@ainyc/canonry 4.15.0 → 4.17.1
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/README.md +57 -223
- package/assets/assets/index-4fWsYFLp.css +1 -0
- package/assets/assets/index-C5-Gvl6o.js +302 -0
- package/assets/index.html +2 -2
- package/dist/{chunk-C32VL5BB.js → chunk-6TWKC3DP.js} +147 -12
- package/dist/{chunk-7HBZCGRL.js → chunk-PAZCY4FF.js} +99 -4
- package/dist/{chunk-6QTH5NS5.js → chunk-Q2OED5JQ.js} +75 -1
- package/dist/{chunk-DLSQXNUN.js → chunk-ZGHD3IAV.js} +485 -150
- package/dist/cli.js +248 -45
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-BCKXIKIL.js → intelligence-service-X3PQLBUV.js} +2 -2
- package/dist/mcp.js +9 -3
- package/package.json +7 -7
- package/assets/assets/index-B6Mi9Fd1.js +0 -302
- package/assets/assets/index-D0EPNRDs.css +0 -1
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
function JH(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 o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).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 ha(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yb={exports:{}},bf={};var xz;function eK(){if(xz)return bf;xz=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+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:o,ref:i!==void 0?i:null,props:a}}return bf.Fragment=t,bf.jsx=n,bf.jsxs=n,bf}var bz;function tK(){return bz||(bz=1,Yb.exports=eK()),Yb.exports}var l=tK(),Zb={exports:{}},it={};var wz;function nK(){if(wz)return it;wz=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"),o=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"),y=Symbol.iterator;function v(I){return I===null||typeof I!="object"?null:(I=y&&I[y]||I["@@iterator"],typeof I=="function"?I:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,j={};function k(I,q,D){this.props=I,this.context=q,this.refs=j,this.updater=D||w}k.prototype.isReactComponent={},k.prototype.setState=function(I,q){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,q,"setState")},k.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function E(){}E.prototype=k.prototype;function C(I,q,D){this.props=I,this.context=q,this.refs=j,this.updater=D||w}var O=C.prototype=new E;O.constructor=C,b(O,k.prototype),O.isPureReactComponent=!0;var _=Array.isArray;function A(){}var z={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function $(I,q,D){var G=D.ref;return{$$typeof:e,type:I,key:q,ref:G!==void 0?G:null,props:D}}function F(I,q){return $(I.type,q,I.props)}function U(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function B(I){var q={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(D){return q[D]})}var V=/\/+/g;function X(I,q){return typeof I=="object"&&I!==null&&I.key!=null?B(""+I.key):q.toString(36)}function W(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(A,A):(I.status="pending",I.then(function(q){I.status==="pending"&&(I.status="fulfilled",I.value=q)},function(q){I.status==="pending"&&(I.status="rejected",I.reason=q)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function H(I,q,D,G,oe){var ne=typeof I;(ne==="undefined"||ne==="boolean")&&(I=null);var Ae=!1;if(I===null)Ae=!0;else switch(ne){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(I.$$typeof){case e:case t:Ae=!0;break;case p:return Ae=I._init,H(Ae(I._payload),q,D,G,oe)}}if(Ae)return oe=oe(I),Ae=G===""?"."+X(I,0):G,_(oe)?(D="",Ae!=null&&(D=Ae.replace(V,"$&/")+"/"),H(oe,q,D,"",function(he){return he})):oe!=null&&(U(oe)&&(oe=F(oe,D+(oe.key==null||I&&I.key===oe.key?"":(""+oe.key).replace(V,"$&/")+"/")+Ae)),q.push(oe)),1;Ae=0;var we=G===""?".":G+":";if(_(I))for(var ee=0;ee<I.length;ee++)G=I[ee],ne=we+X(G,ee),Ae+=H(G,q,D,ne,oe);else if(ee=v(I),typeof ee=="function")for(I=ee.call(I),ee=0;!(G=I.next()).done;)G=G.value,ne=we+X(G,ee++),Ae+=H(G,q,D,ne,oe);else if(ne==="object"){if(typeof I.then=="function")return H(W(I),q,D,G,oe);throw q=String(I),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function J(I,q,D){if(I==null)return I;var G=[],oe=0;return H(I,G,"","",function(ne){return q.call(D,ne,oe++)}),G}function ce(I){if(I._status===-1){var q=I._result;q=q(),q.then(function(D){(I._status===0||I._status===-1)&&(I._status=1,I._result=D)},function(D){(I._status===0||I._status===-1)&&(I._status=2,I._result=D)}),I._status===-1&&(I._status=0,I._result=q)}if(I._status===1)return I._result.default;throw I._result}var xe=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},M={map:J,forEach:function(I,q,D){J(I,function(){q.apply(this,arguments)},D)},count:function(I){var q=0;return J(I,function(){q++}),q},toArray:function(I){return J(I,function(q){return q})||[]},only:function(I){if(!U(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return it.Activity=m,it.Children=M,it.Component=k,it.Fragment=n,it.Profiler=i,it.PureComponent=C,it.StrictMode=r,it.Suspense=d,it.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,it.__COMPILER_RUNTIME={__proto__:null,c:function(I){return z.H.useMemoCache(I)}},it.cache=function(I){return function(){return I.apply(null,arguments)}},it.cacheSignal=function(){return null},it.cloneElement=function(I,q,D){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var G=b({},I.props),oe=I.key;if(q!=null)for(ne in q.key!==void 0&&(oe=""+q.key),q)!R.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 Ae=Array(ne),we=0;we<ne;we++)Ae[we]=arguments[we+2];G.children=Ae}return $(I.type,oe,G)},it.createContext=function(I){return I={$$typeof:o,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:a,_context:I},I},it.createElement=function(I,q,D){var G,oe={},ne=null;if(q!=null)for(G in q.key!==void 0&&(ne=""+q.key),q)R.call(q,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(oe[G]=q[G]);var Ae=arguments.length-2;if(Ae===1)oe.children=D;else if(1<Ae){for(var we=Array(Ae),ee=0;ee<Ae;ee++)we[ee]=arguments[ee+2];oe.children=we}if(I&&I.defaultProps)for(G in Ae=I.defaultProps,Ae)oe[G]===void 0&&(oe[G]=Ae[G]);return $(I,ne,oe)},it.createRef=function(){return{current:null}},it.forwardRef=function(I){return{$$typeof:u,render:I}},it.isValidElement=U,it.lazy=function(I){return{$$typeof:p,_payload:{_status:-1,_result:I},_init:ce}},it.memo=function(I,q){return{$$typeof:f,type:I,compare:q===void 0?null:q}},it.startTransition=function(I){var q=z.T,D={};z.T=D;try{var G=I(),oe=z.S;oe!==null&&oe(D,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(A,xe)}catch(ne){xe(ne)}finally{q!==null&&D.types!==null&&(q.types=D.types),z.T=q}},it.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},it.use=function(I){return z.H.use(I)},it.useActionState=function(I,q,D){return z.H.useActionState(I,q,D)},it.useCallback=function(I,q){return z.H.useCallback(I,q)},it.useContext=function(I){return z.H.useContext(I)},it.useDebugValue=function(){},it.useDeferredValue=function(I,q){return z.H.useDeferredValue(I,q)},it.useEffect=function(I,q){return z.H.useEffect(I,q)},it.useEffectEvent=function(I){return z.H.useEffectEvent(I)},it.useId=function(){return z.H.useId()},it.useImperativeHandle=function(I,q,D){return z.H.useImperativeHandle(I,q,D)},it.useInsertionEffect=function(I,q){return z.H.useInsertionEffect(I,q)},it.useLayoutEffect=function(I,q){return z.H.useLayoutEffect(I,q)},it.useMemo=function(I,q){return z.H.useMemo(I,q)},it.useOptimistic=function(I,q){return z.H.useOptimistic(I,q)},it.useReducer=function(I,q,D){return z.H.useReducer(I,q,D)},it.useRef=function(I){return z.H.useRef(I)},it.useState=function(I){return z.H.useState(I)},it.useSyncExternalStore=function(I,q,D){return z.H.useSyncExternalStore(I,q,D)},it.useTransition=function(){return z.H.useTransition()},it.version="19.2.4",it}var Sz;function cd(){return Sz||(Sz=1,Zb.exports=nK()),Zb.exports}var x=cd();const Ii=ha(x),dv=JH({__proto__:null,default:Ii},[x]);var Wb={exports:{}},wf={},Xb={exports:{}},Jb={};var jz;function rK(){return jz||(jz=1,(function(e){function t(H,J){var ce=H.length;H.push(J);e:for(;0<ce;){var xe=ce-1>>>1,M=H[xe];if(0<i(M,J))H[xe]=J,H[ce]=M,ce=xe;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],ce=H.pop();if(ce!==J){H[0]=ce;e:for(var xe=0,M=H.length,I=M>>>1;xe<I;){var q=2*(xe+1)-1,D=H[q],G=q+1,oe=H[G];if(0>i(D,ce))G<M&&0>i(oe,D)?(H[xe]=oe,H[G]=ce,xe=G):(H[xe]=D,H[q]=ce,xe=q);else if(G<M&&0>i(oe,ce))H[xe]=oe,H[G]=ce,xe=G;else break e}}return J}function i(H,J){var ce=H.sortIndex-J.sortIndex;return ce!==0?ce: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 o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var d=[],f=[],p=1,m=null,y=3,v=!1,w=!1,b=!1,j=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function O(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 _(H){if(b=!1,O(H),!w)if(n(d)!==null)w=!0,A||(A=!0,B());else{var J=n(f);J!==null&&W(_,J.startTime-H)}}var A=!1,z=-1,R=5,$=-1;function F(){return j?!0:!(e.unstable_now()-$<R)}function U(){if(j=!1,A){var H=e.unstable_now();$=H;var J=!0;try{e:{w=!1,b&&(b=!1,E(z),z=-1),v=!0;var ce=y;try{t:{for(O(H),m=n(d);m!==null&&!(m.expirationTime>H&&F());){var xe=m.callback;if(typeof xe=="function"){m.callback=null,y=m.priorityLevel;var M=xe(m.expirationTime<=H);if(H=e.unstable_now(),typeof M=="function"){m.callback=M,O(H),J=!0;break t}m===n(d)&&r(d),O(H)}else r(d);m=n(d)}if(m!==null)J=!0;else{var I=n(f);I!==null&&W(_,I.startTime-H),J=!1}}break e}finally{m=null,y=ce,v=!1}J=void 0}}finally{J?B():A=!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 W(H,J){z=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"):R=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(H){switch(y){case 1:case 2:case 3:var J=3;break;default:J=y}var ce=y;y=J;try{return H()}finally{y=ce}},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 ce=y;y=H;try{return J()}finally{y=ce}},e.unstable_scheduleCallback=function(H,J,ce){var xe=e.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?xe+ce:xe):ce=xe,H){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=ce+M,H={id:p++,callback:J,priorityLevel:H,startTime:ce,expirationTime:M,sortIndex:-1},ce>xe?(H.sortIndex=ce,t(f,H),n(d)===null&&H===n(f)&&(b?(E(z),z=-1):b=!0,W(_,ce-xe))):(H.sortIndex=M,t(d,H),w||v||(w=!0,A||(A=!0,B()))),H},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(H){var J=y;return function(){var ce=y;y=J;try{return H.apply(this,arguments)}finally{y=ce}}}})(Jb)),Jb}var Nz;function iK(){return Nz||(Nz=1,Xb.exports=rK()),Xb.exports}var ew={exports:{}},ur={};var kz;function aK(){if(kz)return ur;kz=1;var e=cd();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 o=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 ur.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ur.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)},ur.flushSync=function(d){var f=o.T,p=r.p;try{if(o.T=null,r.p=2,d)return d()}finally{o.T=f,r.p=p,r.d.f()}},ur.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))},ur.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},ur.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,m=u(p,f.crossOrigin),y=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:y,fetchPriority:v}):p==="script"&&r.d.X(d,{crossOrigin:m,integrity:y,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},ur.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)},ur.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})}},ur.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)},ur.requestFormReset=function(d){r.d.r(d)},ur.unstable_batchedUpdates=function(d,f){return d(f)},ur.useFormState=function(d,f,p){return o.H.useFormState(d,f,p)},ur.useFormStatus=function(){return o.H.useHostTransitionStatus()},ur.version="19.2.4",ur}var Cz;function OL(){if(Cz)return ew.exports;Cz=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(),ew.exports=aK(),ew.exports}var Az;function sK(){if(Az)return wf;Az=1;var e=iK(),t=cd(),n=OL();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 o(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,g=c;;){var S=h.return;if(S===null)break;var N=S.alternate;if(N===null){if(g=S.return,g!==null){h=g;continue}break}if(S.child===N.child){for(N=S.child;N;){if(N===h)return d(S),s;if(N===g)return d(S),c;N=N.sibling}throw Error(r(188))}if(h.return!==g.return)h=S,g=N;else{for(var T=!1,L=S.child;L;){if(L===h){T=!0,h=S,g=N;break}if(L===g){T=!0,g=S,h=N;break}L=L.sibling}if(!T){for(L=N.child;L;){if(L===h){T=!0,h=N,g=S;break}if(L===g){T=!0,g=N,h=S;break}L=L.sibling}if(!T)throw Error(r(189))}}if(h.alternate!==g)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,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=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"),O=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),R=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 _:return"Suspense";case A:return"SuspenseList";case $:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case w:return"Portal";case C:return s.displayName||"Context";case E:return(s._context.displayName||"Context")+".Consumer";case O:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case z:return c=s.displayName||null,c!==null?c:X(s.type)||"Memo";case R:c=s._payload,s=s._init;try{return X(s(c))}catch{}}return null}var W=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,ce={pending:!1,data:null,method:null,action:null},xe=[],M=-1;function I(s){return{current:s}}function q(s){0>M||(s.current=xe[M],xe[M]=null,M--)}function D(s,c){M++,xe[M]=s.current,s.current=c}var G=I(null),oe=I(null),ne=I(null),Ae=I(null);function we(s,c){switch(D(ne,c),D(oe,s),D(G,null),c.nodeType){case 9:case 11:s=(s=c.documentElement)&&(s=s.namespaceURI)?q_(s):0;break;default:if(s=c.tagName,c=c.namespaceURI)c=q_(c),s=F_(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(oe),q(ne)}function he(s){s.memoizedState!==null&&D(Ae,s);var c=G.current,h=F_(c,s.type);c!==h&&(D(oe,s),D(G,h))}function _e(s){oe.current===s&&(q(G),q(oe)),Ae.current===s&&(q(Ae),gf._currentValue=ce)}var Z,Fe;function Re(s){if(Z===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);Z=c&&c[1]||"",Fe=-1<h.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Z+s+Fe}var st=!1;function Ke(s,c){if(!s||st)return"";st=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(c){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(fe){var le=fe}Reflect.construct(s,[],ve)}else{try{ve.call()}catch(fe){le=fe}s.call(ve.prototype)}}else{try{throw Error()}catch(fe){le=fe}(ve=s())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(fe){if(fe&&le&&typeof fe.stack=="string")return[fe.stack,le.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var S=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");S&&S.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=g.DetermineComponentFrameRoot(),T=N[0],L=N[1];if(T&&L){var K=T.split(`
|
|
4
|
+
`),ie=L.split(`
|
|
5
|
+
`);for(S=g=0;g<K.length&&!K[g].includes("DetermineComponentFrameRoot");)g++;for(;S<ie.length&&!ie[S].includes("DetermineComponentFrameRoot");)S++;if(g===K.length||S===ie.length)for(g=K.length-1,S=ie.length-1;1<=g&&0<=S&&K[g]!==ie[S];)S--;for(;1<=g&&0<=S;g--,S--)if(K[g]!==ie[S]){if(g!==1||S!==1)do if(g--,S--,0>S||K[g]!==ie[S]){var pe=`
|
|
6
|
+
`+K[g].replace(" at new "," at ");return s.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",s.displayName)),pe}while(1<=g&&0<=S);break}}}finally{st=!1,Error.prepareStackTrace=h}return(h=s?s.displayName||s.name:"")?Re(h):""}function Kt(s,c){switch(s.tag){case 26:case 27:case 5:return Re(s.type);case 16:return Re("Lazy");case 13:return s.child!==c&&c!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return Ke(s.type,!1);case 11:return Ke(s.type.render,!1);case 1:return Ke(s.type,!0);case 31:return Re("Activity");default:return""}}function Bt(s){try{var c="",h=null;do c+=Kt(s,h),h=s,s=s.return;while(s);return c}catch(g){return`
|
|
7
|
+
Error generating stack: `+g.message+`
|
|
8
|
+
`+g.stack}}var on=Object.prototype.hasOwnProperty,en=e.unstable_scheduleCallback,be=e.unstable_cancelCallback,Ze=e.unstable_shouldYield,Dt=e.unstable_requestPaint,yt=e.unstable_now,We=e.unstable_getCurrentPriorityLevel,ue=e.unstable_ImmediatePriority,je=e.unstable_UserBlockingPriority,Ie=e.unstable_NormalPriority,Ve=e.unstable_LowPriority,ct=e.unstable_IdlePriority,fn=e.log,Vn=e.unstable_setDisableYieldValue,xn=null,Qe=null;function kn(s){if(typeof fn=="function"&&Vn(s),Qe&&typeof Qe.setStrictMode=="function")try{Qe.setStrictMode(xn,s)}catch{}}var Xe=Math.clz32?Math.clz32:kr,ot=Math.log,ke=Math.LN2;function kr(s){return s>>>=0,s===0?32:31-(ot(s)/ke|0)|0}var vi=256,va=262144,Cr=4194304;function Se(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 tt(s,c,h){var g=s.pendingLanes;if(g===0)return 0;var S=0,N=s.suspendedLanes,T=s.pingedLanes;s=s.warmLanes;var L=g&134217727;return L!==0?(g=L&~N,g!==0?S=Se(g):(T&=L,T!==0?S=Se(T):h||(h=L&~s,h!==0&&(S=Se(h))))):(L=g&~N,L!==0?S=Se(L):T!==0?S=Se(T):h||(h=g&~s,h!==0&&(S=Se(h)))),S===0?0:c!==0&&c!==S&&(c&N)===0&&(N=S&-S,h=c&-c,N>=h||N===32&&(h&4194048)!==0)?c:S}function Je(s,c){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&c)===0}function rt(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 ri(){var s=Cr;return Cr<<=1,(Cr&62914560)===0&&(Cr=4194304),s}function xi(s){for(var c=[],h=0;31>h;h++)c.push(s);return c}function Yt(s,c){s.pendingLanes|=c,c!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function bi(s,c,h,g,S,N){var T=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,ie=s.hiddenUpdates;for(h=T&~h;0<h;){var pe=31-Xe(h),ve=1<<pe;L[pe]=0,K[pe]=-1;var le=ie[pe];if(le!==null)for(ie[pe]=null,pe=0;pe<le.length;pe++){var fe=le[pe];fe!==null&&(fe.lane&=-536870913)}h&=~ve}g!==0&&xa(s,g,0),N!==0&&S===0&&s.tag!==0&&(s.suspendedLanes|=N&~(T&~c))}function xa(s,c,h){s.pendingLanes|=c,s.suspendedLanes&=~c;var g=31-Xe(c);s.entangledLanes|=c,s.entanglements[g]=s.entanglements[g]|1073741824|h&261930}function Yo(s,c){var h=s.entangledLanes|=c;for(s=s.entanglements;h;){var g=31-Xe(h),S=1<<g;S&c|s[g]&c&&(s[g]|=c),h&=~S}}function ba(s,c){var h=c&-c;return h=(h&42)!==0?1:Ed(h),(h&(s.suspendedLanes|c))!==0?0:h}function Ed(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 _d(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function zd(){var s=J.p;return s!==0?s:(s=window.event,s===void 0?32:fz(s.type))}function Q(s,c){var h=J.p;try{return J.p=s,c()}finally{J.p=h}}var Ne=Math.random().toString(36).slice(2),nt="__reactFiber$"+Ne,Ct="__reactProps$"+Ne,Cn="__reactContainer$"+Ne,wa="__reactEvents$"+Ne,Qa="__reactListeners$"+Ne,$s="__reactHandles$"+Ne,Ar="__reactResources$"+Ne,Zo="__reactMarker$"+Ne;function Sa(s){delete s[nt],delete s[Ct],delete s[wa],delete s[Qa],delete s[$s]}function wi(s){var c=s[nt];if(c)return c;for(var h=s.parentNode;h;){if(c=h[Cn]||h[nt]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(s=Z_(s);s!==null;){if(h=s[nt])return h;s=Z_(s)}return c}s=h,h=s.parentNode}return null}function Wi(s){if(s=s[nt]||s[Cn]){var c=s.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return s}return null}function Bs(s){var c=s.tag;if(c===5||c===26||c===27||c===6)return s.stateNode;throw Error(r(33))}function Us(s){var c=s[Ar];return c||(c=s[Ar]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function hn(s){s[Zo]=!0}var Wo=new Set,pp={};function Ya(s,c){ht(s,c),ht(s+"Capture",c)}function ht(s,c){for(pp[s]=c,s=0;s<c.length;s++)Wo.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={},Xi={};function Sc(s){return on.call(Xi,s)?!0:on.call($r,s)?!1:Gt.test(s)?Xi[s]=!0:($r[s]=!0,!1)}function Xo(s,c,h){if(Sc(c))if(h===null)s.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":s.removeAttribute(c);return;case"boolean":var g=c.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(c);return}}s.setAttribute(c,""+h)}}function mp(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 Za(s,c,h,g){if(g===null)s.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(h);return}s.setAttributeNS(c,h,""+g)}}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 RA(s){var c=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function GF(s,c,h){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,c);if(!s.hasOwnProperty(c)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var S=g.get,N=g.set;return Object.defineProperty(s,c,{configurable:!0,get:function(){return S.call(this)},set:function(T){h=""+T,N.call(this,T)}}),Object.defineProperty(s,c,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(T){h=""+T},stopTracking:function(){s._valueTracker=null,delete s[c]}}}}function q0(s){if(!s._valueTracker){var c=RA(s)?"checked":"value";s._valueTracker=GF(s,c,""+s[c])}}function DA(s){if(!s)return!1;var c=s._valueTracker;if(!c)return!0;var h=c.getValue(),g="";return s&&(g=RA(s)?s.checked?"true":"false":s.value),s=g,s!==h?(c.setValue(s),!0):!1}function gp(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 VF=/[\n"\\]/g;function ji(s){return s.replace(VF,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function F0(s,c,h,g,S,N,T,L){s.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?s.type=T:s.removeAttribute("type"),c!=null?T==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+Si(c)):s.value!==""+Si(c)&&(s.value=""+Si(c)):T!=="submit"&&T!=="reset"||s.removeAttribute("value"),c!=null?H0(s,T,Si(c)):h!=null?H0(s,T,Si(h)):g!=null&&s.removeAttribute("value"),S==null&&N!=null&&(s.defaultChecked=!!N),S!=null&&(s.checked=S&&typeof S!="function"&&typeof S!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?s.name=""+Si(L):s.removeAttribute("name")}function MA(s,c,h,g,S,N,T,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)){q0(s);return}h=h!=null?""+Si(h):"",c=c!=null?""+Si(c):h,L||c===s.value||(s.value=c),s.defaultValue=c}g=g??S,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=L?s.checked:!!g,s.defaultChecked=!!g,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(s.name=T),q0(s)}function H0(s,c,h){c==="number"&&gp(s.ownerDocument)===s||s.defaultValue===""+h||(s.defaultValue=""+h)}function jc(s,c,h,g){if(s=s.options,c){c={};for(var S=0;S<h.length;S++)c["$"+h[S]]=!0;for(h=0;h<s.length;h++)S=c.hasOwnProperty("$"+s[h].value),s[h].selected!==S&&(s[h].selected=S),S&&g&&(s[h].defaultSelected=!0)}else{for(h=""+Si(h),c=null,S=0;S<s.length;S++){if(s[S].value===h){s[S].selected=!0,g&&(s[S].defaultSelected=!0);return}c!==null||s[S].disabled||(c=s[S])}c!==null&&(c.selected=!0)}}function IA(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 LA(s,c,h,g){if(c==null){if(g!=null){if(h!=null)throw Error(r(92));if(W(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),c=h}h=Si(c),s.defaultValue=h,g=s.textContent,g===h&&g!==""&&g!==null&&(s.value=g),q0(s)}function Nc(s,c){if(c){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=c;return}}s.textContent=c}var QF=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 $A(s,c,h){var g=c.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?s.setProperty(c,""):c==="float"?s.cssFloat="":s[c]="":g?s.setProperty(c,h):typeof h!="number"||h===0||QF.has(c)?c==="float"?s.cssFloat=h:s[c]=(""+h).trim():s[c]=h+"px"}function BA(s,c,h){if(c!=null&&typeof c!="object")throw Error(r(62));if(s=s.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||c!=null&&c.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var S in c)g=c[S],c.hasOwnProperty(S)&&h[S]!==g&&$A(s,S,g)}else for(var N in c)c.hasOwnProperty(N)&&$A(s,N,c[N])}function K0(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 YF=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"]]),ZF=/^[\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 yp(s){return ZF.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Wa(){}var G0=null;function V0(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var kc=null,Cc=null;function UA(s){var c=Wi(s);if(c&&(s=c.stateNode)){var h=s[Ct]||null;e:switch(s=c.stateNode,c.type){case"input":if(F0(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 g=h[c];if(g!==s&&g.form===s.form){var S=g[Ct]||null;if(!S)throw Error(r(90));F0(g,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name)}}for(c=0;c<h.length;c++)g=h[c],g.form===s.form&&DA(g)}break e;case"textarea":IA(s,h.value,h.defaultValue);break e;case"select":c=h.value,c!=null&&jc(s,!!h.multiple,c,!1)}}}var Q0=!1;function qA(s,c,h){if(Q0)return s(c,h);Q0=!0;try{var g=s(c);return g}finally{if(Q0=!1,(kc!==null||Cc!==null)&&(im(),kc&&(c=kc,s=Cc,Cc=kc=null,UA(c),s)))for(c=0;c<s.length;c++)UA(s[c])}}function Td(s,c){var h=s.stateNode;if(h===null)return null;var g=h[Ct]||null;if(g===null)return null;h=g[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":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(h&&typeof h!="function")throw Error(r(231,c,typeof h));return h}var Xa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Y0=!1;if(Xa)try{var Pd={};Object.defineProperty(Pd,"passive",{get:function(){Y0=!0}}),window.addEventListener("test",Pd,Pd),window.removeEventListener("test",Pd,Pd)}catch{Y0=!1}var qs=null,Z0=null,vp=null;function FA(){if(vp)return vp;var s,c=Z0,h=c.length,g,S="value"in qs?qs.value:qs.textContent,N=S.length;for(s=0;s<h&&c[s]===S[s];s++);var T=h-s;for(g=1;g<=T&&c[h-g]===S[N-g];g++);return vp=S.slice(s,1<g?1-g:void 0)}function xp(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 bp(){return!0}function HA(){return!1}function Br(s){function c(h,g,S,N,T){this._reactName=h,this._targetInst=S,this.type=g,this.nativeEvent=N,this.target=T,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)?bp:HA,this.isPropagationStopped=HA,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=bp)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=bp)},persist:function(){},isPersistent:bp}),c}var Jo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wp=Br(Jo),Rd=m({},Jo,{view:0,detail:0}),WF=Br(Rd),W0,X0,Dd,Sp=m({},Rd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ex,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!==Dd&&(Dd&&s.type==="mousemove"?(W0=s.screenX-Dd.screenX,X0=s.screenY-Dd.screenY):X0=W0=0,Dd=s),W0)},movementY:function(s){return"movementY"in s?s.movementY:X0}}),KA=Br(Sp),XF=m({},Sp,{dataTransfer:0}),JF=Br(XF),e9=m({},Rd,{relatedTarget:0}),J0=Br(e9),t9=m({},Jo,{animationName:0,elapsedTime:0,pseudoElement:0}),n9=Br(t9),r9=m({},Jo,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),i9=Br(r9),a9=m({},Jo,{data:0}),GA=Br(a9),s9={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},o9={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"},l9={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function c9(s){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(s):(s=l9[s])?!!c[s]:!1}function ex(){return c9}var u9=m({},Rd,{key:function(s){if(s.key){var c=s9[s.key]||s.key;if(c!=="Unidentified")return c}return s.type==="keypress"?(s=xp(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?o9[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ex,charCode:function(s){return s.type==="keypress"?xp(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?xp(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),d9=Br(u9),f9=m({},Sp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),VA=Br(f9),h9=m({},Rd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ex}),p9=Br(h9),m9=m({},Jo,{propertyName:0,elapsedTime:0,pseudoElement:0}),g9=Br(m9),y9=m({},Sp,{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}),v9=Br(y9),x9=m({},Jo,{newState:0,oldState:0}),b9=Br(x9),w9=[9,13,27,32],tx=Xa&&"CompositionEvent"in window,Md=null;Xa&&"documentMode"in document&&(Md=document.documentMode);var S9=Xa&&"TextEvent"in window&&!Md,QA=Xa&&(!tx||Md&&8<Md&&11>=Md),YA=" ",ZA=!1;function WA(s,c){switch(s){case"keyup":return w9.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function XA(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Ac=!1;function j9(s,c){switch(s){case"compositionend":return XA(c);case"keypress":return c.which!==32?null:(ZA=!0,YA);case"textInput":return s=c.data,s===YA&&ZA?null:s;default:return null}}function N9(s,c){if(Ac)return s==="compositionend"||!tx&&WA(s,c)?(s=FA(),vp=Z0=qs=null,Ac=!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 QA&&c.locale!=="ko"?null:c.data;default:return null}}var k9={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 JA(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c==="input"?!!k9[s.type]:c==="textarea"}function eO(s,c,h,g){kc?Cc?Cc.push(g):Cc=[g]:kc=g,c=dm(c,"onChange"),0<c.length&&(h=new wp("onChange","change",null,h,g),s.push({event:h,listeners:c}))}var Id=null,Ld=null;function C9(s){M_(s,0)}function jp(s){var c=Bs(s);if(DA(c))return s}function tO(s,c){if(s==="change")return c}var nO=!1;if(Xa){var nx;if(Xa){var rx="oninput"in document;if(!rx){var rO=document.createElement("div");rO.setAttribute("oninput","return;"),rx=typeof rO.oninput=="function"}nx=rx}else nx=!1;nO=nx&&(!document.documentMode||9<document.documentMode)}function iO(){Id&&(Id.detachEvent("onpropertychange",aO),Ld=Id=null)}function aO(s){if(s.propertyName==="value"&&jp(Ld)){var c=[];eO(c,Ld,s,V0(s)),qA(C9,c)}}function A9(s,c,h){s==="focusin"?(iO(),Id=c,Ld=h,Id.attachEvent("onpropertychange",aO)):s==="focusout"&&iO()}function O9(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return jp(Ld)}function E9(s,c){if(s==="click")return jp(c)}function _9(s,c){if(s==="input"||s==="change")return jp(c)}function z9(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var ii=typeof Object.is=="function"?Object.is:z9;function $d(s,c){if(ii(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var h=Object.keys(s),g=Object.keys(c);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var S=h[g];if(!on.call(c,S)||!ii(s[S],c[S]))return!1}return!0}function sO(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function oO(s,c){var h=sO(s);s=0;for(var g;h;){if(h.nodeType===3){if(g=s+h.textContent.length,s<=c&&g>=c)return{node:h,offset:c-s};s=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=sO(h)}}function lO(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?lO(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function cO(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var c=gp(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=gp(s.document)}return c}function ix(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 T9=Xa&&"documentMode"in document&&11>=document.documentMode,Oc=null,ax=null,Bd=null,sx=!1;function uO(s,c,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;sx||Oc==null||Oc!==gp(g)||(g=Oc,"selectionStart"in g&&ix(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Bd&&$d(Bd,g)||(Bd=g,g=dm(ax,"onSelect"),0<g.length&&(c=new wp("onSelect","select",null,c,h),s.push({event:c,listeners:g}),c.target=Oc)))}function el(s,c){var h={};return h[s.toLowerCase()]=c.toLowerCase(),h["Webkit"+s]="webkit"+c,h["Moz"+s]="moz"+c,h}var Ec={animationend:el("Animation","AnimationEnd"),animationiteration:el("Animation","AnimationIteration"),animationstart:el("Animation","AnimationStart"),transitionrun:el("Transition","TransitionRun"),transitionstart:el("Transition","TransitionStart"),transitioncancel:el("Transition","TransitionCancel"),transitionend:el("Transition","TransitionEnd")},ox={},dO={};Xa&&(dO=document.createElement("div").style,"AnimationEvent"in window||(delete Ec.animationend.animation,delete Ec.animationiteration.animation,delete Ec.animationstart.animation),"TransitionEvent"in window||delete Ec.transitionend.transition);function tl(s){if(ox[s])return ox[s];if(!Ec[s])return s;var c=Ec[s],h;for(h in c)if(c.hasOwnProperty(h)&&h in dO)return ox[s]=c[h];return s}var fO=tl("animationend"),hO=tl("animationiteration"),pO=tl("animationstart"),P9=tl("transitionrun"),R9=tl("transitionstart"),D9=tl("transitioncancel"),mO=tl("transitionend"),gO=new Map,lx="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(" ");lx.push("scrollEnd");function Ji(s,c){gO.set(s,c),Ya(c,[s])}var Np=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=[],_c=0,cx=0;function kp(){for(var s=_c,c=cx=_c=0;c<s;){var h=Ni[c];Ni[c++]=null;var g=Ni[c];Ni[c++]=null;var S=Ni[c];Ni[c++]=null;var N=Ni[c];if(Ni[c++]=null,g!==null&&S!==null){var T=g.pending;T===null?S.next=S:(S.next=T.next,T.next=S),g.pending=S}N!==0&&yO(h,S,N)}}function Cp(s,c,h,g){Ni[_c++]=s,Ni[_c++]=c,Ni[_c++]=h,Ni[_c++]=g,cx|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function ux(s,c,h,g){return Cp(s,c,h,g),Ap(s)}function nl(s,c){return Cp(s,null,null,c),Ap(s)}function yO(s,c,h){s.lanes|=h;var g=s.alternate;g!==null&&(g.lanes|=h);for(var S=!1,N=s.return;N!==null;)N.childLanes|=h,g=N.alternate,g!==null&&(g.childLanes|=h),N.tag===22&&(s=N.stateNode,s===null||s._visibility&1||(S=!0)),s=N,N=N.return;return s.tag===3?(N=s.stateNode,S&&c!==null&&(S=31-Xe(h),s=N.hiddenUpdates,g=s[S],g===null?s[S]=[c]:g.push(c),c.lane=h|536870912),N):null}function Ap(s){if(50<cf)throw cf=0,xb=null,Error(r(185));for(var c=s.return;c!==null;)s=c,c=s.return;return s.tag===3?s.stateNode:null}var zc={};function M9(s,c,h,g){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=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(s,c,h,g){return new M9(s,c,h,g)}function dx(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Ja(s,c){var h=s.alternate;return h===null?(h=ai(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 vO(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 Op(s,c,h,g,S,N){var T=0;if(g=s,typeof s=="function")dx(s)&&(T=1);else if(typeof s=="string")T=UH(s,h,G.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case $:return s=ai(31,h,c,S),s.elementType=$,s.lanes=N,s;case b:return rl(h.children,S,N,c);case j:T=8,S|=24;break;case k:return s=ai(12,h,c,S|2),s.elementType=k,s.lanes=N,s;case _:return s=ai(13,h,c,S),s.elementType=_,s.lanes=N,s;case A:return s=ai(19,h,c,S),s.elementType=A,s.lanes=N,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case C:T=10;break e;case E:T=9;break e;case O:T=11;break e;case z:T=14;break e;case R:T=16,g=null;break e}T=29,h=Error(r(130,s===null?"null":typeof s,"")),g=null}return c=ai(T,h,c,S),c.elementType=s,c.type=g,c.lanes=N,c}function rl(s,c,h,g){return s=ai(7,s,g,c),s.lanes=h,s}function fx(s,c,h){return s=ai(6,s,null,c),s.lanes=h,s}function xO(s){var c=ai(18,null,null,0);return c.stateNode=s,c}function hx(s,c,h){return c=ai(4,s.children!==null?s.children:[],s.key,c),c.lanes=h,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}var bO=new WeakMap;function ki(s,c){if(typeof s=="object"&&s!==null){var h=bO.get(s);return h!==void 0?h:(c={value:s,source:c,stack:Bt(c)},bO.set(s,c),c)}return{value:s,source:c,stack:Bt(c)}}var Tc=[],Pc=0,Ep=null,Ud=0,Ci=[],Ai=0,Fs=null,ja=1,Na="";function es(s,c){Tc[Pc++]=Ud,Tc[Pc++]=Ep,Ep=s,Ud=c}function wO(s,c,h){Ci[Ai++]=ja,Ci[Ai++]=Na,Ci[Ai++]=Fs,Fs=s;var g=ja;s=Na;var S=32-Xe(g)-1;g&=~(1<<S),h+=1;var N=32-Xe(c)+S;if(30<N){var T=S-S%5;N=(g&(1<<T)-1).toString(32),g>>=T,S-=T,ja=1<<32-Xe(c)+S|h<<S|g,Na=N+s}else ja=1<<N|h<<S|g,Na=s}function px(s){s.return!==null&&(es(s,1),wO(s,1,0))}function mx(s){for(;s===Ep;)Ep=Tc[--Pc],Tc[Pc]=null,Ud=Tc[--Pc],Tc[Pc]=null;for(;s===Fs;)Fs=Ci[--Ai],Ci[Ai]=null,Na=Ci[--Ai],Ci[Ai]=null,ja=Ci[--Ai],Ci[Ai]=null}function SO(s,c){Ci[Ai++]=ja,Ci[Ai++]=Na,Ci[Ai++]=Fs,ja=c.id,Na=c.overflow,Fs=s}var tr=null,tn=null,Nt=!1,Hs=null,Oi=!1,gx=Error(r(519));function Ks(s){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qd(ki(c,s)),gx}function jO(s){var c=s.stateNode,h=s.type,g=s.memoizedProps;switch(c[nt]=s,c[Ct]=g,h){case"dialog":xt("cancel",c),xt("close",c);break;case"iframe":case"object":case"embed":xt("load",c);break;case"video":case"audio":for(h=0;h<df.length;h++)xt(df[h],c);break;case"source":xt("error",c);break;case"img":case"image":case"link":xt("error",c),xt("load",c);break;case"details":xt("toggle",c);break;case"input":xt("invalid",c),MA(c,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":xt("invalid",c);break;case"textarea":xt("invalid",c),LA(c,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||c.textContent===""+h||g.suppressHydrationWarning===!0||B_(c.textContent,h)?(g.popover!=null&&(xt("beforetoggle",c),xt("toggle",c)),g.onScroll!=null&&xt("scroll",c),g.onScrollEnd!=null&&xt("scrollend",c),g.onClick!=null&&(c.onclick=Wa),c=!0):c=!1,c||Ks(s,!0)}function NO(s){for(tr=s.return;tr;)switch(tr.tag){case 5:case 31:case 13:Oi=!1;return;case 27:case 3:Oi=!0;return;default:tr=tr.return}}function Rc(s){if(s!==tr)return!1;if(!Nt)return NO(s),Nt=!0,!1;var c=s.tag,h;if((h=c!==3&&c!==27)&&((h=c===5)&&(h=s.type,h=!(h!=="form"&&h!=="button")||Rb(s.type,s.memoizedProps)),h=!h),h&&tn&&Ks(s),NO(s),c===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));tn=Y_(s)}else if(c===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));tn=Y_(s)}else c===27?(c=tn,ao(s.type)?(s=$b,$b=null,tn=s):tn=c):tn=tr?_i(s.stateNode.nextSibling):null;return!0}function il(){tn=tr=null,Nt=!1}function yx(){var s=Hs;return s!==null&&(Hr===null?Hr=s:Hr.push.apply(Hr,s),Hs=null),s}function qd(s){Hs===null?Hs=[s]:Hs.push(s)}var vx=I(null),al=null,ts=null;function Gs(s,c,h){D(vx,c._currentValue),c._currentValue=h}function ns(s){s._currentValue=vx.current,q(vx)}function xx(s,c,h){for(;s!==null;){var g=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,g!==null&&(g.childLanes|=c)):g!==null&&(g.childLanes&c)!==c&&(g.childLanes|=c),s===h)break;s=s.return}}function bx(s,c,h,g){var S=s.child;for(S!==null&&(S.return=s);S!==null;){var N=S.dependencies;if(N!==null){var T=S.child;N=N.firstContext;e:for(;N!==null;){var L=N;N=S;for(var K=0;K<c.length;K++)if(L.context===c[K]){N.lanes|=h,L=N.alternate,L!==null&&(L.lanes|=h),xx(N.return,h,s),g||(T=null);break e}N=L.next}}else if(S.tag===18){if(T=S.return,T===null)throw Error(r(341));T.lanes|=h,N=T.alternate,N!==null&&(N.lanes|=h),xx(T,h,s),T=null}else T=S.child;if(T!==null)T.return=S;else for(T=S;T!==null;){if(T===s){T=null;break}if(S=T.sibling,S!==null){S.return=T.return,T=S;break}T=T.return}S=T}}function Dc(s,c,h,g){s=null;for(var S=c,N=!1;S!==null;){if(!N){if((S.flags&524288)!==0)N=!0;else if((S.flags&262144)!==0)break}if(S.tag===10){var T=S.alternate;if(T===null)throw Error(r(387));if(T=T.memoizedProps,T!==null){var L=S.type;ii(S.pendingProps.value,T.value)||(s!==null?s.push(L):s=[L])}}else if(S===Ae.current){if(T=S.alternate,T===null)throw Error(r(387));T.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(s!==null?s.push(gf):s=[gf])}S=S.return}s!==null&&bx(c,s,h,g),c.flags|=262144}function _p(s){for(s=s.firstContext;s!==null;){if(!ii(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function sl(s){al=s,ts=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function nr(s){return kO(al,s)}function zp(s,c){return al===null&&sl(s),kO(s,c)}function kO(s,c){var h=c._currentValue;if(c={context:c,memoizedValue:h,next:null},ts===null){if(s===null)throw Error(r(308));ts=c,s.dependencies={lanes:0,firstContext:c},s.flags|=524288}else ts=ts.next=c;return h}var I9=typeof AbortController<"u"?AbortController:function(){var s=[],c=this.signal={aborted:!1,addEventListener:function(h,g){s.push(g)}};this.abort=function(){c.aborted=!0,s.forEach(function(h){return h()})}},L9=e.unstable_scheduleCallback,$9=e.unstable_NormalPriority,Pn={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wx(){return{controller:new I9,data:new Map,refCount:0}}function Fd(s){s.refCount--,s.refCount===0&&L9($9,function(){s.controller.abort()})}var Hd=null,Sx=0,Mc=0,Ic=null;function B9(s,c){if(Hd===null){var h=Hd=[];Sx=0,Mc=kb(),Ic={status:"pending",value:void 0,then:function(g){h.push(g)}}}return Sx++,c.then(CO,CO),c}function CO(){if(--Sx===0&&Hd!==null){Ic!==null&&(Ic.status="fulfilled");var s=Hd;Hd=null,Mc=0,Ic=null;for(var c=0;c<s.length;c++)(0,s[c])()}}function U9(s,c){var h=[],g={status:"pending",value:null,reason:null,then:function(S){h.push(S)}};return s.then(function(){g.status="fulfilled",g.value=c;for(var S=0;S<h.length;S++)(0,h[S])(c)},function(S){for(g.status="rejected",g.reason=S,S=0;S<h.length;S++)(0,h[S])(void 0)}),g}var AO=H.S;H.S=function(s,c){u_=yt(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&B9(s,c),AO!==null&&AO(s,c)};var ol=I(null);function jx(){var s=ol.current;return s!==null?s:Vt.pooledCache}function Tp(s,c){c===null?D(ol,ol.current):D(ol,c.pool)}function OO(){var s=jx();return s===null?null:{parent:Pn._currentValue,pool:s}}var Lc=Error(r(460)),Nx=Error(r(474)),Pp=Error(r(542)),Rp={then:function(){}};function EO(s){return s=s.status,s==="fulfilled"||s==="rejected"}function _O(s,c,h){switch(h=s[h],h===void 0?s.push(c):h!==c&&(c.then(Wa,Wa),c=h),c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,TO(s),s;default:if(typeof c.status=="string")c.then(Wa,Wa);else{if(s=Vt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=c,s.status="pending",s.then(function(g){if(c.status==="pending"){var S=c;S.status="fulfilled",S.value=g}},function(g){if(c.status==="pending"){var S=c;S.status="rejected",S.reason=g}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw s=c.reason,TO(s),s}throw cl=c,Lc}}function ll(s){try{var c=s._init;return c(s._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(cl=h,Lc):h}}var cl=null;function zO(){if(cl===null)throw Error(r(459));var s=cl;return cl=null,s}function TO(s){if(s===Lc||s===Pp)throw Error(r(483))}var $c=null,Kd=0;function Dp(s){var c=Kd;return Kd+=1,$c===null&&($c=[]),_O($c,s,c)}function Gd(s,c){c=c.props.ref,s.ref=c!==void 0?c:null}function Mp(s,c){throw c.$$typeof===y?Error(r(525)):(s=Object.prototype.toString.call(c),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s)))}function PO(s){function c(te,Y){if(s){var re=te.deletions;re===null?(te.deletions=[Y],te.flags|=16):re.push(Y)}}function h(te,Y){if(!s)return null;for(;Y!==null;)c(te,Y),Y=Y.sibling;return null}function g(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 S(te,Y){return te=Ja(te,Y),te.index=0,te.sibling=null,te}function N(te,Y,re){return te.index=re,s?(re=te.alternate,re!==null?(re=re.index,re<Y?(te.flags|=67108866,Y):re):(te.flags|=67108866,Y)):(te.flags|=1048576,Y)}function T(te){return s&&te.alternate===null&&(te.flags|=67108866),te}function L(te,Y,re,ye){return Y===null||Y.tag!==6?(Y=fx(re,te.mode,ye),Y.return=te,Y):(Y=S(Y,re),Y.return=te,Y)}function K(te,Y,re,ye){var He=re.type;return He===b?pe(te,Y,re.props.children,ye,re.key):Y!==null&&(Y.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===R&&ll(He)===Y.type)?(Y=S(Y,re.props),Gd(Y,re),Y.return=te,Y):(Y=Op(re.type,re.key,re.props,null,te.mode,ye),Gd(Y,re),Y.return=te,Y)}function ie(te,Y,re,ye){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==re.containerInfo||Y.stateNode.implementation!==re.implementation?(Y=hx(re,te.mode,ye),Y.return=te,Y):(Y=S(Y,re.children||[]),Y.return=te,Y)}function pe(te,Y,re,ye,He){return Y===null||Y.tag!==7?(Y=rl(re,te.mode,ye,He),Y.return=te,Y):(Y=S(Y,re),Y.return=te,Y)}function ve(te,Y,re){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=fx(""+Y,te.mode,re),Y.return=te,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case v:return re=Op(Y.type,Y.key,Y.props,null,te.mode,re),Gd(re,Y),re.return=te,re;case w:return Y=hx(Y,te.mode,re),Y.return=te,Y;case R:return Y=ll(Y),ve(te,Y,re)}if(W(Y)||B(Y))return Y=rl(Y,te.mode,re,null),Y.return=te,Y;if(typeof Y.then=="function")return ve(te,Dp(Y),re);if(Y.$$typeof===C)return ve(te,zp(te,Y),re);Mp(te,Y)}return null}function le(te,Y,re,ye){var He=Y!==null?Y.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return He!==null?null:L(te,Y,""+re,ye);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case v:return re.key===He?K(te,Y,re,ye):null;case w:return re.key===He?ie(te,Y,re,ye):null;case R:return re=ll(re),le(te,Y,re,ye)}if(W(re)||B(re))return He!==null?null:pe(te,Y,re,ye,null);if(typeof re.then=="function")return le(te,Y,Dp(re),ye);if(re.$$typeof===C)return le(te,Y,zp(te,re),ye);Mp(te,re)}return null}function fe(te,Y,re,ye,He){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return te=te.get(re)||null,L(Y,te,""+ye,He);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case v:return te=te.get(ye.key===null?re:ye.key)||null,K(Y,te,ye,He);case w:return te=te.get(ye.key===null?re:ye.key)||null,ie(Y,te,ye,He);case R:return ye=ll(ye),fe(te,Y,re,ye,He)}if(W(ye)||B(ye))return te=te.get(re)||null,pe(Y,te,ye,He,null);if(typeof ye.then=="function")return fe(te,Y,re,Dp(ye),He);if(ye.$$typeof===C)return fe(te,Y,re,zp(Y,ye),He);Mp(Y,ye)}return null}function Me(te,Y,re,ye){for(var He=null,Et=null,Be=Y,ut=Y=0,St=null;Be!==null&&ut<re.length;ut++){Be.index>ut?(St=Be,Be=null):St=Be.sibling;var _t=le(te,Be,re[ut],ye);if(_t===null){Be===null&&(Be=St);break}s&&Be&&_t.alternate===null&&c(te,Be),Y=N(_t,Y,ut),Et===null?He=_t:Et.sibling=_t,Et=_t,Be=St}if(ut===re.length)return h(te,Be),Nt&&es(te,ut),He;if(Be===null){for(;ut<re.length;ut++)Be=ve(te,re[ut],ye),Be!==null&&(Y=N(Be,Y,ut),Et===null?He=Be:Et.sibling=Be,Et=Be);return Nt&&es(te,ut),He}for(Be=g(Be);ut<re.length;ut++)St=fe(Be,te,ut,re[ut],ye),St!==null&&(s&&St.alternate!==null&&Be.delete(St.key===null?ut:St.key),Y=N(St,Y,ut),Et===null?He=St:Et.sibling=St,Et=St);return s&&Be.forEach(function(uo){return c(te,uo)}),Nt&&es(te,ut),He}function Ye(te,Y,re,ye){if(re==null)throw Error(r(151));for(var He=null,Et=null,Be=Y,ut=Y=0,St=null,_t=re.next();Be!==null&&!_t.done;ut++,_t=re.next()){Be.index>ut?(St=Be,Be=null):St=Be.sibling;var uo=le(te,Be,_t.value,ye);if(uo===null){Be===null&&(Be=St);break}s&&Be&&uo.alternate===null&&c(te,Be),Y=N(uo,Y,ut),Et===null?He=uo:Et.sibling=uo,Et=uo,Be=St}if(_t.done)return h(te,Be),Nt&&es(te,ut),He;if(Be===null){for(;!_t.done;ut++,_t=re.next())_t=ve(te,_t.value,ye),_t!==null&&(Y=N(_t,Y,ut),Et===null?He=_t:Et.sibling=_t,Et=_t);return Nt&&es(te,ut),He}for(Be=g(Be);!_t.done;ut++,_t=re.next())_t=fe(Be,te,ut,_t.value,ye),_t!==null&&(s&&_t.alternate!==null&&Be.delete(_t.key===null?ut:_t.key),Y=N(_t,Y,ut),Et===null?He=_t:Et.sibling=_t,Et=_t);return s&&Be.forEach(function(XH){return c(te,XH)}),Nt&&es(te,ut),He}function Ft(te,Y,re,ye){if(typeof re=="object"&&re!==null&&re.type===b&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case v:e:{for(var He=re.key;Y!==null;){if(Y.key===He){if(He=re.type,He===b){if(Y.tag===7){h(te,Y.sibling),ye=S(Y,re.props.children),ye.return=te,te=ye;break e}}else if(Y.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===R&&ll(He)===Y.type){h(te,Y.sibling),ye=S(Y,re.props),Gd(ye,re),ye.return=te,te=ye;break e}h(te,Y);break}else c(te,Y);Y=Y.sibling}re.type===b?(ye=rl(re.props.children,te.mode,ye,re.key),ye.return=te,te=ye):(ye=Op(re.type,re.key,re.props,null,te.mode,ye),Gd(ye,re),ye.return=te,te=ye)}return T(te);case w:e:{for(He=re.key;Y!==null;){if(Y.key===He)if(Y.tag===4&&Y.stateNode.containerInfo===re.containerInfo&&Y.stateNode.implementation===re.implementation){h(te,Y.sibling),ye=S(Y,re.children||[]),ye.return=te,te=ye;break e}else{h(te,Y);break}else c(te,Y);Y=Y.sibling}ye=hx(re,te.mode,ye),ye.return=te,te=ye}return T(te);case R:return re=ll(re),Ft(te,Y,re,ye)}if(W(re))return Me(te,Y,re,ye);if(B(re)){if(He=B(re),typeof He!="function")throw Error(r(150));return re=He.call(re),Ye(te,Y,re,ye)}if(typeof re.then=="function")return Ft(te,Y,Dp(re),ye);if(re.$$typeof===C)return Ft(te,Y,zp(te,re),ye);Mp(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,Y!==null&&Y.tag===6?(h(te,Y.sibling),ye=S(Y,re),ye.return=te,te=ye):(h(te,Y),ye=fx(re,te.mode,ye),ye.return=te,te=ye),T(te)):h(te,Y)}return function(te,Y,re,ye){try{Kd=0;var He=Ft(te,Y,re,ye);return $c=null,He}catch(Be){if(Be===Lc||Be===Pp)throw Be;var Et=ai(29,Be,null,te.mode);return Et.lanes=ye,Et.return=te,Et}}}var ul=PO(!0),RO=PO(!1),Vs=!1;function kx(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cx(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 Qs(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Ys(s,c,h){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(Tt&2)!==0){var S=g.pending;return S===null?c.next=c:(c.next=S.next,S.next=c),g.pending=c,c=Ap(s),yO(s,null,h),c}return Cp(s,g,c,h),Ap(s)}function Vd(s,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194048)!==0)){var g=c.lanes;g&=s.pendingLanes,h|=g,c.lanes=h,Yo(s,h)}}function Ax(s,c){var h=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var S=null,N=null;if(h=h.firstBaseUpdate,h!==null){do{var T={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};N===null?S=N=T:N=N.next=T,h=h.next}while(h!==null);N===null?S=N=c:N=N.next=c}else S=N=c;h={baseState:g.baseState,firstBaseUpdate:S,lastBaseUpdate:N,shared:g.shared,callbacks:g.callbacks},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=c:s.next=c,h.lastBaseUpdate=c}var Ox=!1;function Qd(){if(Ox){var s=Ic;if(s!==null)throw s}}function Yd(s,c,h,g){Ox=!1;var S=s.updateQueue;Vs=!1;var N=S.firstBaseUpdate,T=S.lastBaseUpdate,L=S.shared.pending;if(L!==null){S.shared.pending=null;var K=L,ie=K.next;K.next=null,T===null?N=ie:T.next=ie,T=K;var pe=s.alternate;pe!==null&&(pe=pe.updateQueue,L=pe.lastBaseUpdate,L!==T&&(L===null?pe.firstBaseUpdate=ie:L.next=ie,pe.lastBaseUpdate=K))}if(N!==null){var ve=S.baseState;T=0,pe=ie=K=null,L=N;do{var le=L.lane&-536870913,fe=le!==L.lane;if(fe?(wt&le)===le:(g&le)===le){le!==0&&le===Mc&&(Ox=!0),pe!==null&&(pe=pe.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Me=s,Ye=L;le=c;var Ft=h;switch(Ye.tag){case 1:if(Me=Ye.payload,typeof Me=="function"){ve=Me.call(Ft,ve,le);break e}ve=Me;break e;case 3:Me.flags=Me.flags&-65537|128;case 0:if(Me=Ye.payload,le=typeof Me=="function"?Me.call(Ft,ve,le):Me,le==null)break e;ve=m({},ve,le);break e;case 2:Vs=!0}}le=L.callback,le!==null&&(s.flags|=64,fe&&(s.flags|=8192),fe=S.callbacks,fe===null?S.callbacks=[le]:fe.push(le))}else fe={lane:le,tag:L.tag,payload:L.payload,callback:L.callback,next:null},pe===null?(ie=pe=fe,K=ve):pe=pe.next=fe,T|=le;if(L=L.next,L===null){if(L=S.shared.pending,L===null)break;fe=L,L=fe.next,fe.next=null,S.lastBaseUpdate=fe,S.shared.pending=null}}while(!0);pe===null&&(K=ve),S.baseState=K,S.firstBaseUpdate=ie,S.lastBaseUpdate=pe,N===null&&(S.shared.lanes=0),eo|=T,s.lanes=T,s.memoizedState=ve}}function DO(s,c){if(typeof s!="function")throw Error(r(191,s));s.call(c)}function MO(s,c){var h=s.callbacks;if(h!==null)for(s.callbacks=null,s=0;s<h.length;s++)DO(h[s],c)}var Bc=I(null),Ip=I(0);function IO(s,c){s=ds,D(Ip,s),D(Bc,c),ds=s|c.baseLanes}function Ex(){D(Ip,ds),D(Bc,Bc.current)}function _x(){ds=Ip.current,q(Bc),q(Ip)}var si=I(null),Ei=null;function Zs(s){var c=s.alternate;D(An,An.current&1),D(si,s),Ei===null&&(c===null||Bc.current!==null||c.memoizedState!==null)&&(Ei=s)}function zx(s){D(An,An.current),D(si,s),Ei===null&&(Ei=s)}function LO(s){s.tag===22?(D(An,An.current),D(si,s),Ei===null&&(Ei=s)):Ws()}function Ws(){D(An,An.current),D(si,si.current)}function oi(s){q(si),Ei===s&&(Ei=null),q(An)}var An=I(0);function Lp(s){for(var c=s;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Ib(h)||Lb(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 rs=0,lt=null,Ut=null,Rn=null,$p=!1,Uc=!1,dl=!1,Bp=0,Zd=0,qc=null,q9=0;function bn(){throw Error(r(321))}function Tx(s,c){if(c===null)return!1;for(var h=0;h<c.length&&h<s.length;h++)if(!ii(s[h],c[h]))return!1;return!0}function Px(s,c,h,g,S,N){return rs=N,lt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,H.H=s===null||s.memoizedState===null?wE:Qx,dl=!1,N=h(g,S),dl=!1,Uc&&(N=BO(c,h,g,S)),$O(s),N}function $O(s){H.H=Jd;var c=Ut!==null&&Ut.next!==null;if(rs=0,Rn=Ut=lt=null,$p=!1,Zd=0,qc=null,c)throw Error(r(300));s===null||Dn||(s=s.dependencies,s!==null&&_p(s)&&(Dn=!0))}function BO(s,c,h,g){lt=s;var S=0;do{if(Uc&&(qc=null),Zd=0,Uc=!1,25<=S)throw Error(r(301));if(S+=1,Rn=Ut=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=SE,N=c(h,g)}while(Uc);return N}function F9(){var s=H.H,c=s.useState()[0];return c=typeof c.then=="function"?Wd(c):c,s=s.useState()[0],(Ut!==null?Ut.memoizedState:null)!==s&&(lt.flags|=1024),c}function Rx(){var s=Bp!==0;return Bp=0,s}function Dx(s,c,h){c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~h}function Mx(s){if($p){for(s=s.memoizedState;s!==null;){var c=s.queue;c!==null&&(c.pending=null),s=s.next}$p=!1}rs=0,Rn=Ut=lt=null,Uc=!1,Zd=Bp=0,qc=null}function Or(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rn===null?lt.memoizedState=Rn=s:Rn=Rn.next=s,Rn}function On(){if(Ut===null){var s=lt.alternate;s=s!==null?s.memoizedState:null}else s=Ut.next;var c=Rn===null?lt.memoizedState:Rn.next;if(c!==null)Rn=c,Ut=s;else{if(s===null)throw lt.alternate===null?Error(r(467)):Error(r(310));Ut=s,s={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},Rn===null?lt.memoizedState=Rn=s:Rn=Rn.next=s}return Rn}function Up(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wd(s){var c=Zd;return Zd+=1,qc===null&&(qc=[]),s=_O(qc,s,c),c=lt,(Rn===null?c.memoizedState:Rn.next)===null&&(c=c.alternate,H.H=c===null||c.memoizedState===null?wE:Qx),s}function qp(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Wd(s);if(s.$$typeof===C)return nr(s)}throw Error(r(438,String(s)))}function Ix(s){var c=null,h=lt.updateQueue;if(h!==null&&(c=h.memoCache),c==null){var g=lt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(c={data:g.data.map(function(S){return S.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),h===null&&(h=Up(),lt.updateQueue=h),h.memoCache=c,h=c.data[c.index],h===void 0)for(h=c.data[c.index]=Array(s),g=0;g<s;g++)h[g]=F;return c.index++,h}function is(s,c){return typeof c=="function"?c(s):c}function Fp(s){var c=On();return Lx(c,Ut,s)}function Lx(s,c,h){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var S=s.baseQueue,N=g.pending;if(N!==null){if(S!==null){var T=S.next;S.next=N.next,N.next=T}c.baseQueue=S=N,g.pending=null}if(N=s.baseState,S===null)s.memoizedState=N;else{c=S.next;var L=T=null,K=null,ie=c,pe=!1;do{var ve=ie.lane&-536870913;if(ve!==ie.lane?(wt&ve)===ve:(rs&ve)===ve){var le=ie.revertLane;if(le===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),ve===Mc&&(pe=!0);else if((rs&le)===le){ie=ie.next,le===Mc&&(pe=!0);continue}else ve={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},K===null?(L=K=ve,T=N):K=K.next=ve,lt.lanes|=le,eo|=le;ve=ie.action,dl&&h(N,ve),N=ie.hasEagerState?ie.eagerState:h(N,ve)}else le={lane:ve,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},K===null?(L=K=le,T=N):K=K.next=le,lt.lanes|=ve,eo|=ve;ie=ie.next}while(ie!==null&&ie!==c);if(K===null?T=N:K.next=L,!ii(N,s.memoizedState)&&(Dn=!0,pe&&(h=Ic,h!==null)))throw h;s.memoizedState=N,s.baseState=T,s.baseQueue=K,g.lastRenderedState=N}return S===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function $x(s){var c=On(),h=c.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var g=h.dispatch,S=h.pending,N=c.memoizedState;if(S!==null){h.pending=null;var T=S=S.next;do N=s(N,T.action),T=T.next;while(T!==S);ii(N,c.memoizedState)||(Dn=!0),c.memoizedState=N,c.baseQueue===null&&(c.baseState=N),h.lastRenderedState=N}return[N,g]}function UO(s,c,h){var g=lt,S=On(),N=Nt;if(N){if(h===void 0)throw Error(r(407));h=h()}else h=c();var T=!ii((Ut||S).memoizedState,h);if(T&&(S.memoizedState=h,Dn=!0),S=S.queue,qx(HO.bind(null,g,S,s),[s]),S.getSnapshot!==c||T||Rn!==null&&Rn.memoizedState.tag&1){if(g.flags|=2048,Fc(9,{destroy:void 0},FO.bind(null,g,S,h,c),null),Vt===null)throw Error(r(349));N||(rs&127)!==0||qO(g,c,h)}return h}function qO(s,c,h){s.flags|=16384,s={getSnapshot:c,value:h},c=lt.updateQueue,c===null?(c=Up(),lt.updateQueue=c,c.stores=[s]):(h=c.stores,h===null?c.stores=[s]:h.push(s))}function FO(s,c,h,g){c.value=h,c.getSnapshot=g,KO(c)&&GO(s)}function HO(s,c,h){return h(function(){KO(c)&&GO(s)})}function KO(s){var c=s.getSnapshot;s=s.value;try{var h=c();return!ii(s,h)}catch{return!0}}function GO(s){var c=nl(s,2);c!==null&&Kr(c,s,2)}function Bx(s){var c=Or();if(typeof s=="function"){var h=s;if(s=h(),dl){kn(!0);try{h()}finally{kn(!1)}}}return c.memoizedState=c.baseState=s,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:s},c}function VO(s,c,h,g){return s.baseState=h,Lx(s,Ut,typeof g=="function"?g:is)}function H9(s,c,h,g,S){if(Gp(s))throw Error(r(485));if(s=c.action,s!==null){var N={payload:S,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){N.listeners.push(T)}};H.T!==null?h(!0):N.isTransition=!1,g(N),h=c.pending,h===null?(N.next=c.pending=N,QO(c,N)):(N.next=h.next,c.pending=h.next=N)}}function QO(s,c){var h=c.action,g=c.payload,S=s.state;if(c.isTransition){var N=H.T,T={};H.T=T;try{var L=h(S,g),K=H.S;K!==null&&K(T,L),YO(s,c,L)}catch(ie){Ux(s,c,ie)}finally{N!==null&&T.types!==null&&(N.types=T.types),H.T=N}}else try{N=h(S,g),YO(s,c,N)}catch(ie){Ux(s,c,ie)}}function YO(s,c,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){ZO(s,c,g)},function(g){return Ux(s,c,g)}):ZO(s,c,h)}function ZO(s,c,h){c.status="fulfilled",c.value=h,WO(c),s.state=h,c=s.pending,c!==null&&(h=c.next,h===c?s.pending=null:(h=h.next,c.next=h,QO(s,h)))}function Ux(s,c,h){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do c.status="rejected",c.reason=h,WO(c),c=c.next;while(c!==g)}s.action=null}function WO(s){s=s.listeners;for(var c=0;c<s.length;c++)(0,s[c])()}function XO(s,c){return c}function JO(s,c){if(Nt){var h=Vt.formState;if(h!==null){e:{var g=lt;if(Nt){if(tn){t:{for(var S=tn,N=Oi;S.nodeType!==8;){if(!N){S=null;break t}if(S=_i(S.nextSibling),S===null){S=null;break t}}N=S.data,S=N==="F!"||N==="F"?S:null}if(S){tn=_i(S.nextSibling),g=S.data==="F!";break e}}Ks(g)}g=!1}g&&(c=h[0])}}return h=Or(),h.memoizedState=h.baseState=c,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:XO,lastRenderedState:c},h.queue=g,h=vE.bind(null,lt,g),g.dispatch=h,g=Bx(!1),N=Vx.bind(null,lt,!1,g.queue),g=Or(),S={state:c,dispatch:null,action:s,pending:null},g.queue=S,h=H9.bind(null,lt,S,N,h),S.dispatch=h,g.memoizedState=s,[c,h,!1]}function eE(s){var c=On();return tE(c,Ut,s)}function tE(s,c,h){if(c=Lx(s,c,XO)[0],s=Fp(is)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var g=Wd(c)}catch(T){throw T===Lc?Pp:T}else g=c;c=On();var S=c.queue,N=S.dispatch;return h!==c.memoizedState&&(lt.flags|=2048,Fc(9,{destroy:void 0},K9.bind(null,S,h),null)),[g,N,s]}function K9(s,c){s.action=c}function nE(s){var c=On(),h=Ut;if(h!==null)return tE(c,h,s);On(),c=c.memoizedState,h=On();var g=h.queue.dispatch;return h.memoizedState=s,[c,g,!1]}function Fc(s,c,h,g){return s={tag:s,create:h,deps:g,inst:c,next:null},c=lt.updateQueue,c===null&&(c=Up(),lt.updateQueue=c),h=c.lastEffect,h===null?c.lastEffect=s.next=s:(g=h.next,h.next=s,s.next=g,c.lastEffect=s),s}function rE(){return On().memoizedState}function Hp(s,c,h,g){var S=Or();lt.flags|=s,S.memoizedState=Fc(1|c,{destroy:void 0},h,g===void 0?null:g)}function Kp(s,c,h,g){var S=On();g=g===void 0?null:g;var N=S.memoizedState.inst;Ut!==null&&g!==null&&Tx(g,Ut.memoizedState.deps)?S.memoizedState=Fc(c,N,h,g):(lt.flags|=s,S.memoizedState=Fc(1|c,N,h,g))}function iE(s,c){Hp(8390656,8,s,c)}function qx(s,c){Kp(2048,8,s,c)}function G9(s){lt.flags|=4;var c=lt.updateQueue;if(c===null)c=Up(),lt.updateQueue=c,c.events=[s];else{var h=c.events;h===null?c.events=[s]:h.push(s)}}function aE(s){var c=On().memoizedState;return G9({ref:c,nextImpl:s}),function(){if((Tt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function sE(s,c){return Kp(4,2,s,c)}function oE(s,c){return Kp(4,4,s,c)}function lE(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 cE(s,c,h){h=h!=null?h.concat([s]):null,Kp(4,4,lE.bind(null,c,s),h)}function Fx(){}function uE(s,c){var h=On();c=c===void 0?null:c;var g=h.memoizedState;return c!==null&&Tx(c,g[1])?g[0]:(h.memoizedState=[s,c],s)}function dE(s,c){var h=On();c=c===void 0?null:c;var g=h.memoizedState;if(c!==null&&Tx(c,g[1]))return g[0];if(g=s(),dl){kn(!0);try{s()}finally{kn(!1)}}return h.memoizedState=[g,c],g}function Hx(s,c,h){return h===void 0||(rs&1073741824)!==0&&(wt&261930)===0?s.memoizedState=c:(s.memoizedState=h,s=f_(),lt.lanes|=s,eo|=s,h)}function fE(s,c,h,g){return ii(h,c)?h:Bc.current!==null?(s=Hx(s,h,g),ii(s,c)||(Dn=!0),s):(rs&42)===0||(rs&1073741824)!==0&&(wt&261930)===0?(Dn=!0,s.memoizedState=h):(s=f_(),lt.lanes|=s,eo|=s,c)}function hE(s,c,h,g,S){var N=J.p;J.p=N!==0&&8>N?N:8;var T=H.T,L={};H.T=L,Vx(s,!1,c,h);try{var K=S(),ie=H.S;if(ie!==null&&ie(L,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var pe=U9(K,g);Xd(s,c,pe,ui(s))}else Xd(s,c,g,ui(s))}catch(ve){Xd(s,c,{then:function(){},status:"rejected",reason:ve},ui())}finally{J.p=N,T!==null&&L.types!==null&&(T.types=L.types),H.T=T}}function V9(){}function Kx(s,c,h,g){if(s.tag!==5)throw Error(r(476));var S=pE(s).queue;hE(s,S,c,ce,h===null?V9:function(){return mE(s),h(g)})}function pE(s){var c=s.memoizedState;if(c!==null)return c;c={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:ce},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:h},next:null},s.memoizedState=c,s=s.alternate,s!==null&&(s.memoizedState=c),c}function mE(s){var c=pE(s);c.next===null&&(c=s.alternate.memoizedState),Xd(s,c.next.queue,{},ui())}function Gx(){return nr(gf)}function gE(){return On().memoizedState}function yE(){return On().memoizedState}function Q9(s){for(var c=s.return;c!==null;){switch(c.tag){case 24:case 3:var h=ui();s=Qs(h);var g=Ys(c,s,h);g!==null&&(Kr(g,c,h),Vd(g,c,h)),c={cache:wx()},s.payload=c;return}c=c.return}}function Y9(s,c,h){var g=ui();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Gp(s)?xE(c,h):(h=ux(s,c,h,g),h!==null&&(Kr(h,s,g),bE(h,c,g)))}function vE(s,c,h){var g=ui();Xd(s,c,h,g)}function Xd(s,c,h,g){var S={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Gp(s))xE(c,S);else{var N=s.alternate;if(s.lanes===0&&(N===null||N.lanes===0)&&(N=c.lastRenderedReducer,N!==null))try{var T=c.lastRenderedState,L=N(T,h);if(S.hasEagerState=!0,S.eagerState=L,ii(L,T))return Cp(s,c,S,0),Vt===null&&kp(),!1}catch{}if(h=ux(s,c,S,g),h!==null)return Kr(h,s,g),bE(h,c,g),!0}return!1}function Vx(s,c,h,g){if(g={lane:2,revertLane:kb(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Gp(s)){if(c)throw Error(r(479))}else c=ux(s,h,g,2),c!==null&&Kr(c,s,2)}function Gp(s){var c=s.alternate;return s===lt||c!==null&&c===lt}function xE(s,c){Uc=$p=!0;var h=s.pending;h===null?c.next=c:(c.next=h.next,h.next=c),s.pending=c}function bE(s,c,h){if((h&4194048)!==0){var g=c.lanes;g&=s.pendingLanes,h|=g,c.lanes=h,Yo(s,h)}}var Jd={readContext:nr,use:qp,useCallback:bn,useContext:bn,useEffect:bn,useImperativeHandle:bn,useLayoutEffect:bn,useInsertionEffect:bn,useMemo:bn,useReducer:bn,useRef:bn,useState:bn,useDebugValue:bn,useDeferredValue:bn,useTransition:bn,useSyncExternalStore:bn,useId:bn,useHostTransitionStatus:bn,useFormState:bn,useActionState:bn,useOptimistic:bn,useMemoCache:bn,useCacheRefresh:bn};Jd.useEffectEvent=bn;var wE={readContext:nr,use:qp,useCallback:function(s,c){return Or().memoizedState=[s,c===void 0?null:c],s},useContext:nr,useEffect:iE,useImperativeHandle:function(s,c,h){h=h!=null?h.concat([s]):null,Hp(4194308,4,lE.bind(null,c,s),h)},useLayoutEffect:function(s,c){return Hp(4194308,4,s,c)},useInsertionEffect:function(s,c){Hp(4,2,s,c)},useMemo:function(s,c){var h=Or();c=c===void 0?null:c;var g=s();if(dl){kn(!0);try{s()}finally{kn(!1)}}return h.memoizedState=[g,c],g},useReducer:function(s,c,h){var g=Or();if(h!==void 0){var S=h(c);if(dl){kn(!0);try{h(c)}finally{kn(!1)}}}else S=c;return g.memoizedState=g.baseState=S,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:S},g.queue=s,s=s.dispatch=Y9.bind(null,lt,s),[g.memoizedState,s]},useRef:function(s){var c=Or();return s={current:s},c.memoizedState=s},useState:function(s){s=Bx(s);var c=s.queue,h=vE.bind(null,lt,c);return c.dispatch=h,[s.memoizedState,h]},useDebugValue:Fx,useDeferredValue:function(s,c){var h=Or();return Hx(h,s,c)},useTransition:function(){var s=Bx(!1);return s=hE.bind(null,lt,s.queue,!0,!1),Or().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,c,h){var g=lt,S=Or();if(Nt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=c(),Vt===null)throw Error(r(349));(wt&127)!==0||qO(g,c,h)}S.memoizedState=h;var N={value:h,getSnapshot:c};return S.queue=N,iE(HO.bind(null,g,N,s),[s]),g.flags|=2048,Fc(9,{destroy:void 0},FO.bind(null,g,N,h,c),null),h},useId:function(){var s=Or(),c=Vt.identifierPrefix;if(Nt){var h=Na,g=ja;h=(g&~(1<<32-Xe(g)-1)).toString(32)+h,c="_"+c+"R_"+h,h=Bp++,0<h&&(c+="H"+h.toString(32)),c+="_"}else h=q9++,c="_"+c+"r_"+h.toString(32)+"_";return s.memoizedState=c},useHostTransitionStatus:Gx,useFormState:JO,useActionState:JO,useOptimistic:function(s){var c=Or();c.memoizedState=c.baseState=s;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=h,c=Vx.bind(null,lt,!0,h),h.dispatch=c,[s,c]},useMemoCache:Ix,useCacheRefresh:function(){return Or().memoizedState=Q9.bind(null,lt)},useEffectEvent:function(s){var c=Or(),h={impl:s};return c.memoizedState=h,function(){if((Tt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},Qx={readContext:nr,use:qp,useCallback:uE,useContext:nr,useEffect:qx,useImperativeHandle:cE,useInsertionEffect:sE,useLayoutEffect:oE,useMemo:dE,useReducer:Fp,useRef:rE,useState:function(){return Fp(is)},useDebugValue:Fx,useDeferredValue:function(s,c){var h=On();return fE(h,Ut.memoizedState,s,c)},useTransition:function(){var s=Fp(is)[0],c=On().memoizedState;return[typeof s=="boolean"?s:Wd(s),c]},useSyncExternalStore:UO,useId:gE,useHostTransitionStatus:Gx,useFormState:eE,useActionState:eE,useOptimistic:function(s,c){var h=On();return VO(h,Ut,s,c)},useMemoCache:Ix,useCacheRefresh:yE};Qx.useEffectEvent=aE;var SE={readContext:nr,use:qp,useCallback:uE,useContext:nr,useEffect:qx,useImperativeHandle:cE,useInsertionEffect:sE,useLayoutEffect:oE,useMemo:dE,useReducer:$x,useRef:rE,useState:function(){return $x(is)},useDebugValue:Fx,useDeferredValue:function(s,c){var h=On();return Ut===null?Hx(h,s,c):fE(h,Ut.memoizedState,s,c)},useTransition:function(){var s=$x(is)[0],c=On().memoizedState;return[typeof s=="boolean"?s:Wd(s),c]},useSyncExternalStore:UO,useId:gE,useHostTransitionStatus:Gx,useFormState:nE,useActionState:nE,useOptimistic:function(s,c){var h=On();return Ut!==null?VO(h,Ut,s,c):(h.baseState=s,[s,h.queue.dispatch])},useMemoCache:Ix,useCacheRefresh:yE};SE.useEffectEvent=aE;function Yx(s,c,h,g){c=s.memoizedState,h=h(g,c),h=h==null?c:m({},c,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}var Zx={enqueueSetState:function(s,c,h){s=s._reactInternals;var g=ui(),S=Qs(g);S.payload=c,h!=null&&(S.callback=h),c=Ys(s,S,g),c!==null&&(Kr(c,s,g),Vd(c,s,g))},enqueueReplaceState:function(s,c,h){s=s._reactInternals;var g=ui(),S=Qs(g);S.tag=1,S.payload=c,h!=null&&(S.callback=h),c=Ys(s,S,g),c!==null&&(Kr(c,s,g),Vd(c,s,g))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var h=ui(),g=Qs(h);g.tag=2,c!=null&&(g.callback=c),c=Ys(s,g,h),c!==null&&(Kr(c,s,h),Vd(c,s,h))}};function jE(s,c,h,g,S,N,T){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,N,T):c.prototype&&c.prototype.isPureReactComponent?!$d(h,g)||!$d(S,N):!0}function NE(s,c,h,g){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,g),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,g),c.state!==s&&Zx.enqueueReplaceState(c,c.state,null)}function fl(s,c){var h=c;if("ref"in c){h={};for(var g in c)g!=="ref"&&(h[g]=c[g])}if(s=s.defaultProps){h===c&&(h=m({},h));for(var S in s)h[S]===void 0&&(h[S]=s[S])}return h}function kE(s){Np(s)}function CE(s){console.error(s)}function AE(s){Np(s)}function Vp(s,c){try{var h=s.onUncaughtError;h(c.value,{componentStack:c.stack})}catch(g){setTimeout(function(){throw g})}}function OE(s,c,h){try{var g=s.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function Wx(s,c,h){return h=Qs(h),h.tag=3,h.payload={element:null},h.callback=function(){Vp(s,c)},h}function EE(s){return s=Qs(s),s.tag=3,s}function _E(s,c,h,g){var S=h.type.getDerivedStateFromError;if(typeof S=="function"){var N=g.value;s.payload=function(){return S(N)},s.callback=function(){OE(c,h,g)}}var T=h.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(s.callback=function(){OE(c,h,g),typeof S!="function"&&(to===null?to=new Set([this]):to.add(this));var L=g.stack;this.componentDidCatch(g.value,{componentStack:L!==null?L:""})})}function Z9(s,c,h,g,S){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(c=h.alternate,c!==null&&Dc(c,h,S,!0),h=si.current,h!==null){switch(h.tag){case 31:case 13:return Ei===null?am():h.alternate===null&&wn===0&&(wn=3),h.flags&=-257,h.flags|=65536,h.lanes=S,g===Rp?h.flags|=16384:(c=h.updateQueue,c===null?h.updateQueue=new Set([g]):c.add(g),Sb(s,g,S)),!1;case 22:return h.flags|=65536,g===Rp?h.flags|=16384:(c=h.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=c):(h=c.retryQueue,h===null?c.retryQueue=new Set([g]):h.add(g)),Sb(s,g,S)),!1}throw Error(r(435,h.tag))}return Sb(s,g,S),am(),!1}if(Nt)return c=si.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=S,g!==gx&&(s=Error(r(422),{cause:g}),qd(ki(s,h)))):(g!==gx&&(c=Error(r(423),{cause:g}),qd(ki(c,h))),s=s.current.alternate,s.flags|=65536,S&=-S,s.lanes|=S,g=ki(g,h),S=Wx(s.stateNode,g,S),Ax(s,S),wn!==4&&(wn=2)),!1;var N=Error(r(520),{cause:g});if(N=ki(N,h),lf===null?lf=[N]:lf.push(N),wn!==4&&(wn=2),c===null)return!0;g=ki(g,h),h=c;do{switch(h.tag){case 3:return h.flags|=65536,s=S&-S,h.lanes|=s,s=Wx(h.stateNode,g,s),Ax(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"&&(to===null||!to.has(N))))return h.flags|=65536,S&=-S,h.lanes|=S,S=EE(S),_E(S,s,h,g),Ax(h,S),!1}h=h.return}while(h!==null);return!1}var Xx=Error(r(461)),Dn=!1;function rr(s,c,h,g){c.child=s===null?RO(c,null,h,g):ul(c,s.child,h,g)}function zE(s,c,h,g,S){h=h.render;var N=c.ref;if("ref"in g){var T={};for(var L in g)L!=="ref"&&(T[L]=g[L])}else T=g;return sl(c),g=Px(s,c,h,T,N,S),L=Rx(),s!==null&&!Dn?(Dx(s,c,S),as(s,c,S)):(Nt&&L&&px(c),c.flags|=1,rr(s,c,g,S),c.child)}function TE(s,c,h,g,S){if(s===null){var N=h.type;return typeof N=="function"&&!dx(N)&&N.defaultProps===void 0&&h.compare===null?(c.tag=15,c.type=N,PE(s,c,N,g,S)):(s=Op(h.type,null,g,c,c.mode,S),s.ref=c.ref,s.return=c,c.child=s)}if(N=s.child,!sb(s,S)){var T=N.memoizedProps;if(h=h.compare,h=h!==null?h:$d,h(T,g)&&s.ref===c.ref)return as(s,c,S)}return c.flags|=1,s=Ja(N,g),s.ref=c.ref,s.return=c,c.child=s}function PE(s,c,h,g,S){if(s!==null){var N=s.memoizedProps;if($d(N,g)&&s.ref===c.ref)if(Dn=!1,c.pendingProps=g=N,sb(s,S))(s.flags&131072)!==0&&(Dn=!0);else return c.lanes=s.lanes,as(s,c,S)}return Jx(s,c,h,g,S)}function RE(s,c,h,g){var S=g.children,N=s!==null?s.memoizedState:null;if(s===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((c.flags&128)!==0){if(N=N!==null?N.baseLanes|h:h,s!==null){for(g=c.child=s.child,S=0;g!==null;)S=S|g.lanes|g.childLanes,g=g.sibling;g=S&~N}else g=0,c.child=null;return DE(s,c,N,h,g)}if((h&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},s!==null&&Tp(c,N!==null?N.cachePool:null),N!==null?IO(c,N):Ex(),LO(c);else return g=c.lanes=536870912,DE(s,c,N!==null?N.baseLanes|h:h,h,g)}else N!==null?(Tp(c,N.cachePool),IO(c,N),Ws(),c.memoizedState=null):(s!==null&&Tp(c,null),Ex(),Ws());return rr(s,c,S,h),c.child}function ef(s,c){return s!==null&&s.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function DE(s,c,h,g,S){var N=jx();return N=N===null?null:{parent:Pn._currentValue,pool:N},c.memoizedState={baseLanes:h,cachePool:N},s!==null&&Tp(c,null),Ex(),LO(c),s!==null&&Dc(s,c,g,!0),c.childLanes=S,null}function Qp(s,c){return c=Zp({mode:c.mode,children:c.children},s.mode),c.ref=s.ref,s.child=c,c.return=s,c}function ME(s,c,h){return ul(c,s.child,null,h),s=Qp(c,c.pendingProps),s.flags|=2,oi(c),c.memoizedState=null,s}function W9(s,c,h){var g=c.pendingProps,S=(c.flags&128)!==0;if(c.flags&=-129,s===null){if(Nt){if(g.mode==="hidden")return s=Qp(c,g),c.lanes=536870912,ef(null,s);if(zx(c),(s=tn)?(s=Q_(s,Oi),s=s!==null&&s.data==="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:Fs!==null?{id:ja,overflow:Na}:null,retryLane:536870912,hydrationErrors:null},h=xO(s),h.return=c,c.child=h,tr=c,tn=null)):s=null,s===null)throw Ks(c);return c.lanes=536870912,null}return Qp(c,g)}var N=s.memoizedState;if(N!==null){var T=N.dehydrated;if(zx(c),S)if(c.flags&256)c.flags&=-257,c=ME(s,c,h);else if(c.memoizedState!==null)c.child=s.child,c.flags|=128,c=null;else throw Error(r(558));else if(Dn||Dc(s,c,h,!1),S=(h&s.childLanes)!==0,Dn||S){if(g=Vt,g!==null&&(T=ba(g,h),T!==0&&T!==N.retryLane))throw N.retryLane=T,nl(s,T),Kr(g,s,T),Xx;am(),c=ME(s,c,h)}else s=N.treeContext,tn=_i(T.nextSibling),tr=c,Nt=!0,Hs=null,Oi=!1,s!==null&&SO(c,s),c=Qp(c,g),c.flags|=4096;return c}return s=Ja(s.child,{mode:g.mode,children:g.children}),s.ref=c.ref,c.child=s,s.return=c,s}function Yp(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 Jx(s,c,h,g,S){return sl(c),h=Px(s,c,h,g,void 0,S),g=Rx(),s!==null&&!Dn?(Dx(s,c,S),as(s,c,S)):(Nt&&g&&px(c),c.flags|=1,rr(s,c,h,S),c.child)}function IE(s,c,h,g,S,N){return sl(c),c.updateQueue=null,h=BO(c,g,h,S),$O(s),g=Rx(),s!==null&&!Dn?(Dx(s,c,N),as(s,c,N)):(Nt&&g&&px(c),c.flags|=1,rr(s,c,h,N),c.child)}function LE(s,c,h,g,S){if(sl(c),c.stateNode===null){var N=zc,T=h.contextType;typeof T=="object"&&T!==null&&(N=nr(T)),N=new h(g,N),c.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=Zx,c.stateNode=N,N._reactInternals=c,N=c.stateNode,N.props=g,N.state=c.memoizedState,N.refs={},kx(c),T=h.contextType,N.context=typeof T=="object"&&T!==null?nr(T):zc,N.state=c.memoizedState,T=h.getDerivedStateFromProps,typeof T=="function"&&(Yx(c,h,T,g),N.state=c.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(T=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),T!==N.state&&Zx.enqueueReplaceState(N,N.state,null),Yd(c,g,N,S),Qd(),N.state=c.memoizedState),typeof N.componentDidMount=="function"&&(c.flags|=4194308),g=!0}else if(s===null){N=c.stateNode;var L=c.memoizedProps,K=fl(h,L);N.props=K;var ie=N.context,pe=h.contextType;T=zc,typeof pe=="object"&&pe!==null&&(T=nr(pe));var ve=h.getDerivedStateFromProps;pe=typeof ve=="function"||typeof N.getSnapshotBeforeUpdate=="function",L=c.pendingProps!==L,pe||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(L||ie!==T)&&NE(c,N,g,T),Vs=!1;var le=c.memoizedState;N.state=le,Yd(c,g,N,S),Qd(),ie=c.memoizedState,L||le!==ie||Vs?(typeof ve=="function"&&(Yx(c,h,ve,g),ie=c.memoizedState),(K=Vs||jE(c,h,K,g,le,ie,T))?(pe||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=g,c.memoizedState=ie),N.props=g,N.state=ie,N.context=T,g=K):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),g=!1)}else{N=c.stateNode,Cx(s,c),T=c.memoizedProps,pe=fl(h,T),N.props=pe,ve=c.pendingProps,le=N.context,ie=h.contextType,K=zc,typeof ie=="object"&&ie!==null&&(K=nr(ie)),L=h.getDerivedStateFromProps,(ie=typeof L=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(T!==ve||le!==K)&&NE(c,N,g,K),Vs=!1,le=c.memoizedState,N.state=le,Yd(c,g,N,S),Qd();var fe=c.memoizedState;T!==ve||le!==fe||Vs||s!==null&&s.dependencies!==null&&_p(s.dependencies)?(typeof L=="function"&&(Yx(c,h,L,g),fe=c.memoizedState),(pe=Vs||jE(c,h,pe,g,le,fe,K)||s!==null&&s.dependencies!==null&&_p(s.dependencies))?(ie||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(g,fe,K),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(g,fe,K)),typeof N.componentDidUpdate=="function"&&(c.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof N.componentDidUpdate!="function"||T===s.memoizedProps&&le===s.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||T===s.memoizedProps&&le===s.memoizedState||(c.flags|=1024),c.memoizedProps=g,c.memoizedState=fe),N.props=g,N.state=fe,N.context=K,g=pe):(typeof N.componentDidUpdate!="function"||T===s.memoizedProps&&le===s.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||T===s.memoizedProps&&le===s.memoizedState||(c.flags|=1024),g=!1)}return N=g,Yp(s,c),g=(c.flags&128)!==0,N||g?(N=c.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:N.render(),c.flags|=1,s!==null&&g?(c.child=ul(c,s.child,null,S),c.child=ul(c,null,h,S)):rr(s,c,h,S),c.memoizedState=N.state,s=c.child):s=as(s,c,S),s}function $E(s,c,h,g){return il(),c.flags|=256,rr(s,c,h,g),c.child}var eb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tb(s){return{baseLanes:s,cachePool:OO()}}function nb(s,c,h){return s=s!==null?s.childLanes&~h:0,c&&(s|=ci),s}function BE(s,c,h){var g=c.pendingProps,S=!1,N=(c.flags&128)!==0,T;if((T=N)||(T=s!==null&&s.memoizedState===null?!1:(An.current&2)!==0),T&&(S=!0,c.flags&=-129),T=(c.flags&32)!==0,c.flags&=-33,s===null){if(Nt){if(S?Zs(c):Ws(),(s=tn)?(s=Q_(s,Oi),s=s!==null&&s.data!=="&"?s:null,s!==null&&(c.memoizedState={dehydrated:s,treeContext:Fs!==null?{id:ja,overflow:Na}:null,retryLane:536870912,hydrationErrors:null},h=xO(s),h.return=c,c.child=h,tr=c,tn=null)):s=null,s===null)throw Ks(c);return Lb(s)?c.lanes=32:c.lanes=536870912,null}var L=g.children;return g=g.fallback,S?(Ws(),S=c.mode,L=Zp({mode:"hidden",children:L},S),g=rl(g,S,h,null),L.return=c,g.return=c,L.sibling=g,c.child=L,g=c.child,g.memoizedState=tb(h),g.childLanes=nb(s,T,h),c.memoizedState=eb,ef(null,g)):(Zs(c),rb(c,L))}var K=s.memoizedState;if(K!==null&&(L=K.dehydrated,L!==null)){if(N)c.flags&256?(Zs(c),c.flags&=-257,c=ib(s,c,h)):c.memoizedState!==null?(Ws(),c.child=s.child,c.flags|=128,c=null):(Ws(),L=g.fallback,S=c.mode,g=Zp({mode:"visible",children:g.children},S),L=rl(L,S,h,null),L.flags|=2,g.return=c,L.return=c,g.sibling=L,c.child=g,ul(c,s.child,null,h),g=c.child,g.memoizedState=tb(h),g.childLanes=nb(s,T,h),c.memoizedState=eb,c=ef(null,g));else if(Zs(c),Lb(L)){if(T=L.nextSibling&&L.nextSibling.dataset,T)var ie=T.dgst;T=ie,g=Error(r(419)),g.stack="",g.digest=T,qd({value:g,source:null,stack:null}),c=ib(s,c,h)}else if(Dn||Dc(s,c,h,!1),T=(h&s.childLanes)!==0,Dn||T){if(T=Vt,T!==null&&(g=ba(T,h),g!==0&&g!==K.retryLane))throw K.retryLane=g,nl(s,g),Kr(T,s,g),Xx;Ib(L)||am(),c=ib(s,c,h)}else Ib(L)?(c.flags|=192,c.child=s.child,c=null):(s=K.treeContext,tn=_i(L.nextSibling),tr=c,Nt=!0,Hs=null,Oi=!1,s!==null&&SO(c,s),c=rb(c,g.children),c.flags|=4096);return c}return S?(Ws(),L=g.fallback,S=c.mode,K=s.child,ie=K.sibling,g=Ja(K,{mode:"hidden",children:g.children}),g.subtreeFlags=K.subtreeFlags&65011712,ie!==null?L=Ja(ie,L):(L=rl(L,S,h,null),L.flags|=2),L.return=c,g.return=c,g.sibling=L,c.child=g,ef(null,g),g=c.child,L=s.child.memoizedState,L===null?L=tb(h):(S=L.cachePool,S!==null?(K=Pn._currentValue,S=S.parent!==K?{parent:K,pool:K}:S):S=OO(),L={baseLanes:L.baseLanes|h,cachePool:S}),g.memoizedState=L,g.childLanes=nb(s,T,h),c.memoizedState=eb,ef(s.child,g)):(Zs(c),h=s.child,s=h.sibling,h=Ja(h,{mode:"visible",children:g.children}),h.return=c,h.sibling=null,s!==null&&(T=c.deletions,T===null?(c.deletions=[s],c.flags|=16):T.push(s)),c.child=h,c.memoizedState=null,h)}function rb(s,c){return c=Zp({mode:"visible",children:c},s.mode),c.return=s,s.child=c}function Zp(s,c){return s=ai(22,s,null,c),s.lanes=0,s}function ib(s,c,h){return ul(c,s.child,null,h),s=rb(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function UE(s,c,h){s.lanes|=c;var g=s.alternate;g!==null&&(g.lanes|=c),xx(s.return,c,h)}function ab(s,c,h,g,S,N){var T=s.memoizedState;T===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:S,treeForkCount:N}:(T.isBackwards=c,T.rendering=null,T.renderingStartTime=0,T.last=g,T.tail=h,T.tailMode=S,T.treeForkCount=N)}function qE(s,c,h){var g=c.pendingProps,S=g.revealOrder,N=g.tail;g=g.children;var T=An.current,L=(T&2)!==0;if(L?(T=T&1|2,c.flags|=128):T&=1,D(An,T),rr(s,c,g,h),g=Nt?Ud:0,!L&&s!==null&&(s.flags&128)!==0)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&UE(s,h,c);else if(s.tag===19)UE(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(S){case"forwards":for(h=c.child,S=null;h!==null;)s=h.alternate,s!==null&&Lp(s)===null&&(S=h),h=h.sibling;h=S,h===null?(S=c.child,c.child=null):(S=h.sibling,h.sibling=null),ab(c,!1,S,h,N,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,S=c.child,c.child=null;S!==null;){if(s=S.alternate,s!==null&&Lp(s)===null){c.child=S;break}s=S.sibling,S.sibling=h,h=S,S=s}ab(c,!0,h,null,N,g);break;case"together":ab(c,!1,null,null,void 0,g);break;default:c.memoizedState=null}return c.child}function as(s,c,h){if(s!==null&&(c.dependencies=s.dependencies),eo|=c.lanes,(h&c.childLanes)===0)if(s!==null){if(Dc(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=Ja(s,s.pendingProps),c.child=h,h.return=c;s.sibling!==null;)s=s.sibling,h=h.sibling=Ja(s,s.pendingProps),h.return=c;h.sibling=null}return c.child}function sb(s,c){return(s.lanes&c)!==0?!0:(s=s.dependencies,!!(s!==null&&_p(s)))}function X9(s,c,h){switch(c.tag){case 3:we(c,c.stateNode.containerInfo),Gs(c,Pn,s.memoizedState.cache),il();break;case 27:case 5:he(c);break;case 4:we(c,c.stateNode.containerInfo);break;case 10:Gs(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,zx(c),null;break;case 13:var g=c.memoizedState;if(g!==null)return g.dehydrated!==null?(Zs(c),c.flags|=128,null):(h&c.child.childLanes)!==0?BE(s,c,h):(Zs(c),s=as(s,c,h),s!==null?s.sibling:null);Zs(c);break;case 19:var S=(s.flags&128)!==0;if(g=(h&c.childLanes)!==0,g||(Dc(s,c,h,!1),g=(h&c.childLanes)!==0),S){if(g)return qE(s,c,h);c.flags|=128}if(S=c.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),D(An,An.current),g)break;return null;case 22:return c.lanes=0,RE(s,c,h,c.pendingProps);case 24:Gs(c,Pn,s.memoizedState.cache)}return as(s,c,h)}function FE(s,c,h){if(s!==null)if(s.memoizedProps!==c.pendingProps)Dn=!0;else{if(!sb(s,h)&&(c.flags&128)===0)return Dn=!1,X9(s,c,h);Dn=(s.flags&131072)!==0}else Dn=!1,Nt&&(c.flags&1048576)!==0&&wO(c,Ud,c.index);switch(c.lanes=0,c.tag){case 16:e:{var g=c.pendingProps;if(s=ll(c.elementType),c.type=s,typeof s=="function")dx(s)?(g=fl(s,g),c.tag=1,c=LE(null,c,s,g,h)):(c.tag=0,c=Jx(null,c,s,g,h));else{if(s!=null){var S=s.$$typeof;if(S===O){c.tag=11,c=zE(null,c,s,g,h);break e}else if(S===z){c.tag=14,c=TE(null,c,s,g,h);break e}}throw c=X(s)||s,Error(r(306,c,""))}}return c;case 0:return Jx(s,c,c.type,c.pendingProps,h);case 1:return g=c.type,S=fl(g,c.pendingProps),LE(s,c,g,S,h);case 3:e:{if(we(c,c.stateNode.containerInfo),s===null)throw Error(r(387));g=c.pendingProps;var N=c.memoizedState;S=N.element,Cx(s,c),Yd(c,g,null,h);var T=c.memoizedState;if(g=T.cache,Gs(c,Pn,g),g!==N.cache&&bx(c,[Pn],h,!0),Qd(),g=T.element,N.isDehydrated)if(N={element:g,isDehydrated:!1,cache:T.cache},c.updateQueue.baseState=N,c.memoizedState=N,c.flags&256){c=$E(s,c,g,h);break e}else if(g!==S){S=ki(Error(r(424)),c),qd(S),c=$E(s,c,g,h);break e}else for(s=c.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,tn=_i(s.firstChild),tr=c,Nt=!0,Hs=null,Oi=!0,h=RO(c,null,g,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(il(),g===S){c=as(s,c,h);break e}rr(s,c,g,h)}c=c.child}return c;case 26:return Yp(s,c),s===null?(h=ez(c.type,null,c.pendingProps,null))?c.memoizedState=h:Nt||(h=c.type,s=c.pendingProps,g=fm(ne.current).createElement(h),g[nt]=c,g[Ct]=s,ir(g,h,s),hn(g),c.stateNode=g):c.memoizedState=ez(c.type,s.memoizedProps,c.pendingProps,s.memoizedState),null;case 27:return he(c),s===null&&Nt&&(g=c.stateNode=W_(c.type,c.pendingProps,ne.current),tr=c,Oi=!0,S=tn,ao(c.type)?($b=S,tn=_i(g.firstChild)):tn=S),rr(s,c,c.pendingProps.children,h),Yp(s,c),s===null&&(c.flags|=4194304),c.child;case 5:return s===null&&Nt&&((S=g=tn)&&(g=OH(g,c.type,c.pendingProps,Oi),g!==null?(c.stateNode=g,tr=c,tn=_i(g.firstChild),Oi=!1,S=!0):S=!1),S||Ks(c)),he(c),S=c.type,N=c.pendingProps,T=s!==null?s.memoizedProps:null,g=N.children,Rb(S,N)?g=null:T!==null&&Rb(S,T)&&(c.flags|=32),c.memoizedState!==null&&(S=Px(s,c,F9,null,null,h),gf._currentValue=S),Yp(s,c),rr(s,c,g,h),c.child;case 6:return s===null&&Nt&&((s=h=tn)&&(h=EH(h,c.pendingProps,Oi),h!==null?(c.stateNode=h,tr=c,tn=null,s=!0):s=!1),s||Ks(c)),null;case 13:return BE(s,c,h);case 4:return we(c,c.stateNode.containerInfo),g=c.pendingProps,s===null?c.child=ul(c,null,g,h):rr(s,c,g,h),c.child;case 11:return zE(s,c,c.type,c.pendingProps,h);case 7:return rr(s,c,c.pendingProps,h),c.child;case 8:return rr(s,c,c.pendingProps.children,h),c.child;case 12:return rr(s,c,c.pendingProps.children,h),c.child;case 10:return g=c.pendingProps,Gs(c,c.type,g.value),rr(s,c,g.children,h),c.child;case 9:return S=c.type._context,g=c.pendingProps.children,sl(c),S=nr(S),g=g(S),c.flags|=1,rr(s,c,g,h),c.child;case 14:return TE(s,c,c.type,c.pendingProps,h);case 15:return PE(s,c,c.type,c.pendingProps,h);case 19:return qE(s,c,h);case 31:return W9(s,c,h);case 22:return RE(s,c,h,c.pendingProps);case 24:return sl(c),g=nr(Pn),s===null?(S=jx(),S===null&&(S=Vt,N=wx(),S.pooledCache=N,N.refCount++,N!==null&&(S.pooledCacheLanes|=h),S=N),c.memoizedState={parent:g,cache:S},kx(c),Gs(c,Pn,S)):((s.lanes&h)!==0&&(Cx(s,c),Yd(c,null,null,h),Qd()),S=s.memoizedState,N=c.memoizedState,S.parent!==g?(S={parent:g,cache:g},c.memoizedState=S,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=S),Gs(c,Pn,g)):(g=N.cache,Gs(c,Pn,g),g!==S.cache&&bx(c,[Pn],h,!0))),rr(s,c,c.pendingProps.children,h),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function ss(s){s.flags|=4}function ob(s,c,h,g,S){if((c=(s.mode&32)!==0)&&(c=!1),c){if(s.flags|=16777216,(S&335544128)===S)if(s.stateNode.complete)s.flags|=8192;else if(g_())s.flags|=8192;else throw cl=Rp,Nx}else s.flags&=-16777217}function HE(s,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!az(c))if(g_())s.flags|=8192;else throw cl=Rp,Nx}function Wp(s,c){c!==null&&(s.flags|=4),s.flags&16384&&(c=s.tag!==22?ri():536870912,s.lanes|=c,Vc|=c)}function tf(s,c){if(!Nt)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 g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function nn(s){var c=s.alternate!==null&&s.alternate.child===s.child,h=0,g=0;if(c)for(var S=s.child;S!==null;)h|=S.lanes|S.childLanes,g|=S.subtreeFlags&65011712,g|=S.flags&65011712,S.return=s,S=S.sibling;else for(S=s.child;S!==null;)h|=S.lanes|S.childLanes,g|=S.subtreeFlags,g|=S.flags,S.return=s,S=S.sibling;return s.subtreeFlags|=g,s.childLanes=h,c}function J9(s,c,h){var g=c.pendingProps;switch(mx(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nn(c),null;case 1:return nn(c),null;case 3:return h=c.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),c.memoizedState.cache!==g&&(c.flags|=2048),ns(Pn),ee(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(s===null||s.child===null)&&(Rc(c)?ss(c):s===null||s.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,yx())),nn(c),null;case 26:var S=c.type,N=c.memoizedState;return s===null?(ss(c),N!==null?(nn(c),HE(c,N)):(nn(c),ob(c,S,null,g,h))):N?N!==s.memoizedState?(ss(c),nn(c),HE(c,N)):(nn(c),c.flags&=-16777217):(s=s.memoizedProps,s!==g&&ss(c),nn(c),ob(c,S,s,g,h)),null;case 27:if(_e(c),h=ne.current,S=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==g&&ss(c);else{if(!g){if(c.stateNode===null)throw Error(r(166));return nn(c),null}s=G.current,Rc(c)?jO(c):(s=W_(S,g,h),c.stateNode=s,ss(c))}return nn(c),null;case 5:if(_e(c),S=c.type,s!==null&&c.stateNode!=null)s.memoizedProps!==g&&ss(c);else{if(!g){if(c.stateNode===null)throw Error(r(166));return nn(c),null}if(N=G.current,Rc(c))jO(c);else{var T=fm(ne.current);switch(N){case 1:N=T.createElementNS("http://www.w3.org/2000/svg",S);break;case 2:N=T.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;default:switch(S){case"svg":N=T.createElementNS("http://www.w3.org/2000/svg",S);break;case"math":N=T.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;case"script":N=T.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof g.is=="string"?T.createElement("select",{is:g.is}):T.createElement("select"),g.multiple?N.multiple=!0:g.size&&(N.size=g.size);break;default:N=typeof g.is=="string"?T.createElement(S,{is:g.is}):T.createElement(S)}}N[nt]=c,N[Ct]=g;e:for(T=c.child;T!==null;){if(T.tag===5||T.tag===6)N.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===c)break e;for(;T.sibling===null;){if(T.return===null||T.return===c)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}c.stateNode=N;e:switch(ir(N,S,g),S){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&ss(c)}}return nn(c),ob(c,c.type,s===null?null:s.memoizedProps,c.pendingProps,h),null;case 6:if(s&&c.stateNode!=null)s.memoizedProps!==g&&ss(c);else{if(typeof g!="string"&&c.stateNode===null)throw Error(r(166));if(s=ne.current,Rc(c)){if(s=c.stateNode,h=c.memoizedProps,g=null,S=tr,S!==null)switch(S.tag){case 27:case 5:g=S.memoizedProps}s[nt]=c,s=!!(s.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||B_(s.nodeValue,h)),s||Ks(c,!0)}else s=fm(s).createTextNode(g),s[nt]=c,c.stateNode=s}return nn(c),null;case 31:if(h=c.memoizedState,s===null||s.memoizedState!==null){if(g=Rc(c),h!==null){if(s===null){if(!g)throw Error(r(318));if(s=c.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[nt]=c}else il(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;nn(c),s=!1}else h=yx(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),s=!0;if(!s)return c.flags&256?(oi(c),c):(oi(c),null);if((c.flags&128)!==0)throw Error(r(558))}return nn(c),null;case 13:if(g=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(S=Rc(c),g!==null&&g.dehydrated!==null){if(s===null){if(!S)throw Error(r(318));if(S=c.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(r(317));S[nt]=c}else il(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;nn(c),S=!1}else S=yx(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=S),S=!0;if(!S)return c.flags&256?(oi(c),c):(oi(c),null)}return oi(c),(c.flags&128)!==0?(c.lanes=h,c):(h=g!==null,s=s!==null&&s.memoizedState!==null,h&&(g=c.child,S=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(S=g.alternate.memoizedState.cachePool.pool),N=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(N=g.memoizedState.cachePool.pool),N!==S&&(g.flags|=2048)),h!==s&&h&&(c.child.flags|=8192),Wp(c,c.updateQueue),nn(c),null);case 4:return ee(),s===null&&Eb(c.stateNode.containerInfo),nn(c),null;case 10:return ns(c.type),nn(c),null;case 19:if(q(An),g=c.memoizedState,g===null)return nn(c),null;if(S=(c.flags&128)!==0,N=g.rendering,N===null)if(S)tf(g,!1);else{if(wn!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(N=Lp(s),N!==null){for(c.flags|=128,tf(g,!1),s=N.updateQueue,c.updateQueue=s,Wp(c,s),c.subtreeFlags=0,s=h,h=c.child;h!==null;)vO(h,s),h=h.sibling;return D(An,An.current&1|2),Nt&&es(c,g.treeForkCount),c.child}s=s.sibling}g.tail!==null&&yt()>nm&&(c.flags|=128,S=!0,tf(g,!1),c.lanes=4194304)}else{if(!S)if(s=Lp(N),s!==null){if(c.flags|=128,S=!0,s=s.updateQueue,c.updateQueue=s,Wp(c,s),tf(g,!0),g.tail===null&&g.tailMode==="hidden"&&!N.alternate&&!Nt)return nn(c),null}else 2*yt()-g.renderingStartTime>nm&&h!==536870912&&(c.flags|=128,S=!0,tf(g,!1),c.lanes=4194304);g.isBackwards?(N.sibling=c.child,c.child=N):(s=g.last,s!==null?s.sibling=N:c.child=N,g.last=N)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=yt(),s.sibling=null,h=An.current,D(An,S?h&1|2:h&1),Nt&&es(c,g.treeForkCount),s):(nn(c),null);case 22:case 23:return oi(c),_x(),g=c.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(c.flags|=8192):g&&(c.flags|=8192),g?(h&536870912)!==0&&(c.flags&128)===0&&(nn(c),c.subtreeFlags&6&&(c.flags|=8192)):nn(c),h=c.updateQueue,h!==null&&Wp(c,h.retryQueue),h=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==h&&(c.flags|=2048),s!==null&&q(ol),null;case 24:return h=null,s!==null&&(h=s.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),ns(Pn),nn(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function eH(s,c){switch(mx(c),c.tag){case 1:return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return ns(Pn),ee(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 26:case 27:case 5:return _e(c),null;case 31:if(c.memoizedState!==null){if(oi(c),c.alternate===null)throw Error(r(340));il()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 13:if(oi(c),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(r(340));il()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return q(An),null;case 4:return ee(),null;case 10:return ns(c.type),null;case 22:case 23:return oi(c),_x(),s!==null&&q(ol),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 24:return ns(Pn),null;case 25:return null;default:return null}}function KE(s,c){switch(mx(c),c.tag){case 3:ns(Pn),ee();break;case 26:case 27:case 5:_e(c);break;case 4:ee();break;case 31:c.memoizedState!==null&&oi(c);break;case 13:oi(c);break;case 19:q(An);break;case 10:ns(c.type);break;case 22:case 23:oi(c),_x(),s!==null&&q(ol);break;case 24:ns(Pn)}}function nf(s,c){try{var h=c.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var S=g.next;h=S;do{if((h.tag&s)===s){g=void 0;var N=h.create,T=h.inst;g=N(),T.destroy=g}h=h.next}while(h!==S)}}catch(L){$t(c,c.return,L)}}function Xs(s,c,h){try{var g=c.updateQueue,S=g!==null?g.lastEffect:null;if(S!==null){var N=S.next;g=N;do{if((g.tag&s)===s){var T=g.inst,L=T.destroy;if(L!==void 0){T.destroy=void 0,S=c;var K=h,ie=L;try{ie()}catch(pe){$t(S,K,pe)}}}g=g.next}while(g!==N)}}catch(pe){$t(c,c.return,pe)}}function GE(s){var c=s.updateQueue;if(c!==null){var h=s.stateNode;try{MO(c,h)}catch(g){$t(s,s.return,g)}}}function VE(s,c,h){h.props=fl(s.type,s.memoizedProps),h.state=s.memoizedState;try{h.componentWillUnmount()}catch(g){$t(s,c,g)}}function rf(s,c){try{var h=s.ref;if(h!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof h=="function"?s.refCleanup=h(g):h.current=g}}catch(S){$t(s,c,S)}}function ka(s,c){var h=s.ref,g=s.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(S){$t(s,c,S)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(S){$t(s,c,S)}else h.current=null}function QE(s){var c=s.type,h=s.memoizedProps,g=s.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(S){$t(s,s.return,S)}}function lb(s,c,h){try{var g=s.stateNode;SH(g,s.type,h,c),g[Ct]=c}catch(S){$t(s,s.return,S)}}function YE(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ao(s.type)||s.tag===4}function cb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||YE(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&&ao(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 ub(s,c,h){var g=s.tag;if(g===5||g===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=Wa));else if(g!==4&&(g===27&&ao(s.type)&&(h=s.stateNode,c=null),s=s.child,s!==null))for(ub(s,c,h),s=s.sibling;s!==null;)ub(s,c,h),s=s.sibling}function Xp(s,c,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,c?h.insertBefore(s,c):h.appendChild(s);else if(g!==4&&(g===27&&ao(s.type)&&(h=s.stateNode),s=s.child,s!==null))for(Xp(s,c,h),s=s.sibling;s!==null;)Xp(s,c,h),s=s.sibling}function ZE(s){var c=s.stateNode,h=s.memoizedProps;try{for(var g=s.type,S=c.attributes;S.length;)c.removeAttributeNode(S[0]);ir(c,g,h),c[nt]=s,c[Ct]=h}catch(N){$t(s,s.return,N)}}var os=!1,Mn=!1,db=!1,WE=typeof WeakSet=="function"?WeakSet:Set,Qn=null;function tH(s,c){if(s=s.containerInfo,Tb=xm,s=cO(s),ix(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var S=g.anchorOffset,N=g.focusNode;g=g.focusOffset;try{h.nodeType,N.nodeType}catch{h=null;break e}var T=0,L=-1,K=-1,ie=0,pe=0,ve=s,le=null;t:for(;;){for(var fe;ve!==h||S!==0&&ve.nodeType!==3||(L=T+S),ve!==N||g!==0&&ve.nodeType!==3||(K=T+g),ve.nodeType===3&&(T+=ve.nodeValue.length),(fe=ve.firstChild)!==null;)le=ve,ve=fe;for(;;){if(ve===s)break t;if(le===h&&++ie===S&&(L=T),le===N&&++pe===g&&(K=T),(fe=ve.nextSibling)!==null)break;ve=le,le=ve.parentNode}ve=fe}h=L===-1||K===-1?null:{start:L,end:K}}else h=null}h=h||{start:0,end:0}}else h=null;for(Pb={focusedElem:s,selectionRange:h},xm=!1,Qn=c;Qn!==null;)if(c=Qn,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,Qn=s;else for(;Qn!==null;){switch(c=Qn,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++)S=s[h],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&N!==null){s=void 0,h=c,S=N.memoizedProps,N=N.memoizedState,g=h.stateNode;try{var Me=fl(h.type,S);s=g.getSnapshotBeforeUpdate(Me,N),g.__reactInternalSnapshotBeforeUpdate=s}catch(Ye){$t(h,h.return,Ye)}}break;case 3:if((s&1024)!==0){if(s=c.stateNode.containerInfo,h=s.nodeType,h===9)Mb(s);else if(h===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Mb(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,Qn=s;break}Qn=c.return}}function XE(s,c,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:cs(s,h),g&4&&nf(5,h);break;case 1:if(cs(s,h),g&4)if(s=h.stateNode,c===null)try{s.componentDidMount()}catch(T){$t(h,h.return,T)}else{var S=fl(h.type,c.memoizedProps);c=c.memoizedState;try{s.componentDidUpdate(S,c,s.__reactInternalSnapshotBeforeUpdate)}catch(T){$t(h,h.return,T)}}g&64&&GE(h),g&512&&rf(h,h.return);break;case 3:if(cs(s,h),g&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{MO(s,c)}catch(T){$t(h,h.return,T)}}break;case 27:c===null&&g&4&&ZE(h);case 26:case 5:cs(s,h),c===null&&g&4&&QE(h),g&512&&rf(h,h.return);break;case 12:cs(s,h);break;case 31:cs(s,h),g&4&&t_(s,h);break;case 13:cs(s,h),g&4&&n_(s,h),g&64&&(s=h.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(h=uH.bind(null,h),_H(s,h))));break;case 22:if(g=h.memoizedState!==null||os,!g){c=c!==null&&c.memoizedState!==null||Mn,S=os;var N=Mn;os=g,(Mn=c)&&!N?us(s,h,(h.subtreeFlags&8772)!==0):cs(s,h),os=S,Mn=N}break;case 30:break;default:cs(s,h)}}function JE(s){var c=s.alternate;c!==null&&(s.alternate=null,JE(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 ln=null,Ur=!1;function ls(s,c,h){for(h=h.child;h!==null;)e_(s,c,h),h=h.sibling}function e_(s,c,h){if(Qe&&typeof Qe.onCommitFiberUnmount=="function")try{Qe.onCommitFiberUnmount(xn,h)}catch{}switch(h.tag){case 26:Mn||ka(h,c),ls(s,c,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Mn||ka(h,c);var g=ln,S=Ur;ao(h.type)&&(ln=h.stateNode,Ur=!1),ls(s,c,h),hf(h.stateNode),ln=g,Ur=S;break;case 5:Mn||ka(h,c);case 6:if(g=ln,S=Ur,ln=null,ls(s,c,h),ln=g,Ur=S,ln!==null)if(Ur)try{(ln.nodeType===9?ln.body:ln.nodeName==="HTML"?ln.ownerDocument.body:ln).removeChild(h.stateNode)}catch(N){$t(h,c,N)}else try{ln.removeChild(h.stateNode)}catch(N){$t(h,c,N)}break;case 18:ln!==null&&(Ur?(s=ln,G_(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,h.stateNode),tu(s)):G_(ln,h.stateNode));break;case 4:g=ln,S=Ur,ln=h.stateNode.containerInfo,Ur=!0,ls(s,c,h),ln=g,Ur=S;break;case 0:case 11:case 14:case 15:Xs(2,h,c),Mn||Xs(4,h,c),ls(s,c,h);break;case 1:Mn||(ka(h,c),g=h.stateNode,typeof g.componentWillUnmount=="function"&&VE(h,c,g)),ls(s,c,h);break;case 21:ls(s,c,h);break;case 22:Mn=(g=Mn)||h.memoizedState!==null,ls(s,c,h),Mn=g;break;default:ls(s,c,h)}}function t_(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{tu(s)}catch(h){$t(c,c.return,h)}}}function n_(s,c){if(c.memoizedState===null&&(s=c.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{tu(s)}catch(h){$t(c,c.return,h)}}function nH(s){switch(s.tag){case 31:case 13:case 19:var c=s.stateNode;return c===null&&(c=s.stateNode=new WE),c;case 22:return s=s.stateNode,c=s._retryCache,c===null&&(c=s._retryCache=new WE),c;default:throw Error(r(435,s.tag))}}function Jp(s,c){var h=nH(s);c.forEach(function(g){if(!h.has(g)){h.add(g);var S=dH.bind(null,s,g);g.then(S,S)}})}function qr(s,c){var h=c.deletions;if(h!==null)for(var g=0;g<h.length;g++){var S=h[g],N=s,T=c,L=T;e:for(;L!==null;){switch(L.tag){case 27:if(ao(L.type)){ln=L.stateNode,Ur=!1;break e}break;case 5:ln=L.stateNode,Ur=!1;break e;case 3:case 4:ln=L.stateNode.containerInfo,Ur=!0;break e}L=L.return}if(ln===null)throw Error(r(160));e_(N,T,S),ln=null,Ur=!1,N=S.alternate,N!==null&&(N.return=null),S.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)r_(c,s),c=c.sibling}var ea=null;function r_(s,c){var h=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:qr(c,s),Fr(s),g&4&&(Xs(3,s,s.return),nf(3,s),Xs(5,s,s.return));break;case 1:qr(c,s),Fr(s),g&512&&(Mn||h===null||ka(h,h.return)),g&64&&os&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(h=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var S=ea;if(qr(c,s),Fr(s),g&512&&(Mn||h===null||ka(h,h.return)),g&4){var N=h!==null?h.memoizedState:null;if(g=s.memoizedState,h===null)if(g===null)if(s.stateNode===null){e:{g=s.type,h=s.memoizedProps,S=S.ownerDocument||S;t:switch(g){case"title":N=S.getElementsByTagName("title")[0],(!N||N[Zo]||N[nt]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=S.createElement(g),S.head.insertBefore(N,S.querySelector("head > title"))),ir(N,g,h),N[nt]=s,hn(N),g=N;break e;case"link":var T=rz("link","href",S).get(g+(h.href||""));if(T){for(var L=0;L<T.length;L++)if(N=T[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)){T.splice(L,1);break t}}N=S.createElement(g),ir(N,g,h),S.head.appendChild(N);break;case"meta":if(T=rz("meta","content",S).get(g+(h.content||""))){for(L=0;L<T.length;L++)if(N=T[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)){T.splice(L,1);break t}}N=S.createElement(g),ir(N,g,h),S.head.appendChild(N);break;default:throw Error(r(468,g))}N[nt]=s,hn(N),g=N}s.stateNode=g}else iz(S,s.type,s.stateNode);else s.stateNode=nz(S,g,s.memoizedProps);else N!==g?(N===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):N.count--,g===null?iz(S,s.type,s.stateNode):nz(S,g,s.memoizedProps)):g===null&&s.stateNode!==null&&lb(s,s.memoizedProps,h.memoizedProps)}break;case 27:qr(c,s),Fr(s),g&512&&(Mn||h===null||ka(h,h.return)),h!==null&&g&4&&lb(s,s.memoizedProps,h.memoizedProps);break;case 5:if(qr(c,s),Fr(s),g&512&&(Mn||h===null||ka(h,h.return)),s.flags&32){S=s.stateNode;try{Nc(S,"")}catch(Me){$t(s,s.return,Me)}}g&4&&s.stateNode!=null&&(S=s.memoizedProps,lb(s,S,h!==null?h.memoizedProps:S)),g&1024&&(db=!0);break;case 6:if(qr(c,s),Fr(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,h=s.stateNode;try{h.nodeValue=g}catch(Me){$t(s,s.return,Me)}}break;case 3:if(mm=null,S=ea,ea=hm(c.containerInfo),qr(c,s),ea=S,Fr(s),g&4&&h!==null&&h.memoizedState.isDehydrated)try{tu(c.containerInfo)}catch(Me){$t(s,s.return,Me)}db&&(db=!1,i_(s));break;case 4:g=ea,ea=hm(s.stateNode.containerInfo),qr(c,s),Fr(s),ea=g;break;case 12:qr(c,s),Fr(s);break;case 31:qr(c,s),Fr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Jp(s,g)));break;case 13:qr(c,s),Fr(s),s.child.flags&8192&&s.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(tm=yt()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Jp(s,g)));break;case 22:S=s.memoizedState!==null;var K=h!==null&&h.memoizedState!==null,ie=os,pe=Mn;if(os=ie||S,Mn=pe||K,qr(c,s),Mn=pe,os=ie,Fr(s),g&8192)e:for(c=s.stateNode,c._visibility=S?c._visibility&-2:c._visibility|1,S&&(h===null||K||os||Mn||hl(s)),h=null,c=s;;){if(c.tag===5||c.tag===26){if(h===null){K=h=c;try{if(N=K.stateNode,S)T=N.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{L=K.stateNode;var ve=K.memoizedProps.style,le=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;L.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch(Me){$t(K,K.return,Me)}}}else if(c.tag===6){if(h===null){K=c;try{K.stateNode.nodeValue=S?"":K.memoizedProps}catch(Me){$t(K,K.return,Me)}}}else if(c.tag===18){if(h===null){K=c;try{var fe=K.stateNode;S?V_(fe,!0):V_(K.stateNode,!1)}catch(Me){$t(K,K.return,Me)}}}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}g&4&&(g=s.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,Jp(s,h))));break;case 19:qr(c,s),Fr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Jp(s,g)));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,g=s.return;g!==null;){if(YE(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var S=h.stateNode,N=cb(s);Xp(s,N,S);break;case 5:var T=h.stateNode;h.flags&32&&(Nc(T,""),h.flags&=-33);var L=cb(s);Xp(s,L,T);break;case 3:case 4:var K=h.stateNode.containerInfo,ie=cb(s);ub(s,ie,K);break;default:throw Error(r(161))}}catch(pe){$t(s,s.return,pe)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function i_(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var c=s;i_(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),s=s.sibling}}function cs(s,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)XE(s,c.alternate,c),c=c.sibling}function hl(s){for(s=s.child;s!==null;){var c=s;switch(c.tag){case 0:case 11:case 14:case 15:Xs(4,c,c.return),hl(c);break;case 1:ka(c,c.return);var h=c.stateNode;typeof h.componentWillUnmount=="function"&&VE(c,c.return,h),hl(c);break;case 27:hf(c.stateNode);case 26:case 5:ka(c,c.return),hl(c);break;case 22:c.memoizedState===null&&hl(c);break;case 30:hl(c);break;default:hl(c)}s=s.sibling}}function us(s,c,h){for(h=h&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var g=c.alternate,S=s,N=c,T=N.flags;switch(N.tag){case 0:case 11:case 15:us(S,N,h),nf(4,N);break;case 1:if(us(S,N,h),g=N,S=g.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(ie){$t(g,g.return,ie)}if(g=N,S=g.updateQueue,S!==null){var L=g.stateNode;try{var K=S.shared.hiddenCallbacks;if(K!==null)for(S.shared.hiddenCallbacks=null,S=0;S<K.length;S++)DO(K[S],L)}catch(ie){$t(g,g.return,ie)}}h&&T&64&&GE(N),rf(N,N.return);break;case 27:ZE(N);case 26:case 5:us(S,N,h),h&&g===null&&T&4&&QE(N),rf(N,N.return);break;case 12:us(S,N,h);break;case 31:us(S,N,h),h&&T&4&&t_(S,N);break;case 13:us(S,N,h),h&&T&4&&n_(S,N);break;case 22:N.memoizedState===null&&us(S,N,h),rf(N,N.return);break;case 30:break;default:us(S,N,h)}c=c.sibling}}function fb(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&&Fd(h))}function hb(s,c){s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&Fd(s))}function ta(s,c,h,g){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)a_(s,c,h,g),c=c.sibling}function a_(s,c,h,g){var S=c.flags;switch(c.tag){case 0:case 11:case 15:ta(s,c,h,g),S&2048&&nf(9,c);break;case 1:ta(s,c,h,g);break;case 3:ta(s,c,h,g),S&2048&&(s=null,c.alternate!==null&&(s=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==s&&(c.refCount++,s!=null&&Fd(s)));break;case 12:if(S&2048){ta(s,c,h,g),s=c.stateNode;try{var N=c.memoizedProps,T=N.id,L=N.onPostCommit;typeof L=="function"&&L(T,c.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(K){$t(c,c.return,K)}}else ta(s,c,h,g);break;case 31:ta(s,c,h,g);break;case 13:ta(s,c,h,g);break;case 23:break;case 22:N=c.stateNode,T=c.alternate,c.memoizedState!==null?N._visibility&2?ta(s,c,h,g):af(s,c):N._visibility&2?ta(s,c,h,g):(N._visibility|=2,Hc(s,c,h,g,(c.subtreeFlags&10256)!==0||!1)),S&2048&&fb(T,c);break;case 24:ta(s,c,h,g),S&2048&&hb(c.alternate,c);break;default:ta(s,c,h,g)}}function Hc(s,c,h,g,S){for(S=S&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var N=s,T=c,L=h,K=g,ie=T.flags;switch(T.tag){case 0:case 11:case 15:Hc(N,T,L,K,S),nf(8,T);break;case 23:break;case 22:var pe=T.stateNode;T.memoizedState!==null?pe._visibility&2?Hc(N,T,L,K,S):af(N,T):(pe._visibility|=2,Hc(N,T,L,K,S)),S&&ie&2048&&fb(T.alternate,T);break;case 24:Hc(N,T,L,K,S),S&&ie&2048&&hb(T.alternate,T);break;default:Hc(N,T,L,K,S)}c=c.sibling}}function af(s,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var h=s,g=c,S=g.flags;switch(g.tag){case 22:af(h,g),S&2048&&fb(g.alternate,g);break;case 24:af(h,g),S&2048&&hb(g.alternate,g);break;default:af(h,g)}c=c.sibling}}var sf=8192;function Kc(s,c,h){if(s.subtreeFlags&sf)for(s=s.child;s!==null;)s_(s,c,h),s=s.sibling}function s_(s,c,h){switch(s.tag){case 26:Kc(s,c,h),s.flags&sf&&s.memoizedState!==null&&qH(h,ea,s.memoizedState,s.memoizedProps);break;case 5:Kc(s,c,h);break;case 3:case 4:var g=ea;ea=hm(s.stateNode.containerInfo),Kc(s,c,h),ea=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=sf,sf=16777216,Kc(s,c,h),sf=g):Kc(s,c,h));break;default:Kc(s,c,h)}}function o_(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 of(s){var c=s.deletions;if((s.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var g=c[h];Qn=g,c_(g,s)}o_(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)l_(s),s=s.sibling}function l_(s){switch(s.tag){case 0:case 11:case 15:of(s),s.flags&2048&&Xs(9,s,s.return);break;case 3:of(s);break;case 12:of(s);break;case 22:var c=s.stateNode;s.memoizedState!==null&&c._visibility&2&&(s.return===null||s.return.tag!==13)?(c._visibility&=-3,em(s)):of(s);break;default:of(s)}}function em(s){var c=s.deletions;if((s.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var g=c[h];Qn=g,c_(g,s)}o_(s)}for(s=s.child;s!==null;){switch(c=s,c.tag){case 0:case 11:case 15:Xs(8,c,c.return),em(c);break;case 22:h=c.stateNode,h._visibility&2&&(h._visibility&=-3,em(c));break;default:em(c)}s=s.sibling}}function c_(s,c){for(;Qn!==null;){var h=Qn;switch(h.tag){case 0:case 11:case 15:Xs(8,h,c);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Fd(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,Qn=g;else e:for(h=s;Qn!==null;){g=Qn;var S=g.sibling,N=g.return;if(JE(g),g===h){Qn=null;break e}if(S!==null){S.return=N,Qn=S;break e}Qn=N}}}var rH={getCacheForType:function(s){var c=nr(Pn),h=c.data.get(s);return h===void 0&&(h=s(),c.data.set(s,h)),h},cacheSignal:function(){return nr(Pn).controller.signal}},iH=typeof WeakMap=="function"?WeakMap:Map,Tt=0,Vt=null,vt=null,wt=0,Lt=0,li=null,Js=!1,Gc=!1,pb=!1,ds=0,wn=0,eo=0,pl=0,mb=0,ci=0,Vc=0,lf=null,Hr=null,gb=!1,tm=0,u_=0,nm=1/0,rm=null,to=null,Bn=0,no=null,Qc=null,fs=0,yb=0,vb=null,d_=null,cf=0,xb=null;function ui(){return(Tt&2)!==0&&wt!==0?wt&-wt:H.T!==null?kb():zd()}function f_(){if(ci===0)if((wt&536870912)===0||Nt){var s=va;va<<=1,(va&3932160)===0&&(va=262144),ci=s}else ci=536870912;return s=si.current,s!==null&&(s.flags|=32),ci}function Kr(s,c,h){(s===Vt&&(Lt===2||Lt===9)||s.cancelPendingCommit!==null)&&(Yc(s,0),ro(s,wt,ci,!1)),Yt(s,h),((Tt&2)===0||s!==Vt)&&(s===Vt&&((Tt&2)===0&&(pl|=h),wn===4&&ro(s,wt,ci,!1)),Ca(s))}function h_(s,c,h){if((Tt&6)!==0)throw Error(r(327));var g=!h&&(c&127)===0&&(c&s.expiredLanes)===0||Je(s,c),S=g?oH(s,c):wb(s,c,!0),N=g;do{if(S===0){Gc&&!g&&ro(s,c,0,!1);break}else{if(h=s.current.alternate,N&&!aH(h)){S=wb(s,c,!1),N=!1;continue}if(S===2){if(N=c,s.errorRecoveryDisabledLanes&N)var T=0;else T=s.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){c=T;e:{var L=s;S=lf;var K=L.current.memoizedState.isDehydrated;if(K&&(Yc(L,T).flags|=256),T=wb(L,T,!1),T!==2){if(pb&&!K){L.errorRecoveryDisabledLanes|=N,pl|=N,S=4;break e}N=Hr,Hr=S,N!==null&&(Hr===null?Hr=N:Hr.push.apply(Hr,N))}S=T}if(N=!1,S!==2)continue}}if(S===1){Yc(s,0),ro(s,c,0,!0);break}e:{switch(g=s,N=S,N){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:ro(g,c,ci,!Js);break e;case 2:Hr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(S=tm+300-yt(),10<S)){if(ro(g,c,ci,!Js),tt(g,0,!0)!==0)break e;fs=c,g.timeoutHandle=H_(p_.bind(null,g,h,Hr,rm,gb,c,ci,pl,Vc,Js,N,"Throttled",-0,0),S);break e}p_(g,h,Hr,rm,gb,c,ci,pl,Vc,Js,N,null,-0,0)}}break}while(!0);Ca(s)}function p_(s,c,h,g,S,N,T,L,K,ie,pe,ve,le,fe){if(s.timeoutHandle=-1,ve=c.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wa},s_(c,N,ve);var Me=(N&62914560)===N?tm-yt():(N&4194048)===N?u_-yt():0;if(Me=FH(ve,Me),Me!==null){fs=N,s.cancelPendingCommit=Me(S_.bind(null,s,c,N,h,g,S,T,L,K,pe,ve,null,le,fe)),ro(s,N,T,!ie);return}}S_(s,c,N,h,g,S,T,L,K)}function aH(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 g=0;g<h.length;g++){var S=h[g],N=S.getSnapshot;S=S.value;try{if(!ii(N(),S))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 ro(s,c,h,g){c&=~mb,c&=~pl,s.suspendedLanes|=c,s.pingedLanes&=~c,g&&(s.warmLanes|=c),g=s.expirationTimes;for(var S=c;0<S;){var N=31-Xe(S),T=1<<N;g[N]=-1,S&=~T}h!==0&&xa(s,h,c)}function im(){return(Tt&6)===0?(uf(0),!1):!0}function bb(){if(vt!==null){if(Lt===0)var s=vt.return;else s=vt,ts=al=null,Mx(s),$c=null,Kd=0,s=vt;for(;s!==null;)KE(s.alternate,s),s=s.return;vt=null}}function Yc(s,c){var h=s.timeoutHandle;h!==-1&&(s.timeoutHandle=-1,kH(h)),h=s.cancelPendingCommit,h!==null&&(s.cancelPendingCommit=null,h()),fs=0,bb(),Vt=s,vt=h=Ja(s.current,null),wt=c,Lt=0,li=null,Js=!1,Gc=Je(s,c),pb=!1,Vc=ci=mb=pl=eo=wn=0,Hr=lf=null,gb=!1,(c&8)!==0&&(c|=c&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=c;0<g;){var S=31-Xe(g),N=1<<S;c|=s[S],g&=~N}return ds=c,kp(),h}function m_(s,c){lt=null,H.H=Jd,c===Lc||c===Pp?(c=zO(),Lt=3):c===Nx?(c=zO(),Lt=4):Lt=c===Xx?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,li=c,vt===null&&(wn=1,Vp(s,ki(c,s.current)))}function g_(){var s=si.current;return s===null?!0:(wt&4194048)===wt?Ei===null:(wt&62914560)===wt||(wt&536870912)!==0?s===Ei:!1}function y_(){var s=H.H;return H.H=Jd,s===null?Jd:s}function v_(){var s=H.A;return H.A=rH,s}function am(){wn=4,Js||(wt&4194048)!==wt&&si.current!==null||(Gc=!0),(eo&134217727)===0&&(pl&134217727)===0||Vt===null||ro(Vt,wt,ci,!1)}function wb(s,c,h){var g=Tt;Tt|=2;var S=y_(),N=v_();(Vt!==s||wt!==c)&&(rm=null,Yc(s,c)),c=!1;var T=wn;e:do try{if(Lt!==0&&vt!==null){var L=vt,K=li;switch(Lt){case 8:bb(),T=6;break e;case 3:case 2:case 9:case 6:si.current===null&&(c=!0);var ie=Lt;if(Lt=0,li=null,Zc(s,L,K,ie),h&&Gc){T=0;break e}break;default:ie=Lt,Lt=0,li=null,Zc(s,L,K,ie)}}sH(),T=wn;break}catch(pe){m_(s,pe)}while(!0);return c&&s.shellSuspendCounter++,ts=al=null,Tt=g,H.H=S,H.A=N,vt===null&&(Vt=null,wt=0,kp()),T}function sH(){for(;vt!==null;)x_(vt)}function oH(s,c){var h=Tt;Tt|=2;var g=y_(),S=v_();Vt!==s||wt!==c?(rm=null,nm=yt()+500,Yc(s,c)):Gc=Je(s,c);e:do try{if(Lt!==0&&vt!==null){c=vt;var N=li;t:switch(Lt){case 1:Lt=0,li=null,Zc(s,c,N,1);break;case 2:case 9:if(EO(N)){Lt=0,li=null,b_(c);break}c=function(){Lt!==2&&Lt!==9||Vt!==s||(Lt=7),Ca(s)},N.then(c,c);break e;case 3:Lt=7;break e;case 4:Lt=5;break e;case 7:EO(N)?(Lt=0,li=null,b_(c)):(Lt=0,li=null,Zc(s,c,N,7));break;case 5:var T=null;switch(vt.tag){case 26:T=vt.memoizedState;case 5:case 27:var L=vt;if(T?az(T):L.stateNode.complete){Lt=0,li=null;var K=L.sibling;if(K!==null)vt=K;else{var ie=L.return;ie!==null?(vt=ie,sm(ie)):vt=null}break t}}Lt=0,li=null,Zc(s,c,N,5);break;case 6:Lt=0,li=null,Zc(s,c,N,6);break;case 8:bb(),wn=6;break e;default:throw Error(r(462))}}lH();break}catch(pe){m_(s,pe)}while(!0);return ts=al=null,H.H=g,H.A=S,Tt=h,vt!==null?0:(Vt=null,wt=0,kp(),wn)}function lH(){for(;vt!==null&&!Ze();)x_(vt)}function x_(s){var c=FE(s.alternate,s,ds);s.memoizedProps=s.pendingProps,c===null?sm(s):vt=c}function b_(s){var c=s,h=c.alternate;switch(c.tag){case 15:case 0:c=IE(h,c,c.pendingProps,c.type,void 0,wt);break;case 11:c=IE(h,c,c.pendingProps,c.type.render,c.ref,wt);break;case 5:Mx(c);default:KE(h,c),c=vt=vO(c,ds),c=FE(h,c,ds)}s.memoizedProps=s.pendingProps,c===null?sm(s):vt=c}function Zc(s,c,h,g){ts=al=null,Mx(c),$c=null,Kd=0;var S=c.return;try{if(Z9(s,S,c,h,wt)){wn=1,Vp(s,ki(h,s.current)),vt=null;return}}catch(N){if(S!==null)throw vt=S,N;wn=1,Vp(s,ki(h,s.current)),vt=null;return}c.flags&32768?(Nt||g===1?s=!0:Gc||(wt&536870912)!==0?s=!1:(Js=s=!0,(g===2||g===9||g===3||g===6)&&(g=si.current,g!==null&&g.tag===13&&(g.flags|=16384))),w_(c,s)):sm(c)}function sm(s){var c=s;do{if((c.flags&32768)!==0){w_(c,Js);return}s=c.return;var h=J9(c.alternate,c,ds);if(h!==null){vt=h;return}if(c=c.sibling,c!==null){vt=c;return}vt=c=s}while(c!==null);wn===0&&(wn=5)}function w_(s,c){do{var h=eH(s.alternate,s);if(h!==null){h.flags&=32767,vt=h;return}if(h=s.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!c&&(s=s.sibling,s!==null)){vt=s;return}vt=s=h}while(s!==null);wn=6,vt=null}function S_(s,c,h,g,S,N,T,L,K){s.cancelPendingCommit=null;do om();while(Bn!==0);if((Tt&6)!==0)throw Error(r(327));if(c!==null){if(c===s.current)throw Error(r(177));if(N=c.lanes|c.childLanes,N|=cx,bi(s,h,N,T,L,K),s===Vt&&(vt=Vt=null,wt=0),Qc=c,no=s,fs=h,yb=N,vb=S,d_=g,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,fH(Ie,function(){return A_(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||g){g=H.T,H.T=null,S=J.p,J.p=2,T=Tt,Tt|=4;try{tH(s,c,h)}finally{Tt=T,J.p=S,H.T=g}}Bn=1,j_(),N_(),k_()}}function j_(){if(Bn===1){Bn=0;var s=no,c=Qc,h=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||h){h=H.T,H.T=null;var g=J.p;J.p=2;var S=Tt;Tt|=4;try{r_(c,s);var N=Pb,T=cO(s.containerInfo),L=N.focusedElem,K=N.selectionRange;if(T!==L&&L&&L.ownerDocument&&lO(L.ownerDocument.documentElement,L)){if(K!==null&&ix(L)){var ie=K.start,pe=K.end;if(pe===void 0&&(pe=ie),"selectionStart"in L)L.selectionStart=ie,L.selectionEnd=Math.min(pe,L.value.length);else{var ve=L.ownerDocument||document,le=ve&&ve.defaultView||window;if(le.getSelection){var fe=le.getSelection(),Me=L.textContent.length,Ye=Math.min(K.start,Me),Ft=K.end===void 0?Ye:Math.min(K.end,Me);!fe.extend&&Ye>Ft&&(T=Ft,Ft=Ye,Ye=T);var te=oO(L,Ye),Y=oO(L,Ft);if(te&&Y&&(fe.rangeCount!==1||fe.anchorNode!==te.node||fe.anchorOffset!==te.offset||fe.focusNode!==Y.node||fe.focusOffset!==Y.offset)){var re=ve.createRange();re.setStart(te.node,te.offset),fe.removeAllRanges(),Ye>Ft?(fe.addRange(re),fe.extend(Y.node,Y.offset)):(re.setEnd(Y.node,Y.offset),fe.addRange(re))}}}}for(ve=[],fe=L;fe=fe.parentNode;)fe.nodeType===1&&ve.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<ve.length;L++){var ye=ve[L];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}xm=!!Tb,Pb=Tb=null}finally{Tt=S,J.p=g,H.T=h}}s.current=c,Bn=2}}function N_(){if(Bn===2){Bn=0;var s=no,c=Qc,h=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||h){h=H.T,H.T=null;var g=J.p;J.p=2;var S=Tt;Tt|=4;try{XE(s,c.alternate,c)}finally{Tt=S,J.p=g,H.T=h}}Bn=3}}function k_(){if(Bn===4||Bn===3){Bn=0,Dt();var s=no,c=Qc,h=fs,g=d_;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Bn=5:(Bn=0,Qc=no=null,C_(s,s.pendingLanes));var S=s.pendingLanes;if(S===0&&(to=null),_d(h),c=c.stateNode,Qe&&typeof Qe.onCommitFiberRoot=="function")try{Qe.onCommitFiberRoot(xn,c,void 0,(c.current.flags&128)===128)}catch{}if(g!==null){c=H.T,S=J.p,J.p=2,H.T=null;try{for(var N=s.onRecoverableError,T=0;T<g.length;T++){var L=g[T];N(L.value,{componentStack:L.stack})}}finally{H.T=c,J.p=S}}(fs&3)!==0&&om(),Ca(s),S=s.pendingLanes,(h&261930)!==0&&(S&42)!==0?s===xb?cf++:(cf=0,xb=s):cf=0,uf(0)}}function C_(s,c){(s.pooledCacheLanes&=c)===0&&(c=s.pooledCache,c!=null&&(s.pooledCache=null,Fd(c)))}function om(){return j_(),N_(),k_(),A_()}function A_(){if(Bn!==5)return!1;var s=no,c=yb;yb=0;var h=_d(fs),g=H.T,S=J.p;try{J.p=32>h?32:h,H.T=null,h=vb,vb=null;var N=no,T=fs;if(Bn=0,Qc=no=null,fs=0,(Tt&6)!==0)throw Error(r(331));var L=Tt;if(Tt|=4,l_(N.current),a_(N,N.current,T,h),Tt=L,uf(0,!1),Qe&&typeof Qe.onPostCommitFiberRoot=="function")try{Qe.onPostCommitFiberRoot(xn,N)}catch{}return!0}finally{J.p=S,H.T=g,C_(s,c)}}function O_(s,c,h){c=ki(h,c),c=Wx(s.stateNode,c,2),s=Ys(s,c,2),s!==null&&(Yt(s,2),Ca(s))}function $t(s,c,h){if(s.tag===3)O_(s,s,h);else for(;c!==null;){if(c.tag===3){O_(c,s,h);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(to===null||!to.has(g))){s=ki(h,s),h=EE(2),g=Ys(c,h,2),g!==null&&(_E(h,g,c,s),Yt(g,2),Ca(g));break}}c=c.return}}function Sb(s,c,h){var g=s.pingCache;if(g===null){g=s.pingCache=new iH;var S=new Set;g.set(c,S)}else S=g.get(c),S===void 0&&(S=new Set,g.set(c,S));S.has(h)||(pb=!0,S.add(h),s=cH.bind(null,s,c,h),c.then(s,s))}function cH(s,c,h){var g=s.pingCache;g!==null&&g.delete(c),s.pingedLanes|=s.suspendedLanes&h,s.warmLanes&=~h,Vt===s&&(wt&h)===h&&(wn===4||wn===3&&(wt&62914560)===wt&&300>yt()-tm?(Tt&2)===0&&Yc(s,0):mb|=h,Vc===wt&&(Vc=0)),Ca(s)}function E_(s,c){c===0&&(c=ri()),s=nl(s,c),s!==null&&(Yt(s,c),Ca(s))}function uH(s){var c=s.memoizedState,h=0;c!==null&&(h=c.retryLane),E_(s,h)}function dH(s,c){var h=0;switch(s.tag){case 31:case 13:var g=s.stateNode,S=s.memoizedState;S!==null&&(h=S.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(c),E_(s,h)}function fH(s,c){return en(s,c)}var lm=null,Wc=null,jb=!1,cm=!1,Nb=!1,io=0;function Ca(s){s!==Wc&&s.next===null&&(Wc===null?lm=Wc=s:Wc=Wc.next=s),cm=!0,jb||(jb=!0,pH())}function uf(s,c){if(!Nb&&cm){Nb=!0;do for(var h=!1,g=lm;g!==null;){if(s!==0){var S=g.pendingLanes;if(S===0)var N=0;else{var T=g.suspendedLanes,L=g.pingedLanes;N=(1<<31-Xe(42|s)+1)-1,N&=S&~(T&~L),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(h=!0,P_(g,N))}else N=wt,N=tt(g,g===Vt?N:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(N&3)===0||Je(g,N)||(h=!0,P_(g,N));g=g.next}while(h);Nb=!1}}function hH(){__()}function __(){cm=jb=!1;var s=0;io!==0&&NH()&&(s=io);for(var c=yt(),h=null,g=lm;g!==null;){var S=g.next,N=z_(g,c);N===0?(g.next=null,h===null?lm=S:h.next=S,S===null&&(Wc=h)):(h=g,(s!==0||(N&3)!==0)&&(cm=!0)),g=S}Bn!==0&&Bn!==5||uf(s),io!==0&&(io=0)}function z_(s,c){for(var h=s.suspendedLanes,g=s.pingedLanes,S=s.expirationTimes,N=s.pendingLanes&-62914561;0<N;){var T=31-Xe(N),L=1<<T,K=S[T];K===-1?((L&h)===0||(L&g)!==0)&&(S[T]=rt(L,c)):K<=c&&(s.expiredLanes|=L),N&=~L}if(c=Vt,h=wt,h=tt(s,s===c?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,h===0||s===c&&(Lt===2||Lt===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&be(g),s.callbackNode=null,s.callbackPriority=0;if((h&3)===0||Je(s,h)){if(c=h&-h,c===s.callbackPriority)return c;switch(g!==null&&be(g),_d(h)){case 2:case 8:h=je;break;case 32:h=Ie;break;case 268435456:h=ct;break;default:h=Ie}return g=T_.bind(null,s),h=en(h,g),s.callbackPriority=c,s.callbackNode=h,c}return g!==null&&g!==null&&be(g),s.callbackPriority=2,s.callbackNode=null,2}function T_(s,c){if(Bn!==0&&Bn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var h=s.callbackNode;if(om()&&s.callbackNode!==h)return null;var g=wt;return g=tt(s,s===Vt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(h_(s,g,c),z_(s,yt()),s.callbackNode!=null&&s.callbackNode===h?T_.bind(null,s):null)}function P_(s,c){if(om())return null;h_(s,c,!0)}function pH(){CH(function(){(Tt&6)!==0?en(ue,hH):__()})}function kb(){if(io===0){var s=Mc;s===0&&(s=vi,vi<<=1,(vi&261888)===0&&(vi=256)),io=s}return io}function R_(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:yp(""+s)}function D_(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 mH(s,c,h,g,S){if(c==="submit"&&h&&h.stateNode===S){var N=R_((S[Ct]||null).action),T=g.submitter;T&&(c=(c=T[Ct]||null)?R_(c.formAction):T.getAttribute("formAction"),c!==null&&(N=c,T=null));var L=new wp("action","action",null,g,S);s.push({event:L,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(io!==0){var K=T?D_(S,T):new FormData(S);Kx(h,{pending:!0,data:K,method:S.method,action:N},null,K)}}else typeof N=="function"&&(L.preventDefault(),K=T?D_(S,T):new FormData(S),Kx(h,{pending:!0,data:K,method:S.method,action:N},N,K))},currentTarget:S}]})}}for(var Cb=0;Cb<lx.length;Cb++){var Ab=lx[Cb],gH=Ab.toLowerCase(),yH=Ab[0].toUpperCase()+Ab.slice(1);Ji(gH,"on"+yH)}Ji(fO,"onAnimationEnd"),Ji(hO,"onAnimationIteration"),Ji(pO,"onAnimationStart"),Ji("dblclick","onDoubleClick"),Ji("focusin","onFocus"),Ji("focusout","onBlur"),Ji(P9,"onTransitionRun"),Ji(R9,"onTransitionStart"),Ji(D9,"onTransitionCancel"),Ji(mO,"onTransitionEnd"),ht("onMouseEnter",["mouseout","mouseover"]),ht("onMouseLeave",["mouseout","mouseover"]),ht("onPointerEnter",["pointerout","pointerover"]),ht("onPointerLeave",["pointerout","pointerover"]),Ya("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ya("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ya("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ya("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ya("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ya("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var df="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(" "),vH=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(df));function M_(s,c){c=(c&4)!==0;for(var h=0;h<s.length;h++){var g=s[h],S=g.event;g=g.listeners;e:{var N=void 0;if(c)for(var T=g.length-1;0<=T;T--){var L=g[T],K=L.instance,ie=L.currentTarget;if(L=L.listener,K!==N&&S.isPropagationStopped())break e;N=L,S.currentTarget=ie;try{N(S)}catch(pe){Np(pe)}S.currentTarget=null,N=K}else for(T=0;T<g.length;T++){if(L=g[T],K=L.instance,ie=L.currentTarget,L=L.listener,K!==N&&S.isPropagationStopped())break e;N=L,S.currentTarget=ie;try{N(S)}catch(pe){Np(pe)}S.currentTarget=null,N=K}}}}function xt(s,c){var h=c[wa];h===void 0&&(h=c[wa]=new Set);var g=s+"__bubble";h.has(g)||(I_(c,s,2,!1),h.add(g))}function Ob(s,c,h){var g=0;c&&(g|=4),I_(h,s,g,c)}var um="_reactListening"+Math.random().toString(36).slice(2);function Eb(s){if(!s[um]){s[um]=!0,Wo.forEach(function(h){h!=="selectionchange"&&(vH.has(h)||Ob(h,!1,s),Ob(h,!0,s))});var c=s.nodeType===9?s:s.ownerDocument;c===null||c[um]||(c[um]=!0,Ob("selectionchange",!1,c))}}function I_(s,c,h,g){switch(fz(c)){case 2:var S=GH;break;case 8:S=VH;break;default:S=Hb}h=S.bind(null,c,h,s),S=void 0,!Y0||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(S=!0),g?S!==void 0?s.addEventListener(c,h,{capture:!0,passive:S}):s.addEventListener(c,h,!0):S!==void 0?s.addEventListener(c,h,{passive:S}):s.addEventListener(c,h,!1)}function _b(s,c,h,g,S){var N=g;if((c&1)===0&&(c&2)===0&&g!==null)e:for(;;){if(g===null)return;var T=g.tag;if(T===3||T===4){var L=g.stateNode.containerInfo;if(L===S)break;if(T===4)for(T=g.return;T!==null;){var K=T.tag;if((K===3||K===4)&&T.stateNode.containerInfo===S)return;T=T.return}for(;L!==null;){if(T=wi(L),T===null)return;if(K=T.tag,K===5||K===6||K===26||K===27){g=N=T;continue e}L=L.parentNode}}g=g.return}qA(function(){var ie=N,pe=V0(h),ve=[];e:{var le=gO.get(s);if(le!==void 0){var fe=wp,Me=s;switch(s){case"keypress":if(xp(h)===0)break e;case"keydown":case"keyup":fe=d9;break;case"focusin":Me="focus",fe=J0;break;case"focusout":Me="blur",fe=J0;break;case"beforeblur":case"afterblur":fe=J0;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":fe=KA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=JF;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=p9;break;case fO:case hO:case pO:fe=n9;break;case mO:fe=g9;break;case"scroll":case"scrollend":fe=WF;break;case"wheel":fe=v9;break;case"copy":case"cut":case"paste":fe=i9;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=VA;break;case"toggle":case"beforetoggle":fe=b9}var Ye=(c&4)!==0,Ft=!Ye&&(s==="scroll"||s==="scrollend"),te=Ye?le!==null?le+"Capture":null:le;Ye=[];for(var Y=ie,re;Y!==null;){var ye=Y;if(re=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||re===null||te===null||(ye=Td(Y,te),ye!=null&&Ye.push(ff(Y,ye,re))),Ft)break;Y=Y.return}0<Ye.length&&(le=new fe(le,Me,null,h,pe),ve.push({event:le,listeners:Ye}))}}if((c&7)===0){e:{if(le=s==="mouseover"||s==="pointerover",fe=s==="mouseout"||s==="pointerout",le&&h!==G0&&(Me=h.relatedTarget||h.fromElement)&&(wi(Me)||Me[Cn]))break e;if((fe||le)&&(le=pe.window===pe?pe:(le=pe.ownerDocument)?le.defaultView||le.parentWindow:window,fe?(Me=h.relatedTarget||h.toElement,fe=ie,Me=Me?wi(Me):null,Me!==null&&(Ft=a(Me),Ye=Me.tag,Me!==Ft||Ye!==5&&Ye!==27&&Ye!==6)&&(Me=null)):(fe=null,Me=ie),fe!==Me)){if(Ye=KA,ye="onMouseLeave",te="onMouseEnter",Y="mouse",(s==="pointerout"||s==="pointerover")&&(Ye=VA,ye="onPointerLeave",te="onPointerEnter",Y="pointer"),Ft=fe==null?le:Bs(fe),re=Me==null?le:Bs(Me),le=new Ye(ye,Y+"leave",fe,h,pe),le.target=Ft,le.relatedTarget=re,ye=null,wi(pe)===ie&&(Ye=new Ye(te,Y+"enter",Me,h,pe),Ye.target=re,Ye.relatedTarget=Ft,ye=Ye),Ft=ye,fe&&Me)t:{for(Ye=xH,te=fe,Y=Me,re=0,ye=te;ye;ye=Ye(ye))re++;ye=0;for(var He=Y;He;He=Ye(He))ye++;for(;0<re-ye;)te=Ye(te),re--;for(;0<ye-re;)Y=Ye(Y),ye--;for(;re--;){if(te===Y||Y!==null&&te===Y.alternate){Ye=te;break t}te=Ye(te),Y=Ye(Y)}Ye=null}else Ye=null;fe!==null&&L_(ve,le,fe,Ye,!1),Me!==null&&Ft!==null&&L_(ve,Ft,Me,Ye,!0)}}e:{if(le=ie?Bs(ie):window,fe=le.nodeName&&le.nodeName.toLowerCase(),fe==="select"||fe==="input"&&le.type==="file")var Et=tO;else if(JA(le))if(nO)Et=_9;else{Et=O9;var Be=A9}else fe=le.nodeName,!fe||fe.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?ie&&K0(ie.elementType)&&(Et=tO):Et=E9;if(Et&&(Et=Et(s,ie))){eO(ve,Et,h,pe);break e}Be&&Be(s,le,ie),s==="focusout"&&ie&&le.type==="number"&&ie.memoizedProps.value!=null&&H0(le,"number",le.value)}switch(Be=ie?Bs(ie):window,s){case"focusin":(JA(Be)||Be.contentEditable==="true")&&(Oc=Be,ax=ie,Bd=null);break;case"focusout":Bd=ax=Oc=null;break;case"mousedown":sx=!0;break;case"contextmenu":case"mouseup":case"dragend":sx=!1,uO(ve,h,pe);break;case"selectionchange":if(T9)break;case"keydown":case"keyup":uO(ve,h,pe)}var ut;if(tx)e:{switch(s){case"compositionstart":var St="onCompositionStart";break e;case"compositionend":St="onCompositionEnd";break e;case"compositionupdate":St="onCompositionUpdate";break e}St=void 0}else Ac?WA(s,h)&&(St="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(St="onCompositionStart");St&&(QA&&h.locale!=="ko"&&(Ac||St!=="onCompositionStart"?St==="onCompositionEnd"&&Ac&&(ut=FA()):(qs=pe,Z0="value"in qs?qs.value:qs.textContent,Ac=!0)),Be=dm(ie,St),0<Be.length&&(St=new GA(St,s,null,h,pe),ve.push({event:St,listeners:Be}),ut?St.data=ut:(ut=XA(h),ut!==null&&(St.data=ut)))),(ut=S9?j9(s,h):N9(s,h))&&(St=dm(ie,"onBeforeInput"),0<St.length&&(Be=new GA("onBeforeInput","beforeinput",null,h,pe),ve.push({event:Be,listeners:St}),Be.data=ut)),mH(ve,s,ie,h,pe)}M_(ve,c)})}function ff(s,c,h){return{instance:s,listener:c,currentTarget:h}}function dm(s,c){for(var h=c+"Capture",g=[];s!==null;){var S=s,N=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||N===null||(S=Td(s,h),S!=null&&g.unshift(ff(s,S,N)),S=Td(s,c),S!=null&&g.push(ff(s,S,N))),s.tag===3)return g;s=s.return}return[]}function xH(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function L_(s,c,h,g,S){for(var N=c._reactName,T=[];h!==null&&h!==g;){var L=h,K=L.alternate,ie=L.stateNode;if(L=L.tag,K!==null&&K===g)break;L!==5&&L!==26&&L!==27||ie===null||(K=ie,S?(ie=Td(h,N),ie!=null&&T.unshift(ff(h,ie,K))):S||(ie=Td(h,N),ie!=null&&T.push(ff(h,ie,K)))),h=h.return}T.length!==0&&s.push({event:c,listeners:T})}var bH=/\r\n?/g,wH=/\u0000|\uFFFD/g;function $_(s){return(typeof s=="string"?s:""+s).replace(bH,`
|
|
9
|
+
`).replace(wH,"")}function B_(s,c){return c=$_(c),$_(s)===c}function qt(s,c,h,g,S,N){switch(h){case"children":typeof g=="string"?c==="body"||c==="textarea"&&g===""||Nc(s,g):(typeof g=="number"||typeof g=="bigint")&&c!=="body"&&Nc(s,""+g);break;case"className":mp(s,"class",g);break;case"tabIndex":mp(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":mp(s,h,g);break;case"style":BA(s,g,N);break;case"data":if(c!=="object"){mp(s,"data",g);break}case"src":case"href":if(g===""&&(c!=="a"||h!=="href")){s.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=yp(""+g),s.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="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"&&qt(s,c,"name",S.name,S,null),qt(s,c,"formEncType",S.formEncType,S,null),qt(s,c,"formMethod",S.formMethod,S,null),qt(s,c,"formTarget",S.formTarget,S,null)):(qt(s,c,"encType",S.encType,S,null),qt(s,c,"method",S.method,S,null),qt(s,c,"target",S.target,S,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=yp(""+g),s.setAttribute(h,g);break;case"onClick":g!=null&&(s.onclick=Wa);break;case"onScroll":g!=null&&xt("scroll",s);break;case"onScrollEnd":g!=null&&xt("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(S.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}h=yp(""+g),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":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,""+g):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":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,""):s.removeAttribute(h);break;case"capture":case"download":g===!0?s.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,g):s.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(h,g):s.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(h):s.setAttribute(h,g);break;case"popover":xt("beforetoggle",s),xt("toggle",s),Xo(s,"popover",g);break;case"xlinkActuate":Za(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Za(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Za(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Za(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Za(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Za(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Za(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Za(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Za(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Xo(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=YF.get(h)||h,Xo(s,h,g))}}function zb(s,c,h,g,S,N){switch(h){case"style":BA(s,g,N);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(S.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"children":typeof g=="string"?Nc(s,g):(typeof g=="number"||typeof g=="bigint")&&Nc(s,""+g);break;case"onScroll":g!=null&&xt("scroll",s);break;case"onScrollEnd":g!=null&&xt("scrollend",s);break;case"onClick":g!=null&&(s.onclick=Wa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!pp.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(S=h.endsWith("Capture"),c=h.slice(2,S?h.length-7:void 0),N=s[Ct]||null,N=N!=null?N[h]:null,typeof N=="function"&&s.removeEventListener(c,N,S),typeof g=="function")){typeof N!="function"&&N!==null&&(h in s?s[h]=null:s.hasAttribute(h)&&s.removeAttribute(h)),s.addEventListener(c,g,S);break e}h in s?s[h]=g:g===!0?s.setAttribute(h,""):Xo(s,h,g)}}}function ir(s,c,h){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xt("error",s),xt("load",s);var g=!1,S=!1,N;for(N in h)if(h.hasOwnProperty(N)){var T=h[N];if(T!=null)switch(N){case"src":g=!0;break;case"srcSet":S=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:qt(s,c,N,T,h,null)}}S&&qt(s,c,"srcSet",h.srcSet,h,null),g&&qt(s,c,"src",h.src,h,null);return;case"input":xt("invalid",s);var L=N=T=S=null,K=null,ie=null;for(g in h)if(h.hasOwnProperty(g)){var pe=h[g];if(pe!=null)switch(g){case"name":S=pe;break;case"type":T=pe;break;case"checked":K=pe;break;case"defaultChecked":ie=pe;break;case"value":N=pe;break;case"defaultValue":L=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,c));break;default:qt(s,c,g,pe,h,null)}}MA(s,N,L,K,ie,T,S,!1);return;case"select":xt("invalid",s),g=T=N=null;for(S in h)if(h.hasOwnProperty(S)&&(L=h[S],L!=null))switch(S){case"value":N=L;break;case"defaultValue":T=L;break;case"multiple":g=L;default:qt(s,c,S,L,h,null)}c=N,h=T,s.multiple=!!g,c!=null?jc(s,!!g,c,!1):h!=null&&jc(s,!!g,h,!0);return;case"textarea":xt("invalid",s),N=S=g=null;for(T in h)if(h.hasOwnProperty(T)&&(L=h[T],L!=null))switch(T){case"value":g=L;break;case"defaultValue":S=L;break;case"children":N=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:qt(s,c,T,L,h,null)}LA(s,g,S,N);return;case"option":for(K in h)h.hasOwnProperty(K)&&(g=h[K],g!=null)&&(K==="selected"?s.selected=g&&typeof g!="function"&&typeof g!="symbol":qt(s,c,K,g,h,null));return;case"dialog":xt("beforetoggle",s),xt("toggle",s),xt("cancel",s),xt("close",s);break;case"iframe":case"object":xt("load",s);break;case"video":case"audio":for(g=0;g<df.length;g++)xt(df[g],s);break;case"image":xt("error",s),xt("load",s);break;case"details":xt("toggle",s);break;case"embed":case"source":case"link":xt("error",s),xt("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(ie in h)if(h.hasOwnProperty(ie)&&(g=h[ie],g!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:qt(s,c,ie,g,h,null)}return;default:if(K0(c)){for(pe in h)h.hasOwnProperty(pe)&&(g=h[pe],g!==void 0&&zb(s,c,pe,g,h,void 0));return}}for(L in h)h.hasOwnProperty(L)&&(g=h[L],g!=null&&qt(s,c,L,g,h,null))}function SH(s,c,h,g){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var S=null,N=null,T=null,L=null,K=null,ie=null,pe=null;for(fe in h){var ve=h[fe];if(h.hasOwnProperty(fe)&&ve!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":K=ve;default:g.hasOwnProperty(fe)||qt(s,c,fe,null,g,ve)}}for(var le in g){var fe=g[le];if(ve=h[le],g.hasOwnProperty(le)&&(fe!=null||ve!=null))switch(le){case"type":N=fe;break;case"name":S=fe;break;case"checked":ie=fe;break;case"defaultChecked":pe=fe;break;case"value":T=fe;break;case"defaultValue":L=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,c));break;default:fe!==ve&&qt(s,c,le,fe,g,ve)}}F0(s,T,L,K,ie,pe,N,S);return;case"select":fe=T=L=le=null;for(N in h)if(K=h[N],h.hasOwnProperty(N)&&K!=null)switch(N){case"value":break;case"multiple":fe=K;default:g.hasOwnProperty(N)||qt(s,c,N,null,g,K)}for(S in g)if(N=g[S],K=h[S],g.hasOwnProperty(S)&&(N!=null||K!=null))switch(S){case"value":le=N;break;case"defaultValue":L=N;break;case"multiple":T=N;default:N!==K&&qt(s,c,S,N,g,K)}c=L,h=T,g=fe,le!=null?jc(s,!!h,le,!1):!!g!=!!h&&(c!=null?jc(s,!!h,c,!0):jc(s,!!h,h?[]:"",!1));return;case"textarea":fe=le=null;for(L in h)if(S=h[L],h.hasOwnProperty(L)&&S!=null&&!g.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:qt(s,c,L,null,g,S)}for(T in g)if(S=g[T],N=h[T],g.hasOwnProperty(T)&&(S!=null||N!=null))switch(T){case"value":le=S;break;case"defaultValue":fe=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(r(91));break;default:S!==N&&qt(s,c,T,S,g,N)}IA(s,le,fe);return;case"option":for(var Me in h)le=h[Me],h.hasOwnProperty(Me)&&le!=null&&!g.hasOwnProperty(Me)&&(Me==="selected"?s.selected=!1:qt(s,c,Me,null,g,le));for(K in g)le=g[K],fe=h[K],g.hasOwnProperty(K)&&le!==fe&&(le!=null||fe!=null)&&(K==="selected"?s.selected=le&&typeof le!="function"&&typeof le!="symbol":qt(s,c,K,le,g,fe));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 Ye in h)le=h[Ye],h.hasOwnProperty(Ye)&&le!=null&&!g.hasOwnProperty(Ye)&&qt(s,c,Ye,null,g,le);for(ie in g)if(le=g[ie],fe=h[ie],g.hasOwnProperty(ie)&&le!==fe&&(le!=null||fe!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,c));break;default:qt(s,c,ie,le,g,fe)}return;default:if(K0(c)){for(var Ft in h)le=h[Ft],h.hasOwnProperty(Ft)&&le!==void 0&&!g.hasOwnProperty(Ft)&&zb(s,c,Ft,void 0,g,le);for(pe in g)le=g[pe],fe=h[pe],!g.hasOwnProperty(pe)||le===fe||le===void 0&&fe===void 0||zb(s,c,pe,le,g,fe);return}}for(var te in h)le=h[te],h.hasOwnProperty(te)&&le!=null&&!g.hasOwnProperty(te)&&qt(s,c,te,null,g,le);for(ve in g)le=g[ve],fe=h[ve],!g.hasOwnProperty(ve)||le===fe||le==null&&fe==null||qt(s,c,ve,le,g,fe)}function U_(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function jH(){if(typeof performance.getEntriesByType=="function"){for(var s=0,c=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var S=h[g],N=S.transferSize,T=S.initiatorType,L=S.duration;if(N&&L&&U_(T)){for(T=0,L=S.responseEnd,g+=1;g<h.length;g++){var K=h[g],ie=K.startTime;if(ie>L)break;var pe=K.transferSize,ve=K.initiatorType;pe&&U_(ve)&&(K=K.responseEnd,T+=pe*(K<L?1:(L-ie)/(K-ie)))}if(--g,c+=8*(N+T)/(S.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 Tb=null,Pb=null;function fm(s){return s.nodeType===9?s:s.ownerDocument}function q_(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 F_(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 Rb(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 Db=null;function NH(){var s=window.event;return s&&s.type==="popstate"?s===Db?!1:(Db=s,!0):(Db=null,!1)}var H_=typeof setTimeout=="function"?setTimeout:void 0,kH=typeof clearTimeout=="function"?clearTimeout:void 0,K_=typeof Promise=="function"?Promise:void 0,CH=typeof queueMicrotask=="function"?queueMicrotask:typeof K_<"u"?function(s){return K_.resolve(null).then(s).catch(AH)}:H_;function AH(s){setTimeout(function(){throw s})}function ao(s){return s==="head"}function G_(s,c){var h=c,g=0;do{var S=h.nextSibling;if(s.removeChild(h),S&&S.nodeType===8)if(h=S.data,h==="/$"||h==="/&"){if(g===0){s.removeChild(S),tu(c);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")hf(s.ownerDocument.documentElement);else if(h==="head"){h=s.ownerDocument.head,hf(h);for(var N=h.firstChild;N;){var T=N.nextSibling,L=N.nodeName;N[Zo]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&N.rel.toLowerCase()==="stylesheet"||h.removeChild(N),N=T}}else h==="body"&&hf(s.ownerDocument.body);h=S}while(h);tu(c)}function V_(s,c){var h=s;s=0;do{var g=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||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(s===0)break;s--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||s++;h=g}while(h)}function Mb(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":Mb(h),Sa(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}s.removeChild(h)}}function OH(s,c,h,g){for(;s.nodeType===1;){var S=h;if(s.nodeName.toLowerCase()!==c.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[Zo])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!==S.rel||s.getAttribute("href")!==(S.href==null||S.href===""?null:S.href)||s.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin)||s.getAttribute("title")!==(S.title==null?null:S.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(N=s.getAttribute("src"),(N!==(S.src==null?null:S.src)||s.getAttribute("type")!==(S.type==null?null:S.type)||s.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin))&&N&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(c==="input"&&s.type==="hidden"){var N=S.name==null?null:""+S.name;if(S.type==="hidden"&&s.getAttribute("name")===N)return s}else return s;if(s=_i(s.nextSibling),s===null)break}return null}function EH(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 Q_(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 Ib(s){return s.data==="$?"||s.data==="$~"}function Lb(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function _H(s,c){var h=s.ownerDocument;if(s.data==="$~")s._reactRetry=c;else if(s.data!=="$?"||h.readyState!=="loading")c();else{var g=function(){c(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}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 $b=null;function Y_(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 Z_(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 W_(s,c,h){switch(c=fm(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 hf(s){for(var c=s.attributes;c.length;)s.removeAttributeNode(c[0]);Sa(s)}var zi=new Map,X_=new Set;function hm(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var hs=J.d;J.d={f:zH,r:TH,D:PH,C:RH,L:DH,m:MH,X:LH,S:IH,M:$H};function zH(){var s=hs.f(),c=im();return s||c}function TH(s){var c=Wi(s);c!==null&&c.tag===5&&c.type==="form"?mE(c):hs.r(s)}var Xc=typeof document>"u"?null:document;function J_(s,c,h){var g=Xc;if(g&&typeof c=="string"&&c){var S=ji(c);S='link[rel="'+s+'"][href="'+S+'"]',typeof h=="string"&&(S+='[crossorigin="'+h+'"]'),X_.has(S)||(X_.add(S),s={rel:s,crossOrigin:h,href:c},g.querySelector(S)===null&&(c=g.createElement("link"),ir(c,"link",s),hn(c),g.head.appendChild(c)))}}function PH(s){hs.D(s),J_("dns-prefetch",s,null)}function RH(s,c){hs.C(s,c),J_("preconnect",s,c)}function DH(s,c,h){hs.L(s,c,h);var g=Xc;if(g&&s&&c){var S='link[rel="preload"][as="'+ji(c)+'"]';c==="image"&&h&&h.imageSrcSet?(S+='[imagesrcset="'+ji(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(S+='[imagesizes="'+ji(h.imageSizes)+'"]')):S+='[href="'+ji(s)+'"]';var N=S;switch(c){case"style":N=Jc(s);break;case"script":N=eu(s)}zi.has(N)||(s=m({rel:"preload",href:c==="image"&&h&&h.imageSrcSet?void 0:s,as:c},h),zi.set(N,s),g.querySelector(S)!==null||c==="style"&&g.querySelector(pf(N))||c==="script"&&g.querySelector(mf(N))||(c=g.createElement("link"),ir(c,"link",s),hn(c),g.head.appendChild(c)))}}function MH(s,c){hs.m(s,c);var h=Xc;if(h&&s){var g=c&&typeof c.as=="string"?c.as:"script",S='link[rel="modulepreload"][as="'+ji(g)+'"][href="'+ji(s)+'"]',N=S;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=eu(s)}if(!zi.has(N)&&(s=m({rel:"modulepreload",href:s},c),zi.set(N,s),h.querySelector(S)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(mf(N)))return}g=h.createElement("link"),ir(g,"link",s),hn(g),h.head.appendChild(g)}}}function IH(s,c,h){hs.S(s,c,h);var g=Xc;if(g&&s){var S=Us(g).hoistableStyles,N=Jc(s);c=c||"default";var T=S.get(N);if(!T){var L={loading:0,preload:null};if(T=g.querySelector(pf(N)))L.loading=5;else{s=m({rel:"stylesheet",href:s,"data-precedence":c},h),(h=zi.get(N))&&Bb(s,h);var K=T=g.createElement("link");hn(K),ir(K,"link",s),K._p=new Promise(function(ie,pe){K.onload=ie,K.onerror=pe}),K.addEventListener("load",function(){L.loading|=1}),K.addEventListener("error",function(){L.loading|=2}),L.loading|=4,pm(T,c,g)}T={type:"stylesheet",instance:T,count:1,state:L},S.set(N,T)}}}function LH(s,c){hs.X(s,c);var h=Xc;if(h&&s){var g=Us(h).hoistableScripts,S=eu(s),N=g.get(S);N||(N=h.querySelector(mf(S)),N||(s=m({src:s,async:!0},c),(c=zi.get(S))&&Ub(s,c),N=h.createElement("script"),hn(N),ir(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(S,N))}}function $H(s,c){hs.M(s,c);var h=Xc;if(h&&s){var g=Us(h).hoistableScripts,S=eu(s),N=g.get(S);N||(N=h.querySelector(mf(S)),N||(s=m({src:s,async:!0,type:"module"},c),(c=zi.get(S))&&Ub(s,c),N=h.createElement("script"),hn(N),ir(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(S,N))}}function ez(s,c,h,g){var S=(S=ne.current)?hm(S):null;if(!S)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(c=Jc(h.href),h=Us(S).hoistableStyles,g=h.get(c),g||(g={type:"style",instance:null,count:0,state:null},h.set(c,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){s=Jc(h.href);var N=Us(S).hoistableStyles,T=N.get(s);if(T||(S=S.ownerDocument||S,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(s,T),(N=S.querySelector(pf(s)))&&!N._p&&(T.instance=N,T.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||BH(S,s,h,T.state))),c&&g===null)throw Error(r(528,""));return T}if(c&&g!==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=eu(h),h=Us(S).hoistableScripts,g=h.get(c),g||(g={type:"script",instance:null,count:0,state:null},h.set(c,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Jc(s){return'href="'+ji(s)+'"'}function pf(s){return'link[rel="stylesheet"]['+s+"]"}function tz(s){return m({},s,{"data-precedence":s.precedence,precedence:null})}function BH(s,c,h,g){s.querySelector('link[rel="preload"][as="style"]['+c+"]")?g.loading=1:(c=s.createElement("link"),g.preload=c,c.addEventListener("load",function(){return g.loading|=1}),c.addEventListener("error",function(){return g.loading|=2}),ir(c,"link",h),hn(c),s.head.appendChild(c))}function eu(s){return'[src="'+ji(s)+'"]'}function mf(s){return"script[async]"+s}function nz(s,c,h){if(c.count++,c.instance===null)switch(c.type){case"style":var g=s.querySelector('style[data-href~="'+ji(h.href)+'"]');if(g)return c.instance=g,hn(g),g;var S=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),hn(g),ir(g,"style",S),pm(g,h.precedence,s),c.instance=g;case"stylesheet":S=Jc(h.href);var N=s.querySelector(pf(S));if(N)return c.state.loading|=4,c.instance=N,hn(N),N;g=tz(h),(S=zi.get(S))&&Bb(g,S),N=(s.ownerDocument||s).createElement("link"),hn(N);var T=N;return T._p=new Promise(function(L,K){T.onload=L,T.onerror=K}),ir(N,"link",g),c.state.loading|=4,pm(N,h.precedence,s),c.instance=N;case"script":return N=eu(h.src),(S=s.querySelector(mf(N)))?(c.instance=S,hn(S),S):(g=h,(S=zi.get(N))&&(g=m({},h),Ub(g,S)),s=s.ownerDocument||s,S=s.createElement("script"),hn(S),ir(S,"link",g),s.head.appendChild(S),c.instance=S);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(g=c.instance,c.state.loading|=4,pm(g,h.precedence,s));return c.instance}function pm(s,c,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=g.length?g[g.length-1]:null,N=S,T=0;T<g.length;T++){var L=g[T];if(L.dataset.precedence===c)N=L;else if(N!==S)break}N?N.parentNode.insertBefore(s,N.nextSibling):(c=h.nodeType===9?h.head:h,c.insertBefore(s,c.firstChild))}function Bb(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.title==null&&(s.title=c.title)}function Ub(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.integrity==null&&(s.integrity=c.integrity)}var mm=null;function rz(s,c,h){if(mm===null){var g=new Map,S=mm=new Map;S.set(h,g)}else S=mm,g=S.get(h),g||(g=new Map,S.set(h,g));if(g.has(s))return g;for(g.set(s,null),h=h.getElementsByTagName(s),S=0;S<h.length;S++){var N=h[S];if(!(N[Zo]||N[nt]||s==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var T=N.getAttribute(c)||"";T=s+T;var L=g.get(T);L?L.push(N):g.set(T,[N])}}return g}function iz(s,c,h){s=s.ownerDocument||s,s.head.insertBefore(h,c==="title"?s.querySelector("head > title"):null)}function UH(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 az(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function qH(s,c,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var S=Jc(g.href),N=c.querySelector(pf(S));if(N){c=N._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=gm.bind(s),c.then(s,s)),h.state.loading|=4,h.instance=N,hn(N);return}N=c.ownerDocument||c,g=tz(g),(S=zi.get(S))&&Bb(g,S),N=N.createElement("link"),hn(N);var T=N;T._p=new Promise(function(L,K){T.onload=L,T.onerror=K}),ir(N,"link",g),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=gm.bind(s),c.addEventListener("load",h),c.addEventListener("error",h))}}var qb=0;function FH(s,c){return s.stylesheets&&s.count===0&&vm(s,s.stylesheets),0<s.count||0<s.imgCount?function(h){var g=setTimeout(function(){if(s.stylesheets&&vm(s,s.stylesheets),s.unsuspend){var N=s.unsuspend;s.unsuspend=null,N()}},6e4+c);0<s.imgBytes&&qb===0&&(qb=62500*jH());var S=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&vm(s,s.stylesheets),s.unsuspend)){var N=s.unsuspend;s.unsuspend=null,N()}},(s.imgBytes>qb?50:800)+c);return s.unsuspend=h,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(S)}}:null}function gm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vm(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var ym=null;function vm(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,ym=new Map,c.forEach(HH,s),ym=null,gm.call(s))}function HH(s,c){if(!(c.state.loading&4)){var h=ym.get(s);if(h)var g=h.get(null);else{h=new Map,ym.set(s,h);for(var S=s.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<S.length;N++){var T=S[N];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(h.set(T.dataset.precedence,T),g=T)}g&&h.set(null,g)}S=c.instance,T=S.getAttribute("data-precedence"),N=h.get(T)||g,N===g&&h.set(null,S),h.set(T,S),this.count++,g=gm.bind(this),S.addEventListener("load",g),S.addEventListener("error",g),N?N.parentNode.insertBefore(S,N.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(S,s.firstChild)),c.state.loading|=4}}var gf={$$typeof:C,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function KH(s,c,h,g,S,N,T,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=xi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xi(0),this.hiddenUpdates=xi(null),this.identifierPrefix=g,this.onUncaughtError=S,this.onCaughtError=N,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function sz(s,c,h,g,S,N,T,L,K,ie,pe,ve){return s=new KH(s,c,h,T,K,ie,pe,ve,L),c=1,N===!0&&(c|=24),N=ai(3,null,null,c),s.current=N,N.stateNode=s,c=wx(),c.refCount++,s.pooledCache=c,c.refCount++,N.memoizedState={element:g,isDehydrated:h,cache:c},kx(N),s}function oz(s){return s?(s=zc,s):zc}function lz(s,c,h,g,S,N){S=oz(S),g.context===null?g.context=S:g.pendingContext=S,g=Qs(c),g.payload={element:h},N=N===void 0?null:N,N!==null&&(g.callback=N),h=Ys(s,g,c),h!==null&&(Kr(h,s,c),Vd(h,s,c))}function cz(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<c?h:c}}function Fb(s,c){cz(s,c),(s=s.alternate)&&cz(s,c)}function uz(s){if(s.tag===13||s.tag===31){var c=nl(s,67108864);c!==null&&Kr(c,s,67108864),Fb(s,67108864)}}function dz(s){if(s.tag===13||s.tag===31){var c=ui();c=Ed(c);var h=nl(s,c);h!==null&&Kr(h,s,c),Fb(s,c)}}var xm=!0;function GH(s,c,h,g){var S=H.T;H.T=null;var N=J.p;try{J.p=2,Hb(s,c,h,g)}finally{J.p=N,H.T=S}}function VH(s,c,h,g){var S=H.T;H.T=null;var N=J.p;try{J.p=8,Hb(s,c,h,g)}finally{J.p=N,H.T=S}}function Hb(s,c,h,g){if(xm){var S=Kb(g);if(S===null)_b(s,c,g,bm,h),hz(s,g);else if(YH(S,s,c,h,g))g.stopPropagation();else if(hz(s,g),c&4&&-1<QH.indexOf(s)){for(;S!==null;){var N=Wi(S);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var T=Se(N.pendingLanes);if(T!==0){var L=N;for(L.pendingLanes|=2,L.entangledLanes|=2;T;){var K=1<<31-Xe(T);L.entanglements[1]|=K,T&=~K}Ca(N),(Tt&6)===0&&(nm=yt()+500,uf(0))}}break;case 31:case 13:L=nl(N,2),L!==null&&Kr(L,N,2),im(),Fb(N,2)}if(N=Kb(g),N===null&&_b(s,c,g,bm,h),N===S)break;S=N}S!==null&&g.stopPropagation()}else _b(s,c,g,null,h)}}function Kb(s){return s=V0(s),Gb(s)}var bm=null;function Gb(s){if(bm=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=o(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 bm=s,null}function fz(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(We()){case ue:return 2;case je:return 8;case Ie:case Ve:return 32;case ct:return 268435456;default:return 32}default:return 32}}var Vb=!1,so=null,oo=null,lo=null,yf=new Map,vf=new Map,co=[],QH="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 hz(s,c){switch(s){case"focusin":case"focusout":so=null;break;case"dragenter":case"dragleave":oo=null;break;case"mouseover":case"mouseout":lo=null;break;case"pointerover":case"pointerout":yf.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":vf.delete(c.pointerId)}}function xf(s,c,h,g,S,N){return s===null||s.nativeEvent!==N?(s={blockedOn:c,domEventName:h,eventSystemFlags:g,nativeEvent:N,targetContainers:[S]},c!==null&&(c=Wi(c),c!==null&&uz(c)),s):(s.eventSystemFlags|=g,c=s.targetContainers,S!==null&&c.indexOf(S)===-1&&c.push(S),s)}function YH(s,c,h,g,S){switch(c){case"focusin":return so=xf(so,s,c,h,g,S),!0;case"dragenter":return oo=xf(oo,s,c,h,g,S),!0;case"mouseover":return lo=xf(lo,s,c,h,g,S),!0;case"pointerover":var N=S.pointerId;return yf.set(N,xf(yf.get(N)||null,s,c,h,g,S)),!0;case"gotpointercapture":return N=S.pointerId,vf.set(N,xf(vf.get(N)||null,s,c,h,g,S)),!0}return!1}function pz(s){var c=wi(s.target);if(c!==null){var h=a(c);if(h!==null){if(c=h.tag,c===13){if(c=o(h),c!==null){s.blockedOn=c,Q(s.priority,function(){dz(h)});return}}else if(c===31){if(c=u(h),c!==null){s.blockedOn=c,Q(s.priority,function(){dz(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 wm(s){if(s.blockedOn!==null)return!1;for(var c=s.targetContainers;0<c.length;){var h=Kb(s.nativeEvent);if(h===null){h=s.nativeEvent;var g=new h.constructor(h.type,h);G0=g,h.target.dispatchEvent(g),G0=null}else return c=Wi(h),c!==null&&uz(c),s.blockedOn=h,!1;c.shift()}return!0}function mz(s,c,h){wm(s)&&h.delete(c)}function ZH(){Vb=!1,so!==null&&wm(so)&&(so=null),oo!==null&&wm(oo)&&(oo=null),lo!==null&&wm(lo)&&(lo=null),yf.forEach(mz),vf.forEach(mz)}function Sm(s,c){s.blockedOn===c&&(s.blockedOn=null,Vb||(Vb=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ZH)))}var jm=null;function gz(s){jm!==s&&(jm=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){jm===s&&(jm=null);for(var c=0;c<s.length;c+=3){var h=s[c],g=s[c+1],S=s[c+2];if(typeof g!="function"){if(Gb(g||h)===null)continue;break}var N=Wi(h);N!==null&&(s.splice(c,3),c-=3,Kx(N,{pending:!0,data:S,method:h.method,action:g},g,S))}}))}function tu(s){function c(K){return Sm(K,s)}so!==null&&Sm(so,s),oo!==null&&Sm(oo,s),lo!==null&&Sm(lo,s),yf.forEach(c),vf.forEach(c);for(var h=0;h<co.length;h++){var g=co[h];g.blockedOn===s&&(g.blockedOn=null)}for(;0<co.length&&(h=co[0],h.blockedOn===null);)pz(h),h.blockedOn===null&&co.shift();if(h=(s.ownerDocument||s).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var S=h[g],N=h[g+1],T=S[Ct]||null;if(typeof N=="function")T||gz(h);else if(T){var L=null;if(N&&N.hasAttribute("formAction")){if(S=N,T=N[Ct]||null)L=T.formAction;else if(Gb(S)!==null)continue}else L=T.action;typeof L=="function"?h[g+1]=L:(h.splice(g,3),g-=3),gz(h)}}}function yz(){function s(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(T){return S=T})},focusReset:"manual",scroll:"manual"})}function c(){S!==null&&(S(),S=null),g||setTimeout(h,20)}function h(){if(!g&&!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 g=!1,S=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),S!==null&&(S(),S=null)}}}function Qb(s){this._internalRoot=s}Nm.prototype.render=Qb.prototype.render=function(s){var c=this._internalRoot;if(c===null)throw Error(r(409));var h=c.current,g=ui();lz(h,g,s,c,null,null)},Nm.prototype.unmount=Qb.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var c=s.containerInfo;lz(s.current,2,null,s,null,null),im(),c[Cn]=null}};function Nm(s){this._internalRoot=s}Nm.prototype.unstable_scheduleHydration=function(s){if(s){var c=zd();s={blockedOn:null,target:s,priority:c};for(var h=0;h<co.length&&c!==0&&c<co[h].priority;h++);co.splice(h,0,s),h===0&&pz(s)}};var vz=t.version;if(vz!=="19.2.4")throw Error(r(527,vz,"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 WH={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var km=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!km.isDisabled&&km.supportsFiber)try{xn=km.inject(WH),Qe=km}catch{}}return wf.createRoot=function(s,c){if(!i(s))throw Error(r(299));var h=!1,g="",S=kE,N=CE,T=AE;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onUncaughtError!==void 0&&(S=c.onUncaughtError),c.onCaughtError!==void 0&&(N=c.onCaughtError),c.onRecoverableError!==void 0&&(T=c.onRecoverableError)),c=sz(s,1,!1,null,null,h,g,null,S,N,T,yz),s[Cn]=c.current,Eb(s),new Qb(c)},wf.hydrateRoot=function(s,c,h){if(!i(s))throw Error(r(299));var g=!1,S="",N=kE,T=CE,L=AE,K=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(S=h.identifierPrefix),h.onUncaughtError!==void 0&&(N=h.onUncaughtError),h.onCaughtError!==void 0&&(T=h.onCaughtError),h.onRecoverableError!==void 0&&(L=h.onRecoverableError),h.formState!==void 0&&(K=h.formState)),c=sz(s,1,!0,c,h??null,g,S,K,N,T,L,yz),c.context=oz(null),h=c.current,g=ui(),g=Ed(g),S=Qs(g),S.callback=null,Ys(h,S,g),h=g,c.current.lanes=h,Yt(c,h),Ca(c),s[Cn]=c.current,Eb(s),new Nm(c)},wf.version="19.2.4",wf}var Oz;function oK(){if(Oz)return Wb.exports;Oz=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(),Wb.exports=sK(),Wb.exports}var lK=oK(),lc=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(){}},cK={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},uK=class{#t=cK;#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)}},Al=new uK;function dK(e){setTimeout(e,0)}var Kl=typeof window>"u"||"Deno"in globalThis;function hr(){}function fK(e,t){return typeof e=="function"?e(t):e}function Aj(e){return typeof e=="number"&&e>=0&&e!==1/0}function EL(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Oo(e,t){return typeof e=="function"?e(t):e}function Mi(e,t){return typeof e=="function"?e(t):e}function Ez(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:u}=e;if(o){if(r){if(t.queryHash!==wN(o,t.options))return!1}else if(!ch(t.queryKey,o))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 _z(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Gl(t.options.mutationKey)!==Gl(a))return!1}else if(!ch(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function wN(e,t){return(t?.queryKeyHashFn||Gl)(e)}function Gl(e){return JSON.stringify(e,(t,n)=>Oj(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function ch(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ch(e[n],t[n])):!1}var hK=Object.prototype.hasOwnProperty;function SN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=zz(e)&&zz(t);if(!r&&!(Oj(e)&&Oj(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),u=o.length,d=r?new Array(u):{};let f=0;for(let p=0;p<u;p++){const m=r?p:o[p],y=e[m],v=t[m];if(y===v){d[m]=y,(r?p<a:hK.call(e,m))&&f++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){d[m]=v;continue}const w=SN(y,v,n+1);d[m]=w,w===y&&f++}return a===u&&f===a?e:d}function uh(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 zz(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Oj(e){if(!Tz(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Tz(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Tz(e){return Object.prototype.toString.call(e)==="[object Object]"}function pK(e){return new Promise(t=>{Al.setTimeout(t,e)})}function Ej(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?SN(e,t):t}function mK(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function gK(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var jN=Symbol();function _L(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===jN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function NN(e,t){return typeof e=="function"?e(...t):!!e}function yK(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 vK=class extends lc{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Kl&&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"}},kN=new vK;function _j(){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 xK=dK;function bK(){let e=[],t=0,n=u=>{u()},r=u=>{u()},i=xK;const a=u=>{t?e.push(u):i(()=>{n(u)})},o=()=>{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||o()}return d},batchCalls:u=>(...d)=>{a(()=>{u(...d)})},schedule:a,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var Nn=bK(),wK=class extends lc{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Kl&&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}},Ig=new wK;function SK(e){return Math.min(1e3*2**e,3e4)}function zL(e){return(e??"online")==="online"?Ig.isOnline():!0}var zj=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function TL(e){let t=!1,n=0,r;const i=_j(),a=()=>i.status!=="pending",o=b=>{if(!a()){const j=new zj(b);y(j),e.onCancel?.(j)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>kN.isFocused()&&(e.networkMode==="always"||Ig.isOnline())&&e.canRun(),p=()=>zL(e.networkMode)&&e.canRun(),m=b=>{a()||(r?.(),i.resolve(b))},y=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?.()}),w=()=>{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??(Kl?0:3),C=e.retryDelay??SK,O=typeof C=="function"?C(n,k):C,_=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,k);if(t||!_){y(k);return}n++,e.onFail?.(n,k),pK(O).then(()=>f()?void 0:v()).then(()=>{t?y(k):w()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?w():v().then(w),i)}}var PL=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Aj(this.gcTime)&&(this.#t=Al.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Kl?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Al.clearTimeout(this.#t),this.#t=void 0)}},jK=class extends PL{#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=Rz(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=Rz(this.options);t.data!==void 0&&(this.setState(Pz(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Ej(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(hr).catch(hr):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===jN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Oo(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:!EL(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=_L(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)},o=(()=>{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(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=TL({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:u=>{u instanceof zj&&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:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.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 zj){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,...RL(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Pz(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),Nn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function RL(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:zL(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Pz(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Rz(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 CN=class extends lc{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=_j(),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),Dz(this.#e,this.options)?this.#m():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Tj(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Tj(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&&!uh(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&Mz(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)||Oo(this.options.staleTime,this.#e)!==Oo(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 kK(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(hr)),t}#g(){this.#b();const e=Oo(this.options.staleTime,this.#e);if(Kl||this.#i.isStale||!Aj(e))return;const n=EL(this.#i.dataUpdatedAt,e)+1;this.#c=Al.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,!(Kl||Mi(this.options.enabled,this.#e)===!1||!Aj(this.#l)||this.#l===0)&&(this.#u=Al.setInterval(()=>{(this.options.refetchIntervalInBackground||kN.isFocused())&&this.#m()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(Al.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Al.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,i=this.#i,a=this.#r,o=this.#a,d=e!==n?e.state:this.#n,{state:f}=e;let p={...f},m=!1,y;if(t._optimisticResults){const R=this.hasListeners(),$=!R&&Dz(e,t),F=R&&Mz(e,n,t,r);($||F)&&(p={...p,...RL(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:b}=p;y=p.data;let j=!1;if(t.placeholderData!==void 0&&y===void 0&&b==="pending"){let R;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(R=i.data,j=!0):R=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,R!==void 0&&(b="success",y=Ej(i?.data,R,t),m=!0)}if(t.select&&y!==void 0&&!j)if(i&&y===a?.data&&t.select===this.#p)y=this.#d;else try{this.#p=t.select,y=t.select(y),y=Ej(i?.data,y,t),this.#d=y,this.#s=null}catch(R){this.#s=R}this.#s&&(v=this.#s,y=this.#d,w=Date.now(),b="error");const k=p.fetchStatus==="fetching",E=b==="pending",C=b==="error",O=E&&k,_=y!==void 0,z={status:b,fetchStatus:p.fetchStatus,isPending:E,isSuccess:b==="success",isError:C,isInitialLoading:O,isLoading:O,data:y,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:w,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&&!_,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:C&&_,isStale:AN(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Mi(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const R=z.data!==void 0,$=z.status==="error"&&!R,F=V=>{$?V.reject(z.error):R&&V.resolve(z.data)},U=()=>{const V=this.#o=z.promise=_j();F(V)},B=this.#o;switch(B.status){case"pending":e.queryHash===n.queryHash&&F(B);break;case"fulfilled":($||z.data!==B.value)&&U();break;case"rejected":(!$||z.error!==B.reason)&&U();break}}return z}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),uh(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(o=>{const u=o;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){Nn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function NK(e,t){return Mi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Dz(e,t){return NK(e,t)||e.state.data!==void 0&&Tj(e,t,t.refetchOnMount)}function Tj(e,t,n){if(Mi(t.enabled,e)!==!1&&Oo(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&AN(e,t)}return!1}function Mz(e,t,n,r){return(e!==t||Mi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&AN(e,n)}function AN(e,t){return Mi(t.enabled,e)!==!1&&e.isStaleByTime(Oo(t.staleTime,e))}function kK(e,t){return!uh(e.getCurrentResult(),t)}function Iz(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},d=0;const f=async()=>{let p=!1;const m=w=>{yK(w,()=>t.signal,()=>p=!0)},y=_L(t.options,t.fetchOptions),v=async(w,b,j)=>{if(p)return Promise.reject();if(b==null&&w.pages.length)return Promise.resolve(w);const E=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:b,direction:j?"backward":"forward",meta:t.options.meta};return m(A),A})(),C=await y(E),{maxPages:O}=t.options,_=j?gK:mK;return{pages:_(w.pages,C,O),pageParams:_(w.pageParams,b,O)}};if(i&&a.length){const w=i==="backward",b=w?CK:Lz,j={pages:a,pageParams:o},k=b(r,j);u=await v(j,k,w)}else{const w=e??a.length;do{const b=d===0?o[0]??r.initialPageParam:Lz(r,u);if(d>0&&b==null)break;u=await v(u,b),d++}while(d<w)}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 Lz(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 CK(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var AK=class extends PL{#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||DL(),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=TL({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#r({type:"failed",failureCount:a,error:o})},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 o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#r({type:"pending",context:o,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(o){Promise.reject(o)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(o){Promise.reject(o)}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),Nn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function DL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ML=class extends lc{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 AK({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=Cm(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=Cm(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=Cm(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=Cm(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Nn.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=>_z(t,n))}findAll(e={}){return this.getAll().filter(t=>_z(e,t))}notify(e){Nn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Nn.batch(()=>Promise.all(e.map(t=>t.continue().catch(hr))))}};function Cm(e){return e.options.scope?.id}var OK=class extends lc{#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),uh(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Gl(n.mutationKey)!==Gl(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??DL();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){Nn.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 $z(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function EK(e,t,n){const r=e.slice(0);return r[t]=n,r}var _K=class extends lc{#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,Nn.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()),o=n.length!==i.length,u=i.some((p,m)=>p!==n[m]),d=o||u,f=d?!0:a.some((p,m)=>{const y=this.#e[m];return!y||!uh(p,y)});!d&&!f||(d&&(this.#d=r,this.#r=i),this.#e=a,this.hasListeners()&&(d&&($z(n,i).forEach(p=>{p.destroy()}),$z(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(o=>{o.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,o)=>a!==r[o]));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=SN(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),o=t.get(i.queryHash)?.shift()??new CN(this.#t,i);n.push({defaultedQueryOptions:i,observer:o})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=EK(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&&Nn.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},zK=class extends lc{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??wN(r,t);let a=this.get(i);return a||(a=new jK({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(){Nn.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=>Ez(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Ez(e,n)):t}notify(e){Nn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Nn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Nn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},TK=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new zK,this.#e=e.mutationCache||new ML,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=kN.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=Ig.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(Oo(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,o=fK(t,a);if(o!==void 0)return this.#t.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Nn.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;Nn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return Nn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Nn.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(hr).catch(hr)}invalidateQueries(e,t={}){return Nn.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=Nn.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(hr)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(hr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(Oo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(hr).catch(hr)}fetchInfiniteQuery(e){return e.behavior=Iz(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(hr).catch(hr)}ensureInfiniteQueryData(e){return e.behavior=Iz(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ig.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(Gl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{ch(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Gl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{ch(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=wN(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===jN&&(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()}},IL=x.createContext(void 0),Ir=e=>{const t=x.useContext(IL);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},PK=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(IL.Provider,{value:e,children:t})),LL=x.createContext(!1),$L=()=>x.useContext(LL);LL.Provider;function RK(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var DK=x.createContext(RK()),BL=()=>x.useContext(DK),UL=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?NN(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},qL=e=>{x.useEffect(()=>{e.clearReset()},[e])},FL=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||NN(n,[e.error,r])),HL=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))}},MK=(e,t)=>e.isLoading&&e.isFetching&&!t,Pj=(e,t)=>e?.suspense&&t.isPending,Rj=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function KL({queries:e,...t},n){const r=Ir(),i=$L(),a=BL(),o=x.useMemo(()=>e.map(b=>{const j=r.defaultQueryOptions(b);return j._optimisticResults=i?"isRestoring":"optimistic",j}),[e,r,i]);o.forEach(b=>{HL(b);const j=r.getQueryCache().get(b.queryHash);UL(b,a,j)}),qL(a);const[u]=x.useState(()=>new _K(r,o,t)),[d,f,p]=u.getOptimisticResult(o,t.combine),m=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(b=>m?u.subscribe(Nn.batchCalls(b)):hr,[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),x.useEffect(()=>{u.setQueries(o,t)},[o,t,u]);const v=d.some((b,j)=>Pj(o[j],b))?d.flatMap((b,j)=>{const k=o[j];if(k&&Pj(k,b)){const E=new CN(r,k);return Rj(k,E,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const w=d.find((b,j)=>{const k=o[j];return k&&FL({result:b,errorResetBoundary:a,throwOnError:k.throwOnError,query:r.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(w?.error)throw w.error;return f(p())}function IK(e,t,n){const r=$L(),i=BL(),a=Ir(),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const u=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",HL(o),UL(o,i,u),qL(i);const d=!a.getQueryCache().get(o.queryHash),[f]=x.useState(()=>new t(a,o)),p=f.getOptimisticResult(o),m=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(y=>{const v=m?f.subscribe(Nn.batchCalls(y)):hr;return f.updateResult(),v},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setOptions(o)},[o,f]),Pj(o,p))throw Rj(o,f,i);if(FL({result:p,errorResetBoundary:i,throwOnError:o.throwOnError,query:u,suspense:o.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!Kl&&MK(p,r)&&(d?Rj(o,f,i):u?.promise)?.catch(hr).finally(()=>{f.updateResult()}),o.notifyOnChangeProps?p:f.trackResult(p)}function yr(e,t){return IK(e,CN)}function cc(e,t){const n=Ir(),[r]=x.useState(()=>new OK(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(o=>r.subscribe(Nn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((o,u)=>{r.mutate(o,u).catch(hr)},[r]);if(i.error&&NN(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Am=typeof window<"u"?x.useLayoutEffect:x.useEffect;function tw(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 LK(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 $K(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}var BK=!1;function dh(e){return e[e.length-1]}function UK(e){return typeof e=="function"}function jo(e,t){return UK(e)?e(t):e}var qK=Object.prototype.hasOwnProperty,Bz=Object.prototype.propertyIsEnumerable,FK=()=>Object.create(null),ml=(e,t)=>Ol(e,t,FK);function Ol(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=Fz(e)&&Fz(i);if(!a&&!(Lg(e)&&Lg(i)))return i;const o=a?e:Uz(e);if(!o)return i;const u=a?i:Uz(i);if(!u)return i;const d=o.length,f=u.length,p=a?new Array(f):n();let m=0;for(let y=0;y<f;y++){const v=a?y:u[y],w=e[v],b=i[v];if(w===b){p[v]=w,(a?y<d:qK.call(e,v))&&m++;continue}if(w===null||b===null||typeof w!="object"||typeof b!="object"){p[v]=b;continue}const j=Ol(w,b,n,r+1);p[v]=j,j===w&&m++}return d===f&&m===d?e:p}function Uz(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!Bz.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(!Bz.call(e,i))return!1;r.push(i)}return r}function Lg(e){if(!qz(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!qz(n)||!n.hasOwnProperty("isPrototypeOf"))}function qz(e){return Object.prototype.toString.call(e)==="[object Object]"}function Fz(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Il(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(!Il(e[r],t[r],n))return!1;return!0}if(Lg(e)&&Lg(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const o in t)if((!r||t[o]!==void 0)&&!Il(e[o],t[o],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const o in e)e[o]!==void 0&&i++;let a=0;for(const o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!Il(e[o],t[o],n)))return!1;return i===a}return!1}function Ku(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 fh(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function HK(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Hz(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 HK(t)}var KK=["http:","https:","mailto:","tel:"];function $g(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Sf(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+=Hz(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+Hz(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function GK(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Bg(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 o=t.get(a);if(o)return i(o),o.value},set(a,o){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=o,i(u);else{const d={key:a,value:o,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 VK="Invariant failed";function Cs(e,t){if(!e)throw new Error(VK)}var El=4,GL=5;function QK(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 ON(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 o=QK(a);if(o){const[u,d]=o,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 fv(e,t,n,r,i,a,o){o?.(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=ON(d,u,t);let w;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)w=E;else{i.static??=new Map;const C=_l(n.fullPath??n.from);C.parent=i,C.depth=a,w=C,i.static.set(k,C)}}else{const E=k.toLowerCase(),C=i.staticInsensitive?.get(E);if(C)w=C;else{i.staticInsensitive??=new Map;const O=_l(n.fullPath??n.from);O.parent=i,O.depth=a,w=O,i.staticInsensitive.set(E,O)}}break}case 1:{const k=d.substring(b,v[1]),E=d.substring(v[4],j),C=p&&!!(k||E),O=k?C?k:k.toLowerCase():void 0,_=E?C?E:E.toLowerCase():void 0,A=!m&&i.dynamic?.find(z=>!z.skipOnParamError&&z.caseSensitive===C&&z.prefix===O&&z.suffix===_);if(A)w=A;else{const z=rw(1,n.fullPath??n.from,C,O,_);w=z,z.depth=a,z.parent=i,i.dynamic??=[],i.dynamic.push(z)}break}case 3:{const k=d.substring(b,v[1]),E=d.substring(v[4],j),C=p&&!!(k||E),O=k?C?k:k.toLowerCase():void 0,_=E?C?E:E.toLowerCase():void 0,A=!m&&i.optional?.find(z=>!z.skipOnParamError&&z.caseSensitive===C&&z.prefix===O&&z.suffix===_);if(A)w=A;else{const z=rw(3,n.fullPath??n.from,C,O,_);w=z,z.parent=i,z.depth=a,i.optional??=[],i.optional.push(z)}break}case 2:{const k=d.substring(b,v[1]),E=d.substring(v[4],j),C=p&&!!(k||E),O=k?C?k:k.toLowerCase():void 0,_=E?C?E:E.toLowerCase():void 0,A=rw(2,n.fullPath??n.from,C,O,_);w=A,A.parent=i,A.depth=a,i.wildcard??=[],i.wildcard.push(A)}}i=w}if(m&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const v=_l(n.fullPath??n.from);v.kind=GL,v.parent=i,a++,v.depth=a,i.pathless??=[],i.pathless.push(v),i=v}const y=(n.path||!n.children)&&!n.isRoot;if(y&&d.endsWith("/")){const v=_l(n.fullPath??n.from);v.kind=El,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,y&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)fv(e,t,d,u,i,a,o)}function nw(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 yo(e){if(e.pathless)for(const t of e.pathless)yo(t);if(e.static)for(const t of e.static.values())yo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())yo(t);if(e.dynamic?.length){e.dynamic.sort(nw);for(const t of e.dynamic)yo(t)}if(e.optional?.length){e.optional.sort(nw);for(const t of e.optional)yo(t)}if(e.wildcard?.length){e.wildcard.sort(nw);for(const t of e.wildcard)yo(t)}}function _l(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 rw(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 YK(e,t){const n=_l("/"),r=new Uint16Array(6);for(const i of e)fv(!1,r,i,1,n,0);yo(n),t.masksTree=n,t.flatCache=Bg(1e3)}function ZK(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=EN(e,t.masksTree);return t.flatCache.set(e,r),r}function WK(e,t,n,r,i){e||="/",r||="/";const a=t?`case\0${e}`:e;let o=i.singleCache.get(a);return o||(o=_l("/"),fv(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),EN(r,o,n)}function XK(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=EN(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)a=null;else throw o}return a&&(a.branch=t7(a.route)),t.matchCache.set(r,a),a}function JK(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function e7(e,t=!1,n){const r=_l(e.fullPath),i=new Uint16Array(6),a={},o={};let u=0;return fv(t,i,e,1,r,0,d=>{if(n?.(d,u),Cs(!(d.id in a),`Duplicate routes found with id: ${String(d.id)}`),a[d.id]=d,u!==0&&d.path){const f=JK(d.fullPath);(!o[f]||d.fullPath.endsWith("/"))&&(o[f]=d)}u++}),yo(r),{processedTree:{segmentTree:r,singleCache:Bg(1e3),matchCache:Bg(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function EN(e,t,n=!1){const r=e.split("/"),i=r7(e,r,t,n);if(!i)return null;const[a]=VL(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function VL(e,t,n){const r=n7(n.node);let i=null;const a=Object.create(null);let o=n.extract?.part??0,u=n.extract?.node??0,d=n.extract?.path??0,f=n.extract?.segment??0;for(;u<r.length;o++,u++,d++,f++){const p=r[u];if(p.kind===El)break;if(p.kind===GL){f--,o--,d--;continue}const m=t[o],y=d;if(m&&(d+=m.length),p.kind===1){i??=n.node.fullPath.split("/");const v=i[f],w=p.prefix?.length??0;if(v.charCodeAt(w)===123){const b=p.suffix?.length??0,j=v.substring(w+2,v.length-b-1),k=m.substring(w,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){o--,d=y-1;continue}i??=n.node.fullPath.split("/");const v=i[f],w=p.prefix?.length??0,b=p.suffix?.length??0,j=v.substring(w+3,v.length-b-1),k=p.suffix||p.prefix?m.substring(w,m.length-b):m;k&&(a[j]=decodeURIComponent(k))}else if(p.kind===2){const v=p,w=e.substring(y+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),b=decodeURIComponent(w);a["*"]=b,a._splat=b;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:u,path:d,segment:f}]}function t7(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function n7(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function r7(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!dh(t),a=i&&e!=="/",o=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:y,index:v,skipped:w,depth:b,statics:j,dynamics:k,optionals:E}=m;let{extract:C,rawParams:O,parsedParams:_}=m;if(y.skipOnParamError){if(!iw(e,t,m))continue;O=m.rawParams,C=m.extract,_=m.parsedParams}r&&y.route&&y.kind!==El&&jf(f,m)&&(f=m);const A=v===o;if(A&&(y.route&&!a&&jf(p,m)&&(p=m),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const z=A?void 0:t[v];let R;if(A&&y.index){const $={node:y.index,index:v,skipped:w,depth:b+1,statics:j,dynamics:k,optionals:E,extract:C,rawParams:O,parsedParams:_};let F=!0;if(y.index.skipOnParamError&&(iw(e,t,$)||(F=!1)),F){if(j===o&&!k&&!E&&!w)return $;jf(p,$)&&(p=$)}}if(y.wildcard&&jf(d,m))for(const $ of y.wildcard){const{prefix:F,suffix:U}=$;if(F&&(A||!($.caseSensitive?z:R??=z.toLowerCase()).startsWith(F)))continue;if(U){if(A)continue;const V=t.slice(v).join("/").slice(-U.length);if(($.caseSensitive?V:V.toLowerCase())!==U)continue}const B={node:$,index:o,skipped:w,depth:b,statics:j,dynamics:k,optionals:E,extract:C,rawParams:O,parsedParams:_};if(!($.skipOnParamError&&!iw(e,t,B))){d=B;break}}if(y.optional){const $=w|1<<b,F=b+1;for(let U=y.optional.length-1;U>=0;U--){const B=y.optional[U];u.push({node:B,index:v,skipped:$,depth:F,statics:j,dynamics:k,optionals:E,extract:C,rawParams:O,parsedParams:_})}if(!A)for(let U=y.optional.length-1;U>=0;U--){const B=y.optional[U],{prefix:V,suffix:X}=B;if(V||X){const W=B.caseSensitive?z:R??=z.toLowerCase();if(V&&!W.startsWith(V)||X&&!W.endsWith(X))continue}u.push({node:B,index:v+1,skipped:w,depth:F,statics:j,dynamics:k,optionals:E+1,extract:C,rawParams:O,parsedParams:_})}}if(!A&&y.dynamic&&z)for(let $=y.dynamic.length-1;$>=0;$--){const F=y.dynamic[$],{prefix:U,suffix:B}=F;if(U||B){const V=F.caseSensitive?z:R??=z.toLowerCase();if(U&&!V.startsWith(U)||B&&!V.endsWith(B))continue}u.push({node:F,index:v+1,skipped:w,depth:b+1,statics:j,dynamics:k+1,optionals:E,extract:C,rawParams:O,parsedParams:_})}if(!A&&y.staticInsensitive){const $=y.staticInsensitive.get(R??=z.toLowerCase());$&&u.push({node:$,index:v+1,skipped:w,depth:b+1,statics:j+1,dynamics:k,optionals:E,extract:C,rawParams:O,parsedParams:_})}if(!A&&y.static){const $=y.static.get(z);$&&u.push({node:$,index:v+1,skipped:w,depth:b+1,statics:j+1,dynamics:k,optionals:E,extract:C,rawParams:O,parsedParams:_})}if(y.pathless){const $=b+1;for(let F=y.pathless.length-1;F>=0;F--){const U=y.pathless[F];u.push({node:U,index:v,skipped:w,depth:$,statics:j,dynamics:k,optionals:E,extract:C,rawParams:O,parsedParams:_})}}}if(p&&d)return jf(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 y=m===e.length?"/":e.slice(m);return f.rawParams??=Object.create(null),f.rawParams["**"]=decodeURIComponent(y),f}return null}function iw(e,t,n){try{const[r,i]=VL(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 jf(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===El)>(e.node.kind===El)||t.node.kind===El==(e.node.kind===El)&&t.depth>e.depth))):!0}function bg(e){return _N(e.filter(t=>t!==void 0).join("/"))}function _N(e){return e.replace(/\/{2,}/g,"/")}function QL(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Eo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function YL(e){return Eo(QL(e))}function Ug(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function i7(e,t,n){return Ug(e,n)===Ug(t,n)}function a7({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),a=!i&&t===".";let o;if(r){o=i?t:a?e:e+"\0"+t;const m=r.get(o);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&&dh(u)==="";)u.pop();const m=t.split("/");for(let y=0,v=m.length;y<v;y++){const w=m[y];w===""?y?y===v-1&&u.push(w):u=[w]:w===".."?u.pop():w==="."||u.push(w)}}u.length>1&&(dh(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));let d,f="";for(let m=0;m<u.length;m++){m>0&&(f+="/");const y=u[m];if(!y)continue;d=ON(y,0,d);const v=d[0];if(v===0){f+=y;continue}const w=d[5],b=y.substring(0,d[1]),j=y.substring(d[4],w),k=y.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=_N(f);const p=f||"/";return o&&r&&r.set(o,p),p}function s7(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 aw(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=>Gz(i,n)).join("/"):Gz(r,n)}function Kz({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 o=e.length;let u=0,d,f="";for(;u<o;){const p=u;d=ON(e,p,d);const m=d[5];if(u=m+1,p===m)continue;const y=d[0];if(y===0){f+="/"+e.substring(p,m);continue}if(y===2){const v=t._splat;a._splat=v,a["*"]=v;const w=e.substring(p,d[1]),b=e.substring(d[4],m);if(!v){i=!0,(w||b)&&(f+="/"+w+b);continue}const j=aw("_splat",t,n);f+="/"+w+j+b;continue}if(y===1){const v=e.substring(d[2],d[3]);!i&&!(v in t)&&(i=!0),a[v]=t[v];const w=e.substring(p,d[1]),b=e.substring(d[4],m),j=aw(v,t,n)??"undefined";f+="/"+w+j+b;continue}if(y===3){const v=e.substring(d[2],d[3]),w=t[v];if(w==null)continue;a[v]=w;const b=e.substring(p,d[1]),j=e.substring(d[4],m),k=aw(v,t,n)??"";f+="/"+b+k+j;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:i}}function Gz(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function Pr(e){return!!e?.isNotFound}function o7(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var Dj="tsr-scroll-restoration-v1_3",l7=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function c7(){const e=o7();if(!e)return null;const t=e.getItem(Dj);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=jo(r,n)||n;try{e.setItem(Dj,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Om=c7(),u7=e=>e.state.__TSR_key||e.href;function d7(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 qg=!1;function f7({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const u=t||window.history.state?.__TSR_key,d=o[u];qg=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const m in d){const y=d[m];if(m==="window")window.scrollTo({top:y.scrollY,left:y.scrollX,behavior:n});else if(m){const v=document.querySelector(m);v&&(v.scrollLeft=y.scrollX,v.scrollTop=y.scrollY)}}break e}const f=(a??window.location).hash.split("#",2)[1];if(f){const m=window.history.state?.__hashScrollIntoViewOptions??!0;if(m){const y=document.getElementById(f);y&&y.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 y=typeof m=="function"?m():document.querySelector(m);y&&y.scrollTo(p)}}qg=!1}function h7(e,t){if(!Om||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Om))return;e.isScrollRestorationSetup=!0,qg=!1;const n=e.options.getScrollRestorationKey||u7;window.history.scrollRestoration="manual";const r=i=>{if(qg||!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=d7(i.target)}const o=n(e.state.location);Om.set(u=>{const d=u[o]||={},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",l7(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})||(f7({storageKey:Dj,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Om.set(o=>(o[a]||={},o)))})}function p7(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 m7(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 sw(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function g7(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]=sw(i):Array.isArray(a)?a.push(sw(i)):n[r]=[a,sw(i)]}return n}var y7=x7(JSON.parse),v7=b7(JSON.stringify,JSON.parse);function x7(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=g7(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function b7(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=m7(i,r);return a?`?${a}`:""}}var Ll="__root__";function zN(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 w7(e){return{input:({url:t})=>{for(const n of e)t=Mj(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=ZL(e[n],t);return t}}}function S7(e){const t=YL(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:o})=>{const u=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return u===i?o.pathname="/":u.startsWith(a)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=bg(["/",t,o.pathname]),o)}}function Mj(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 ZL(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 cn=(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))(cn||{});function WL({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:u};function r(f,p,m){const y=p.depsTail;if(y!==void 0&&y.dep===f)return;const v=y!==void 0?y.nextDep:p.deps;if(v!==void 0&&v.dep===f){v.version=m,p.depsTail=v;return}const w=f.subsTail;if(w!==void 0&&w.version===m&&w.sub===p)return;const b=p.depsTail=f.subsTail={version:m,dep:f,sub:p,prevDep:y,nextDep:v,prevSub:w,nextSub:void 0};v!==void 0&&(v.prevDep=b),y!==void 0?y.nextDep=b:p.deps=b,w!==void 0?w.nextSub=b:f.subs=b}function i(f,p=f.sub){const m=f.dep,y=f.prevDep,v=f.nextDep,w=f.nextSub,b=f.prevSub;return v!==void 0?v.prevDep=y:p.depsTail=y,y!==void 0?y.nextDep=v:p.deps=v,w!==void 0?w.prevSub=b:m.subsTail=b,b!==void 0?b.nextSub=w:(m.subs=w)===void 0&&n(m),v}function a(f){let p=f.nextSub,m;e:do{const y=f.sub;let v=y.flags;if(v&60?v&12?v&4?!(v&48)&&d(f,y)?(y.flags=v|40,v&=1):v=0:y.flags=v&-9|32:v=0:y.flags=v|32,v&2&&t(y),v&1){const w=y.subs;if(w!==void 0){const b=(f=w).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 o(f,p){let m,y=0,v=!1;e:do{const w=f.dep,b=w.flags;if(p.flags&16)v=!0;else if((b&17)===17){if(e(w)){const j=w.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=w.deps,p=w,++y;continue}if(!v){const j=f.nextDep;if(j!==void 0){f=j;continue}}for(;y--;){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 TN=0,gl=0,Xf=0;const gs=[],{link:H_e,unlink:XL,propagate:K_e,checkDirty:j7,shallowPropagate:G_e}=WL({update(e){return e.depsTail!==void 0?A7(e):O7(e)},notify(e){let t=Xf,n=t;do if(gs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Xf=t;n<--t;){const r=gs[n];gs[n++]=gs[t],gs[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,hv(e)):z7.call(e)}});function N7(){return TN}function k7(){++TN}function C7(){--TN||_7()}function A7(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,hv(e)}}function O7(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function E7(e){const t=e.flags;if(t&16||t&32&&j7(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,hv(e)}}else e.flags=2}function _7(){try{for(;gl<Xf;){const e=gs[gl];gs[gl++]=void 0,E7(e)}}finally{for(;gl<Xf;){const e=gs[gl];gs[gl++]=void 0,e.flags|=10}gl=0,Xf=0}}function z7(){this.depsTail=void 0,this.flags=0,hv(this);const e=this.subs;e!==void 0&&XL(e)}function hv(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=XL(n,e)}function PN(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 Ij=[];let wg=0;const{link:Vz,unlink:T7,propagate:P7,checkDirty:JL,shallowPropagate:Qz}=WL({update(e){return e._update()},notify(e){Ij[Lj++]=e,e.flags&=~cn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=cn.Mutable|cn.Dirty,Fg(e))}});let Em=0,Lj=0,za;function Fg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=T7(n,e)}function e5(){if(!(N7()>0)){for(;Em<Lj;){const e=Ij[Em];Ij[Em++]=void 0,e.notify()}Em=0,Lj=0}}function t5(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?cn.None:cn.Mutable,get(){return za!==void 0&&Vz(i,za,wg),i._snapshot},subscribe(a){const o=PN(a),u={current:!1},d=R7(()=>{i.get(),u.current?o.next?.(i._snapshot):u.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const o=za,u=Object.is;if(n)za=i,++wg,i.depsTail=void 0;else if(a===void 0)return!1;n&&(i.flags=cn.Mutable|cn.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{za=o,n&&(i.flags&=~cn.RecursedCheck),Fg(i)}}};return n?(i.flags=cn.Mutable|cn.Dirty,i.get=function(){const a=i.flags;if(a&cn.Dirty||a&cn.Pending&&JL(i.deps,i)){if(i._update()){const o=i.subs;o!==void 0&&Qz(o)}}else a&cn.Pending&&(i.flags=a&~cn.Pending);return za!==void 0&&Vz(i,za,wg),i._snapshot}):i.set=function(a){if(i._update(a)){const o=i.subs;o!==void 0&&(P7(o),Qz(o),e5())}},i}function R7(e){const t=()=>{const r=za;za=n,++wg,n.depsTail=void 0,n.flags=cn.Watching|cn.RecursedCheck;try{return e()}finally{za=r,n.flags&=~cn.RecursedCheck,Fg(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:cn.Watching|cn.RecursedCheck,notify(){const r=this.flags;r&cn.Dirty||r&cn.Pending&&JL(this.deps,this)?t():this.flags=cn.Watching},stop(){this.flags=cn.None,this.depsTail=void 0,Fg(this)}};return t(),n}class D7{constructor(t){this.atom=t5(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(PN(t))}}class M7{constructor(t){this.atom=t5(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(PN(t))}}function I7(e){return typeof e=="function"?new M7(e):new D7(e)}function L7(e){try{k7(),e()}finally{C7(),e5()}}function Jf(e){let t;return L7(()=>{t=e()}),t}var $j=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},pv=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),$l=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const o=e.matches[a];if(!o)continue;const u=e.router.getMatch(o.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},Yz=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(o=>o.routeId===e.router.routeTree.id),i=r>=0?r:0;let a=n?e.matches.findIndex(o=>o.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let o=a;o>=0;o--){const u=e.matches[o];if(e.router.looseRoutesById[u.routeId].options.notFoundComponent)return o}return n?a:i},No=(e,t,n)=>{if(!(!Vr(n)&&!Pr(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:$l(e,t.index),isFetching:!1,error:n})),Pr(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},n5=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Zz=(e,t,n)=>{const r=$l(e,n);e.updateMatch(t,i=>({...i,context:r}))},Nf=(e,t,n,r)=>{const{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,No(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(u){n=u,No(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)&&!Pr(n)&&(e.serialError??=n)},r5=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!pv(e,t)&&(n.options.loader||n.options.beforeLoad||a5(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{$j(e)},i);r._nonReactive.pendingTimeout=a}},$7=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;r5(e,t,n,r);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&No(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},B7=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Ku(()=>{a?.resolve(),a=void 0});const{paramsError:o,searchError:u}=i;o&&Nf(e,n,o,"PARSE_PARAMS"),u&&Nf(e,n,u,"VALIDATE_SEARCH"),r5(e,t,r,i);const d=new AbortController;let f=!1;const p=()=>{f||(f=!0,e.updateMatch(t,O=>({...O,isFetching:"beforeLoad",fetchCount:O.fetchCount+1,abortController:d})))},m=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,O=>({...O,isFetching:!1}))};if(!r.options.beforeLoad){Jf(()=>{p(),m()});return}i._nonReactive.beforeLoadPromise=Ku();const y={...$l(e,n,!1),...i.__routeContext},{search:v,params:w,cause:b}=i,j=pv(e,t),k={search:v,abortController:d,params:w,preload:j,context:y,location:e.location,navigate:O=>e.router.navigate({...O,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":b,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},E=O=>{if(O===void 0){Jf(()=>{p(),m()});return}(Vr(O)||Pr(O))&&(p(),Nf(e,n,O,"BEFORE_LOAD")),Jf(()=>{p(),e.updateMatch(t,_=>({..._,__beforeLoadContext:O})),m()})};let C;try{if(C=r.options.beforeLoad(k),fh(C))return p(),C.catch(O=>{Nf(e,n,O,"BEFORE_LOAD")}).then(E)}catch(O){p(),Nf(e,n,O,"BEFORE_LOAD")}E(C)},U7=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>u(),o=()=>B7(e,n,t,i),u=()=>{if(n5(e,n))return;const d=$7(e,n,i);return fh(d)?d.then(o):o()};return a()},q7=(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,o,u])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:u,scripts:o,styles:a?.styles}))},i5=(e,t,n,r,i)=>{const a=t[r-1],{params:o,loaderDeps:u,abortController:d,cause:f}=e.router.getMatch(n),p=$l(e,r),m=pv(e,n);return{params:o,deps:u,preload:!!m,parentMatchPromise:a,abortController:d,context:p,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:m?"preload":f,route:i,...e.router.options.additionalContext}},Wz=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(BK??e.router.isServer)||a.ssr===!0)&&hh(i);const o=i.options.loader,u=typeof o=="function"?o:o?.handler,d=u?.(i5(e,t,n,r,i)),f=!!u&&fh(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;No(e,e.router.getMatch(n),m),m!==void 0&&e.updateMatch(n,y=>({...y,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:$l(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(o){let u=o;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:$l(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,Pr(o)&&await i.options.notFoundComponent?.preload?.(),No(e,e.router.getMatch(n),o);try{i.options.onError?.(o)}catch(f){u=f,No(e,e.router.getMatch(n),f)}!Vr(u)&&!Pr(u)&&await hh(i,["errorComponent"]),e.updateMatch(n,f=>({...f,error:u,context:$l(e,r),status:"error",isFetching:!1}))}}catch(a){const o=e.router.getMatch(n);o&&(o._nonReactive.loaderPromise=void 0),No(e,o,a)}},F7=async(e,t,n)=>{async function r(v,w,b,j,k){const E=Date.now()-w.updatedAt,C=v?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,O=k.options.shouldReload,_=typeof O=="function"?O(i5(e,t,i,n,k)):O,{status:A,invalid:z}=j,R=E>C&&(!!e.forceStaleReload||j.cause==="enter"||b!==void 0&&b!==j.id);o=A==="success"&&(z||(_??R)),v&&k.options.preload===!1||(o&&!e.sync&&p?(u=!0,(async()=>{try{await Wz(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)}})()):A!=="success"||o?await Wz(e,t,i,n,k):Zz(e,i,n))}const{id:i,routeId:a}=e.matches[n];let o=!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(n5(e,i)){if(!e.router.getMatch(i))return e.matches[n];Zz(e,i,n)}else{const v=e.router.getMatch(i),w=e.router.state.matches[n]?.routeId===a?e.router.state.matches[n].id:e.router.state.matches.find(j=>j.routeId===a)?.id,b=pv(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&&No(e,j,k),j.status==="pending"&&await r(b,v,w,j,d)}else{const j=b&&!e.router.state.matches.some(E=>E.id===i),k=e.router.getMatch(i);k._nonReactive.loaderPromise=Ku(),j!==k.preload&&e.updateMatch(i,E=>({...E,preload:j})),await r(b,v,w,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 y=u?m.isFetching:!1;return y!==m.isFetching||m.invalid!==!1?(e.updateMatch(i,v=>({...v,isFetching:y,invalid:!1})),e.router.getMatch(i)):m};async function Xz(e){const t=e,n=[];t.router.state.matches.some(y=>y._forcePending)&&$j(t);let r;for(let y=0;y<t.matches.length;y++){try{const v=U7(t,y);fh(v)&&await v}catch(v){if(Vr(v))throw v;if(Pr(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?Yz(t,r):void 0,o=r&&t.preload?0:a!==void 0?Math.min(a+1,i):i;let u,d;for(let y=0;y<o;y++)n.push(F7(t,n,y));try{await Promise.all(n)}catch{const y=await Promise.allSettled(n);for(const v of y){if(v.status!=="rejected")continue;const w=v.reason;if(Vr(w))throw w;Pr(w)?u??=w:d??=w}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 y=Yz(t,f);Cs(y!==void 0);const v=t.matches[y],w=t.router.looseRoutesById[v.routeId],b=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&b&&(w.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=y,await hh(w,["notFoundComponent"])}else if(!t.preload){const y=t.matches[0];y.globalNotFound||t.router.getMatch(y.id)?.globalNotFound&&t.updateMatch(y.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const y=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await hh(y,["errorComponent"])}for(let y=0;y<=p;y++){const{id:v,routeId:w}=t.matches[y],b=t.router.looseRoutesById[w];try{const j=q7(t,v,b);if(j){const k=await j;t.updateMatch(v,E=>({...E,...k}))}}catch(j){console.error(`Error executing head for route ${w}:`,j)}}const m=$j(t);if(fh(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Jz(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function hh(e,t=Sg){!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===Sg?(()=>{if(e._componentsPromise===void 0){const r=Jz(e,Sg);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Jz(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function a5(e){for(const t of Sg)if(e.options[t]?.preload)return!0;return!1}var Sg=["component","errorComponent","pendingComponent","notFoundComponent"],_o="__TSR_index",e2="popstate",t2="beforeunload";function H7(e){let t=e.getLocation();const n=new Set,r=o=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:o}))},i=o=>{e.notifyOnIndexChange??!0?r(o):t=e.getLocation()},a=async({task:o,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){o();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 y=Hg(d.path,d.state);if(await m.blockerFn({currentLocation:t,nextLocation:y,action:d.type})){e.onBlocked?.();return}}o()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,u,d)=>{const f=t.state[_o];u=n2(f+1,u),a({task:()=>{e.pushState(o,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:o,state:u})},replace:(o,u,d)=>{const f=t.state[_o];u=n2(f,u),a({task:()=>{e.replaceState(o,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:o,state:u})},go:(o,u)=>{a({task:()=>{e.go(o),i({type:"GO",index:o})},navigateOpts:u,type:"GO"})},back:o=>{a({task:()=>{e.back(o?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{a({task:()=>{e.forward(o?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[_o]!==0,createHref:o=>e.createHref(o),block:o=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,o]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==o))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function n2(e,t){t||(t={});const n=RN();return{...t,key:n,__TSR_key:n,[_o]:e}}function K7(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const a=()=>i,o=R=>i=R,u=(R=>R),d=(()=>Hg(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const R=RN();t.history.replaceState({[_o]:0,key:R,__TSR_key:R},"")}let f=d(),p,m=!1,y=!1,v=!1,w=!1;const b=()=>f;let j,k;const E=()=>{j&&(z._ignoreSubscribers=!0,(j.isPush?t.history.pushState:t.history.replaceState)(j.state,"",j.href),z._ignoreSubscribers=!1,j=void 0,k=void 0,p=void 0)},C=(R,$,F)=>{const U=u($);k||(p=f),f=Hg($,F),j={href:U,state:F,isPush:j?.isPush||R==="push"},k||(k=Promise.resolve().then(()=>E()))},O=R=>{f=d(),z.notify({type:R})},_=async()=>{if(y){y=!1;return}const R=d(),$=R.state[_o]-f.state[_o],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 W=a();if(typeof document<"u"&&W.length){for(const H of W)if(await H.blockerFn({currentLocation:f,nextLocation:R,action:V})){y=!0,t.history.go(1),z.notify(X);return}}}f=d(),z.notify(X)},A=R=>{if(w){w=!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 R.preventDefault(),R.returnValue=""},z=H7({getLocation:b,getLength:()=>t.history.length,pushState:(R,$)=>C("push",R,$),replaceState:(R,$)=>C("replace",R,$),back:R=>(R&&(v=!0),w=!0,t.history.back()),forward:R=>{R&&(v=!0),w=!0,t.history.forward()},go:R=>{m=!0,t.history.go(R)},createHref:R=>u(R),flush:E,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(t2,A,{capture:!0}),t.removeEventListener(e2,_)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(t2,A,{capture:!0}),t.addEventListener(e2,_),t.history.pushState=function(...R){const $=n.apply(t.history,R);return z._ignoreSubscribers||O("PUSH"),$},t.history.replaceState=function(...R){const $=r.apply(t.history,R);return z._ignoreSubscribers||O("REPLACE"),$},z}function G7(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Hg(e,t){const n=G7(e),r=n.indexOf("#"),i=n.indexOf("?"),a=RN();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||{[_o]:0,key:a,__TSR_key:a}}}function RN(){return(Math.random()+1).toString(36).substring(7)}function Bl(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 V7(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var Q7=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=s7(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=K7()),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=Bg(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=I7(Z7(this.latestLocation)),h7(this));let o=!1;const u=this.options.basepath??"/",d=this.options.rewrite;if(i||r!==u||a!==d){this.basepath=u;const f=[],p=YL(u);p&&p!=="/"&&f.push(S7({basepath:u})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:w7(f),this.history&&this.updateLatestLocation(),o=!0}o&&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=e7(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&YK(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:Sf(u).path,external:!1,searchStr:k,search:ml(n?.search,j),hash:Sf(f.slice(1)).path,state:Ol(n?.state,m)}}const y=new URL(p,this.origin),v=Mj(this.rewrite,y),w=this.options.parseSearch(v.search),b=this.options.stringifySearch(w);return v.search=b,{href:v.href.replace(v.origin,""),publicHref:p,pathname:Sf(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:b,search:ml(n?.search,w),hash:Sf(v.hash.slice(1)).path,state:Ol(n?.state,m)}},i=r(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===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)=>a7({base:t,to:_N(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=>W7({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,o=this.matchRoutesLightweight(a);i.from;const u=i.unsafeRelative==="path"?a.pathname:i.from??o.fullPath,d=this.resolvePathWithBase(u,"."),f=o.search,p=Object.assign(Object.create(null),o.params),m=i.to?this.resolvePathWithBase(d,`${i.to}`):this.resolvePathWithBase(d,"."),y=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?p:Object.assign(p,jo(i.params,p)),v=this.getMatchedRoutes(m);let w=v.matchedRoutes;if((!v.foundRoute||v.foundRoute.path!=="/"&&v.routeParams["**"])&&this.options.notFoundRoute&&(w=[...w,this.options.notFoundRoute]),Object.keys(y).length>0)for(const $ of w){const F=$.options.params?.stringify??$.options.stringifyParams;if(F)try{Object.assign(y,F(y))}catch{}}const b=t.leaveParams?m:Sf(Kz({path:m,params:y,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let j=f;if(t._includeValidateSearch&&this.options.search?.strict){const $={};w.forEach(F=>{if(F.options.validateSearch)try{Object.assign($,jg(F.options.validateSearch,{...$,...j}))}catch{}}),j=$}j=X7({search:j,dest:i,destRoutes:w,_includeValidateSearch:t._includeValidateSearch}),j=ml(f,j);const k=this.options.stringifySearch(j),E=i.hash===!0?a.hash:i.hash?jo(i.hash,a.hash):void 0,C=E?`#${E}`:"";let O=i.state===!0?a.state:i.state?jo(i.state,a.state):{};O=Ol(a.state,O);const _=`${b}${k}${C}`;let A,z,R=!1;if(this.rewrite){const $=new URL(_,this.origin),F=ZL(this.rewrite,$);A=$.href.replace($.origin,""),F.origin!==this.origin?(z=F.href,R=!0):z=F.pathname+F.search+F.hash}else A=GK(_),z=A;return{publicHref:z,href:A,pathname:b,search:j,searchStr:k,state:O,hash:E??"",external:R,unmaskOnReload:i.unmaskOnReload}},r=(i={},a)=>{const o=n(i);let u=a?n(a):void 0;if(!u){const d=Object.create(null);if(this.options.routeMasks){const f=ZK(o.pathname,this.processedTree);if(f){Object.assign(d,f.rawParams);const{from:p,params:m,...y}=f.route,v=m===!1||m===null?Object.create(null):(m??!0)===!0?d:Object.assign(d,jo(m,d));a={from:t.from,...y,params:v},u=n(a)}}}return u&&(o.maskedLocation=u),o};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=Il(r.state,this.latestLocation.state);return u.forEach(f=>{delete r.state[f]}),d},a=Eo(this.latestLocation.href)===Eo(r.href);let o=this.commitLocationPromise;if(this.commitLocationPromise=Ku(()=>{o?.resolve(),o=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:o,...u}={})=>{if(o){const p=this.history.location.state.__TSR_index,m=Hg(o,{__TSR_index:t?p:p+1}),y=new URL(m.pathname,this.origin);u.to=Mj(this.rewrite,y).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 o=!1;if(r)try{new URL(`${r}`),o=!0}catch{}if(o&&!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=!o&&i?i:r;if($g(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",...Bl({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...Bl({resolvedLocation:f,location:d})}),await Xz({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=[],y=[],v=[];Jf(()=>{this.__store.setState(w=>{const b=w.matches,j=w.pendingMatches||w.matches;return p=b.filter(k=>!j.some(E=>E.id===k.id)),m=b.filter(k=>!j.some(E=>E.routeId===k.routeId)),y=j.filter(k=>!b.some(E=>E.routeId===k.routeId)),v=j.filter(k=>b.some(E=>E.routeId===k.routeId)),{...w,isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...p.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[y,"onEnter"],[v,"onStay"]].forEach(([w,b])=>{w.forEach(j=>{this.looseRoutesById[j.routeId].options[b]?.(j)})})})})}})}catch(d){Vr(d)?(n=d,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Pr(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 o;this.hasNotFoundMatch()?o=404:this.__store.state.matches.some(u=>u.status==="error")&&(o=500),o!==void 0&&this.__store.setState(u=>({...u,statusCode:o}))},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,o=typeof n.types=="function"?n.types(Bl({resolvedLocation:a,location:i})):n.types;if(o===!1){t();return}r={update:t,types:o}}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:V7(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&&$g(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=hh,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(o=>o.id)),a=new Set([...i,...this.state.cachedMatches.map(o=>o.id)]);Jf(()=>{r.forEach(o=>{a.has(o.id)||this.__store.setState(u=>({...u,cachedMatches:[...u.cachedMatches,o]}))})});try{return r=await Xz({router:this,matches:r,location:n,preload:!0,updateMatch:(o,u)=>{i.has(o)?r=r.map(d=>d.id===o?u(d):d):this.updateMatch(o,u)}}),r}catch(o){if(Vr(o))return o.options.reloadDocument?void 0:await this.preloadRoute({...o.options,_fromLocation:n});Pr(o)||console.error(o);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,o=WK(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,a.pathname,this.processedTree);return!o||t.params&&!Il(o.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?Il(a.search,i.search,{partial:!0})?o.rawParams:!1:o.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??v7,parseSearch:e.parseSearch??y7,protocolAllowlist:e.protocolAllowlist??KK}),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:o}=n,u=!1;(r?r.path!=="/"&&i["**"]:Eo(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:u=!0);const d=u?eG(this.options.notFoundMode,o):void 0,f=new Array(o.length),p=new Map(this.state.matches.map(m=>[m.routeId,m]));for(let m=0;m<o.length;m++){const y=o[m],v=f[m-1];let w,b,j;{const V=v?.search??e.search,X=v?._strictSearch??void 0;try{const W=jg(y.options.validateSearch,{...V})??void 0;w={...V,...W},b={...X,...W},j=void 0}catch(W){let H=W;if(W instanceof Kg||(H=new Kg(W.message,{cause:W})),t?.throwOnError)throw H;w=V,b={},j=H}}const k=y.options.loaderDeps?.({search:w})??"",E=k?JSON.stringify(k):"",{interpolatedPath:C,usedParams:O}=Kz({path:y.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),_=y.id+C+E,A=this.getMatch(_),z=p.get(y.id),R=A?._strictParams??O;let $;if(!A)try{r2(y,O,a,R)}catch(V){if(Pr(V)||Vr(V)?$=V:$=new Y7(V.message,{cause:V}),t?.throwOnError)throw $}Object.assign(i,R);const F=z?"stay":"enter";let U;if(A)U={...A,cause:F,params:z?.params??i,_strictParams:R,search:ml(z?z.search:A.search,w),_strictSearch:b};else{const V=y.options.loader||y.options.beforeLoad||y.lazyFn||a5(y)?"pending":"success";U={id:_,ssr:y.options.ssr,index:m,routeId:y.id,params:z?.params??i,_strictParams:R,pathname:C,updatedAt:Date.now(),search:z?ml(z.search,w):w,_strictSearch:b,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:$,__routeContext:void 0,_nonReactive:{loadPromise:Ku()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:z?Ol(z.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:y.options.staticData||{},fullPath:y.fullPath}}t?.preload||(U.globalNotFound=d===y.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 y=f[m],v=this.looseRoutesById[y.routeId],w=this.getMatch(y.id),b=p.get(y.routeId);if(y.params=b?ml(b.params,i):i,!w){const j=f[m-1],k=this.getParentContext(j);if(v.options.context){const E={deps:y.loaderDeps,params:y.params,context:k??{},location:e,navigate:C=>this.navigate({...C,_fromLocation:e}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:f,routeId:v.id};y.__routeContext=v.options.context(E)??void 0}y.context={...k,...y.__routeContext,...y.__beforeLoadContext}}}return f}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=dh(t),a={...e.search};for(const f of t)try{Object.assign(a,jg(f.options.validateSearch,a))}catch{}const o=dh(this.state.matches),u=o&&o.routeId===i.id&&e.pathname===this.state.location.pathname;let d;if(u)d=o.params;else{const f=Object.assign(Object.create(null),n);for(const p of t)try{r2(p,n,r??{},f)}catch{}d=f}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:d}}},Kg=class extends Error{},Y7=class extends Error{};function Z7(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function jg(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Kg("Async validation not supported");if(n.issues)throw new Kg(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 W7({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=Eo(e);let a,o;const u=XK(i,n,!0);return u&&(a=u.route,Object.assign(r,u.rawParams),o=Object.assign(Object.create(null),u.parsedParams)),{matchedRoutes:u?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function X7({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return J7(n)(e,t,r??!1)}function J7(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:o,next:u})=>{let d=o;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((p,m)=>m(p),o));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:o,next:u})=>{const d=u(o);if(!t._includeValidateSearch)return d;try{return{...d,...jg(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:jo(a.search,i):{}};t.middlewares.push(n);const r=(i,a,o)=>{if(i>=o.length)return a;const u=o[i];return u({search:a,next:f=>r(i+1,f,o)})};return function(a,o,u){return t.dest=o,t._includeValidateSearch=u,r(0,a,t.middlewares)}}function eG(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 Ll}function r2(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 tG="Error preloading route! ☝️",s5=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=Ll:this.parentRoute||Cs(!1);let i=r?Ll:n?.path;i&&i!=="/"&&(i=QL(i));const a=n?.id||i;let o=r?Ll:bg([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),o!=="__root__"&&(o=bg(["/",o]));const u=o==="__root__"?"/":bg([this.parentRoute.fullPath,i]);this._path=i,this._id=o,this._fullPath=u,this._to=Eo(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=>zN({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.")}},nG=class extends s5{constructor(e){super(e)}};function DN(e){const t=e.errorComponent??MN;return l.jsx(rG,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?x.createElement(t,{error:n,reset:r}):e.children})}var rG=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 MN({error:e}){const[t,n]=x.useState(!1);return l.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[l.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),l.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"})]}),l.jsx("div",{style:{height:".25rem"}}),t?l.jsx("div",{children:l.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?l.jsx("code",{children:e.message}):null})}):null]})}function iG({children:e,fallback:t=null}){return o5()?l.jsx(Ii.Fragment,{children:e}):l.jsx(Ii.Fragment,{children:t})}function o5(){return Ii.useSyncExternalStore(aG,()=>!0,()=>!1)}function aG(){return()=>{}}var l5=x.createContext(null);function Gi(e){const t=x.useContext(l5);return e?.warn,t}var ow={exports:{}},lw={},cw={exports:{}},uw={};var i2;function sG(){if(i2)return uw;i2=1;var e=cd();function t(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function u(m,y){var v=y(),w=r({inst:{value:v,getSnapshot:y}}),b=w[0].inst,j=w[1];return a(function(){b.value=v,b.getSnapshot=y,d(b)&&j({inst:b})},[m,v,y]),i(function(){return d(b)&&j({inst:b}),m(function(){d(b)&&j({inst:b})})},[m]),o(v),v}function d(m){var y=m.getSnapshot;m=m.value;try{var v=y();return!n(m,v)}catch{return!0}}function f(m,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return uw.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,uw}var a2;function oG(){return a2||(a2=1,cw.exports=sG()),cw.exports}var s2;function lG(){if(s2)return lw;s2=1;var e=cd(),t=oG();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,o=e.useEffect,u=e.useMemo,d=e.useDebugValue;return lw.useSyncExternalStoreWithSelector=function(f,p,m,y,v){var w=a(null);if(w.current===null){var b={hasValue:!1,value:null};w.current=b}else b=w.current;w=u(function(){function k(A){if(!E){if(E=!0,C=A,A=y(A),v!==void 0&&b.hasValue){var z=b.value;if(v(z,A))return O=z}return O=A}if(z=O,r(C,A))return z;var R=y(A);return v!==void 0&&v(z,R)?(C=A,z):(C=A,O=R)}var E=!1,C,O,_=m===void 0?null:m;return[function(){return k(p())},_===null?void 0:function(){return k(_())}]},[p,m,y,v]);var j=i(f,w[0],w[1]);return o(function(){b.hasValue=!0,b.value=j},[j]),d(j),j},lw}var o2;function cG(){return o2||(o2=1,ow.exports=lG()),ow.exports}var c5=cG();function uG(e,t){return e===t}function dG(e,t,n=uG){const r=x.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(o);return u},[e]),i=x.useCallback(()=>e?.get(),[e]);return c5.useSyncExternalStoreWithSelector(r,i,i,t,n)}function Wr(e){const t=Gi({warn:e?.router===void 0}),n=e?.router||t,r=x.useRef(void 0);return dG(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=Ol(r.current,e.select(i));return r.current=a,a}return e.select(i)}return i})}var mv=x.createContext(void 0),fG=x.createContext(void 0);function Uo(e){const t=x.useContext(e.from?fG:mv);return Wr({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(Cs(!((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 IN(e){return Uo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function LN(e){const{select:t,...n}=e;return Uo({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function $h(e){return Uo({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 gv(e){return Uo({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=Gi();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function $N(e){return Uo({...e,select:t=>e.select?e.select(t.context):t.context})}var uc=OL();const hG=ha(uc);function pG(e,t){const n=Gi(),r=$K(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:u,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:y,resetScroll:v,viewTransition:w,children:b,target:j,disabled:k,style:E,className:C,onClick:O,onBlur:_,onFocus:A,onMouseEnter:z,onMouseLeave:R,onTouchStart:$,ignoreBlocker:F,params:U,search:B,hash:V,state:X,mask:W,reloadDocument:H,unsafeRelative:J,from:ce,_fromLocation:xe,...M}=e,I=o5(),q=Wr({select:We=>{const ue=We.matches[We.matches.length-1];return{search:ue?.search,hash:We.location.hash,path:ue?.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]),oe=x.useMemo(()=>n.buildLocation({...G}),[n,G]),ne=oe.maskedLocation?oe.maskedLocation.publicHref:oe.publicHref,Ae=oe.maskedLocation?oe.maskedLocation.external:oe.external,we=x.useMemo(()=>bG(ne,Ae,n.history,k),[k,Ae,ne,n.history]),ee=x.useMemo(()=>{if(we?.external)return $g(we.href,n.protocolAllowlist)?void 0:we.href;if(!wG(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),$g(u,n.protocolAllowlist)?void 0:u}catch{}},[u,we,n.protocolAllowlist]),he=Wr({select:We=>{if(ee)return!1;if(o?.exact){if(!i7(We.location.pathname,oe.pathname,n.basepath))return!1}else{const ue=Ug(We.location.pathname,n.basepath),je=Ug(oe.pathname,n.basepath);if(!(ue.startsWith(je)&&(ue.length===je.length||ue[je.length]==="/")))return!1}return(o?.includeSearch??!0)&&!Il(We.location.search,oe.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?I&&We.location.hash===oe.hash:!0}}),_e=he?jo(i,{})??mG:dw,Z=he?dw:jo(a,{})??dw,Fe=[C,_e.className,Z.className].filter(Boolean).join(" "),Re=(E||_e.style||Z.style)&&{...E,..._e.style,...Z.style},[st,Ke]=x.useState(!1),Kt=x.useRef(!1),Bt=e.reloadDocument||ee?!1:d??n.options.defaultPreload,on=f??n.options.defaultPreloadDelay??0,en=x.useCallback(()=>{n.preloadRoute({...G,_builtLocation:oe}).catch(We=>{console.warn(We),console.warn(tG)})},[n,G,oe]);LK(r,x.useCallback(We=>{We?.isIntersecting&&en()},[en]),xG,{disabled:!!k||Bt!=="viewport"}),x.useEffect(()=>{Kt.current||!k&&Bt==="render"&&(en(),Kt.current=!0)},[k,en,Bt]);const be=We=>{const ue=We.currentTarget.getAttribute("target"),je=j!==void 0?j:ue;if(!k&&!SG(We)&&!We.defaultPrevented&&(!je||je==="_self")&&We.button===0){We.preventDefault(),uc.flushSync(()=>{Ke(!0)});const Ie=n.subscribe("onResolved",()=>{Ie(),Ke(!1)});n.navigate({...G,replace:m,resetScroll:v,hashScrollIntoView:p,startTransition:y,viewTransition:w,ignoreBlocker:F})}};if(ee)return{...M,ref:r,href:ee,...b&&{children:b},...j&&{target:j},...k&&{disabled:k},...E&&{style:E},...C&&{className:C},...O&&{onClick:O},..._&&{onBlur:_},...A&&{onFocus:A},...z&&{onMouseEnter:z},...R&&{onMouseLeave:R},...$&&{onTouchStart:$}};const Ze=We=>{if(k||Bt!=="intent")return;if(!on){en();return}const ue=We.currentTarget;if(kf.has(ue))return;const je=setTimeout(()=>{kf.delete(ue),en()},on);kf.set(ue,je)},Dt=We=>{k||Bt!=="intent"||en()},yt=We=>{if(k||!Bt||!on)return;const ue=We.currentTarget,je=kf.get(ue);je&&(clearTimeout(je),kf.delete(ue))};return{...M,..._e,...Z,href:we?.href,ref:r,onClick:nu([O,be]),onBlur:nu([_,yt]),onFocus:nu([A,Ze]),onMouseEnter:nu([z,Ze]),onMouseLeave:nu([R,yt]),onTouchStart:nu([$,Dt]),disabled:!!k,target:j,...Re&&{style:Re},...Fe&&{className:Fe},...k&&gG,...he&&yG,...I&&st&&vG}}var dw={},mG={className:"active"},gG={role:"link","aria-disabled":!0},yG={"data-status":"active","aria-current":"page"},vG={"data-transitioning":"transitioning"},kf=new WeakMap,xG={rootMargin:"100px"},nu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function bG(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function wG(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var At=x.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...a}=pG(r,t),o=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,o)}return x.createElement(n,a,o)});function SG(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var jG=class extends s5{constructor(e){super(e),this.useMatch=t=>Uo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>$N({...t,from:this.id}),this.useSearch=t=>gv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>$h({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>LN({...t,from:this.id}),this.useLoaderData=t=>IN({...t,from:this.id}),this.useNavigate=()=>qo({from:this.fullPath}),this.Link=Ii.forwardRef((t,n)=>l.jsx(At,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function br(e){return new jG(e)}function NG(){return e=>CG(e)}var kG=class extends nG{constructor(e){super(e),this.useMatch=t=>Uo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>$N({...t,from:this.id}),this.useSearch=t=>gv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>$h({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>LN({...t,from:this.id}),this.useLoaderData=t=>IN({...t,from:this.id}),this.useNavigate=()=>qo({from:this.fullPath}),this.Link=Ii.forwardRef((t,n)=>l.jsx(At,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function CG(e){return new kG(e)}function l2(e){return typeof e=="object"?new c2(e,{silent:!0}).createRoute(e):new c2(e,{silent:!0}).createRoute}var c2=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=br(n);return r.isRoot=!1,r},this.silent=t?.silent}},u2=class{constructor(e){this.useMatch=t=>Uo({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>$N({...t,from:this.options.id}),this.useSearch=t=>gv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>$h({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>LN({...t,from:this.options.id}),this.useLoaderData=t=>IN({...t,from:this.options.id}),this.useNavigate=()=>qo({from:Gi().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function d2(e){return typeof e=="object"?new u2(e):t=>new u2({id:e,...t})}function AG(e){const t=Wr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return l.jsx(DN,{getResetKey:()=>t,onCatch:(n,r)=>{if(Pr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Pr(n))return e.fallback?.(n);throw n},children:e.children})}function OG(){return l.jsx("p",{children:"Not Found"})}function bu(e){return l.jsx(l.Fragment,{children:e.children})}function u5(e,t,n){return t.options.notFoundComponent?l.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?l.jsx(e.options.defaultNotFoundComponent,{...n}):l.jsx(OG,{})}function EG(){return Gi().isScrollRestoring,null}var d5=x.memo(function({matchId:t}){const n=Gi(),r=Wr({select:w=>{const b=w.matches.findIndex(k=>k.id===t),j=w.matches[b];return Cs(j),{routeId:j.routeId,ssr:j.ssr,_displayPending:j._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[b-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],a=i.options.pendingComponent??n.options.defaultPendingComponent,o=a?l.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:bu,y=u?DN:bu,v=f?AG:bu;return l.jsxs(i.isRoot?i.options.shellComponent??bu:bu,{children:[l.jsx(mv.Provider,{value:t,children:l.jsx(m,{fallback:o,children:l.jsx(y,{getResetKey:()=>r.resetKey,errorComponent:u||MN,onCatch:(w,b)=>{if(Pr(w))throw w;d?.(w,b)},children:l.jsx(v,{fallback:w=>{if(!f||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!i.isRoot)throw w;return x.createElement(f,w)},children:p||r._displayPending?l.jsx(iG,{fallback:o,children:l.jsx(f2,{matchId:t})}):l.jsx(f2,{matchId:t})})})})}),r.parentRouteId===Ll&&n.options.scrollRestoration?l.jsxs(l.Fragment,{children:[l.jsx(_G,{}),l.jsx(EG,{})]}):null]})});function _G(){const e=Gi(),t=x.useRef(void 0);return l.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Bl(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var f2=x.memo(function({matchId:t}){const n=Gi(),{match:r,key:i,routeId:a}=Wr({select:d=>{const f=d.matches.find(y=>y.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}),o=n.routesById[a],u=x.useMemo(()=>{const d=o.options.component??n.options.defaultComponent;return d?l.jsx(d,{},i):l.jsx(BN,{})},[i,o.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=o.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const f=n.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise){const p=Ku();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 Cs(Pr(r.error)),u5(n,o,r.error);if(r.status==="redirected")throw Cs(Vr(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return u}),BN=x.memo(function(){const t=Gi(),n=x.useContext(mv),r=Wr({select:f=>f.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],a=Wr({select:f=>{const p=f.matches.find(m=>m.id===n);return Cs(p),p.globalNotFound}}),o=Wr({select:f=>{const p=f.matches;return p[p.findIndex(m=>m.id===n)+1]?.id}}),u=t.options.defaultPendingComponent?l.jsx(t.options.defaultPendingComponent,{}):null;if(a)return u5(t,i,void 0);if(!o)return null;const d=l.jsx(d5,{matchId:o});return r===Ll?l.jsx(x.Suspense,{fallback:u,children:d}):d});function zG(){const e=Gi(),t=x.useRef({router:e,mounted:!1}),[n,r]=x.useState(!1),{hasPendingMatches:i,isLoading:a}=Wr({select:m=>({isLoading:m.isLoading,hasPendingMatches:m.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),o=tw(a),u=a||n||i,d=tw(u),f=a||i,p=tw(f);return e.startTransition=m=>{r(!0),x.startTransition(()=>{m(),r(!1)})},x.useEffect(()=>{const m=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Eo(e.latestLocation.publicHref)!==Eo(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{m()}},[e,e.history]),Am(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),Am(()=>{o&&!a&&e.emit({type:"onLoad",...Bl(e.state)})},[o,e,a]),Am(()=>{p&&!f&&e.emit({type:"onBeforeRouteMount",...Bl(e.state)})},[f,p,e]),Am(()=>{if(d&&!u){const m=Bl(e.state);e.emit({type:"onResolved",...m}),e.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),m.hrefChanged&&p7(e)}},[u,d,e]),null}function TG(){const e=Gi(),t=e.routesById[Ll].options.pendingComponent??e.options.defaultPendingComponent,n=t?l.jsx(t,{}):null,r=l.jsxs(typeof document<"u"&&e.ssr?bu:x.Suspense,{fallback:n,children:[l.jsx(zG,{}),l.jsx(PG,{})]});return e.options.InnerWrap?l.jsx(e.options.InnerWrap,{children:r}):r}function PG(){const e=Gi(),t=Wr({select:i=>i.matches[0]?.id}),n=Wr({select:i=>i.loadedAt}),r=t?l.jsx(d5,{matchId:t}):null;return l.jsx(mv.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:l.jsx(DN,{getResetKey:()=>n,errorComponent:MN,onCatch:void 0,children:r})})}var RG=e=>new DG(e),DG=class extends Q7{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=l2,globalThis.createLazyFileRoute=d2):typeof window<"u"&&(window.createFileRoute=l2,window.createLazyFileRoute=d2);function MG({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=l.jsx(l5.Provider,{value:e,children:t});return e.options.Wrap?l.jsx(e.options.Wrap,{children:r}):r}function IG({router:e,...t}){return l.jsx(MG,{router:e,...t,children:l.jsx(TG,{})})}function f5(e){return Wr({select:t=>t.location})}class vr extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function LG(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const h5=LG();function $G(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function BG(e){return`${$G()}${e}`}function UG(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 qG(){return""}function h2(){return!!qG()}async function Oe(e,t){const n=t?.body!=null,r=await fetch(`${h5}${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}`,o;if(i)try{const u=JSON.parse(i);typeof u.error=="string"?a=u.error:u.error?.message?(a=u.error.message,o=u.error.code):u.message&&(a=u.message)}catch{a=i}throw new vr(a,r.status,o)}if(r.status!==204)return r.json()}function yv(){return Oe("/projects")}function p5(e){return Oe(`/projects/${encodeURIComponent(e)}`)}function m5(){return Oe("/runs")}function FG(e){return Oe(`/projects/${encodeURIComponent(e)}/runs`)}function Vl(e){return Oe(`/runs/${encodeURIComponent(e)}`)}function HG(e){return Oe(`/projects/${encodeURIComponent(e)}/queries`)}function g5(e){return Oe(`/projects/${encodeURIComponent(e)}/competitors`)}function y5(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const r=n.toString();return Oe(`/projects/${encodeURIComponent(e)}/timeline${r?`?${r}`:""}`)}function KG(e,t){const r=new URLSearchParams().toString();return Oe(`/projects/${encodeURIComponent(e)}/overview${r?`?${r}`:""}`)}function vv(e,t){return Oe(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function GG(e,t){return Oe(`/projects/${encodeURIComponent(e)}/queries`,{method:"PUT",body:JSON.stringify({queries:t})})}function VG(e,t){return Oe(`/projects/${encodeURIComponent(e)}/queries`,{method:"POST",body:JSON.stringify({queries:t})})}function v5(e,t){return Oe(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function p2(e,t){const n=await p5(e);return vv(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 QG(e,t){const n=await p5(e);return vv(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 YG(e,t){const n={};return t?.location&&(n.location=t.location),t?.allLocations&&(n.allLocations=!0),t?.noLocation&&(n.noLocation=!0),Oe(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function ZG(e,t){return Oe(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function WG(e,t){await Oe(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function XG(e,t){return Oe(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function JG(e){await Oe(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function eV(e){return Oe(`/projects/${encodeURIComponent(e)}/export`)}function UN(){return Oe("/settings")}function tV(){return Oe("/session")}function nV(e){return Oe("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function rV(e){return Oe("/session",{method:"POST",body:JSON.stringify({password:e})})}function iV(e,t){return Oe(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function aV(e){return Oe("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function sV(e){try{return await Oe(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof vr&&t.statusCode===404)return null;throw t}}function m2(e,t){return Oe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function oV(e){await Oe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function lV(e){return Oe(`/projects/${encodeURIComponent(e)}/notifications`)}function cV(e,t){return Oe(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function uV(e,t){await Oe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function dV(e,t){return Oe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function fV(e,t,n){return Oe(`/projects/${encodeURIComponent(e)}/queries/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function hV(e){return Oe("/apply",{method:"POST",body:JSON.stringify(e)})}function pV(e){return Oe("/runs",{method:"POST",body:JSON.stringify(e??{})})}function x5(e){return Oe(`/projects/${encodeURIComponent(e)}/google/connections`)}function mV(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function gV(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function yV(e){return Oe(`/projects/${encodeURIComponent(e)}/google/properties`)}function vV(e,t,n){return Oe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function xV(e,t,n){return Oe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function b5(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function bV(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 Oe(`/projects/${encodeURIComponent(e)}/google/gsc/performance${r}`)}function wV(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function SV(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 Oe(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${r}`)}function jV(e){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function qN(e){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function NV(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function kV(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function CV(e){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function AV(e){return Oe(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function g2(){return Oe("/cdp/status")}function OV(e,t){return Oe("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function y2(e,t){return Oe(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function w5(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/status`)}function EV(e,t){return Oe(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function _V(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function zV(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/sites`)}function TV(e,t){return Oe(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function FN(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function S5(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Oe(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function j5(e,t){return Oe(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function v2(e,t){return Oe(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function PV(e){return Oe(`/projects/${encodeURIComponent(e)}/bing/performance`)}function RV(e){return Oe("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function DV(e){return Oe(`/projects/${encodeURIComponent(e)}/report`)}function MV(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function IV(e,t="agency"){const n=new URLSearchParams({audience:t}),r=await fetch(`${h5}/projects/${encodeURIComponent(e)}/report.html?${n.toString()}`,{credentials:"same-origin",headers:{}});if(!r.ok)throw new vr(`Failed to download report: ${r.status}`,r.status);const i=await r.blob(),a=URL.createObjectURL(i),o=MV(r.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,u=document.createElement("a");u.href=a,u.download=o,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(a)}function LV(e){return Oe(`/projects/${encodeURIComponent(e)}/ga/status`)}function $V(e,t,n){const r=new URLSearchParams;n&&n!=="all"&&r.set("window",n);const i=r.toString()?`?${r}`:"";return Oe(`/projects/${encodeURIComponent(e)}/ga/traffic${i}`)}function N5(e,t){return Oe(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function BV(e,t){return Oe(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function UV(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history${n}`)}function qV(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/ga/social-referral-history${n}`)}function FV(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Oe(`/projects/${encodeURIComponent(e)}/ga/session-history${n}`)}function HV(e){return Oe(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function KV(e){return Oe(`/projects/${encodeURIComponent(e)}/traffic/sources`)}function GV(e){return Oe(`/projects/${encodeURIComponent(e)}/traffic/status`)}function k5(e,t){return Oe(`/projects/${encodeURIComponent(e)}/traffic/sources/${encodeURIComponent(t)}`)}function VV(e,t){const n={};t?.since&&(n.since=t.since),t?.until&&(n.until=t.until),t?.kind&&(n.kind=t.kind),t?.sourceId&&(n.sourceId=t.sourceId),t?.limit!==void 0&&(n.limit=String(t.limit));const r=Object.keys(n).length?"?"+new URLSearchParams(n).toString():"";return Oe(`/projects/${encodeURIComponent(e)}/traffic/events${r}`)}function QV(e,t){return Oe(`/projects/${encodeURIComponent(e)}/traffic/connect/cloud-run`,{method:"POST",body:JSON.stringify(t)})}function YV(e,t,n){return Oe(`/projects/${encodeURIComponent(e)}/traffic/sources/${encodeURIComponent(t)}/sync`,{method:"POST",body:JSON.stringify(n??{})})}function ZV(e,t){const n=t?`?runId=${encodeURIComponent(t)}`:"";return Oe(`/projects/${encodeURIComponent(e)}/insights${n}`)}function WV(e){return Oe(`/projects/${encodeURIComponent(e)}/citations/visibility`)}async function XV(e,t){const n=BG(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:UG(e,r.status)};const i=await r.json(),a=typeof i.version=="string"?i.version:"unknown",o=typeof i.databaseUrlConfigured=="boolean"?i.databaseUrlConfigured:void 0,u=typeof i.lastHeartbeatAt=="string"?i.lastHeartbeatAt:void 0,d=[a,o===!1?"database not configured":"database configured",u?`heartbeat ${u}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:d,version:a,databaseConfigured:o,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 JV(){return Oe("/backlinks/status")}function eQ(){return Oe("/backlinks/install",{method:"POST"})}function C5(){return Oe("/backlinks/syncs/latest")}function tQ(){return Oe("/backlinks/syncs")}function nQ(e){return Oe("/backlinks/syncs",{method:"POST",body:JSON.stringify(e?{release:e}:{})})}function rQ(){return Oe("/backlinks/releases")}function iQ(){return Oe("/backlinks/latest-release")}function aQ(e){return Oe(`/backlinks/cache/${encodeURIComponent(e)}`,{method:"DELETE"})}function sQ(e,t={}){const n=new URLSearchParams;t.release&&n.set("release",t.release),t.excludeCrawlers&&n.set("excludeCrawlers","1");const r=n.toString();return Oe(`/projects/${encodeURIComponent(e)}/backlinks/summary${r?`?${r}`:""}`)}function oQ(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 Oe(`/projects/${encodeURIComponent(e)}/backlinks/domains${r?`?${r}`:""}`)}function lQ(e){return Oe(`/projects/${encodeURIComponent(e)}/backlinks/history`)}function cQ(e,t){return Oe(`/projects/${encodeURIComponent(e)}/backlinks/extract`,{method:"POST",body:JSON.stringify({release:void 0})})}const uQ=6e3,dQ=5,fQ=180;let pr=[],hQ=0;const Bj=new Set,Uj=new Map,qj=new Map;function Gg(){const e=[...pr];for(const t of Bj)t(e)}function HN(e){const t=Uj.get(e);t&&(clearTimeout(t),Uj.delete(e));const n=qj.get(e);n&&(clearTimeout(n),qj.delete(e))}function A5(e){HN(e);const t=pr.length;pr=pr.filter(n=>n.id!==e),pr.length!==t&&Gg()}function x2(e){HN(e.id),Uj.set(e.id,setTimeout(()=>{Fj(e.id)},e.durationMs))}function pQ(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function bt(e,t="negative",n=uQ){const r=pQ(e,t,n),i={id:String(++hQ),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=pr.find(o=>o.dedupeKey===r.dedupeKey);if(a){if((r.dedupeMode??"drop")==="drop")return a.id;const o={...a,title:i.title,detail:i.detail,tone:i.tone,durationMs:i.durationMs,cta:i.cta,state:"open"};return pr=pr.map(u=>u.id===a.id?o:u),Gg(),x2(o),a.id}}return pr.length>=dQ&&A5(pr[0].id),pr=[...pr,i],Gg(),x2(i),i.id}function Fj(e){const t=pr.find(n=>n.id===e);!t||t.state==="closing"||(HN(e),pr=pr.map(n=>n.id===e?{...n,state:"closing"}:n),Gg(),qj.set(e,setTimeout(()=>{A5(e)},fQ)))}function mQ(e){return Bj.add(e),()=>{Bj.delete(e)}}function b2(){return pr}const gQ=5*6e4,O5=30*6e4,ys=3e4,mr=6e4,Hj=3e4;function yQ(){return new TK({defaultOptions:{queries:{staleTime:gQ,retry:1,refetchOnWindowFocus:!1}},mutationCache:new ML({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||bt({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const vQ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),xQ=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),w2=e=>{const t=xQ(e);return t.charAt(0).toUpperCase()+t.slice(1)},E5=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),bQ=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var wQ={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 SQ=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...u},d)=>x.createElement("svg",{ref:d,...wQ,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:E5("lucide",i),...!a&&!bQ(u)&&{"aria-hidden":"true"},...u},[...o.map(([f,p])=>x.createElement(f,p)),...Array.isArray(a)?a:[a]]));const jt=(e,t)=>{const n=x.forwardRef(({className:r,...i},a)=>x.createElement(SQ,{ref:a,iconNode:t,className:E5(`lucide-${vQ(w2(e))}`,`lucide-${e}`,r),...i}));return n.displayName=w2(e),n};const jQ=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],S2=jt("arrow-left",jQ);const NQ=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],kQ=jt("arrow-up",NQ);const CQ=[["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"}]],AQ=jt("book-open",CQ);const OQ=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],_5=jt("check",OQ);const EQ=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_Q=jt("chevron-down",EQ);const zQ=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Bh=jt("chevron-right",zQ);const TQ=[["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"}]],PQ=jt("circle-alert",TQ);const RQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],z5=jt("circle-check",RQ);const DQ=[["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=jt("circle-question-mark",DQ);const MQ=[["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"}]],IQ=jt("copy",MQ);const LQ=[["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"}]],xv=jt("download",LQ);const $Q=[["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"}]],BQ=jt("external-link",$Q);const UQ=[["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"}]],qQ=jt("file-text",UQ);const FQ=[["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"}]],HQ=jt("github",FQ);const KQ=[["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"}]],GQ=jt("globe",KQ);const VQ=[["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"}]],QQ=jt("layout-dashboard",VQ);const YQ=[["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"}]],P5=jt("link-2",YQ);const ZQ=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],R5=jt("loader-circle",ZQ);const WQ=[["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"}]],XQ=jt("maximize-2",WQ);const JQ=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],eY=jt("menu",JQ);const tY=[["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"}]],nY=jt("minimize-2",tY);const rY=[["path",{d:"M5 12h14",key:"1ays0h"}]],iY=jt("minus",rY);const aY=[["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"}]],Vg=jt("play",aY);const sY=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Qg=jt("plus",sY);const oY=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],lY=jt("radar",oY);const cY=[["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"}]],Yg=jt("refresh-cw",cY);const uY=[["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"}]],dY=jt("rocket",uY);const fY=[["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"}]],D5=jt("rotate-ccw",fY);const hY=[["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"}]],pY=jt("settings",hY);const mY=[["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"}]],j2=jt("sparkles",mY);const gY=[["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"}]],M5=jt("trash-2",gY);const yY=[["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"}]],Zg=jt("triangle-alert",yY);const vY=[["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"}]],xY=jt("unplug",vY);const bY=[["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"}]],wY=jt("upload",bY);const SY=[["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"}]],jY=jt("wrench",SY);const NY=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Uh=jt("x",NY);function ge(e,t,n){function r(u,d){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:d,constr:o,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,d);const f=o.prototype,p=Object.keys(f);for(let m=0;m<p.length;m++){const y=p[m];y in u||(u[y]=f[y].bind(u))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(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(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:u=>n?.Parent&&u instanceof n.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class Tu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class I5 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const L5={};function Do(e){return L5}function $5(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 Kj(e,t){return typeof t=="bigint"?t.toString():t}function bv(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function KN(e){return e==null}function GN(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function kY(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,o=Number.parseInt(e.toFixed(a).replace(".","")),u=Number.parseInt(t.toFixed(a).replace(".",""));return o%u/10**a}const N2=Symbol("evaluating");function Mt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==N2)return r===void 0&&(r=N2,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function dc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Fo(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function k2(e){return JSON.stringify(e)}function CY(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const B5="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ph(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const AY=bv(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Gu(e){if(ph(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ph(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function U5(e){return Gu(e)?{...e}:Array.isArray(e)?[...e]:e}const OY=new Set(["string","number","symbol"]);function Vu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ho(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function qe(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 EY(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const _Y={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 zY(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=Fo(e._zod.def,{get shape(){const o={};for(const u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(o[u]=n.shape[u])}return dc(this,"shape",o),o},checks:[]});return Ho(e,a)}function TY(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=Fo(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete o[u]}return dc(this,"shape",o),o},checks:[]});return Ho(e,a)}function PY(e,t){if(!Gu(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 o in t)if(Object.getOwnPropertyDescriptor(a,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Fo(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return dc(this,"shape",a),a}});return Ho(e,i)}function RY(e,t){if(!Gu(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Fo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return dc(this,"shape",r),r}});return Ho(e,n)}function DY(e,t){const n=Fo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return dc(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Ho(e,n)}function MY(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 o=Fo(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 dc(this,"shape",d),d},checks:[]});return Ho(t,o)}function IY(e,t,n){const r=Fo(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const o in n){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(a[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)a[o]=new e({type:"nonoptional",innerType:i[o]});return dc(this,"shape",a),a}});return Ho(t,r)}function Su(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 ju(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function _m(e){return typeof e=="string"?e:e?.message}function Mo(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=_m(e.inst?._zod.def?.error?.(e))??_m(t?.error?.(e))??_m(n.customError?.(e))??_m(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function VN(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function mh(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const q5=(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,Kj,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},F5=ge("$ZodError",q5),H5=ge("$ZodError",q5,{Parent:Error});function LY(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 $Y(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(o=>r({issues:o}));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 o=n,u=0;for(;u<a.path.length;){const d=a.path[u];u===a.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(a))):o[d]=o[d]||{_errors:[]},o=o[d],u++}}};return r(e),n}const QN=e=>(t,n,r,i)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Tu;if(o.issues.length){const u=new(i?.Err??e)(o.issues.map(d=>Mo(d,a,Do())));throw B5(u,i?.callee),u}return o.value},YN=e=>async(t,n,r,i)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const u=new(i?.Err??e)(o.issues.map(d=>Mo(d,a,Do())));throw B5(u,i?.callee),u}return o.value},wv=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 Tu;return a.issues.length?{success:!1,error:new(e??F5)(a.issues.map(o=>Mo(o,i,Do())))}:{success:!0,data:a.value}},BY=wv(H5),Sv=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(o=>Mo(o,i,Do())))}:{success:!0,data:a.value}},UY=Sv(H5),qY=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return QN(e)(t,n,i)},FY=e=>(t,n,r)=>QN(e)(t,n,r),HY=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return YN(e)(t,n,i)},KY=e=>async(t,n,r)=>YN(e)(t,n,r),GY=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return wv(e)(t,n,i)},VY=e=>(t,n,r)=>wv(e)(t,n,r),QY=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Sv(e)(t,n,i)},YY=e=>async(t,n,r)=>Sv(e)(t,n,r),ZY=/^[cC][^\s-]{8,}$/,WY=/^[0-9a-z]+$/,XY=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,JY=/^[0-9a-vA-V]{20}$/,eZ=/^[A-Za-z0-9]{27}$/,tZ=/^[a-zA-Z0-9_-]{21}$/,nZ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rZ=/^([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})$/,C2=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)$/,iZ=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,aZ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function sZ(){return new RegExp(aZ,"u")}const oZ=/^(?:(?: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])$/,lZ=/^(([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}|:))$/,cZ=/^((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])$/,uZ=/^(([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])$/,dZ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,K5=/^[A-Za-z0-9_-]*$/,fZ=/^\+[1-9]\d{6,14}$/,G5="(?:(?:\\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])))",hZ=new RegExp(`^${G5}$`);function V5(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 pZ(e){return new RegExp(`^${V5(e)}$`)}function mZ(e){const t=V5({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(`^${G5}T(?:${r})$`)}const gZ=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},yZ=/^-?\d+$/,Q5=/^-?\d+(?:\.\d+)?$/,vZ=/^(?:true|false)$/i,xZ=/^[^A-Z]*$/,bZ=/^[^a-z]*$/,ti=ge("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Y5={number:"number",bigint:"bigint",object:"date"},Z5=ge("$ZodCheckLessThan",(e,t)=>{ti.init(e,t);const n=Y5[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})}}),W5=ge("$ZodCheckGreaterThan",(e,t)=>{ti.init(e,t);const n=Y5[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})}}),wZ=ge("$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):kY(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})}}),SZ=ge("$ZodCheckNumberFormat",(e,t)=>{ti.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,a]=_Y[t.format];e._zod.onattach.push(o=>{const u=o._zod.bag;u.format=t.format,u.minimum=i,u.maximum=a,n&&(u.pattern=yZ)}),e._zod.check=o=>{const u=o.value;if(n){if(!Number.isInteger(u)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?o.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}):o.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&&o.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),u>a&&o.issues.push({origin:"number",input:u,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),jZ=ge("$ZodCheckMaxLength",(e,t)=>{var n;ti.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!KN(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 o=VN(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),NZ=ge("$ZodCheckMinLength",(e,t)=>{var n;ti.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!KN(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 o=VN(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),kZ=ge("$ZodCheckLengthEquals",(e,t)=>{var n;ti.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!KN(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 o=VN(i),u=a>t.length;r.issues.push({origin:o,...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})}}),jv=ge("$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=()=>{})}),CZ=ge("$ZodCheckRegex",(e,t)=>{jv.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})}}),AZ=ge("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=xZ),jv.init(e,t)}),OZ=ge("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=bZ),jv.init(e,t)}),EZ=ge("$ZodCheckIncludes",(e,t)=>{ti.init(e,t);const n=Vu(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})}}),_Z=ge("$ZodCheckStartsWith",(e,t)=>{ti.init(e,t);const n=new RegExp(`^${Vu(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})}}),zZ=ge("$ZodCheckEndsWith",(e,t)=>{ti.init(e,t);const n=new RegExp(`.*${Vu(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})}}),TZ=ge("$ZodCheckOverwrite",(e,t)=>{ti.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class PZ{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(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),a=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of a)this.content.push(o)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
|
|
11
|
+
`))}}const RZ={major:4,minor:3,patch:6},gn=ge("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=RZ;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=(o,u,d)=>{let f=Su(o),p;for(const m of u){if(m._zod.def.when){if(!m._zod.def.when(o))continue}else if(f)continue;const y=o.issues.length,v=m._zod.check(o);if(v instanceof Promise&&d?.async===!1)throw new Tu;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,o.issues.length!==y&&(f||(f=Su(o,y)))});else{if(o.issues.length===y)continue;f||(f=Su(o,y))}}return p?p.then(()=>o):o},a=(o,u,d)=>{if(Su(o))return o.aborted=!0,o;const f=i(u,r,d);if(f instanceof Promise){if(d.async===!1)throw new Tu;return f.then(p=>e._zod.parse(p,d))}return e._zod.parse(f,d)};e._zod.run=(o,u)=>{if(u.skipChecks)return e._zod.parse(o,u);if(u.direction==="backward"){const f=e._zod.parse({value:o.value,issues:[]},{...u,skipChecks:!0});return f instanceof Promise?f.then(p=>a(p,o,u)):a(f,o,u)}const d=e._zod.parse(o,u);if(d instanceof Promise){if(u.async===!1)throw new Tu;return d.then(f=>i(f,r,u))}return i(d,r,u)}}Mt(e,"~standard",()=>({validate:i=>{try{const a=BY(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return UY(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),ZN=ge("$ZodString",(e,t)=>{gn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??gZ(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}}),dn=ge("$ZodStringFormat",(e,t)=>{jv.init(e,t),ZN.init(e,t)}),DZ=ge("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=rZ),dn.init(e,t)}),MZ=ge("$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=C2(r))}else t.pattern??(t.pattern=C2());dn.init(e,t)}),IZ=ge("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=iZ),dn.init(e,t)}),LZ=ge("$ZodURL",(e,t)=>{dn.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})}}}),$Z=ge("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=sZ()),dn.init(e,t)}),BZ=ge("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=tZ),dn.init(e,t)}),UZ=ge("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ZY),dn.init(e,t)}),qZ=ge("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=WY),dn.init(e,t)}),FZ=ge("$ZodULID",(e,t)=>{t.pattern??(t.pattern=XY),dn.init(e,t)}),HZ=ge("$ZodXID",(e,t)=>{t.pattern??(t.pattern=JY),dn.init(e,t)}),KZ=ge("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=eZ),dn.init(e,t)}),GZ=ge("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=mZ(t)),dn.init(e,t)}),VZ=ge("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=hZ),dn.init(e,t)}),QZ=ge("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=pZ(t)),dn.init(e,t)}),YZ=ge("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=nZ),dn.init(e,t)}),ZZ=ge("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=oZ),dn.init(e,t),e._zod.bag.format="ipv4"}),WZ=ge("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=lZ),dn.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})}}}),XZ=ge("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=cZ),dn.init(e,t)}),JZ=ge("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=uZ),dn.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 o=Number(a);if(`${o}`!==a)throw new Error;if(o<0||o>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 X5(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const eW=ge("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=dZ),dn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{X5(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function tW(e){if(!K5.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return X5(n)}const nW=ge("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=K5),dn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{tW(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),rW=ge("$ZodE164",(e,t)=>{t.pattern??(t.pattern=fZ),dn.init(e,t)});function iW(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 aW=ge("$ZodJWT",(e,t)=>{dn.init(e,t),e._zod.check=n=>{iW(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),J5=ge("$ZodNumber",(e,t)=>{gn.init(e,t),e._zod.pattern=e._zod.bag.pattern??Q5,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}}),sW=ge("$ZodNumberFormat",(e,t)=>{SZ.init(e,t),J5.init(e,t)}),oW=ge("$ZodBoolean",(e,t)=>{gn.init(e,t),e._zod.pattern=vZ,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}}),lW=ge("$ZodUnknown",(e,t)=>{gn.init(e,t),e._zod.parse=n=>n}),cW=ge("$ZodNever",(e,t)=>{gn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function A2(e,t,n){e.issues.length&&t.issues.push(...ju(n,e.issues)),t.value[n]=e.value}const uW=ge("$ZodArray",(e,t)=>{gn.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 o=0;o<i.length;o++){const u=i[o],d=t.element._zod.run({value:u,issues:[]},r);d instanceof Promise?a.push(d.then(f=>A2(f,n,o))):A2(d,n,o)}return a.length?Promise.all(a).then(()=>n):n}});function Wg(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...ju(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function e4(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=EY(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function t4(e,t,n,r,i,a){const o=[],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"){o.push(m);continue}const y=d.run({value:t[m],issues:[]},r);y instanceof Promise?e.push(y.then(v=>Wg(v,n,m,t,p))):Wg(y,n,m,t,p)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const dW=ge("$ZodObject",(e,t)=>{if(gn.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=bv(()=>e4(t));Mt(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=ph,a=t.catchall;let o;e._zod.parse=(u,d)=>{o??(o=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=o.shape;for(const y of o.keys){const v=m[y],w=v._zod.optout==="optional",b=v._zod.run({value:f[y],issues:[]},d);b instanceof Promise?p.push(b.then(j=>Wg(j,u,y,f,w))):Wg(b,u,y,f,w)}return a?t4(p,f,u,d,r.value,e):p.length?Promise.all(p).then(()=>u):u}}),fW=ge("$ZodObjectJIT",(e,t)=>{dW.init(e,t);const n=e._zod.parse,r=bv(()=>e4(t)),i=y=>{const v=new PZ(["shape","payload","ctx"]),w=r.value,b=C=>{const O=k2(C);return`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`};v.write("const input = payload.value;");const j=Object.create(null);let k=0;for(const C of w.keys)j[C]=`key_${k++}`;v.write("const newResult = {};");for(const C of w.keys){const O=j[C],_=k2(C),z=y[C]?._zod?.optout==="optional";v.write(`const ${O} = ${b(C)};`),z?v.write(`
|
|
12
|
+
if (${O}.issues.length) {
|
|
13
|
+
if (${_} in input) {
|
|
14
|
+
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
15
|
+
...iss,
|
|
16
|
+
path: iss.path ? [${_}, ...iss.path] : [${_}]
|
|
17
|
+
})));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (${O}.value === undefined) {
|
|
22
|
+
if (${_} in input) {
|
|
23
|
+
newResult[${_}] = undefined;
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
newResult[${_}] = ${O}.value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
`):v.write(`
|
|
30
|
+
if (${O}.issues.length) {
|
|
31
|
+
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
32
|
+
...iss,
|
|
33
|
+
path: iss.path ? [${_}, ...iss.path] : [${_}]
|
|
34
|
+
})));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (${O}.value === undefined) {
|
|
38
|
+
if (${_} in input) {
|
|
39
|
+
newResult[${_}] = undefined;
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
newResult[${_}] = ${O}.value;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
`)}v.write("payload.value = newResult;"),v.write("return payload;");const E=v.compile();return(C,O)=>E(y,C,O)};let a;const o=ph,u=!L5.jitless,f=u&&AY.value,p=t.catchall;let m;e._zod.parse=(y,v)=>{m??(m=r.value);const w=y.value;return o(w)?u&&f&&v?.async===!1&&v.jitless!==!0?(a||(a=i(t.shape)),y=a(y,v),p?t4([],w,y,v,m,e):y):n(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),y)}});function O2(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=>!Su(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(o=>Mo(o,r,Do())))}),t)}const n4=ge("$ZodUnion",(e,t)=>{gn.init(e,t),Mt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Mt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Mt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Mt(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=>GN(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 o=!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),o=!0;else{if(f.issues.length===0)return f;u.push(f)}}return o?Promise.all(u).then(d=>O2(d,i,e,a)):O2(u,i,e,a)}}),hW=ge("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,n4.init(e,t);const n=e._zod.parse;Mt(e._zod,"propValues",()=>{const i={};for(const a of t.options){const o=a._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const[u,d]of Object.entries(o)){i[u]||(i[u]=new Set);for(const f of d)i[u].add(f)}}return i});const r=bv(()=>{const i=t.options,a=new Map;for(const o of i){const u=o._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const d of u){if(a.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);a.set(d,o)}}return a});e._zod.parse=(i,a)=>{const o=i.value;if(!ph(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),i;const u=r.value.get(o?.[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:o,path:[t.discriminator],inst:e}),i)}}),pW=ge("$ZodIntersection",(e,t)=>{gn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},r),o=t.right._zod.run({value:i,issues:[]},r);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([d,f])=>E2(n,d,f)):E2(n,a,o)}});function Gj(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(Gu(e)&&Gu(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 o=Gj(e[a],t[a]);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};i[a]=o.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],o=Gj(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function E2(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}),Su(e))return e;const o=Gj(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const mW=ge("$ZodRecord",(e,t)=>{gn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Gu(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],o=t.keyType._zod.values;if(o){n.value={};const u=new Set;for(const f of o)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(...ju(f,m.issues)),n.value[f]=m.value})):(p.issues.length&&n.issues.push(...ju(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"&&Q5.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=>Mo(m,r,Do())),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(...ju(u,m.issues)),n.value[d.value]=m.value})):(p.issues.length&&n.issues.push(...ju(u,p.issues)),n.value[d.value]=p.value)}}return a.length?Promise.all(a).then(()=>n):n}}),gW=ge("$ZodEnum",(e,t)=>{gn.init(e,t);const n=$5(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>OY.has(typeof i)).map(i=>typeof i=="string"?Vu(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:n,input:o,inst:e}),i}}),yW=ge("$ZodLiteral",(e,t)=>{if(gn.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"?Vu(r):r?Vu(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}}),vW=ge("$ZodTransform",(e,t)=>{gn.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new I5(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(n.value=o,n));if(i instanceof Promise)throw new Tu;return n.value=i,n}});function _2(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const r4=ge("$ZodOptional",(e,t)=>{gn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Mt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${GN(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=>_2(a,n.value)):_2(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),xW=ge("$ZodExactOptional",(e,t)=>{r4.init(e,t),Mt(e._zod,"values",()=>t.innerType._zod.values),Mt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),bW=ge("$ZodNullable",(e,t)=>{gn.init(e,t),Mt(e._zod,"optin",()=>t.innerType._zod.optin),Mt(e._zod,"optout",()=>t.innerType._zod.optout),Mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${GN(n.source)}|null)$`):void 0}),Mt(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)}),wW=ge("$ZodDefault",(e,t)=>{gn.init(e,t),e._zod.optin="optional",Mt(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=>z2(a,t)):z2(i,t)}});function z2(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const SW=ge("$ZodPrefault",(e,t)=>{gn.init(e,t),e._zod.optin="optional",Mt(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))}),jW=ge("$ZodNonOptional",(e,t)=>{gn.init(e,t),Mt(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=>T2(a,e)):T2(i,e)}});function T2(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 NW=ge("$ZodCatch",(e,t)=>{gn.init(e,t),Mt(e._zod,"optin",()=>t.innerType._zod.optin),Mt(e._zod,"optout",()=>t.innerType._zod.optout),Mt(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(o=>Mo(o,r,Do()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>Mo(a,r,Do()))},input:n.value}),n.issues=[]),n)}}),kW=ge("$ZodPipe",(e,t)=>{gn.init(e,t),Mt(e._zod,"values",()=>t.in._zod.values),Mt(e._zod,"optin",()=>t.in._zod.optin),Mt(e._zod,"optout",()=>t.out._zod.optout),Mt(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(o=>zm(o,t.in,r)):zm(a,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>zm(a,t.out,r)):zm(i,t.out,r)}});function zm(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const CW=ge("$ZodReadonly",(e,t)=>{gn.init(e,t),Mt(e._zod,"propValues",()=>t.innerType._zod.propValues),Mt(e._zod,"values",()=>t.innerType._zod.values),Mt(e._zod,"optin",()=>t.innerType?._zod?.optin),Mt(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(P2):P2(i)}});function P2(e){return e.value=Object.freeze(e.value),e}const AW=ge("$ZodCustom",(e,t)=>{ti.init(e,t),gn.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=>R2(a,n,r,e));R2(i,n,r,e)}});function R2(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(mh(i))}}var D2;class OW{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 EW(){return new OW}(D2=globalThis).__zod_globalRegistry??(D2.__zod_globalRegistry=EW());const Gf=globalThis.__zod_globalRegistry;function _W(e,t){return new e({type:"string",...qe(t)})}function zW(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...qe(t)})}function M2(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...qe(t)})}function TW(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...qe(t)})}function PW(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...qe(t)})}function RW(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...qe(t)})}function DW(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...qe(t)})}function MW(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...qe(t)})}function IW(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...qe(t)})}function LW(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...qe(t)})}function $W(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...qe(t)})}function BW(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...qe(t)})}function UW(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...qe(t)})}function qW(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...qe(t)})}function FW(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...qe(t)})}function HW(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...qe(t)})}function KW(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...qe(t)})}function GW(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...qe(t)})}function VW(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...qe(t)})}function QW(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...qe(t)})}function YW(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...qe(t)})}function ZW(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...qe(t)})}function WW(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...qe(t)})}function XW(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...qe(t)})}function JW(e,t){return new e({type:"string",format:"date",check:"string_format",...qe(t)})}function eX(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...qe(t)})}function tX(e,t){return new e({type:"string",format:"duration",check:"string_format",...qe(t)})}function nX(e,t){return new e({type:"number",checks:[],...qe(t)})}function rX(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...qe(t)})}function iX(e,t){return new e({type:"boolean",...qe(t)})}function aX(e){return new e({type:"unknown"})}function sX(e,t){return new e({type:"never",...qe(t)})}function I2(e,t){return new Z5({check:"less_than",...qe(t),value:e,inclusive:!1})}function fw(e,t){return new Z5({check:"less_than",...qe(t),value:e,inclusive:!0})}function L2(e,t){return new W5({check:"greater_than",...qe(t),value:e,inclusive:!1})}function hw(e,t){return new W5({check:"greater_than",...qe(t),value:e,inclusive:!0})}function $2(e,t){return new wZ({check:"multiple_of",...qe(t),value:e})}function i4(e,t){return new jZ({check:"max_length",...qe(t),maximum:e})}function Xg(e,t){return new NZ({check:"min_length",...qe(t),minimum:e})}function a4(e,t){return new kZ({check:"length_equals",...qe(t),length:e})}function oX(e,t){return new CZ({check:"string_format",format:"regex",...qe(t),pattern:e})}function lX(e){return new AZ({check:"string_format",format:"lowercase",...qe(e)})}function cX(e){return new OZ({check:"string_format",format:"uppercase",...qe(e)})}function uX(e,t){return new EZ({check:"string_format",format:"includes",...qe(t),includes:e})}function dX(e,t){return new _Z({check:"string_format",format:"starts_with",...qe(t),prefix:e})}function fX(e,t){return new zZ({check:"string_format",format:"ends_with",...qe(t),suffix:e})}function ud(e){return new TZ({check:"overwrite",tx:e})}function hX(e){return ud(t=>t.normalize(e))}function pX(){return ud(e=>e.trim())}function mX(){return ud(e=>e.toLowerCase())}function gX(){return ud(e=>e.toUpperCase())}function yX(){return ud(e=>CY(e))}function vX(e,t,n){return new e({type:"array",element:t,...qe(n)})}function xX(e,t,n){return new e({type:"custom",check:"custom",fn:t,...qe(n)})}function bX(e){const t=wX(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(mh(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(mh(i))}},e(n.value,n)));return t}function wX(e,t){const n=new ti({check:"custom",...qe(t)});return n._zod.check=e,n}function s4(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??Gf,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 Ln(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 o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const u=e._zod.toJSONSchema?.();if(u)o.schema=u;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,p);else{const y=o.schema,v=t.processors[i.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);v(e,t,y,p)}const m=e._zod.parent;m&&(o.ref||(o.ref=m),Ln(m,t,p),t.seen.get(m).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(o.schema,d),t.io==="input"&&Er(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function o4(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 o of e.seen.entries()){const u=e.metadataRegistry.get(o[0])?.id;if(u){const d=r.get(u);if(d&&d!==o[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,o[0])}}const i=o=>{const u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(o[0])?.id,y=e.external.uri??(w=>w);if(m)return{ref:y(m)};const v=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=v,{defId:v,ref:`${y("__shared")}#/${u}/${v}`}}if(o[1]===n)return{ref:"#"};const f=`#/${u}/`,p=o[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},a=o=>{if(o[1].schema.$ref)return;const u=o[1],{ref:d,defId:f}=i(o);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 o of e.seen.entries()){const u=o[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 o of e.seen.entries()){const u=o[1];if(t===o[0]){a(o);continue}if(e.external){const f=e.external.registry.get(o[0])?.id;if(t!==o[0]&&f){a(o);continue}}if(e.metadataRegistry.get(o[0])?.id){a(o);continue}if(u.cycle){a(o);continue}if(u.count>1&&e.reused==="ref"){a(o);continue}}}function l4(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const u=e.seen.get(o);if(u.ref===null)return;const d=u.def??u.schema,f={...d},p=u.ref;if(u.ref=null,p){r(p);const y=e.seen.get(p),v=y.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),o._zod.parent===p)for(const b in d)b==="$ref"||b==="allOf"||b in f||delete d[b];if(v.$ref&&y.def)for(const b in d)b==="$ref"||b==="allOf"||b in y.def&&JSON.stringify(d[b])===JSON.stringify(y.def[b])&&delete d[b]}const m=o._zod.parent;if(m&&m!==p){r(m);const y=e.seen.get(m);if(y?.schema.$ref&&(d.$ref=y.schema.$ref,y.def))for(const v in d)v==="$ref"||v==="allOf"||v in y.def&&JSON.stringify(d[v])===JSON.stringify(y.def[v])&&delete d[v]}e.override({zodSchema:o,jsonSchema:d,path:u.path??[]})};for(const o of[...e.seen.entries()].reverse())r(o[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 o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(o)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const o of e.seen.entries()){const u=o[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 o=JSON.parse(JSON.stringify(i));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Jg(t,"input",e.processors),output:Jg(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function Er(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 Er(r.element,n);if(r.type==="set")return Er(r.valueType,n);if(r.type==="lazy")return Er(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 Er(r.innerType,n);if(r.type==="intersection")return Er(r.left,n)||Er(r.right,n);if(r.type==="record"||r.type==="map")return Er(r.keyType,n)||Er(r.valueType,n);if(r.type==="pipe")return Er(r.in,n)||Er(r.out,n);if(r.type==="object"){for(const i in r.shape)if(Er(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(Er(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(Er(i,n))return!0;return!!(r.rest&&Er(r.rest,n))}return!1}const SX=(e,t={})=>n=>{const r=s4({...n,processors:t});return Ln(e,r),o4(r,e),l4(r,e)},Jg=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},o=s4({...i??{},target:a,io:t,processors:n});return Ln(e,o),o4(o,e),l4(o,e)},jX={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},NX=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:a,maximum:o,format:u,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof o=="number"&&(i.maxLength=o),u&&(i.format=jX[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}))])}},kX=(e,t,n,r)=>{const i=n,{minimum:a,maximum:o,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 o=="number"&&(i.maximum=o,typeof f=="number"&&t.target!=="draft-04"&&(f<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},CX=(e,t,n,r)=>{n.type="boolean"},AX=(e,t,n,r)=>{n.not={}},OX=(e,t,n,r)=>{},EX=(e,t,n,r)=>{const i=e._zod.def,a=$5(i.entries);a.every(o=>typeof o=="number")&&(n.type="number"),a.every(o=>typeof o=="string")&&(n.type="string"),n.enum=a},_X=(e,t,n,r)=>{const i=e._zod.def,a=[];for(const o of i.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){const o=a[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else a.every(o=>typeof o=="number")&&(n.type="number"),a.every(o=>typeof o=="string")&&(n.type="string"),a.every(o=>typeof o=="boolean")&&(n.type="boolean"),a.every(o=>o===null)&&(n.type="null"),n.enum=a},zX=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},TX=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},PX=(e,t,n,r)=>{const i=n,a=e._zod.def,{minimum:o,maximum:u}=e._zod.bag;typeof o=="number"&&(i.minItems=o),typeof u=="number"&&(i.maxItems=u),i.type="array",i.items=Ln(a.element,t,{...r,path:[...r.path,"items"]})},RX=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const o=a.shape;for(const f in o)i.properties[f]=Ln(o[f],t,{...r,path:[...r.path,"properties",f]});const u=new Set(Object.keys(o)),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=Ln(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},DX=(e,t,n,r)=>{const i=e._zod.def,a=i.inclusive===!1,o=i.options.map((u,d)=>Ln(u,t,{...r,path:[...r.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=o:n.anyOf=o},MX=(e,t,n,r)=>{const i=e._zod.def,a=Ln(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=Ln(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(o)?o.allOf:[o]];n.allOf=d},IX=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object";const o=a.keyType,d=o._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){const p=Ln(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=Ln(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Ln(a.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=o._zod.values;if(f){const p=[...f].filter(m=>typeof m=="string"||typeof m=="number");p.length>0&&(i.required=p)}},LX=(e,t,n,r)=>{const i=e._zod.def,a=Ln(i.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},$X=(e,t,n,r)=>{const i=e._zod.def;Ln(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},BX=(e,t,n,r)=>{const i=e._zod.def;Ln(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},UX=(e,t,n,r)=>{const i=e._zod.def;Ln(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)))},qX=(e,t,n,r)=>{const i=e._zod.def;Ln(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},FX=(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;Ln(a,t,r);const o=t.seen.get(e);o.ref=a},HX=(e,t,n,r)=>{const i=e._zod.def;Ln(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},c4=(e,t,n,r)=>{const i=e._zod.def;Ln(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},KX=ge("ZodISODateTime",(e,t)=>{GZ.init(e,t),vn.init(e,t)});function GX(e){return XW(KX,e)}const VX=ge("ZodISODate",(e,t)=>{VZ.init(e,t),vn.init(e,t)});function QX(e){return JW(VX,e)}const YX=ge("ZodISOTime",(e,t)=>{QZ.init(e,t),vn.init(e,t)});function ZX(e){return eX(YX,e)}const WX=ge("ZodISODuration",(e,t)=>{YZ.init(e,t),vn.init(e,t)});function XX(e){return tX(WX,e)}const JX=(e,t)=>{F5.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>$Y(e,n)},flatten:{value:n=>LY(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Kj,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Kj,2)}},isEmpty:{get(){return e.issues.length===0}}})},Vi=ge("ZodError",JX,{Parent:Error}),eJ=QN(Vi),tJ=YN(Vi),nJ=wv(Vi),rJ=Sv(Vi),iJ=qY(Vi),aJ=FY(Vi),sJ=HY(Vi),oJ=KY(Vi),lJ=GY(Vi),cJ=VY(Vi),uJ=QY(Vi),dJ=YY(Vi),yn=ge("ZodType",(e,t)=>(gn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Jg(e,"input"),output:Jg(e,"output")}}),e.toJSONSchema=SX(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Fo(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)=>Ho(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>eJ(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>nJ(e,n,r),e.parseAsync=async(n,r)=>tJ(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>rJ(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>iJ(e,n,r),e.decode=(n,r)=>aJ(e,n,r),e.encodeAsync=async(n,r)=>sJ(e,n,r),e.decodeAsync=async(n,r)=>oJ(e,n,r),e.safeEncode=(n,r)=>lJ(e,n,r),e.safeDecode=(n,r)=>cJ(e,n,r),e.safeEncodeAsync=async(n,r)=>uJ(e,n,r),e.safeDecodeAsync=async(n,r)=>dJ(e,n,r),e.refine=(n,r)=>e.check(aee(n,r)),e.superRefine=n=>e.check(see(n)),e.overwrite=n=>e.check(ud(n)),e.optional=()=>q2(e),e.exactOptional=()=>GJ(e),e.nullable=()=>F2(e),e.nullish=()=>q2(F2(e)),e.nonoptional=n=>XJ(e,n),e.array=()=>Ce(e),e.or=n=>IJ([e,n]),e.and=n=>BJ(e,n),e.transform=n=>H2(e,HJ(n)),e.default=n=>YJ(e,n),e.prefault=n=>WJ(e,n),e.catch=n=>eee(e,n),e.pipe=n=>H2(e,n),e.readonly=()=>ree(e),e.describe=n=>{const r=e.clone();return Gf.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Gf.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Gf.get(e);const r=e.clone();return Gf.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),u4=ge("_ZodString",(e,t)=>{ZN.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>NX(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(oX(...r)),e.includes=(...r)=>e.check(uX(...r)),e.startsWith=(...r)=>e.check(dX(...r)),e.endsWith=(...r)=>e.check(fX(...r)),e.min=(...r)=>e.check(Xg(...r)),e.max=(...r)=>e.check(i4(...r)),e.length=(...r)=>e.check(a4(...r)),e.nonempty=(...r)=>e.check(Xg(1,...r)),e.lowercase=r=>e.check(lX(r)),e.uppercase=r=>e.check(cX(r)),e.trim=()=>e.check(pX()),e.normalize=(...r)=>e.check(hX(...r)),e.toLowerCase=()=>e.check(mX()),e.toUpperCase=()=>e.check(gX()),e.slugify=()=>e.check(yX())}),fJ=ge("ZodString",(e,t)=>{ZN.init(e,t),u4.init(e,t),e.email=n=>e.check(zW(hJ,n)),e.url=n=>e.check(MW(pJ,n)),e.jwt=n=>e.check(WW(EJ,n)),e.emoji=n=>e.check(IW(mJ,n)),e.guid=n=>e.check(M2(B2,n)),e.uuid=n=>e.check(TW(Tm,n)),e.uuidv4=n=>e.check(PW(Tm,n)),e.uuidv6=n=>e.check(RW(Tm,n)),e.uuidv7=n=>e.check(DW(Tm,n)),e.nanoid=n=>e.check(LW(gJ,n)),e.guid=n=>e.check(M2(B2,n)),e.cuid=n=>e.check($W(yJ,n)),e.cuid2=n=>e.check(BW(vJ,n)),e.ulid=n=>e.check(UW(xJ,n)),e.base64=n=>e.check(QW(CJ,n)),e.base64url=n=>e.check(YW(AJ,n)),e.xid=n=>e.check(qW(bJ,n)),e.ksuid=n=>e.check(FW(wJ,n)),e.ipv4=n=>e.check(HW(SJ,n)),e.ipv6=n=>e.check(KW(jJ,n)),e.cidrv4=n=>e.check(GW(NJ,n)),e.cidrv6=n=>e.check(VW(kJ,n)),e.e164=n=>e.check(ZW(OJ,n)),e.datetime=n=>e.check(GX(n)),e.date=n=>e.check(QX(n)),e.time=n=>e.check(ZX(n)),e.duration=n=>e.check(XX(n))});function P(e){return _W(fJ,e)}const vn=ge("ZodStringFormat",(e,t)=>{dn.init(e,t),u4.init(e,t)}),hJ=ge("ZodEmail",(e,t)=>{IZ.init(e,t),vn.init(e,t)}),B2=ge("ZodGUID",(e,t)=>{DZ.init(e,t),vn.init(e,t)}),Tm=ge("ZodUUID",(e,t)=>{MZ.init(e,t),vn.init(e,t)}),pJ=ge("ZodURL",(e,t)=>{LZ.init(e,t),vn.init(e,t)}),mJ=ge("ZodEmoji",(e,t)=>{$Z.init(e,t),vn.init(e,t)}),gJ=ge("ZodNanoID",(e,t)=>{BZ.init(e,t),vn.init(e,t)}),yJ=ge("ZodCUID",(e,t)=>{UZ.init(e,t),vn.init(e,t)}),vJ=ge("ZodCUID2",(e,t)=>{qZ.init(e,t),vn.init(e,t)}),xJ=ge("ZodULID",(e,t)=>{FZ.init(e,t),vn.init(e,t)}),bJ=ge("ZodXID",(e,t)=>{HZ.init(e,t),vn.init(e,t)}),wJ=ge("ZodKSUID",(e,t)=>{KZ.init(e,t),vn.init(e,t)}),SJ=ge("ZodIPv4",(e,t)=>{ZZ.init(e,t),vn.init(e,t)}),jJ=ge("ZodIPv6",(e,t)=>{WZ.init(e,t),vn.init(e,t)}),NJ=ge("ZodCIDRv4",(e,t)=>{XZ.init(e,t),vn.init(e,t)}),kJ=ge("ZodCIDRv6",(e,t)=>{JZ.init(e,t),vn.init(e,t)}),CJ=ge("ZodBase64",(e,t)=>{eW.init(e,t),vn.init(e,t)}),AJ=ge("ZodBase64URL",(e,t)=>{nW.init(e,t),vn.init(e,t)}),OJ=ge("ZodE164",(e,t)=>{rW.init(e,t),vn.init(e,t)}),EJ=ge("ZodJWT",(e,t)=>{aW.init(e,t),vn.init(e,t)}),d4=ge("ZodNumber",(e,t)=>{J5.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>kX(e,r,i),e.gt=(r,i)=>e.check(L2(r,i)),e.gte=(r,i)=>e.check(hw(r,i)),e.min=(r,i)=>e.check(hw(r,i)),e.lt=(r,i)=>e.check(I2(r,i)),e.lte=(r,i)=>e.check(fw(r,i)),e.max=(r,i)=>e.check(fw(r,i)),e.int=r=>e.check(U2(r)),e.safe=r=>e.check(U2(r)),e.positive=r=>e.check(L2(0,r)),e.nonnegative=r=>e.check(hw(0,r)),e.negative=r=>e.check(I2(0,r)),e.nonpositive=r=>e.check(fw(0,r)),e.multipleOf=(r,i)=>e.check($2(r,i)),e.step=(r,i)=>e.check($2(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 se(e){return nX(d4,e)}const _J=ge("ZodNumberFormat",(e,t)=>{sW.init(e,t),d4.init(e,t)});function U2(e){return rX(_J,e)}const zJ=ge("ZodBoolean",(e,t)=>{oW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>CX(e,n,r)});function ft(e){return iX(zJ,e)}const TJ=ge("ZodUnknown",(e,t)=>{lW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>OX()});function Ql(){return aX(TJ)}const PJ=ge("ZodNever",(e,t)=>{cW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>AX(e,n,r)});function RJ(e){return sX(PJ,e)}const DJ=ge("ZodArray",(e,t)=>{uW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>PX(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(Xg(n,r)),e.nonempty=n=>e.check(Xg(1,n)),e.max=(n,r)=>e.check(i4(n,r)),e.length=(n,r)=>e.check(a4(n,r)),e.unwrap=()=>e.element});function Ce(e,t){return vX(DJ,e,t)}const MJ=ge("ZodObject",(e,t)=>{fW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>RX(e,n,r,i),Mt(e,"shape",()=>t.shape),e.keyof=()=>Ge(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ql()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ql()}),e.strict=()=>e.clone({...e._zod.def,catchall:RJ()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>PY(e,n),e.safeExtend=n=>RY(e,n),e.merge=n=>DY(e,n),e.pick=n=>zY(e,n),e.omit=n=>TY(e,n),e.partial=(...n)=>MY(p4,e,n[0]),e.required=(...n)=>IY(m4,e,n[0])});function de(e,t){const n={type:"object",shape:e??{},...qe(t)};return new MJ(n)}const f4=ge("ZodUnion",(e,t)=>{n4.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>DX(e,n,r,i),e.options=t.options});function IJ(e,t){return new f4({type:"union",options:e,...qe(t)})}const LJ=ge("ZodDiscriminatedUnion",(e,t)=>{f4.init(e,t),hW.init(e,t)});function h4(e,t,n){return new LJ({type:"union",options:t,discriminator:e,...qe(n)})}const $J=ge("ZodIntersection",(e,t)=>{pW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>MX(e,n,r,i)});function BJ(e,t){return new $J({type:"intersection",left:e,right:t})}const UJ=ge("ZodRecord",(e,t)=>{mW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>IX(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function Ha(e,t,n){return new UJ({type:"record",keyType:e,valueType:t,...qe(n)})}const Vj=ge("ZodEnum",(e,t)=>{gW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>EX(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 o of r)if(n.has(o))a[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Vj({...t,checks:[],...qe(i),entries:a})},e.exclude=(r,i)=>{const a={...t.entries};for(const o of r)if(n.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new Vj({...t,checks:[],...qe(i),entries:a})}});function Ge(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Vj({type:"enum",entries:n,...qe(t)})}const qJ=ge("ZodLiteral",(e,t)=>{yW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>_X(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 ei(e,t){return new qJ({type:"literal",values:Array.isArray(e)?e:[e],...qe(t)})}const FJ=ge("ZodTransform",(e,t)=>{vW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>TX(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new I5(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(mh(a,n.value,t));else{const o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(mh(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function HJ(e){return new FJ({type:"transform",transform:e})}const p4=ge("ZodOptional",(e,t)=>{r4.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>c4(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function q2(e){return new p4({type:"optional",innerType:e})}const KJ=ge("ZodExactOptional",(e,t)=>{xW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>c4(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function GJ(e){return new KJ({type:"optional",innerType:e})}const VJ=ge("ZodNullable",(e,t)=>{bW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>LX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function F2(e){return new VJ({type:"nullable",innerType:e})}const QJ=ge("ZodDefault",(e,t)=>{wW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>BX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function YJ(e,t){return new QJ({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():U5(t)}})}const ZJ=ge("ZodPrefault",(e,t)=>{SW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>UX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function WJ(e,t){return new ZJ({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():U5(t)}})}const m4=ge("ZodNonOptional",(e,t)=>{jW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>$X(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function XJ(e,t){return new m4({type:"nonoptional",innerType:e,...qe(t)})}const JJ=ge("ZodCatch",(e,t)=>{NW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>qX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function eee(e,t){return new JJ({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const tee=ge("ZodPipe",(e,t)=>{kW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>FX(e,n,r,i),e.in=t.in,e.out=t.out});function H2(e,t){return new tee({type:"pipe",in:e,out:t})}const nee=ge("ZodReadonly",(e,t)=>{CW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>HX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function ree(e){return new nee({type:"readonly",innerType:e})}const iee=ge("ZodCustom",(e,t)=>{AW.init(e,t),yn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>zX(e,n)});function aee(e,t={}){return xX(iee,e,t)}function see(e){return bX(e)}de({maxConcurrency:se().int().positive(),maxRequestsPerMinute:se().int().positive(),maxRequestsPerDay:se().int().positive()});const zs=P().min(1);P().min(1);const WN=de({label:P().min(1),city:P().min(1),region:P().min(1),country:P().length(2),timezone:P().optional()}),XN=Ge(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);de({id:P(),projectId:P(),channel:ei("webhook"),url:P().url(),urlDisplay:P(),urlHost:P(),events:Ce(XN),enabled:ft().default(!0),source:P().optional(),webhookSecret:P().optional(),createdAt:P(),updatedAt:P()});de({channel:ei("webhook"),url:P().url(),events:Ce(XN).min(1),source:P().optional()});const g4=Ge(["cli","api","config-file"]);function oee(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 lee(e,t){return t?e.some(n=>n.label===t):!0}de({displayName:P().min(1),canonicalDomain:P().min(1),ownedDomains:Ce(P().min(1)).optional(),country:P().length(2),language:P().min(2),tags:Ce(P()).optional(),labels:Ha(P(),P()).optional(),providers:Ce(zs).optional(),locations:Ce(WN).optional(),defaultLocation:P().nullable().optional(),autoExtractBacklinks:ft().optional(),configSource:g4.optional()});de({id:P(),name:P(),displayName:P().optional(),canonicalDomain:P(),ownedDomains:Ce(P()).default([]),country:P().length(2),language:P().min(2),tags:Ce(P()).default([]),labels:Ha(P(),P()).default({}),locations:Ce(WN).default([]),defaultLocation:P().nullable().optional(),autoExtractBacklinks:ft().default(!1),configSource:g4.default("cli"),configRevision:se().int().positive().default(1),createdAt:P().optional(),updatedAt:P().optional()});de({id:P(),query:P(),createdAt:P()});de({id:P(),keyword:P(),createdAt:P()});de({queries:Ce(P().trim().min(1)).min(1)});de({keywords:Ce(P().trim().min(1)).min(1)});de({provider:zs,count:se().int().min(1).max(20).optional()});de({id:P(),domain:P(),createdAt:P()});de({competitors:Ce(P().trim().min(1)).min(1)});function ey(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}const cee=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 uee(e){const t=ey(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 cee.has(i)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function dee(e){const t=uee(e);return t?t.split(".")[0]??"":""}function fee(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],n=new Set,r=[];for(const i of t){const a=i.trim();if(!a)continue;const o=ey(a);n.has(o)||(n.add(o),r.push(a))}return r}const hee=de({name:P().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:Ha(P(),P()).optional().default({})}),pee=de({preset:P().optional(),cron:P().optional(),timezone:P().optional().default("UTC"),providers:Ce(zs).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),mee=de({channel:ei("webhook"),url:P().url(),events:Ce(XN).min(1)}),gee=de({gsc:de({propertyUrl:P()}).optional(),syncSchedule:de({preset:P().optional(),cron:P().optional()}).optional()}).optional(),K2=Ce(P().min(1)),yee=de({displayName:P().min(1),canonicalDomain:P().min(1),ownedDomains:Ce(P().min(1)).optional().default([]),country:P().length(2),language:P().min(2),queries:K2.optional(),keywords:K2.optional(),competitors:Ce(P().min(1)).optional().default([]),providers:Ce(zs).optional().default([]),locations:Ce(WN).optional().default([]),defaultLocation:P().optional(),schedule:pee,notifications:Ce(mee).optional().default([]),google:gee,autoExtractBacklinks:ft().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=oee(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),lee(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});de({apiVersion:ei("canonry/v1"),kind:ei("Project"),metadata:hee,spec:yee});const vee=Ge(["gsc","ga4"]);de({id:P(),domain:P(),connectionType:vee,propertyId:P().nullable().optional(),sitemapUrl:P().nullable().optional(),scopes:Ce(P()).default([]),createdAt:P(),updatedAt:P()});de({date:P(),query:P(),page:P(),country:P().nullable().optional(),device:P().nullable().optional(),clicks:se(),impressions:se(),ctr:se(),position:se()});const Qj=de({id:P(),url:P(),indexingState:P().nullable().optional(),verdict:P().nullable().optional(),coverageState:P().nullable().optional(),pageFetchState:P().nullable().optional(),robotsTxtState:P().nullable().optional(),crawlTime:P().nullable().optional(),lastCrawlResult:P().nullable().optional(),isMobileFriendly:ft().nullable().optional(),richResults:Ce(P()).default([]),inspectedAt:P()});Ge(["stable","reindexed","deindexed","still-missing","new"]);const xee=de({url:P(),previousState:P().nullable(),currentState:P().nullable(),transitionDate:P()}),bee=de({reason:P(),count:se(),urls:Ce(Qj).default([])});de({summary:de({total:se(),indexed:se(),notIndexed:se(),deindexed:se(),percentage:se()}),lastInspectedAt:P().nullable(),lastSyncedAt:P().nullable(),indexed:Ce(Qj).default([]),notIndexed:Ce(Qj).default([]),deindexed:Ce(xee).default([]),reasonGroups:Ce(bee).default([])});de({url:P(),type:Ge(["URL_UPDATED","URL_DELETED"]),notifiedAt:P()});de({url:P(),type:Ge(["URL_UPDATED","URL_DELETED"]),notifiedAt:P(),status:Ge(["success","error"]),error:P().optional()});de({date:P(),indexed:se(),notIndexed:se(),reasonBreakdown:Ha(P(),se()).default({})});de({id:P(),domain:P(),siteUrl:P().nullable().optional(),createdAt:P(),updatedAt:P()});const pw=de({id:P(),url:P(),httpCode:se().nullable().optional(),inIndex:ft().nullable().optional(),lastCrawledDate:P().nullable().optional(),inIndexDate:P().nullable().optional(),inspectedAt:P(),documentSize:se().nullable().optional(),anchorCount:se().nullable().optional(),discoveryDate:P().nullable().optional()});de({summary:de({total:se(),indexed:se(),notIndexed:se(),unknown:se().optional(),percentage:se()}),lastInspectedAt:P().nullable(),indexed:Ce(pw).default([]),notIndexed:Ce(pw).default([]),unknown:Ce(pw).default([]).optional()});de({query:P(),impressions:se(),clicks:se(),ctr:se(),averagePosition:se()});de({date:P(),indexed:se(),notIndexed:se(),unknown:se()});de({url:P(),status:Ge(["success","error"]),submittedAt:P(),error:P().optional()});const dd=Ge(["live","staging"]);de({projectName:P(),url:P(),stagingUrl:P().optional(),username:P(),defaultEnv:dd,createdAt:P(),updatedAt:P()});const G2=de({url:P(),reachable:ft(),pageCount:se().nullable().optional(),version:P().nullable().optional(),error:P().nullable().optional(),plugins:Ce(P()).optional(),authenticatedUser:de({id:se(),slug:P()}).nullable().optional()});de({connected:ft(),projectName:P(),defaultEnv:dd,live:G2.nullable(),staging:G2.nullable(),adminUrl:P().nullable().optional()});const wee=de({id:se(),slug:P(),title:P(),status:P(),modifiedAt:P().nullable().optional(),link:P().nullable().optional()}),y4=de({title:P().nullable(),description:P().nullable(),noindex:ft().nullable(),writable:ft().default(!1),writeTargets:Ce(P()).default([])}),See=de({type:P(),json:Ha(P(),Ql())}),jee=wee.extend({env:dd,content:P(),seo:y4,schemaBlocks:Ce(See).default([])}),V2=jee.extend({contentHash:P(),contentSnippet:P()}),v4=de({manualRequired:ei(!0),targetUrl:P(),adminUrl:P().nullable().optional(),content:P(),nextSteps:Ce(P()).default([])}),Nee=de({slug:P(),severity:Ge(["high","medium","low"]),code:Ge(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:P()});de({slug:P(),title:P(),status:P(),wordCount:se(),seo:y4,schemaPresent:ft(),issues:Ce(Nee).default([])});const kee=de({slug:P(),status:Ge(["applied","skipped","manual"]),error:P().optional(),manualAssist:v4.optional()});de({env:dd,strategy:Ge(["plugin","manual"]),results:Ce(kee)});const Cee=de({slug:P(),status:Ge(["deployed","stripped","skipped","failed"]),schemasInjected:Ce(P()).optional(),manualAssist:v4.optional(),error:P().optional()});de({env:dd,results:Ce(Cee)});const Aee=de({slug:P(),title:P(),canonrySchemas:Ce(P()),thirdPartySchemas:Ce(P()),hasCanonrySchema:ft()});de({env:dd,pages:Ce(Aee)});const Oee=de({name:P(),status:Ge(["completed","skipped","failed"]),summary:P().optional(),error:P().optional()});de({projectName:P(),steps:Ce(Oee)});de({slug:P(),live:V2,staging:V2,hasDifferences:ft(),differences:de({title:ft(),slug:ft(),content:ft(),seoTitle:ft(),seoDescription:ft(),noindex:ft(),schema:ft()})});const JN=Ge(["queued","running","completed","partial","failed","cancelled"]),or=JN.enum,x4=Ge(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","bing-inspect-sitemap","backlink-extract","traffic-sync"]),Ot=x4.enum,b4=Ge(["manual","scheduled","config-apply"]),eh=b4.enum,Qu=Ge(["cited","not-cited"]),gh=Qu.enum,ty=Ge(["visible","not-visible"]);ty.enum;const w4=Ge(["new","cited","lost","emerging","not-cited"]);w4.enum;de({kind:ei(Ot["answer-visibility"]).optional(),trigger:ei(eh.manual).optional(),providers:Ce(zs).optional(),location:P().min(1).optional(),allLocations:ft().optional(),noLocation:ft().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const Eee=de({message:P(),raw:Ql().optional()}),_ee=de({message:P().optional(),providers:Ha(P(),Eee).optional()}),zee=de({id:P(),projectId:P(),kind:x4,status:JN,trigger:b4.default("manual"),location:P().nullable().optional(),startedAt:P().nullable().optional(),finishedAt:P().nullable().optional(),error:_ee.nullable().optional(),createdAt:P()});function ek(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 S4=de({uri:P(),title:P()}),j4=de({id:P(),runId:P(),queryId:P(),query:P().optional(),provider:zs,citationState:Qu,answerMentioned:ft().optional(),visibilityState:ty.optional(),transition:w4.optional(),answerText:P().nullable().optional(),citedDomains:Ce(P()).default([]),competitorOverlap:Ce(P()).default([]),recommendedCompetitors:Ce(P()).default([]),matchedTerms:Ce(P()).default([]),groundingSources:Ce(S4).default([]),searchQueries:Ce(P()).default([]),model:P().nullable().optional(),location:P().nullable().optional(),createdAt:P()});de({snapshots:Ce(j4),total:se().int().nonnegative()});const Tee=de({queryId:P().nullable(),query:P().nullable(),run1State:Qu.nullable(),run2State:Qu.nullable(),run1AnswerMentioned:ft().nullable(),run2AnswerMentioned:ft().nullable(),run1VisibilityState:ty.nullable(),run2VisibilityState:ty.nullable(),changed:ft(),visibilityChanged:ft()});de({run1:P(),run2:P(),diff:Ce(Tee)});const Pee=zee.extend({snapshots:Ce(j4).optional()});de({totalRuns:se().int().nonnegative(),run:Pee.nullable()});de({id:P(),projectId:P().nullable().optional(),actor:P(),action:P(),entityType:P(),entityId:P().nullable().optional(),diff:Ql().optional(),createdAt:P()});const Ree=Ge(["yes","no","unknown","not-mentioned"]),Q2=Ce(P().min(1));de({companyName:P().min(1),domain:P().min(1),queries:Q2.optional(),phrases:Q2.optional(),competitors:Ce(P().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 Dee=de({name:P(),count:se().int().nonnegative()}),Mee=de({id:P(),name:P(),weight:se(),score:se(),grade:P(),status:Ge(["pass","partial","fail"]),findings:Ce(de({type:P(),message:P()})).default([]),recommendations:Ce(P()).default([])}),Iee=de({url:P(),finalUrl:P(),auditedAt:P(),overallScore:se(),overallGrade:P(),summary:P(),factors:Ce(Mee).default([])}),Lee=de({industry:P(),summary:P(),services:Ce(P()).default([]),categoryTerms:Ce(P()).default([])}),$ee=de({provider:P(),displayName:P(),model:P().nullable().optional(),mentioned:ft(),cited:ft(),describedAccurately:Ree,accuracyNotes:P().nullable().optional(),incorrectClaims:Ce(P()).default([]),recommendedCompetitors:Ce(P()).default([]),citedDomains:Ce(P()).default([]),groundingSources:Ce(S4).default([]),searchQueries:Ce(P()).default([]),answerText:P(),error:P().nullable().optional()}),Bee=de({query:P(),providerResults:Ce($ee).default([])}),Uee=de({totalQueries:se().int().nonnegative(),totalProviders:se().int().nonnegative(),totalComparisons:se().int().nonnegative(),mentionCount:se().int().nonnegative(),citationCount:se().int().nonnegative(),topCompetitors:Ce(Dee).default([]),visibilityGap:P(),whatThisMeans:Ce(P()).default([]),recommendedActions:Ce(P()).default([])});de({companyName:P(),domain:P(),homepageUrl:P(),generatedAt:P(),queries:Ce(P()).default([]),competitors:Ce(P()).default([]),profile:Lee,audit:Iee,queryResults:Ce(Bee).default([]),summary:Uee});const tk=Ge(["answer-visibility","traffic-sync"]);tk.enum;de({id:P(),projectId:P(),kind:tk,cronExpr:P(),preset:P().nullable().optional(),timezone:P().default("UTC"),enabled:ft().default(!0),providers:Ce(zs).default([]),sourceId:P().nullable().optional(),lastRunAt:P().nullable().optional(),nextRunAt:P().nullable().optional(),createdAt:P(),updatedAt:P()});de({kind:tk.optional(),preset:P().optional(),cron:P().optional(),timezone:P().optional().default("UTC"),enabled:ft().optional().default(!0),providers:Ce(zs).optional().default([]),sourceId:P().optional()}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const qee=Ge(["mentioned","cited"]);qee.enum;de({id:P(),projectId:P(),propertyId:P(),clientEmail:P(),connected:ft(),createdAt:P(),updatedAt:P()});de({date:P(),landingPage:P(),sessions:se(),organicSessions:se(),users:se()});const nk=Ge(["session","first_user","manual_utm"]),Fee=de({source:P(),medium:P(),sessions:se(),users:se(),sourceDimension:nk}),Hee=de({source:P(),medium:P(),sourceDimension:nk,landingPage:P(),sessions:se(),users:se()}),Kee=de({source:P(),medium:P(),sessions:se(),users:se(),channelGroup:P()}),Cf=de({sessions:se(),sharePct:se(),sharePctDisplay:P()}),Gee=de({organic:Cf,social:Cf,direct:Cf,ai:Cf,other:Cf});de({totalSessions:se(),totalOrganicSessions:se(),totalDirectSessions:se(),totalUsers:se(),topPages:Ce(de({landingPage:P(),sessions:se(),organicSessions:se(),directSessions:se(),users:se()})),aiReferrals:Ce(Fee),aiReferralLandingPages:Ce(Hee),aiSessionsDeduped:se(),aiUsersDeduped:se(),aiSessionsBySession:se(),aiUsersBySession:se(),socialReferrals:Ce(Kee),socialSessions:se(),socialUsers:se(),channelBreakdown:Gee,organicSharePct:se(),aiSharePct:se(),aiSharePctBySession:se(),directSharePct:se(),socialSharePct:se(),organicSharePctDisplay:P(),aiSharePctDisplay:P(),aiSharePctBySessionDisplay:P(),directSharePctDisplay:P(),socialSharePctDisplay:P(),otherSessions:se(),otherSharePct:se(),otherSharePctDisplay:P(),lastSyncedAt:P().nullable()});de({date:P(),source:P(),medium:P(),landingPage:P(),sessions:se(),users:se(),sourceDimension:nk});de({date:P(),source:P(),medium:P(),sessions:se(),users:se(),channelGroup:P()});de({date:P(),sessions:se(),organicSessions:se(),users:se()});function ny(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const Vee=Ge(["aero","user","compaction"]);Vee.enum;const N4=128;de({key:P().min(1).max(N4),value:P().min(1)});de({key:P().min(1).max(N4)});const rk=Ge(["queued","downloading","querying","ready","failed"]);rk.enum;de({id:P(),release:P(),status:rk,phaseDetail:P().nullable().optional(),vertexPath:P().nullable().optional(),edgesPath:P().nullable().optional(),vertexSha256:P().nullable().optional(),edgesSha256:P().nullable().optional(),vertexBytes:se().int().nullable().optional(),edgesBytes:se().int().nullable().optional(),projectsProcessed:se().int().nullable().optional(),domainsDiscovered:se().int().nullable().optional(),downloadStartedAt:P().nullable().optional(),downloadFinishedAt:P().nullable().optional(),queryStartedAt:P().nullable().optional(),queryFinishedAt:P().nullable().optional(),error:P().nullable().optional(),createdAt:P(),updatedAt:P()});const Qee=de({linkingDomain:P(),numHosts:se().int()}),Yee=de({projectId:P(),release:P(),targetDomain:P(),totalLinkingDomains:se().int(),totalHosts:se().int(),top10HostsShare:P(),queriedAt:P(),excludedLinkingDomains:se().int().optional(),excludedHosts:se().int().optional()});de({summary:Yee.nullable(),total:se().int(),rows:Ce(Qee)});de({release:P(),totalLinkingDomains:se().int(),totalHosts:se().int(),top10HostsShare:P(),queriedAt:P()});de({duckdbInstalled:ft(),duckdbVersion:P().nullable().optional(),duckdbSpec:P(),pluginDir:P()});de({installed:ft(),version:P(),path:P(),alreadyPresent:ft()});de({release:P(),vertexUrl:P(),edgesUrl:P(),vertexBytes:se().int().nullable(),edgesBytes:se().int().nullable(),lastModified:P().nullable()});de({release:P(),syncStatus:rk.nullable(),bytes:se().int(),lastUsedAt:P().nullable()});Ge(["snapshot","insight"]);const Zee=de({kind:ei("snapshot"),id:P(),runId:P(),query:P(),provider:P(),model:P().nullable(),citationState:Qu,matchedField:Ge(["answerText","citedDomains","searchQueries","query"]),snippet:P(),createdAt:P()}),Wee=de({kind:ei("insight"),id:P(),runId:P().nullable(),type:Ge(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost"]),severity:Ge(["critical","high","medium","low"]),title:P(),query:P(),provider:P(),matchedField:Ge(["title","query","recommendation","cause"]),snippet:P(),dismissed:ft(),createdAt:P()}),Xee=h4("kind",[Zee,Wee]);de({query:P(),totalHits:se().int().nonnegative(),truncated:ft(),hits:Ce(Xee)});const k4=Ge(["create","expand","refresh","add-schema"]);k4.enum;function Jee(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}const C4=Ge(["gsc","competitor-evidence","both"]);C4.enum;const A4=Ge(["high","medium","low"]);A4.enum;const ete=Ge(["blog-post","comparison","listicle","how-to","guide","glossary"]);ete.enum;const O4=Ge(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);O4.enum;const tte=de({url:P(),gscImpressions:se().nonnegative(),gscClicks:se().nonnegative(),gscAvgPosition:se().nonnegative().nullable(),organicSessions:se().nonnegative()}),nte=de({domain:P(),url:P(),title:P(),citationCount:se().int().nonnegative()}),rte=de({demand:se(),competitor:se(),absence:se(),gapSeverity:se()}),ite=de({actionId:P(),state:O4,lastUpdated:P()}),ate=de({targetRef:P(),query:P(),action:k4,ourBestPage:tte.nullable(),winningCompetitor:nte.nullable(),score:se(),scoreBreakdown:rte,drivers:Ce(P()),demandSource:C4,actionConfidence:A4,existingAction:ite.nullable()});de({targets:Ce(ate),contextMetrics:de({totalAiReferralSessions:se().int().nonnegative(),latestRunId:P(),runTimestamp:P()})});const ste=de({uri:P(),title:P(),domain:P(),isOurDomain:ft(),isCompetitor:ft(),citationCount:se().int().nonnegative(),providers:Ce(zs)}),ote=de({query:P(),groundingSources:Ce(ste)});de({sources:Ce(ote),latestRunId:P()});const lte=de({query:P(),competitorDomains:Ce(P()),competitorCount:se().int().nonnegative(),missRate:se().min(0).max(1),lastSeenInRunId:P()});de({gaps:Ce(lte),latestRunId:P()});const E4=Ge(["ok","warn","fail","skipped"]);E4.enum;const ik=Ge(["global","project"]);ik.enum;const _4=Ge(["auth","config","providers","integrations","database","schedules"]);_4.enum;const cte=de({id:P(),category:_4,scope:ik,title:P(),status:E4,code:P().describe('Stable machine-readable code (e.g. "google.token.refresh-failed"). Use this for filtering and remediation logic.'),summary:P(),remediation:P().nullable().optional().describe('Operator-facing next step. Null when status is "ok" or no specific remediation applies.'),details:Ha(P(),Ql()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:se().int().nonnegative().describe("How long the check took to execute.")});de({scope:ik,project:P().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:P().describe("ISO-8601 timestamp when this doctor run started."),durationMs:se().int().nonnegative(),summary:de({total:se().int().nonnegative(),ok:se().int().nonnegative(),warn:se().int().nonnegative(),fail:se().int().nonnegative(),skipped:se().int().nonnegative()}),checks:Ce(cte)});const ute=de({provider:P(),citationState:Qu,cited:ft(),mentioned:ft(),runId:P(),runCreatedAt:P()}),dte=de({queryId:P(),query:P(),providers:Ce(ute),citedCount:se().int().nonnegative(),mentionedCount:se().int().nonnegative(),totalProviders:se().int().nonnegative()}),fte=de({queryId:P(),query:P(),provider:P(),citingCompetitors:Ce(P()),runId:P(),runCreatedAt:P()}),hte=de({providersConfigured:se().int().nonnegative(),providersCiting:se().int().nonnegative(),providersMentioning:se().int().nonnegative(),totalQueries:se().int().nonnegative(),queriesCitedAndMentioned:se().int().nonnegative(),queriesCitedOnly:se().int().nonnegative(),queriesMentionedOnly:se().int().nonnegative(),queriesInvisible:se().int().nonnegative(),latestRunId:P().nullable(),latestRunAt:P().nullable()});de({summary:hte,byQuery:Ce(dte),competitorGaps:Ce(fte),status:Ge(["ready","no-data"]),reason:Ge(["no-runs-yet","no-queries"]).optional()});function pte(e){return e.horizon==="immediate"?"negative":e.confidence==="high"?"caution":e.confidence==="low"?"neutral":"caution"}function mte(e){switch(e){case"critical":return"Critical";case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}function gte(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function yte(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 vte(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}const xte=new Set(["a","an","and","for","from","in","near","of","on","or","the","to"]);function z4(e){return e.toLowerCase().match(/[a-z0-9]+/g)??[]}function T4(e){return e.length>4&&e.endsWith("ies")?`${e.slice(0,-3)}y`:e.length>4&&e.endsWith("s")&&!e.endsWith("ss")?e.slice(0,-1):e}function P4(e){const t=e.meta.location;return t?new Set([t.label,t.city,t.region,t.country].flatMap(z4).map(T4).filter(Boolean)):new Set}function R4(e,t){const n=z4(e).map(T4).filter(Boolean).filter(r=>!xte.has(r)).filter(r=>!t.has(r));return[...new Set(n)].sort().join(" ")}function bte(e){return e.title.match(/"([^"]+)"/)?.[1]??e.successMetric.match(/"([^"]+)"/)?.[1]??e.title}function wte(e,t){const n=P4(e);if(t.length<=1||n.size===0)return[...t];const r=new Set,i=[];for(const a of t){if(a.category!=="content"){i.push(a);continue}const o=R4(bte(a),n);!o||r.has(o)||(r.add(o),i.push(a))}return i}function Ste(e){const t=P4(e),n=e.contentOpportunities;if(n.length<=1||t.size===0)return n;const r=new Set;return n.filter(i=>{const a=R4(i.query,t);return!a||r.has(a)?!1:(r.add(a),!0)})}const jte=Ge(["claude","codex"]);jte.enum;const Nte=Ge(["claude","codex","all"]);Nte.enum;const ak=Ge(["cloud-run","wordpress","cloudflare","vercel","generic-log"]);ak.enum;const kte=Ge(["raw-request-events","aggregate-request-metrics","request-url","status-code","user-agent","remote-ip","referer","cursor-pull"]);kte.enum;const Cte=Ge(["raw-request","aggregate-bucket"]),Ate=Cte.enum,Ote=Ge(["observed","provider-aggregated","inferred"]),Ete=Ote.enum,_te=de({type:P().nullable(),labels:Ha(P(),P())}),zte=de({sourceType:ak,evidenceKind:ei(Ate["raw-request"]),confidence:ei(Ete.observed),eventId:P().min(1),observedAt:P().min(1),method:P().nullable(),requestUrl:P().nullable(),host:P().nullable(),path:P().min(1),queryString:P().nullable(),status:se().int().nullable(),userAgent:P().nullable(),remoteIp:P().nullable(),referer:P().nullable(),latencyMs:se().nullable(),requestSizeBytes:se().int().nullable(),responseSizeBytes:se().int().nullable(),providerResource:_te,providerLabels:Ha(P(),P())});de({events:Ce(zte),rawEntryCount:se().int().nonnegative(),skippedEntryCount:se().int().nonnegative(),nextPageToken:P().optional(),filter:P()});const D4=Ge(["connected","paused","error","archived"]),Vf=D4.enum,M4=Ge(["oauth","service-account"]);M4.enum;de({gcpProjectId:P().min(1),serviceName:P().nullable().optional(),location:P().nullable().optional(),authMode:M4});const I4=de({id:P(),projectId:P(),sourceType:ak,displayName:P(),status:D4,lastSyncedAt:P().nullable(),lastCursor:P().nullable(),lastError:P().nullable(),archivedAt:P().nullable(),config:Ha(P(),Ql()),createdAt:P(),updatedAt:P()});de({gcpProjectId:P().min(1),serviceName:P().min(1).optional(),location:P().min(1).optional(),displayName:P().min(1).optional(),keyJson:P().optional()});de({sourceId:P(),runId:P(),syncedAt:P(),pulledEvents:se().int().nonnegative(),crawlerHits:se().int().nonnegative(),aiReferralHits:se().int().nonnegative(),unknownHits:se().int().nonnegative(),crawlerBucketRows:se().int().nonnegative(),aiReferralBucketRows:se().int().nonnegative(),sampleRows:se().int().nonnegative(),windowStart:P(),windowEnd:P()});const Tte=de({crawlerHits:se().int().nonnegative(),aiReferralHits:se().int().nonnegative(),sampleCount:se().int().nonnegative()});de({sources:Ce(I4)});const Pte=I4.extend({totals24h:Tte,latestRun:de({runId:P(),status:JN,startedAt:P().nullable(),finishedAt:P().nullable(),error:P().nullable()}).nullable()});de({sources:Ce(Pte)});const Rte=Ge(["crawler","ai-referral"]),xs=Rte.enum,Dte=de({kind:ei(xs.crawler),sourceId:P(),tsHour:P(),botId:P(),operator:P(),verificationStatus:P(),pathNormalized:P(),status:se().int(),hits:se().int().nonnegative()}),Mte=de({kind:ei(xs["ai-referral"]),sourceId:P(),tsHour:P(),product:P(),operator:P(),sourceDomain:P(),evidenceType:P(),landingPathNormalized:P(),status:se().int(),hits:se().int().nonnegative()}),Ite=h4("kind",[Dte,Mte]);de({windowStart:P(),windowEnd:P(),totals:de({crawlerHits:se().int().nonnegative(),aiReferralHits:se().int().nonnegative()}),events:Ce(Ite)});var ko=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(ko||{});const Lte={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},Pm={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},$te=ek;function Bte(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 Nv(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function sa(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function Y2(e){return e===null?"Unknown":e?"Pass":"Fail"}function Yj(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function Ute(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function qte(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 mw(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 o=i[1]?parseInt(i[1]):6;return`Every day at ${Yj(o)} · ${r}`}const a=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(a){const o={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},u=a[2]?parseInt(a[2]):6;return`Every ${o[a[1]]} at ${Yj(u)} · ${r}`}return`${e} · ${r}`}function ry(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function L4(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 Fte(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 Hte(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function Kte(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function Io(e){const t=[e.detail,e.hint].filter(Boolean);return t.length>0?t.join(`
|
|
52
|
+
`):void 0}function Gte(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:ry(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:ry(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,o=i>0,u=n.providerStatuses.filter(d=>d.state==="ready").map(d=>Kte(d)).join(" · ");return{...r,label:"Providers",tone:o?"positive":"caution",detail:`${i} of ${a} configured`,meta:u||"None configured"}})}function Vte(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 Qte(e,t,n){const r=Vte(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 o=n.providerStatuses.some(u=>u.state==="ready");return{...a,detail:o?"At least one provider configured.":"No providers configured.",state:o?"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 $4="canonry.run-tracker",Zj=new Set;let Z2=!1,Yte=0,kv={runs:{},batches:{}};function Zte(){const e=Yl();for(const t of Zj)t(e)}function Wte(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function Xte(){typeof window>"u"||window.sessionStorage.setItem($4,JSON.stringify(kv))}function B4(){Z2||(Z2=!0,!(typeof window>"u")&&(kv=Wte(window.sessionStorage.getItem($4))))}function Cv(e){kv=e,Xte(),Zte()}function Yl(){return B4(),kv}function Jte(e){return B4(),Zj.add(e),()=>{Zj.delete(e)}}function U4(e){const t=Yl();Cv({...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 W2(e){const t=Yl();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;Cv({...t,runs:r})}function ene(e){const t=Yl(),n=`batch_${Date.now()}_${++Yte}`;return Cv({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function tne(e){const t=Yl();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;Cv({...t,batches:r})}function sk(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function nne(e,t){let n=0,r=0,i=0,a=0,o=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:o+=1}return{completed:n,partial:r,failed:i,cancelled:a,pending:o,finished:o===0}}function X2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ok(...e){return t=>{let n=!1;const r=e.map(i=>{const a=X2(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():X2(e[i],null)}}}}function fc(...e){return x.useCallback(ok(...e),e)}var rne=Symbol.for("react.lazy"),iy=dv[" use ".trim().toString()];function ine(e){return typeof e=="object"&&e!==null&&"then"in e}function q4(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===rne&&"_payload"in e&&ine(e._payload)}function ane(e){const t=one(e),n=x.forwardRef((r,i)=>{let{children:a,...o}=r;q4(a)&&typeof iy=="function"&&(a=iy(a._payload));const u=x.Children.toArray(a),d=u.find(cne);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 l.jsx(t,{...o,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return l.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var sne=ane("Slot");function one(e){const t=x.forwardRef((n,r)=>{let{children:i,...a}=n;if(q4(i)&&typeof iy=="function"&&(i=iy(i._payload)),x.isValidElement(i)){const o=dne(i),u=une(a,i.props);return i.type!==x.Fragment&&(u.ref=r?ok(r,o):o),x.cloneElement(i,u)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lne=Symbol("radix.slottable");function cne(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lne}function une(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 dne(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 F4(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=F4(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Rt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=F4(e))&&(r&&(r+=" "),r+=t);return r}const J2=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,eT=Rt,H4=(e,t)=>n=>{var r;if(t?.variants==null)return eT(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(f=>{const p=n?.[f],m=a?.[f];if(p===null)return null;const y=J2(p)||J2(m);return i[f][y]}),u=n&&Object.entries(n).reduce((f,p)=>{let[m,y]=p;return y===void 0||(f[m]=y),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:m,className:y,...v}=p;return Object.entries(v).every(w=>{let[b,j]=w;return Array.isArray(j)?j.includes({...a,...u}[b]):{...a,...u}[b]===j})?[...f,m,y]:f},[]);return eT(e,o,d,n?.class,n?.className)},fne=(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},hne=(e,t)=>({classGroupId:e,validator:t}),K4=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ay="-",tT=[],pne="arbitrary..",mne=e=>{const t=yne(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return gne(o);const u=o.split(ay),d=u[0]===""&&u.length>1?1:0;return G4(u,d,t)},getConflictingClassGroupIds:(o,u)=>{if(u){const d=r[o],f=n[o];return d?f?fne(f,d):d:f||tT}return n[o]||tT}}},G4=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=G4(e,t+1,a);if(f)return f}const o=n.validators;if(o===null)return;const u=t===0?e.join(ay):e.slice(t).join(ay),d=o.length;for(let f=0;f<d;f++){const p=o[f];if(p.validator(u))return p.classGroupId}},gne=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?pne+r:void 0})(),yne=e=>{const{theme:t,classGroups:n}=e;return vne(n,t)},vne=(e,t)=>{const n=K4();for(const r in e){const i=e[r];lk(i,n,r,t)}return n},lk=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];xne(o,t,n,r)}},xne=(e,t,n,r)=>{if(typeof e=="string"){bne(e,t,n);return}if(typeof e=="function"){wne(e,t,n,r);return}Sne(e,t,n,r)},bne=(e,t,n)=>{const r=e===""?t:V4(t,e);r.classGroupId=n},wne=(e,t,n,r)=>{if(jne(e)){lk(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(hne(n,e))},Sne=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[u,d]=i[o];lk(d,V4(t,u),n,r)}},V4=(e,t)=>{let n=e;const r=t.split(ay),i=r.length;for(let a=0;a<i;a++){const o=r[a];let u=n.nextPart.get(o);u||(u=K4(),n.nextPart.set(o,u)),n=u}return n},jne=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Nne=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let o=n[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return i(a,o),o},set(a,o){a in n?n[a]=o:i(a,o)}}},Wj="!",nT=":",kne=[],rT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Cne=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let o=0,u=0,d=0,f;const p=i.length;for(let b=0;b<p;b++){const j=i[b];if(o===0&&u===0){if(j===nT){a.push(i.slice(d,b)),d=b+1;continue}if(j==="/"){f=b;continue}}j==="["?o++:j==="]"?o--:j==="("?u++:j===")"&&u--}const m=a.length===0?i:i.slice(d);let y=m,v=!1;m.endsWith(Wj)?(y=m.slice(0,-1),v=!0):m.startsWith(Wj)&&(y=m.slice(1),v=!0);const w=f&&f>d?f-d:void 0;return rT(a,v,y,w)};if(t){const i=t+nT,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):rT(kne,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},Ane=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 o=n[a],u=o[0]==="[",d=t.has(o);u||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},One=e=>({cache:Nne(e.cacheSize),parseClassName:Cne(e),sortModifiers:Ane(e),...mne(e)}),Ene=/\s+/,_ne=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],u=e.trim().split(Ene);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:m,modifiers:y,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:b}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let j=!!b,k=r(j?w.substring(0,b):w);if(!k){if(!j){d=p+(d.length>0?" "+d:d);continue}if(k=r(w),!k){d=p+(d.length>0?" "+d:d);continue}j=!1}const E=y.length===0?"":y.length===1?y[0]:a(y).join(":"),C=v?E+Wj:E,O=C+k;if(o.indexOf(O)>-1)continue;o.push(O);const _=i(k,j);for(let A=0;A<_.length;++A){const z=_[A];o.push(C+z)}d=p+(d.length>0?" "+d:d)}return d},zne=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=Q4(n))&&(i&&(i+=" "),i+=r);return i},Q4=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Q4(e[r]))&&(n&&(n+=" "),n+=t);return n},Tne=(e,...t)=>{let n,r,i,a;const o=d=>{const f=t.reduce((p,m)=>m(p),e());return n=One(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=_ne(d,n);return i(d,p),p};return a=o,(...d)=>a(zne(...d))},Pne=[],Un=e=>{const t=n=>n[e]||Pne;return t.isThemeGetter=!0,t},Y4=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Z4=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Rne=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Dne=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mne=/\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$/,Ine=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Lne=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$ne=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fo=e=>Rne.test(e),mt=e=>!!e&&!Number.isNaN(Number(e)),ho=e=>!!e&&Number.isInteger(Number(e)),gw=e=>e.endsWith("%")&&mt(e.slice(0,-1)),ps=e=>Dne.test(e),W4=()=>!0,Bne=e=>Mne.test(e)&&!Ine.test(e),ck=()=>!1,Une=e=>Lne.test(e),qne=e=>$ne.test(e),Fne=e=>!Le(e)&&!$e(e),Hne=e=>Ko(e,e3,ck),Le=e=>Y4.test(e),yl=e=>Ko(e,t3,Bne),iT=e=>Ko(e,Xne,mt),Kne=e=>Ko(e,r3,W4),Gne=e=>Ko(e,n3,ck),aT=e=>Ko(e,X4,ck),Vne=e=>Ko(e,J4,qne),Rm=e=>Ko(e,i3,Une),$e=e=>Z4.test(e),Af=e=>hc(e,t3),Qne=e=>hc(e,n3),sT=e=>hc(e,X4),Yne=e=>hc(e,e3),Zne=e=>hc(e,J4),Dm=e=>hc(e,i3,!0),Wne=e=>hc(e,r3,!0),Ko=(e,t,n)=>{const r=Y4.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},hc=(e,t,n=!1)=>{const r=Z4.exec(e);return r?r[1]?t(r[1]):n:!1},X4=e=>e==="position"||e==="percentage",J4=e=>e==="image"||e==="url",e3=e=>e==="length"||e==="size"||e==="bg-size",t3=e=>e==="length",Xne=e=>e==="number",n3=e=>e==="family-name",r3=e=>e==="number"||e==="weight",i3=e=>e==="shadow",Jne=()=>{const e=Un("color"),t=Un("font"),n=Un("text"),r=Un("font-weight"),i=Un("tracking"),a=Un("leading"),o=Un("breakpoint"),u=Un("container"),d=Un("spacing"),f=Un("radius"),p=Un("shadow"),m=Un("inset-shadow"),y=Un("text-shadow"),v=Un("drop-shadow"),w=Un("blur"),b=Un("perspective"),j=Un("aspect"),k=Un("ease"),E=Un("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...O(),$e,Le],A=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],R=()=>[$e,Le,d],$=()=>[fo,"full","auto",...R()],F=()=>[ho,"none","subgrid",$e,Le],U=()=>["auto",{span:["full",ho,$e,Le]},ho,$e,Le],B=()=>[ho,"auto",$e,Le],V=()=>["auto","min","max","fr",$e,Le],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...R()],J=()=>[fo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],ce=()=>[fo,"screen","full","dvw","lvw","svw","min","max","fit",...R()],xe=()=>[fo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],M=()=>[e,$e,Le],I=()=>[...O(),sT,aT,{position:[$e,Le]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",Yne,Hne,{size:[$e,Le]}],G=()=>[gw,Af,yl],oe=()=>["","none","full",f,$e,Le],ne=()=>["",mt,Af,yl],Ae=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[mt,gw,sT,aT],he=()=>["","none",w,$e,Le],_e=()=>["none",mt,$e,Le],Z=()=>["none",mt,$e,Le],Fe=()=>[mt,$e,Le],Re=()=>[fo,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ps],breakpoint:[ps],color:[W4],container:[ps],"drop-shadow":[ps],ease:["in","out","in-out"],font:[Fne],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ps],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ps],shadow:[ps],spacing:["px",mt],text:[ps],"text-shadow":[ps],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fo,Le,$e,j]}],container:["container"],columns:[{columns:[mt,Le,$e,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:_()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],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:[ho,"auto",$e,Le]}],basis:[{basis:[fo,"full","auto",u,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[mt,fo,"auto","initial","none",Le]}],grow:[{grow:["",mt,$e,Le]}],shrink:[{shrink:["",mt,$e,Le]}],order:[{order:[ho,"first","last","none",$e,Le]}],"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:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],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":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],"inline-size":[{inline:["auto",...ce()]}],"min-inline-size":[{"min-inline":["auto",...ce()]}],"max-inline-size":[{"max-inline":["none",...ce()]}],"block-size":[{block:["auto",...xe()]}],"min-block-size":[{"min-block":["auto",...xe()]}],"max-block-size":[{"max-block":["none",...xe()]}],w:[{w:[u,"screen",...J()]}],"min-w":[{"min-w":[u,"screen","none",...J()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[o]},...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,Af,yl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Wne,Kne]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gw,Le]}],"font-family":[{font:[Qne,Gne,t]}],"font-features":[{"font-features":[Le]}],"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,$e,Le]}],"line-clamp":[{"line-clamp":[mt,"none",$e,iT]}],leading:[{leading:[a,...R()]}],"list-image":[{"list-image":["none",$e,Le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$e,Le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[mt,"from-font","auto",$e,yl]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[mt,"auto",$e,Le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e,Le]}],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",$e,Le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ho,$e,Le],radial:["",$e,Le],conic:[ho,$e,Le]},Zne,Vne]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"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:[...Ae(),"hidden","none"]}],"divide-style":[{divide:[...Ae(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...Ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[mt,$e,Le]}],"outline-w":[{outline:["",mt,Af,yl]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",p,Dm,Rm]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",m,Dm,Rm]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[mt,yl]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",y,Dm,Rm]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[mt,$e,Le]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"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":[mt]}],"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":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"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":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"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":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"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":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"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":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"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":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"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":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[$e,Le]}],"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":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[mt]}],"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":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$e,Le]}],filter:[{filter:["","none",$e,Le]}],blur:[{blur:he()}],brightness:[{brightness:[mt,$e,Le]}],contrast:[{contrast:[mt,$e,Le]}],"drop-shadow":[{"drop-shadow":["","none",v,Dm,Rm]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",mt,$e,Le]}],"hue-rotate":[{"hue-rotate":[mt,$e,Le]}],invert:[{invert:["",mt,$e,Le]}],saturate:[{saturate:[mt,$e,Le]}],sepia:[{sepia:["",mt,$e,Le]}],"backdrop-filter":[{"backdrop-filter":["","none",$e,Le]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[mt,$e,Le]}],"backdrop-contrast":[{"backdrop-contrast":[mt,$e,Le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",mt,$e,Le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[mt,$e,Le]}],"backdrop-invert":[{"backdrop-invert":["",mt,$e,Le]}],"backdrop-opacity":[{"backdrop-opacity":[mt,$e,Le]}],"backdrop-saturate":[{"backdrop-saturate":[mt,$e,Le]}],"backdrop-sepia":[{"backdrop-sepia":["",mt,$e,Le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",$e,Le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[mt,"initial",$e,Le]}],ease:[{ease:["linear","initial",k,$e,Le]}],delay:[{delay:[mt,$e,Le]}],animate:[{animate:["none",E,$e,Le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,$e,Le]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:Z()}],"scale-x":[{"scale-x":Z()}],"scale-y":[{"scale-y":Z()}],"scale-z":[{"scale-z":Z()}],"scale-3d":["scale-3d"],skew:[{skew:Fe()}],"skew-x":[{"skew-x":Fe()}],"skew-y":[{"skew-y":Fe()}],transform:[{transform:[$e,Le,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Re()}],"translate-x":[{"translate-x":Re()}],"translate-y":[{"translate-y":Re()}],"translate-z":[{"translate-z":Re()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"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",$e,Le]}],"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":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",$e,Le]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[mt,Af,yl,iT]}],stroke:[{stroke:["none",...M()]}],"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"]}},ere=Tne(Jne);function Qi(...e){return ere(Rt(e))}const tre=H4("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-zinc-50 text-black hover:bg-zinc-200",secondary:"border border-zinc-800 bg-zinc-950 text-zinc-100 hover:bg-zinc-900",ghost:"text-zinc-400 hover:bg-zinc-900 hover:text-zinc-50",outline:"border border-zinc-800 bg-transparent text-zinc-100 hover:bg-zinc-900",destructive:"bg-rose-600 text-white hover:bg-rose-700"},size:{default:"h-9 px-4",sm:"h-8 px-3 text-xs",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),me=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const o=r?sne:"button";return l.jsx(o,{ref:a,className:Qi(tre({variant:t,size:n,className:e})),...i})});me.displayName="Button";const nre=H4("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 a3({className:e,variant:t,...n}){return l.jsx("div",{className:Qi(nre({variant:t}),e),...n})}function oT({compact:e=!1,version:t}){const n=!e&&t&&t!=="unknown";return l.jsxs(At,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[l.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),l.jsxs("span",{className:"brand-copy",children:[l.jsx("span",{className:"brand-mark",children:"Canonry"}),n?l.jsxs("span",{className:"brand-version",children:["v",t]}):null]})]})}function Zl({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 l.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 pt({tone:e,children:t,...n}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return l.jsx(a3,{variant:r,...n,children:t})}function Av({status:e}){return l.jsx(pt,{tone:L4(e),children:Nv(e)})}function zo(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function rre(e,t){const n=x.createContext(t),r=a=>{const{children:o,...u}=a,d=x.useMemo(()=>u,Object.values(u));return l.jsx(n.Provider,{value:d,children:o})};r.displayName=e+"Provider";function i(a){const o=x.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function ire(e,t=[]){let n=[];function r(a,o){const u=x.createContext(o),d=n.length;n=[...n,o];const f=m=>{const{scope:y,children:v,...w}=m,b=y?.[e]?.[d]||u,j=x.useMemo(()=>w,Object.values(w));return l.jsx(b.Provider,{value:j,children:v})};f.displayName=a+"Provider";function p(m,y){const v=y?.[e]?.[d]||u,w=x.useContext(v);if(w)return w;if(o!==void 0)return o;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[f,p]}const i=()=>{const a=n.map(o=>x.createContext(o));return function(u){const d=u?.[e]||a;return x.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return i.scopeName=e,[r,are(i,...t)]}function are(...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 o=r.reduce((u,{useScope:d,scopeName:f})=>{const m=d(a)[`__scope${f}`];return{...u,...m}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var yh=globalThis?.document?x.useLayoutEffect:()=>{},sre=dv[" useId ".trim().toString()]||(()=>{}),ore=0;function yw(e){const[t,n]=x.useState(sre());return yh(()=>{n(r=>r??String(ore++))},[e]),e||(t?`radix-${t}`:"")}var lre=dv[" useInsertionEffect ".trim().toString()]||yh;function cre({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=ure({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=dre(p)?p(e):p;m!==e&&o.current?.(m)}else a(p)},[u,e,a,o]);return[d,f]}function ure({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),a=x.useRef(t);return lre(()=>{a.current=t},[t]),x.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function dre(e){return typeof e=="function"}function s3(e){const t=fre(e),n=x.forwardRef((r,i)=>{const{children:a,...o}=r,u=x.Children.toArray(a),d=u.find(pre);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 l.jsx(t,{...o,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return l.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function fre(e){const t=x.forwardRef((n,r)=>{const{children:i,...a}=n;if(x.isValidElement(i)){const o=gre(i),u=mre(a,i.props);return i.type!==x.Fragment&&(u.ref=r?ok(r,o):o),x.cloneElement(i,u)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hre=Symbol("radix.slottable");function pre(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hre}function mre(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 gre(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 yre=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ts=yre.reduce((e,t)=>{const n=s3(`Primitive.${t}`),r=x.forwardRef((i,a)=>{const{asChild:o,...u}=i,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(d,{...u,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function vre(e,t){e&&uc.flushSync(()=>e.dispatchEvent(t))}function vh(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function xre(e,t=globalThis?.document){const n=vh(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 bre="DismissableLayer",Xj="dismissableLayer.update",wre="dismissableLayer.pointerDownOutside",Sre="dismissableLayer.focusOutside",lT,o3=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),l3=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:u,...d}=e,f=x.useContext(o3),[p,m]=x.useState(null),y=p?.ownerDocument??globalThis?.document,[,v]=x.useState({}),w=fc(t,z=>m(z)),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,O=E>=k,_=kre(z=>{const R=z.target,$=[...f.branches].some(F=>F.contains(R));!O||$||(i?.(z),o?.(z),z.defaultPrevented||u?.())},y),A=Cre(z=>{const R=z.target;[...f.branches].some(F=>F.contains(R))||(a?.(z),o?.(z),z.defaultPrevented||u?.())},y);return xre(z=>{E===f.layers.size-1&&(r?.(z),!z.defaultPrevented&&u&&(z.preventDefault(),u()))},y),x.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(lT=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),cT(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=lT)}},[p,y,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),cT())},[p,f]),x.useEffect(()=>{const z=()=>v({});return document.addEventListener(Xj,z),()=>document.removeEventListener(Xj,z)},[]),l.jsx(Ts.div,{...d,ref:w,style:{pointerEvents:C?O?"auto":"none":void 0,...e.style},onFocusCapture:zo(e.onFocusCapture,A.onFocusCapture),onBlurCapture:zo(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:zo(e.onPointerDownCapture,_.onPointerDownCapture)})});l3.displayName=bre;var jre="DismissableLayerBranch",Nre=x.forwardRef((e,t)=>{const n=x.useContext(o3),r=x.useRef(null),i=fc(t,r);return x.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),l.jsx(Ts.div,{...e,ref:i})});Nre.displayName=jre;function kre(e,t=globalThis?.document){const n=vh(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const a=u=>{if(u.target&&!r.current){let d=function(){c3(wre,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},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Cre(e,t=globalThis?.document){const n=vh(e),r=x.useRef(!1);return x.useEffect(()=>{const i=a=>{a.target&&!r.current&&c3(Sre,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 cT(){const e=new CustomEvent(Xj);document.dispatchEvent(e)}function c3(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?vre(i,a):i.dispatchEvent(a)}var vw="focusScope.autoFocusOnMount",xw="focusScope.autoFocusOnUnmount",uT={bubbles:!1,cancelable:!0},Are="FocusScope",u3=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[u,d]=x.useState(null),f=vh(i),p=vh(a),m=x.useRef(null),y=fc(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 O=C.target;u.contains(O)?m.current=O:go(m.current,{select:!0})},j=function(C){if(v.paused||!u)return;const O=C.relatedTarget;O!==null&&(u.contains(O)||go(m.current,{select:!0}))},k=function(C){if(document.activeElement===document.body)for(const _ of C)_.removedNodes.length>0&&go(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){fT.add(v);const b=document.activeElement;if(!u.contains(b)){const k=new CustomEvent(vw,uT);u.addEventListener(vw,f),u.dispatchEvent(k),k.defaultPrevented||(Ore(Pre(d3(u)),{select:!0}),document.activeElement===b&&go(u))}return()=>{u.removeEventListener(vw,f),setTimeout(()=>{const k=new CustomEvent(xw,uT);u.addEventListener(xw,p),u.dispatchEvent(k),k.defaultPrevented||go(b??document.body,{select:!0}),u.removeEventListener(xw,p),fT.remove(v)},0)}}},[u,f,p,v]);const w=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,O]=Ere(E);C&&O?!b.shiftKey&&k===O?(b.preventDefault(),n&&go(C,{select:!0})):b.shiftKey&&k===C&&(b.preventDefault(),n&&go(O,{select:!0})):k===E&&b.preventDefault()}},[n,r,v.paused]);return l.jsx(Ts.div,{tabIndex:-1,...o,ref:y,onKeyDown:w})});u3.displayName=Are;function Ore(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(go(r,{select:t}),document.activeElement!==n)return}function Ere(e){const t=d3(e),n=dT(t,e),r=dT(t.reverse(),e);return[n,r]}function d3(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 dT(e,t){for(const n of e)if(!_re(n,{upTo:t}))return n}function _re(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 zre(e){return e instanceof HTMLInputElement&&"select"in e}function go(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&zre(e)&&t&&e.select()}}var fT=Tre();function Tre(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=hT(e,t),e.unshift(t)},remove(t){e=hT(e,t),e[0]?.resume()}}}function hT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Pre(e){return e.filter(t=>t.tagName!=="A")}var Rre="Portal",f3=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,a]=x.useState(!1);yh(()=>a(!0),[]);const o=n||i&&globalThis?.document?.body;return o?hG.createPortal(l.jsx(Ts.div,{...r,ref:t}),o):null});f3.displayName=Rre;function Dre(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Ov=e=>{const{present:t,children:n}=e,r=Mre(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=fc(r.ref,Ire(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:a}):null};Ov.displayName="Presence";function Mre(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),a=x.useRef("none"),o=e?"mounted":"unmounted",[u,d]=Dre(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Mm(r.current);a.current=u==="mounted"?f:"none"},[u]),yh(()=>{const f=r.current,p=i.current;if(p!==e){const y=a.current,v=Mm(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&y!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),yh(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,m=v=>{const b=Mm(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)})}},y=v=>{v.target===t&&(a.current=Mm(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",y),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 Mm(e){return e?.animationName||"none"}function Ire(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 bw=0;function Lre(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??pT()),document.body.insertAdjacentElement("beforeend",e[1]??pT()),bw++,()=>{bw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),bw--}},[])}function pT(){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 Ta=function(){return Ta=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},Ta.apply(this,arguments)};function h3(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 $re(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 Ng="right-scroll-bar-position",kg="width-before-scroll-bar",Bre="with-scroll-bars-hidden",Ure="--removed-body-scroll-bar-size";function ww(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function qre(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 Fre=typeof window<"u"?x.useLayoutEffect:x.useEffect,mT=new WeakMap;function Hre(e,t){var n=qre(null,function(r){return e.forEach(function(i){return ww(i,r)})});return Fre(function(){var r=mT.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(u){a.has(u)||ww(u,null)}),a.forEach(function(u){i.has(u)||ww(u,o)})}mT.set(n,e)},[e]),n}function Kre(e){return e}function Gre(e,t){t===void 0&&(t=Kre);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 o=t(a,r);return n.push(o),function(){n=n.filter(function(u){return u!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(u){return a(u)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var u=n;n=[],u.forEach(a),o=n}var d=function(){var p=o;o=[],p.forEach(a)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){o.push(p),f()},filter:function(p){return o=o.filter(p),n}}}};return i}function Vre(e){e===void 0&&(e={});var t=Gre(null);return t.options=Ta({async:!0,ssr:!1},e),t}var p3=function(e){var t=e.sideCar,n=h3(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,Ta({},n))};p3.isSideCarExport=!0;function Qre(e,t){return e.useMedium(t),p3}var m3=Vre(),Sw=function(){},Ev=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:Sw,onWheelCapture:Sw,onTouchMoveCapture:Sw}),i=r[0],a=r[1],o=e.forwardProps,u=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,y=e.sideCar,v=e.noRelative,w=e.noIsolation,b=e.inert,j=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,C=e.gapMode,O=h3(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=y,A=Hre([n,t]),z=Ta(Ta({},O),i);return x.createElement(x.Fragment,null,p&&x.createElement(_,{sideCar:m3,removeScrollBar:f,shards:m,noRelative:v,noIsolation:w,inert:b,setCallbacks:a,allowPinchZoom:!!j,lockRef:n,gapMode:C}),o?x.cloneElement(x.Children.only(u),Ta(Ta({},z),{ref:A})):x.createElement(E,Ta({},z,{className:d,ref:A}),u))});Ev.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ev.classNames={fullWidth:kg,zeroRight:Ng};var Yre=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Zre(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Yre();return t&&e.setAttribute("nonce",t),e}function Wre(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Xre(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Jre=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Zre())&&(Wre(t,n),Xre(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},eie=function(){var e=Jre();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},g3=function(){var e=eie(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},tie={left:0,top:0,right:0,gap:0},jw=function(e){return parseInt(e||"",10)||0},nie=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[jw(n),jw(r),jw(i)]},rie=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return tie;var t=nie(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])}},iie=g3(),Pu="data-scroll-locked",aie=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
53
|
+
.`.concat(Bre,` {
|
|
54
|
+
overflow: hidden `).concat(r,`;
|
|
55
|
+
padding-right: `).concat(u,"px ").concat(r,`;
|
|
56
|
+
}
|
|
57
|
+
body[`).concat(Pu,`] {
|
|
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(o,`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(Ng,` {
|
|
71
|
+
right: `).concat(u,"px ").concat(r,`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.`).concat(kg,` {
|
|
75
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.`).concat(Ng," .").concat(Ng,` {
|
|
79
|
+
right: 0 `).concat(r,`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.`).concat(kg," .").concat(kg,` {
|
|
83
|
+
margin-right: 0 `).concat(r,`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
body[`).concat(Pu,`] {
|
|
87
|
+
`).concat(Ure,": ").concat(u,`px;
|
|
88
|
+
}
|
|
89
|
+
`)},gT=function(){var e=parseInt(document.body.getAttribute(Pu)||"0",10);return isFinite(e)?e:0},sie=function(){x.useEffect(function(){return document.body.setAttribute(Pu,(gT()+1).toString()),function(){var e=gT()-1;e<=0?document.body.removeAttribute(Pu):document.body.setAttribute(Pu,e.toString())}},[])},oie=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;sie();var a=x.useMemo(function(){return rie(i)},[i]);return x.createElement(iie,{styles:aie(a,!t,i,n?"":"!important")})},Jj=!1;if(typeof window<"u")try{var Im=Object.defineProperty({},"passive",{get:function(){return Jj=!0,!0}});window.addEventListener("test",Im,Im),window.removeEventListener("test",Im,Im)}catch{Jj=!1}var ru=Jj?{passive:!1}:!1,lie=function(e){return e.tagName==="TEXTAREA"},y3=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!lie(e)&&n[t]==="visible")},cie=function(e){return y3(e,"overflowY")},uie=function(e){return y3(e,"overflowX")},yT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=v3(e,r);if(i){var a=x3(e,r),o=a[1],u=a[2];if(o>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},die=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},fie=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},v3=function(e,t){return e==="v"?cie(t):uie(t)},x3=function(e,t){return e==="v"?die(t):fie(t)},hie=function(e,t){return e==="h"&&t==="rtl"?-1:1},pie=function(e,t,n,r,i){var a=hie(e,window.getComputedStyle(t).direction),o=a*r,u=n.target,d=t.contains(u),f=!1,p=o>0,m=0,y=0;do{if(!u)break;var v=x3(e,u),w=v[0],b=v[1],j=v[2],k=b-j-a*w;(w||k)&&v3(e,u)&&(m+=k,y+=w);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(y)<1)&&(f=!0),f},Lm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vT=function(e){return[e.deltaX,e.deltaY]},xT=function(e){return e&&"current"in e?e.current:e},mie=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gie=function(e){return`
|
|
90
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
91
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
92
|
+
`)},yie=0,iu=[];function vie(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(yie++)[0],a=x.useState(g3)[0],o=x.useRef(e);x.useEffect(function(){o.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var b=$re([e.lockRef.current],(e.shards||[]).map(xT),!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!o.current.allowPinchZoom;var k=Lm(b),E=n.current,C="deltaX"in b?b.deltaX:E[0]-k[0],O="deltaY"in b?b.deltaY:E[1]-k[1],_,A=b.target,z=Math.abs(C)>Math.abs(O)?"h":"v";if("touches"in b&&z==="h"&&A.type==="range")return!1;var R=window.getSelection(),$=R&&R.anchorNode,F=$?$===A||$.contains(A):!1;if(F)return!1;var U=yT(z,A);if(!U)return!0;if(U?_=z:(_=z==="v"?"h":"v",U=yT(z,A)),!U)return!1;if(!r.current&&"changedTouches"in b&&(C||O)&&(r.current=_),!_)return!0;var B=r.current||_;return pie(B,j,b,B==="h"?C:O)},[]),d=x.useCallback(function(b){var j=b;if(!(!iu.length||iu[iu.length-1]!==a)){var k="deltaY"in j?vT(j):Lm(j),E=t.current.filter(function(_){return _.name===j.type&&(_.target===j.target||j.target===_.shadowParent)&&mie(_.delta,k)})[0];if(E&&E.should){j.cancelable&&j.preventDefault();return}if(!E){var C=(o.current.shards||[]).map(xT).filter(Boolean).filter(function(_){return _.contains(j.target)}),O=C.length>0?u(j,C[0]):!o.current.noIsolation;O&&j.cancelable&&j.preventDefault()}}},[]),f=x.useCallback(function(b,j,k,E){var C={name:b,delta:j,target:k,should:E,shadowParent:xie(k)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(O){return O!==C})},1)},[]),p=x.useCallback(function(b){n.current=Lm(b),r.current=void 0},[]),m=x.useCallback(function(b){f(b.type,vT(b),b.target,u(b,e.lockRef.current))},[]),y=x.useCallback(function(b){f(b.type,Lm(b),b.target,u(b,e.lockRef.current))},[]);x.useEffect(function(){return iu.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:y}),document.addEventListener("wheel",d,ru),document.addEventListener("touchmove",d,ru),document.addEventListener("touchstart",p,ru),function(){iu=iu.filter(function(b){return b!==a}),document.removeEventListener("wheel",d,ru),document.removeEventListener("touchmove",d,ru),document.removeEventListener("touchstart",p,ru)}},[]);var v=e.removeScrollBar,w=e.inert;return x.createElement(x.Fragment,null,w?x.createElement(a,{styles:gie(i)}):null,v?x.createElement(oie,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function xie(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const bie=Qre(m3,vie);var b3=x.forwardRef(function(e,t){return x.createElement(Ev,Ta({},e,{ref:t,sideCar:bie}))});b3.classNames=Ev.classNames;var wie=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},au=new WeakMap,$m=new WeakMap,Bm={},Nw=0,w3=function(e){return e&&(e.host||w3(e.parentNode))},Sie=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=w3(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})},jie=function(e,t,n,r){var i=Sie(t,Array.isArray(e)?e:[e]);Bm[n]||(Bm[n]=new WeakMap);var a=Bm[n],o=[],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(y){if(u.has(y))p(y);else try{var v=y.getAttribute(r),w=v!==null&&v!=="false",b=(au.get(y)||0)+1,j=(a.get(y)||0)+1;au.set(y,b),a.set(y,j),o.push(y),b===1&&w&&$m.set(y,!0),j===1&&y.setAttribute(n,"true"),w||y.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",y,k)}})};return p(t),u.clear(),Nw++,function(){o.forEach(function(m){var y=au.get(m)-1,v=a.get(m)-1;au.set(m,y),a.set(m,v),y||($m.has(m)||m.removeAttribute(r),$m.delete(m)),v||m.removeAttribute(n)}),Nw--,Nw||(au=new WeakMap,au=new WeakMap,$m=new WeakMap,Bm={})}},Nie=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=wie(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),jie(r,i,n,"aria-hidden")):function(){return null}},_v="Dialog",[S3]=ire(_v),[kie,pa]=S3(_v),j3=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,u=x.useRef(null),d=x.useRef(null),[f,p]=cre({prop:r,defaultProp:i??!1,onChange:a,caller:_v});return l.jsx(kie,{scope:t,triggerRef:u,contentRef:d,contentId:yw(),titleId:yw(),descriptionId:yw(),open:f,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(m=>!m),[p]),modal:o,children:n})};j3.displayName=_v;var N3="DialogTrigger",Cie=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=pa(N3,n),a=fc(t,i.triggerRef);return l.jsx(Ts.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":fk(i.open),...r,ref:a,onClick:zo(e.onClick,i.onOpenToggle)})});Cie.displayName=N3;var uk="DialogPortal",[Aie,k3]=S3(uk,{forceMount:void 0}),C3=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=pa(uk,t);return l.jsx(Aie,{scope:t,forceMount:n,children:x.Children.map(r,o=>l.jsx(Ov,{present:n||a.open,children:l.jsx(f3,{asChild:!0,container:i,children:o})}))})};C3.displayName=uk;var sy="DialogOverlay",A3=x.forwardRef((e,t)=>{const n=k3(sy,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=pa(sy,e.__scopeDialog);return a.modal?l.jsx(Ov,{present:r||a.open,children:l.jsx(Eie,{...i,ref:t})}):null});A3.displayName=sy;var Oie=s3("DialogOverlay.RemoveScroll"),Eie=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=pa(sy,n);return l.jsx(b3,{as:Oie,allowPinchZoom:!0,shards:[i.contentRef],children:l.jsx(Ts.div,{"data-state":fk(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Wl="DialogContent",O3=x.forwardRef((e,t)=>{const n=k3(Wl,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=pa(Wl,e.__scopeDialog);return l.jsx(Ov,{present:r||a.open,children:a.modal?l.jsx(_ie,{...i,ref:t}):l.jsx(zie,{...i,ref:t})})});O3.displayName=Wl;var _ie=x.forwardRef((e,t)=>{const n=pa(Wl,e.__scopeDialog),r=x.useRef(null),i=fc(t,n.contentRef,r);return x.useEffect(()=>{const a=r.current;if(a)return Nie(a)},[]),l.jsx(E3,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:zo(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:zo(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,u=o.button===0&&o.ctrlKey===!0;(o.button===2||u)&&a.preventDefault()}),onFocusOutside:zo(e.onFocusOutside,a=>a.preventDefault())})}),zie=x.forwardRef((e,t)=>{const n=pa(Wl,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return l.jsx(E3,{...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 o=a.target;n.triggerRef.current?.contains(o)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),E3=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,u=pa(Wl,n),d=x.useRef(null),f=fc(t,d);return Lre(),l.jsxs(l.Fragment,{children:[l.jsx(u3,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:l.jsx(l3,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":fk(u.open),...o,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(Tie,{titleId:u.titleId}),l.jsx(Rie,{contentRef:d,descriptionId:u.descriptionId})]})]})}),dk="DialogTitle",_3=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=pa(dk,n);return l.jsx(Ts.h2,{id:i.titleId,...r,ref:t})});_3.displayName=dk;var z3="DialogDescription",T3=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=pa(z3,n);return l.jsx(Ts.p,{id:i.descriptionId,...r,ref:t})});T3.displayName=z3;var P3="DialogClose",R3=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=pa(P3,n);return l.jsx(Ts.button,{type:"button",...r,ref:t,onClick:zo(e.onClick,()=>i.onOpenChange(!1))})});R3.displayName=P3;function fk(e){return e?"open":"closed"}var D3="DialogTitleWarning",[V_e,M3]=rre(D3,{contentName:Wl,titleName:dk,docsSlug:"dialog"}),Tie=({titleId:e})=>{const t=M3(D3),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},Pie="DialogDescriptionWarning",Rie=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${M3(Pie).contentName}}.`;return x.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},I3=j3,L3=C3,hk=A3,pk=O3,mk=_3,$3=T3,B3=R3;const U3=I3,Die=L3,q3=x.forwardRef(({className:e,...t},n)=>l.jsx(hk,{ref:n,className:Qi("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));q3.displayName=hk.displayName;const Mie=400,Iie=1200,Lie=720,gk=x.forwardRef(({className:e,children:t,...n},r)=>{const[i,a]=x.useState(Lie),o=x.useRef(!1),u=x.useRef(0),d=x.useRef(0),f=x.useCallback(y=>{o.current=!0,u.current=y.clientX,d.current=i,y.target.setPointerCapture(y.pointerId),y.preventDefault()},[i]),p=x.useCallback(y=>{if(!o.current)return;const v=u.current-y.clientX,w=Math.min(Iie,Math.max(Mie,d.current+v));a(w)},[]),m=x.useCallback(()=>{o.current=!1},[]);return l.jsxs(Die,{children:[l.jsx(q3,{}),l.jsxs(pk,{ref:r,className:Qi("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:[l.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,l.jsxs(B3,{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:[l.jsx(Uh,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});gk.displayName=pk.displayName;const F3=({className:e,...t})=>l.jsx("div",{className:Qi("flex flex-col gap-1.5 pr-10",e),...t}),yk=x.forwardRef(({className:e,...t},n)=>l.jsx(mk,{ref:n,className:Qi("text-lg font-medium text-zinc-50",e),...t}));yk.displayName=mk.displayName;const vk=x.forwardRef(({className:e,...t},n)=>l.jsx($3,{ref:n,className:Qi("text-sm text-zinc-500",e),...t}));vk.displayName=$3.displayName;function $ie({title:e,subtitle:t,children:n,open:r,onClose:i}){return l.jsx(U3,{open:r,onOpenChange:a=>a?void 0:i(),children:l.jsxs(gk,{children:[l.jsxs(F3,{className:"drawer-head",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),l.jsx(yk,{id:"drawer-title",children:e}),l.jsx(vk,{className:"sr-only",children:t})]}),l.jsx("div",{className:"drawer-body",children:n})]})})}function lr({text:e}){const[t,n]=x.useState(null),r=x.useRef(null),i=x.useCallback(()=>{if(!r.current)return;const o=r.current.getBoundingClientRect();n({top:o.top,left:o.left+o.width/2})},[]),a=x.useCallback(()=>n(null),[]);return l.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,children:[l.jsxs("svg",{ref:r,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[l.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),l.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),t!==null&&uc.createPortal(l.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 Bie=/[\s\-_]+/;function Uie(e){const t=e.split(Bie).filter(Boolean);return t.length===0?null:t.map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function bT(e,t){const n=qie(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 o=[...i].sort((f,p)=>p.length-f.length).map(Uie).filter(f=>!!f);if(o.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(`(${o.join("|")})`,"gi"),d=new Map;for(const f of n)for(const p of f.terms){const m=ny(p);m&&!d.has(m)&&d.set(m,f.className)}return r.flatMap((f,p)=>f.value.split(u).map((y,v)=>{if(!y)return null;if(v%2===1){const b=d.get(ny(y))??"answer-highlight";return f.type==="bold"?Ii.createElement("mark",{key:`hl-${p}-${v}`,className:b},Ii.createElement("strong",{className:"text-zinc-200 font-semibold"},y)):Ii.createElement("mark",{key:`hl-${p}-${v}`,className:b},y)}return f.type==="bold"?Ii.createElement("strong",{key:`b-${p}-${v}`,className:"text-zinc-200 font-semibold"},y):y})).filter(Boolean)}function qie(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function kw(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 Fie({evidence:e,project:t,onClose:n}){const[r,i]=x.useState(!1),[a,o]=x.useState("mentions"),[u,d]=x.useState(-1),[f,p]=x.useState(null),[m,y]=x.useState(!1),[v,w]=x.useState({}),b=fee(t.project),j=new Set(b.map(ey)),k=e.runHistory,E=k.length>1,[C,O]=x.useState(null),_=x.useRef(!1);x.useEffect(()=>{if(_.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const G=k.at(-1);G&&(_.current=!0,Vl(G.runId).then(oe=>{const ne=oe.snapshots.find(Ae=>Ae.query===e.query&&Ae.provider===e.provider);ne&&O({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 A=u>=0&&f!==null,z=A?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},R=z.visibilityState==="pending"||z.citationState==="pending",$=R?!1:z.visibilityState!=null?z.visibilityState==="visible":z.answerMentioned!=null?z.answerMentioned:z.citationState===gh.cited||z.citationState==="emerging",F=z.answerMentioned!=null||z.visibilityState!=null||z.recommendedCompetitors.length>0,U=z.citedDomains.length>0||z.groundingSources.length>0||z.evidenceUrls.length>0,B=t.project.displayName||t.project.name,V=[...b.map(ey),B,B.split(" ").slice(0,2).join(" "),...z.matchedTerms].filter(G=>G.trim().length>2),X=[...z.competitorDomains.flatMap(G=>{const oe=dee(G);return oe.length>=4?[oe]:[]}),...z.recommendedCompetitors].filter(G=>G.trim().length>2),W=[{terms:V,className:"answer-highlight-brand"},...X.length>0?[{terms:X,className:"answer-highlight-competitor"}]:[]],H=R?"pending":z.visibilityTransition==="lost"?"lost":$?"cited":"not-cited",J=x.useRef(0),ce=x.useCallback(async G=>{const oe=++J.current;if(G===-1||G===k.length-1){d(-1),p(null),i(!1);return}d(G),i(!1);const ne=k[G],Ae=`${ne.runId}::${e.query}::${e.provider}`;if(v[Ae]){p(v[Ae]);return}y(!0);try{const we=await Vl(ne.runId);if(oe!==J.current)return;const ee=we.snapshots.find(_e=>_e.query===e.query&&_e.provider===e.provider)??we.snapshots.find(_e=>_e.query===e.query),he=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:kw(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:kw(ne.visibilityTransition,ne.visibilityState),summary:"Snapshot data not available for this run."};w(_e=>({..._e,[Ae]:he})),p(he)}catch{if(oe!==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:kw(ne.visibilityTransition,ne.visibilityState),summary:"Failed to load historical run data."})}finally{oe===J.current&&y(!1)}},[k,e.query,e.provider,v]),M=(A||e.historyScope!=="provider")&&z.model?`${z.provider} (${z.model}) · ${z.changeLabel.toLowerCase()}`:`${z.provider} · ${z.changeLabel.toLowerCase()}`,I=!A&&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:M}:z.visibilityTransition==="lost"?{label:"Visibility lost",title:"Your brand no longer appears in this answer",meta:M}:R?{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:M},D=()=>{if(!z.answerSnippet)return null;const G=z.answerSnippet.split(`
|
|
97
|
+
`),oe=[];let ne=[],Ae=0;const we=()=>{if(ne.length===0)return;const ee=ne.join(" ").trim();ee&&oe.push(l.jsx("p",{className:oe.length>0?"mt-2.5":"",children:bT(ee,W)},Ae++)),ne=[]};for(const ee of G){const he=ee.trim();if(/^[-\u2013\u2014]{3,}$/.test(he)){we(),oe.push(l.jsx("hr",{className:"border-zinc-800/60 my-3"},Ae++));continue}const _e=he.match(/^(#{1,3})\s+(.+)$/);if(_e){we();const Z=_e[1].length,Fe=_e[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||_e[2],Re=Z===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":Z===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";oe.push(l.jsx("p",{className:Re,children:bT(Fe,W)},Ae++));continue}if(he===""){we();continue}ne.push(he)}return we(),oe};return l.jsx(I3,{open:!0,onOpenChange:G=>{G||n()},children:l.jsxs(L3,{children:[l.jsx(hk,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),l.jsxs(pk,{className:"evidence-modal","aria-describedby":void 0,children:[l.jsxs("div",{className:"evidence-modal-header",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," ","·"," ",z.provider||"All providers"]}),l.jsx(mk,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),l.jsxs(B3,{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:[l.jsx(Uh,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]}),E&&l.jsxs("div",{className:"evidence-modal-timeline",children:[l.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),l.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:k.map((G,oe)=>{const ne=u===-1&&oe===k.length-1||u===oe,Ae=G.visibilityState??(G.answerMentioned?"visible":"not-visible"),we=G.visibilityTransition??Ae,ee=Ae==="visible"?"bg-emerald-400":we==="emerging"?"bg-amber-400":we==="lost"?"bg-rose-400":"bg-zinc-600",_e=new Date(G.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Z=!!(G.model&&oe>0&&k[oe-1]?.model&&k[oe-1].model!==G.model);return l.jsxs("button",{type:"button",className:`evidence-run-dot ${ne?"evidence-run-dot--selected":""}`,onClick:()=>ce(oe===k.length-1?-1:oe),"aria-label":[`Run ${_e}: ${Ae}`,G.model?`model ${G.model}`:null,Z?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ne,children:[l.jsx("span",{className:`size-2 rounded-full ${ee} ${Z?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),l.jsx("span",{className:"text-[10px] text-zinc-500",children:_e})]},oe)})}),u>=0&&u<k.length&&l.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(k[u].createdAt).toLocaleString()," ","—"," ",l.jsx("span",{className:"capitalize",children:k[u].visibilityState??(k[u].answerMentioned?"visible":"not-visible")}),l.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>ce(-1),children:["←"," Back to latest"]})]}),!A&&(e.modelTransitions?.length??0)>0&&l.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(G=>l.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"}`))})]}),l.jsxs("div",{className:"evidence-modal-body",children:[m&&l.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&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"evidence-modal-main",children:[l.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${H}`,children:[l.jsx("p",{className:`evidence-position-label evidence-position-label--${H}`,children:q.label}),l.jsx("p",{className:`evidence-position-title evidence-position-title--${H}`,children:q.title}),l.jsx("p",{className:"evidence-position-meta",children:q.meta}),I&&l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:I})]}),z.answerSnippet&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),l.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:D()}),z.answerSnippet.length>280&&l.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"})]}),!z.answerSnippet&&!m&&l.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"}),!A&&e.relatedTechnicalSignals.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:$?"Why you're visible":"What to fix"}),l.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((G,oe)=>l.jsxs("div",{className:"action-item",children:[l.jsx("svg",{className:`action-item-icon ${$?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:$?l.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),l.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),l.jsx("span",{className:"action-item-text",children:G})]},oe))})]}),z.summary&&l.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:z.summary})]}),l.jsxs("div",{className:"evidence-modal-sidebar",children:[(F||U)&&l.jsxs("div",{className:"sidebar-tabs",children:[l.jsx("button",{className:`sidebar-tab ${a==="mentions"?"sidebar-tab--active":""}`,onClick:()=>o("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),l.jsx("button",{className:`sidebar-tab ${a==="sources"?"sidebar-tab--active":""}`,onClick:()=>o("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"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsxs("div",{className:"drawer-section-label flex items-center",children:[l.jsx("span",{children:"Answer visibility"}),l.jsx(lr,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),l.jsxs("div",{className:`mention-status mention-status--${$?"visible":"not-visible"}`,children:[l.jsx("span",{className:"mention-status-icon",children:R?"…":$?"✓":"—"}),l.jsx("span",{className:"mention-status-label",children:R?"Pending":$?"Visible":"Not visible"})]}),z.matchedTerms.length>0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:z.matchedTerms.map(G=>l.jsx("span",{className:"mention-chip mention-chip--brand",children:G},G))})]}),!R&&!$&&z.matchedTerms.length===0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:V.map(G=>l.jsx("span",{className:"mention-chip mention-chip--muted",children:G},G))}),l.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(z.recommendedCompetitors.length>0||z.competitorDomains.length>0)&&l.jsxs("div",{children:[l.jsxs("div",{className:"drawer-section-label flex items-center",children:[l.jsx("span",{children:"Competitors in answer"}),l.jsx(lr,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const G=z.competitorDomains.map(Ae=>Ae.replace(/^www\./,"")),oe=new Set(G.map(Ae=>ny(Ae.replace(/\.[^.]+$/,""))));return[...z.recommendedCompetitors.filter(Ae=>!oe.has(ny(Ae))),...G].map(Ae=>l.jsx("span",{className:"mention-chip mention-chip--competitor",children:Ae},Ae))})()})]})]}),a==="sources"&&l.jsxs(l.Fragment,{children:[z.citedDomains.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"drawer-section-label flex items-center",children:[l.jsx("span",{children:"Domains from source links"}),l.jsx(lr,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),l.jsx("div",{className:"citation-leaderboard",children:z.citedDomains.map((G,oe)=>{const ne=G.toLowerCase().replace(/^www\./,""),Ae=j.has(ne),we=!Ae&&z.competitorDomains.some(he=>he.toLowerCase().replace(/^www\./,"")===ne),ee=Ae?"you":we?"competitor":"other";return l.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${ee}`,children:[l.jsxs("span",{className:"citation-leaderboard-rank",children:["#",oe+1]}),l.jsx("span",{className:"citation-leaderboard-domain",children:G}),Ae&&l.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),we&&l.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},G)})})]}),z.groundingSources.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"drawer-section-label flex items-center",children:[l.jsxs("span",{children:["Grounding source links (",z.groundingSources.length,")"]}),l.jsx(lr,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),l.jsx("ul",{className:"grid gap-0.5",children:z.groundingSources.map((G,oe)=>l.jsx("li",{className:"truncate text-sm",children:l.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})},oe))})]}),z.evidenceUrls.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),l.jsx("ul",{className:"grid gap-1",children:z.evidenceUrls.map(G=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:G,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G})},G))})]}),z.citedDomains.length===0&&z.groundingSources.length===0&&z.evidenceUrls.length===0&&l.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",A?"for this run":"yet"]})]}),!F&&!U&&l.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",A?"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 Cw=[{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 zv(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 Hie=zv({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"}),Kie=zv({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"}),Gie=zv({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"}),Vie=zv({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"}),Qie=[{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"])}];Cw[0],Cw[1],ia(["cited","cited","cited","cited","cited"]),Cw[2],2/7,ia(["not-cited","not-cited","not-cited","cited"]);function Yie(e,t){return e.projects.find(n=>n.project.id===t)}function Zie(e,t){return e.runs.find(n=>n.id===t)}function Wie(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 Xie={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral"},Jie={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited"},eae={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor"};function tae(e){return{id:e.id,tone:Xie[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??eae[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:Jie[e.type]}]}}function nae(e){return e.filter(t=>!t.dismissed).map(tae)}function H3(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 wT(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function rae(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 K3(e){switch(e){case Ot["answer-visibility"]:return"Answer visibility sweep";case Ot["gsc-sync"]:return"GSC sync";case Ot["inspect-sitemap"]:return"Sitemap inspection";case Ot["ga-sync"]:return"GA sync";case Ot["traffic-sync"]:return"Traffic sync";case Ot["bing-inspect"]:return"Bing URL inspection";case Ot["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Ot["site-audit"]:return"Site audit";case Ot["backlink-extract"]:return"Backlink extract"}}function iae(e){return e===eh.manual?"Manual":e===eh.scheduled?"Scheduled":e===eh["config-apply"]?"Config apply":e}function xk(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:K3(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?wT(e.startedAt):wT(e.createdAt),duration:rae(e.startedAt,e.finishedAt),statusDetail:e.error?G3(e.error):aae(e),summary:sae(e),triggerLabel:iae(e.trigger)}}function G3(e){const t=ek(e);return t.length>200?t.slice(0,200)+"…":t}function aae(e){switch(e.status){case or.queued:return"Waiting for execution slot.";case or.running:return"Provider queries in progress.";case or.completed:return"All queries checked.";case or.partial:return"Run completed with some queries skipped.";case or.failed:return e.error?G3(e.error):"Run failed.";case or.cancelled:return"Run was cancelled.";default:return""}}function sae(e){const t=K3(e.kind);switch(e.status){case or.queued:return`${t} queued`;case or.running:return`${t} in progress`;case or.completed:return`${t} completed`;case or.partial:return`${t} partially completed`;case or.failed:return`${t} failed`;case or.cancelled:return`${t} cancelled`;default:return e.status}}function oae(e,t,n,r){const i=[];let a=0;const o=new Set;if(n){const u=new Map;for(const y of n.snapshots)if(y.query){const v=`${y.query}::${y.provider}`;u.set(v,y)}const d=new Set(n.snapshots.map(y=>y.provider)),f=new Set(t.flatMap(y=>Object.keys(y.providerRuns??{}))),p=[...new Set([...d,...f])].sort(),m=p.length>0?p:["gemini"];for(const y of t){if(y.runs.length===0)continue;o.add(y.query);const v=y.runs.at(-1),w=v?.transition??"not-cited";for(const b of m){const j=u.get(`${y.query}::${b}`),k=(y.providerRuns?.[b]?.length??0)>0;if(!j&&!k)continue;const E=j?.model??null,C=E?`${b}:${E}`:null,O=C?y.modelRuns?.[C]:void 0,_=y.providerRuns?.[b],A=(_?.length?_:null)??(O?.length?O:null),z=_?.length?"provider":O?.length?"model":"query",R=A?A.at(-1).transition:w,$=A?A.at(-1).visibilityTransition??(A.at(-1).visibilityState==="visible"?"visible":"not-visible"):v?.visibilityTransition??(v?.visibilityState==="visible"?"visible":"not-visible"),F=A?.at(-1)?.citationState,U=A?.at(-1)?.visibilityState,B=j?R==="lost"?"lost":R==="emerging"?"emerging":j.citationState===gh.cited?"cited":"not-cited":F===gh.cited?"cited":"not-cited",V=j?.visibilityState??(U==="visible"?"visible":U==="pending"?"pending":"not-visible"),X=ST(A||y.runs),W=jT(A||y.runs),H=lae(y,b),J=(A??y.runs).map(I=>({runId:I.runId,citationState:I.citationState,createdAt:I.createdAt,model:H.get(I.runId)??null,answerMentioned:I.answerMentioned,visibilityState:I.visibilityState,visibilityTransition:I.visibilityTransition})),ce=cae(J),xe=z==="provider"&&ce.length<=1?"model":z,M=uae(J);i.push({id:`evidence_${e}_${a++}`,query:y.query,provider:j?.provider??b,model:j?.model??null,location:j?.location??null,citationState:B,answerMentioned:j?.answerMentioned,visibilityState:V,visibilityChangeLabel:NT($,W,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:NT(R,X),answerSnippet:j?.answerText??"",citedDomains:j?.citedDomains??[],evidenceUrls:[],competitorDomains:j?.competitorOverlap??[],recommendedCompetitors:j?.recommendedCompetitors??[],matchedTerms:j?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:j?.groundingSources??[],summary:dae(V,$,y.query),runHistory:J,historyScope:xe,modelsSeen:ce,modelTransitions:M})}}}for(const u of r)o.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 lae(e,t){const n=new Map,r=`${t}:`;for(const[i,a]of Object.entries(e.modelRuns??{})){if(!i.startsWith(r))continue;const o=i.slice(r.length),u=o==="unknown"?null:o;for(const d of a)n.set(d.runId,u)}return n}function cae(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function uae(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 ST(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 jT(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 NT(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?`${Of(r.positive)} in latest run`:`${Of(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return Of(r.first);case"not-cited":case"not-visible":return t<=1?`${Of(r.negative)} in latest run`:`${Of(r.negative)} across ${t} runs`;default:return e}}function Of(e){return e.charAt(0).toUpperCase()+e.slice(1)}function dae(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 fae(e){const t=H3(e.project),n=oae(t.name,e.timeline,e.latestRunDetail,e.queries),i=[...e.runs].sort((a,o)=>o.createdAt.localeCompare(a.createdAt)).map(a=>xk(a,e.project.displayName||e.project.name));return e.overview?hae(t,e.overview,n,i):pae(t,n,i)}function hae(e,t,n,r){const i=nae(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 pae(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 mae(e){const t=H3(e.project),n=[...e.runs].sort((y,v)=>v.createdAt.localeCompare(y.createdAt)),r=n.find(y=>y.kind===Ot["answer-visibility"])??n[0],i=e.project.displayName||e.project.name,a=r?xk(r,i):gae(e.project.id,i),o=e.overview;if(!o)return{project:t,visibilityScore:0,visibilityDelta:"No data",visibilityTone:"neutral",lastRun:a,insight:"No runs completed yet.",trend:[],competitorPressureLabel:"None"};const u=o.scores.visibility,d=u.progress??0,f=o.queryCounts.citedQueries,p=o.queryCounts.totalQueries,m=o.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:o.scores.competitorPressure.value}}function gae(e,t){return{id:"none",projectId:e,projectName:t,kind:Ot["answer-visibility"],kindLabel:"No runs yet",status:or.queued,trigger:eh.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function yae(e,t){const n=[],r=[],i=[];for(const o of e){r.push(fae(o)),i.push(mae(o));const u=[...o.runs].sort((d,f)=>f.createdAt.localeCompare(d.createdAt));for(const d of u)n.push(xk(d,o.project.displayName||o.project.name))}n.sort((o,u)=>u.createdAt.localeCompare(o.createdAt));const a=e.length>0;return{portfolioOverview:{projects:i,attentionItems:a?vae(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(o=>({name:o.name,displayName:o.displayName,keyUrl:o.keyUrl,modelHint:o.modelHint,model:o.model,state:o.configured?"ready":"needs-config",detail:o.configured?"Provider is configured.":"API key is missing.",quota:o.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 vae(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===or.running||a.status===or.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 Pe={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]},serverTraffic:{all:["server-traffic"],project:e=>["server-traffic",e],sources:e=>["server-traffic",e,"sources"],status:e=>["server-traffic",e,"status"],sourceDetail:(e,t)=>["server-traffic",e,"sources",t],events:(e,t)=>["server-traffic",e,"events",t]}},V3=x.createContext(null);V3.Provider;function qh(){return x.useContext(V3)}function pc(e){const n=qh()?.dashboard??null,r=yr({queryKey:Pe.projects.all,queryFn:yv,enabled:!n}),i=yr({queryKey:Pe.runs.all,queryFn:m5,enabled:!n,staleTime:Hj,refetchInterval:w=>w.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:Hj}),a=yr({queryKey:Pe.settings,queryFn:()=>UN().catch(()=>null),enabled:!n}),o=r.data??[],u=i.data??[],d=KL({queries:o.map(w=>{const b=u.filter(k=>k.projectId===w.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:Pe.projects.detail(w.id,j[0]?.id),queryFn:async()=>{const k=j[0]?.id,[E,C,O,_,A,z,R,$,F]=await Promise.all([HG(w.name).catch(()=>[]),g5(w.name).catch(()=>[]),y5(w.name).catch(()=>[]),k?Vl(k).catch(()=>null):Promise.resolve(null),j[1]?Vl(j[1].id).catch(()=>null):Promise.resolve(null),qN(w.name).catch(()=>null),FN(w.name).catch(()=>null),k?ZV(w.name,k).catch(()=>null):Promise.resolve(null),KG(w.name).catch(()=>null)]);return{project:w,runs:b,queries:E,competitors:C,timeline:O,latestRunDetail:_,previousRunDetail:A,gscCoverage:z,bingCoverage:R,dbInsights:$,overview:F}},enabled:!n&&r.isSuccess&&i.isSuccess,staleTime:O5}})}),f=d.every(w=>w.isSuccess),p=x.useMemo(()=>{if(n)return n;if(!r.data||!i.data||o.length>0&&!f)return null;const w=d.map(b=>b.data?{...b.data,runs:u.filter(j=>j.projectId===b.data.project.id)}:null).filter(b=>b!=null);return yae(w,a.data??null)},[n,r.data,i.data,a.data,f,d,o.length,u]),m=!n&&(r.isError||i.isError),y=!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:y,isError:m,refetch:v}}async function xae(){const e=await XV("/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 Tv(e,t){return yr({queryKey:Pe.health,queryFn:xae,enabled:e,refetchInterval:15e3,initialData:t})}function bae(e){return yr({queryKey:Pe.runs.detail(e??""),queryFn:()=>Vl(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function fd(){const e=qo(),t=gv({strict:!1}),n=Wr({select:d=>d.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:d=>e({to:n,from:Jr.to,search:f=>({...f,runId:d,evidenceId:void 0})}),openEvidence:d=>e({to:n,from:Jr.to,search:f=>({...f,evidenceId:d,runId:void 0})}),closeDrawer:()=>e({to:n,from:Jr.to,search:d=>({...d,runId:void 0,evidenceId:void 0})})}}const wae={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function Sae(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function jae(){const e=x.useSyncExternalStore(mQ,b2,b2),t=qo(),{openRun:n}=fd(),r=x.useCallback(a=>{Fj(a)},[]),i=x.useCallback(a=>{a.cta&&(a.cta.intent==="open-run-drawer"?n(a.cta.runId):t({to:"/runs"}),Fj(a.id))},[t,n]);return e.length===0?null:l.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(a=>l.jsxs("section",{role:a.tone==="negative"?"alert":"status","aria-live":a.tone==="negative"?"assertive":"polite","data-state":a.state,className:`toast-card ${wae[a.tone]}`,children:[l.jsxs("div",{className:"toast-copy",children:[l.jsx("p",{className:"toast-title",children:a.title}),a.detail?l.jsx("p",{className:"toast-detail",children:a.detail}):null,a.cta?l.jsx("button",{type:"button",className:"toast-action",onClick:()=>i(a),"aria-label":Sae(a),children:a.cta.label}):null]}),l.jsx("button",{type:"button",onClick:()=>r(a.id),className:"toast-dismiss","aria-label":"Dismiss",children:l.jsx(Uh,{className:"size-3.5"})})]},a.id))})}function Nae(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const kae=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Cae=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Aae={};function kT(e,t){return(Aae.jsx?Cae:kae).test(e)}const Oae=/[ \t\n\f\r]/g;function Eae(e){return typeof e=="object"?e.type==="text"?CT(e.value):!1:CT(e)}function CT(e){return e.replace(Oae,"")===""}let Fh=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Fh.prototype.normal={};Fh.prototype.property={};Fh.prototype.space=void 0;function Q3(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Fh(n,r,t)}function e1(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 _ae=0;const dt=mc(),In=mc(),t1=mc(),Ee=mc(),Zt=mc(),Ru=mc(),di=mc();function mc(){return 2**++_ae}const n1=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:In,commaOrSpaceSeparated:di,commaSeparated:Ru,number:Ee,overloadedBoolean:t1,spaceSeparated:Zt},Symbol.toStringTag,{value:"Module"})),Aw=Object.keys(n1);class bk extends ni{constructor(t,n,r,i){let a=-1;if(super(t,n),AT(this,"space",i),typeof r=="number")for(;++a<Aw.length;){const o=Aw[a];AT(this,Aw[a],(r&n1[o])===n1[o])}}}bk.prototype.defined=!0;function AT(e,t,n){n&&(e[t]=n)}function hd(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new bk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[e1(r)]=r,n[e1(a.attribute)]=r}return new Fh(t,n,e.space)}const Y3=hd({properties:{ariaActiveDescendant:null,ariaAtomic:In,ariaAutoComplete:null,ariaBusy:In,ariaChecked:In,ariaColCount:Ee,ariaColIndex:Ee,ariaColSpan:Ee,ariaControls:Zt,ariaCurrent:null,ariaDescribedBy:Zt,ariaDetails:null,ariaDisabled:In,ariaDropEffect:Zt,ariaErrorMessage:null,ariaExpanded:In,ariaFlowTo:Zt,ariaGrabbed:In,ariaHasPopup:null,ariaHidden:In,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Zt,ariaLevel:Ee,ariaLive:null,ariaModal:In,ariaMultiLine:In,ariaMultiSelectable:In,ariaOrientation:null,ariaOwns:Zt,ariaPlaceholder:null,ariaPosInSet:Ee,ariaPressed:In,ariaReadOnly:In,ariaRelevant:null,ariaRequired:In,ariaRoleDescription:Zt,ariaRowCount:Ee,ariaRowIndex:Ee,ariaRowSpan:Ee,ariaSelected:In,ariaSetSize:Ee,ariaSort:null,ariaValueMax:Ee,ariaValueMin:Ee,ariaValueNow:Ee,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Z3(e,t){return t in e?e[t]:t}function W3(e,t){return Z3(e,t.toLowerCase())}const zae=hd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ru,acceptCharset:Zt,accessKey:Zt,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:Zt,autoFocus:dt,autoPlay:dt,blocking:Zt,capture:null,charSet:null,checked:dt,cite:null,className:Zt,cols:Ee,colSpan:null,content:null,contentEditable:In,controls:dt,controlsList:Zt,coords:Ee|Ru,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:t1,draggable:In,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:Zt,height:Ee,hidden:t1,high:Ee,href:null,hrefLang:null,htmlFor:Zt,httpEquiv:Zt,id:null,imageSizes:null,imageSrcSet:null,inert:dt,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:Zt,itemRef:Zt,itemScope:dt,itemType:Zt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:Ee,manifest:null,max:null,maxLength:Ee,media:null,method:null,min:null,minLength:Ee,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,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:dt,optimum:Ee,pattern:null,ping:Zt,placeholder:null,playsInline:dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:Zt,required:dt,reversed:dt,rows:Ee,rowSpan:Ee,sandbox:Zt,scope:null,scoped:dt,seamless:dt,selected:dt,shadowRootClonable:dt,shadowRootDelegatesFocus:dt,shadowRootMode:null,shape:null,size:Ee,sizes:null,slot:null,span:Ee,spellCheck:In,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ee,step:null,style:null,tabIndex:Ee,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:In,width:Ee,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Zt,axis:null,background:null,bgColor:null,border:Ee,borderColor:null,bottomMargin:Ee,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ee,leftMargin:Ee,link:null,longDesc:null,lowSrc:null,marginHeight:Ee,marginWidth:Ee,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ee,rules:null,scheme:null,scrolling:In,standby:null,summary:null,text:null,topMargin:Ee,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ee,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:Ee,security:null,unselectable:null},space:"html",transform:W3}),Tae=hd({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:di,accentHeight:Ee,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ee,amplitude:Ee,arabicForm:null,ascent:Ee,attributeName:null,attributeType:null,azimuth:Ee,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ee,by:null,calcMode:null,capHeight:Ee,className:Zt,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:Ee,diffuseConstant:Ee,direction:null,display:null,dur:null,divisor:Ee,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ee,enableBackground:null,end:null,event:null,exponent:Ee,externalResourcesRequired:null,fill:null,fillOpacity:Ee,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:Ru,g2:Ru,glyphName:Ru,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ee,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ee,horizOriginX:Ee,horizOriginY:Ee,id:null,ideographic:Ee,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ee,k:Ee,k1:Ee,k2:Ee,k3:Ee,k4:Ee,kernelMatrix:di,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ee,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:Ee,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:Ee,overlineThickness:Ee,paintOrder:null,panose1:null,path:null,pathLength:Ee,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Zt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ee,pointsAtY:Ee,pointsAtZ:Ee,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:di,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:di,rev:di,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:di,requiredFeatures:di,requiredFonts:di,requiredFormats:di,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:Ee,specularExponent:Ee,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ee,strikethroughThickness:Ee,string:null,stroke:null,strokeDashArray:di,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ee,strokeOpacity:Ee,strokeWidth:null,style:null,surfaceScale:Ee,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:di,tabIndex:Ee,tableValues:null,target:null,targetX:Ee,targetY:Ee,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:di,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ee,underlineThickness:Ee,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ee,values:null,vAlphabetic:Ee,vMathematical:Ee,vectorEffect:null,vHanging:Ee,vIdeographic:Ee,version:null,vertAdvY:Ee,vertOriginX:Ee,vertOriginY:Ee,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ee,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Z3}),X3=hd({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()}}),J3=hd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:W3}),e$=hd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Pae={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"},Rae=/[A-Z]/g,OT=/-[a-z]/g,Dae=/^data[-\w.:]+$/i;function Mae(e,t){const n=e1(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"&&Dae.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(OT,Lae);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!OT.test(a)){let o=a.replace(Rae,Iae);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=bk}return new i(r,t)}function Iae(e){return"-"+e.toLowerCase()}function Lae(e){return e.charAt(1).toUpperCase()}const $ae=Q3([Y3,zae,X3,J3,e$],"html"),wk=Q3([Y3,Tae,X3,J3,e$],"svg");function Bae(e){return e.join(" ").trim()}var su={},Ow,ET;function Uae(){if(ET)return Ow;ET=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
|
|
98
|
+
`,f="/",p="*",m="",y="comment",v="declaration";function w(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 O(X){var W=X.match(t);W&&(E+=W.length);var H=X.lastIndexOf(d);C=~H?X.length-H:C+X.length}function _(){var X={line:E,column:C};return function(W){return W.position=new A(X),$(),W}}function A(X){this.start=X,this.end={line:E,column:C},this.source=k.source}A.prototype.content=j;function z(X){var W=new Error(k.source+":"+E+":"+C+": "+X);if(W.reason=X,W.filename=k.source,W.line=E,W.column=C,W.source=j,!k.silent)throw W}function R(X){var W=X.exec(j);if(W){var H=W[0];return O(H),j=j.slice(H.length),W}}function $(){R(n)}function F(X){var W;for(X=X||[];W=U();)W!==!1&&X.push(W);return X}function U(){var X=_();if(!(f!=j.charAt(0)||p!=j.charAt(1))){for(var W=2;m!=j.charAt(W)&&(p!=j.charAt(W)||f!=j.charAt(W+1));)++W;if(W+=2,m===j.charAt(W-1))return z("End of comment missing");var H=j.slice(2,W-2);return C+=2,O(H),j=j.slice(W),C+=2,X({type:y,comment:H})}}function B(){var X=_(),W=R(r);if(W){if(U(),!R(i))return z("property missing ':'");var H=R(a),J=X({type:v,property:b(W[0].replace(e,m)),value:H?b(H[0].replace(e,m)):m});return R(o),J}}function V(){var X=[];F(X);for(var W;W=B();)W!==!1&&(X.push(W),F(X));return X}return $(),V()}function b(j){return j?j.replace(u,m):m}return Ow=w,Ow}var _T;function qae(){if(_T)return su;_T=1;var e=su&&su.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(su,"__esModule",{value:!0}),su.default=n;const t=e(Uae());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),u=typeof i=="function";return o.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 su}var Ef={},zT;function Fae(){if(zT)return Ef;zT=1,Object.defineProperty(Ef,"__esModule",{value:!0}),Ef.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)},o=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,o))};return Ef.camelCase=d,Ef}var _f,TT;function Hae(){if(TT)return _f;TT=1;var e=_f&&_f.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(qae()),n=Fae();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(u,d){u&&d&&(o[(0,n.camelCase)(u,a)]=d)}),o}return r.default=r,_f=r,_f}var Kae=Hae();const Gae=ha(Kae),t$=n$("end"),Sk=n$("start");function n$(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 Vae(e){const t=Sk(e),n=t$(e);if(t&&n)return{start:t,end:n}}function th(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?PT(e.position):"start"in e||"end"in e?PT(e):"line"in e||"column"in e?r1(e):""}function r1(e){return RT(e&&e.line)+":"+RT(e&&e.column)}function PT(e){return r1(e&&e.start)+"-"+r1(e&&e.end)}function RT(e){return e&&typeof e=="number"?e:1}class wr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!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&&(o=!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=th(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=o&&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}}wr.prototype.file="";wr.prototype.name="";wr.prototype.reason="";wr.prototype.message="";wr.prototype.stack="";wr.prototype.column=void 0;wr.prototype.line=void 0;wr.prototype.ancestors=void 0;wr.prototype.cause=void 0;wr.prototype.fatal=void 0;wr.prototype.place=void 0;wr.prototype.ruleId=void 0;wr.prototype.source=void 0;const jk={}.hasOwnProperty,Qae=new Map,Yae=/[A-Z]/g,Zae=new Set(["table","tbody","thead","tfoot","tr"]),Wae=new Set(["td","th"]),r$="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Xae(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=sse(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=ase(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"?wk:$ae,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=i$(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function i$(e,t,n){if(t.type==="element")return Jae(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ese(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return nse(e,t,n);if(t.type==="mdxjsEsm")return tse(e,t);if(t.type==="root")return rse(e,t,n);if(t.type==="text")return ise(e,t)}function Jae(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=wk,e.schema=i),e.ancestors.push(t);const a=s$(e,t.tagName,!1),o=ose(e,t);let u=kk(e,t);return Zae.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!Eae(d):!0})),a$(e,o,a,t),Nk(o,u),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ese(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)}xh(e,t.position)}function tse(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);xh(e,t.position)}function nse(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=wk,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:s$(e,t.name,!0),o=lse(e,t),u=kk(e,t);return a$(e,o,a,t),Nk(o,u),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function rse(e,t,n){const r={};return Nk(r,kk(e,t)),e.create(t,e.Fragment,r,n)}function ise(e,t){return t.value}function a$(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Nk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function ase(e,t,n){return r;function r(i,a,o,u){const f=Array.isArray(o.children)?n:t;return u?f(a,o,u):f(a,o)}}function sse(e,t){return n;function n(r,i,a,o){const u=Array.isArray(a.children),d=Sk(r);return t(i,a,o,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function ose(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&jk.call(t.properties,i)){const a=cse(e,i,t.properties[i]);if(a){const[o,u]=a;e.tableCellAlignToStyle&&o==="align"&&typeof u=="string"&&Wae.has(t.tagName)?r=u:n[o]=u}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function lse(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 o=a.expression;o.type;const u=o.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else xh(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 xh(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function kk(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Qae;for(;++r<t.children.length;){const a=t.children[r];let o;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;o=d+"-"+f,i.set(d,f+1)}}const u=i$(e,a,o);u!==void 0&&n.push(u)}return n}function cse(e,t,n){const r=Mae(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Nae(n):Bae(n)),r.property==="style"){let i=typeof n=="object"?n:use(e,String(n));return e.stylePropertyNameCase==="css"&&(i=dse(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Pae[r.property]||r.property:r.attribute,n]}}function use(e,t){try{return Gae(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new wr("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=r$+"#cannot-parse-style-attribute",i}}function s$(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const u=kT(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=o}else r=kT(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return jk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);xh(e)}function xh(e,t){const n=new wr("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=r$+"#cannot-handle-mdx-estrees-without-createevaluater",n}function dse(e){const t={};let n;for(n in e)jk.call(e,n)&&(t[fse(n)]=e[n]);return t}function fse(e){let t=e.replace(Yae,hse);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function hse(e){return"-"+e.toLowerCase()}const Ew={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"]},pse={};function mse(e,t){const n=pse,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return o$(e,r,i)}function o$(e,t,n){if(gse(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 DT(e.children,t,n)}return Array.isArray(e)?DT(e,t,n):""}function DT(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=o$(e[i],t,n);return r.join("")}function gse(e){return!!(e&&typeof e=="object")}const MT=document.createElement("i");function Ck(e){const t="&"+e+";";MT.innerHTML=t;const n=MT.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function La(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Li(e,t){return e.length>0?(La(e,e.length,0,t),e):t}const IT={}.hasOwnProperty;function yse(e){const t={};let n=-1;for(;++n<e.length;)vse(t,e[n]);return t}function vse(e,t){let n;for(n in t){const i=(IT.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){IT.call(i,o)||(i[o]=[]);const u=a[o];xse(i[o],Array.isArray(u)?u:u?[u]:[])}}}function xse(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);La(e,0,0,r)}function l$(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 Du(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Pa=Go(/[A-Za-z]/),hi=Go(/[\dA-Za-z]/),bse=Go(/[#-'*+\--9=?A-Z^-~]/);function i1(e){return e!==null&&(e<32||e===127)}const a1=Go(/\d/),wse=Go(/[\dA-Fa-f]/),Sse=Go(/[!-/:-@[-`{-~]/);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 jse=Go(new RegExp("\\p{P}|\\p{S}","u")),Nse=Go(/\s/);function Go(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function pd(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&hi(e.charCodeAt(n+1))&&hi(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(o=String.fromCharCode(a,u),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Xt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(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 kse={tokenize:Cse};function Cse(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"),Xt(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,o(u)}function o(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),o)}}const Ase={tokenize:Ose},LT={tokenize:Ese};function Ose(e){const t=this,n=[];let r=0,i,a,o;return u;function u(C){if(r<n.length){const O=n[r];return t.containerState=O[1],e.attempt(O[0].continuation,d,f)(C)}return f(C)}function d(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const O=t.events.length;let _=O,A;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){A=t.events[_][1].end;break}k(r);let z=O;for(;z<t.events.length;)t.events[z][1].end={...A},z++;return La(t.events,_+1,0,t.events.slice(O)),t.events.length=z,f(C)}return u(C)}function f(C){if(r===n.length){if(!i)return y(C);if(i.currentConstruct&&i.currentConstruct.concrete)return w(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(LT,p,m)(C)}function p(C){return i&&E(),k(r),y(C)}function m(C){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,w(C)}function y(C){return t.containerState={},e.attempt(LT,v,w)(C)}function v(C){return r++,n.push([t.currentConstruct,t.containerState]),y(C)}function w(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,O){const _=t.sliceStream(C);if(O&&_.push(null),C.previous=a,a&&(a.next=C),a=C,i.defineSkip(C.start),i.write(_),t.parser.lazy[C.start.line]){let A=i.events.length;for(;A--;)if(i.events[A][1].start.offset<o&&(!i.events[A][1].end||i.events[A][1].end.offset>o))return;const z=t.events.length;let R=z,$,F;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if($){F=t.events[R][1].end;break}$=!0}for(k(r),A=z;A<t.events.length;)t.events[A][1].end={...F},A++;La(t.events,R+1,0,t.events.slice(z)),t.events.length=A}}function k(C){let O=n.length;for(;O-- >C;){const _=n[O];t.containerState=_[1],_[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 Ese(e,t,n){return Xt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function $T(e){if(e===null||Xr(e)||Nse(e))return 1;if(jse(e))return 2}function Ak(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 s1={name:"attention",resolveAll:_se,tokenize:zse};function _se(e,t){let n=-1,r,i,a,o,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},y={...e[n][1].start};BT(m,-d),BT(y,d),o={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...o.start},end:{...u.end}},e[r][1].end={...o.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",o,t],["exit",o,t],["enter",a,t]]),f=Li(f,Ak(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,La(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 zse(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=$T(r);let a;return o;function o(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=$T(d),m=!p||p===2&&i||n.includes(d),y=!i||i===2&&p||n.includes(r);return f._open=!!(a===42?m:m&&(i||!y)),f._close=!!(a===42?y:y&&(p||!m)),t(d)}}function BT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Tse={name:"autolink",tokenize:Pse};function Pse(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 Pa(v)?(e.consume(v),o):v===64?n(v):f(v)}function o(v){return v===43||v===45||v===46||hi(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||hi(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||i1(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):bse(v)?(e.consume(v),f):n(v)}function p(v){return hi(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):y(v)}function y(v){if((v===45||hi(v))&&r++<63){const w=v===45?y:m;return e.consume(v),w}return n(v)}}const Pv={partial:!0,tokenize:Rse};function Rse(e,t,n){return r;function r(a){return Pt(a)?Xt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||et(a)?t(a):n(a)}}const c$={continuation:{tokenize:Mse},exit:Ise,name:"blockQuote",tokenize:Dse};function Dse(e,t,n){const r=this;return i;function i(o){if(o===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return Pt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Mse(e,t,n){const r=this;return i;function i(o){return Pt(o)?Xt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(c$,t,n)(o)}}function Ise(e){e.exit("blockQuote")}const u$={name:"characterEscape",tokenize:Lse};function Lse(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 Sse(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const d$={name:"characterReference",tokenize:$se};function $se(e,t,n){const r=this;let i=0,a,o;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,o=hi,p(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=wse,p):(e.enter("characterReferenceValue"),a=7,o=a1,p(m))}function p(m){if(m===59&&i){const y=e.exit("characterReferenceValue");return o===hi&&!Ck(r.sliceSerialize(y))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(m)&&i++<a?(e.consume(m),p):n(m)}}const UT={partial:!0,tokenize:Use},qT={concrete:!0,name:"codeFenced",tokenize:Bse};function Bse(e,t,n){const r=this,i={partial:!0,tokenize:_};let a=0,o=0,u;return d;function d(A){return f(A)}function f(A){const z=r.events[r.events.length-1];return a=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,u=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(A)}function p(A){return A===u?(o++,e.consume(A),p):o<3?n(A):(e.exit("codeFencedFenceSequence"),Pt(A)?Xt(e,m,"whitespace")(A):m(A))}function m(A){return A===null||et(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(UT,b,O)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(A))}function y(A){return A===null||et(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(A)):Pt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Xt(e,v,"whitespace")(A)):A===96&&A===u?n(A):(e.consume(A),y)}function v(A){return A===null||et(A)?m(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(A))}function w(A){return A===null||et(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(A)):A===96&&A===u?n(A):(e.consume(A),w)}function b(A){return e.attempt(i,O,j)(A)}function j(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),k}function k(A){return a>0&&Pt(A)?Xt(e,E,"linePrefix",a+1)(A):E(A)}function E(A){return A===null||et(A)?e.check(UT,b,O)(A):(e.enter("codeFlowValue"),C(A))}function C(A){return A===null||et(A)?(e.exit("codeFlowValue"),E(A)):(e.consume(A),C)}function O(A){return e.exit("codeFenced"),t(A)}function _(A,z,R){let $=0;return F;function F(W){return A.enter("lineEnding"),A.consume(W),A.exit("lineEnding"),U}function U(W){return A.enter("codeFencedFence"),Pt(W)?Xt(A,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):B(W)}function B(W){return W===u?(A.enter("codeFencedFenceSequence"),V(W)):R(W)}function V(W){return W===u?($++,A.consume(W),V):$>=o?(A.exit("codeFencedFenceSequence"),Pt(W)?Xt(A,X,"whitespace")(W):X(W)):R(W)}function X(W){return W===null||et(W)?(A.exit("codeFencedFence"),z(W)):R(W)}}}function Use(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const _w={name:"codeIndented",tokenize:Fse},qse={partial:!0,tokenize:Hse};function Fse(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Xt(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?o(f):n(f)}function o(f){return f===null?d(f):et(f)?e.attempt(qse,o,d)(f):(e.enter("codeFlowValue"),u(f))}function u(f){return f===null||et(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),u)}function d(f){return e.exit("codeIndented"),t(f)}}function Hse(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):et(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Xt(e,a,"linePrefix",5)(o)}function a(o){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(o):et(o)?i(o):n(o)}}const Kse={name:"codeText",previous:Vse,resolve:Gse,tokenize:Qse};function Gse(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 Vse(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Qse(e,t,n){let r=0,i,a;return o;function o(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 Yse{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&&zf(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),zf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),zf(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);zf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);zf(this.left,n.reverse())}}}function zf(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 f$(e){const t={};let n=-1,r,i,a,o,u,d,f;const p=new Yse(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,Zse(p,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=p.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[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 La(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function Zse(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const u=o.events,d=[],f={};let p,m,y=-1,v=n,w=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&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(p),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++y<u.length;)u[y][0]==="exit"&&u[y-1][0]==="enter"&&u[y][1].type===u[y-1][1].type&&u[y][1].start.line!==u[y][1].end.line&&(b=y+1,j.push(b),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(o.events=[],v?(v._tokenizer=void 0,v.previous=void 0):j.pop(),y=j.length;y--;){const k=u.slice(j[y],j[y+1]),E=a.pop();d.push([E,E+k.length-1]),e.splice(E,2,k)}for(d.reverse(),y=-1;++y<d.length;)f[w+d[y][0]]=w+d[y][1],w+=d[y][1]-d[y][0]-1;return f}const Wse={resolve:Jse,tokenize:eoe},Xse={partial:!0,tokenize:toe};function Jse(e){return f$(e),e}function eoe(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(Xse,o,a)(u):(e.consume(u),i)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function o(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function toe(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Xt(e,a,"linePrefix")}function a(o){if(o===null||et(o))return n(o);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(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function h$(e,t,n,r,i,a,o,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),y):k===null||k===32||k===41||i1(k)?n(k):(e.enter(r),e.enter(o),e.enter(u),e.enter("chunkString",{contentType:"string"}),b(k))}function y(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),y(k)):k===null||k===60||et(k)?n(k):(e.consume(k),k===92?w:v)}function w(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(o),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||i1(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 p$(e,t,n,r,i,a){const o=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 o.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?y:m)}function y(v){return v===91||v===92||v===93?(e.consume(v),u++,m):m(v)}}function m$(e,t,n,r,i,a){let o;return u;function u(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),o=y===40?41:y,d):n(y)}function d(y){return y===o?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(a),f(y))}function f(y){return y===o?(e.exit(a),d(o)):y===null?n(y):et(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Xt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===o||y===null||et(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?m:p)}function m(y){return y===o||y===92?(e.consume(y),p):p(y)}}function nh(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)?Xt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const noe={name:"definition",tokenize:ioe},roe={partial:!0,tokenize:aoe};function ioe(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return p$.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function u(v){return i=Du(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)?nh(e,f)(v):f(v)}function f(v){return h$(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(roe,m,m)(v)}function m(v){return Pt(v)?Xt(e,y,"whitespace")(v):y(v)}function y(v){return v===null||et(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function aoe(e,t,n){return r;function r(u){return Xr(u)?nh(e,i)(u):n(u)}function i(u){return m$(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return Pt(u)?Xt(e,o,"whitespace")(u):o(u)}function o(u){return u===null||et(u)?t(u):n(u)}}const soe={name:"hardBreakEscape",tokenize:ooe};function ooe(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 loe={name:"headingAtx",resolve:coe,tokenize:uoe};function coe(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"},La(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function uoe(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):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)?Xt(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 doe=["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"],FT=["pre","script","style","textarea"],foe={concrete:!0,name:"htmlFlow",resolveTo:moe,tokenize:goe},hoe={partial:!0,tokenize:voe},poe={partial:!0,tokenize:yoe};function moe(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 goe(e,t,n){const r=this;let i,a,o,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),y):D===47?(e.consume(D),a=!0,b):D===63?(e.consume(D),i=3,r.interrupt?t:M):Pa(D)?(e.consume(D),o=String.fromCharCode(D),j):n(D)}function y(D){return D===45?(e.consume(D),i=2,v):D===91?(e.consume(D),i=5,u=0,w):Pa(D)?(e.consume(D),i=4,r.interrupt?t:M):n(D)}function v(D){return D===45?(e.consume(D),r.interrupt?t:M):n(D)}function w(D){const G="CDATA[";return D===G.charCodeAt(u++)?(e.consume(D),u===G.length?r.interrupt?t:B:w):n(D)}function b(D){return Pa(D)?(e.consume(D),o=String.fromCharCode(D),j):n(D)}function j(D){if(D===null||D===47||D===62||Xr(D)){const G=D===47,oe=o.toLowerCase();return!G&&!a&&FT.includes(oe)?(i=1,r.interrupt?t(D):B(D)):doe.includes(o.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||hi(D)?(e.consume(D),o+=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||Pa(D)?(e.consume(D),O):Pt(D)?(e.consume(D),C):F(D)}function O(D){return D===45||D===46||D===58||D===95||hi(D)?(e.consume(D),O):_(D)}function _(D){return D===61?(e.consume(D),A):Pt(D)?(e.consume(D),_):C(D)}function A(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),d=D,z):Pt(D)?(e.consume(D),A):R(D)}function z(D){return D===d?(e.consume(D),d=null,$):D===null||et(D)?n(D):(e.consume(D),z)}function R(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Xr(D)?_(D):(e.consume(D),R)}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),I):D===63&&i===3?(e.consume(D),M):D===93&&i===5?(e.consume(D),xe):et(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(hoe,q,V)(D)):D===null||et(D)?(e.exit("htmlFlowData"),V(D)):(e.consume(D),B)}function V(D){return e.check(poe,X,q)(D)}function X(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),W}function W(D){return D===null||et(D)?V(D):(e.enter("htmlFlowData"),B(D))}function H(D){return D===45?(e.consume(D),M):B(D)}function J(D){return D===47?(e.consume(D),o="",ce):B(D)}function ce(D){if(D===62){const G=o.toLowerCase();return FT.includes(G)?(e.consume(D),I):B(D)}return Pa(D)&&o.length<8?(e.consume(D),o+=String.fromCharCode(D),ce):B(D)}function xe(D){return D===93?(e.consume(D),M):B(D)}function M(D){return D===62?(e.consume(D),I):D===45&&i===2?(e.consume(D),M):B(D)}function I(D){return D===null||et(D)?(e.exit("htmlFlowData"),q(D)):(e.consume(D),I)}function q(D){return e.exit("htmlFlow"),t(D)}}function yoe(e,t,n){const r=this;return i;function i(o){return et(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function voe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Pv,t,n)}}const xoe={name:"htmlText",tokenize:boe};function boe(e,t,n){const r=this;let i,a,o;return u;function u(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),d}function d(M){return M===33?(e.consume(M),f):M===47?(e.consume(M),_):M===63?(e.consume(M),C):Pa(M)?(e.consume(M),R):n(M)}function f(M){return M===45?(e.consume(M),p):M===91?(e.consume(M),a=0,w):Pa(M)?(e.consume(M),E):n(M)}function p(M){return M===45?(e.consume(M),v):n(M)}function m(M){return M===null?n(M):M===45?(e.consume(M),y):et(M)?(o=m,J(M)):(e.consume(M),m)}function y(M){return M===45?(e.consume(M),v):m(M)}function v(M){return M===62?H(M):M===45?y(M):m(M)}function w(M){const I="CDATA[";return M===I.charCodeAt(a++)?(e.consume(M),a===I.length?b:w):n(M)}function b(M){return M===null?n(M):M===93?(e.consume(M),j):et(M)?(o=b,J(M)):(e.consume(M),b)}function j(M){return M===93?(e.consume(M),k):b(M)}function k(M){return M===62?H(M):M===93?(e.consume(M),k):b(M)}function E(M){return M===null||M===62?H(M):et(M)?(o=E,J(M)):(e.consume(M),E)}function C(M){return M===null?n(M):M===63?(e.consume(M),O):et(M)?(o=C,J(M)):(e.consume(M),C)}function O(M){return M===62?H(M):C(M)}function _(M){return Pa(M)?(e.consume(M),A):n(M)}function A(M){return M===45||hi(M)?(e.consume(M),A):z(M)}function z(M){return et(M)?(o=z,J(M)):Pt(M)?(e.consume(M),z):H(M)}function R(M){return M===45||hi(M)?(e.consume(M),R):M===47||M===62||Xr(M)?$(M):n(M)}function $(M){return M===47?(e.consume(M),H):M===58||M===95||Pa(M)?(e.consume(M),F):et(M)?(o=$,J(M)):Pt(M)?(e.consume(M),$):H(M)}function F(M){return M===45||M===46||M===58||M===95||hi(M)?(e.consume(M),F):U(M)}function U(M){return M===61?(e.consume(M),B):et(M)?(o=U,J(M)):Pt(M)?(e.consume(M),U):$(M)}function B(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),i=M,V):et(M)?(o=B,J(M)):Pt(M)?(e.consume(M),B):(e.consume(M),X)}function V(M){return M===i?(e.consume(M),i=void 0,W):M===null?n(M):et(M)?(o=V,J(M)):(e.consume(M),V)}function X(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||Xr(M)?$(M):(e.consume(M),X)}function W(M){return M===47||M===62||Xr(M)?$(M):n(M)}function H(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function J(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),ce}function ce(M){return Pt(M)?Xt(e,xe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):xe(M)}function xe(M){return e.enter("htmlTextData"),o(M)}}const Ok={name:"labelEnd",resolveAll:Noe,resolveTo:koe,tokenize:Coe},woe={tokenize:Aoe},Soe={tokenize:Ooe},joe={tokenize:Eoe};function Noe(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&&La(e,0,e.length,n),e}function koe(e,t){let n=e.length,r=0,i,a,o,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(o){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"&&(o=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[o][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-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,Ak(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),u=Li(u,[["exit",p,t],e[o-2],e[o-1],["exit",f,t]]),u=Li(u,e.slice(o+1)),u=Li(u,[["exit",d,t]]),La(e,a,e.length,u),e}function Coe(e,t,n){const r=this;let i=r.events.length,a,o;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(y){return a?a._inactive?m(y):(o=r.parser.defined.includes(Du(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(woe,p,o?p:m)(y):y===91?e.attempt(Soe,p,o?f:m)(y):o?p(y):m(y)}function f(y){return e.attempt(joe,p,m)(y)}function p(y){return t(y)}function m(y){return a._balanced=!0,n(y)}}function Aoe(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)?nh(e,a)(m):a(m)}function a(m){return m===41?p(m):h$(e,o,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return Xr(m)?nh(e,d)(m):p(m)}function u(m){return n(m)}function d(m){return m===34||m===39||m===40?m$(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return Xr(m)?nh(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 Ooe(e,t,n){const r=this;return i;function i(u){return p$.call(r,e,a,o,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(Du(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function o(u){return n(u)}}function Eoe(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 _oe={name:"labelStartImage",resolveAll:Ok.resolveAll,tokenize:zoe};function zoe(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"),o):n(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const Toe={name:"labelStartLink",resolveAll:Ok.resolveAll,tokenize:Poe};function Poe(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const zw={name:"lineEnding",tokenize:Roe};function Roe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Xt(e,t,"linePrefix")}}const Cg={name:"thematicBreak",tokenize:Doe};function Doe(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),o(f)}function o(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)?Xt(e,u,"whitespace")(f):u(f))}}const Gr={continuation:{tokenize:$oe},exit:Uoe,name:"list",tokenize:Loe},Moe={partial:!0,tokenize:qoe},Ioe={partial:!0,tokenize:Boe};function Loe(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,o=0;return u;function u(v){const w=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:a1(v)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Cg,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 a1(v)&&++o<10?(e.consume(v),d):(!r.interrupt||o<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(Pv,r.interrupt?n:p,e.attempt(Moe,y,m))}function p(v){return r.containerState.initialBlankLine=!0,a++,y(v)}function m(v){return Pt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):n(v)}function y(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function $oe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Pv,i,a);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Xt(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,o(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ioe,t,o)(u))}function o(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Xt(e,e.attempt(Gr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function Boe(e,t,n){const r=this;return Xt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function Uoe(e){e.exit(this.containerState.type)}function qoe(e,t,n){const r=this;return Xt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!Pt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const HT={name:"setextUnderline",resolveTo:Foe,tokenize:Hoe};function Foe(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 o={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",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Hoe(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,o(f)):n(f)}function o(f){return e.enter("setextHeadingLineSequence"),u(f)}function u(f){return f===i?(e.consume(f),u):(e.exit("setextHeadingLineSequence"),Pt(f)?Xt(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||et(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const Koe={tokenize:Goe};function Goe(e){const t=this,n=e.attempt(Pv,r,e.attempt(this.parser.constructs.flowInitial,i,Xt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Wse,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 Voe={resolveAll:y$()},Qoe=g$("string"),Yoe=g$("text");function g$(e){return{resolveAll:y$(e==="text"?Zoe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,u);return o;function o(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 y=-1;if(m)for(;++y<m.length;){const v=m[y];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function y$(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 Zoe(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,o=-1,u=0,d;for(;a--;){const f=i[a];if(typeof f=="string"){for(o=f.length;f.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-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?o:r.start._bufferIndex+o,_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 Woe={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:c$},Xoe={91:noe},Joe={[-2]:_w,[-1]:_w,32:_w},ele={35:loe,42:Cg,45:[HT,Cg],60:foe,61:HT,95:Cg,96:qT,126:qT},tle={38:d$,92:u$},nle={[-5]:zw,[-4]:zw,[-3]:zw,33:_oe,38:d$,42:s1,60:[Tse,xoe],91:Toe,92:[soe,u$],93:Ok,95:s1,96:Kse},rle={null:[s1,Voe]},ile={null:[42,95]},ale={null:[]},sle=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ile,contentInitial:Xoe,disable:ale,document:Woe,flow:ele,flowInitial:Joe,insideSpan:rle,string:tle,text:nle},Symbol.toStringTag,{value:"Module"}));function ole(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 o=[],u=[];const d={attempt:z(_),check:z(A),consume:E,enter:C,exit:O,interrupt:z(A,{interrupt:!0})},f={code:null,containerState:{},defineSkip:b,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:m};let p=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function m(U){return o=Li(o,U),j(),o[o.length-1]!==null?[]:(R(t,0),f.events=Ak(a,f.events,f),f.events)}function y(U,B){return cle(v(U),B)}function v(U){return lle(o,U)}function w(){const{_bufferIndex:U,_index:B,line:V,column:X,offset:W}=r;return{_bufferIndex:U,_index:B,line:V,column:X,offset:W}}function b(U){i[U.line]=U.column,F()}function j(){let U;for(;r._index<o.length;){const B=o[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===o[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=U}function C(U,B){const V=B||{};return V.type=U,V.start=w(),f.events.push(["enter",V,f]),u.push(V),V}function O(U){const B=u.pop();return B.end=w(),f.events.push(["exit",B,f]),B}function _(U,B){R(U,B.from)}function A(U,B){B.restore()}function z(U,B){return V;function V(X,W,H){let J,ce,xe,M;return Array.isArray(X)?q(X):"tokenize"in X?q([X]):I(X);function I(ne){return Ae;function Ae(we){const ee=we!==null&&ne[we],he=we!==null&&ne.null,_e=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(he)?he:he?[he]:[]];return q(_e)(we)}}function q(ne){return J=ne,ce=0,ne.length===0?H:D(ne[ce])}function D(ne){return Ae;function Ae(we){return M=$(),xe=ne,ne.partial||(f.currentConstruct=ne),ne.name&&f.parser.constructs.disable.null.includes(ne.name)?oe():ne.tokenize.call(B?Object.assign(Object.create(f),B):f,d,G,oe)(we)}}function G(ne){return U(xe,M),W}function oe(ne){return M.restore(),++ce<J.length?D(J[ce]):H}}}function R(U,B){U.resolveAll&&!a.includes(U)&&a.push(U),U.resolve&&La(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=w(),B=f.previous,V=f.currentConstruct,X=f.events.length,W=Array.from(u);return{from:X,restore:H};function H(){r=U,f.previous=B,f.currentConstruct=V,f.events.length=X,u=W,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function lle(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const u=o[0];typeof u=="string"?o[0]=u.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function cle(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
|
|
99
|
+
`;break}case-3:{o=`\r
|
|
100
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}function ule(e){const r={constructs:yse([sle,...(e||{}).extensions||[]]),content:i(kse),defined:[],document:i(Ase),flow:i(Koe),lazy:{},string:i(Qoe),text:i(Yoe)};return r;function i(a){return o;function o(u){return ole(r,a,u)}}}function dle(e){for(;!f$(e););return e}const KT=/[\0\t\n\r]/g;function fle(){let e=1,t="",n=!0,r;return i;function i(a,o,u){const d=[];let f,p,m,y,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(KT.lastIndex=m,f=KT.exec(a),y=f&&f.index!==void 0?f.index:a.length,v=a.charCodeAt(y),!f){t=a.slice(m);break}if(v===10&&m===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<y&&(d.push(a.slice(m,y)),e+=y-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=y+1}return u&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const hle=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ple(e){return e.replace(hle,mle)}function mle(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return l$(n.slice(a?2:1),a?16:10)}return Ck(n)||e}const v$={}.hasOwnProperty;function gle(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),yle(n)(dle(ule(n).document().write(fle()(e,t,!0))))}function yle(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(on),autolinkProtocol:$,autolinkEmail:$,atxHeading:a(st),blockQuote:a(he),characterEscape:$,characterReference:$,codeFenced:a(_e),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(_e,o),codeText:a(Z,o),codeTextData:$,data:$,codeFlowValue:$,definition:a(Fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Re),hardBreakEscape:a(Ke),hardBreakTrailing:a(Ke),htmlFlow:a(Kt,o),htmlFlowData:$,htmlText:a(Kt,o),htmlTextData:$,image:a(Bt),label:o,link:a(on),listItem:a(be),listItemValue:y,listOrdered:a(en,m),listUnordered:a(en),paragraph:a(Ze),reference:D,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(st),strong:a(Dt),thematicBreak:a(We)},exit:{atxHeading:d(),atxHeadingSequence:_,autolink:d(),autolinkEmail:ee,autolinkProtocol:we,blockQuote:d(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:ne,characterReference:Ae,codeFenced:d(j),codeFencedFence:b,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:F,codeIndented:d(k),codeText:d(W),codeTextData:F,data:F,definition:d(),definitionDestinationString:O,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:xe,labelText:ce,lineEnding:U,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:G,resourceDestinationString:M,resourceTitleString:I,resource:q,setextHeading:d(R),setextHeadingLineSequence:z,setextHeadingText:A,strong:d(),thematicBreak:d()}};x$(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ue){let je={type:"root",children:[]};const Ie={stack:[je],tokenStack:[],config:t,enter:u,exit:f,buffer:o,resume:p,data:n},Ve=[];let ct=-1;for(;++ct<ue.length;)if(ue[ct][1].type==="listOrdered"||ue[ct][1].type==="listUnordered")if(ue[ct][0]==="enter")Ve.push(ct);else{const fn=Ve.pop();ct=i(ue,fn,ct)}for(ct=-1;++ct<ue.length;){const fn=t[ue[ct][0]];v$.call(fn,ue[ct][1].type)&&fn[ue[ct][1].type].call(Object.assign({sliceSerialize:ue[ct][2].sliceSerialize},Ie),ue[ct][1])}if(Ie.tokenStack.length>0){const fn=Ie.tokenStack[Ie.tokenStack.length-1];(fn[1]||GT).call(Ie,void 0,fn[0])}for(je.position={start:po(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:po(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},ct=-1;++ct<t.transforms.length;)je=t.transforms[ct](je)||je;return je}function i(ue,je,Ie){let Ve=je-1,ct=-1,fn=!1,Vn,xn,Qe,kn;for(;++Ve<=Ie;){const Xe=ue[Ve];switch(Xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xe[0]==="enter"?ct++:ct--,kn=void 0;break}case"lineEndingBlank":{Xe[0]==="enter"&&(Vn&&!kn&&!ct&&!Qe&&(Qe=Ve),kn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:kn=void 0}if(!ct&&Xe[0]==="enter"&&Xe[1].type==="listItemPrefix"||ct===-1&&Xe[0]==="exit"&&(Xe[1].type==="listUnordered"||Xe[1].type==="listOrdered")){if(Vn){let ot=Ve;for(xn=void 0;ot--;){const ke=ue[ot];if(ke[1].type==="lineEnding"||ke[1].type==="lineEndingBlank"){if(ke[0]==="exit")continue;xn&&(ue[xn][1].type="lineEndingBlank",fn=!0),ke[1].type="lineEnding",xn=ot}else if(!(ke[1].type==="linePrefix"||ke[1].type==="blockQuotePrefix"||ke[1].type==="blockQuotePrefixWhitespace"||ke[1].type==="blockQuoteMarker"||ke[1].type==="listItemIndent"))break}Qe&&(!xn||Qe<xn)&&(Vn._spread=!0),Vn.end=Object.assign({},xn?ue[xn][1].start:Xe[1].end),ue.splice(xn||Ve,0,["exit",Vn,Xe[2]]),Ve++,Ie++}if(Xe[1].type==="listItemPrefix"){const ot={type:"listItem",_spread:!1,start:Object.assign({},Xe[1].start),end:void 0};Vn=ot,ue.splice(Ve,0,["enter",ot,Xe[2]]),Ve++,Ie++,Qe=void 0,kn=!0}}}return ue[je][1]._spread=fn,Ie}function a(ue,je){return Ie;function Ie(Ve){u.call(this,ue(Ve),Ve),je&&je.call(this,Ve)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(ue,je,Ie){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([je,Ie||void 0]),ue.position={start:po(je.start),end:void 0}}function d(ue){return je;function je(Ie){ue&&ue.call(this,Ie),f.call(this,Ie)}}function f(ue,je){const Ie=this.stack.pop(),Ve=this.tokenStack.pop();if(Ve)Ve[0].type!==ue.type&&(je?je.call(this,ue,Ve[0]):(Ve[1]||GT).call(this,ue,Ve[0]));else throw new Error("Cannot close `"+ue.type+"` ("+th({start:ue.start,end:ue.end})+"): it’s not open");Ie.position.end=po(ue.end)}function p(){return mse(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(ue){if(this.data.expectingFirstListItemValue){const je=this.stack[this.stack.length-2];je.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ue=this.resume(),je=this.stack[this.stack.length-1];je.lang=ue}function w(){const ue=this.resume(),je=this.stack[this.stack.length-1];je.meta=ue}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const ue=this.resume(),je=this.stack[this.stack.length-1];je.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ue=this.resume(),je=this.stack[this.stack.length-1];je.value=ue.replace(/(\r?\n|\r)$/g,"")}function E(ue){const je=this.resume(),Ie=this.stack[this.stack.length-1];Ie.label=je,Ie.identifier=Du(this.sliceSerialize(ue)).toLowerCase()}function C(){const ue=this.resume(),je=this.stack[this.stack.length-1];je.title=ue}function O(){const ue=this.resume(),je=this.stack[this.stack.length-1];je.url=ue}function _(ue){const je=this.stack[this.stack.length-1];if(!je.depth){const Ie=this.sliceSerialize(ue).length;je.depth=Ie}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function z(ue){const je=this.stack[this.stack.length-1];je.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function $(ue){const Ie=this.stack[this.stack.length-1].children;let Ve=Ie[Ie.length-1];(!Ve||Ve.type!=="text")&&(Ve=yt(),Ve.position={start:po(ue.start),end:void 0},Ie.push(Ve)),this.stack.push(Ve)}function F(ue){const je=this.stack.pop();je.value+=this.sliceSerialize(ue),je.position.end=po(ue.end)}function U(ue){const je=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ie=je.children[je.children.length-1];Ie.position.end=po(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(je.type)&&($.call(this,ue),F.call(this,ue))}function B(){this.data.atHardBreak=!0}function V(){const ue=this.resume(),je=this.stack[this.stack.length-1];je.value=ue}function X(){const ue=this.resume(),je=this.stack[this.stack.length-1];je.value=ue}function W(){const ue=this.resume(),je=this.stack[this.stack.length-1];je.value=ue}function H(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const je=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=je,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function J(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const je=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=je,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function ce(ue){const je=this.sliceSerialize(ue),Ie=this.stack[this.stack.length-2];Ie.label=ple(je),Ie.identifier=Du(je).toLowerCase()}function xe(){const ue=this.stack[this.stack.length-1],je=this.resume(),Ie=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ie.type==="link"){const Ve=ue.children;Ie.children=Ve}else Ie.alt=je}function M(){const ue=this.resume(),je=this.stack[this.stack.length-1];je.url=ue}function I(){const ue=this.resume(),je=this.stack[this.stack.length-1];je.title=ue}function q(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function G(ue){const je=this.resume(),Ie=this.stack[this.stack.length-1];Ie.label=je,Ie.identifier=Du(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function oe(ue){this.data.characterReferenceType=ue.type}function ne(ue){const je=this.sliceSerialize(ue),Ie=this.data.characterReferenceType;let Ve;Ie?(Ve=l$(je,Ie==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ve=Ck(je);const ct=this.stack[this.stack.length-1];ct.value+=Ve}function Ae(ue){const je=this.stack.pop();je.position.end=po(ue.end)}function we(ue){F.call(this,ue);const je=this.stack[this.stack.length-1];je.url=this.sliceSerialize(ue)}function ee(ue){F.call(this,ue);const je=this.stack[this.stack.length-1];je.url="mailto:"+this.sliceSerialize(ue)}function he(){return{type:"blockquote",children:[]}}function _e(){return{type:"code",lang:null,meta:null,value:""}}function Z(){return{type:"inlineCode",value:""}}function Fe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Re(){return{type:"emphasis",children:[]}}function st(){return{type:"heading",depth:0,children:[]}}function Ke(){return{type:"break"}}function Kt(){return{type:"html",value:""}}function Bt(){return{type:"image",title:null,url:"",alt:null}}function on(){return{type:"link",title:null,url:"",children:[]}}function en(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function be(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function Ze(){return{type:"paragraph",children:[]}}function Dt(){return{type:"strong",children:[]}}function yt(){return{type:"text",value:""}}function We(){return{type:"thematicBreak"}}}function po(e){return{line:e.line,column:e.column,offset:e.offset}}function x$(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?x$(e,r):vle(e,r)}}function vle(e,t){let n;for(n in t)if(v$.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 GT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+th({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+th({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+th({start:t.start,end:t.end})+") is still open")}function xle(e){const t=this;t.parser=n;function n(r){return gle(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ble(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 wle(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
101
|
+
`}]}function Sle(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 jle(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nle(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kle(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=pd(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=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(o)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function Cle(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 Ale(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function b$(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 o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Ole(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return b$(e,t);const i={src:pd(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 Ele(e,t){const n={src:pd(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 _le(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 zle(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return b$(e,t);const i={href:pd(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 Tle(e,t){const n={href:pd(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 Ple(e,t,n){const r=e.all(t),i=n?Rle(n):w$(t),a={},o=[];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")&&o.push({type:"text",value:`
|
|
103
|
+
`}),p.type==="element"&&p.tagName==="p"&&!i?o.push(...p.children):o.push(p)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
|
|
104
|
+
`});const f={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,f),e.applyData(t,f)}function Rle(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=w$(n[r])}return t}function w$(e){const t=e.spread;return t??e.children.length>1}function Dle(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 o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.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 Mle(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ile(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Lle(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $le(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=Sk(t.children[1]),d=t$(t.children[t.children.length-1]);u&&d&&(o.position={start:u,end:d}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Ble(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,u=o?o.length:t.children.length;let d=-1;const f=[];for(;++d<u;){const m=t.children[d],y={},v=o?o[d]:void 0;v&&(y.align=v);let w={type:"element",tagName:a,properties:y,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),f.push(w)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function Ule(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const VT=9,QT=32;function qle(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(YT(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(YT(t.slice(i),i>0,!1)),a.join("")}function YT(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===VT||a===QT;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===VT||a===QT;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Fle(e,t){const n={type:"text",value:qle(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Hle(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Kle={blockquote:ble,break:wle,code:Sle,delete:jle,emphasis:Nle,footnoteReference:kle,heading:Cle,html:Ale,imageReference:Ole,image:Ele,inlineCode:_le,linkReference:zle,link:Tle,listItem:Ple,list:Dle,paragraph:Mle,root:Ile,strong:Lle,table:$le,tableCell:Ule,tableRow:Ble,text:Fle,thematicBreak:Hle,toml:Um,yaml:Um,definition:Um,footnoteDefinition:Um};function Um(){}const S$=-1,Rv=0,rh=1,oy=2,Ek=3,_k=4,zk=5,Tk=6,j$=7,N$=8,ZT=typeof self=="object"?self:globalThis,Gle=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case Rv:case S$:return n(o,i);case rh:{const u=n([],i);for(const d of o)u.push(r(d));return u}case oy:{const u=n({},i);for(const[d,f]of o)u[r(d)]=r(f);return u}case Ek:return n(new Date(o),i);case _k:{const{source:u,flags:d}=o;return n(new RegExp(u,d),i)}case zk:{const u=n(new Map,i);for(const[d,f]of o)u.set(r(d),r(f));return u}case Tk:{const u=n(new Set,i);for(const d of o)u.add(r(d));return u}case j$:{const{name:u,message:d}=o;return n(new ZT[u](d),i)}case N$:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:u}=new Uint8Array(o);return n(new DataView(u),o)}}return n(new ZT[a](o),i)};return r},WT=e=>Gle(new Map,e)(0),ou="",{toString:Vle}={},{keys:Qle}=Object,Tf=e=>{const t=typeof e;if(t!=="object"||!e)return[Rv,t];const n=Vle.call(e).slice(8,-1);switch(n){case"Array":return[rh,ou];case"Object":return[oy,ou];case"Date":return[Ek,ou];case"RegExp":return[_k,ou];case"Map":return[zk,ou];case"Set":return[Tk,ou];case"DataView":return[rh,n]}return n.includes("Array")?[rh,n]:n.includes("Error")?[j$,n]:[oy,n]},qm=([e,t])=>e===Rv&&(t==="function"||t==="symbol"),Yle=(e,t,n,r)=>{const i=(o,u)=>{const d=r.push(o)-1;return n.set(u,d),d},a=o=>{if(n.has(o))return n.get(o);let[u,d]=Tf(o);switch(u){case Rv:{let p=o;switch(d){case"bigint":u=N$,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([S$],o)}return i([u,p],o)}case rh:{if(d){let y=o;return d==="DataView"?y=new Uint8Array(o.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(o)),i([d,[...y]],o)}const p=[],m=i([u,p],o);for(const y of o)p.push(a(y));return m}case oy:{if(d)switch(d){case"BigInt":return i([d,o.toString()],o);case"Boolean":case"Number":case"String":return i([d,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const p=[],m=i([u,p],o);for(const y of Qle(o))(e||!qm(Tf(o[y])))&&p.push([a(y),a(o[y])]);return m}case Ek:return i([u,o.toISOString()],o);case _k:{const{source:p,flags:m}=o;return i([u,{source:p,flags:m}],o)}case zk:{const p=[],m=i([u,p],o);for(const[y,v]of o)(e||!(qm(Tf(y))||qm(Tf(v))))&&p.push([a(y),a(v)]);return m}case Tk:{const p=[],m=i([u,p],o);for(const y of o)(e||!qm(Tf(y)))&&p.push(a(y));return m}}const{message:f}=o;return i([u,{name:d,message:f}],o)};return a},XT=(e,{json:t,lossy:n}={})=>{const r=[];return Yle(!(t||n),!!t,new Map,r)(e),r},ly=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?WT(XT(e,t)):structuredClone(e):(e,t)=>WT(XT(e,t));function Zle(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 Wle(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Xle(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Zle,r=e.options.footnoteBackLabel||Wle,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=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(),y=pd(m.toLowerCase());let v=0;const w=[],b=e.footnoteCounts.get(m);for(;b!==void 0&&++v<=b;){w.length>0&&w.push({type:"text",value:" "});let E=typeof n=="string"?n:n(d,v);typeof E=="string"&&(E={type:"text",value:E}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(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(...w)}else p.push(...w);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+y},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:{...ly(o),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 k$=(function(e){if(e==null)return nce;if(typeof e=="function")return Dv(e);if(typeof e=="object")return Array.isArray(e)?Jle(e):ece(e);if(typeof e=="string")return tce(e);throw new Error("Expected function, string, or object as test")});function Jle(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=k$(e[n]);return Dv(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function ece(e){const t=e;return Dv(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function tce(e){return Dv(t);function t(n){return n&&n.type===e}}function Dv(e){return t;function t(n,r,i){return!!(rce(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function nce(){return!0}function rce(e){return e!==null&&typeof e=="object"&&"type"in e}const C$=[],ice=!0,JT=!1,ace="skip";function sce(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=k$(i),o=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(y,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=C$,w,b,j;if((!t||a(d,f,p[p.length-1]||void 0))&&(v=oce(n(d,p)),v[0]===JT))return v;if("children"in d&&d.children){const k=d;if(k.children&&v[0]!==ace)for(b=(r?k.children.length:-1)+o,j=p.concat(k);b>-1&&b<k.children.length;){const E=k.children[b];if(w=u(E,b,j)(),w[0]===JT)return w;b=typeof w[1]=="number"?w[1]:b+o}}return v}}}function oce(e){return Array.isArray(e)?e:typeof e=="number"?[ice,e]:e==null?C$:[e]}function A$(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),sce(e,a,u,i);function u(d,f){const p=f[f.length-1],m=p?p.children.indexOf(d):void 0;return o(d,m,p)}}const o1={}.hasOwnProperty,lce={};function cce(e,t){const n=t||lce,r=new Map,i=new Map,a=new Map,o={...Kle,...n.handlers},u={all:f,applyData:dce,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:d,options:n,patch:uce,wrap:hce};return A$(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:i,y=String(p.identifier).toUpperCase();m.has(y)||m.set(y,p)}}),u;function d(p,m){const y=p.type,v=u.handlers[y];if(o1.call(u.handlers,y)&&v)return v(u,p,m);if(u.options.passThrough&&u.options.passThrough.includes(y)){if("children"in p){const{children:b,...j}=p,k=ly(j);return k.children=u.all(p),k}return ly(p)}return(u.options.unknownHandler||fce)(u,p,m)}function f(p){const m=[];if("children"in p){const y=p.children;let v=-1;for(;++v<y.length;){const w=u.one(y[v],p);if(w){if(v&&y[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=eP(w.value)),!Array.isArray(w)&&w.type==="element")){const b=w.children[0];b&&b.type==="text"&&(b.value=eP(b.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function uce(e,t){e.position&&(t.position=Vae(e))}function dce(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 o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,ly(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function fce(e,t){const n=t.data||{},r="value"in t&&!(o1.call(n,"hProperties")||o1.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 hce(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 eP(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function tP(e,t){const n=cce(e,t),r=n.one(e,void 0),i=Xle(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 pce(e,t){return e&&"run"in e?async function(n,r){const i=tP(n,{file:r,...t});await e.run(i,r)}:function(n,r){return tP(n,{file:r,...e||t})}}function nP(e){if(e)throw e}var Tw,rP;function mce(){if(rP)return Tw;rP=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 y;for(y in f);return typeof y>"u"||e.call(f,y)},o=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 Tw=function d(){var f,p,m,y,v,w,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),y=u(f,p),b!==y&&(E&&y&&(a(y)||(v=i(y)))?(v?(v=!1,w=m&&i(m)?m:[]):w=m&&a(m)?m:{},o(b,{name:p,newValue:d(E,w,y)})):typeof y<"u"&&o(b,{name:p,newValue:y}));return b},Tw}var gce=mce();const Pw=ha(gce);function l1(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 yce(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);u(null,...i);function u(d,...f){const p=e[++a];let m=-1;if(d){o(d);return}for(;++m<i.length;)(f[m]===null||f[m]===void 0)&&(f[m]=i[m]);i=f,p?vce(p,u)(...f):o(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 vce(e,t){let n;return r;function r(...o){const u=e.length>o.length;let d;u&&o.push(i);try{d=e.apply(this,o)}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(o,...u){n||(n=!0,t(o,...u))}function a(o){i(null,o)}}const _a={basename:xce,dirname:bce,extname:wce,join:Sce,sep:"/"};function xce(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hh(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 o=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function bce(e){if(Hh(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 wce(e){Hh(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const u=e.codePointAt(t);if(u===47){if(o){r=t+1;break}continue}n<0&&(o=!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 Sce(...e){let t=-1,n;for(;++t<e.length;)Hh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":jce(n)}function jce(e){Hh(e);const t=e.codePointAt(0)===47;let n=Nce(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Nce(e,t){let n="",r=0,i=-1,a=0,o=-1,u,d;for(;++o<=e.length;){if(o<e.length)u=e.codePointAt(o);else{if(u===47)break;u=47}if(u===47){if(!(i===o-1||a===1))if(i!==o-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=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else u===46&&a>-1?a++:a=-1}return n}function Hh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const kce={cwd:Cce};function Cce(){return"/"}function c1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ace(e){if(typeof e=="string")e=new URL(e);else if(!c1(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 Oce(e)}function Oce(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 Rw=["history","path","basename","stem","extname","dirname"];class O${constructor(t){let n;t?c1(t)?n={path:t}:typeof t=="string"||Ece(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":kce.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Rw.length;){const a=Rw[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)Rw.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?_a.basename(this.path):void 0}set basename(t){Mw(t,"basename"),Dw(t,"basename"),this.path=_a.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?_a.dirname(this.path):void 0}set dirname(t){iP(this.basename,"dirname"),this.path=_a.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?_a.extname(this.path):void 0}set extname(t){if(Dw(t,"extname"),iP(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=_a.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){c1(t)&&(t=Ace(t)),Mw(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?_a.basename(this.path,this.extname):void 0}set stem(t){Mw(t,"stem"),Dw(t,"stem"),this.path=_a.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 wr(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 Dw(e,t){if(e&&e.includes(_a.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+_a.sep+"`")}function Mw(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function iP(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Ece(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _ce=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),zce={}.hasOwnProperty;class Pk extends _ce{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=yce()}copy(){const t=new Pk;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Pw(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?($w("data",this.frozen),this.namespace[t]=n,this):zce.call(this.namespace,t)&&this.namespace[t]||void 0:t?($w("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=Fm(t),r=this.parser||this.Parser;return Iw("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Iw("process",this.parser||this.Parser),Lw("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const u=Fm(t),d=r.parse(u);r.run(d,u,function(p,m,y){if(p||!m||!y)return f(p);const v=m,w=r.stringify(v,y);Rce(w)?y.value=w:y.result=w,f(p,y)});function f(p,m){p||!m?o(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),Iw("processSync",this.parser||this.Parser),Lw("processSync",this.compiler||this.Compiler),this.process(t,i),sP("processSync","process",n),r;function i(a,o){n=!0,nP(a),r=o}}run(t,n,r){aP(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(o,u){const d=Fm(n);i.run(t,d,f);function f(p,m,y){const v=m||t;p?u(p):o?o(v):r(void 0,v,y)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),sP("runSync","run",r),i;function a(o,u){nP(o),i=u,r=!0}}stringify(t,n){this.freeze();const r=Fm(n),i=this.compiler||this.Compiler;return Lw("stringify",i),aP(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if($w("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):o(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 o(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function o(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=Pw(!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,y=-1;for(;++m<r.length;)if(r[m][0]===f){y=m;break}if(y===-1)r.push([f,...p]);else if(p.length>0){let[v,...w]=p;const b=r[y][1];l1(b)&&l1(v)&&(v=Pw(!0,b,v)),r[y]=[f,v,...w]}}}}const Tce=new Pk().freeze();function Iw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Lw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function $w(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 aP(e){if(!l1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function sP(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Fm(e){return Pce(e)?e:new O$(e)}function Pce(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Rce(e){return typeof e=="string"||Dce(e)}function Dce(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Mce="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",oP=[],lP={allowDangerousHtml:!0},Ice=/^(https?|ircs?|mailto|xmpp)$/i,Lce=[{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 $ce(e){const t=Bce(e),n=Uce(e);return qce(t.runSync(t.parse(n),n),e)}function Bce(e){const t=e.rehypePlugins||oP,n=e.remarkPlugins||oP,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...lP}:lP;return Tce().use(xle).use(n).use(pce,r).use(t)}function Uce(e){const t=e.children||"",n=new O$;return typeof t=="string"&&(n.value=t),n}function qce(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||Fce;for(const p of Lce)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Mce+p.id,void 0);return A$(e,f),Xae(e,{Fragment:l.Fragment,components:i,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function f(p,m,y){if(p.type==="raw"&&y&&typeof m=="number")return o?y.children.splice(m,1):y.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in Ew)if(Object.hasOwn(Ew,v)&&Object.hasOwn(p.properties,v)){const w=p.properties[v],b=Ew[v];(b===null||b.includes(p.tagName))&&(p.properties[v]=d(String(w||""),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,y)),v&&y&&typeof m=="number")return u&&p.children?y.children.splice(m,1,...p.children):y.children.splice(m,1),m}}}function Fce(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||Ice.test(e.slice(0,t))?e:""}function Hce(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Mv=Hce();async function cP(e){const t=await fetch(`${Mv}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new vr(n?.error?.message??`transcript fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function Kce(e){const t=await fetch(`${Mv}/projects/${encodeURIComponent(e)}/agent/providers`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new vr(n?.error?.message??`providers fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function Gce(e){const t=await fetch(`${Mv}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new vr(n?.error?.message??`reset failed: ${t.status}`,t.status,n?.error?.code)}}async function Vce({project:e,prompt:t,provider:n,modelId:r,scope:i,signal:a,onEvent:o}){const u={prompt:t};n&&(u.provider=n),r&&(u.modelId=r),i&&(u.scope=i);const d=await fetch(`${Mv}/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 vr(v?.error?.message??`prompt failed: ${d.status}`,d.status,v?.error?.code)}const f=d.body.getReader(),p=new TextDecoder;let m="";const y=()=>{f.cancel().catch(()=>{})};a?.addEventListener("abort",y,{once:!0});try{for(;;){const{value:v,done:w}=await f.read();if(w)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{o(JSON.parse(E))}catch{}}b=m.indexOf(`
|
|
114
|
+
|
|
115
|
+
`)}}}finally{a?.removeEventListener("abort",y);try{f.releaseLock()}catch{}}}function E$(e){return!e||e.role!=="assistant"?"":e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}const Qce=[{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?"}],Yce=[{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"}],Hm=e=>`canonry:aero:provider:${e}`,uP=e=>`canonry:aero:scope:${e}`;function Zce({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(!1),[a,o]=x.useState([]),[u,d]=x.useState(""),[f,p]=x.useState(!1),[m,y]=x.useState([]),[v,w]=x.useState(""),[b,j]=x.useState(null),[k,E]=x.useState(()=>typeof window>"u"?null:window.localStorage.getItem(Hm(e))??null),[C,O]=x.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(uP(e))==="all"?"all":"read-only"),_=x.useRef(null),A=x.useRef(null),z=x.useRef(null),[R,$]=x.useState(0),F=x.useMemo(()=>{const q=u.trimStart();if(!q.startsWith("/"))return[];if(/\s/.test(q))return[];const D=q.toLowerCase();return Yce.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=yr({queryKey:Pe.agent.providers(e),queryFn:()=>Kce(e),enabled:t,staleTime:6e4}),B=x.useMemo(()=>{const q=U.data?.providers??[];if(k){const G=q.find(oe=>oe.id===k&&oe.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(Hm(e)))},[U.data,k,e]);const V=x.useCallback(q=>{E(q),!(typeof window>"u")&&(q?window.localStorage.setItem(Hm(e),q):window.localStorage.removeItem(Hm(e)))},[e]),X=x.useCallback(()=>{O(q=>{const D=q==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(uP(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||cP(e).then(ne=>{q||o(ne.messages)}).catch(ne=>{q||j(ne instanceof Error?ne.message:"Failed to load transcript")})};D();const oe=window.setInterval(D,15e3);return()=>{q=!0,window.clearInterval(oe)}},[t,e,f]),x.useEffect(()=>()=>{_.current?.abort()},[e]),x.useEffect(()=>{const q=A.current;q&&(q.scrollTop=q.scrollHeight)},[a,v,m]);async function W(q){const D=q.trim();if(!D||f)return;j(null),d(""),p(!0),w(""),y([]);const G={role:"user",content:D,timestamp:Date.now()};o(ne=>[...ne,G]);const oe=new AbortController;_.current=oe;try{await Vce({project:e,prompt:D,provider:k??void 0,scope:C,signal:oe.signal,onEvent:H});const ne=await cP(e);o(ne.messages)}catch(ne){ne.name!=="AbortError"&&j(ne instanceof Error?ne.message:"Prompt failed")}finally{p(!1),w(""),_.current=null}}function H(q){switch(q.type){case"message_update":w(E$(q.message));break;case"message_end":q.message.role==="assistant"&&w("");break;case"tool_execution_start":y(D=>[...D,{id:q.toolCallId,name:q.toolName,args:q.args,startedAt:Date.now()}]);break;case"tool_execution_end":y(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(){_.current?.abort();try{await Gce(e),o([]),j(null)}catch(q){j(q instanceof Error?q.message:"Reset failed")}}const ce=a.length===0,xe=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",M=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",I=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 l.jsx("div",{className:xe,onClick:q=>{r&&q.target===q.currentTarget&&i(!1)},children:l.jsx("div",{className:M,children:t?l.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:[l.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(j2,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),l.jsx("span",{className:"text-sm font-medium text-zinc-100",children:"Aero"}),l.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:f?"working…":e})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Wce,{providers:U.data?.providers??[],active:B,override:k,onPick:V,disabled:f}),l.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:l.jsx(D5,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),l.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?l.jsx(nY,{className:"h-3.5 w-3.5","aria-hidden":"true"}):l.jsx(XQ,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),l.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:l.jsx(Uh,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),l.jsxs("div",{ref:A,className:I,children:[b&&l.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}),ce&&!f&&l.jsxs("div",{className:"flex flex-col gap-3 py-2",children:[l.jsxs("p",{className:"text-xs text-zinc-500",children:["Ask anything about ",l.jsx("span",{className:"text-zinc-300",children:e}),", or start with:"]}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:Qce.map(q=>l.jsx("button",{type:"button",onClick:()=>W(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))})]}),nue(a,e,k,C),m.length>0&&l.jsx("div",{className:"mt-3 space-y-1.5",children:m.map(q=>l.jsx(_$,{trail:q},q.id))}),f&&v&&l.jsxs("div",{className:"mt-3",children:[l.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),l.jsx(z$,{content:v})]}),f&&!v&&m.every(q=>q.endedAt!==void 0)&&l.jsx(sue,{})]}),l.jsx(Xce,{projectName:e,activeProvider:B,scope:C,onToggleScope:X,disabled:f}),l.jsxs("div",{className:"relative",children:[F.length>0&&l.jsx(Jce,{matches:F,selectedIndex:R,onHover:$,onPick:q=>{d(""),z.current?.focus(),q.action==="clear"?J():W(q.prompt)}}),l.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[R];d(""),D.action==="clear"?J():W(D.prompt);return}W(u)},children:[l.jsx("textarea",{ref:z,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[R];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[R];d(""),D.action==="clear"?J():W(D.prompt)}else W(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"}),l.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:l.jsx(kQ,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}):l.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:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(j2,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Ask Aero about ",e,"…"]}),l.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-600",children:"Enter"})]})})})}function Wce({providers:e,active:t,override:n,onPick:r,disabled:i}){const[a,o]=x.useState(!1),u=x.useRef(null);if(x.useEffect(()=>{if(!a)return;const p=y=>{u.current?.contains(y.target)||o(!1)},m=y=>{y.key==="Escape"&&o(!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 l.jsxs("div",{ref:u,className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>o(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:[l.jsx("span",{className:"font-medium text-zinc-200",children:d}),f&&l.jsx("span",{className:"hidden font-mono text-[10px] text-zinc-500 sm:inline",children:f}),l.jsx(_Q,{className:"h-3 w-3","aria-hidden":"true"})]}),a&&l.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:[l.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-2 text-[10px] uppercase tracking-wider text-zinc-500",children:"Aero provider"}),l.jsx("ul",{className:"max-h-72 overflow-y-auto py-1",children:e.map(p=>{const m=t?.id===p.id,y=n===p.id;return l.jsx("li",{children:l.jsxs("button",{type:"button",role:"option","aria-selected":m,disabled:!p.configured,onClick:()=>{p.configured&&(r(y?null:p.id),o(!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:[l.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:m?l.jsx(_5,{className:"h-3 w-3 text-emerald-400","aria-hidden":"true"}):null}),l.jsxs("span",{className:"flex-1",children:[l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"font-medium text-zinc-100",children:p.label}),y&&l.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&&l.jsx("span",{className:"rounded-full border border-zinc-800 px-1.5 text-[9px] uppercase tracking-wider text-zinc-500",children:"Key missing"})]}),l.jsx("span",{className:"mt-0.5 block font-mono text-[10px] text-zinc-500",children:p.defaultModel}),p.keySource==="env"&&l.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!p.configured&&l.jsxs("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:["Add key in config.yaml or export"," ",l.jsx("code",{className:"font-mono text-zinc-400",children:eue(p.id)})]})]})]})},p.id)})}),n&&l.jsx("button",{type:"button",onClick:()=>{r(null),o(!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 Xce({projectName:e,activeProvider:t,scope:n,onToggleScope:r,disabled:i}){const a=t?.label.replace(/\s+\(.+\)$/,"")??null,o=n==="all";return l.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:[l.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:[l.jsx("span",{className:"text-zinc-600",children:"project"}),l.jsx("span",{className:"font-medium text-zinc-200",children:e})]}),a&&l.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:[l.jsx("span",{className:"text-zinc-600",children:"model"}),l.jsx("span",{className:"font-medium text-zinc-200",children:a})]}),l.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 ${o?"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:o?"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:[l.jsx("span",{className:o?"text-amber-500":"text-zinc-600",children:"scope"}),l.jsx("span",{className:"font-medium",children:o?"all tools":"read-only"})]})]})}function Jce({matches:e,selectedIndex:t,onHover:n,onPick:r}){return l.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:[l.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500",children:"Commands"}),l.jsx("ul",{role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:e.map((i,a)=>{const o=a===t;return l.jsx("li",{children:l.jsxs("button",{type:"button",role:"option","aria-selected":o,onMouseEnter:()=>n(a),onClick:()=>r(i),className:`flex w-full items-center gap-3 px-3 py-1.5 text-left text-xs transition ${o?"bg-zinc-900 text-zinc-100":"text-zinc-300 hover:bg-zinc-900/60"}`,children:[l.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:i.command}),l.jsx("span",{className:"font-medium",children:i.label}),l.jsx("span",{className:"ml-auto text-[10px] text-zinc-500",children:i.hint})]})},i.command)})}),l.jsxs("div",{className:"border-t border-zinc-800/60 px-3 py-1.5 text-[10px] text-zinc-600",children:[l.jsx("span",{className:"mr-3",children:"↑↓ to select"}),l.jsx("span",{className:"mr-3",children:"Enter to run"}),l.jsx("span",{children:"Tab to autocomplete"})]})]})}function eue(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 tue(e,t){const n=e.timestamp??0;return`${e.role}:${n}:${t}`}function nue(e,t,n,r){const i=[];for(let a=0;a<e.length;a++){const o=e[a],u=tue(o,a);if(o.role==="user"){const d=typeof o.content=="string"?o.content:JSON.stringify(o.content);if(d.startsWith("[system]"))continue;i.push(l.jsx(rue,{text:d,projectName:t,providerOverride:n,scope:r},u));continue}if(o.role==="assistant"){const d=new Map;let f=a+1;for(;f<e.length&&e[f].role==="toolResult";){const y=e[f];d.set(y.toolCallId,y),f++}const p=aue(o,d,o.timestamp??0),m=E$(o);i.push(l.jsxs(x.Fragment,{children:[p.length>0&&l.jsx("div",{className:"mt-3 space-y-1.5",children:p.map(y=>l.jsx(_$,{trail:y},y.id))}),m.trim()&&l.jsxs("div",{className:"mt-3",children:[l.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),l.jsx(z$,{content:m})]})]},u)),a=f-1;continue}}return i}function rue({text:e,projectName:t,providerOverride:n,scope:r}){const[i,a]=x.useState(!1),o=x.useMemo(()=>iue(t,e,n,r),[t,e,n,r]);async function u(){try{await navigator.clipboard.writeText(o),a(!0),window.setTimeout(()=>a(!1),1500)}catch{}}return l.jsxs("div",{className:"group relative mt-3 rounded-md bg-zinc-900/60 px-3 py-2 text-zinc-200",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"You"}),l.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:o,children:i?l.jsxs(l.Fragment,{children:[l.jsx(_5,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):l.jsxs(l.Fragment,{children:[l.jsx(IQ,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),l.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function iue(e,t,n,r){const i=["canonry","agent","ask",dP(e),dP(t)];return n&&i.push("--provider",n),r==="read-only"&&i.push("--scope","read-only"),i.join(" ")}function dP(e){return`'${e.replace(/'/g,"'\\''")}'`}function aue(e,t,n){const r=[];for(const i of e.content){if(i.type!=="toolCall")continue;const a=i,o=t.get(a.id);r.push({id:a.id,name:a.name,args:a.arguments,startedAt:n,endedAt:o?.timestamp,isError:o?.isError,result:o?.content})}return r}function _$({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,o=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 l.jsxs("div",{className:`rounded-md border ${u} ${d} font-mono`,children:[l.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:[l.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:r?l.jsx(R5,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):i?l.jsx(Zg,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):l.jsx(jY,{className:"h-3 w-3 text-zinc-500","aria-hidden":"true"})}),l.jsx("span",{className:"text-[11px] font-semibold text-zinc-100",children:e.name}),l.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px] text-zinc-500",children:[r?l.jsx("span",{className:"text-emerald-400",children:"running…"}):l.jsxs(l.Fragment,{children:[l.jsx("span",{children:i?"failed":"ok"}),o&&l.jsx("span",{children:o})]}),l.jsx(Bh,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`,"aria-hidden":"true"})]})]}),t&&l.jsxs("div",{className:"border-t border-zinc-800/60 px-2.5 py-2 text-[11px] text-zinc-400",children:[l.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:"Args"}),l.jsx("pre",{className:"mb-2 overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:fP(e.args)}),!r&&e.result!==void 0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:i?"Error":"Result"}),l.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:fP(e.result)})]})]})]})}function fP(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 z$({content:e}){return l.jsx("div",{className:"aero-markdown text-zinc-100",children:l.jsx($ce,{components:{h1:t=>l.jsx("h1",{...t,className:"mt-3 mb-2 text-base font-semibold text-zinc-50"}),h2:t=>l.jsx("h2",{...t,className:"mt-3 mb-2 text-sm font-semibold text-zinc-50"}),h3:t=>l.jsx("h3",{...t,className:"mt-3 mb-1.5 text-sm font-semibold text-zinc-100"}),h4:t=>l.jsx("h4",{...t,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-300"}),p:t=>l.jsx("p",{...t,className:"mb-2 leading-relaxed"}),ul:t=>l.jsx("ul",{...t,className:"mb-2 ml-4 list-disc space-y-1"}),ol:t=>l.jsx("ol",{...t,className:"mb-2 ml-4 list-decimal space-y-1"}),li:t=>l.jsx("li",{...t,className:"marker:text-zinc-600"}),strong:t=>l.jsx("strong",{...t,className:"font-semibold text-zinc-50"}),em:t=>l.jsx("em",{...t,className:"text-zinc-200"}),code:({children:t,...n})=>l.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=>l.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=>l.jsx("a",{...t,className:"text-emerald-400 underline decoration-emerald-700 hover:decoration-emerald-400",target:"_blank",rel:"noopener noreferrer"}),table:t=>l.jsx("div",{className:"mb-2 overflow-x-auto",children:l.jsx("table",{...t,className:"w-full border-collapse text-xs"})}),thead:t=>l.jsx("thead",{...t,className:"border-b border-zinc-800"}),th:t=>l.jsx("th",{...t,className:"px-2 py-1 text-left font-semibold text-zinc-300"}),tr:t=>l.jsx("tr",{...t,className:"border-b border-zinc-900"}),td:t=>l.jsx("td",{...t,className:"px-2 py-1 text-zinc-200"}),blockquote:t=>l.jsx("blockquote",{...t,className:"mb-2 border-l-2 border-zinc-700 pl-3 italic text-zinc-400"}),hr:()=>l.jsx("hr",{className:"my-3 border-zinc-800"})},children:e})})}function sue(){return l.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),l.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[l.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-emerald-400/80"}),l.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-emerald-400/60"}),l.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-emerald-400/40"})]})]})}function oue(){const e=f5(),t=/^\/projects\/([^/]+)/.exec(e.pathname),n=t?decodeURIComponent(t[1]):null,r=yr({queryKey:Pe.projects.all,queryFn:yv,enabled:n!==null,staleTime:6e4});if(!n)return null;const i=r.data??[],a=i.find(o=>o.id===n)??i.find(o=>o.name===n);return a?l.jsx(Zce,{projectName:a.name},a.name):null}function Iv(e,t,n){switch(e.invalidateQueries({queryKey:Pe.runs.all}),e.invalidateQueries({queryKey:Pe.projects.all}),t){case Ot["answer-visibility"]:case Ot["site-audit"]:case Ot["backlink-extract"]:return;case Ot["gsc-sync"]:case Ot["inspect-sitemap"]:e.invalidateQueries({queryKey:Pe.gsc.project(n)});return;case Ot["ga-sync"]:e.invalidateQueries({queryKey:Pe.traffic.project(n)});return;case Ot["traffic-sync"]:e.invalidateQueries({queryKey:Pe.traffic.project(n)}),e.invalidateQueries({queryKey:Pe.serverTraffic.project(n)});return;case Ot["bing-inspect"]:case Ot["bing-inspect-sitemap"]:e.invalidateQueries({queryKey:Pe.bing.project(n)});return;default:return t}}const hP=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:HQ},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:AQ},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:qQ}],pP=e=>({label:e,state:"checking",detail:"Checking service health"}),lue={apiStatus:pP("API"),workerStatus:pP("Worker")};function cue(e){switch(e){case Ot["answer-visibility"]:return"Visibility sweep";case Ot["gsc-sync"]:return"GSC sync";case Ot["inspect-sitemap"]:return"Sitemap inspection";case Ot["ga-sync"]:return"GA sync";case Ot["traffic-sync"]:return"Traffic sync";case Ot["bing-inspect"]:return"Bing URL inspection";case Ot["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Ot["site-audit"]:return"Site audit";case Ot["backlink-extract"]:return"Backlink extract"}}function uue(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function due(e){const t=cue(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function fue(e,t){return e.error?`${t}: ${ek(e.error)}`:e.location?`${t} · ${e.location}`:t}function hue(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function pue(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 mue(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function gue(){const e=Ir(),t=x.useSyncExternalStore(Jte,Yl,Yl),n=Object.keys(t.runs).length>0||Object.keys(t.batches).length>0,r=yr({queryKey:Pe.runs.all,queryFn:m5,enabled:n,staleTime:Hj,refetchInterval:3e3}),i=yr({queryKey:Pe.projects.all,queryFn:yv,enabled:n}),a=x.useRef({}),o=x.useCallback(()=>{r.refetch()},[r.refetch]);return x.useEffect(()=>{n&&o()},[n,o]),x.useEffect(()=>{if(!n||typeof window>"u")return;const u=()=>{document.visibilityState==="visible"&&o()};return window.addEventListener("focus",o),document.addEventListener("visibilitychange",u),()=>{window.removeEventListener("focus",o),document.removeEventListener("visibilitychange",u)}},[n,o]),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 y=f[m.runId];if(!y||!sk(y.status)||(a.current[y.id]??m.lastAnnouncedStatus)===y.status)continue;const w=d.find(j=>j.id===y.projectId);if(w&&Iv(e,y.kind,w.name),m.sourceAction==="run-all"){W2(y.id);continue}const b=hue(y.projectId,m.projectLabel,d);bt({title:due(y),detail:fue(y,b),tone:uue(y.status),dedupeKey:`run:${y.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:y.id}}),W2(y.id)}for(const m of Object.values(t.batches)){const y=nne(m.runIds,f);y.finished&&(bt({title:"Run-all batch finished",detail:pue(y,m.skippedCount),tone:mue(y),dedupeKey:`batch:${m.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),tne(m.batchId))}a.current=p},[i.data,r.data,t,e]),null}function yue(){const e=qh(),{dashboard:t,isLoading:n,refetch:r}=pc(),o=Tv(!e,e?.health).data??e?.health??lue,u=f5(),{runId:d,evidenceId:f,closeDrawer:p}=fd(),[m,y]=x.useState(!1),v=bae(d),w=v.data??null,b=v.isLoading;x.useEffect(()=>{w&&w.status!=="running"&&w.status!=="queued"&&r()},[w?.status,r]),x.useEffect(()=>{y(!1)},[u.pathname]),x.useEffect(()=>{if(typeof window>"u"||!d&&!f)return;const O=_=>{_.key==="Escape"&&p()};return window.addEventListener("keydown",O),()=>{window.removeEventListener("keydown",O)}},[d,f,p]);const j=t??e?.dashboard??null,k=d&&j?Zie(j,d):void 0,E=f&&j?Wie(j,f):void 0,C=(()=>{const O=u.pathname;if(O==="/")return"Portfolio";if(O==="/projects")return"Projects";if(O==="/runs")return"Runs";if(O==="/settings")return"Settings";if(O==="/setup")return"Setup";if(O==="/backlinks")return"Backlinks";if(O==="/traffic"||O.startsWith("/traffic/"))return"Server traffic";if(O.startsWith("/projects/")){const A=O.split("/").filter(Boolean)[1];if(A&&j){const z=j.projects.find(R=>R.project.id===A);if(z)return z.project.name}return"Project"}return"Not found"})();return l.jsxs("div",{className:"app-shell",children:[l.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),l.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[l.jsx("div",{className:"sidebar-brand",children:l.jsx(oT,{version:o.apiStatus.version})}),l.jsxs("nav",{className:"sidebar-nav",children:[l.jsxs(At,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(QQ,{className:"sidebar-icon"}),l.jsx("span",{children:"Overview"})]}),l.jsxs(At,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[l.jsx(GQ,{className:"sidebar-icon"}),l.jsx("span",{children:"Projects"})]}),l.jsxs(At,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(Vg,{className:"sidebar-icon"}),l.jsx("span",{children:"Runs"})]}),l.jsxs(At,{to:"/traffic",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[l.jsx(lY,{className:"sidebar-icon"}),l.jsx("span",{children:"Server traffic"})]}),l.jsxs(At,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(P5,{className:"sidebar-icon"}),l.jsx("span",{children:"Backlinks"})]}),l.jsxs(At,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(pY,{className:"sidebar-icon"}),l.jsx("span",{children:"Settings"})]}),n?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(O=>l.jsxs("div",{className:"sidebar-skeleton-item",children:[l.jsx("span",{className:"skeleton-circle size-2"}),l.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+O*15}%`}})]},O))]}):j&&j.projects.length>0?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Projects"}),j.projects.map(O=>{const _=O.visibilitySummary.tone;return l.jsxs(At,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[l.jsx("span",{className:`sidebar-dot sidebar-dot-${_}`}),l.jsx("span",{children:O.project.name})]},O.project.id)})]}):n?null:l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Resources"}),l.jsxs(At,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(dY,{className:"sidebar-icon"}),l.jsx("span",{children:"Setup"})]})]})]}),l.jsx("div",{className:"sidebar-footer",children:hP.map(({label:O,href:_,Icon:A})=>l.jsx("a",{className:"sidebar-footer-icon",href:_,target:"_blank",rel:"noopener noreferrer",title:O,"aria-label":O,children:l.jsx(A,{className:"size-4"})},_))})]}),l.jsxs("div",{className:"main-area",children:[l.jsxs("header",{className:"topbar",children:[l.jsxs("div",{className:"topbar-left",children:[l.jsx("div",{className:"topbar-brand-mobile",children:l.jsx(oT,{compact:!0})}),l.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[l.jsx(At,{to:"/",children:"Home"}),l.jsx(Bh,{className:"breadcrumb-sep size-3"}),l.jsx("span",{className:"breadcrumb-current",children:C})]})]}),l.jsxs("div",{className:"topbar-actions",children:[l.jsxs("div",{className:"health-pill-row",children:[l.jsxs("span",{className:`health-pill health-pill-${o.apiStatus.state}`,title:Io(o.apiStatus),children:["API ",o.apiStatus.state==="ok"?"ok":o.apiStatus.state]}),l.jsxs("span",{className:`health-pill health-pill-${o.workerStatus.state}`,title:Io(o.workerStatus),children:["Worker ",o.workerStatus.state==="ok"?"ok":o.workerStatus.state]})]}),l.jsxs(me,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":m,"aria-controls":"mobile-nav",onClick:()=>y(O=>!O),children:[l.jsx(eY,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),l.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${m?"mobile-nav-open":""}`,children:[l.jsxs(me,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>y(!1),children:[l.jsx(Uh,{className:"size-5"}),l.jsx("span",{className:"sr-only",children:"Close navigation"})]}),l.jsx(At,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),l.jsx(At,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),l.jsx(At,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),l.jsx(At,{to:"/traffic",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Server traffic"}),l.jsx(At,{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?l.jsxs("div",{className:"mobile-nav-section",children:[l.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),j.projects.map(O=>l.jsx(At,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"mobile-nav-link",children:O.project.name},O.project.id))]}):null]}),l.jsx("main",{id:"content",className:"page-shell",children:n&&!e?l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-40"}),l.jsx("div",{className:"skeleton-text-sm w-72"})]}),l.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(O=>l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-24"}),l.jsx("div",{className:"skeleton-text w-full"}),l.jsx("div",{className:"skeleton-text-sm w-3/4"})]},O))}),l.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(O=>l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-20"}),l.jsx("div",{className:"space-y-2",children:[1,2,3].map(_=>l.jsx("div",{className:"skeleton-text-sm w-full"},_))})]},O))})]}):l.jsx(BN,{})}),l.jsxs("footer",{className:"footer",children:[l.jsxs("span",{className:"footer-brand",children:[l.jsx("span",{children:l.jsx("a",{href:"https://canonry.ai",children:"Canonry"})}),o.apiStatus.version&&o.apiStatus.version!=="unknown"?l.jsxs("span",{className:"footer-version",children:["v",o.apiStatus.version]}):null]}),l.jsx("div",{className:"footer-links",children:hP.map(({label:O,href:_,Icon:A})=>l.jsx("a",{href:_,target:"_blank",rel:"noopener noreferrer",title:O,"aria-label":O,className:"footer-icon",children:l.jsx(A,{className:"size-3.5"})},_))})]})]}),k?l.jsxs($ie,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:p,children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[l.jsx(Av,{status:k.status}),l.jsx("span",{className:"text-zinc-400",children:k.startedAt}),l.jsx("span",{className:"text-zinc-500",children:k.duration}),l.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&l.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.statusDetail}),l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),b?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):w&&w.snapshots.length>0?l.jsxs("div",{className:"space-y-2",children:[w.snapshots.map(O=>l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:O.query??"Unknown query"}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Zl,{provider:O.provider}),l.jsx(a3,{variant:O.citationState===gh.cited?"success":"neutral",children:O.citationState})]})]}),O.model&&l.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:O.model}),O.citedDomains.length>0&&l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[l.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",O.citedDomains.join(", ")]}),O.competitorOverlap.length>0&&l.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",O.competitorOverlap.join(", ")]}),O.groundingSources&&O.groundingSources.length>0&&l.jsxs("details",{className:"mt-2",children:[l.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[O.groundingSources.length," grounding source",O.groundingSources.length!==1?"s":""]}),l.jsx("ul",{className:"mt-1 space-y-0.5",children:O.groundingSources.map((_,A)=>l.jsx("li",{className:"text-xs text-zinc-500 truncate",children:l.jsx("a",{href:_.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:_.title||_.uri})},A))})]}),O.answerText&&l.jsxs("details",{className:"mt-1",children:[l.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:O.answerText})]})]},O.id)),w.status==="running"&&l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Running remaining queries..."]})]}):w&&w.status==="running"?l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first query result..."]}):w&&w.status==="queued"?l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):w&&w.error?l.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[l.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),l.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:Bte(w.error)})]}):l.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?l.jsx(Fie,{evidence:E.evidence,project:E.project,onClose:p}):null,l.jsx(gue,{}),l.jsx(jae,{}),l.jsx(oue,{})]})}class vue 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?l.jsx("div",{className:"page-container",children:l.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[l.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:l.jsx(Zg,{className:"size-6 text-rose-400"})}),l.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),l.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),l.jsxs("div",{className:"flex gap-3 mt-2",children:[l.jsxs(me,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[l.jsx(D5,{className:"size-3.5 mr-1.5"}),"Try again"]}),l.jsx(me,{variant:"secondary",size:"sm",onClick:()=>{const t=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=t||"/"},children:"Go home"})]})]})}):this.props.children}}const ze=x.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Qi("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}));ze.displayName="Card";const u1=x.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Qi("flex flex-col gap-1.5 p-5",e),...t}));u1.displayName="CardHeader";const d1=x.forwardRef(({className:e,...t},n)=>l.jsx("h3",{ref:n,className:Qi("font-medium tracking-tight text-zinc-50",e),...t}));d1.displayName="CardTitle";const f1=x.forwardRef(({className:e,...t},n)=>l.jsx("p",{ref:n,className:Qi("text-sm text-zinc-500",e),...t}));f1.displayName="CardDescription";const Ag=x.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:Qi("p-5 pt-0",e),...t}));Ag.displayName="CardContent";function xue({points:e,tone:t}){const n=x.useId();if(e.length===0)return null;const r=42,i=132,a=5,o=Math.min(...e),d=Math.max(...e)-o||1,f=i-a*2,p=r-a*2,m=e.map((y,v)=>{const w=a+v/Math.max(e.length-1,1)*f,b=a+(1-(y-o)/d)*p;return`${w},${b}`}).join(" ");return l.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${i} ${r}`,"aria-hidden":"true",children:[l.jsx("defs",{children:l.jsx("clipPath",{id:n,children:l.jsx("rect",{x:a,y:a,width:f,height:p,rx:"8"})})}),l.jsx("line",{className:"sparkline-guide",x1:a,x2:i-a,y1:r-a,y2:r-a}),l.jsx("polyline",{clipPath:`url(#${n})`,points:m,vectorEffect:"non-scaling-stroke"})]})}function bue({project:e}){return l.jsxs(At,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[l.jsxs("div",{className:"project-row-primary",children:[l.jsxs("div",{children:[l.jsx("p",{className:"project-name",children:e.project.name}),l.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),l.jsx("p",{className:"project-insight",children:e.insight})]}),l.jsx("div",{className:"project-row-stat",children:l.jsxs("div",{className:"metric-inline-block",children:[l.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),l.jsx("p",{className:`metric-inline-value ${e.visibilityTone==="caution"?"text-amber-400":""}`,children:e.visibilityScore}),l.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta}),e.providerCoverage&&l.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),l.jsx("div",{className:"project-row-stat",children:l.jsxs("div",{className:"metric-inline-block",children:[l.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),l.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),l.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Nv(e.lastRun.status)]})]})}),l.jsx("div",{className:"project-row-chart",children:l.jsx(xue,{points:e.trend,tone:L4(e.lastRun.status)})}),l.jsx("span",{className:"project-row-link",children:l.jsx(Bh,{className:"h-4 w-4 text-zinc-500"})})]})}function wue(){const e=qh(),{dashboard:t,isLoading:n}=pc(),r=t??e?.dashboard;if(!r||n)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-32"}),l.jsx("div",{className:"skeleton-text-sm w-64"})]}),l.jsx("div",{className:"space-y-3",children:[1,2,3].map(p=>l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[l.jsxs("div",{className:"flex-1 space-y-2",children:[l.jsx("div",{className:"skeleton-text w-36"}),l.jsx("div",{className:"skeleton-text-sm w-48"})]}),l.jsx("div",{className:"skeleton-text w-16"}),l.jsx("div",{className:"skeleton-text w-16"}),l.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},p))})]});const i=r.portfolioOverview,u=Tv(!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=Gte(i.systemHealth,u,r.settings),{openRun:f}=fd();return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Portfolio"}),l.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),l.jsx("div",{className:"page-header-right",children:l.jsx("p",{className:"text-[11px] text-zinc-600",children:i.lastUpdatedAt})})]}),i.projects.length>0?l.jsx("div",{className:"project-list project-list-scrollable",children:i.projects.map(p=>l.jsx(bue,{project:p},p.project.id))}):l.jsxs(ze,{className:"surface-card empty-card",children:[l.jsx("h3",{children:i.emptyState?.title??"No projects yet"}),l.jsx("p",{className:"supporting-copy",children:i.emptyState?.detail}),l.jsx(me,{size:"sm",asChild:!0,children:l.jsx(At,{to:i.emptyState?.ctaHref==="/setup"||!i.emptyState?.ctaHref?"/setup":"/",children:i.emptyState?.ctaLabel??"Launch setup"})})]}),l.jsxs("div",{className:"overview-secondary-grid",children:[i.attentionItems.length>0&&l.jsxs("section",{className:"overview-secondary-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),l.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),l.jsx("div",{className:"attention-list attention-list-scrollable",children:i.attentionItems.map(p=>l.jsxs(At,{to:p.href,className:`attention-item attention-item-${p.tone}`,children:[l.jsxs("div",{children:[l.jsx("p",{className:"attention-title",children:p.title}),l.jsx("p",{className:"attention-detail",children:p.detail})]}),l.jsx("span",{className:"attention-action",children:p.actionLabel})]},p.id))})]}),l.jsxs("section",{className:"overview-secondary-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),l.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),l.jsx("div",{className:"compact-stack compact-stack-scrollable",children:i.recentRuns.length>0?i.recentRuns.map(p=>l.jsxs("button",{className:"compact-run",type:"button",onClick:()=>f(p.id),children:[l.jsxs("div",{children:[l.jsx("p",{className:"compact-run-title",children:p.projectName}),l.jsx("p",{className:"compact-run-detail",children:p.summary})]}),l.jsx(Av,{status:p.status})]},p.id)):l.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),l.jsxs("section",{className:"page-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),l.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),l.jsx("div",{className:"health-grid",children:d.map(p=>l.jsxs(ze,{className:"surface-card compact-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:p.label}),l.jsx("h3",{children:p.detail})]}),l.jsx(pt,{tone:p.tone,title:p.id==="api"?Io(u.apiStatus):p.id==="worker"?Io(u.workerStatus):void 0,children:p.label})]}),l.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const Rk=Symbol.for("yaml.alias"),h1=Symbol.for("yaml.document"),To=Symbol.for("yaml.map"),T$=Symbol.for("yaml.pair"),$a=Symbol.for("yaml.scalar"),md=Symbol.for("yaml.seq"),Fi=Symbol.for("yaml.node.type"),gc=e=>!!e&&typeof e=="object"&&e[Fi]===Rk,Lv=e=>!!e&&typeof e=="object"&&e[Fi]===h1,Kh=e=>!!e&&typeof e=="object"&&e[Fi]===To,Tn=e=>!!e&&typeof e=="object"&&e[Fi]===T$,Jt=e=>!!e&&typeof e=="object"&&e[Fi]===$a,Gh=e=>!!e&&typeof e=="object"&&e[Fi]===md;function En(e){if(e&&typeof e=="object")switch(e[Fi]){case To:case md:return!0}return!1}function _n(e){if(e&&typeof e=="object")switch(e[Fi]){case Rk:case To:case $a:case md:return!0}return!1}const P$=e=>(Jt(e)||En(e))&&!!e.anchor,jl=Symbol("break visit"),Sue=Symbol("skip children"),ih=Symbol("remove node");function gd(e,t){const n=jue(t);Lv(e)?Nu(null,e.contents,n,Object.freeze([e]))===ih&&(e.contents=null):Nu(null,e,n,Object.freeze([]))}gd.BREAK=jl;gd.SKIP=Sue;gd.REMOVE=ih;function Nu(e,t,n,r){const i=Nue(e,t,n,r);if(_n(i)||Tn(i))return kue(e,r,i),Nu(e,i,n,r);if(typeof i!="symbol"){if(En(t)){r=Object.freeze(r.concat(t));for(let a=0;a<t.items.length;++a){const o=Nu(a,t.items[a],n,r);if(typeof o=="number")a=o-1;else{if(o===jl)return jl;o===ih&&(t.items.splice(a,1),a-=1)}}}else if(Tn(t)){r=Object.freeze(r.concat(t));const a=Nu("key",t.key,n,r);if(a===jl)return jl;a===ih&&(t.key=null);const o=Nu("value",t.value,n,r);if(o===jl)return jl;o===ih&&(t.value=null)}}return i}function jue(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 Nue(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(Kh(t))return n.Map?.(e,t,r);if(Gh(t))return n.Seq?.(e,t,r);if(Tn(t))return n.Pair?.(e,t,r);if(Jt(t))return n.Scalar?.(e,t,r);if(gc(t))return n.Alias?.(e,t,r)}function kue(e,t,n){const r=t[t.length-1];if(En(r))r.items[e]=n;else if(Tn(r))e==="key"?r.key=n:r.value=n;else if(Lv(r))r.contents=n;else{const i=gc(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Cue={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Aue=e=>e.replace(/[!,[\]{}]/g,t=>Cue[t]);class _r{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},_r.defaultYaml,t),this.tags=Object.assign({},_r.defaultTags,n)}clone(){const t=new _r(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new _r(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:_r.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},_r.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:_r.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},_r.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,o]=r;return this.tags[a]=o,!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 o=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,o),!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 o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}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(o){return n(String(o)),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+Aue(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&&_n(t.contents)){const a={};gd(t.contents,(o,u)=>{_n(u)&&u.tag&&(a[u.tag]=!0)}),i=Object.keys(a)}else i=[];for(const[a,o]of r)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(u=>u.startsWith(o)))&&n.push(`%TAG ${a} ${o}`);return n.join(`
|
|
117
|
+
`)}}_r.defaultYaml={explicit:!1,version:"1.2"};_r.defaultTags={"!!":"tag:yaml.org,2002:"};function R$(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 D$(e){const t=new Set;return gd(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function M$(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Oue(e,t){const n=[],r=new Map;let i=null;return{onAnchor:a=>{n.push(a),i??(i=D$(e));const o=M$(t,i);return i.add(o),o},setAnchors:()=>{for(const a of n){const o=r.get(a);if(typeof o=="object"&&o.anchor&&(Jt(o.node)||En(o.node)))o.node.anchor=o.anchor;else{const u=new Error("Failed to resolve repeated object (this should not happen)");throw u.source=a,u}}},sourceObjects:r}}function ku(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,a=r.length;i<a;++i){const o=r[i],u=ku(e,r,String(i),o);u===void 0?delete r[i]:u!==o&&(r[i]=u)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const a=r.get(i),o=ku(e,r,i,a);o===void 0?r.delete(i):o!==a&&r.set(i,o)}else if(r instanceof Set)for(const i of Array.from(r)){const a=ku(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 o=ku(e,r,i,a);o===void 0?delete r[i]:o!==a&&(r[i]=o)}return e.call(t,n,r)}function qi(e,t,n){if(Array.isArray(e))return e.map((r,i)=>qi(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!P$(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 Dk{constructor(t){Object.defineProperty(this,Fi,{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(!Lv(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},u=qi(this,"",o);if(typeof i=="function")for(const{count:d,res:f}of o.anchors.values())i(f,d);return typeof a=="function"?ku(a,{"":u},"",u):u}}class Mk extends Dk{constructor(t){super(Rk),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=[],gd(t,{Node:(a,o)=>{(gc(o)||P$(o))&&r.push(o)}}),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,o=this.resolve(i,n);if(!o){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let u=r.get(o);if(u||(qi(o,null,n),u=r.get(o)),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=Og(i,o,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(R$(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 Og(e,t,n){if(gc(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(En(t)){let r=0;for(const i of t.items){const a=Og(e,i,n);a>r&&(r=a)}return r}else if(Tn(t)){const r=Og(e,t.key,n),i=Og(e,t.value,n);return Math.max(r,i)}return 1}const I$=e=>!e||typeof e!="function"&&typeof e!="object";class at extends Dk{constructor(t){super($a),this.value=t}toJSON(t,n){return n?.keep?this.value:qi(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 Eue="tag:yaml.org,2002:";function _ue(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 bh(e,t,n){if(Lv(e)&&(e=e.contents),_n(e))return e;if(Tn(e)){const m=n.schema[To].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:o,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 Mk(d.anchor);d={anchor:null,node:null},u.set(e,d)}t?.startsWith("!!")&&(t=Eue+t.slice(2));let f=_ue(e,t,o.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?o[To]:Symbol.iterator in Object(e)?o[md]:o[To]}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 cy(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 o=[];o[a]=r,r=o}else r=new Map([[a,r]])}return bh(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 Qf=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class L$ extends Dk{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=>_n(r)||Tn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Qf(t))this.add(n);else{const[r,...i]=t,a=this.get(r,!0);if(En(a))a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,cy(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(En(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t,a=this.get(r,!0);return i.length===0?!n&&Jt(a)?a.value:a:En(a)?a.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Tn(n))return!1;const r=n.value;return r==null||t&&Jt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const i=this.get(n,!0);return En(i)?i.hasIn(r):!1}setIn(t,n){const[r,...i]=t;if(i.length===0)this.set(r,n);else{const a=this.get(r,!0);if(En(a))a.setIn(i,n);else if(a===void 0&&this.schema)this.set(r,cy(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const zue=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function bs(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const zl=(e,t,n)=>e.endsWith(`
|
|
118
|
+
`)?bs(n,t):n.includes(`
|
|
119
|
+
`)?`
|
|
120
|
+
`+bs(n,t):(e.endsWith(" ")?"":" ")+n,$$="flow",p1="block",Eg="quoted";function $v(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,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 y,v,w=!1,b=-1,j=-1,k=-1;n===p1&&(b=mP(e,b,t.length),b!==-1&&(m=b+d));for(let C;C=e[b+=1];){if(n===Eg&&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===p1&&(b=mP(e,b,t.length)),m=b+t.length+d,y=void 0;else{if(C===" "&&v&&v!==" "&&v!==`
|
|
122
|
+
`&&v!==" "){const O=e[b+1];O&&O!==" "&&O!==`
|
|
123
|
+
`&&O!==" "&&(y=b)}if(b>=m)if(y)f.push(y),m=y+d,y=void 0;else if(n===Eg){for(;v===" "||v===" ";)v=C,C=e[b+=1],w=!0;const O=b>k+1?b-2:j-1;if(p[O])return e;f.push(O),p[O]=!0,m=O+d,y=void 0}else w=!0}v=C}if(w&&u&&u(),f.length===0)return e;o&&o();let E=e.slice(0,f[0]);for(let C=0;C<f.length;++C){const O=f[C],_=f[C+1]||e.length;O===0?E=`
|
|
124
|
+
${t}${e.slice(0,_)}`:(n===Eg&&p[O]&&(E+=`${e[O]}\\`),E+=`
|
|
125
|
+
${t}${e.slice(O+1,_)}`)}return E}function mP(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 Bv=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Uv=e=>/^(%|---|\.\.\.)/m.test(e);function Tue(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,o=0;a<i;++a)if(e[a]===`
|
|
127
|
+
`){if(a-o>r)return!0;if(o=a+1,i-o<=r)return!1}return!0}function ah(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Uv(e)?" ":"");let o="",u=0;for(let d=0,f=n[d];f;f=n[++d])if(f===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(o+=n.slice(u,d)+"\\ ",d+=1,u=d,f="\\"),f==="\\")switch(n[d+1]){case"u":{o+=n.slice(u,d);const p=n.substr(d+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=n.substr(d,6)}d+=5,u=d+1}break;case"n":if(r||n[d+2]==='"'||n.length<i)d+=1;else{for(o+=n.slice(u,d)+`
|
|
128
|
+
|
|
129
|
+
`;n[d+2]==="\\"&&n[d+3]==="n"&&n[d+4]!=='"';)o+=`
|
|
130
|
+
`,d+=2;o+=a,n[d+2]===" "&&(o+="\\"),d+=1,u=d+1}break;default:d+=1}return o=u?o+n.slice(u):n,r?o:$v(o,a,Eg,Bv(t,!1))}function m1(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
131
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return ah(e,t);const n=t.indent||(Uv(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
132
|
+
${n}`)+"'";return t.implicitKey?r:$v(r,n,$$,Bv(t,!1))}function Cu(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=ah;else{const i=e.includes('"'),a=e.includes("'");i&&!a?r=m1:a&&!i?r=ah:r=n?m1:ah}return r(e,t)}let g1;try{g1=new RegExp(`(^|(?<!
|
|
133
|
+
))
|
|
134
|
+
+(?!
|
|
135
|
+
|$)`,"g")}catch{g1=/\n+(?!\n|$)/g}function _g({comment:e,type:t,value:n},r,i,a){const{blockQuote:o,commentString:u,lineWidth:d}=r.options;if(!o||/\n[\t ]+$/.test(n))return Cu(n,r);const f=r.indent||(r.forceBlockIndent||Uv(n)?" ":""),p=o==="literal"?!0:o==="folded"||t===at.BLOCK_FOLDED?!1:t===at.BLOCK_LITERAL?!0:!Tue(n,d,f.length);if(!n)return p?`|
|
|
136
|
+
`:`>
|
|
137
|
+
`;let m,y;for(y=n.length;y>0;--y){const _=n[y-1];if(_!==`
|
|
138
|
+
`&&_!==" "&&_!==" ")break}let v=n.substring(y);const w=v.indexOf(`
|
|
139
|
+
`);w===-1?m="-":n===v||w!==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(g1,`$&${f}`));let b=!1,j,k=-1;for(j=0;j<n.length;++j){const _=n[j];if(_===" ")b=!0;else if(_===`
|
|
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 O=(b?f?"2":"1":"")+m;if(e&&(O+=" "+u(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const _=n.replace(/\n+/g,`
|
|
142
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let A=!1;const z=Bv(r,!0);o!=="folded"&&t!==at.BLOCK_FOLDED&&(z.onOverflow=()=>{A=!0});const R=$v(`${E}${_}${v}`,f,p1,z);if(!A)return`>${O}
|
|
143
|
+
${f}${R}`}return n=n.replace(/\n+/g,`$&${f}`),`|${O}
|
|
144
|
+
${f}${E}${n}${v}`}function Pue(e,t,n,r){const{type:i,value:a}=e,{actualString:o,implicitKey:u,indent:d,indentStep:f,inFlow:p}=t;if(u&&a.includes(`
|
|
145
|
+
`)||p&&/[[\]{},]/.test(a))return Cu(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return u||p||!a.includes(`
|
|
146
|
+
`)?Cu(a,t):_g(e,t,n,r);if(!u&&!p&&i!==at.PLAIN&&a.includes(`
|
|
147
|
+
`))return _g(e,t,n,r);if(Uv(a)){if(d==="")return t.forceBlockIndent=!0,_g(e,t,n,r);if(u&&d===f)return Cu(a,t)}const m=a.replace(/\n+/g,`$&
|
|
148
|
+
${d}`);if(o){const y=b=>b.default&&b.tag!=="tag:yaml.org,2002:str"&&b.test?.test(m),{compat:v,tags:w}=t.doc.schema;if(w.some(y)||v?.some(y))return Cu(a,t)}return u?m:$v(m,d,$$,Bv(t,!1))}function Ik(e,t,n,r){const{implicitKey:i,inFlow:a}=t,o=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(o.value)&&(u=at.QUOTE_DOUBLE);const d=p=>{switch(p){case at.BLOCK_FOLDED:case at.BLOCK_LITERAL:return i||a?Cu(o.value,t):_g(o,t,n,r);case at.QUOTE_DOUBLE:return ah(o.value,t);case at.QUOTE_SINGLE:return m1(o.value,t);case at.PLAIN:return Pue(o,t,n,r);default:return null}};let f=d(u);if(f===null){const{defaultKeyType:p,defaultStringType:m}=t.options,y=i&&p||m;if(f=d(y),f===null)throw new Error(`Unsupported default string type ${y}`)}return f}function B$(e,t){const n=Object.assign({blockQuote:!0,commentString:zue,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 Rue(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(Jt(t)){r=t.value;let i=e.filter(a=>a.identify?.(r));if(i.length>1){const a=i.filter(o=>o.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 Due(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],a=(Jt(e)||En(e))&&e.anchor;a&&R$(a)&&(n.add(a),i.push(`&${a}`));const o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(" ")}function Yu(e,t,n,r){if(Tn(e))return e.toString(t,n,r);if(gc(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=_n(e)?e:t.doc.createNode(e,{onTagObj:d=>i=d});i??(i=Rue(t.doc.schema.tags,a));const o=Due(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const u=typeof i.stringify=="function"?i.stringify(a,t,n,r):Jt(a)?Ik(a,t,n,r):a.toString(t,n,r);return o?Jt(a)||u[0]==="{"||u[0]==="["?`${o} ${u}`:`${o}
|
|
149
|
+
${t.indent}${u}`:u}function Mue({key:e,value:t},n,r,i){const{allNullValues:a,doc:o,indent:u,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:m}}=n;let y=_n(e)&&e.comment||null;if(m){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(En(e)||!_n(e)&&typeof e=="object"){const z="With simple keys, collection cannot be used as a key value";throw new Error(z)}}let v=!m&&(!e||y&&t==null&&!n.inFlow||En(e)||(Jt(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 w=!1,b=!1,j=Yu(e,n,()=>w=!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 w&&r&&r(),j===""?"?":v?`? ${j}`:j}else if(a&&!m||t==null&&v)return j=`? ${j}`,y&&!w?j+=zl(j,n.indent,f(y)):b&&i&&i(),j;w&&(y=null),v?(y&&(j+=zl(j,n.indent,f(y))),j=`? ${j}
|
|
150
|
+
${u}:`):(j=`${j}:`,y&&(j+=zl(j,n.indent,f(y))));let k,E,C;_n(t)?(k=!!t.spaceBefore,E=t.commentBefore,C=t.comment):(k=!1,E=null,C=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!v&&!y&&Jt(t)&&(n.indentAtStart=j.length+1),b=!1,!p&&d.length>=2&&!n.inFlow&&!v&&Gh(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let O=!1;const _=Yu(t,n,()=>O=!0,()=>b=!0);let A=" ";if(y||k||E){if(A=k?`
|
|
151
|
+
`:"",E){const z=f(E);A+=`
|
|
152
|
+
${bs(z,n.indent)}`}_===""&&!n.inFlow?A===`
|
|
153
|
+
`&&C&&(A=`
|
|
154
|
+
|
|
155
|
+
`):A+=`
|
|
156
|
+
${n.indent}`}else if(!v&&En(t)){const z=_[0],R=_.indexOf(`
|
|
157
|
+
`),$=R!==-1,F=n.inFlow??t.flow??t.items.length===0;if($||!F){let U=!1;if($&&(z==="&"||z==="!")){let B=_.indexOf(" ");z==="&"&&B!==-1&&B<R&&_[B+1]==="!"&&(B=_.indexOf(" ",B+1)),(B===-1||R<B)&&(U=!0)}U||(A=`
|
|
158
|
+
${n.indent}`)}}else(_===""||_[0]===`
|
|
159
|
+
`)&&(A="");return j+=A+_,n.inFlow?O&&r&&r():C&&!O?j+=zl(j,n.indent,f(C)):b&&i&&i(),j}function Iue(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Km="<<",js={identify:e=>e===Km||typeof e=="symbol"&&e.description===Km,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new at(Symbol(Km)),{addToJSMap:U$}),stringify:()=>Km},Lue=(e,t)=>(js.identify(t)||Jt(t)&&(!t.type||t.type===at.PLAIN)&&js.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===js.tag&&n.default);function U$(e,t,n){if(n=e&&gc(n)?n.resolve(e.doc):n,Gh(n))for(const r of n.items)Bw(e,t,r);else if(Array.isArray(n))for(const r of n)Bw(e,t,r);else Bw(e,t,n)}function Bw(e,t,n){const r=e&&gc(n)?n.resolve(e.doc):n;if(!Kh(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[a,o]of i)t instanceof Map?t.has(a)||t.set(a,o):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function q$(e,t,{key:n,value:r}){if(_n(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Lue(e,n))U$(e,t,r);else{const i=qi(n,"",e);if(t instanceof Map)t.set(i,qi(r,i,e));else if(t instanceof Set)t.add(i);else{const a=$ue(n,i,e),o=qi(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function $ue(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(_n(e)&&n?.doc){const r=B$(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)+'..."'),Iue(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 Lk(e,t,n){const r=bh(e,void 0,n),i=bh(t,void 0,n);return new Rr(r,i)}class Rr{constructor(t,n=null){Object.defineProperty(this,Fi,{value:T$}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return _n(n)&&(n=n.clone(t)),_n(r)&&(r=r.clone(t)),new Rr(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return q$(n,r,this)}toString(t,n,r){return t?.doc?Mue(this,t,n,r):JSON.stringify(this)}}function F$(e,t,n){return(t.inFlow??e.flow?Uue:Bue)(e,t,n)}function Bue({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:u}){const{indent:d,options:{commentString:f}}=n,p=Object.assign({},n,{indent:a,type:null});let m=!1;const y=[];for(let w=0;w<t.length;++w){const b=t[w];let j=null;if(_n(b))!m&&b.spaceBefore&&y.push(""),uy(n,y,b.commentBefore,m),b.comment&&(j=b.comment);else if(Tn(b)){const E=_n(b.key)?b.key:null;E&&(!m&&E.spaceBefore&&y.push(""),uy(n,y,E.commentBefore,m))}m=!1;let k=Yu(b,p,()=>j=null,()=>m=!0);j&&(k+=zl(k,a,f(j))),m&&j&&(m=!1),y.push(r+k)}let v;if(y.length===0)v=i.start+i.end;else{v=y[0];for(let w=1;w<y.length;++w){const b=y[w];v+=b?`
|
|
160
|
+
${d}${b}`:`
|
|
161
|
+
`}}return e?(v+=`
|
|
162
|
+
`+bs(f(e),d),u&&u()):m&&o&&o(),v}function Uue({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:a,flowCollectionPadding:o,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 w=0;w<e.length;++w){const b=e[w];let j=null;if(_n(b))b.spaceBefore&&m.push(""),uy(t,m,b.commentBefore,!1),b.comment&&(j=b.comment);else if(Tn(b)){const E=_n(b.key)?b.key:null;E&&(E.spaceBefore&&m.push(""),uy(t,m,E.commentBefore,!1),E.comment&&(f=!0));const C=_n(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=Yu(b,d,()=>j=null);w<e.length-1&&(k+=","),j&&(k+=zl(k,r,u(j))),!f&&(m.length>p||k.includes(`
|
|
163
|
+
`))&&(f=!0),m.push(k),p=m.length}const{start:y,end:v}=n;if(m.length===0)return y+v;if(!f){const w=m.reduce((b,j)=>b+j.length+2,2);f=t.options.lineWidth>0&&w>t.options.lineWidth}if(f){let w=y;for(const b of m)w+=b?`
|
|
164
|
+
${a}${i}${b}`:`
|
|
165
|
+
`;return`${w}
|
|
166
|
+
${i}${v}`}else return`${y}${o}${m.join(" ")}${o}${v}`}function uy({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=bs(t(r),e);n.push(a.trimStart())}}function Tl(e,t){const n=Jt(t)?t.value:t;for(const r of e)if(Tn(r)&&(r.key===t||r.key===n||Jt(r.key)&&r.key.value===n))return r}class $i extends L${static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(To,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:a}=r,o=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)&&o.items.push(Lk(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"&&o.items.sort(t.sortMapEntries),o}add(t,n){let r;Tn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Rr(t,t?.value):r=new Rr(t.key,t.value);const i=Tl(this.items,r.key),a=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Jt(i.value)&&I$(r.value)?i.value.value=r.value:i.value=r.value}else if(a){const o=this.items.findIndex(u=>a(r,u)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=Tl(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Tl(this.items,t)?.value;return(!n&&Jt(i)?i.value:i)??void 0}has(t){return!!Tl(this.items,t)}set(t,n){this.add(new Rr(t,n),!0)}toJSON(t,n,r){const i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(const a of this.items)q$(n,i,a);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!Tn(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})),F$(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const yd={collection:"map",default:!0,nodeClass:$i,tag:"tag:yaml.org,2002:map",resolve(e,t){return Kh(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>$i.from(e,t,n)};class Xl extends L${static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(md,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Gm(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Gm(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Jt(i)?i.value:i}has(t){const n=Gm(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=Gm(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];Jt(i)&&I$(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(qi(a,String(i++),n));return r}toString(t,n,r){return t?F$(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 o=0;for(let u of n){if(typeof i=="function"){const d=n instanceof Set?u:String(o++);u=i.call(n,d,u)}a.items.push(bh(u,void 0,r))}}return a}}function Gm(e){let t=Jt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const vd={collection:"seq",default:!0,nodeClass:Xl,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Gh(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Xl.from(e,t,n)},qv={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),Ik(e,t,n,r)}},Fv={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"&&Fv.test.test(e)?e:t.options.nullStr},$k={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&&$k.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 ma({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 o=a.indexOf(".");o<0&&(o=a.length,a+=".");let u=t-(a.length-o-1);for(;u-- >0;)a+="0"}return a}const H$={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:ma},K$={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():ma(e)}},G$={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:ma},Hv=e=>typeof e=="bigint"||Number.isInteger(e),Bk=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function V$(e,t,n){const{value:r}=e;return Hv(r)&&r>=0?n+r.toString(t):ma(e)}const Q$={identify:e=>Hv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Bk(e,2,8,n),stringify:e=>V$(e,8,"0o")},Y$={identify:Hv,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Bk(e,0,10,n),stringify:ma},Z$={identify:e=>Hv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Bk(e,2,16,n),stringify:e=>V$(e,16,"0x")},que=[yd,vd,qv,Fv,$k,Q$,Y$,Z$,H$,K$,G$];function gP(e){return typeof e=="bigint"||Number.isInteger(e)}const Vm=({value:e})=>JSON.stringify(e),Fue=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Vm},{identify:e=>e==null,createNode:()=>new at(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Vm},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Vm},{identify:gP,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})=>gP(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:Vm}],Hue={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Kue=[yd,vd].concat(Fue,Hue),Uk={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 o=n;let u;if(typeof btoa=="function"){let d="";for(let f=0;f<o.length;++f)d+=String.fromCharCode(o[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,y=0;m<f;++m,y+=d)p[m]=u.substr(y,d);u=p.join(t===at.BLOCK_LITERAL?`
|
|
167
|
+
`:" ")}return Ik({comment:e,type:t,value:u},r,i,a)}};function W$(e,t){if(Gh(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Tn(r)){if(Kh(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new Rr(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]=Tn(r)?r:new Rr(r)}}else t("Expected a sequence for this tag");return e}function X$(e,t,n){const{replacer:r}=n,i=new Xl(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof r=="function"&&(o=r.call(t,String(a++),o));let u,d;if(Array.isArray(o))if(o.length===2)u=o[0],d=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const f=Object.keys(o);if(f.length===1)u=f[0],d=o[u];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else u=o;i.items.push(Lk(u,d,n))}return i}const qk={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:W$,createNode:X$};class Mu extends Xl{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=Mu.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,o;if(Tn(i)?(a=qi(i.key,"",n),o=qi(i.value,a,n)):a=qi(i,"",n),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,o)}return r}static from(t,n,r){const i=X$(t,n,r),a=new this;return a.items=i.items,a}}Mu.tag="tag:yaml.org,2002:omap";const Fk={collection:"seq",identify:e=>e instanceof Map,nodeClass:Mu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=W$(e,t),r=[];for(const{key:i}of n.items)Jt(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Mu,n)},createNode:(e,t,n)=>Mu.from(e,t,n)};function J$({value:e,source:t},n){return t&&(e?eB:tB).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const eB={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:J$},tB={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:J$},Gue={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:ma},Vue={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():ma(e)}},Que={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:ma},Vh=e=>typeof e=="bigint"||Number.isInteger(e);function Kv(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 o=BigInt(e);return i==="-"?BigInt(-1)*o:o}const a=parseInt(e,n);return i==="-"?-1*a:a}function Hk(e,t,n){const{value:r}=e;if(Vh(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return ma(e)}const Yue={identify:Vh,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Kv(e,2,2,n),stringify:e=>Hk(e,2,"0b")},Zue={identify:Vh,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Kv(e,1,8,n),stringify:e=>Hk(e,8,"0")},Wue={identify:Vh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Kv(e,0,10,n),stringify:ma},Xue={identify:Vh,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Kv(e,2,16,n),stringify:e=>Hk(e,16,"0x")};class Iu extends $i{constructor(t){super(t),this.tag=Iu.tag}add(t){let n;Tn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Rr(t.key,null):n=new Rr(t,null),Tl(this.items,n.key)||this.items.push(n)}get(t,n){const r=Tl(this.items,t);return!n&&Tn(r)?Jt(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=Tl(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Rr(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),a.items.push(Lk(o,null,r));return a}}Iu.tag="tag:yaml.org,2002:set";const Kk={collection:"map",identify:e=>e instanceof Set,nodeClass:Iu,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Iu.from(e,t,n),resolve(e,t){if(Kh(e)){if(e.hasAllNullValues(!0))return Object.assign(new Iu,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Gk(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=o=>t?BigInt(o):Number(o),a=r.replace(/_/g,"").split(":").reduce((o,u)=>o*i(60)+i(u),i(0));return n==="-"?i(-1)*a:a}function nB(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return ma(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(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const rB={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})=>Gk(e,n),stringify:nB},iB={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=>Gk(e,!1),stringify:nB},Gv={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(Gv.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,a,o,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,o||0,u||0,d);const p=t[8];if(p&&p!=="Z"){let m=Gk(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$/,"")??""},yP=[yd,vd,qv,Fv,eB,tB,Yue,Zue,Wue,Xue,Gue,Vue,Que,Uk,js,Fk,qk,Kk,rB,iB,Gv],vP=new Map([["core",que],["failsafe",[yd,vd,qv]],["json",Kue],["yaml11",yP],["yaml-1.1",yP]]),xP={binary:Uk,bool:$k,float:G$,floatExp:K$,floatNaN:H$,floatTime:iB,int:Y$,intHex:Z$,intOct:Q$,intTime:rB,map:yd,merge:js,null:Fv,omap:Fk,pairs:qk,seq:vd,set:Kk,timestamp:Gv},Jue={"tag:yaml.org,2002:binary":Uk,"tag:yaml.org,2002:merge":js,"tag:yaml.org,2002:omap":Fk,"tag:yaml.org,2002:pairs":qk,"tag:yaml.org,2002:set":Kk,"tag:yaml.org,2002:timestamp":Gv};function Uw(e,t,n){const r=vP.get(t);if(r&&!e)return n&&!r.includes(js)?r.concat(js):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const a=Array.from(vP.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).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(js)),i.reduce((a,o)=>{const u=typeof o=="string"?xP[o]:o;if(!u){const d=JSON.stringify(o),f=Object.keys(xP).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 ede=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Vk{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:a,sortMapEntries:o,toStringDefaults:u}){this.compat=Array.isArray(t)?Uw(t,"compat"):t?Uw(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=i?Jue:{},this.tags=Uw(n,this.name,r),this.toStringOptions=u??null,Object.defineProperty(this,To,{value:yd}),Object.defineProperty(this,$a,{value:qv}),Object.defineProperty(this,md,{value:vd}),this.sortMapEntries=typeof o=="function"?o:o===!0?ede:null}clone(){const t=Object.create(Vk.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function tde(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=B$(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=a(e.commentBefore);n.unshift(bs(d,""))}let o=!1,u=null;if(e.contents){if(_n(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=a(e.contents.commentBefore);n.push(bs(p,""))}i.forceBlockIndent=!!e.comment,u=e.contents.comment}const d=u?void 0:()=>o=!0;let f=Yu(e.contents,i,()=>u=null,d);u&&(f+=zl(f,"",a(u))),(f[0]==="|"||f[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${f}`:n.push(f)}else n.push(Yu(e.contents,i));if(e.directives?.docEnd)if(e.comment){const d=a(e.comment);d.includes(`
|
|
170
|
+
`)?(n.push("..."),n.push(bs(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&o&&(d=d.replace(/^\n+/,"")),d&&((!o||u)&&n[n.length-1]!==""&&n.push(""),n.push(bs(a(d),"")))}return n.join(`
|
|
171
|
+
`)+`
|
|
172
|
+
`}class Vv{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Fi,{value:h1});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:o}=a;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new _r({version:o}),this.setSchema(o,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(Vv.prototype,{[Fi]:{value:h1}});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=_n(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){lu(this.contents)&&this.contents.add(t)}addIn(t,n){lu(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=D$(this);t.anchor=!n||r.has(n)?M$(n||"a",r):n}return new Mk(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:o,flow:u,keepUndefined:d,onTagObj:f,tag:p}=r??{},{onAnchor:m,setAnchors:y,sourceObjects:v}=Oue(this,o||"a"),w={aliasDuplicateObjects:a??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:v},b=bh(t,p,w);return u&&En(b)&&(b.flow=!0),y(),b}createPair(t,n,r={}){const i=this.createNode(t,null,r),a=this.createNode(n,null,r);return new Rr(i,a)}delete(t){return lu(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Qf(t)?this.contents==null?!1:(this.contents=null,!0):lu(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return En(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Qf(t)?!n&&Jt(this.contents)?this.contents.value:this.contents:En(this.contents)?this.contents.getIn(t,n):void 0}has(t){return En(this.contents)?this.contents.has(t):!1}hasIn(t){return Qf(t)?this.contents!==void 0:En(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=cy(this.schema,[t],n):lu(this.contents)&&this.contents.set(t,n)}setIn(t,n){Qf(t)?this.contents=n:this.contents==null?this.contents=cy(this.schema,Array.from(t),n):lu(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 _r({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 _r({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 Vk(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:o}={}){const u={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},d=qi(this.contents,n??"",u);if(typeof a=="function")for(const{count:f,res:p}of u.anchors.values())a(p,f);return typeof o=="function"?ku(o,{"":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 tde(this,t)}}function lu(e){if(En(e))return!0;throw new Error("Expected a YAML collection as document contents")}class aB extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class Qm extends aB{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class nde extends aB{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const bP=(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,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){const u=Math.min(a-39,o.length-79);o="…"+o.substring(u),a-=u-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,a))){let u=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);u.length>80&&(u=u.substring(0,79)+`…
|
|
173
|
+
`),o=u+o}if(/[^ ]/.test(o)){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
|
+
${o}
|
|
176
|
+
${f}
|
|
177
|
+
`}};function Zu(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:u}){let d=!1,f=u,p=u,m="",y="",v=!1,w=!1,b=null,j=null,k=null,E=null,C=null,O=null,_=null;for(const R of e)switch(w&&(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma"&&a(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),b&&(f&&R.type!=="comment"&&R.type!=="newline"&&a(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),R.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&R.source.includes(" ")&&(b=R),p=!0;break;case"comment":{p||a(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const $=R.source.substring(1)||" ";m?m+=y+$:m=$,y="",f=!1;break}case"newline":f?m?m+=R.source:(!O||n!=="seq-item-ind")&&(d=!0):y+=R.source,f=!0,v=!0,(j||k)&&(E=R),p=!0;break;case"anchor":j&&a(R,"MULTIPLE_ANCHORS","A node can have at most one anchor"),R.source.endsWith(":")&&a(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),j=R,_??(_=R.offset),f=!1,p=!1,w=!0;break;case"tag":{k&&a(R,"MULTIPLE_TAGS","A node can have at most one tag"),k=R,_??(_=R.offset),f=!1,p=!1,w=!0;break}case n:(j||k)&&a(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),O&&a(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${t??"collection"}`),O=R,f=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){C&&a(R,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),C=R,f=!1,p=!1;break}default:a(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),f=!1,p=!1}const A=e[e.length-1],z=A?A.offset+A.source.length:i;return w&&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<=o||r?.type==="block-map"||r?.type==="block-seq")&&a(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:C,found:O,spaceBefore:d,comment:m,hasNewline:v,anchor:j,tag:k,newlineAfterProp:E,end:z,start:_??z}}function wh(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(wh(t.key)||wh(t.value))return!0}return!1;default:return!0}}function y1(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&wh(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function sB(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(a,o)=>a===o||Jt(a)&&Jt(o)&&a.value===o.value;return t.some(a=>i(a.key,n))}const wP="All mapping items must start at the same column";function rde({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??$i,u=new o(n.schema);n.atRoot&&(n.atRoot=!1);let d=r.offset,f=null;for(const p of r.items){const{start:m,key:y,sep:v,value:w}=p,b=Zu(m,{indicator:"explicit-key-ind",next:y??v?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0}),j=!b.found;if(j){if(y&&(y.type==="block-seq"?i(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==r.indent&&i(d,"BAD_INDENT",wP)),!b.anchor&&!b.tag&&!v){f=b.end,b.comment&&(u.comment?u.comment+=`
|
|
179
|
+
`+b.comment:u.comment=b.comment);continue}(b.newlineAfterProp||wh(y))&&i(y??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",wP);n.atKey=!0;const k=b.end,E=y?e(n,y,b,i):t(n,k,m,null,b,i);n.schema.compat&&y1(r.indent,y,i),n.atKey=!1,sB(n,u.items,E)&&i(k,"DUPLICATE_KEY","Map keys must be unique");const C=Zu(v??[],{indicator:"map-value-ind",next:w,offset:E.range[2],onError:i,parentIndent:r.indent,startOnNewline:!y||y.type==="block-scalar"});if(d=C.end,C.found){j&&(w?.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 O=w?e(n,w,C,i):t(n,d,v,null,C,i);n.schema.compat&&y1(r.indent,w,i),d=O.range[2];const _=new Rr(E,O);n.options.keepSourceTokens&&(_.srcToken=p),u.items.push(_)}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 O=new Rr(E);n.options.keepSourceTokens&&(O.srcToken=p),u.items.push(O)}}return f&&f<d&&i(f,"IMPOSSIBLE","Map comment with trailing content"),u.range=[r.offset,d,f??d],u}function ide({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??Xl,u=new o(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 y=Zu(p,{indicator:"seq-item-ind",next:m,offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||m)m?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(d,"MISSING_CHAR","Sequence item without - indicator");else{f=y.end,y.comment&&(u.comment=y.comment);continue}const v=m?e(n,m,y,i):t(n,y.end,p,null,y,i);n.schema.compat&&y1(r.indent,m,i),d=v.range[2],u.items.push(v)}return u.range=[r.offset,d,f??d],u}function Qh(e,t,n,r){let i="";if(e){let a=!1,o="";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+=o+p:i=p,o="";break}case"newline":i&&(o+=d),a=!0;break;default:r(u,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=d.length}}return{comment:i,offset:t}}const qw="Block collections are not allowed within flow collections",Fw=e=>e&&(e.type==="block-map"||e.type==="block-seq");function ade({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=r.start.source==="{",u=o?"flow map":"flow sequence",d=a?.nodeClass??(o?$i:Xl),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:O,value:_}=k,A=Zu(E,{flow:u,indicator:"explicit-key-ind",next:C??O?.[0],offset:m,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!O&&!_){j===0&&A.comma?i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`):j<r.items.length-1&&i(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${u}`),A.comment&&(f.comment?f.comment+=`
|
|
181
|
+
`+A.comment:f.comment=A.comment),m=A.end;continue}!o&&n.options.strict&&wh(C)&&i(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(j===0)A.comma&&i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`);else if(A.comma||i(A.start,"MISSING_CHAR",`Missing , between ${u} items`),A.comment){let z="";e:for(const R of E)switch(R.type){case"comma":case"space":break;case"comment":z=R.source.substring(1);break e;default:break e}if(z){let R=f.items[f.items.length-1];Tn(R)&&(R=R.value??R.key),R.comment?R.comment+=`
|
|
182
|
+
`+z:R.comment=z,A.comment=A.comment.substring(z.length+1)}}if(!o&&!O&&!A.found){const z=_?e(n,_,A,i):t(n,A.end,O,null,A,i);f.items.push(z),m=z.range[2],Fw(_)&&i(z.range,"BLOCK_IN_FLOW",qw)}else{n.atKey=!0;const z=A.end,R=C?e(n,C,A,i):t(n,z,E,null,A,i);Fw(C)&&i(R.range,"BLOCK_IN_FLOW",qw),n.atKey=!1;const $=Zu(O??[],{flow:u,indicator:"map-value-ind",next:_,offset:R.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if($.found){if(!o&&!A.found&&n.options.strict){if(O)for(const B of O){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}}A.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 _&&("source"in _&&_.source?.[0]===":"?i(_,"MISSING_CHAR",`Missing space after : in ${u}`):i($.start,"MISSING_CHAR",`Missing , or : between ${u} items`));const F=_?e(n,_,$,i):$.found?t(n,$.end,O,null,$,i):null;F?Fw(_)&&i(F.range,"BLOCK_IN_FLOW",qw):$.comment&&(R.comment?R.comment+=`
|
|
183
|
+
`+$.comment:R.comment=$.comment);const U=new Rr(R,F);if(n.options.keepSourceTokens&&(U.srcToken=k),o){const B=f;sB(n,B.items,R)&&i(z,"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??R).range;B.range=[R.range[0],V[1],V[2]],f.items.push(B)}m=F?F.range[2]:$.end}}const y=o?"}":"]",[v,...w]=r.end;let b=m;if(v?.source===y)b=v.offset+v.source.length;else{const j=u[0].toUpperCase()+u.substring(1),k=p?`${j} must end with a ${y}`:`${j} in block collection must be sufficiently indented and end with a ${y}`;i(m,p?"MISSING_CHAR":"BAD_INDENT",k),v&&v.source.length!==1&&w.unshift(v)}if(w.length>0){const j=Qh(w,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 Hw(e,t,n,r,i,a){const o=n.type==="block-map"?rde(e,t,n,r,a):n.type==="block-seq"?ide(e,t,n,r,a):ade(e,t,n,r,a),u=o.constructor;return i==="!"||i===u.tagName?(o.tag=u.tagName,o):(i&&(o.tag=i),o)}function sde(e,t,n,r,i){const a=r.tag,o=a?t.directives.tagName(a.source,y=>i(a,"TAG_RESOLVE_FAILED",y)):null;if(n.type==="block-seq"){const{anchor:y,newlineAfterProp:v}=r,w=y&&a?y.offset>a.offset?y:a:y??a;w&&(!v||v.offset<w.offset)&&i(w,"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||!o||o==="!"||o===$i.tagName&&u==="map"||o===Xl.tagName&&u==="seq")return Hw(e,t,n,i,o);let d=t.schema.tags.find(y=>y.tag===o&&y.collection===u);if(!d){const y=t.schema.knownTags[o];if(y?.collection===u)t.schema.tags.push(Object.assign({},y,{default:!1})),d=y;else return y?i(a,"BAD_COLLECTION_TYPE",`${y.tag} used for ${u} collection, but expects ${y.collection??"scalar"}`,!0):i(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Hw(e,t,n,i,o)}const f=Hw(e,t,n,i,o,d),p=d.resolve?.(f,y=>i(a,"TAG_RESOLVE_FAILED",y),t.options)??f,m=_n(p)?p:new at(p);return m.range=f.range,m.tag=o,d?.format&&(m.format=d.format),m}function ode(e,t,n){const r=t.offset,i=lde(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,o=t.source?cde(t.source):[];let u=o.length;for(let b=o.length-1;b>=0;--b){const j=o[b][1];if(j===""||j==="\r")u=b;else break}if(u===0){const b=i.chomp==="+"&&o.length>0?`
|
|
185
|
+
`.repeat(Math.max(1,o.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]=o[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=o.length-1;b>=u;--b)o[b][0].length>d&&(u=b+1);let m="",y="",v=!1;for(let b=0;b<p;++b)m+=o[b][0].slice(d)+`
|
|
186
|
+
`;for(let b=p;b<u;++b){let[j,k]=o[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 O=`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",O),j=""}a===at.BLOCK_LITERAL?(m+=y+j.slice(d)+k,y=`
|
|
187
|
+
`):j.length>d||k[0]===" "?(y===" "?y=`
|
|
188
|
+
`:!v&&y===`
|
|
189
|
+
`&&(y=`
|
|
190
|
+
|
|
191
|
+
`),m+=y+j.slice(d)+k,y=`
|
|
192
|
+
`,v=!0):k===""?y===`
|
|
193
|
+
`?m+=`
|
|
194
|
+
`:y=`
|
|
195
|
+
`:(m+=y+k,y=" ",v=!1)}switch(i.chomp){case"-":break;case"+":for(let b=u;b<o.length;++b)m+=`
|
|
196
|
+
`+o[b][0].slice(d);m[m.length-1]!==`
|
|
197
|
+
`&&(m+=`
|
|
198
|
+
`);break;default:m+=`
|
|
199
|
+
`}const w=r+i.length+t.source.length;return{value:m,type:a,comment:i.comment,range:[r,w,w]}}function lde({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 o=0,u="",d=-1;for(let y=1;y<i.length;++y){const v=i[y];if(!u&&(v==="-"||v==="+"))u=v;else{const w=Number(v);!o&&w?o=w:d===-1&&(d=e+y)}}d!==-1&&r(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let f=!1,p="",m=i.length;for(let y=1;y<t.length;++y){const v=t[y];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 w=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",w);const b=v.source;b&&typeof b=="string"&&(m+=b.length)}}}return{mode:a,indent:o,chomp:u,comment:p,length:m}}function cde(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 o=1;o<t.length;o+=2)a.push([t[o],t[o+1]]);return a}function ude(e,t,n){const{offset:r,type:i,source:a,end:o}=e;let u,d;const f=(y,v,w)=>n(r+y,v,w);switch(i){case"scalar":u=at.PLAIN,d=dde(a,f);break;case"single-quoted-scalar":u=at.QUOTE_SINGLE,d=fde(a,f);break;case"double-quoted-scalar":u=at.QUOTE_DOUBLE,d=hde(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=Qh(o,p,t,n);return{value:d,type:u,comment:m.comment,range:[r,p,m.offset]}}function dde(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}`),oB(e)}function fde(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),oB(e.slice(1,-1)).replace(/''/g,"'")}function oB(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=" ",o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===""?a===`
|
|
202
|
+
`?i+=a:a=`
|
|
203
|
+
`:(i+=a+r[1],a=" "),o=n.lastIndex;const u=/[ \t]*(.*)/sy;return u.lastIndex=o,r=u.exec(e),i+a+(r?.[1]??"")}function hde(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:o}=pde(e,r);n+=a,r=o}else if(i==="\\"){let a=e[++r];const o=mde[a];if(o)n+=o;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+=gde(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 o=e[r+1];for(;o===" "||o===" ";)o=e[++r+1];o!==`
|
|
208
|
+
`&&!(o==="\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 pde(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 mde={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
214
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function gde(e,t,n,r){const i=e.substr(t,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const u=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),u}return String.fromCodePoint(o)}function lB(e,t,n,r){const{value:i,type:a,comment:o,range:u}=t.type==="block-scalar"?ode(e,t,r):ude(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[$a]:d?f=yde(e.schema,i,d,n,r):t.type==="scalar"?f=vde(e,i,t,r):f=e.schema[$a];let p;try{const m=f.resolve(i,y=>r(n??t,"TAG_RESOLVE_FAILED",y),e.options);p=Jt(m)?m:new at(m)}catch(m){const y=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",y),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),o&&(p.comment=o),p}function yde(e,t,n,r,i){if(n==="!")return e[$a];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 o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[$a])}function vde({atKey:e,directives:t,schema:n},r,i,a){const o=n.tags.find(u=>(u.default===!0||e&&u.default==="key")&&u.test?.test(r))||n[$a];if(n.compat){const u=n.compat.find(d=>d.default&&d.test?.test(r))??n[$a];if(o.tag!==u.tag){const d=t.tagString(o.tag),f=t.tagString(u.tag),p=`Value may be parsed as either ${d} or ${f}`;a(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}function xde(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 bde={composeNode:cB,composeEmptyNode:Qk};function cB(e,t,n,r){const i=e.atKey,{spaceBefore:a,comment:o,anchor:u,tag:d}=n;let f,p=!0;switch(t.type){case"alias":f=wde(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=lB(e,t,d,r),u&&(f.anchor=u.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=sde(bde,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=Qk(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&&(!Jt(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),o&&(t.type==="scalar"&&t.source===""?f.comment=o:f.commentBefore=o),e.options.keepSourceTokens&&p&&(f.srcToken=t),f}function Qk(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:u,end:d},f){const p={type:"scalar",offset:xde(t,n,r),indent:-1,source:""},m=lB(e,p,u,f);return o&&(m.anchor=o.source.substring(1),m.anchor===""&&f(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(m.spaceBefore=!0),a&&(m.comment=a,m.range[2]=d),m}function wde({options:e},{offset:t,source:n,end:r},i){const a=new Mk(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 o=t+n.length,u=Qh(r,o,e.strict,i);return a.range=[t,o,u.offset],u.comment&&(a.comment=u.comment),a}function Sde(e,t,{offset:n,start:r,value:i,end:a},o){const u=Object.assign({_directives:t},e),d=new Vv(void 0,u),f={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=Zu(r,{indicator:"doc-start",next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(d.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=i?cB(f,i,p,o):Qk(f,p.end,r,null,p,o);const m=d.contents.range[2],y=Qh(a,m,!1,o);return y.comment&&(d.comment=y.comment),d.range=[n,m,y.offset],d}function Pf(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 SP(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 jde{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,a)=>{const o=Pf(n);a?this.warnings.push(new nde(o,r,i)):this.errors.push(new Qm(o,r,i))},this.directives=new _r({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=SP(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(En(a)&&!a.flow&&a.items.length>0){let o=a.items[0];Tn(o)&&(o=o.key);const u=o.commentBefore;o.commentBefore=u?`${r}
|
|
219
|
+
${u}`:r}else{const o=a.commentBefore;a.commentBefore=o?`${r}
|
|
220
|
+
${o}`: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:SP(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=Pf(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=Sde(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 Qm(Pf(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 Qm(Pf(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Qh(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 Qm(Pf(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 Vv(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 uB="\uFEFF",dB="",fB="",v1="";function Nde(e){switch(e){case uB:return"byte-order-mark";case dB:return"doc-mode";case fB:return"flow-error-end";case v1: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 na(e){switch(e){case void 0:case" ":case`
|
|
224
|
+
`:case"\r":case" ":return!0;default:return!1}}const jP=new Set("0123456789ABCDEFabcdef"),kde=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ym=new Set(",[]{}"),Cde=new Set(` ,[]{}
|
|
225
|
+
\r `),Kw=e=>!e||Cde.has(e);class Ade{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==="...")&&na(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]===uB&&(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 dB,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==="...")&&na(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&&!na(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===":")&&na(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(Kw),"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("..."))&&na(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield fB,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(Kw),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||na(o)||o===",")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=>na(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 o=this.buffer[a+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
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,o=this.buffer[a];o==="\r"&&(o=this.buffer[--a]);const u=a;for(;o===" ";)o=this.buffer[--a];if(o===`
|
|
237
|
+
`&&a>=this.pos&&a+1+n>u)t=a;else break}while(!0);return yield v1,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(na(a)||t&&Ym.has(a))break;n=r}else if(na(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&&Ym.has(a))break;if(i===`
|
|
240
|
+
`){const o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(t&&Ym.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield v1,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(Kw))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(na(n)||t&&Ym.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(;!na(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(kde.has(n))n=this.buffer[++t];else if(n==="%"&&jP.has(this.buffer[t+1])&&jP.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 Ode{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 vo(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function NP(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 hB(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 Zm(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 cu(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 kP(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!vo(t.start,"explicit-key-ind")&&!vo(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,hB(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 Ede{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 Ade,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=Nde(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"&&kP(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&&NP(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":{NP(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=Zm(this.peek(2)),r=cu(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 o=[];for(let u=0;u<n.sep.length;++u){const d=n.sep[u];switch(d.type){case"newline":o.push(u);break;case"space":break;case"comment":d.indent>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=n.sep.splice(o[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(vo(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(hB(n.key)&&!vo(n.sep,"newline")){const o=cu(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:o,key:u,sep:d}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(vo(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=cu(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):vo(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 o=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!vo(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(o);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||vo(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=Zm(r),a=cu(i);kP(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const u={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:o}]};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=Zm(t),r=cu(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=Zm(t),r=cu(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 _de(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Ode||null,prettyErrors:t}}function zde(e,t={}){const{lineCounter:n,prettyErrors:r}=_de(t),i=new Ede(n?.addNewLine),a=new jde(t),o=Array.from(a.compose(i.parse(e)));if(r&&n)for(const u of o)u.errors.forEach(bP(e,n)),u.warnings.forEach(bP(e,n));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function Tde({onApplied:e}){const[t,n]=x.useState(""),[r,i]=x.useState(!1),[a,o]=x.useState([]),[u,d]=x.useState([]),f=async()=>{if(!t.trim())return;i(!0),o([]),d([]);const p=zde(t),m=[],y=[];for(let v=0;v<p.length;v++){const w=p[v];if(w.errors.length>0){m.push(`Document ${v+1}: ${w.errors[0]?.message}`);continue}const b=w.toJSON();if(!(!b||typeof b!="object"))try{const j=await hV(b);y.push(`Applied "${j.displayName||j.name}" (revision ${j.configRevision})`)}catch(j){m.push(`Document ${v+1}: ${j instanceof Error?j.message:String(j)}`)}}o(y),d(m),i(!1),y.length>0&&(bt({title:"YAML applied",detail:`Applied ${y.length} document${y.length===1?"":"s"} successfully.`,tone:m.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return l.jsxs("section",{className:"mt-8",children:[l.jsx("div",{className:"page-section-divider"}),l.jsx("div",{className:"section-head mt-6",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),l.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),l.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",l.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",l.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),l.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&&l.jsx("ul",{className:"mt-2 space-y-1",children:a.map((p,m)=>l.jsx("li",{className:"text-emerald-400 text-sm",children:p},m))}),u.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:u.map((p,m)=>l.jsx("li",{className:"text-rose-400 text-sm",children:p},m))}),l.jsx("div",{className:"mt-3",children:l.jsx(me,{type:"button",disabled:!t.trim()||r,onClick:f,children:r?"Applying...":"Apply"})})]})}function Pde(){const{dashboard:e,isLoading:t,refetch:n}=pc();if(!e||t)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-28"}),l.jsx("div",{className:"skeleton-text-sm w-40"})]}),l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[l.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(z=>l.jsx("div",{className:"skeleton-text-sm w-16"},z))}),[1,2,3].map(z=>l.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[l.jsxs("div",{className:"flex-1 space-y-1",children:[l.jsx("div",{className:"skeleton-text w-28"}),l.jsx("div",{className:"skeleton-text-sm w-16"})]}),l.jsx("div",{className:"skeleton-text w-24"}),l.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),l.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),l.jsx("div",{className:"skeleton-text-sm w-8"})]},z))]})]});const r=e.projects,i=qo(),[a,o]=x.useState(!1),[u,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,w]=x.useState("US"),[b,j]=x.useState("en"),[k,E]=x.useState(!1),[C,O]=x.useState(null),_=u.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),A=async()=>{if(!(!_||!m)){E(!0),O(null);try{const z=await vv(_,{displayName:f||u,canonicalDomain:m,country:v,language:b});bt({title:"Project created",detail:`${z.displayName||z.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${z.name}`,dedupeMode:"drop"}),n(),d(""),p(""),y(""),w("US"),j("en"),o(!1),i({to:"/projects/$projectId",params:{projectId:z.id}})}catch(z){O(z instanceof Error?z.message:"Failed to create project")}finally{E(!1)}}};return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Projects"}),l.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),l.jsx("div",{className:"page-header-right",children:l.jsxs(me,{type:"button",onClick:()=>o(z=>!z),children:[l.jsx(Qg,{className:"size-4 mr-1.5"}),"Add project"]})})]}),a?l.jsxs(ze,{className:"surface-card mb-6",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),l.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),l.jsxs("div",{className:"compact-stack mt-4",children:[l.jsxs("div",{className:"setup-field-row",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),l.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:u,onChange:z=>d(z.target.value)}),_&&_!==u?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",_]}):null]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),l.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:f,onChange:z=>p(z.target.value)})]})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),l.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:m,onChange:z=>y(z.target.value)})]}),l.jsxs("div",{className:"setup-field-row",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),l.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:v,onChange:z=>w(z.target.value.toUpperCase())})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),l.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:b,onChange:z=>j(z.target.value.toLowerCase())})]})]})]}),C?l.jsx("p",{className:"text-rose-400 text-sm mt-3",children:C}):null,l.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[l.jsx(me,{type:"button",disabled:!_||!m||k,onClick:A,children:k?"Creating...":"Create project"}),l.jsx(me,{type:"button",variant:"ghost",onClick:()=>o(!1),children:"Cancel"})]})]}):null,r.length>0?l.jsx("div",{className:"data-table-wrapper",children:l.jsxs("table",{className:"data-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Name"}),l.jsx("th",{children:"Domain"}),l.jsx("th",{children:"Visibility"}),l.jsx("th",{children:"Last run"}),l.jsx("th",{className:"text-right",children:"Country"})]})}),l.jsx("tbody",{children:r.map(z=>{const R=z.recentRuns[0];return l.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:z.project.id}}),children:[l.jsxs("td",{children:[l.jsx(At,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:$=>$.stopPropagation(),children:z.project.displayName||z.project.name}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:z.project.name})]}),l.jsx("td",{className:"text-zinc-400",children:z.project.canonicalDomain}),l.jsx("td",{children:l.jsx(pt,{tone:z.visibilitySummary.tone,children:z.visibilitySummary.value})}),l.jsx("td",{className:"text-zinc-500 text-sm",children:R?l.jsx(Av,{status:R.status}):l.jsx("span",{className:"text-zinc-600",children:"No runs"})}),l.jsx("td",{className:"text-right text-zinc-500",children:z.project.country})]},z.project.id)})})]})}):a?null:l.jsxs(ze,{className:"surface-card empty-card",children:[l.jsx("h3",{children:"No projects yet"}),l.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),l.jsxs(me,{type:"button",onClick:()=>o(!0),children:[l.jsx(Qg,{className:"size-4 mr-1.5"}),"Add project"]})]}),l.jsx(Tde,{onApplied:()=>{n()}})]})}function x1({state:e,label:t}){return l.jsx(pt,{tone:Fte(e),children:t??Nv(e)})}function pB({run:e}){const{openRun:t}=fd();return l.jsxs("article",{className:"run-row",children:[l.jsxs("div",{className:"run-row-main",children:[l.jsxs("div",{className:"run-row-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:e.summary}),l.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),l.jsx(Av,{status:e.status})]}),l.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),l.jsxs("dl",{className:"run-row-meta",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Started"}),l.jsx("dd",{children:e.startedAt})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Duration"}),l.jsx("dd",{children:e.duration})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Trigger"}),l.jsx("dd",{children:e.triggerLabel})]})]}),l.jsx(me,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function zg({value:e,label:t,delta:n,tone:r,description:i,tooltip:a,isNumeric:o=!0,progress:u,providerCoverage:d}){const m=2*Math.PI*48,y=Number.parseInt(e,10),v=typeof u=="number"&&Number.isFinite(u)?Math.min(Math.max(u,0),100)/100:o&&!Number.isNaN(y)?Math.min(y/100,1):.5,w=m*(1-v);return l.jsxs("div",{className:"score-gauge",children:[l.jsxs("div",{className:"gauge-ring-wrapper",children:[l.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[l.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),l.jsx("circle",{className:`gauge-fill gauge-fill-${r}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:m,strokeDashoffset:w,transform:"rotate(-90 60 60)"})]}),l.jsx("div",{className:"gauge-center",children:l.jsx("span",{className:o?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),l.jsxs("p",{className:"gauge-label",children:[t,a&&l.jsx(lr,{text:a})]}),l.jsx("p",{className:"gauge-delta",children:n}),d&&l.jsx("p",{className:"gauge-provider-coverage",children:d}),l.jsx("p",{className:"gauge-description",children:i})]})}function CP({history:e,maxDots:t=12}){const n=e.slice(-t);if(n.length===0)return l.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 l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:i}),l.jsx("div",{className:"flex items-center gap-[3px]",title:`${n.length} runs`,children:n.map((o,u)=>l.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[o.citationState]??"bg-zinc-700"} ${o.model&&u>0&&n[u-1]?.model&&n[u-1].model!==o.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[o.citationState,new Date(o.createdAt).toLocaleDateString(),o.model?`model ${o.model}`:null,o.model&&u>0&&n[u-1]?.model&&n[u-1].model!==o.model?"model changed":null].filter(Boolean).join(" — ")},u))}),l.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:a})]})}function Rde(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 AP(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 OP(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 EP(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 o=0;for(let u=e.length-1;u>=0&&e[u].citationState===i;u--)o++;return i==="cited"?o<=1?`${r} in latest run`:`${r} for ${o} runs`:o<=1?`Not ${n} in latest run`:`Not ${n} across ${o} runs`}function Dde(e,t){return t==="citations"?e:e.map(n=>({...n,citationState:AP(n,t),runHistory:n.runHistory.map(r=>({...r,citationState:AP(r,t)}))}))}function Mde({evidence:e}){const{openEvidence:t}=fd(),[n,r]=x.useState(new Set),[i,a]=x.useState("citations"),o=x.useMemo(()=>{const m=Dde(e,i),y=new Map;for(const v of m){const w=y.get(v.query)??[];y.set(v.query,[...w,v])}return[...y.entries()].map(([v,w])=>({phrase:v,items:w}))},[e,i]),u=m=>{r(y=>{const v=new Set(y);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 l.jsxs("div",{children:[l.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"View by"}),l.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:[l.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"}),l.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"})]}),l.jsx("span",{className:"text-[11px] text-zinc-500",children:i==="mentions"?"Brand or domain in answer text":"Brand or domain in source links"})]}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{style:{width:"2rem"}}),l.jsx("th",{children:"Query"}),l.jsx("th",{children:"Status"}),l.jsx("th",{children:f}),l.jsx("th",{children:"Change"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:o.map(({phrase:m,items:y})=>{const v=n.has(m),w=y.map(C=>C.citationState),b=w.includes("cited")?"cited":w.includes("emerging")?"emerging":w.includes("lost")?"lost":w.every(C=>C==="pending")?"pending":"not-cited",j=Rde(y),k=y.filter(C=>C.citationState===gh.cited||C.citationState==="emerging").length,E=EP(j,i);return l.jsxs(x.Fragment,{children:[l.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>u(m),"aria-expanded":v,children:[l.jsx("td",{children:l.jsx(Bh,{size:14,className:`transition-transform duration-150 text-zinc-500 ${v?"rotate-90":""}`})}),l.jsx("td",{className:"evidence-query-cell",children:l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-zinc-100",children:m}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:y.map(C=>l.jsx(Zl,{provider:C.provider},C.id))})]})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(x1,{state:b,label:OP(b,i)}),l.jsxs("span",{className:"text-[11px] text-zinc-500",title:`${k} of ${y.length} engines ${p}`,children:[k,"/",y.length]})]})}),l.jsx("td",{children:l.jsx(CP,{history:j})}),l.jsx("td",{className:"evidence-change-cell",children:E}),l.jsx("td",{})]}),v&&y.map(C=>l.jsxs("tr",{className:"bg-zinc-900/30",children:[l.jsx("td",{}),l.jsx("td",{className:"evidence-query-cell pl-5",children:l.jsx(Zl,{provider:C.provider})}),l.jsx("td",{children:l.jsx(x1,{state:C.citationState,label:OP(C.citationState,i)})}),l.jsx("td",{children:l.jsx(CP,{history:C.runHistory})}),l.jsx("td",{className:"evidence-change-cell",children:EP(C.runHistory,i)}),l.jsx("td",{children:l.jsx(me,{variant:"ghost",size:"sm",type:"button",onClick:O=>{O.stopPropagation(),t(C.id)},children:"View"})})]},C.id))]},m)})})]})}),l.jsxs("p",{className:"sr-only","aria-live":"polite",children:["Showing ",d==="cited"?"citations (sources)":"mentions (answer text)","."]})]})}function Ide({competitors:e}){return e.length===0?l.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):l.jsx("div",{className:"competitor-table-wrap",children:l.jsxs("table",{className:"competitor-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Domain"}),l.jsx("th",{children:"Pressure"}),l.jsx("th",{children:"Citations"}),l.jsx("th",{children:"Queries"})]})}),l.jsx("tbody",{children:e.map(t=>l.jsxs("tr",{children:[l.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),l.jsx("td",{children:l.jsx(pt,{tone:Hte(t.pressureLabel),children:t.pressureLabel})}),l.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalQueries>0?`${t.citationCount} / ${t.totalQueries}`:"—"}),l.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedQueries.length>0?t.citedQueries.join(", "):"Not cited"})]},t.id))})]})})}function _P({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:a,coverageValue:o,note:u,updatedAt:d,active:f,onClick:p}){return l.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:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),l.jsx("h3",{children:t})]}),l.jsx(pt,{tone:r,children:n})]}),l.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:i}),l.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:a})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:o})]})]}),l.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:[l.jsx("span",{children:u}),l.jsx("span",{children:d?`Updated ${sa(d)}`:"No recent sync yet"})]})]})}function Wm({label:e,value:t,tone:n}){const r=n==="positive"?"text-emerald-400":n==="negative"?"text-rose-400":"text-zinc-200";return l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),l.jsx("p",{className:`mt-2 text-2xl font-semibold ${r}`,children:t})]})}var Lde=["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 Yk(e){if(typeof e!="string")return!1;var t=Lde;return t.includes(e)}var $de=["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"],Bde=new Set($de);function mB(e){return typeof e!="string"?!1:Bde.has(e)}function gB(e){return typeof e=="string"&&e.startsWith("data-")}function Hi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(mB(n)||gB(n))&&(t[n]=e[n]);return t}function Yh(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Hi(t)}return typeof e=="object"&&!Array.isArray(e)?Hi(e):null}function Dr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(mB(n)||gB(n)||Yk(n))&&(t[n]=e[n]);return t}function Ude(e){return e==null?null:x.isValidElement(e)?Dr(e.props):typeof e=="object"&&!Array.isArray(e)?Dr(e):null}var qde=["children","width","height","viewBox","className","style","title","desc"];function b1(){return b1=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},b1.apply(null,arguments)}function Fde(e,t){if(e==null)return{};var n,r,i=Hde(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 Hde(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 Zk=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:u,title:d,desc:f}=e,p=Fde(e,qde),m=a||{width:r,height:i,x:0,y:0},y=Rt("recharts-surface",o);return x.createElement("svg",b1({},Dr(p),{className:y,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)}),Kde=["children","className"];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 Gde(e,t){if(e==null)return{};var n,r,i=Vde(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 Vde(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 xr=x.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Gde(e,Kde),a=Rt("recharts-layer",r);return x.createElement("g",w1({className:a},Dr(i),{ref:t}),n)}),yB=x.createContext(null),Qde=()=>x.useContext(yB);function Wt(e){return function(){return e}}const vB=Math.cos,dy=Math.sin,ga=Math.sqrt,fy=Math.PI,Qv=2*fy,S1=Math.PI,j1=2*S1,Nl=1e-6,Yde=j1-Nl;function xB(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Zde(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return xB;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 Wde{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?xB:Zde(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,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}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 o=this._x1,u=this._y1,d=r-t,f=i-n,p=o-t,m=u-n,y=p*p+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(y>Nl)if(!(Math.abs(m*d-f*p)>Nl)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-o,w=i-u,b=d*d+f*f,j=v*v+w*w,k=Math.sqrt(b),E=Math.sqrt(y),C=a*Math.tan((S1-Math.acos((b+y-j)/(2*k*E)))/2),O=C/E,_=C/k;Math.abs(O-1)>Nl&&this._append`L${t+O*p},${n+O*m}`,this._append`A${a},${a},0,0,${+(m*v>p*w)},${this._x1=t+_*d},${this._y1=n+_*f}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,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^o,y=o?i-a:a-i;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>Nl||Math.abs(this._y1-p)>Nl)&&this._append`L${f},${p}`,r&&(y<0&&(y=y%j1+j1),y>Yde?this._append`A${r},${r},0,1,${m},${t-u},${n-d}A${r},${r},0,1,${m},${this._x1=f},${this._y1=p}`:y>Nl&&this._append`A${r},${r},0,${+(y>=S1)},${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 Wk(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 Wde(t)}function Xk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function bB(e){this._context=e}bB.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 Yv(e){return new bB(e)}function wB(e){return e[0]}function SB(e){return e[1]}function jB(e,t){var n=Wt(!0),r=null,i=Yv,a=null,o=Wk(u);e=typeof e=="function"?e:e===void 0?wB:Wt(e),t=typeof t=="function"?t:t===void 0?SB:Wt(t);function u(d){var f,p=(d=Xk(d)).length,m,y=!1,v;for(r==null&&(a=i(v=o())),f=0;f<=p;++f)!(f<p&&n(m=d[f],f,d))===y&&((y=!y)?a.lineStart():a.lineEnd()),y&&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:Wt(+d),u):e},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Wt(+d),u):t},u.defined=function(d){return arguments.length?(n=typeof d=="function"?d:Wt(!!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 Xm(e,t,n){var r=null,i=Wt(!0),a=null,o=Yv,u=null,d=Wk(f);e=typeof e=="function"?e:e===void 0?wB:Wt(+e),t=typeof t=="function"?t:Wt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?SB:Wt(+n);function f(m){var y,v,w,b=(m=Xk(m)).length,j,k=!1,E,C=new Array(b),O=new Array(b);for(a==null&&(u=o(E=d())),y=0;y<=b;++y){if(!(y<b&&i(j=m[y],y,m))===k)if(k=!k)v=y,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),w=y-1;w>=v;--w)u.point(C[w],O[w]);u.lineEnd(),u.areaEnd()}k&&(C[y]=+e(j,y,m),O[y]=+t(j,y,m),u.point(r?+r(j,y,m):C[y],n?+n(j,y,m):O[y]))}if(E)return u=null,E+""||null}function p(){return jB().defined(i).curve(o).context(a)}return f.x=function(m){return arguments.length?(e=typeof m=="function"?m:Wt(+m),r=null,f):e},f.x0=function(m){return arguments.length?(e=typeof m=="function"?m:Wt(+m),f):e},f.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:Wt(+m),f):r},f.y=function(m){return arguments.length?(t=typeof m=="function"?m:Wt(+m),n=null,f):t},f.y0=function(m){return arguments.length?(t=typeof m=="function"?m:Wt(+m),f):t},f.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:Wt(+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:Wt(!!m),f):i},f.curve=function(m){return arguments.length?(o=m,a!=null&&(u=o(a)),f):o},f.context=function(m){return arguments.length?(m==null?a=u=null:u=o(a=m),f):a},f}class NB{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 Xde(e){return new NB(e,!0)}function Jde(e){return new NB(e,!1)}const Jk={draw(e,t){const n=ga(t/fy);e.moveTo(n,0),e.arc(0,0,n,0,Qv)}},efe={draw(e,t){const n=ga(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()}},kB=ga(1/3),tfe=kB*2,nfe={draw(e,t){const n=ga(t/tfe),r=n*kB;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},rfe={draw(e,t){const n=ga(t),r=-n/2;e.rect(r,r,n,n)}},ife=.8908130915292852,CB=dy(fy/10)/dy(7*fy/10),afe=dy(Qv/10)*CB,sfe=-vB(Qv/10)*CB,ofe={draw(e,t){const n=ga(t*ife),r=afe*n,i=sfe*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=Qv*a/5,u=vB(o),d=dy(o);e.lineTo(d*n,-u*n),e.lineTo(u*r-d*i,d*r+u*i)}e.closePath()}},Gw=ga(3),lfe={draw(e,t){const n=-ga(t/(Gw*3));e.moveTo(0,n*2),e.lineTo(-Gw*n,-n),e.lineTo(Gw*n,-n),e.closePath()}},Ti=-.5,Pi=ga(3)/2,N1=1/ga(12),cfe=(N1/2+1)*3,ufe={draw(e,t){const n=ga(t/cfe),r=n/2,i=n*N1,a=r,o=n*N1+n,u=-a,d=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(u,d),e.lineTo(Ti*r-Pi*i,Pi*r+Ti*i),e.lineTo(Ti*a-Pi*o,Pi*a+Ti*o),e.lineTo(Ti*u-Pi*d,Pi*u+Ti*d),e.lineTo(Ti*r+Pi*i,Ti*i-Pi*r),e.lineTo(Ti*a+Pi*o,Ti*o-Pi*a),e.lineTo(Ti*u+Pi*d,Ti*d-Pi*u),e.closePath()}};function dfe(e,t){let n=null,r=Wk(i);e=typeof e=="function"?e:Wt(e||Jk),t=typeof t=="function"?t:Wt(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:Wt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Wt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function hy(){}function py(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 AB(e){this._context=e}AB.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:py(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:py(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ffe(e){return new AB(e)}function OB(e){this._context=e}OB.prototype={areaStart:hy,areaEnd:hy,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:py(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hfe(e){return new OB(e)}function EB(e){this._context=e}EB.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:py(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pfe(e){return new EB(e)}function _B(e){this._context=e}_B.prototype={areaStart:hy,areaEnd:hy,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 mfe(e){return new _B(e)}function zP(e){return e<0?-1:1}function TP(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),u=(a*i+o*r)/(r+i);return(zP(a)+zP(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function PP(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Vw(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,u=(a-r)/3;e._context.bezierCurveTo(r+u,i+u*t,a-u,o-u*n,a,o)}function my(e){this._context=e}my.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:Vw(this,this._t0,PP(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,Vw(this,PP(this,n=TP(this,e,t)),n);break;default:Vw(this,this._t0,n=TP(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function zB(e){this._context=new TB(e)}(zB.prototype=Object.create(my.prototype)).point=function(e,t){my.prototype.point.call(this,t,e)};function TB(e){this._context=e}TB.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 gfe(e){return new my(e)}function yfe(e){return new zB(e)}function PB(e){this._context=e}PB.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=RP(e),i=RP(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(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 RP(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[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 vfe(e){return new PB(e)}function Zv(e,t){this._context=e,this._t=t}Zv.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 xfe(e){return new Zv(e,.5)}function bfe(e){return new Zv(e,0)}function wfe(e){return new Zv(e,1)}function Jl(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,u=a.length;n<o;++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 k1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Sfe(e,t){return e[t]}function jfe(e){const t=[];return t.key=e,t}function Nfe(){var e=Wt([]),t=k1,n=Jl,r=Sfe;function i(a){var o=Array.from(e.apply(this,arguments),jfe),u,d=o.length,f=-1,p;for(const m of a)for(u=0,++f;u<d;++u)(o[u][f]=[0,+r(m,o[u].key,f,a)]).data=m;for(u=0,p=Xk(t(o));u<d;++u)o[p[u]].index=u;return n(o,p),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Wt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Wt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?k1:typeof a=="function"?a:Wt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Jl,i):n},i}function kfe(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}Jl(e,t)}}function Cfe(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,u=0;o<i;++o)u+=e[o][n][1]||0;r[n][1]+=r[n][0]=-u/2}Jl(e,t)}}function Afe(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var u=0,d=0,f=0;u<o;++u){for(var p=e[t[u]],m=p[r][1]||0,y=p[r-1][1]||0,v=(m-y)/2,w=0;w<u;++w){var b=e[t[w]],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,Jl(e,t)}}var Qw={},Yw={},DP;function Ofe(){return DP||(DP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(Yw)),Yw}var Zw={},MP;function RB(){return MP||(MP=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})(Zw)),Zw}var Ww={},IP;function eC(){return IP||(IP=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})(Ww)),Ww}var Xw={},Jw={},LP;function Efe(){return LP||(LP=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})(Jw)),Jw}var $P;function tC(){return $P||($P=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Efe(),n=eC();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],o=i.length;if(o===0)return a;let u=0,d="",f="",p=!1;for(i.charCodeAt(0)===46&&(a.push(""),u++);u<o;){const m=i[u];f?m==="\\"&&u+1<o?(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})(Xw)),Xw}var BP;function nC(){return BP||(BP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ofe(),n=RB(),r=eC(),i=tC();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 o(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 o(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})(Qw)),Qw}var eS,UP;function _fe(){return UP||(UP=1,eS=nC().get),eS}var zfe=_fe();const Wu=ha(zfe);var Tfe=4;function Co(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tfe,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function jn(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,o)=>{var u=n[o-1];return typeof u=="string"?i+u+a:u!==void 0?i+Co(u)+a:i+a},"")}var Qr=e=>e===0?0:e>0?1:-1,ua=e=>typeof e=="number"&&e!=+e,ec=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Te=e=>(typeof e=="number"||e instanceof Number)&&!ua(e),Ba=e=>Te(e)||typeof e=="string",Pfe=0,Sh=e=>{var t=++Pfe;return"".concat(e||"").concat(t)},da=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(!Te(t)&&typeof t!="string")return r;var a;if(ec(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return ua(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},DB=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 pn(e,t,n){return Te(e)&&Te(t)?Co(e+n*(t-e)):t}function MB(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):Wu(r,t))===n)}var mn=e=>e===null||typeof e>"u",Zh=e=>mn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Yr(e){return e!=null}function yc(){}var Rfe=["type","size","sizeType"];function C1(){return C1=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},C1.apply(null,arguments)}function qP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function FP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qP(Object(n),!0).forEach(function(r){Dfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dfe(e,t,n){return(t=Mfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mfe(e){var t=Ife(e,"string");return typeof t=="symbol"?t:t+""}function Ife(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 Lfe(e,t){if(e==null)return{};var n,r,i=$fe(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 $fe(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 IB={symbolCircle:Jk,symbolCross:efe,symbolDiamond:nfe,symbolSquare:rfe,symbolStar:ofe,symbolTriangle:lfe,symbolWye:ufe},Bfe=Math.PI/180,Ufe=e=>{var t="symbol".concat(Zh(e));return IB[t]||Jk},qfe=(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*Bfe;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}},Ffe=(e,t)=>{IB["symbol".concat(Zh(e))]=t},rC=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=Lfe(e,Rfe),a=FP(FP({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var u=()=>{var y=Ufe(o),v=dfe().type(y).size(qfe(n,r,o)),w=v();if(w!==null)return w},{className:d,cx:f,cy:p}=a,m=Dr(a);return Te(f)&&Te(p)&&Te(n)?x.createElement("path",C1({},m,{className:Rt("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};rC.registerSymbol=Ffe;var LB=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,iC=(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=>{Yk(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},Hfe=(e,t,n)=>r=>(e(t,n,r),null),Wv=(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];Yk(i)&&typeof a=="function"&&(r||(r={}),r[i]=Hfe(a,t,n))}),r};function HP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Kfe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HP(Object(n),!0).forEach(function(r){Gfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gfe(e,t,n){return(t=Vfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vfe(e){var t=Qfe(e,"string");return typeof t=="symbol"?t:t+""}function Qfe(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 Sr(e,t){var n=Kfe({},e),r=t,i=Object.keys(t),a=i.reduce((o,u)=>(o[u]===void 0&&r[u]!==void 0&&(o[u]=r[u]),o),n);return a}function gy(){return gy=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},gy.apply(null,arguments)}function KP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $B(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KP(Object(n),!0).forEach(function(r){Yfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yfe(e,t,n){return(t=Zfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zfe(e){var t=Wfe(e,"string");return typeof t=="symbol"?t:t+""}function Wfe(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,Xfe={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Jfe(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function ehe(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Di/2,a=Di/6,o=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:Jfe(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(o,`
|
|
255
|
+
A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(i,`
|
|
256
|
+
H`).concat(Di,"M").concat(2*o,",").concat(i,`
|
|
257
|
+
A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").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=$B({},t);return delete f.legendIcon,x.cloneElement(t.legendIcon,f)}return x.createElement(rC,{fill:u,cx:i,cy:i,size:Di,sizeType:"diameter",type:d})}function the(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,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,y)=>{var v=m.formatter||i,w=Rt({"recharts-legend-item":!0,["legend-item-".concat(y)]:!0,inactive:m.inactive});if(m.type==="none")return null;var b=typeof u=="object"?$B({},u):{};b.color=m.inactive?a:b.color||m.color;var j=v?v(m.value,m,y):m.value;return x.createElement("li",gy({className:w,style:f,key:"legend-item-".concat(y)},Wv(e,m,y)),x.createElement(Zk,{width:n,height:n,viewBox:d,style:p,"aria-label":"".concat(m.value," legend icon")},x.createElement(ehe,{data:m,iconType:o,inactiveColor:a})),x.createElement("span",{className:"recharts-legend-item-text",style:b},j))})}var nhe=e=>{var t=Sr(e,Xfe),{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(the,gy({},t,{payload:n})))},tS={},nS={},GP;function rhe(){return GP||(GP=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 o=n[a],u=r(o,a,n);i.has(u)||i.set(u,o)}return Array.from(i.values())}e.uniqBy=t})(nS)),nS}var rS={},VP;function ihe(){return VP||(VP=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})(rS)),rS}var iS={},QP;function BB(){return QP||(QP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(iS)),iS}var aS={},sS={},oS={},YP;function ahe(){return YP||(YP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(oS)),oS}var ZP;function UB(){return ZP||(ZP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ahe();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(sS)),sS}var lS={},WP;function she(){return WP||(WP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(lS)),lS}var XP;function ohe(){return XP||(XP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=UB(),n=she();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(aS)),aS}var cS={},uS={},JP;function lhe(){return JP||(JP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nC();function n(r){return function(i){return t.get(i,r)}}e.property=n})(uS)),uS}var dS={},fS={},hS={},pS={},eR;function qB(){return eR||(eR=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})(pS)),pS}var mS={},tR;function FB(){return tR||(tR=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})(mS)),mS}var gS={},nR;function HB(){return nR||(nR=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})(gS)),gS}var rR;function che(){return rR||(rR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qB(),n=FB(),r=HB();function i(p,m,y){return typeof y!="function"?i(p,m,()=>{}):a(p,m,function v(w,b,j,k,E,C){const O=y(w,b,j,k,E,C);return O!==void 0?!!O:a(w,b,v,C)},new Map)}function a(p,m,y,v){if(m===p)return!0;switch(typeof m){case"object":return o(p,m,y,v);case"function":return Object.keys(m).length>0?a(p,{...m},y,v):r.isEqualsSameValueZero(p,m);default:return t.isObject(p)?typeof m=="string"?m==="":!0:r.isEqualsSameValueZero(p,m)}}function o(p,m,y,v){if(m==null)return!0;if(Array.isArray(m))return d(p,m,y,v);if(m instanceof Map)return u(p,m,y,v);if(m instanceof Set)return f(p,m,y,v);const w=Object.keys(m);if(p==null||n.isPrimitive(p))return w.length===0;if(w.length===0)return!0;if(v?.has(m))return v.get(m)===p;v?.set(m,p);try{for(let b=0;b<w.length;b++){const j=w[b];if(!n.isPrimitive(p)&&!(j in p)||m[j]===void 0&&p[j]!==void 0||m[j]===null&&p[j]!==null||!y(p[j],m[j],j,p,m,v))return!1}return!0}finally{v?.delete(m)}}function u(p,m,y,v){if(m.size===0)return!0;if(!(p instanceof Map))return!1;for(const[w,b]of m.entries()){const j=p.get(w);if(y(j,b,w,p,m,v)===!1)return!1}return!0}function d(p,m,y,v){if(m.length===0)return!0;if(!Array.isArray(p))return!1;const w=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(w.has(E))continue;const C=p[E];let O=!1;if(y(C,j,b,p,m,v)&&(O=!0),O){w.add(E),k=!0;break}}if(!k)return!1}return!0}function f(p,m,y,v){return m.size===0?!0:p instanceof Set?d([...p],[...m],y,v):!1}e.isMatchWith=i,e.isSetMatch=f})(hS)),hS}var iR;function KB(){return iR||(iR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=che();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(fS)),fS}var yS={},vS={},xS={},aR;function uhe(){return aR||(aR=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})(xS)),xS}var bS={},sR;function aC(){return sR||(sR=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})(bS)),bS}var wS={},oR;function GB(){return oR||(oR=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]",o="[object Symbol]",u="[object Date]",d="[object Map]",f="[object Set]",p="[object Array]",m="[object Function]",y="[object ArrayBuffer]",v="[object Object]",w="[object Error]",b="[object DataView]",j="[object Uint8Array]",k="[object Uint8ClampedArray]",E="[object Uint16Array]",C="[object Uint32Array]",O="[object BigUint64Array]",_="[object Int8Array]",A="[object Int16Array]",z="[object Int32Array]",R="[object BigInt64Array]",$="[object Float32Array]",F="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=y,e.arrayTag=p,e.bigInt64ArrayTag=R,e.bigUint64ArrayTag=O,e.booleanTag=i,e.dataViewTag=b,e.dateTag=u,e.errorTag=w,e.float32ArrayTag=$,e.float64ArrayTag=F,e.functionTag=m,e.int16ArrayTag=A,e.int32ArrayTag=z,e.int8ArrayTag=_,e.mapTag=d,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=f,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=E,e.uint32ArrayTag=C,e.uint8ArrayTag=j,e.uint8ClampedArrayTag=k})(wS)),wS}var SS={},lR;function dhe(){return lR||(lR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(SS)),SS}var cR;function VB(){return cR||(cR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=uhe(),n=aC(),r=GB(),i=FB(),a=dhe();function o(p,m){return u(p,void 0,p,new Map,m)}function u(p,m,y,v=new Map,w=void 0){const b=w?.(p,m,y,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,y,v,w);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,y,v,w));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,y,v,w));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,y,v,w);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,y,v,w),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,y,v,w),j}if(typeof Blob<"u"&&p instanceof Blob){const j=new Blob([p],{type:p.type});return v.set(p,j),d(j,p,y,v,w),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,y,v,w),j}if(p instanceof Boolean){const j=new Boolean(p.valueOf());return v.set(p,j),d(j,p,y,v,w),j}if(p instanceof Number){const j=new Number(p.valueOf());return v.set(p,j),d(j,p,y,v,w),j}if(p instanceof String){const j=new String(p.valueOf());return v.set(p,j),d(j,p,y,v,w),j}if(typeof p=="object"&&f(p)){const j=Object.create(Object.getPrototypeOf(p));return v.set(p,j),d(j,p,y,v,w),j}return p}function d(p,m,y=p,v,w){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,y,v,w))}}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=o,e.cloneDeepWithImpl=u,e.copyProperties=d})(vS)),vS}var uR;function fhe(){return uR||(uR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=VB();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(yS)),yS}var dR;function hhe(){return dR||(dR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=KB(),n=fhe();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(dS)),dS}var jS={},NS={},kS={},fR;function phe(){return fR||(fR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=VB(),n=aC(),r=GB();function i(a,o){return t.cloneDeepWith(a,(u,d,f,p)=>{const m=o?.(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 y={};return p.set(a,y),t.copyProperties(y,a,f,p),y}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const y=new a.constructor(a?.valueOf());return t.copyProperties(y,a),y}case r.argumentsTag:{const y={};return t.copyProperties(y,a),y.length=a.length,y[Symbol.iterator]=a[Symbol.iterator],y}default:return}}})}e.cloneDeepWith=i})(kS)),kS}var hR;function mhe(){return hR||(hR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=phe();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(NS)),NS}var CS={},AS={},pR;function QB(){return pR||(pR=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})(AS)),AS}var OS={},mR;function ghe(){return mR||(mR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=aC();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(OS)),OS}var gR;function yhe(){return gR||(gR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=RB(),n=QB(),r=ghe(),i=tC();function a(o,u){let d;if(Array.isArray(u)?d=u:typeof u=="string"&&t.isDeepKey(u)&&o?.[u]==null?d=i.toPath(u):d=[u],d.length===0)return!1;let f=o;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})(CS)),CS}var yR;function vhe(){return yR||(yR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=KB(),n=eC(),r=mhe(),i=nC(),a=yhe();function o(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=o})(jS)),jS}var vR;function xhe(){return vR||(vR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=BB(),n=lhe(),r=hhe(),i=vhe();function a(o){if(o==null)return t.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?i.matchesProperty(o[0],o[1]):r.matches(o);case"string":case"symbol":case"number":return n.property(o)}}e.iteratee=a})(cS)),cS}var xR;function bhe(){return xR||(xR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rhe(),n=ihe(),r=BB(),i=ohe(),a=xhe();function o(u,d=r.identity){return i.isArrayLikeObject(u)?t.uniqBy(Array.from(u),n.ary(a.iteratee(d),1)):[]}e.uniqBy=o})(tS)),tS}var ES,bR;function whe(){return bR||(bR=1,ES=bhe().uniqBy),ES}var She=whe();const wR=ha(She);function YB(e,t,n){return t===!0?wR(e,n):typeof t=="function"?wR(e,t):e}var sC=x.createContext(null),jhe=e=>e,sn=()=>{var e=x.useContext(sC);return e?e.store.dispatch:jhe},Tg=()=>{},Nhe=()=>Tg,khe=(e,t)=>e===t;function Ue(e){var t=x.useContext(sC),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Tg,[t,e]);return c5.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Nhe,t?t.store.getState:Tg,t?t.store.getState:Tg,n,khe)}function Che(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Ahe(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Ohe(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 SR=e=>Array.isArray(e)?e:[e];function Ehe(e){const t=Array.isArray(e[0])?e[0]:e;return Ohe(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function _he(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var zhe=class{constructor(e){this.value=e}deref(){return this.value}},The=typeof WeakRef<"u"?WeakRef:zhe,Phe=0,jR=1;function Jm(){return{s:Phe,v:void 0,o:null,p:null}}function ZB(e,t={}){let n=Jm();const{resultEqualityCheck:r}=t;let i,a=0;function o(){let u=n;const{length:d}=arguments;for(let m=0,y=d;m<y;m++){const v=arguments[m];if(typeof v=="function"||typeof v=="object"&&v!==null){let w=u.o;w===null&&(u.o=w=new WeakMap);const b=w.get(v);b===void 0?(u=Jm(),w.set(v,u)):u=b}else{let w=u.p;w===null&&(u.p=w=new Map);const b=w.get(v);b===void 0?(u=Jm(),w.set(v,u)):u=b}}const f=u;let p;if(u.s===jR)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 The(p):p}return f.s=jR,f.v=p,p}return o.clearCache=()=>{n=Jm(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Rhe(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,o=0,u,d={},f=i.pop();typeof f=="object"&&(d=f,f=i.pop()),Che(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p={...n,...d},{memoize:m,memoizeOptions:y=[],argsMemoize:v=ZB,argsMemoizeOptions:w=[]}=p,b=SR(y),j=SR(w),k=Ehe(i),E=m(function(){return a++,f.apply(null,arguments)},...b),C=v(function(){o++;const _=_he(k,arguments);return u=E.apply(null,_),u},...j);return Object.assign(C,{resultFunc:f,memoizedResultFunc:E,dependencies:k,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var ae=Rhe(ZB),Dhe=Object.assign((e,t=ae)=>{Ahe(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((o,u,d)=>(o[n[d]]=u,o),{}))},{withTypes:()=>Dhe}),_S={},zS={},TS={},NR;function Mhe(){return NR||(NR=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 o=t(r),u=t(i);if(o===u&&o===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?u-o:o-u}return 0};e.compareValues=n})(TS)),TS}var PS={},RS={},kR;function WB(){return kR||(kR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(RS)),RS}var CR;function Ihe(){return CR||(CR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=WB(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,o){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))||o!=null&&Object.hasOwn(o,a)}e.isKey=i})(PS)),PS}var AR;function Lhe(){return AR||(AR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Mhe(),n=Ihe(),r=tC();function i(a,o,u,d){if(a==null)return[];u=d?void 0:u,Array.isArray(a)||(a=Object.values(a)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(u)||(u=u==null?[]:[u]),u=u.map(v=>String(v));const f=(v,w)=>{let b=v;for(let j=0;j<w.length&&b!=null;++j)b=b[w[j]];return b},p=(v,w)=>w==null||v==null?w:typeof v=="object"&&"key"in v?Object.hasOwn(w,v.key)?w[v.key]:f(w,v.path):typeof v=="function"?v(w):Array.isArray(v)?f(w,v):typeof w=="object"?w[v]:w,m=o.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(w=>p(w,v))})).slice().sort((v,w)=>{for(let b=0;b<m.length;b++){const j=t.compareValues(v.criteria[b],w.criteria[b],u[b]);if(j!==0)return j}return 0}).map(v=>v.original)}e.orderBy=i})(zS)),zS}var DS={},OR;function $he(){return OR||(OR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),o=(u,d)=>{for(let f=0;f<u.length;f++){const p=u[f];Array.isArray(p)&&d<a?o(p,d+1):i.push(p)}};return o(n,0),i}e.flatten=t})(DS)),DS}var MS={},ER;function XB(){return ER||(ER=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=QB(),n=UB(),r=qB(),i=HB();function a(o,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],o):!1}e.isIterateeCall=a})(MS)),MS}var _R;function Bhe(){return _R||(_R=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Lhe(),n=$he(),r=XB();function i(a,...o){const u=o.length;return u>1&&r.isIterateeCall(a,o[0],o[1])?o=[]:u>2&&r.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(a,n.flatten(o),["asc"])}e.sortBy=i})(_S)),_S}var IS,zR;function Uhe(){return zR||(zR=1,IS=Bhe().sortBy),IS}var qhe=Uhe();const Xv=ha(qhe);var JB=e=>e.legend.settings,Fhe=e=>e.legend.size,Hhe=e=>e.legend.payload,Khe=ae([Hhe,JB],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?Xv(r,n):r});function Ghe(){return Ue(Khe)}var eg=1;function e6(){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(),o={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(o.height-t.height)>eg||Math.abs(o.left-t.left)>eg||Math.abs(o.top-t.top)>eg||Math.abs(o.width-t.width)>eg)&&n({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function ar(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 Vhe=typeof Symbol=="function"&&Symbol.observable||"@@observable",TR=Vhe,LS=()=>Math.random().toString(36).substring(7).split("").join("."),Qhe={INIT:`@@redux/INIT${LS()}`,REPLACE:`@@redux/REPLACE${LS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${LS()}`},yy=Qhe;function oC(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 t6(e,t,n){if(typeof e!="function")throw new Error(ar(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(ar(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ar(1));return n(t6)(e,t)}let r=e,i=t,a=new Map,o=a,u=0,d=!1;function f(){o===a&&(o=new Map,a.forEach((j,k)=>{o.set(k,j)}))}function p(){if(d)throw new Error(ar(3));return i}function m(j){if(typeof j!="function")throw new Error(ar(4));if(d)throw new Error(ar(5));let k=!0;f();const E=u++;return o.set(E,j),function(){if(k){if(d)throw new Error(ar(6));k=!1,f(),o.delete(E),a=null}}}function y(j){if(!oC(j))throw new Error(ar(7));if(typeof j.type>"u")throw new Error(ar(8));if(typeof j.type!="string")throw new Error(ar(17));if(d)throw new Error(ar(9));try{d=!0,i=r(i,j)}finally{d=!1}return(a=o).forEach(E=>{E()}),j}function v(j){if(typeof j!="function")throw new Error(ar(10));r=j,y({type:yy.REPLACE})}function w(){const j=m;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(ar(11));function E(){const O=k;O.next&&O.next(p())}return E(),{unsubscribe:j(E)}},[TR](){return this}}}return y({type:yy.INIT}),{dispatch:y,subscribe:m,getState:p,replaceReducer:v,[TR]:w}}function Yhe(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:yy.INIT})>"u")throw new Error(ar(12));if(typeof n(void 0,{type:yy.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ar(13))})}function n6(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const o=t[a];typeof e[o]=="function"&&(n[o]=e[o])}const r=Object.keys(n);let i;try{Yhe(n)}catch(a){i=a}return function(o={},u){if(i)throw i;let d=!1;const f={};for(let p=0;p<r.length;p++){const m=r[p],y=n[m],v=o[m],w=y(v,u);if(typeof w>"u")throw u&&u.type,new Error(ar(14));f[m]=w,d=d||w!==v}return d=d||r.length!==Object.keys(o).length,d?f:o}}function vy(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Zhe(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(ar(15))};const o={getState:i.getState,dispatch:(d,...f)=>a(d,...f)},u=e.map(d=>d(o));return a=vy(...u)(i.dispatch),{...i,dispatch:a}}}function r6(e){return oC(e)&&"type"in e&&typeof e.type=="string"}var i6=Symbol.for("immer-nothing"),PR=Symbol.for("immer-draftable"),Mr=Symbol.for("immer-state");function oa(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var pi=Object,Xu=pi.getPrototypeOf,xy="constructor",Jv="prototype",A1="configurable",by="enumerable",Pg="writable",jh="value",As=e=>!!e&&!!e[Mr];function fa(e){return e?a6(e)||t0(e)||!!e[PR]||!!e[xy]?.[PR]||n0(e)||r0(e):!1}var Whe=pi[Jv][xy].toString(),RR=new WeakMap;function a6(e){if(!e||!lC(e))return!1;const t=Xu(e);if(t===null||t===pi[Jv])return!0;const n=pi.hasOwnProperty.call(t,xy)&&t[xy];if(n===Object)return!0;if(!wu(n))return!1;let r=RR.get(n);return r===void 0&&(r=Function.toString.call(n),RR.set(n,r)),r===Whe}function e0(e,t,n=!0){Wh(e)===0?(n?Reflect.ownKeys(e):pi.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Wh(e){const t=e[Mr];return t?t.type_:t0(e)?1:n0(e)?2:r0(e)?3:0}var DR=(e,t,n=Wh(e))=>n===2?e.has(t):pi[Jv].hasOwnProperty.call(e,t),O1=(e,t,n=Wh(e))=>n===2?e.get(t):e[t],wy=(e,t,n,r=Wh(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Xhe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var t0=Array.isArray,n0=e=>e instanceof Map,r0=e=>e instanceof Set,lC=e=>typeof e=="object",wu=e=>typeof e=="function",$S=e=>typeof e=="boolean";function Jhe(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ms=e=>e.copy_||e.base_,cC=e=>e.modified_?e.copy_:e.base_;function E1(e,t){if(n0(e))return new Map(e);if(r0(e))return new Set(e);if(t0(e))return Array[Jv].slice.call(e);const n=a6(e);if(t===!0||t==="class_only"&&!n){const r=pi.getOwnPropertyDescriptors(e);delete r[Mr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],u=r[o];u[Pg]===!1&&(u[Pg]=!0,u[A1]=!0),(u.get||u.set)&&(r[o]={[A1]:!0,[Pg]:!0,[by]:u[by],[jh]:e[o]})}return pi.create(Xu(e),r)}else{const r=Xu(e);if(r!==null&&n)return{...e};const i=pi.create(r);return pi.assign(i,e)}}function uC(e,t=!1){return i0(e)||As(e)||!fa(e)||(Wh(e)>1&&pi.defineProperties(e,{set:tg,add:tg,clear:tg,delete:tg}),pi.freeze(e),t&&e0(e,(n,r)=>{uC(r,!0)},!1)),e}function epe(){oa(2)}var tg={[jh]:epe};function i0(e){return e===null||!lC(e)?!0:pi.isFrozen(e)}var Sy="MapSet",_1="Patches",MR="ArrayMethods",s6={};function tc(e){const t=s6[e];return t||oa(0,e),t}var IR=e=>!!s6[e],Nh,o6=()=>Nh,tpe=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:IR(Sy)?tc(Sy):void 0,arrayMethodsPlugin_:IR(MR)?tc(MR):void 0});function LR(e,t){t&&(e.patchPlugin_=tc(_1),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function z1(e){T1(e),e.drafts_.forEach(npe),e.drafts_=null}function T1(e){e===Nh&&(Nh=e.parent_)}var $R=e=>Nh=tpe(Nh,e);function npe(e){const t=e[Mr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function BR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Mr].modified_&&(z1(t),oa(4)),fa(e)&&(e=UR(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Mr].base_,e,t)}else e=UR(t,n);return rpe(t,e,!0),z1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==i6?e:void 0}function UR(e,t){if(i0(t))return t;const n=t[Mr];if(!n)return jy(t,e.handledSet_,e);if(!a0(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);u6(n,e)}return n.copy_}function rpe(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&uC(t,n)}function l6(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var a0=(e,t)=>e.scope_===t,ipe=[];function c6(e,t,n,r){const i=ms(e),a=e.type_;if(r!==void 0&&O1(i,r,a)===t){wy(i,r,n,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;e0(i,(d,f)=>{if(As(f)){const p=u.get(f)||[];p.push(d),u.set(f,p)}})}const o=e.draftLocations_.get(t)??ipe;for(const u of o)wy(i,u,n,a)}function ape(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!a0(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const o=cC(a);c6(e,a.draft_??a,o,n),u6(a,i)})}function u6(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)}l6(e)}}function spe(e,t,n){const{scope_:r}=e;if(As(n)){const i=n[Mr];a0(i,r)&&i.callbacks_.push(function(){Rg(e);const o=cC(i);c6(e,n,o,t)})}else fa(n)&&e.callbacks_.push(function(){const a=ms(e);e.type_===3?a.has(n)&&jy(n,r.handledSet_,r):O1(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&jy(O1(e.copy_,t,e.type_),r.handledSet_,r)})}function jy(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||As(e)||t.has(e)||!fa(e)||i0(e)||(t.add(e),e0(e,(r,i)=>{if(As(i)){const a=i[Mr];if(a0(a,n)){const o=cC(a);wy(e,r,o,e.type_),l6(a)}}else fa(i)&&jy(i,t,n)})),e}function ope(e,t){const n=t0(e),r={type_:n?1:0,scope_:t?t.scope_:o6(),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=Ny;n&&(i=[r],a=kh);const{revoke:o,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=o,[u,r]}var Ny={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=ms(e);if(!DR(i,t,e.type_))return lpe(e,i,t);const a=i[t];if(e.finalized_||!fa(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Jhe(t))return a;if(a===BS(e.base_,t)){Rg(e);const o=e.type_===1?+t:t,u=R1(e.scope_,a,e,o);return e.copy_[o]=u}return a},has(e,t){return t in ms(e)},ownKeys(e){return Reflect.ownKeys(ms(e))},set(e,t,n){const r=d6(ms(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=BS(ms(e),t),a=i?.[Mr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Xhe(n,i)&&(n!==void 0||DR(e.base_,t,e.type_)))return!0;Rg(e),P1(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),spe(e,t,n)),!0},deleteProperty(e,t){return Rg(e),BS(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),P1(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ms(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Pg]:!0,[A1]:e.type_!==1||t!=="length",[by]:r[by],[jh]:n[t]}},defineProperty(){oa(11)},getPrototypeOf(e){return Xu(e.base_)},setPrototypeOf(){oa(12)}},kh={};for(let e in Ny){let t=Ny[e];kh[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}kh.deleteProperty=function(e,t){return kh.set.call(this,e,t,void 0)};kh.set=function(e,t,n){return Ny.set.call(this,e[0],t,n,e[0])};function BS(e,t){const n=e[Mr];return(n?ms(n):e)[t]}function lpe(e,t,n){const r=d6(t,n);return r?jh in r?r[jh]:r.get?.call(e.draft_):void 0}function d6(e,t){if(!(t in e))return;let n=Xu(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Xu(n)}}function P1(e){e.modified_||(e.modified_=!0,e.parent_&&P1(e.parent_))}function Rg(e){e.copy_||(e.assigned_=new Map,e.copy_=E1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var cpe=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(wu(n)&&!wu(r)){const o=r;r=n;const u=this;return function(f=o,...p){return u.produce(f,m=>r.call(this,m,...p))}}wu(r)||oa(6),i!==void 0&&!wu(i)&&oa(7);let a;if(fa(n)){const o=$R(this),u=R1(o,n,void 0);let d=!0;try{a=r(u),d=!1}finally{d?z1(o):T1(o)}return LR(o,i),BR(a,o)}else if(!n||!lC(n)){if(a=r(n),a===void 0&&(a=n),a===i6&&(a=void 0),this.autoFreeze_&&uC(a,!0),i){const o=[],u=[];tc(_1).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:u}),i(o,u)}return a}else oa(1,n)},this.produceWithPatches=(n,r)=>{if(wu(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]},$S(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),$S(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),$S(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){fa(t)||oa(8),As(t)&&(t=Bi(t));const n=$R(this),r=R1(n,t,void 0);return r[Mr].isManual_=!0,T1(n),r}finishDraft(t,n){const r=t&&t[Mr];(!r||!r.isManual_)&&oa(9);const{scope_:i}=r;return LR(i,n),BR(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=tc(_1).applyPatches_;return As(t)?i(t,n):this.produce(t,a=>i(a,n))}};function R1(e,t,n,r){const[i,a]=n0(t)?tc(Sy).proxyMap_(t,n):r0(t)?tc(Sy).proxySet_(t,n):ope(t,n);return(n?.scope_??o6()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?ape(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 As(e)||oa(10,e),f6(e)}function f6(e){if(!fa(e)||i0(e))return e;const t=e[Mr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=E1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=E1(e,!0);return e0(n,(i,a)=>{wy(n,i,f6(a))},r),t&&(t.finalized_=!1),n}var upe=new cpe,h6=upe.produce;function p6(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var dpe=p6(),fpe=p6,hpe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?vy:vy.apply(null,arguments)};function gi(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(mi(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=>r6(r)&&r.type===e,n}var m6=class Yf extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Yf.prototype)}static get[Symbol.species](){return Yf}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Yf(...t[0].concat(this)):new Yf(...t.concat(this))}};function qR(e){return fa(e)?h6(e,()=>{}):e}function ng(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function ppe(e){return typeof e=="boolean"}var mpe=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new m6;return n&&(ppe(n)?o.push(dpe):o.push(fpe(n.extraArgument))),o},g6="RTK_autoBatch",rn=()=>e=>({payload:e,meta:{[g6]:!0}}),FR=e=>t=>{setTimeout(t,e)},y6=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,o=!1;const u=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:FR(10):e.type==="callback"?e.queueNotification:FR(e.timeout),f=()=>{o=!1,a&&(a=!1,u.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const m=()=>i&&p(),y=r.subscribe(m);return u.add(p),()=>{y(),u.delete(p)}},dispatch(p){try{return i=!p?.meta?.[g6],a=!i,a&&(o||(o=!0,d(f))),r.dispatch(p)}finally{i=!0}}})},gpe=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new m6(e);return r&&i.push(y6(typeof r=="object"?r:void 0)),i};function ype(e){const t=mpe(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let u;if(typeof n=="function")u=n;else if(oC(n))u=n6(n);else throw new Error(mi(1));let d;typeof r=="function"?d=r(t):d=t();let f=vy;i&&(f=hpe({trace:!1,...typeof i=="object"&&i}));const p=Zhe(...d),m=gpe(p);let y=typeof o=="function"?o(m):m();const v=f(...y);return t6(u,a,v)}function v6(e){const t={},n=[];let r;const i={addCase(a,o){const u=typeof a=="string"?a:a.type;if(!u)throw new Error(mi(28));if(u in t)throw new Error(mi(29));return t[u]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return n.push({matcher:a,reducer:o}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function vpe(e){return typeof e=="function"}function xpe(e,t){let[n,r,i]=v6(t),a;if(vpe(e))a=()=>qR(e());else{const u=qR(e);a=()=>u}function o(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(As(p)){const v=m(p,d);return v===void 0?p:v}else{if(fa(p))return h6(p,y=>m(y,d));{const y=m(p,d);if(y===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return y}}return p},u)}return o.getInitialState=a,o}var bpe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",wpe=(e=21)=>{let t="",n=e;for(;n--;)t+=bpe[Math.random()*64|0];return t},Spe=Symbol.for("rtk-slice-createasyncthunk");function jpe(e,t){return`${e}/${t}`}function Npe({creators:e}={}){const t=e?.asyncThunk?.[Spe];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(mi(11));const o=(typeof r.reducers=="function"?r.reducers(Cpe()):r.reducers)||{},u=Object.keys(o),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(C,O){const _=typeof C=="string"?C:C.type;if(!_)throw new Error(mi(12));if(_ in d.sliceCaseReducersByType)throw new Error(mi(13));return d.sliceCaseReducersByType[_]=O,f},addMatcher(C,O){return d.sliceMatchers.push({matcher:C,reducer:O}),f},exposeAction(C,O){return d.actionCreators[C]=O,f},exposeCaseReducer(C,O){return d.sliceCaseReducersByName[C]=O,f}};u.forEach(C=>{const O=o[C],_={reducerName:C,type:jpe(i,C),createNotation:typeof r.reducers=="function"};Ope(O)?_pe(_,O,f,t):Ape(_,O,f)});function p(){const[C={},O=[],_=void 0]=typeof r.extraReducers=="function"?v6(r.extraReducers):[r.extraReducers],A={...C,...d.sliceCaseReducersByType};return xpe(r.initialState,z=>{for(let R in A)z.addCase(R,A[R]);for(let R of d.sliceMatchers)z.addMatcher(R.matcher,R.reducer);for(let R of O)z.addMatcher(R.matcher,R.reducer);_&&z.addDefaultCase(_)})}const m=C=>C,y=new Map,v=new WeakMap;let w;function b(C,O){return w||(w=p()),w(C,O)}function j(){return w||(w=p()),w.getInitialState()}function k(C,O=!1){function _(z){let R=z[C];return typeof R>"u"&&O&&(R=ng(v,_,j)),R}function A(z=m){const R=ng(y,O,()=>new WeakMap);return ng(R,z,()=>{const $={};for(const[F,U]of Object.entries(r.selectors??{}))$[F]=kpe(U,z,()=>ng(v,z,j),O);return $})}return{reducerPath:C,getSelectors:A,get selectors(){return A(_)},selectSlice:_}}const E={name:i,reducer:b,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:j,...k(a),injectInto(C,{reducerPath:O,..._}={}){const A=O??a;return C.inject({reducerPath:A,reducer:b},_),{...E,...k(A,!0)}}};return E}}function kpe(e,t,n,r){function i(a,...o){let u=t(a);return typeof u>"u"&&r&&(u=n()),e(u,...o)}return i.unwrapped=e,i}var jr=Npe();function Cpe(){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 Ape({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!Epe(r))throw new Error(mi(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?gi(e,o):gi(e))}function Ope(e){return e._reducerDefinitionType==="asyncThunk"}function Epe(e){return e._reducerDefinitionType==="reducerWithPrepare"}function _pe({type:e,reducerName:t},n,r,i){if(!i)throw new Error(mi(18));const{payloadCreator:a,fulfilled:o,pending:u,rejected:d,settled:f,options:p}=n,m=i(e,a,p);r.exposeAction(t,m),o&&r.addCase(m.fulfilled,o),u&&r.addCase(m.pending,u),d&&r.addCase(m.rejected,d),f&&r.addMatcher(m.settled,f),r.exposeCaseReducer(t,{fulfilled:o||rg,pending:u||rg,rejected:d||rg,settled:f||rg})}function rg(){}var zpe="task",x6="listener",b6="completed",dC="cancelled",Tpe=`task-${dC}`,Ppe=`task-${b6}`,D1=`${x6}-${dC}`,Rpe=`${x6}-${b6}`,s0=class{constructor(e){this.code=e,this.message=`${zpe} ${dC} (reason: ${e})`}name="TaskAbortError";message},fC=(e,t)=>{if(typeof e!="function")throw new TypeError(mi(32))},ky=()=>{},w6=(e,t=ky)=>(e.catch(t),e),S6=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Ul=e=>{if(e.aborted)throw new s0(e.reason)};function j6(e,t){let n=ky;return new Promise((r,i)=>{const a=()=>i(new s0(e.reason));if(e.aborted){a();return}n=S6(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=ky})}var Dpe=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof s0?"cancelled":"rejected",error:n}}finally{t?.()}},Cy=e=>t=>w6(j6(e,t).then(n=>(Ul(e),n))),N6=e=>{const t=Cy(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Lu}=Object,HR={},o0="listenerMiddleware",Mpe=(e,t)=>{const n=r=>S6(e,()=>r.abort(e.reason));return(r,i)=>{fC(r);const a=new AbortController;n(a);const o=Dpe(async()=>{Ul(e),Ul(a.signal);const u=await r({pause:Cy(a.signal),delay:N6(a.signal),signal:a.signal});return Ul(a.signal),u},()=>a.abort(Ppe));return i?.autoJoin&&t.push(o.catch(ky)),{result:Cy(e)(o),cancel(){a.abort(Tpe)}}}},Ipe=(e,t)=>{const n=async(r,i)=>{Ul(t);let a=()=>{};const u=[new Promise((d,f)=>{let p=e({predicate:r,effect:(m,y)=>{y.unsubscribe(),d([m,y.getState(),y.getOriginalState()])}});a=()=>{p(),f()}})];i!=null&&u.push(new Promise(d=>setTimeout(d,i,null)));try{const d=await j6(t,Promise.race(u));return Ul(t),d}finally{a()}};return(r,i)=>w6(n(r,i))},k6=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(mi(21));return fC(a),{predicate:i,type:t,effect:a}},C6=Lu(e=>{const{type:t,predicate:n,effect:r}=k6(e);return{id:wpe(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(mi(22))}}},{withTypes:()=>C6}),KR=(e,t)=>{const{type:n,effect:r,predicate:i}=k6(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},M1=e=>{e.pending.forEach(t=>{t.abort(D1)})},Lpe=(e,t)=>()=>{for(const n of t.keys())M1(n);e.clear()},GR=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},A6=Lu(gi(`${o0}/add`),{withTypes:()=>A6}),$pe=gi(`${o0}/removeAll`),O6=Lu(gi(`${o0}/remove`),{withTypes:()=>O6}),Bpe=(...e)=>{console.error(`${o0}/error`,...e)},Xh=(e={})=>{const t=new Map,n=new Map,r=v=>{const w=n.get(v)??0;n.set(v,w+1)},i=v=>{const w=n.get(v)??1;w===1?n.delete(v):n.set(v,w-1)},{extra:a,onError:o=Bpe}=e;fC(o);const u=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),w=>{v.unsubscribe(),w?.cancelActive&&M1(v)}),d=v=>{const w=KR(t,v)??C6(v);return u(w)};Lu(d,{withTypes:()=>d});const f=v=>{const w=KR(t,v);return w&&(w.unsubscribe(),v.cancelActive&&M1(w)),!!w};Lu(f,{withTypes:()=>f});const p=async(v,w,b,j)=>{const k=new AbortController,E=Ipe(d,k.signal),C=[];try{v.pending.add(k),r(v),await Promise.resolve(v.effect(w,Lu({},b,{getOriginalState:j,condition:(O,_)=>E(O,_).then(Boolean),take:E,delay:N6(k.signal),pause:Cy(k.signal),extra:a,signal:k.signal,fork:Mpe(k.signal,C),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((O,_,A)=>{O!==k&&(O.abort(D1),A.delete(O))})},cancel:()=>{k.abort(D1),v.pending.delete(k)},throwIfCancelled:()=>{Ul(k.signal)}})))}catch(O){O instanceof s0||GR(o,O,{raisedBy:"effect"})}finally{await Promise.all(C),k.abort(Rpe),i(v),v.pending.delete(k)}},m=Lpe(t,n);return{middleware:v=>w=>b=>{if(!r6(b))return w(b);if(A6.match(b))return d(b.payload);if($pe.match(b)){m();return}if(O6.match(b))return f(b.payload);let j=v.getState();const k=()=>{if(j===HR)throw new Error(mi(23));return j};let E;try{if(E=w(b),t.size>0){const C=v.getState(),O=Array.from(t.values());for(const _ of O){let A=!1;try{A=_.predicate(b,C,j)}catch(z){A=!1,GR(o,z,{raisedBy:"predicate"})}A&&p(_,b,v,k)}}}finally{j=HR}return E},startListening:d,stopListening:f,clearListeners:m}};function mi(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 Upe={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},E6=jr({name:"chartLayout",initialState:Upe,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:qpe,setLayout:Fpe,setChartSize:Hpe,setScale:Kpe}=E6.actions,Gpe=E6.reducer;function _6(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function gt(e){return Number.isFinite(e)}function Ua(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function VR(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 Au(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VR(Object(n),!0).forEach(function(r){Vpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vpe(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=Ype(e,"string");return typeof t=="symbol"?t:t+""}function Ype(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 zn(e,t,n){return mn(e)||mn(t)?n:Ba(t)?Wu(e,t,n):typeof t=="function"?t(e):n}var Zpe=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:u}=t;if((u==="vertical"||u==="horizontal"&&o==="middle")&&a!=="center"&&Te(e[a]))return Au(Au({},e),{},{[a]:e[a]+(r||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&o!=="middle"&&Te(e[o]))return Au(Au({},e),{},{[o]:e[o]+(i||0)})}return e},Ka=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",z6=(e,t,n,r)=>{if(r)return e.map(u=>u.coordinate);var i,a,o=e.map(u=>(u.coordinate===t&&(i=!0),u.coordinate===n&&(a=!0),u.coordinate));return i||o.push(t),a||o.push(n),o},T6=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:u,isCategorical:d,categoricalDomain:f,tickCount:p,ticks:m,niceTicks:y,axisType:v}=e;if(!o)return null;var w=u==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,b=i==="category"&&o.bandwidth?o.bandwidth()/w:0;if(b=v==="angleAxis"&&a&&a.length>=2?Qr(a[0]-a[1])*2*b:b,m||y){var j=(m||y||[]).map((k,E)=>{var C=r?r.indexOf(k):k,O=o.map(C);return gt(O)?{coordinate:O+b,value:k,offset:b,index:E}:null}).filter(Yr);return j}return d&&f?f.map((k,E)=>{var C=o.map(k);return gt(C)?{coordinate:C+b,value:k,index:E,offset:b}:null}).filter(Yr):o.ticks&&p!=null?o.ticks(p).map((k,E)=>{var C=o.map(k);return gt(C)?{coordinate:C+b,value:k,index:E,offset:b}:null}).filter(Yr):o.domain().map((k,E)=>{var C=o.map(k);return gt(C)?{coordinate:C+b,value:r?r[k]:k,index:E,offset:b}:null}).filter(Yr)},Wpe=(e,t)=>{if(!t||t.length!==2||!Te(t[0])||!Te(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(!Te(e[0])||e[0]<n)&&(i[0]=n),(!Te(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},Xpe=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,o=0,u=0;u<n;++u){var d=e[u],f=d?.[i];if(f!=null){var p=f[1],m=f[0],y=ua(p)?m:p;y>=0?(f[0]=a,a+=y,f[1]=a):(f[0]=o,o+=y,f[1]=o)}}}},Jpe=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,o=0;o<n;++o){var u=e[o],d=u?.[i];if(d!=null){var f=ua(d[1])?d[0]:d[1];f>=0?(d[0]=a,a+=f,d[1]=a):(d[0]=0,d[1]=0)}}}},eme={sign:Xpe,expand:kfe,none:Jl,silhouette:Cfe,wiggle:Afe,positive:Jpe},tme=(e,t,n)=>{var r,i=(r=eme[n])!==null&&r!==void 0?r:Jl,a=Nfe().keys(t).value((u,d)=>Number(zn(u,d,0))).order(k1).offset(i),o=a(e);return o.forEach((u,d)=>{u.forEach((f,p)=>{var m=zn(e[p],t[d],0);Array.isArray(m)&&m.length===2&&Te(m[0])&&Te(m[1])&&(f[0]=m[0],f[1]=m[1])})}),o};function P6(e){return e==null?void 0:String(e)}function QR(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!mn(i[t.dataKey])){var u=MB(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=zn(i,mn(o)?t.dataKey:o),f=t.scale.map(d);return Te(f)?f:null}var YR=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:o}=e;if(t.type==="category")return n[o]?n[o].coordinate+r:null;var u=zn(a,t.dataKey,t.scale.domain()[o]);if(mn(u))return null;var d=t.scale.map(u);return Te(d)?d-i/2+r:null},nme=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]},rme=e=>{var t=e.flat(2).filter(Te);return[Math.min(...t),Math.max(...t)]},ime=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],ame=(e,t,n)=>{if(e!=null)return ime(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,u=o.reduce((d,f)=>{var p=_6(f,t,n),m=rme(p);return!gt(m[0])||!gt(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]))},ZR=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,WR=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ju=(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=Xv(t,p=>p.coordinate),a=1/0,o=1,u=i.length;o<u;o++){var d=i[o],f=i[o-1];a=Math.min((d?.coordinate||0)-(f?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function XR(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Au(Au({},t),{},{dataKey:n,payload:r,value:i,name:a})}function l0(e,t){if(e)return String(e);if(typeof t=="string")return t}var sme=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},ome=(e,t)=>t==="centric"?e.angle:e.radius,Ps=e=>e.layout.width,Rs=e=>e.layout.height,lme=e=>e.layout.scale,R6=e=>e.layout.margin,c0=ae(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),u0=ae(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),cme="data-recharts-item-index",ume="data-recharts-item-id",Jh=60;function JR(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 ig(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JR(Object(n),!0).forEach(function(r){dme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dme(e,t,n){return(t=fme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fme(e){var t=hme(e,"string");return typeof t=="symbol"?t:t+""}function hme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pme=e=>e.brush.height;function mme(e){var t=u0(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Jh;return n+i}return n},0)}function gme(e){var t=u0(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Jh;return n+i}return n},0)}function yme(e){var t=c0(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function vme(e){var t=c0(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Wn=ae([Ps,Rs,R6,pme,mme,gme,yme,vme,JB,Fhe],(e,t,n,r,i,a,o,u,d,f)=>{var p={left:(n.left||0)+i,right:(n.right||0)+a},m={top:(n.top||0)+o,bottom:(n.bottom||0)+u},y=ig(ig({},m),p),v=y.bottom;y.bottom+=r,y=Zpe(y,d,f);var w=e-y.left-y.right,b=t-y.top-y.bottom;return ig(ig({brushBottom:v},y),{},{width:Math.max(w,0),height:Math.max(b,0)})}),xme=ae(Wn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),hC=ae(Ps,Rs,(e,t)=>({x:0,y:0,width:e,height:t})),bme=x.createContext(null),Nr=()=>x.useContext(bme)!=null,d0=e=>e.brush,f0=ae([d0,Wn,R6],(e,t,n)=>({height:e.height,x:Te(e.x)?e.x:t.left,y:Te(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Te(e.width)?e.width:t.width})),US={},qS={},FS={},eD;function wme(){return eD||(eD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let o,u=null;const d=a!=null&&a.includes("leading"),f=a==null||a.includes("trailing"),p=()=>{u!==null&&(n.apply(o,u),o=void 0,u=null)},m=()=>{f&&p(),b()};let y=null;const v=()=>{y!=null&&clearTimeout(y),y=setTimeout(()=>{y=null,m()},r)},w=()=>{y!==null&&(clearTimeout(y),y=null)},b=()=>{w(),o=void 0,u=null},j=()=>{p()},k=function(...E){if(i?.aborted)return;o=this,u=E;const C=y==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})(FS)),FS}var tD;function Sme(){return tD||(tD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wme();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:o=!1,trailing:u=!0,maxWait:d}=a,f=Array(2);o&&(f[0]="leading"),u&&(f[1]="trailing");let p,m=null;const y=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(),y.cancel(),y.schedule(),p):(y.apply(this,b),p)},w=()=>(y.flush(),p);return v.cancel=y.cancel,v.flush=w,v}e.debounce=n})(qS)),qS}var nD;function jme(){return nD||(nD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Sme();function n(r,i=0,a={}){const{leading:o=!0,trailing:u=!0}=a;return t.debounce(r,i,{leading:o,maxWait:i,trailing:u})}e.throttle=n})(US)),US}var HS,rD;function Nme(){return rD||(rD=1,HS=jme().throttle),HS}var kme=Nme();const Cme=ha(kme);var Ay=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 o=0;console.warn(n.replace(/%s/g,()=>i[o++]))}},Ra={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},D6=(e,t,n)=>{var{width:r=Ra.width,height:i=Ra.height,aspect:a,maxHeight:o}=n,u=ec(r)?e:Number(r),d=ec(i)?t:Number(i);return a&&a>0&&(u?d=u/a:d&&(u=d*a),o&&d!=null&&d>o&&(d=o)),{calculatedWidth:u,calculatedHeight:d}},Ame={width:0,height:0,overflow:"visible"},Ome={width:0,overflowX:"visible"},Eme={height:0,overflowY:"visible"},_me={},zme=e=>{var{width:t,height:n}=e,r=ec(t),i=ec(n);return r&&i?Ame:r?Ome:i?Eme:_me};function Tme(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=Ra.width,a=Ra.height):i===void 0?i=r&&r>0?void 0:Ra.width:a===void 0&&(a=r&&r>0?void 0:Ra.height),{width:i,height:a}}function I1(){return I1=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},I1.apply(null,arguments)}function iD(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?iD(Object(n),!0).forEach(function(r){Pme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pme(e,t,n){return(t=Rme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rme(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 M6=x.createContext(Ra.initialDimension);function Mme(e){return Ua(e.width)&&Ua(e.height)}function I6(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return Mme(i)?x.createElement(M6.Provider,{value:i},t):null}var pC=()=>x.useContext(M6),Ime=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Ra.initialDimension,width:i,height:a,minWidth:o=Ra.minWidth,minHeight:u,maxHeight:d,children:f,debounce:p=Ra.debounce,id:m,className:y,onResize:v,style:w={}}=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((R,$)=>{E(F=>{var U=Math.round(R),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 yc;var R=B=>{var V,X=B[0];if(X!=null){var{width:W,height:H}=X.contentRect;C(W,H),(V=j.current)===null||V===void 0||V.call(j,W,H)}};p>0&&(R=Cme(R,p,{trailing:!0,leading:!1}));var $=new ResizeObserver(R),{width:F,height:U}=b.current.getBoundingClientRect();return C(F,U),$.observe(b.current),()=>{$.disconnect()}},[C,p]);var{containerWidth:O,containerHeight:_}=k;Ay(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:A,calculatedHeight:z}=D6(O,_,{width:i,height:a,aspect:n,maxHeight:d});return Ay(A!=null&&A>0||z!=null&&z>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.`,A,z,i,a,o,u,n),x.createElement("div",{id:m?"".concat(m):void 0,className:Rt("recharts-responsive-container",y),style:aD(aD({},w),{},{width:i,height:a,minWidth:o,minHeight:u,maxHeight:d}),ref:b},x.createElement("div",{style:zme({width:i,height:a})},x.createElement(I6,{width:A,height:z},f)))}),Oy=x.forwardRef((e,t)=>{var n=pC();if(Ua(n.width)&&Ua(n.height))return e.children;var{width:r,height:i}=Tme({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=D6(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Te(a)&&Te(o)?x.createElement(I6,{width:a,height:o},e.children):x.createElement(Ime,I1({},e,{width:r,height:i,ref:t}))});function mC(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 h0=()=>{var e,t=Nr(),n=Ue(xme),r=Ue(f0),i=(e=Ue(d0))===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}},Lme={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},L6=()=>{var e;return(e=Ue(Wn))!==null&&e!==void 0?e:Lme},gC=()=>Ue(Ps),yC=()=>Ue(Rs),$me=()=>Ue(e=>e.layout.margin),It=e=>e.layout.layoutType,vc=()=>Ue(It),vC=()=>{var e=vc();if(e==="horizontal"||e==="vertical")return e},$6=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Bme=()=>{var e=vc();return e!==void 0},ep=e=>{var t=sn(),n=Nr(),{width:r,height:i}=e,a=pC(),o=r,u=i;return a&&(o=a.width>0?a.width:r,u=a.height>0?a.height:i),x.useEffect(()=>{!n&&Ua(o)&&Ua(u)&&t(Hpe({width:o,height:u}))},[t,n,o,u]),null},B6=Symbol.for("immer-nothing"),sD=Symbol.for("immer-draftable"),yi=Symbol.for("immer-state");function la(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ch=Object.getPrototypeOf;function ed(e){return!!e&&!!e[yi]}function nc(e){return e?U6(e)||Array.isArray(e)||!!e[sD]||!!e.constructor?.[sD]||tp(e)||m0(e):!1}var Ume=Object.prototype.constructor.toString(),oD=new WeakMap;function U6(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=oD.get(n);return r===void 0&&(r=Function.toString.call(n),oD.set(n,r)),r===Ume}function Ey(e,t,n=!0){p0(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 p0(e){const t=e[yi];return t?t.type_:Array.isArray(e)?1:tp(e)?2:m0(e)?3:0}function L1(e,t){return p0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function q6(e,t,n){const r=p0(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function qme(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function tp(e){return e instanceof Map}function m0(e){return e instanceof Set}function kl(e){return e.copy_||e.base_}function $1(e,t){if(tp(e))return new Map(e);if(m0(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=U6(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 o=i[a],u=r[o];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(r[o]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[o]})}return Object.create(Ch(e),r)}else{const r=Ch(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function xC(e,t=!1){return g0(e)||ed(e)||!nc(e)||(p0(e)>1&&Object.defineProperties(e,{set:ag,add:ag,clear:ag,delete:ag}),Object.freeze(e),t&&Object.values(e).forEach(n=>xC(n,!0))),e}function Fme(){la(2)}var ag={value:Fme};function g0(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Hme={};function rc(e){const t=Hme[e];return t||la(0,e),t}var Ah;function F6(){return Ah}function Kme(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function lD(e,t){t&&(rc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function B1(e){U1(e),e.drafts_.forEach(Gme),e.drafts_=null}function U1(e){e===Ah&&(Ah=e.parent_)}function cD(e){return Ah=Kme(Ah,e)}function Gme(e){const t=e[yi];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function uD(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[yi].modified_&&(B1(t),la(4)),nc(e)&&(e=_y(t,e),t.parent_||zy(t,e)),t.patches_&&rc("Patches").generateReplacementPatches_(n[yi].base_,e,t.patches_,t.inversePatches_)):e=_y(t,n,[]),B1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==B6?e:void 0}function _y(e,t,n){if(g0(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[yi];if(!i)return Ey(t,(a,o)=>dD(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return zy(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let o=a,u=!1;i.type_===3&&(o=new Set(a),a.clear(),u=!0),Ey(o,(d,f)=>dD(e,i,a,d,f,n,u),r),zy(e,a,!1),n&&e.patches_&&rc("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function dD(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const u=g0(i);if(!(u&&!o)){if(ed(i)){const d=a&&t&&t.type_!==3&&!L1(t.assigned_,r)?a.concat(r):void 0,f=_y(e,i,d);if(q6(n,r,f),ed(f))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(nc(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&u)return;_y(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(tp(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&zy(e,i)}}}function zy(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&xC(t,n)}function Vme(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:F6(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=bC;n&&(i=[r],a=Oh);const{revoke:o,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=o,u}var bC={get(e,t){if(t===yi)return e;const n=kl(e);if(!L1(n,t))return Qme(e,n,t);const r=n[t];return e.finalized_||!nc(r)?r:r===KS(e.base_,t)?(GS(e),e.copy_[t]=F1(r,e)):r},has(e,t){return t in kl(e)},ownKeys(e){return Reflect.ownKeys(kl(e))},set(e,t,n){const r=H6(kl(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=KS(kl(e),t),a=i?.[yi];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(qme(n,i)&&(n!==void 0||L1(e.base_,t)))return!0;GS(e),q1(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 KS(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,GS(e),q1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=kl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){la(11)},getPrototypeOf(e){return Ch(e.base_)},setPrototypeOf(){la(12)}},Oh={};Ey(bC,(e,t)=>{Oh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Oh.deleteProperty=function(e,t){return Oh.set.call(this,e,t,void 0)};Oh.set=function(e,t,n){return bC.set.call(this,e[0],t,n,e[0])};function KS(e,t){const n=e[yi];return(n?kl(n):e)[t]}function Qme(e,t,n){const r=H6(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function H6(e,t){if(!(t in e))return;let n=Ch(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ch(n)}}function q1(e){e.modified_||(e.modified_=!0,e.parent_&&q1(e.parent_))}function GS(e){e.copy_||(e.copy_=$1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Yme=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 o=this;return function(d=a,...f){return o.produce(d,p=>n.call(this,p,...f))}}typeof n!="function"&&la(6),r!==void 0&&typeof r!="function"&&la(7);let i;if(nc(t)){const a=cD(this),o=F1(t,void 0);let u=!0;try{i=n(o),u=!1}finally{u?B1(a):U1(a)}return lD(a,r),uD(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===B6&&(i=void 0),this.autoFreeze_&&xC(i,!0),r){const a=[],o=[];rc("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else la(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...u)=>this.produceWithPatches(o,d=>t(d,...u));let r,i;return[this.produce(t,n,(o,u)=>{r=o,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){nc(e)||la(8),ed(e)&&(e=Zme(e));const t=cD(this),n=F1(e,void 0);return n[yi].isManual_=!0,U1(t),n}finishDraft(e,t){const n=e&&e[yi];(!n||!n.isManual_)&&la(9);const{scope_:r}=n;return lD(r,t),uD(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=rc("Patches").applyPatches_;return ed(e)?r(e,t):this.produce(e,i=>r(i,t))}};function F1(e,t){const n=tp(e)?rc("MapSet").proxyMap_(e,t):m0(e)?rc("MapSet").proxySet_(e,t):Vme(e,t);return(t?t.scope_:F6()).drafts_.push(n),n}function Zme(e){return ed(e)||la(10,e),K6(e)}function K6(e){if(!nc(e)||g0(e))return e;const t=e[yi];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=$1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=$1(e,!0);return Ey(n,(i,a)=>{q6(n,i,K6(a))},r),t&&(t.finalized_=!1),n}var Wme=new Yme;Wme.produce;var Xme={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},G6=jr({name:"legend",initialState:Xme,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:rn()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Bi(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:rn()},removeLegendPayload:{reducer(e,t){var n=Bi(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:rn()}}}),{setLegendSize:fD,setLegendSettings:Jme,addLegendPayload:ege,replaceLegendPayload:tge,removeLegendPayload:nge}=G6.actions,rge=G6.reducer,VS={exports:{}},QS={};var hD;function ige(){if(hD)return QS;hD=1;var e=cd();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,o=e.useMemo,u=e.useDebugValue;return QS.useSyncExternalStoreWithSelector=function(d,f,p,m,y){var v=i(null);if(v.current===null){var w={hasValue:!1,value:null};v.current=w}else w=v.current;v=o(function(){function j(_){if(!k){if(k=!0,E=_,_=m(_),y!==void 0&&w.hasValue){var A=w.value;if(y(A,_))return C=A}return C=_}if(A=C,n(E,_))return A;var z=m(_);return y!==void 0&&y(A,z)?(E=_,A):(E=_,C=z)}var k=!1,E,C,O=p===void 0?null:p;return[function(){return j(f())},O===null?void 0:function(){return j(O())}]},[f,p,m,y]);var b=r(d,v[0],v[1]);return a(function(){w.hasValue=!0,w.value=b},[b]),u(b),b},QS}var pD;function age(){return pD||(pD=1,VS.exports=ige()),VS.exports}age();function sge(e){e()}function oge(){let e=null,t=null;return{clear(){e=null,t=null},notify(){sge(()=>{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 mD={notify(){},get:()=>[]};function lge(e,t){let n,r=mD,i=0,a=!1;function o(b){p();const j=r.subscribe(b);let k=!1;return()=>{k||(k=!0,j(),m())}}function u(){r.notify()}function d(){w.onStateChange&&w.onStateChange()}function f(){return a}function p(){i++,n||(n=e.subscribe(d),r=oge())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=mD)}function y(){a||(a=!0,p())}function v(){a&&(a=!1,m())}const w={addNestedSub:o,notifyNestedSubs:u,handleChangeWrapper:d,isSubscribed:f,trySubscribe:y,tryUnsubscribe:v,getListeners:()=>r};return w}var cge=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",uge=cge(),dge=()=>typeof navigator<"u"&&navigator.product==="ReactNative",fge=dge(),hge=()=>uge||fge?x.useLayoutEffect:x.useEffect,pge=hge();function gD(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function mge(e,t){if(gD(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])||!gD(e[n[i]],t[n[i]]))return!1;return!0}var gge=Symbol.for("react-redux-context"),yge=typeof globalThis<"u"?globalThis:{};function vge(){if(!x.createContext)return{};const e=yge[gge]??=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var xge=vge();function bge(e){const{children:t,context:n,serverState:r,store:i}=e,a=x.useMemo(()=>{const d=lge(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),o=x.useMemo(()=>i.getState(),[i]);pge(()=>{const{subscription:d}=a;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),o!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[a,o]);const u=n||xge;return x.createElement(u.Provider,{value:a},t)}var wge=bge,Sge=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function jge(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function xd(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Sge.has(r)){if(e[r]==null&&t[r]==null)continue;if(!mge(e[r],t[r]))return!1}else if(!jge(e[r],t[r]))return!1;return!0}var Nge=["contextPayload"];function H1(){return H1=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},H1.apply(null,arguments)}function yD(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 td(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yD(Object(n),!0).forEach(function(r){kge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yD(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,t){if(e==null)return{};var n,r,i=Ege(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 Ege(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 _ge(e){return e.value}function zge(e){var{contextPayload:t}=e,n=Oge(e,Nge),r=YB(t,e.payloadUniqBy,_ge),i=td(td({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content=="function"?x.createElement(e.content,i):x.createElement(nhe,i)}function Tge(e,t,n,r,i,a){var{layout:o,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"&&o==="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}),td(td({},f),p)}function Pge(e){var t=sn();return x.useEffect(()=>{t(Jme(e))},[t,e]),null}function Rge(e){var t=sn();return x.useEffect(()=>(t(fD(e)),()=>{t(fD({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 Mge={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Ige(e){var t=Sr(e,Mge),n=Ghe(),r=Qde(),i=$me(),{width:a,height:o,wrapperStyle:u,portal:d}=t,[f,p]=e6([n]),m=gC(),y=yC();if(m==null||y==null)return null;var v=m-(i?.left||0)-(i?.right||0),w=Dge(t.layout,o,a,v),b=d?u:td(td({position:"absolute",width:w?.width||a||"auto",height:w?.height||o||"auto"},Tge(u,t,i,m,y,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(Pge,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&x.createElement(Rge,{width:f.width,height:f.height}),x.createElement(zge,H1({},t,w,{margin:i,chartWidth:m,chartHeight:y,contextPayload:n})));return uc.createPortal(k,j)}var wC=x.memo(Ige,xd);wC.displayName="Legend";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 vD(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 Rf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vD(Object(n),!0).forEach(function(r){Lge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vD(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){return Array.isArray(e)&&Ba(e[0])&&Ba(e[1])?e.join(" ~ "):e}var uu={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 qge(e,t){return t==null?e:Xv(e,t)}var Fge=e=>{var{separator:t=uu.separator,contentStyle:n,itemStyle:r,labelStyle:i=uu.labelStyle,payload:a,formatter:o,itemSorter:u,wrapperClassName:d,labelClassName:f,label:p,labelFormatter:m,accessibilityLayer:y=uu.accessibilityLayer}=e,v=()=>{if(a&&a.length){var _={padding:0,margin:0},A=qge(a,u),z=A.map((R,$)=>{if(!R||R.type==="none")return null;var F=R.formatter||o||Uge,{value:U,name:B}=R,V=U,X=B;if(F){var W=F(U,B,R,$,a);if(Array.isArray(W))[V,X]=W;else if(W!=null)V=W;else return null}var H=Rf(Rf({},uu.itemStyle),{},{color:R.color||uu.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat($),style:H},Ba(X)?x.createElement("span",{className:"recharts-tooltip-item-name"},X):null,Ba(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"},R.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:_},z)}return null},w=Rf(Rf({},uu.contentStyle),n),b=Rf({margin:0},i),j=!mn(p),k=j?p:"",E=Rt("recharts-default-tooltip",d),C=Rt("recharts-tooltip-label",f);j&&m&&a!==void 0&&a!==null&&(k=m(p,a));var O=y?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",K1({className:E,style:w},O),x.createElement("p",{className:C,style:b},x.isValidElement(k)?k:"".concat(k)),v())},Df="recharts-tooltip-wrapper",Hge={visibility:"hidden"};function Kge(e){var{coordinate:t,translateX:n,translateY:r}=e;return Rt(Df,{["".concat(Df,"-right")]:Te(n)&&t&&Te(t.x)&&n>=t.x,["".concat(Df,"-left")]:Te(n)&&t&&Te(t.x)&&n<t.x,["".concat(Df,"-bottom")]:Te(r)&&t&&Te(t.y)&&r>=t.y,["".concat(Df,"-top")]:Te(r)&&t&&Te(t.y)&&r<t.y})}function xD(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:u,viewBox:d,viewBoxDimension:f}=e;if(a&&Te(a[r]))return a[r];var p=n[r]-u-(i>0?i:0),m=n[r]+i;if(t[r])return o[r]?p:m;var y=d[r];if(y==null)return 0;if(o[r]){var v=p,w=y;return v<w?Math.max(m,y):Math.max(p,y)}if(f==null)return 0;var b=m+u,j=y+f;return b>j?Math.max(p,y):Math.max(m,y)}function Gge(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 Vge(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:u,useTranslate3d:d,viewBox:f}=e,p,m,y;return u.height>0&&u.width>0&&n?(m=xD({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:u.width,viewBox:f,viewBoxDimension:f.width}),y=xD({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:u.height,viewBox:f,viewBoxDimension:f.height}),p=Gge({translateX:m,translateY:y,useTranslate3d:d})):p=Hge,{cssProperties:p,cssClasses:Kge({translateX:m,translateY:y,coordinate:n})}}var Qge=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),np={isSsr:Qge()};function V6(){var[e,t]=x.useState(()=>np.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 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 du(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){Yge(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 Yge(e,t,n){return(t=Zge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zge(e){var t=Wge(e,"string");return typeof t=="symbol"?t:t+""}function Wge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xge(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function Jge(e){var t,n,r,i,a,o,u=V6(),[d,f]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var w=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",w),()=>{document.removeEventListener("keydown",w)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),d.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==d.dismissedAtCoordinate.x||((a=(o=e.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==d.dismissedAtCoordinate.y)&&f(du(du({},d),{},{dismissed:!1}));var{cssClasses:p,cssProperties:m}=Vge({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),y=e.hasPortalFromProps?{}:du(du({transition:Xge({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},m),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=du(du({},y),{},{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 eye=x.memo(Jge),Q6=()=>{var e;return(e=Ue(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function G1(){return G1=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},G1.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 SD(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){tye(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 tye(e,t,n){return(t=nye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nye(e){var t=rye(e,"string");return typeof t=="symbol"?t:t+""}function rye(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 jD={curveBasisClosed:hfe,curveBasisOpen:pfe,curveBasis:ffe,curveBumpX:Xde,curveBumpY:Jde,curveLinearClosed:mfe,curveLinear:Yv,curveMonotoneX:gfe,curveMonotoneY:yfe,curveNatural:vfe,curveStep:xfe,curveStepAfter:wfe,curveStepBefore:bfe},Ty=e=>gt(e.x)&>(e.y),ND=e=>e.base!=null&&Ty(e.base)&&Ty(e),Mf=e=>e.x,If=e=>e.y,iye=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Zh(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=jD["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return jD[n]||Yv},kD={connectNulls:!1,type:"linear"},aye=e=>{var{type:t=kD.type,points:n=[],baseLine:r,layout:i,connectNulls:a=kD.connectNulls}=e,o=iye(t,i),u=a?n.filter(Ty):n;if(Array.isArray(r)){var d,f=n.map((w,b)=>SD(SD({},w),{},{base:r[b]}));i==="vertical"?d=Xm().y(If).x1(Mf).x0(w=>w.base.x):d=Xm().x(Mf).y1(If).y0(w=>w.base.y);var p=d.defined(ND).curve(o),m=a?f.filter(ND):f;return p(m)}var y;i==="vertical"&&Te(r)?y=Xm().y(If).x1(Mf).x0(r):Te(r)?y=Xm().x(Mf).y1(If).y0(r):y=jB().x(Mf).y(If);var v=y.defined(Ty).curve(o);return v(u)},sh=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=vc();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},u=n&&n.length?aye(o):r;return x.createElement("path",G1({},Hi(e),iC(e),{className:Rt("recharts-curve",t),d:u===null?void 0:u,ref:i}))},sye=["x","y","top","left","width","height","className"];function V1(){return V1=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},V1.apply(null,arguments)}function CD(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 oye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CD(Object(n),!0).forEach(function(r){lye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lye(e,t,n){return(t=cye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cye(e){var t=uye(e,"string");return typeof t=="symbol"?t:t+""}function uye(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 dye(e,t){if(e==null)return{};var n,r,i=fye(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 fye(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 hye=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),pye=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:u}=e,d=dye(e,sye),f=oye({x:t,y:n,top:r,left:i,width:a,height:o},d);return!Te(t)||!Te(n)||!Te(a)||!Te(o)||!Te(r)||!Te(i)?null:x.createElement("path",V1({},Dr(f),{className:Rt("recharts-cross",u),d:hye(t,n,a,o,r,i)}))};function mye(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 AD(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 OD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AD(Object(n),!0).forEach(function(r){gye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gye(e,t,n){return(t=yye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yye(e){var t=vye(e,"string");return typeof t=="symbol"?t:t+""}function vye(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 xye=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),Y6=(e,t,n)=>e.map(r=>"".concat(xye(r)," ").concat(t,"ms ").concat(n)).join(","),bye=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Eh=(e,t)=>Object.keys(t).reduce((n,r)=>OD(OD({},n),{},{[r]:e(r,t[r])}),{});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 Hn(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){wye(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 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 Py=(e,t,n)=>e+(t-e)*n,Q1=e=>{var{from:t,to:n}=e;return t!==n},Z6=(e,t,n)=>{var r=Eh((i,a)=>{if(Q1(a)){var[o,u]=e(a.from,a.to,a.velocity);return Hn(Hn({},a),{},{from:o,velocity:u})}return a},t);return n<1?Eh((i,a)=>Q1(a)&&r[i]!=null?Hn(Hn({},a),{},{velocity:Py(a.velocity,r[i].velocity,n),from:Py(a.from,r[i].from,n)}):a,t):Z6(e,r,n-1)};function Nye(e,t,n,r,i,a){var o,u=r.reduce((y,v)=>Hn(Hn({},y),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),d=()=>Eh((y,v)=>v.from,u),f=()=>!Object.values(u).filter(Q1).length,p=null,m=y=>{o||(o=y);var v=y-o,w=v/n.dt;u=Z6(n,u,w),i(Hn(Hn(Hn({},e),t),d())),o=y,f()||(p=a.setTimeout(m))};return()=>(p=a.setTimeout(m),()=>{var y;(y=p)===null||y===void 0||y()})}function kye(e,t,n,r,i,a,o){var u=null,d=i.reduce((m,y)=>{var v=e[y],w=t[y];return v==null||w==null?m:Hn(Hn({},m),{},{[y]:[v,w]})},{}),f,p=m=>{f||(f=m);var y=(m-f)/r,v=Eh((b,j)=>Py(...j,n(y)),d);if(a(Hn(Hn(Hn({},e),t),v)),y<1)u=o.setTimeout(p);else{var w=Eh((b,j)=>Py(...j,n(1)),d);a(Hn(Hn(Hn({},e),t),w))}};return()=>(u=o.setTimeout(p),()=>{var m;(m=u)===null||m===void 0||m()})}const Cye=(e,t,n,r,i,a)=>{var o=bye(e,t);return n==null?()=>(i(Hn(Hn({},e),t)),()=>{}):n.isStepper===!0?Nye(e,t,n,o,i,a):kye(e,t,n,r,o,i,a)};var Ry=1e-4,W6=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],X6=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),_D=(e,t)=>n=>{var r=W6(e,t);return X6(r,n)},Aye=(e,t)=>n=>{var r=W6(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return X6(i,n)},Oye=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]]},Eye=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=Oye(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},_ye=(e,t,n,r)=>{var i=_D(e,n),a=_D(t,r),o=Aye(e,n),u=f=>f>1?1:f<0?0:f,d=f=>{for(var p=f>1?1:f,m=p,y=0;y<8;++y){var v=i(m)-p,w=o(m);if(Math.abs(v-p)<Ry||w<Ry)return a(m);m=u(m-v/w)}return a(m)};return d.isStepper=!1,d},zD=function(){return _ye(...Eye(...arguments))},zye=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(o,u,d)=>{var f=-(o-u)*n,p=d*r,m=d+(f-p)*i/1e3,y=d*i/1e3+o;return Math.abs(y-u)<Ry&&Math.abs(m)<Ry?[u,0]:[y,m]};return a.isStepper=!0,a.dt=i,a},Tye=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return zD(e);case"spring":return zye();default:if(e.split("(")[0]==="cubic-bezier")return zD(e)}return typeof e=="function"?e:null};function Pye(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var u=o,[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 o=="string"&&(t=o,n(t)),typeof o=="object"&&(t=o,n(t)),typeof o=="function"&&o()}};return{stop:()=>{r=!0},start:o=>{r=!1,i&&(i(),i=null),a(o)},subscribe:o=>(n=o,()=>{n=()=>null}),getTimeoutController:()=>e}}class Rye{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=o=>{o-r>=n?t(o):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function Dye(){return Pye(new Rye)}var Mye=x.createContext(Dye);function Iye(e,t){var n=x.useContext(Mye);return x.useMemo(()=>t??n(e),[e,t,n])}var Lye={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},TD={t:0},YS={t:1};function y0(e){var t=Sr(e,Lye),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:u,onAnimationStart:d,children:f}=t,p=V6(),m=n==="auto"?!np.isSsr&&!p:n,y=Iye(t.animationId,t.animationManager),[v,w]=x.useState(m?TD:YS),b=x.useRef(null);return x.useEffect(()=>{m||w(YS)},[m]),x.useEffect(()=>{if(!m||!r)return yc;var j=Cye(TD,YS,Tye(a),i,w,y.getTimeoutController()),k=()=>{b.current=j()};return y.start([d,o,k,i,u]),()=>{y.stop(),b.current&&b.current(),u()}},[m,r,i,a,o,d,u,y]),f(v.t)}function v0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(Sh(t)),r=x.useRef(e);return r.current!==e&&(n.current=Sh(t),r.current=e),n.current}var $ye=["radius"],Bye=["radius"],PD,RD,DD,MD,ID,LD,$D,BD,UD,qD;function FD(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 HD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FD(Object(n),!0).forEach(function(r){Uye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uye(e,t,n){return(t=qye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qye(e){var t=Fye(e,"string");return typeof t=="symbol"?t:t+""}function Fye(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 Dy(){return Dy=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},Dy.apply(null,arguments)}function KD(e,t){if(e==null)return{};var n,r,i=Hye(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 Hye(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 GD=(e,t,n,r,i)=>{var a=Co(n),o=Co(r),u=Math.min(Math.abs(a)/2,Math.abs(o)/2),d=o>=0?1:-1,f=a>=0?1:-1,p=o>=0&&a>=0||o<0&&a<0?1:0,m;if(u>0&&Array.isArray(i)){for(var y=[0,0,0,0],v=0,w=4;v<w;v++){var b,j=(b=i[v])!==null&&b!==void 0?b:0;y[v]=j>u?u:j}m=jn(PD||(PD=Aa(["M",",",""])),e,t+d*y[0]),y[0]>0&&(m+=jn(RD||(RD=Aa(["A ",",",",0,0,",",",",",""])),y[0],y[0],p,e+f*y[0],t)),m+=jn(DD||(DD=Aa(["L ",",",""])),e+n-f*y[1],t),y[1]>0&&(m+=jn(MD||(MD=Aa(["A ",",",",0,0,",`,
|
|
261
|
+
`,",",""])),y[1],y[1],p,e+n,t+d*y[1])),m+=jn(ID||(ID=Aa(["L ",",",""])),e+n,t+r-d*y[2]),y[2]>0&&(m+=jn(LD||(LD=Aa(["A ",",",",0,0,",`,
|
|
262
|
+
`,",",""])),y[2],y[2],p,e+n-f*y[2],t+r)),m+=jn($D||($D=Aa(["L ",",",""])),e+f*y[3],t+r),y[3]>0&&(m+=jn(BD||(BD=Aa(["A ",",",",0,0,",`,
|
|
263
|
+
`,",",""])),y[3],y[3],p,e,t+r-d*y[3])),m+="Z"}else if(u>0&&i===+i&&i>0){var k=Math.min(u,i);m=jn(UD||(UD=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=jn(qD||(qD=Aa(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},VD={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},J6=e=>{var t=Sr(e,VD),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:o,width:u,height:d,radius:f,className:p}=t,{animationEasing:m,animationDuration:y,animationBegin:v,isAnimationActive:w,isUpdateAnimationActive:b}=t,j=x.useRef(u),k=x.useRef(d),E=x.useRef(a),C=x.useRef(o),O=x.useMemo(()=>({x:a,y:o,width:u,height:d,radius:f}),[a,o,u,d,f]),_=v0(O,"rectangle-");if(a!==+a||o!==+o||u!==+u||d!==+d||u===0||d===0)return null;var A=Rt("recharts-rectangle",p);if(!b){var z=Dr(t),{radius:R}=z,$=KD(z,$ye);return x.createElement("path",Dy({},$,{x:Co(a),y:Co(o),width:Co(u),height:Co(d),radius:typeof f=="number"?f:void 0,className:A,d:GD(a,o,u,d,f)}))}var F=j.current,U=k.current,B=E.current,V=C.current,X="0px ".concat(r===-1?1:r,"px"),W="".concat(r,"px ").concat(r,"px"),H=Y6(["strokeDasharray"],y,typeof m=="string"?m:VD.animationEasing);return x.createElement(y0,{animationId:_,key:_,canBegin:r>0,duration:y,easing:m,isActive:b,begin:v},J=>{var ce=pn(F,u,J),xe=pn(U,d,J),M=pn(B,a,J),I=pn(V,o,J);n.current&&(j.current=ce,k.current=xe,E.current=M,C.current=I);var q;w?J>0?q={transition:H,strokeDasharray:W}:q={strokeDasharray:X}:q={strokeDasharray:W};var D=Dr(t),{radius:G}=D,oe=KD(D,Bye);return x.createElement("path",Dy({},oe,{radius:typeof f=="number"?f:void 0,className:A,d:GD(M,I,ce,xe,f),ref:n,style:HD(HD({},q),t.style)}))})};function QD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function YD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QD(Object(n),!0).forEach(function(r){Kye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kye(e,t,n){return(t=Gye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gye(e){var t=Vye(e,"string");return typeof t=="symbol"?t:t+""}function Vye(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 My=Math.PI/180,Qye=e=>e*180/Math.PI,cr=(e,t,n,r)=>({x:e+Math.cos(-My*r)*n,y:t+Math.sin(-My*r)*n}),Yye=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},Zye=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},Wye=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=Zye({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var u=(n-i)/o,d=Math.acos(u);return r>a&&(d=2*Math.PI-d),{radius:o,angle:Qye(d),angleInRadian:d}},Xye=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}},Jye=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return e+o*360},eve=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=Wye({x:n,y:r},t),{innerRadius:o,outerRadius:u}=t;if(i<o||i>u||i===0)return null;var{startAngle:d,endAngle:f}=Xye(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?YD(YD({},t),{},{radius:i,angle:Jye(p,t)}):null};function eU(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=cr(t,n,r,i),u=cr(t,n,r,a);return{points:[o,u],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var ZD,WD,XD,JD,eM,tM,nM;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 Pl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var tve=(e,t)=>{var n=Qr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},sg=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:u,cornerIsExternal:d}=e,f=u*(o?1:-1)+r,p=Math.asin(u/f)/My,m=d?i:i+a*p,y=cr(t,n,f,m),v=cr(t,n,r,m),w=d?i-a*p:i,b=cr(t,n,f*Math.cos(p*My),w);return{center:y,circleTangency:v,lineTangency:b,theta:p}},tU=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,u=tve(a,o),d=a+u,f=cr(t,n,i,a),p=cr(t,n,i,d),m=jn(ZD||(ZD=Pl(["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 y=cr(t,n,r,a),v=cr(t,n,r,d);m+=jn(WD||(WD=Pl(["L ",",",`
|
|
275
|
+
A `,",",`,0,
|
|
276
|
+
`,",",`,
|
|
277
|
+
`,","," Z"])),v.x,v.y,r,r,+(Math.abs(u)>180),+(a<=d),y.x,y.y)}else m+=jn(XD||(XD=Pl(["L ",","," Z"])),t,n);return m},nve=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:u,startAngle:d,endAngle:f}=e,p=Qr(f-d),{circleTangency:m,lineTangency:y,theta:v}=sg({cx:t,cy:n,radius:i,angle:d,sign:p,cornerRadius:a,cornerIsExternal:u}),{circleTangency:w,lineTangency:b,theta:j}=sg({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 o?jn(JD||(JD=Pl(["M ",",",`
|
|
278
|
+
a`,",",",0,0,1,",`,0
|
|
279
|
+
a`,",",",0,0,1,",`,0
|
|
280
|
+
`])),y.x,y.y,a,a,a*2,a,a,-a*2):tU({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:f});var E=jn(eM||(eM=Pl(["M ",",",`
|
|
281
|
+
A`,",",",0,0,",",",",",`
|
|
282
|
+
A`,",",",0,",",",",",",",`
|
|
283
|
+
A`,",",",0,0,",",",",",`
|
|
284
|
+
`])),y.x,y.y,a,a,+(p<0),m.x,m.y,i,i,+(k>180),+(p<0),w.x,w.y,a,a,+(p<0),b.x,b.y);if(r>0){var{circleTangency:C,lineTangency:O,theta:_}=sg({cx:t,cy:n,radius:r,angle:d,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),{circleTangency:A,lineTangency:z,theta:R}=sg({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)-_-R;if($<0&&a===0)return"".concat(E,"L").concat(t,",").concat(n,"Z");E+=jn(tM||(tM=Pl(["L",",",`
|
|
285
|
+
A`,",",",0,0,",",",",",`
|
|
286
|
+
A`,",",",0,",",",",",",",`
|
|
287
|
+
A`,",",",0,0,",",",",","Z"])),z.x,z.y,a,a,+(p<0),A.x,A.y,r,r,+($>180),+(p>0),C.x,C.y,a,a,+(p<0),O.x,O.y)}else E+=jn(nM||(nM=Pl(["L",",","Z"])),t,n);return E},rve={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},nU=e=>{var t=Sr(e,rve),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p,className:m}=t;if(a<i||f===p)return null;var y=Rt("recharts-sector",m),v=a-i,w=da(o,v,0,!0),b;return w>0&&Math.abs(f-p)<360?b=nve({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(w,v/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p}):b=tU({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:p}),x.createElement("path",Y1({},Dr(t),{className:y,d:b}))};function ive(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(LB(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:u}=t,d=cr(r,i,a,u),f=cr(r,i,o,u);return[{x:d.x,y:d.y},{x:f.x,y:f.y}]}return eU(t)}}var ZS={},WS={},XS={},rM;function ave(){return rM||(rM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=WB();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(XS)),XS}var iM;function sve(){return iM||(iM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ave();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})(WS)),WS}var aM;function ove(){return aM||(aM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=XB(),n=sve();function r(i,a,o){o&&typeof o!="number"&&t.isIterateeCall(i,a,o)&&(a=o=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),o=o===void 0?i<a?1:-1:n.toFinite(o);const u=Math.max(Math.ceil((a-i)/(o||1)),0),d=new Array(u);for(let f=0;f<u;f++)d[f]=i,i+=o;return d}e.range=r})(ZS)),ZS}var JS,sM;function lve(){return sM||(sM=1,JS=ove().range),JS}var cve=lve();const rU=ha(cve);var ya=e=>e.chartData,SC=ae([ya],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),x0=(e,t,n,r)=>r?SC(e):ya(e),iU=(e,t,n)=>n?SC(e):ya(e),uve=ae([x0],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});ae([SC],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var dve=ae([ya],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function Ma(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(gt(t)&>(n))return!0}return!1}function oM(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function aU(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(gt(n))i=n;else if(typeof n=="function")return;if(gt(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(Ma(o))return o}}function fve(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Ma(r))return oM(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,u;if(i==="auto")t!=null&&(o=Math.min(...t));else if(Te(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t?.[0]))}catch{}else if(typeof i=="string"&&ZR.test(i)){var d=ZR.exec(i);if(d==null||d[1]==null||t==null)o=void 0;else{var f=+d[1];o=t[0]-f}}else o=t?.[0];if(a==="auto")t!=null&&(u=Math.max(...t));else if(Te(a))u=a;else if(typeof a=="function")try{t!=null&&(u=a(t?.[1]))}catch{}else if(typeof a=="string"&&WR.test(a)){var p=WR.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 y=[o,u];if(Ma(y))return t==null?y:oM(y,t,n)}}}var bd=1e9,hve={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},NC,un=!0,Ki="[DecimalError] ",ql=Ki+"Invalid argument: ",jC=Ki+"Exponent out of range: ",wd=Math.floor,Cl=Math.pow,pve=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fi,Yn=1e7,an=7,sU=9007199254740991,Iy=wd(sU/an),De={};De.absoluteValue=De.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};De.comparedTo=De.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};De.decimalPlaces=De.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*an;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};De.dividedBy=De.div=function(e){return Ns(this,new this.constructor(e))};De.dividedToIntegerBy=De.idiv=function(e){var t=this,n=t.constructor;return Qt(Ns(t,new n(e),0,1),n.precision)};De.equals=De.eq=function(e){return!this.cmp(e)};De.exponent=function(){return $n(this)};De.greaterThan=De.gt=function(e){return this.cmp(e)>0};De.greaterThanOrEqualTo=De.gte=function(e){return this.cmp(e)>=0};De.isInteger=De.isint=function(){return this.e>this.d.length-2};De.isNegative=De.isneg=function(){return this.s<0};De.isPositive=De.ispos=function(){return this.s>0};De.isZero=function(){return this.s===0};De.lessThan=De.lt=function(e){return this.cmp(e)<0};De.lessThanOrEqualTo=De.lte=function(e){return this.cmp(e)<1};De.logarithm=De.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(fi))throw Error(Ki+"NaN");if(n.s<1)throw Error(Ki+(n.s?"NaN":"-Infinity"));return n.eq(fi)?new r(0):(un=!1,t=Ns(_h(n,a),_h(e,a),a),un=!0,Qt(t,i))};De.minus=De.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?cU(t,e):oU(t,(e.s=-e.s,e))};De.modulo=De.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Ki+"NaN");return n.s?(un=!1,t=Ns(n,e,0,1).times(e),un=!0,n.minus(t)):Qt(new r(n),i)};De.naturalExponential=De.exp=function(){return lU(this)};De.naturalLogarithm=De.ln=function(){return _h(this)};De.negated=De.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};De.plus=De.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?oU(t,e):cU(t,(e.s=-e.s,e))};De.precision=De.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ql+e);if(t=$n(i)+1,r=i.d.length-1,n=r*an+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};De.squareRoot=De.sqrt=function(){var e,t,n,r,i,a,o,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(Ki+"NaN")}for(e=$n(u),un=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=Da(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=wd((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=o=n+3;;)if(a=r,r=a.plus(Ns(u,a,o+2)).times(.5),Da(a.d).slice(0,o)===(t=Da(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Qt(a,n+1,0),a.times(a).eq(u)){r=a;break}}else if(t!="9999")break;o+=4}return un=!0,Qt(r,n)};De.times=De.mul=function(e){var t,n,r,i,a,o,u,d,f,p=this,m=p.constructor,y=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=y.length,f=v.length,d<f&&(a=y,y=v,v=a,o=d,d=f,f=o),a=[],o=d+f,r=o;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=d+r;i>r;)u=a[i]+v[r]*y[i-r-1]+t,a[i--]=u%Yn|0,t=u/Yn|0;a[i]=(a[i]+t)%Yn|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,un?Qt(e,m.precision):e};De.toDecimalPlaces=De.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(qa(e,0,bd),t===void 0?t=r.rounding:qa(t,0,8),Qt(n,e+$n(n)+1,t))};De.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=ic(r,!0):(qa(e,0,bd),t===void 0?t=i.rounding:qa(t,0,8),r=Qt(new i(r),e+1,t),n=ic(r,!0,e+1)),n};De.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?ic(i):(qa(e,0,bd),t===void 0?t=a.rounding:qa(t,0,8),r=Qt(new a(i),e+$n(i)+1,t),n=ic(r.abs(),!1,e+$n(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};De.toInteger=De.toint=function(){var e=this,t=e.constructor;return Qt(new t(e),$n(e)+1,t.rounding)};De.toNumber=function(){return+this};De.toPower=De.pow=function(e){var t,n,r,i,a,o,u=this,d=u.constructor,f=12,p=+(e=new d(e));if(!e.s)return new d(fi);if(u=new d(u),!u.s){if(e.s<1)throw Error(Ki+"Infinity");return u}if(u.eq(fi))return u;if(r=d.precision,e.eq(fi))return Qt(u,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=u.s,o){if((n=p<0?-p:p)<=sU){for(i=new d(fi),t=Math.ceil(r/an+4),un=!1;n%2&&(i=i.times(u),cM(i.d,t)),n=wd(n/2),n!==0;)u=u.times(u),cM(u.d,t);return un=!0,e.s<0?new d(fi).div(i):Qt(i,r)}}else if(a<0)throw Error(Ki+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,un=!1,i=e.times(_h(u,r+f)),un=!0,i=lU(i),i.s=a,i};De.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=$n(i),r=ic(i,n<=a.toExpNeg||n>=a.toExpPos)):(qa(e,1,bd),t===void 0?t=a.rounding:qa(t,0,8),i=Qt(new a(i),e,t),n=$n(i),r=ic(i,e<=n||n<=a.toExpNeg,e)),r};De.toSignificantDigits=De.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(qa(e,1,bd),t===void 0?t=r.rounding:qa(t,0,8)),Qt(new r(n),e,t)};De.toString=De.valueOf=De.val=De.toJSON=De[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=$n(e),n=e.constructor;return ic(e,t<=n.toExpNeg||t>=n.toExpPos)};function oU(e,t){var n,r,i,a,o,u,d,f,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),un?Qt(t,m):t;if(d=e.d,f=t.d,o=e.e,i=t.e,d=d.slice(),a=o-i,a){for(a<0?(r=d,a=-a,u=f.length):(r=f,i=o,u=d.length),o=Math.ceil(m/an),u=o>u?o+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)/Yn|0,d[a]%=Yn;for(n&&(d.unshift(n),++i),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=i,un?Qt(t,m):t}function qa(e,t,n){if(e!==~~e||e<t||e>n)throw Error(ql+e)}function Da(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=an-r.length,n&&(a+=xo(n)),a+=r;o=e[t],r=o+"",n=an-r.length,n&&(a+=xo(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var Ns=(function(){function e(r,i){var a,o=0,u=r.length;for(r=r.slice();u--;)a=r[u]*i+o,r[u]=a%Yn|0,o=a/Yn|0;return o&&r.unshift(o),r}function t(r,i,a,o){var u,d;if(a!=o)d=a>o?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 o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*Yn+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var u,d,f,p,m,y,v,w,b,j,k,E,C,O,_,A,z,R,$=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(Ki+"Division by zero");for(d=r.e-i.e,z=B.length,_=U.length,v=new $(F),w=v.d=[],f=0;B[f]==(U[f]||0);)++f;if(B[f]>(U[f]||0)&&--d,a==null?E=a=$.precision:o?E=a+($n(r)-$n(i))+1:E=a,E<0)return new $(0);if(E=E/an+2|0,f=0,z==1)for(p=0,B=B[0],E++;(f<_||p)&&E--;f++)C=p*Yn+(U[f]||0),w[f]=C/B|0,p=C%B|0;else{for(p=Yn/(B[0]+1)|0,p>1&&(B=e(B,p),U=e(U,p),z=B.length,_=U.length),O=z,b=U.slice(0,z),j=b.length;j<z;)b[j++]=0;R=B.slice(),R.unshift(0),A=B[0],B[1]>=Yn/2&&++A;do p=0,u=t(B,b,z,j),u<0?(k=b[0],z!=j&&(k=k*Yn+(b[1]||0)),p=k/A|0,p>1?(p>=Yn&&(p=Yn-1),m=e(B,p),y=m.length,j=b.length,u=t(m,b,y,j),u==1&&(p--,n(m,z<y?R:B,y))):(p==0&&(u=p=1),m=B.slice()),y=m.length,y<j&&m.unshift(0),n(b,m,j),u==-1&&(j=b.length,u=t(B,b,z,j),u<1&&(p++,n(b,z<j?R:B,j))),j=b.length):u===0&&(p++,b=[0]),w[f++]=p,u&&b[0]?b[j++]=U[O]||0:(b=[U[O]],j=1);while((O++<_||b[0]!==void 0)&&E--)}return w[0]||w.shift(),v.e=d,Qt(v,o?a+$n(v)+1:a)}})();function lU(e,t){var n,r,i,a,o,u,d=0,f=0,p=e.constructor,m=p.precision;if($n(e)>16)throw Error(jC+$n(e));if(!e.s)return new p(fi);for(un=!1,u=m,o=new p(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(Cl(2,f))/Math.LN10*2+5|0,u+=r,n=i=a=new p(fi),p.precision=u;;){if(i=Qt(i.times(e),u),n=n.times(++d),o=a.plus(Ns(i,n,u)),Da(o.d).slice(0,u)===Da(a.d).slice(0,u)){for(;f--;)a=Qt(a.times(a),u);return p.precision=m,t==null?(un=!0,Qt(a,m)):a}a=o}}function $n(e){for(var t=e.e*an,n=e.d[0];n>=10;n/=10)t++;return t}function ej(e,t,n){if(t>e.LN10.sd())throw un=!0,n&&(e.precision=n),Error(Ki+"LN10 precision limit exceeded");return Qt(new e(e.LN10),t)}function xo(e){for(var t="";e--;)t+="0";return t}function _h(e,t){var n,r,i,a,o,u,d,f,p,m=1,y=10,v=e,w=v.d,b=v.constructor,j=b.precision;if(v.s<1)throw Error(Ki+(v.s?"NaN":"-Infinity"));if(v.eq(fi))return new b(0);if(t==null?(un=!1,f=j):f=t,v.eq(10))return t==null&&(un=!0),ej(b,f);if(f+=y,b.precision=f,n=Da(w),r=n.charAt(0),a=$n(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=Da(v.d),r=n.charAt(0),m++;a=$n(v),r>1?(v=new b("0."+n),a++):v=new b(r+"."+n.slice(1))}else return d=ej(b,f+2,j).times(a+""),v=_h(new b(r+"."+n.slice(1)),f-y).plus(d),b.precision=j,t==null?(un=!0,Qt(v,j)):v;for(u=o=v=Ns(v.minus(fi),v.plus(fi),f),p=Qt(v.times(v),f),i=3;;){if(o=Qt(o.times(p),f),d=u.plus(Ns(o,new b(i),f)),Da(d.d).slice(0,f)===Da(u.d).slice(0,f))return u=u.times(2),a!==0&&(u=u.plus(ej(b,f+2,j).times(a+""))),u=Ns(u,new b(m),f),b.precision=j,t==null?(un=!0,Qt(u,j)):u;u=d,i+=2}}function lM(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=wd(n/an),e.d=[],r=(n+1)%an,n<0&&(r+=an),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=an;r<i;)e.d.push(+t.slice(r,r+=an));t=t.slice(r),r=an-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),un&&(e.e>Iy||e.e<-Iy))throw Error(jC+n)}else e.s=0,e.e=0,e.d=[0];return e}function Qt(e,t,n){var r,i,a,o,u,d,f,p,m=e.d;for(o=1,a=m[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=an,i=t,f=m[p=0];else{if(p=Math.ceil((r+1)/an),a=m.length,p>=a)return e;for(f=a=m[p],o=1;a>=10;a/=10)o++;r%=an,i=r-an+o}if(n!==void 0&&(a=Cl(10,o-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/Cl(10,o-i):0:m[p-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return d?(a=$n(e),m.length=1,t=t-a-1,m[0]=Cl(10,(an-t%an)%an),e.e=wd(-t/an)||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=Cl(10,an-r),m[p]=i>0?(f/Cl(10,o-i)%Cl(10,i)|0)*a:0),d)for(;;)if(p==0){(m[0]+=a)==Yn&&(m[0]=1,++e.e);break}else{if(m[p]+=a,m[p]!=Yn)break;m[p--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(un&&(e.e>Iy||e.e<-Iy))throw Error(jC+$n(e));return e}function cU(e,t){var n,r,i,a,o,u,d,f,p,m,y=e.constructor,v=y.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new y(e),un?Qt(t,v):t;if(d=e.d,m=t.d,r=t.e,f=e.e,d=d.slice(),o=f-r,o){for(p=o<0,p?(n=d,o=-o,u=m.length):(n=m,r=f,u=d.length),i=Math.max(Math.ceil(v/an),u)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;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}o=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>o;){if(d[--i]<m[i]){for(a=i;a&&d[--a]===0;)d[a]=Yn-1;--d[a],d[i]+=Yn}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,un?Qt(t,v):t):new y(0)}function ic(e,t,n){var r,i=$n(e),a=Da(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+xo(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+xo(-i-1)+a,n&&(r=n-o)>0&&(a+=xo(r))):i>=o?(a+=xo(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+xo(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=xo(r))),e.s<0?"-"+a:a}function cM(e,t){if(e.length>t)return e.length=t,!0}function uU(e){var t,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(ql+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return lM(o,a.toString())}else if(typeof a!="string")throw Error(ql+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,pve.test(a))lM(o,a);else throw Error(ql+a)}if(i.prototype=De,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=uU,i.config=i.set=mve,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 mve(e){if(!e||typeof e!="object")throw Error(Ki+"Object expected");var t,n,r,i=["precision",1,bd,"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(wd(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(ql+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(ql+n+": "+r);return this}var NC=uU(hve);fi=new NC(1);const kt=NC;function dU(e){var t;return e===0?t=1:t=Math.floor(new kt(e).abs().log(10).toNumber())+1,t}function fU(e,t,n){for(var r=new kt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var hU=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},kC=(e,t,n)=>{if(e.lte(0))return new kt(0);var r=dU(e.toNumber()),i=new kt(10).pow(r),a=e.div(i),o=r!==1?.05:.1,u=new kt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),d=u.mul(i);return t?new kt(d.toNumber()):new kt(Math.ceil(d.toNumber()))},pU=(e,t,n)=>{var r;if(e.lte(0))return new kt(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new kt(a).abs().log(10).toNumber()),u=new kt(10).pow(o),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 kt(10).pow(p))}var m=(r=i[f])!==null&&r!==void 0?r:1,y=new kt(m).mul(u);return t?y:new kt(Math.ceil(y.toNumber()))},gve=(e,t,n)=>{var r=new kt(1),i=new kt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new kt(10).pow(dU(e)-1),i=new kt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new kt(Math.floor(e)))}else e===0?i=new kt(Math.floor((t-1)/2)):n||(i=new kt(Math.floor(e)));for(var o=Math.floor((t-1)/2),u=[],d=0;d<t;d++)u.push(i.add(new kt(d-o).mul(r)).toNumber());return u},mU=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:kC;if(!Number.isFinite((n-t)/(r-1)))return{step:new kt(0),tickMin:new kt(0),tickMax:new kt(0)};var u=o(new kt(n).sub(t).div(r-1),i,a),d;t<=0&&n>=0?d=new kt(0):(d=new kt(t).add(n).div(2),d=d.sub(new kt(d).mod(u)));var f=Math.ceil(d.sub(t).div(u).toNumber()),p=Math.ceil(new kt(n).sub(d).div(u).toNumber()),m=f+p+1;return m>r?mU(t,n,r,i,a+1,o):(m<r&&(p=n>0?p+(r-m):p,f=n>0?f:f+(r-m)),{step:u,tickMin:d.sub(new kt(f).mul(u)),tickMax:d.add(new kt(p).mul(u))})},uM=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,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",u=Math.max(i,2),[d,f]=hU([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 gve(d,i,a);var m=o==="snap125"?pU:kC,{step:y,tickMin:v,tickMax:w}=mU(d,f,u,a,0,m),b=fU(v,w.add(new kt(.1).mul(y)),y);return n>r?b.reverse():b},dM=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[u,d]=hU([r,i]);if(u===-1/0||d===1/0)return[r,i];if(u===d)return[u];var f=o==="snap125"?pU:kC,p=Math.max(n,2),m=f(new kt(d).sub(u).div(p-1),a,0),y=[...fU(new kt(u),new kt(d),m),d];return a===!1&&(y=y.map(v=>Math.round(v))),r>i?y.reverse():y},gU=e=>e.rootProps.maxBarSize,yve=e=>e.rootProps.barGap,yU=e=>e.rootProps.barCategoryGap,vve=e=>e.rootProps.barSize,b0=e=>e.rootProps.stackOffset,vU=e=>e.rootProps.reverseStackOrder,CC=e=>e.options.chartName,AC=e=>e.rootProps.syncId,xU=e=>e.rootProps.syncMethod,OC=e=>e.options.eventEmitter,xve=e=>e.rootProps.baseValue,Zn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},vl={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"},w0=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function S0(e,t,n){if(n!=="auto")return n;if(e!=null)return Ka(e,t)?"category":"number"}function fM(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 Ly(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fM(Object(n),!0).forEach(function(r){bve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bve(e,t,n){return(t=wve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wve(e){var t=Sve(e,"string");return typeof t=="symbol"?t:t+""}function Sve(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 hM={allowDataOverflow:vl.allowDataOverflow,allowDecimals:vl.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:vl.angleAxisId,includeHidden:!1,name:void 0,reversed:vl.reversed,scale:vl.scale,tick:vl.tick,tickCount:void 0,ticks:void 0,type:vl.type,unit:void 0,niceTicks:"auto"},pM={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"},jve=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},EC=ae([jve,$6],(e,t)=>{var n;if(e!=null)return e;var r=(n=S0(t,"angleAxis",hM.type))!==null&&n!==void 0?n:"category";return Ly(Ly({},hM),{},{type:r})}),Nve=(e,t)=>e.polarAxis.radiusAxis[t],_C=ae([Nve,$6],(e,t)=>{var n;if(e!=null)return e;var r=(n=S0(t,"radiusAxis",pM.type))!==null&&n!==void 0?n:"category";return Ly(Ly({},pM),{},{type:r})}),j0=e=>e.polarOptions,zC=ae([Ps,Rs,Wn],Yye),bU=ae([j0,zC],(e,t)=>{if(e!=null)return da(e.innerRadius,t,0)}),wU=ae([j0,zC],(e,t)=>{if(e!=null)return da(e.outerRadius,t,t*.8)}),kve=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},SU=ae([j0],kve);ae([EC,SU],w0);var jU=ae([zC,bU,wU],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});ae([_C,jU],w0);var NU=ae([It,j0,bU,wU,Ps,Rs],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:u,startAngle:d,endAngle:f}=t;return{cx:da(o,i,i/2),cy:da(u,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:f,clockWise:!1}}}),Xn=(e,t)=>t,N0=(e,t,n)=>n;function k0(e){return e?.id}function kU(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=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=k0(u);f.forEach((m,y)=>{var v=a==null||i?y:String(zn(m,a,null)),w=zn(m,u.dataKey,0),b;o.has(v)?b=o.get(v):b={},Object.assign(b,{[p]:w}),o.set(v,b)})}}),Array.from(o.values())}function C0(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var A0=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function O0(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Cve(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 Jn=e=>{var t=It(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Sd=e=>e.tooltip.settings.axisId;function TC(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 o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var o=i[0],u=i[1];return o<=u?a>=o&&a<=u:a>=u&&a<=o},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,o)=>{var u=e(a);if(u!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var d=e.bandwidth();switch(o.position){case"middle":u+=d/2;break;case"end":u+=d;break}}return u}}}}}var Ave=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Ma(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];gt(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 Po(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ove(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function PC(e){let t,n,r;e.length!==2?(t=Po,n=(u,d)=>Po(e(u),d),r=(u,d)=>e(u)-d):(t=e===Po||e===Ove?e:Eve,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 o(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:o,right:a}}function Eve(){return 0}function CU(e){return e===null?NaN:+e}function*_ve(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const zve=PC(Po),rp=zve.right;PC(CU).center;class mM extends Map{constructor(t,n=Rve){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(gM(this,t))}has(t){return super.has(gM(this,t))}set(t,n){return super.set(Tve(this,t),n)}delete(t){return super.delete(Pve(this,t))}}function gM({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Tve({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Pve({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Rve(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Dve(e=Po){if(e===Po)return AU;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 AU(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Mve=Math.sqrt(50),Ive=Math.sqrt(10),Lve=Math.sqrt(2);function $y(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=Mve?10:a>=Ive?5:a>=Lve?2:1;let u,d,f;return i<0?(f=Math.pow(10,-i)/o,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)*o,u=Math.round(e/f),d=Math.round(t/f),u*f<e&&++u,d*f>t&&--d),d<u&&.5<=n&&n<2?$y(e,t,n*2):[u,d,f]}function Z1(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,o]=r?$y(t,e,n):$y(e,t,n);if(!(a>=i))return[];const u=a-i+1,d=new Array(u);if(r)if(o<0)for(let f=0;f<u;++f)d[f]=(a-f)/-o;else for(let f=0;f<u;++f)d[f]=(a-f)*o;else if(o<0)for(let f=0;f<u;++f)d[f]=(i+f)/-o;else for(let f=0;f<u;++f)d[f]=(i+f)*o;return d}function W1(e,t,n){return t=+t,e=+e,n=+n,$y(e,t,n)[2]}function X1(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?W1(t,e,n):W1(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function yM(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function vM(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function OU(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?AU: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),y=.5*Math.sqrt(p*m*(d-m)/d)*(f-d/2<0?-1:1),v=Math.max(n,Math.floor(t-f*m/d+y)),w=Math.min(r,Math.floor(t+(d-f)*m/d+y));OU(e,t,v,w,i)}const a=e[t];let o=n,u=r;for(Lf(e,n,t),i(e[r],a)>0&&Lf(e,n,r);o<u;){for(Lf(e,o,u),++o,--u;i(e[o],a)<0;)++o;for(;i(e[u],a)>0;)--u}i(e[n],a)===0?Lf(e,n,u):(++u,Lf(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function Lf(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function $ve(e,t,n){if(e=Float64Array.from(_ve(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return vM(e);if(t>=1)return yM(e);var r,i=(r-1)*t,a=Math.floor(i),o=yM(OU(e,a).subarray(0,a+1)),u=vM(e.subarray(a+1));return o+(u-o)*(i-a)}}function Bve(e,t,n=CU){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),o=+n(e[a],a,e),u=+n(e[a+1],a+1,e);return o+(u-o)*(i-a)}}function Uve(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 Yi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ds(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 J1=Symbol("implicit");function RC(){var e=new mM,t=[],n=[],r=J1;function i(a){let o=e.get(a);if(o===void 0){if(r!==J1)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new mM;for(const o of a)e.has(o)||e.set(o,t.push(o)-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 RC(t,n).unknown(r)},Yi.apply(i,arguments),i}function DC(){var e=RC().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,u=!1,d=0,f=0,p=.5;delete e.unknown;function m(){var y=t().length,v=i<r,w=v?i:r,b=v?r:i;a=(b-w)/Math.max(1,y-d+f*2),u&&(a=Math.floor(a)),w+=(b-w-a*(y-d))*p,o=a*(1-d),u&&(w=Math.round(w),o=Math.round(o));var j=Uve(y).map(function(k){return w+a*k});return n(v?j.reverse():j)}return e.domain=function(y){return arguments.length?(t(y),m()):t()},e.range=function(y){return arguments.length?([r,i]=y,r=+r,i=+i,m()):[r,i]},e.rangeRound=function(y){return[r,i]=y,r=+r,i=+i,u=!0,m()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(y){return arguments.length?(u=!!y,m()):u},e.padding=function(y){return arguments.length?(d=Math.min(1,f=+y),m()):d},e.paddingInner=function(y){return arguments.length?(d=Math.min(1,y),m()):d},e.paddingOuter=function(y){return arguments.length?(f=+y,m()):f},e.align=function(y){return arguments.length?(p=Math.max(0,Math.min(1,y)),m()):p},e.copy=function(){return DC(t(),[r,i]).round(u).paddingInner(d).paddingOuter(f).align(p)},Yi.apply(m(),arguments)}function EU(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return EU(t())},e}function qve(){return EU(DC.apply(null,arguments).paddingInner(1))}function MC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _U(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ip(){}var zh=.7,By=1/zh,$u="\\s*([+-]?\\d+)\\s*",Th="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ia="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Fve=/^#([0-9a-f]{3,8})$/,Hve=new RegExp(`^rgb\\(${$u},${$u},${$u}\\)$`),Kve=new RegExp(`^rgb\\(${Ia},${Ia},${Ia}\\)$`),Gve=new RegExp(`^rgba\\(${$u},${$u},${$u},${Th}\\)$`),Vve=new RegExp(`^rgba\\(${Ia},${Ia},${Ia},${Th}\\)$`),Qve=new RegExp(`^hsl\\(${Th},${Ia},${Ia}\\)$`),Yve=new RegExp(`^hsla\\(${Th},${Ia},${Ia},${Th}\\)$`),xM={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};MC(ip,Ph,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:bM,formatHex:bM,formatHex8:Zve,formatHsl:Wve,formatRgb:wM,toString:wM});function bM(){return this.rgb().formatHex()}function Zve(){return this.rgb().formatHex8()}function Wve(){return zU(this).formatHsl()}function wM(){return this.rgb().formatRgb()}function Ph(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Fve.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?SM(t):n===3?new Zr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?og(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?og(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=Hve.exec(e))?new Zr(t[1],t[2],t[3],1):(t=Kve.exec(e))?new Zr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Gve.exec(e))?og(t[1],t[2],t[3],t[4]):(t=Vve.exec(e))?og(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Qve.exec(e))?kM(t[1],t[2]/100,t[3]/100,1):(t=Yve.exec(e))?kM(t[1],t[2]/100,t[3]/100,t[4]):xM.hasOwnProperty(e)?SM(xM[e]):e==="transparent"?new Zr(NaN,NaN,NaN,0):null}function SM(e){return new Zr(e>>16&255,e>>8&255,e&255,1)}function og(e,t,n,r){return r<=0&&(e=t=n=NaN),new Zr(e,t,n,r)}function Xve(e){return e instanceof ip||(e=Ph(e)),e?(e=e.rgb(),new Zr(e.r,e.g,e.b,e.opacity)):new Zr}function eN(e,t,n,r){return arguments.length===1?Xve(e):new Zr(e,t,n,r??1)}function Zr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}MC(Zr,eN,_U(ip,{brighter(e){return e=e==null?By:Math.pow(By,e),new Zr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?zh:Math.pow(zh,e),new Zr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Zr(Fl(this.r),Fl(this.g),Fl(this.b),Uy(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:jM,formatHex:jM,formatHex8:Jve,formatRgb:NM,toString:NM}));function jM(){return`#${Rl(this.r)}${Rl(this.g)}${Rl(this.b)}`}function Jve(){return`#${Rl(this.r)}${Rl(this.g)}${Rl(this.b)}${Rl((isNaN(this.opacity)?1:this.opacity)*255)}`}function NM(){const e=Uy(this.opacity);return`${e===1?"rgb(":"rgba("}${Fl(this.r)}, ${Fl(this.g)}, ${Fl(this.b)}${e===1?")":`, ${e})`}`}function Uy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Rl(e){return e=Fl(e),(e<16?"0":"")+e.toString(16)}function kM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ca(e,t,n,r)}function zU(e){if(e instanceof ca)return new ca(e.h,e.s,e.l,e.opacity);if(e instanceof ip||(e=Ph(e)),!e)return new ca;if(e instanceof ca)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),o=NaN,u=a-i,d=(a+i)/2;return u?(t===a?o=(n-r)/u+(n<r)*6:n===a?o=(r-t)/u+2:o=(t-n)/u+4,u/=d<.5?a+i:2-a-i,o*=60):u=d>0&&d<1?0:o,new ca(o,u,d,e.opacity)}function e0e(e,t,n,r){return arguments.length===1?zU(e):new ca(e,t,n,r??1)}function ca(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}MC(ca,e0e,_U(ip,{brighter(e){return e=e==null?By:Math.pow(By,e),new ca(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?zh:Math.pow(zh,e),new ca(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 Zr(tj(e>=240?e-240:e+120,i,r),tj(e,i,r),tj(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ca(CM(this.h),lg(this.s),lg(this.l),Uy(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=Uy(this.opacity);return`${e===1?"hsl(":"hsla("}${CM(this.h)}, ${lg(this.s)*100}%, ${lg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function CM(e){return e=(e||0)%360,e<0?e+360:e}function lg(e){return Math.max(0,Math.min(1,e||0))}function tj(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 IC=e=>()=>e;function t0e(e,t){return function(n){return e+n*t}}function n0e(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 r0e(e){return(e=+e)==1?TU:function(t,n){return n-t?n0e(t,n,e):IC(isNaN(t)?n:t)}}function TU(e,t){var n=t-e;return n?t0e(e,n):IC(isNaN(e)?t:e)}const AM=(function e(t){var n=r0e(t);function r(i,a){var o=n((i=eN(i)).r,(a=eN(a)).r),u=n(i.g,a.g),d=n(i.b,a.b),f=TU(i.opacity,a.opacity);return function(p){return i.r=o(p),i.g=u(p),i.b=d(p),i.opacity=f(p),i+""}}return r.gamma=e,r})(1);function i0e(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 a0e(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function s0e(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=jd(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(u){for(o=0;o<r;++o)a[o]=i[o](u);return a}}function o0e(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function qy(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function l0e(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]=jd(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var tN=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,nj=new RegExp(tN.source,"g");function c0e(e){return function(){return e}}function u0e(e){return function(t){return e(t)+""}}function d0e(e,t){var n=tN.lastIndex=nj.lastIndex=0,r,i,a,o=-1,u=[],d=[];for(e=e+"",t=t+"";(r=tN.exec(e))&&(i=nj.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),u[o]?u[o]+=a:u[++o]=a),(r=r[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,d.push({i:o,x:qy(r,i)})),n=nj.lastIndex;return n<t.length&&(a=t.slice(n),u[o]?u[o]+=a:u[++o]=a),u.length<2?d[0]?u0e(d[0].x):c0e(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 jd(e,t){var n=typeof t,r;return t==null||n==="boolean"?IC(t):(n==="number"?qy:n==="string"?(r=Ph(t))?(t=r,AM):d0e:t instanceof Ph?AM:t instanceof Date?o0e:a0e(t)?i0e:Array.isArray(t)?s0e:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?l0e:qy)(e,t)}function LC(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function f0e(e,t){t===void 0&&(t=e,e=jd);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(o){var u=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[u](o-u)}}function h0e(e){return function(){return e}}function Fy(e){return+e}var OM=[0,1];function Tr(e){return e}function nN(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:h0e(isNaN(t)?NaN:.5)}function p0e(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function m0e(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=nN(i,r),a=n(o,a)):(r=nN(r,i),a=n(a,o)),function(u){return a(r(u))}}function g0e(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=nN(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(u){var d=rp(e,u,1,r)-1;return a[d](i[d](u))}}function ap(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function E0(){var e=OM,t=OM,n=jd,r,i,a,o=Tr,u,d,f;function p(){var y=Math.min(e.length,t.length);return o!==Tr&&(o=p0e(e[0],e[y-1])),u=y>2?g0e:m0e,d=f=null,m}function m(y){return y==null||isNaN(y=+y)?a:(d||(d=u(e.map(r),t,n)))(r(o(y)))}return m.invert=function(y){return o(i((f||(f=u(t,e.map(r),qy)))(y)))},m.domain=function(y){return arguments.length?(e=Array.from(y,Fy),p()):e.slice()},m.range=function(y){return arguments.length?(t=Array.from(y),p()):t.slice()},m.rangeRound=function(y){return t=Array.from(y),n=LC,p()},m.clamp=function(y){return arguments.length?(o=y?!0:Tr,p()):o!==Tr},m.interpolate=function(y){return arguments.length?(n=y,p()):n},m.unknown=function(y){return arguments.length?(a=y,m):a},function(y,v){return r=y,i=v,p()}}function $C(){return E0()(Tr,Tr)}function y0e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Hy(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 nd(e){return e=Hy(Math.abs(e)),e?e[1]:NaN}function v0e(e,t){return function(n,r){for(var i=n.length,a=[],o=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[o=(o+1)%e.length];return a.reverse().join(t)}}function x0e(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var b0e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Rh(e){if(!(t=b0e.exec(e)))throw new Error("invalid format: "+e);var t;return new BC({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]})}Rh.prototype=BC.prototype;function BC(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+""}BC.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 w0e(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 Ky;function S0e(e,t){var n=Hy(e,t);if(!n)return Ky=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Ky=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Hy(e,Math.max(0,t+a-1))[0]}function EM(e,t){var n=Hy(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 _M={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:y0e,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)=>EM(e*100,t),r:EM,s:S0e,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function zM(e){return e}var TM=Array.prototype.map,PM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function j0e(e){var t=e.grouping===void 0||e.thousands===void 0?zM:v0e(TM.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?zM:x0e(TM.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(m,y){m=Rh(m);var v=m.fill,w=m.align,b=m.sign,j=m.symbol,k=m.zero,E=m.width,C=m.comma,O=m.precision,_=m.trim,A=m.type;A==="n"?(C=!0,A="g"):_M[A]||(O===void 0&&(O=12),_=!0,A="g"),(k||v==="0"&&w==="=")&&(k=!0,v="0",w="=");var z=(y&&y.prefix!==void 0?y.prefix:"")+(j==="$"?n:j==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),R=(j==="$"?r:/[%p]/.test(A)?o:"")+(y&&y.suffix!==void 0?y.suffix:""),$=_M[A],F=/[defgprs%]/.test(A);O=O===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,O)):Math.max(0,Math.min(20,O));function U(B){var V=z,X=R,W,H,J;if(A==="c")X=$(B)+X,B="";else{B=+B;var ce=B<0||1/B<0;if(B=isNaN(B)?d:$(Math.abs(B),O),_&&(B=w0e(B)),ce&&+B==0&&b!=="+"&&(ce=!1),V=(ce?b==="("?b:u:b==="-"||b==="("?"":b)+V,X=(A==="s"&&!isNaN(B)&&Ky!==void 0?PM[8+Ky/3]:"")+X+(ce&&b==="("?")":""),F){for(W=-1,H=B.length;++W<H;)if(J=B.charCodeAt(W),48>J||J>57){X=(J===46?i+B.slice(W+1):B.slice(W))+X,B=B.slice(0,W);break}}}C&&!k&&(B=t(B,1/0));var xe=V.length+B.length+X.length,M=xe<E?new Array(E-xe+1).join(v):"";switch(C&&k&&(B=t(M+B,M.length?E-X.length:1/0),M=""),w){case"<":B=V+B+X+M;break;case"=":B=V+M+B+X;break;case"^":B=M.slice(0,xe=M.length>>1)+V+B+X+M.slice(xe);break;default:B=M+V+B+X;break}return a(B)}return U.toString=function(){return m+""},U}function p(m,y){var v=Math.max(-8,Math.min(8,Math.floor(nd(y)/3)))*3,w=Math.pow(10,-v),b=f((m=Rh(m),m.type="f",m),{suffix:PM[8+v/3]});return function(j){return b(w*j)}}return{format:f,formatPrefix:p}}var cg,UC,PU;N0e({thousands:",",grouping:[3],currency:["$",""]});function N0e(e){return cg=j0e(e),UC=cg.format,PU=cg.formatPrefix,cg}function k0e(e){return Math.max(0,-nd(Math.abs(e)))}function C0e(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(nd(t)/3)))*3-nd(Math.abs(e)))}function A0e(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,nd(t)-nd(e))+1}function RU(e,t,n,r){var i=X1(e,t,n),a;switch(r=Rh(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=C0e(i,o))&&(r.precision=a),PU(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=A0e(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=k0e(i))&&(r.precision=a-(r.type==="%")*2);break}}return UC(r)}function Vo(e){var t=e.domain;return e.ticks=function(n){var r=t();return Z1(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return RU(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,o=r[i],u=r[a],d,f,p=10;for(u<o&&(f=o,o=u,u=f,f=i,i=a,a=f);p-- >0;){if(f=W1(o,u,n),f===d)return r[i]=o,r[a]=u,t(r);if(f>0)o=Math.floor(o/f)*f,u=Math.ceil(u/f)*f;else if(f<0)o=Math.ceil(o*f)/f,u=Math.floor(u*f)/f;else break;d=f}return e},e}function DU(){var e=$C();return e.copy=function(){return ap(e,DU())},Yi.apply(e,arguments),Vo(e)}function MU(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,Fy),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return MU(e).unknown(t)},e=arguments.length?Array.from(e,Fy):[0,1],Vo(n)}function IU(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function RM(e){return Math.log(e)}function DM(e){return Math.exp(e)}function O0e(e){return-Math.log(-e)}function E0e(e){return-Math.exp(-e)}function _0e(e){return isFinite(e)?+("1e"+e):e<0?0:e}function z0e(e){return e===10?_0e:e===Math.E?Math.exp:t=>Math.pow(e,t)}function T0e(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 MM(e){return(t,n)=>-e(-t,n)}function qC(e){const t=e(RM,DM),n=t.domain;let r=10,i,a;function o(){return i=T0e(r),a=z0e(r),n()[0]<0?(i=MM(i),a=MM(a),e(O0e,E0e)):e(RM,DM),t}return t.base=function(u){return arguments.length?(r=+u,o()):r},t.domain=function(u){return arguments.length?(n(u),o()):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 y=i(f),v=i(p),w,b;const j=u==null?10:+u;let k=[];if(!(r%1)&&v-y<j){if(y=Math.floor(y),v=Math.ceil(v),f>0){for(;y<=v;++y)for(w=1;w<r;++w)if(b=y<0?w/a(-y):w*a(y),!(b<f)){if(b>p)break;k.push(b)}}else for(;y<=v;++y)for(w=r-1;w>=1;--w)if(b=y>0?w/a(-y):w*a(y),!(b<f)){if(b>p)break;k.push(b)}k.length*2<j&&(k=Z1(f,p,j))}else k=Z1(y,v,Math.min(v-y,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=Rh(d)).precision==null&&(d.trim=!0),d=UC(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(IU(n(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function LU(){const e=qC(E0()).domain([1,10]);return e.copy=()=>ap(e,LU()).base(e.base()),Yi.apply(e,arguments),e}function IM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function LM(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function FC(e){var t=1,n=e(IM(t),LM(t));return n.constant=function(r){return arguments.length?e(IM(t=+r),LM(t)):t},Vo(n)}function $U(){var e=FC(E0());return e.copy=function(){return ap(e,$U()).constant(e.constant())},Yi.apply(e,arguments)}function $M(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function P0e(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function R0e(e){return e<0?-e*e:e*e}function HC(e){var t=e(Tr,Tr),n=1;function r(){return n===1?e(Tr,Tr):n===.5?e(P0e,R0e):e($M(n),$M(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Vo(t)}function KC(){var e=HC(E0());return e.copy=function(){return ap(e,KC()).exponent(e.exponent())},Yi.apply(e,arguments),e}function D0e(){return KC.apply(null,arguments).exponent(.5)}function BM(e){return Math.sign(e)*e*e}function M0e(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function BU(){var e=$C(),t=[0,1],n=!1,r;function i(a){var o=M0e(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(BM(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,Fy)).map(BM)),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 BU(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Yi.apply(i,arguments),Vo(i)}function UU(){var e=[],t=[],n=[],r;function i(){var o=0,u=Math.max(1,t.length);for(n=new Array(u-1);++o<u;)n[o-1]=Bve(e,o/u);return a}function a(o){return o==null||isNaN(o=+o)?r:t[rp(n,o)]}return a.invertExtent=function(o){var u=t.indexOf(o);return u<0?[NaN,NaN]:[u>0?n[u-1]:e[0],u<n.length?n[u]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let u of o)u!=null&&!isNaN(u=+u)&&e.push(u);return e.sort(Po),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return UU().domain(e).range(t).unknown(r)},Yi.apply(a,arguments)}function qU(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(d){return d!=null&&d<=d?i[rp(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 o}return o.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,u()):[e,t]},o.range=function(d){return arguments.length?(n=(i=Array.from(d)).length-1,u()):i.slice()},o.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]]},o.unknown=function(d){return arguments.length&&(a=d),o},o.thresholds=function(){return r.slice()},o.copy=function(){return qU().domain([e,t]).range(i).unknown(a)},Yi.apply(Vo(o),arguments)}function FU(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[rp(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 o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return FU().domain(e).range(t).unknown(n)},Yi.apply(i,arguments)}const rj=new Date,ij=new Date;function Kn(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 o=i(a),u=i.ceil(a);return a-o<u-a?o:u},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,u)=>{const d=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a<o)||!(u>0))return d;let f;do d.push(f=new Date(+a)),t(a,u),e(a);while(f<a&&a<o);return d},i.filter=a=>Kn(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!a(o););else for(;--u>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(rj.setTime(+a),ij.setTime(+o),e(rj),e(ij),Math.floor(n(rj,ij))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Gy=Kn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Gy.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Kn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Gy);Gy.range;const ws=1e3,Ui=ws*60,Ss=Ui*60,Os=Ss*24,GC=Os*7,UM=Os*30,aj=Os*365,Dl=Kn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ws)},(e,t)=>(t-e)/ws,e=>e.getUTCSeconds());Dl.range;const VC=Kn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ws)},(e,t)=>{e.setTime(+e+t*Ui)},(e,t)=>(t-e)/Ui,e=>e.getMinutes());VC.range;const QC=Kn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ui)},(e,t)=>(t-e)/Ui,e=>e.getUTCMinutes());QC.range;const YC=Kn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ws-e.getMinutes()*Ui)},(e,t)=>{e.setTime(+e+t*Ss)},(e,t)=>(t-e)/Ss,e=>e.getHours());YC.range;const ZC=Kn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ss)},(e,t)=>(t-e)/Ss,e=>e.getUTCHours());ZC.range;const sp=Kn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ui)/Os,e=>e.getDate()-1);sp.range;const _0=Kn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Os,e=>e.getUTCDate()-1);_0.range;const HU=Kn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Os,e=>Math.floor(e/Os));HU.range;function xc(e){return Kn(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)/GC)}const z0=xc(0),Vy=xc(1),I0e=xc(2),L0e=xc(3),rd=xc(4),$0e=xc(5),B0e=xc(6);z0.range;Vy.range;I0e.range;L0e.range;rd.range;$0e.range;B0e.range;function bc(e){return Kn(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)/GC)}const T0=bc(0),Qy=bc(1),U0e=bc(2),q0e=bc(3),id=bc(4),F0e=bc(5),H0e=bc(6);T0.range;Qy.range;U0e.range;q0e.range;id.range;F0e.range;H0e.range;const WC=Kn(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());WC.range;const XC=Kn(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());XC.range;const Es=Kn(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());Es.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kn(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)});Es.range;const _s=Kn(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());_s.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Kn(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)});_s.range;function KU(e,t,n,r,i,a){const o=[[Dl,1,ws],[Dl,5,5*ws],[Dl,15,15*ws],[Dl,30,30*ws],[a,1,Ui],[a,5,5*Ui],[a,15,15*Ui],[a,30,30*Ui],[i,1,Ss],[i,3,3*Ss],[i,6,6*Ss],[i,12,12*Ss],[r,1,Os],[r,2,2*Os],[n,1,GC],[t,1,UM],[t,3,3*UM],[e,1,aj]];function u(f,p,m){const y=p<f;y&&([f,p]=[p,f]);const v=m&&typeof m.range=="function"?m:d(f,p,m),w=v?v.range(f,+p+1):[];return y?w.reverse():w}function d(f,p,m){const y=Math.abs(p-f)/m,v=PC(([,,j])=>j).right(o,y);if(v===o.length)return e.every(X1(f/aj,p/aj,m));if(v===0)return Gy.every(Math.max(X1(f,p,m),1));const[w,b]=o[y/o[v-1][2]<o[v][2]/y?v-1:v];return w.every(b)}return[u,d]}const[K0e,G0e]=KU(_s,XC,T0,HU,ZC,QC),[V0e,Q0e]=KU(Es,WC,z0,sp,YC,VC);function sj(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 oj(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 $f(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Y0e(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,u=e.months,d=e.shortMonths,f=Bf(i),p=Uf(i),m=Bf(a),y=Uf(a),v=Bf(o),w=Uf(o),b=Bf(u),j=Uf(u),k=Bf(d),E=Uf(d),C={a:J,A:ce,b:xe,B:M,c:null,d:VM,e:VM,f:vxe,g:Oxe,G:_xe,H:mxe,I:gxe,j:yxe,L:GU,m:xxe,M:bxe,p:I,q,Q:ZM,s:WM,S:wxe,u:Sxe,U:jxe,V:Nxe,w:kxe,W:Cxe,x:null,X:null,y:Axe,Y:Exe,Z:zxe,"%":YM},O={a:D,A:G,b:oe,B:ne,c:null,d:QM,e:QM,f:Dxe,g:Kxe,G:Vxe,H:Txe,I:Pxe,j:Rxe,L:QU,m:Mxe,M:Ixe,p:Ae,q:we,Q:ZM,s:WM,S:Lxe,u:$xe,U:Bxe,V:Uxe,w:qxe,W:Fxe,x:null,X:null,y:Hxe,Y:Gxe,Z:Qxe,"%":YM},_={a:F,A:U,b:B,B:V,c:X,d:KM,e:KM,f:dxe,g:HM,G:FM,H:GM,I:GM,j:oxe,L:uxe,m:sxe,M:lxe,p:$,q:axe,Q:hxe,s:pxe,S:cxe,u:exe,U:txe,V:nxe,w:J0e,W:rxe,x:W,X:H,y:HM,Y:FM,Z:ixe,"%":fxe};C.x=A(n,C),C.X=A(r,C),C.c=A(t,C),O.x=A(n,O),O.X=A(r,O),O.c=A(t,O);function A(ee,he){return function(_e){var Z=[],Fe=-1,Re=0,st=ee.length,Ke,Kt,Bt;for(_e instanceof Date||(_e=new Date(+_e));++Fe<st;)ee.charCodeAt(Fe)===37&&(Z.push(ee.slice(Re,Fe)),(Kt=qM[Ke=ee.charAt(++Fe)])!=null?Ke=ee.charAt(++Fe):Kt=Ke==="e"?" ":"0",(Bt=he[Ke])&&(Ke=Bt(_e,Kt)),Z.push(Ke),Re=Fe+1);return Z.push(ee.slice(Re,Fe)),Z.join("")}}function z(ee,he){return function(_e){var Z=$f(1900,void 0,1),Fe=R(Z,ee,_e+="",0),Re,st;if(Fe!=_e.length)return null;if("Q"in Z)return new Date(Z.Q);if("s"in Z)return new Date(Z.s*1e3+("L"in Z?Z.L:0));if(he&&!("Z"in Z)&&(Z.Z=0),"p"in Z&&(Z.H=Z.H%12+Z.p*12),Z.m===void 0&&(Z.m="q"in Z?Z.q:0),"V"in Z){if(Z.V<1||Z.V>53)return null;"w"in Z||(Z.w=1),"Z"in Z?(Re=oj($f(Z.y,0,1)),st=Re.getUTCDay(),Re=st>4||st===0?Qy.ceil(Re):Qy(Re),Re=_0.offset(Re,(Z.V-1)*7),Z.y=Re.getUTCFullYear(),Z.m=Re.getUTCMonth(),Z.d=Re.getUTCDate()+(Z.w+6)%7):(Re=sj($f(Z.y,0,1)),st=Re.getDay(),Re=st>4||st===0?Vy.ceil(Re):Vy(Re),Re=sp.offset(Re,(Z.V-1)*7),Z.y=Re.getFullYear(),Z.m=Re.getMonth(),Z.d=Re.getDate()+(Z.w+6)%7)}else("W"in Z||"U"in Z)&&("w"in Z||(Z.w="u"in Z?Z.u%7:"W"in Z?1:0),st="Z"in Z?oj($f(Z.y,0,1)).getUTCDay():sj($f(Z.y,0,1)).getDay(),Z.m=0,Z.d="W"in Z?(Z.w+6)%7+Z.W*7-(st+5)%7:Z.w+Z.U*7-(st+6)%7);return"Z"in Z?(Z.H+=Z.Z/100|0,Z.M+=Z.Z%100,oj(Z)):sj(Z)}}function R(ee,he,_e,Z){for(var Fe=0,Re=he.length,st=_e.length,Ke,Kt;Fe<Re;){if(Z>=st)return-1;if(Ke=he.charCodeAt(Fe++),Ke===37){if(Ke=he.charAt(Fe++),Kt=_[Ke in qM?he.charAt(Fe++):Ke],!Kt||(Z=Kt(ee,_e,Z))<0)return-1}else if(Ke!=_e.charCodeAt(Z++))return-1}return Z}function $(ee,he,_e){var Z=f.exec(he.slice(_e));return Z?(ee.p=p.get(Z[0].toLowerCase()),_e+Z[0].length):-1}function F(ee,he,_e){var Z=v.exec(he.slice(_e));return Z?(ee.w=w.get(Z[0].toLowerCase()),_e+Z[0].length):-1}function U(ee,he,_e){var Z=m.exec(he.slice(_e));return Z?(ee.w=y.get(Z[0].toLowerCase()),_e+Z[0].length):-1}function B(ee,he,_e){var Z=k.exec(he.slice(_e));return Z?(ee.m=E.get(Z[0].toLowerCase()),_e+Z[0].length):-1}function V(ee,he,_e){var Z=b.exec(he.slice(_e));return Z?(ee.m=j.get(Z[0].toLowerCase()),_e+Z[0].length):-1}function X(ee,he,_e){return R(ee,t,he,_e)}function W(ee,he,_e){return R(ee,n,he,_e)}function H(ee,he,_e){return R(ee,r,he,_e)}function J(ee){return o[ee.getDay()]}function ce(ee){return a[ee.getDay()]}function xe(ee){return d[ee.getMonth()]}function M(ee){return u[ee.getMonth()]}function I(ee){return i[+(ee.getHours()>=12)]}function q(ee){return 1+~~(ee.getMonth()/3)}function D(ee){return o[ee.getUTCDay()]}function G(ee){return a[ee.getUTCDay()]}function oe(ee){return d[ee.getUTCMonth()]}function ne(ee){return u[ee.getUTCMonth()]}function Ae(ee){return i[+(ee.getUTCHours()>=12)]}function we(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var he=A(ee+="",C);return he.toString=function(){return ee},he},parse:function(ee){var he=z(ee+="",!1);return he.toString=function(){return ee},he},utcFormat:function(ee){var he=A(ee+="",O);return he.toString=function(){return ee},he},utcParse:function(ee){var he=z(ee+="",!0);return he.toString=function(){return ee},he}}}var qM={"-":"",_:" ",0:"0"},er=/^\s*\d+/,Z0e=/^%/,W0e=/[\\^$*+?|[\]().{}]/g;function zt(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 X0e(e){return e.replace(W0e,"\\$&")}function Bf(e){return new RegExp("^(?:"+e.map(X0e).join("|")+")","i")}function Uf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function J0e(e,t,n){var r=er.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function exe(e,t,n){var r=er.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function txe(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function nxe(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function rxe(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function FM(e,t,n){var r=er.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function HM(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ixe(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 axe(e,t,n){var r=er.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function sxe(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function KM(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function oxe(e,t,n){var r=er.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function GM(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function lxe(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function cxe(e,t,n){var r=er.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function uxe(e,t,n){var r=er.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function dxe(e,t,n){var r=er.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function fxe(e,t,n){var r=Z0e.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function hxe(e,t,n){var r=er.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function pxe(e,t,n){var r=er.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function VM(e,t){return zt(e.getDate(),t,2)}function mxe(e,t){return zt(e.getHours(),t,2)}function gxe(e,t){return zt(e.getHours()%12||12,t,2)}function yxe(e,t){return zt(1+sp.count(Es(e),e),t,3)}function GU(e,t){return zt(e.getMilliseconds(),t,3)}function vxe(e,t){return GU(e,t)+"000"}function xxe(e,t){return zt(e.getMonth()+1,t,2)}function bxe(e,t){return zt(e.getMinutes(),t,2)}function wxe(e,t){return zt(e.getSeconds(),t,2)}function Sxe(e){var t=e.getDay();return t===0?7:t}function jxe(e,t){return zt(z0.count(Es(e)-1,e),t,2)}function VU(e){var t=e.getDay();return t>=4||t===0?rd(e):rd.ceil(e)}function Nxe(e,t){return e=VU(e),zt(rd.count(Es(e),e)+(Es(e).getDay()===4),t,2)}function kxe(e){return e.getDay()}function Cxe(e,t){return zt(Vy.count(Es(e)-1,e),t,2)}function Axe(e,t){return zt(e.getFullYear()%100,t,2)}function Oxe(e,t){return e=VU(e),zt(e.getFullYear()%100,t,2)}function Exe(e,t){return zt(e.getFullYear()%1e4,t,4)}function _xe(e,t){var n=e.getDay();return e=n>=4||n===0?rd(e):rd.ceil(e),zt(e.getFullYear()%1e4,t,4)}function zxe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+zt(t/60|0,"0",2)+zt(t%60,"0",2)}function QM(e,t){return zt(e.getUTCDate(),t,2)}function Txe(e,t){return zt(e.getUTCHours(),t,2)}function Pxe(e,t){return zt(e.getUTCHours()%12||12,t,2)}function Rxe(e,t){return zt(1+_0.count(_s(e),e),t,3)}function QU(e,t){return zt(e.getUTCMilliseconds(),t,3)}function Dxe(e,t){return QU(e,t)+"000"}function Mxe(e,t){return zt(e.getUTCMonth()+1,t,2)}function Ixe(e,t){return zt(e.getUTCMinutes(),t,2)}function Lxe(e,t){return zt(e.getUTCSeconds(),t,2)}function $xe(e){var t=e.getUTCDay();return t===0?7:t}function Bxe(e,t){return zt(T0.count(_s(e)-1,e),t,2)}function YU(e){var t=e.getUTCDay();return t>=4||t===0?id(e):id.ceil(e)}function Uxe(e,t){return e=YU(e),zt(id.count(_s(e),e)+(_s(e).getUTCDay()===4),t,2)}function qxe(e){return e.getUTCDay()}function Fxe(e,t){return zt(Qy.count(_s(e)-1,e),t,2)}function Hxe(e,t){return zt(e.getUTCFullYear()%100,t,2)}function Kxe(e,t){return e=YU(e),zt(e.getUTCFullYear()%100,t,2)}function Gxe(e,t){return zt(e.getUTCFullYear()%1e4,t,4)}function Vxe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?id(e):id.ceil(e),zt(e.getUTCFullYear()%1e4,t,4)}function Qxe(){return"+0000"}function YM(){return"%"}function ZM(e){return+e}function WM(e){return Math.floor(+e/1e3)}var fu,ZU,WU;Yxe({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 Yxe(e){return fu=Y0e(e),ZU=fu.format,fu.parse,WU=fu.utcFormat,fu.utcParse,fu}function Zxe(e){return new Date(e)}function Wxe(e){return e instanceof Date?+e:+new Date(+e)}function JC(e,t,n,r,i,a,o,u,d,f){var p=$C(),m=p.invert,y=p.domain,v=f(".%L"),w=f(":%S"),b=f("%I:%M"),j=f("%I %p"),k=f("%a %d"),E=f("%b %d"),C=f("%B"),O=f("%Y");function _(A){return(d(A)<A?v:u(A)<A?w:o(A)<A?b:a(A)<A?j:r(A)<A?i(A)<A?k:E:n(A)<A?C:O)(A)}return p.invert=function(A){return new Date(m(A))},p.domain=function(A){return arguments.length?y(Array.from(A,Wxe)):y().map(Zxe)},p.ticks=function(A){var z=y();return e(z[0],z[z.length-1],A??10)},p.tickFormat=function(A,z){return z==null?_:f(z)},p.nice=function(A){var z=y();return(!A||typeof A.range!="function")&&(A=t(z[0],z[z.length-1],A??10)),A?y(IU(z,A)):p},p.copy=function(){return ap(p,JC(e,t,n,r,i,a,o,u,d,f))},p}function Xxe(){return Yi.apply(JC(V0e,Q0e,Es,WC,z0,sp,YC,VC,Dl,ZU).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Jxe(){return Yi.apply(JC(K0e,G0e,_s,XC,T0,_0,ZC,QC,Dl,WU).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function P0(){var e=0,t=1,n,r,i,a,o=Tr,u=!1,d;function f(m){return m==null||isNaN(m=+m)?d:o(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?(o=m,f):o};function p(m){return function(y){var v,w;return arguments.length?([v,w]=y,o=m(v,w),f):[o(0),o(1)]}}return f.range=p(jd),f.rangeRound=p(LC),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 Qo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function XU(){var e=Vo(P0()(Tr));return e.copy=function(){return Qo(e,XU())},Ds.apply(e,arguments)}function JU(){var e=qC(P0()).domain([1,10]);return e.copy=function(){return Qo(e,JU()).base(e.base())},Ds.apply(e,arguments)}function eq(){var e=FC(P0());return e.copy=function(){return Qo(e,eq()).constant(e.constant())},Ds.apply(e,arguments)}function eA(){var e=HC(P0());return e.copy=function(){return Qo(e,eA()).exponent(e.exponent())},Ds.apply(e,arguments)}function ebe(){return eA.apply(null,arguments).exponent(.5)}function tq(){var e=[],t=Tr;function n(r){if(r!=null&&!isNaN(r=+r))return t((rp(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(Po),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)=>$ve(e,a/r))},n.copy=function(){return tq(t).domain(e)},Ds.apply(n,arguments)}function R0(){var e=0,t=.5,n=1,r=1,i,a,o,u,d,f=Tr,p,m=!1,y;function v(b){return isNaN(b=+b)?y:(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),o=p(n=+n),u=i===a?0:.5/(a-i),d=a===o?0:.5/(o-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 w(b){return function(j){var k,E,C;return arguments.length?([k,E,C]=j,f=f0e(b,[k,E,C]),v):[f(0),f(.5),f(1)]}}return v.range=w(jd),v.rangeRound=w(LC),v.unknown=function(b){return arguments.length?(y=b,v):y},function(b){return p=b,i=b(e),a=b(t),o=b(n),u=i===a?0:.5/(a-i),d=a===o?0:.5/(o-a),r=a<i?-1:1,v}}function nq(){var e=Vo(R0()(Tr));return e.copy=function(){return Qo(e,nq())},Ds.apply(e,arguments)}function rq(){var e=qC(R0()).domain([.1,1,10]);return e.copy=function(){return Qo(e,rq()).base(e.base())},Ds.apply(e,arguments)}function iq(){var e=FC(R0());return e.copy=function(){return Qo(e,iq()).constant(e.constant())},Ds.apply(e,arguments)}function tA(){var e=HC(R0());return e.copy=function(){return Qo(e,tA()).exponent(e.exponent())},Ds.apply(e,arguments)}function tbe(){return tA.apply(null,arguments).exponent(.5)}const aq=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:DC,scaleDiverging:nq,scaleDivergingLog:rq,scaleDivergingPow:tA,scaleDivergingSqrt:tbe,scaleDivergingSymlog:iq,scaleIdentity:MU,scaleImplicit:J1,scaleLinear:DU,scaleLog:LU,scaleOrdinal:RC,scalePoint:qve,scalePow:KC,scaleQuantile:UU,scaleQuantize:qU,scaleRadial:BU,scaleSequential:XU,scaleSequentialLog:JU,scaleSequentialPow:eA,scaleSequentialQuantile:tq,scaleSequentialSqrt:ebe,scaleSequentialSymlog:eq,scaleSqrt:D0e,scaleSymlog:$U,scaleThreshold:FU,scaleTime:Xxe,scaleUtc:Jxe,tickFormat:RU},Symbol.toStringTag,{value:"Module"}));function nbe(e){var t=aq;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(Zh(e));if(n in t&&typeof t[n]=="function")return t[n]()}function XM(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=nbe(e);if(r!=null)return r.domain(t).range(n),r}}function nA(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?XM(e.scale,n,r):XM(t,n,r)}function rbe(e){return"scale".concat(Zh(e))}function ibe(e){return rbe(e)in aq}var sq=(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 ibe(r)?r:"point"}};function abe(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 oq(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var o;return(o=e(a))!==null&&o!==void 0?o:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var o,u,d=abe(r,a);if(d<=0)return n[0];if(d>=n.length)return n[n.length-1];var f=(o=r[d-1])!==null&&o!==void 0?o: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 sbe(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):oq(e,void 0)}function JM(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 Yy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JM(Object(n),!0).forEach(function(r){obe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function obe(e,t,n){return(t=lbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lbe(e){var t=cbe(e,"string");return typeof t=="symbol"?t:t+""}function cbe(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 rN=[0,"auto"],qn={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"},lq=(e,t)=>e.cartesianAxis.xAxis[t],Ms=(e,t)=>{var n=lq(e,t);return n??qn},Fn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:rN,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:Jh},cq=(e,t)=>e.cartesianAxis.yAxis[t],Is=(e,t)=>{var n=cq(e,t);return n??Fn},ube={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:""},rA=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??ube},Lr=(e,t,n)=>{switch(t){case"xAxis":return Ms(e,n);case"yAxis":return Is(e,n);case"zAxis":return rA(e,n);case"angleAxis":return EC(e,n);case"radiusAxis":return _C(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},dbe=(e,t,n)=>{switch(t){case"xAxis":return Ms(e,n);case"yAxis":return Is(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},op=(e,t,n)=>{switch(t){case"xAxis":return Ms(e,n);case"yAxis":return Is(e,n);case"angleAxis":return EC(e,n);case"radiusAxis":return _C(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},uq=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function dq(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 D0=e=>e.graphicalItems.cartesianItems,fbe=ae([Xn,N0],dq),fq=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),Nd=ae([D0,Lr,fbe],fq,{memoizeOptions:{resultEqualityCheck:O0}}),hq=ae([Nd],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(C0)),pq=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),hbe=ae([Nd],pq),mq=e=>e.map(t=>t.data).filter(Boolean).flat(1),pbe=ae([Nd],e=>e.some(t=>!t.data)),gq=ae([Nd],mq,{memoizeOptions:{resultEqualityCheck:O0}}),yq=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},iA=ae([gq,x0],yq),mbe=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:zn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:zn(i,r)}))):e.map(r=>({value:r})),vq=(e,t,n,r,i,a)=>{var{chartData:o=[],dataStartIndex:u,dataEndIndex:d}=r,f=mbe(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=o.slice(u,d+1),m=p.map(y=>({value:zn(y,t.dataKey)})).filter(y=>y.value!=null);return[...m,...f]}return f},lp=ae([iA,Lr,Nd,x0,pbe,gq],vq);function Bu(e){if(Ba(e)||e instanceof Date){var t=Number(e);if(gt(t))return t}}function eI(e){if(Array.isArray(e)){var t=[Bu(e[0]),Bu(e[1])];return Ma(t)?t:void 0}var n=Bu(e);if(n!=null)return[n,n]}function Fa(e){return e.map(Bu).filter(Yr)}function gbe(e,t){var n=Bu(e),r=Bu(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var ybe=ae([lp],e=>e?.map(t=>t.value).sort(gbe));function xq(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function vbe(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!ua(t))r=t;else if(Array.isArray(t)){var i=Fa(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Fa(n.flatMap(a=>{var o=zn(e,a.dataKey),u,d;if(Array.isArray(o)?[u,d]=o:u=d=o,!(!gt(u)||!gt(d)))return[r-u,r+d]}))}var Gn=e=>{var t=Jn(e),n=Sd(e);return op(e,t,n)},ad=ae([Gn],e=>e?.dataKey),xbe=ae([hq,x0,Gn],kU),bq=(e,t,n,r)=>{var i={},a=t.reduce((o,u)=>{if(u.stackId==null)return o;var d=o[u.stackId];return d==null&&(d=[]),d.push(u),o[u.stackId]=d,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var[u,d]=o,f=r?[...d].reverse():d,p=f.map(k0);return[u,{stackedData:tme(e,p,n),graphicalItems:f}]}))},Zy=ae([xbe,hq,b0,vU],bq),wq=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=ame(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},bbe=ae([Lr],e=>e.allowDataOverflow),aA=e=>{var t;if(e==null||!("domain"in e))return rN;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Fa(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:rN},Sq=ae([Lr],aA),jq=ae([Sq,bbe],aU),wbe=ae([Zy,ya,Xn,jq],wq,{memoizeOptions:{resultEqualityCheck:A0}}),sA=e=>e.errorBars,Sbe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>xq(n,r)),Wy=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(),o=Math.min(...a),u=Math.max(...a);return[o,u]}},Nq=function(t,n,r,i,a){var o=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]:o,y=(p=i[f.id])===null||p===void 0?void 0:p.filter(v=>xq(a,v));m.forEach(v=>{var w,b=zn(v,(w=n.dataKey)!==null&&w!==void 0?w:f.dataKey),j=vbe(v,b,y);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=eI(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=eI(zn(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]))}),gt(u)&>(d))return[u,d]},jbe=ae([iA,Lr,hbe,sA,Xn,uve],Nq,{memoizeOptions:{resultEqualityCheck:A0}});function Nbe(e){var{value:t}=e;if(Ba(t)||t instanceof Date)return t}var kbe=(e,t,n)=>{var r=e.map(Nbe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&DB(r))?rU(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},kq=e=>e.referenceElements.dots,kd=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),Cbe=ae([kq,Xn,N0],kd),Cq=e=>e.referenceElements.areas,Abe=ae([Cq,Xn,N0],kd),Aq=e=>e.referenceElements.lines,Obe=ae([Aq,Xn,N0],kd),Oq=(e,t)=>{if(e!=null){var n=Fa(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Ebe=ae(Cbe,Xn,Oq),Eq=(e,t)=>{if(e!=null){var n=Fa(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)]}},_be=ae([Abe,Xn],Eq);function zbe(e){var t;if(e.x!=null)return Fa([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Fa(n)}function Tbe(e){var t;if(e.y!=null)return Fa([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Fa(n)}var _q=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?zbe(r):Tbe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Pbe=ae([Obe,Xn],_q),Rbe=ae(Ebe,Pbe,_be,(e,t,n)=>Wy(e,n,t)),zq=(e,t,n,r,i,a,o,u)=>{if(n!=null)return n;var d=o==="vertical"&&u==="xAxis"||o==="horizontal"&&u==="yAxis",f=d?Wy(r,a,i):Wy(a,i);return fve(t,f,e.allowDataOverflow)},Dbe=ae([Lr,Sq,jq,wbe,jbe,Rbe,It,Xn],zq,{memoizeOptions:{resultEqualityCheck:A0}}),Mbe=[0,1],Tq=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:u,type:d}=e,f=Ka(t,a);if(f&&u==null){var p;return rU(0,(p=n?.length)!==null&&p!==void 0?p:0)}return d==="category"?kbe(r,e,f):i==="expand"&&!f?Mbe:o}},oA=ae([Lr,It,iA,lp,b0,Xn,Dbe],Tq),Cd=ae([Lr,uq,CC],sq),Pq=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=aA(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Ma(e)){if(a)return uM(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return dM(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&Ma(e))return uM(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Ma(e))return dM(e,t.tickCount,t.allowDecimals,"adaptive")}}},lA=ae([oA,op,Cd],Pq),Rq=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&Ma(t)&&Array.isArray(n)&&n.length>0){var i,a,o=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(o,u),Math.max(d,f)]}return t},Ibe=ae([Lr,oA,lA,Xn],Rq),Lbe=ae(lp,Lr,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Fa(e.map(m=>m.value))).sort((m,y)=>m-y),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===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/o}}),Dq=ae(Lbe,It,yU,Wn,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!gt(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=da(n,e*a),u=e*a/2;return u-o-(u-o)/a*o}return 0}),$be=(e,t,n)=>{var r=Ms(e,t);return r==null||typeof r.padding!="string"?0:Dq(e,"xAxis",t,n,r.padding)},Bbe=(e,t,n)=>{var r=Is(e,t);return r==null||typeof r.padding!="string"?0:Dq(e,"yAxis",t,n,r.padding)},Ube=ae(Ms,$be,(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}}),qbe=ae(Is,Bbe,(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}}),Fbe=ae([Wn,Ube,f0,d0,(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]}),Hbe=ae([Wn,It,qbe,f0,d0,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),cp=(e,t,n,r)=>{var i;switch(t){case"xAxis":return Fbe(e,n,r);case"yAxis":return Hbe(e,n,r);case"zAxis":return(i=rA(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return SU(e);case"radiusAxis":return jU(e,n);default:return}},Mq=ae([Lr,cp],w0),Kbe=ae([Cd,Ibe],Ave),cA=ae([Lr,Cd,Kbe,Mq],nA),Iq=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=Ka(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(u=>u.value)}},uA=ae([It,lp,op,Xn],Iq),M0=ae([cA],TC);ae([cA],sbe);ae([cA,ybe],oq);ae([Nd,sA,Xn],Sbe);function Lq(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var I0=(e,t)=>t,L0=(e,t,n)=>n,Gbe=ae(c0,I0,L0,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(Lq)),Vbe=ae(u0,I0,L0,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(Lq)),$q=(e,t)=>({width:e.width,height:t.height}),Qbe=(e,t)=>{var n=typeof t.width=="number"?t.width:Jh;return{width:n,height:e.height}},Bq=ae(Wn,Ms,$q),Ybe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},Zbe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},Wbe=ae(Rs,Wn,Gbe,I0,L0,(e,t,n,r,i)=>{var a={},o;return n.forEach(u=>{var d=$q(t,u);o==null&&(o=Ybe(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[u.id]=o-Number(f)*d.height,o+=(f?-1:1)*d.height}),a}),Xbe=ae(Ps,Wn,Vbe,I0,L0,(e,t,n,r,i)=>{var a={},o;return n.forEach(u=>{var d=Qbe(t,u);o==null&&(o=Zbe(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[u.id]=o-Number(f)*d.width,o+=(f?-1:1)*d.width}),a}),Jbe=(e,t)=>{var n=Ms(e,t);if(n!=null)return Wbe(e,n.orientation,n.mirror)},ewe=ae([Wn,Ms,Jbe,(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}}}),twe=(e,t)=>{var n=Is(e,t);if(n!=null)return Xbe(e,n.orientation,n.mirror)},nwe=ae([Wn,Is,twe,(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}}}),Uq=ae(Wn,Is,(e,t)=>{var n=typeof t.width=="number"?t.width:Jh;return{width:n,height:e.height}}),tI=(e,t,n)=>{switch(t){case"xAxis":return Bq(e,n).width;case"yAxis":return Uq(e,n).height;default:return}},qq=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,u=Ka(e,r),d=t.map(p=>p.value),f=d.filter(p=>p!=null);if(o&&u&&a==="category"&&i&&DB(f))return d}},dA=ae([It,lp,Lr,Xn],qq),nI=ae([It,dbe,Cd,M0,dA,uA,cp,lA,Xn],(e,t,n,r,i,a,o,u,d)=>{if(t!=null){var f=Ka(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:o,realScaleType:n,scale:r}}}),rwe=(e,t,n,r,i,a,o,u,d)=>{if(!(t==null||r==null)){var f=Ka(e,d),{type:p,ticks:m,tickCount:y}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,w=p==="category"&&r.bandwidth?r.bandwidth()/v:0;w=d==="angleAxis"&&a!=null&&a.length>=2?Qr(a[0]-a[1])*2*w:w;var b=m||i;return b?b.map((j,k)=>{var E=o?o.indexOf(j):j,C=r.map(E);return gt(C)?{index:k,coordinate:C+w,value:j,offset:w}:null}).filter(Yr):f&&u?u.map((j,k)=>{var E=r.map(j);return gt(E)?{coordinate:E+w,value:j,index:k,offset:w}:null}).filter(Yr):r.ticks?r.ticks(y).map((j,k)=>{var E=r.map(j);return gt(E)?{coordinate:E+w,value:j,index:k,offset:w}:null}).filter(Yr):r.domain().map((j,k)=>{var E=r.map(j);return gt(E)?{coordinate:E+w,value:o?o[j]:j,index:k,offset:w}:null}).filter(Yr)}},Fq=ae([It,op,Cd,M0,lA,cp,dA,uA,Xn],rwe),iwe=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var u=Ka(e,o),{tickCount:d}=t,f=0;return f=o==="angleAxis"&&r?.length>=2?Qr(r[0]-r[1])*2*f:f,u&&a?a.map((p,m)=>{var y=n.map(p);return gt(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(Yr):n.ticks?n.ticks(d).map((p,m)=>{var y=n.map(p);return gt(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(Yr):n.domain().map((p,m)=>{var y=n.map(p);return gt(y)?{coordinate:y+f,value:i?i[p]:p,index:m,offset:f}:null}).filter(Yr)}},Lo=ae([It,op,M0,cp,dA,uA,Xn],iwe),$o=ae(Lr,M0,(e,t)=>{if(!(e==null||t==null))return Yy(Yy({},e),{},{scale:t})}),awe=ae([Lr,Cd,oA,Mq],nA),swe=ae([awe],TC);ae((e,t,n)=>rA(e,n),swe,(e,t)=>{if(!(e==null||t==null))return Yy(Yy({},e),{},{scale:t})});var owe=ae([It,c0,u0],(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}}),lwe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};ae([lwe],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var o=Math.abs(a.coordinate-t);o<r&&(r=o,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var Hq=e=>e.options.defaultTooltipEventType,Kq=e=>e.options.validateTooltipEventTypes;function Gq(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function up(e,t){var n=Hq(e),r=Kq(e);return Gq(t,n,r)}function cwe(e){return Ue(t=>up(t,e))}var Vq=(e,t)=>{var n,r=Number(t);if(!(ua(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},uwe=e=>e.tooltip.settings,So={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},dwe={itemInteraction:{click:So,hover:So},axisInteraction:{click:So,hover:So},keyboardInteraction:So,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}},Qq=jr({name:"tooltip",initialState:dwe,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:rn()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Bi(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:rn()},removeTooltipEntrySettings:{reducer(e,t){var n=Bi(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:rn()},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:fwe,replaceTooltipEntrySettings:hwe,removeTooltipEntrySettings:pwe,setTooltipSettingsState:mwe,setActiveMouseOverItemIndex:Yq,mouseLeaveItem:gwe,mouseLeaveChart:Zq,setActiveClickItemIndex:ywe,setMouseOverAxisIndex:Wq,setMouseClickAxisIndex:vwe,setSyncInteraction:Zf,setKeyboardInteraction:Xy}=Qq.actions,xwe=Qq.reducer;function rI(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 ug(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rI(Object(n),!0).forEach(function(r){bwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bwe(e,t,n){return(t=wwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wwe(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 jwe(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Nwe(e){return e.index!=null}var Xq=(e,t,n,r)=>{if(t==null)return So;var i=jwe(e,t,n);if(i==null)return So;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(Nwe(i)){if(a)return ug(ug({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return ug(ug({},So),{},{coordinate:i.coordinate})};function kwe(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 Cwe(e,t){var n=kwe(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),o=Math.max(r,i);return n>=a&&n<=o}function Awe(e,t,n){if(n==null||t==null)return!0;var r=zn(e,t);return r==null||!Ma(n)?!0:Cwe(r,n)}var oh=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!gt(a))return i;var o=0,u=1/0;t.length>0&&(u=t.length-1);var d=Math.max(o,Math.min(a,u)),f=t[d];return f==null||Awe(f,n,r)?String(d):null},Jq=(e,t,n,r,i,a,o)=>{if(a!=null){var u=o[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}}},e8=(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(o=>{var u;return((u=o.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},t8=e=>e.options.tooltipPayloadSearcher,Ad=e=>e.tooltip;function iI(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 aI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iI(Object(n),!0).forEach(function(r){Owe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Owe(e,t,n){return(t=Ewe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ewe(e){var t=_we(e,"string");return typeof t=="symbol"?t:t+""}function _we(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 zwe(e){if(typeof e=="string"||typeof e=="number")return e}function Twe(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Pwe(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function sI(e){if(typeof e=="string")return e}function Rwe(e){if(!(e==null||typeof e!="object")){var t="name"in e?zwe(e.name):void 0,n="unit"in e?Twe(e.unit):void 0,r="dataKey"in e?Pwe(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?sI(e.color):void 0,o="fill"in e?sI(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function Dwe(e,t){return e??t}var n8=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:u,computedData:d,dataStartIndex:f,dataEndIndex:p}=n,m=[];return e.reduce((y,v)=>{var w,{dataDefinedOnItem:b,settings:j}=v,k=Dwe(b,u),E=Array.isArray(k)?_6(k,f,p):k,C=(w=j?.dataKey)!==null&&w!==void 0?w:r,O=j?.nameKey,_;if(r&&Array.isArray(E)&&!Array.isArray(E[0])&&o==="axis"?_=MB(E,r,i):_=a(E,t,d,O),Array.isArray(_))_.forEach(z=>{var R,$,F=Rwe(z),U=F?.name,B=F?.dataKey,V=F?.payload,X=aI(aI({},j),{},{name:U,unit:F?.unit,color:(R=F?.color)!==null&&R!==void 0?R:j?.color,fill:($=F?.fill)!==null&&$!==void 0?$:j?.fill});y.push(XR({tooltipEntrySettings:X,dataKey:B,payload:V,value:zn(V,B),name:U==null?void 0:String(U)}))});else{var A;y.push(XR({tooltipEntrySettings:j,dataKey:C,payload:_,value:zn(_,C),name:(A=zn(_,O))!==null&&A!==void 0?A:j?.name}))}return y},m)}},fA=ae([Gn,uq,CC],sq),Mwe=ae([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Iwe=ae([Jn,Sd],dq),wc=ae([Mwe,Gn,Iwe],fq,{memoizeOptions:{resultEqualityCheck:O0}}),Lwe=ae([wc],e=>e.filter(C0)),r8=ae([wc],mq,{memoizeOptions:{resultEqualityCheck:O0}}),$we=ae([wc],e=>e.some(t=>!t.data)),ac=ae([r8,ya],yq),Bwe=ae([Lwe,ya,Gn],kU),hA=ae([ac,Gn,wc,ya,$we,r8],vq),i8=ae([Gn],aA),Uwe=ae([Gn],e=>e.allowDataOverflow),a8=ae([i8,Uwe],aU),qwe=ae([wc],e=>e.filter(C0)),Fwe=ae([Bwe,qwe,b0,vU],bq),Hwe=ae([Fwe,ya,Jn,a8],wq),Kwe=ae([wc],pq),Gwe=ae([ac,Gn,Kwe,sA,Jn,dve],Nq,{memoizeOptions:{resultEqualityCheck:A0}}),Vwe=ae([kq,Jn,Sd],kd),Qwe=ae([Vwe,Jn],Oq),Ywe=ae([Cq,Jn,Sd],kd),Zwe=ae([Ywe,Jn],Eq),Wwe=ae([Aq,Jn,Sd],kd),Xwe=ae([Wwe,Jn],_q),Jwe=ae([Qwe,Xwe,Zwe],Wy),eSe=ae([Gn,i8,a8,Hwe,Gwe,Jwe,It,Jn],zq),sd=ae([Gn,It,ac,hA,b0,Jn,eSe],Tq),tSe=ae([sd,Gn,fA],Pq),nSe=ae([Gn,sd,tSe,Jn],Rq),s8=e=>{var t=Jn(e),n=Sd(e),r=!1;return cp(e,t,n,r)},o8=ae([Gn,s8],w0),rSe=ae([Gn,fA,nSe,o8],nA),l8=ae([rSe],TC),iSe=ae([It,hA,Gn,Jn],qq),aSe=ae([It,hA,Gn,Jn],Iq),sSe=(e,t,n,r,i,a,o,u)=>{if(t){var{type:d}=t,f=Ka(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&&o?o.map((y,v)=>{var w=r.map(y);return gt(w)?{coordinate:w+m,value:y,index:v,offset:m}:null}).filter(Yr):r.domain().map((y,v)=>{var w=r.map(y);return gt(w)?{coordinate:w+m,value:a?a[y]:y,index:v,offset:m}:null}).filter(Yr)}}},Ls=ae([It,Gn,fA,l8,s8,iSe,aSe,Jn],sSe),pA=ae([Hq,Kq,uwe],(e,t,n)=>Gq(n.shared,e,t)),c8=e=>e.tooltip.settings.trigger,mA=e=>e.tooltip.settings.defaultIndex,dp=ae([Ad,pA,c8,mA],Xq),sc=ae([dp,ac,ad,sd],oh),u8=ae([Ls,sc],Vq),d8=ae([dp],e=>{if(e)return e.dataKey}),oSe=ae([dp],e=>{if(e)return e.graphicalItemId}),f8=ae([Ad,pA,c8,mA],e8),lSe=ae([Ps,Rs,It,Wn,Ls,mA,f8],Jq),cSe=ae([dp,lSe],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),uSe=ae([dp],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),dSe=ae([f8,sc,ya,ad,u8,t8,pA],n8),fSe=ae([dSe],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});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){hSe(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 hSe(e,t,n){return(t=pSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pSe(e){var t=mSe(e,"string");return typeof t=="symbol"?t:t+""}function mSe(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 gSe=()=>Ue(Gn),ySe=()=>{var e=gSe(),t=Ue(Ls),n=Ue(l8);return Ju(!e||!n?void 0:lI(lI({},e),{},{scale:n}),t)};function cI(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 hu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cI(Object(n),!0).forEach(function(r){vSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vSe(e,t,n){return(t=xSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xSe(e){var t=bSe(e,"string");return typeof t=="symbol"?t:t+""}function bSe(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 wSe=(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}},SSe=(e,t,n,r)=>{var i=t.find(f=>f&&f.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:o}=r;return hu(hu(hu({},r),cr(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var u=i.coordinate,{angle:d}=r;return hu(hu(hu({},r),cr(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 jSe(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 h8=(e,t,n,r,i)=>{var a,o=(a=t?.length)!==null&&a!==void 0?a:0;if(o<=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<o;u++){var d,f,p,m,y,v=u>0?(d=n[u-1])===null||d===void 0?void 0:d.coordinate:(f=n[o-1])===null||f===void 0?void 0:f.coordinate,w=(p=n[u])===null||p===void 0?void 0:p.coordinate,b=u>=o-1?(m=n[0])===null||m===void 0?void 0:m.coordinate:(y=n[u+1])===null||y===void 0?void 0:y.coordinate,j=void 0;if(!(v==null||w==null||b==null))if(Qr(w-v)!==Qr(b-w)){var k=[];if(Qr(b-w)===Qr(i[1]-i[0])){j=b;var E=w+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(w,(C+w)/2),k[1]=Math.max(w,(C+w)/2)}var O=[Math.min(w,(j+w)/2),Math.max(w,(j+w)/2)];if(e>O[0]&&e<=O[1]||e>=k[0]&&e<=k[1]){var _;return(_=n[u])===null||_===void 0?void 0:_.index}}else{var A=Math.min(v,b),z=Math.max(v,b);if(e>(A+w)/2&&e<=(z+w)/2){var R;return(R=n[u])===null||R===void 0?void 0:R.index}}}else if(t)for(var $=0;$<o;$++){var F=t[$];if(F!=null){var U=t[$+1],B=t[$-1];if($===0&&U!=null&&e<=(F.coordinate+U.coordinate)/2||$===o-1&&B!=null&&e>(F.coordinate+B.coordinate)/2||$>0&&$<o-1&&B!=null&&U!=null&&e>(F.coordinate+B.coordinate)/2&&e<=(F.coordinate+U.coordinate)/2)return F.index}}return-1},p8=()=>Ue(CC),gA=(e,t)=>t,m8=(e,t,n)=>n,yA=(e,t,n,r)=>r,NSe=ae(Ls,e=>Xv(e,t=>t.coordinate)),vA=ae([Ad,gA,m8,yA],Xq),xA=ae([vA,ac,ad,sd],oh),kSe=(e,t,n)=>{if(t!=null){var r=Ad(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},g8=ae([Ad,gA,m8,yA],e8),Jy=ae([Ps,Rs,It,Wn,Ls,yA,g8],Jq),CSe=ae([vA,Jy],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),y8=ae([Ls,xA],Vq),ASe=ae([g8,xA,ya,ad,y8,t8,gA],n8),OSe=ae([vA,xA],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),ESe=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&jSe(e,o)){var u=sme(e,t),d=h8(u,a,i,n,r),f=wSe(t,i,d,e);return{activeIndex:String(d),activeCoordinate:f}}},_Se=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var u=eve(e,n);if(u){var d=ome(u,t),f=h8(d,o,a,r,i),p=SSe(t,a,f,u);return{activeIndex:String(f),activeCoordinate:p}}}},zSe=(e,t,n,r,i,a,o,u)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?ESe(e,t,r,i,a,o,u):_Se(e,t,n,r,i,a,o)},TSe=ae(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}}),PSe=ae(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Zn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:Cve}});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){RSe(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 RSe(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=MSe(e,"string");return typeof t=="symbol"?t:t+""}function MSe(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 ISe={},LSe={zIndexMap:Object.values(Zn).reduce((e,t)=>dI(dI({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),ISe)},$Se=new Set(Object.values(Zn));function BSe(e){return $Se.has(e)}var v8=jr({name:"zIndex",initialState:LSe,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:rn()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!BSe(n)&&delete e.zIndexMap[n])},prepare:rn()},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:rn()},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:rn()}}}),{registerZIndexPortal:USe,unregisterZIndexPortal:lj,registerZIndexPortalElement:qSe,unregisterZIndexPortalElement:FSe}=v8.actions,HSe=v8.reducer;function Zi(e){var{zIndex:t,children:n}=e,r=Bme(),i=r&&t!==void 0&&t!==0,a=Nr(),o=x.useRef(void 0),u=x.useRef(new Set),d=sn(),f=Ue(m=>TSe(m,t,a));if(x.useLayoutEffect(()=>{if(!i){var m=u.current;m.forEach(v=>{d(lj({zIndex:v}))}),m.clear(),o.current=void 0;return}if(u.current.has(t)||(d(USe({zIndex:t})),u.current.add(t)),f){o.current=f;var y=u.current;y.forEach(v=>{v!==t&&(d(lj({zIndex:v})),y.delete(v))})}},[d,t,i,f]),x.useLayoutEffect(()=>{var m=u.current;return()=>{m.forEach(y=>{d(lj({zIndex:y}))}),m.clear()}},[d]),!i)return n;var p=f??o.current;return p?uc.createPortal(n,p):null}function iN(){return iN=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},iN.apply(null,arguments)}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 dg(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){KSe(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 KSe(e,t,n){return(t=GSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GSe(e){var t=VSe(e,"string");return typeof t=="symbol"?t:t+""}function VSe(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){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function YSe(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:o,layout:u,cursor:d,tooltipEventType:f,chartName:p}=e,m=n,y=r,v=i;if(!d||!m||p!=="ScatterChart"&&f!=="axis")return null;var w,b,j;if(p==="ScatterChart")w=m,b=pye,j=Zn.cursorLine;else if(p==="BarChart")w=mye(u,m,a,o),b=J6,j=Zn.cursorRectangle;else if(u==="radial"&&LB(m)){var{cx:k,cy:E,radius:C,startAngle:O,endAngle:_}=eU(m);w={cx:k,cy:E,startAngle:O,endAngle:_,innerRadius:C,outerRadius:C},b=nU,j=Zn.cursorLine}else w={points:ive(u,m,a)},b=sh,j=Zn.cursorLine;var A=typeof d=="object"&&"className"in d?d.className:void 0,z=dg(dg(dg(dg({stroke:"#ccc",pointerEvents:"none"},a),w),Yh(d)),{},{payload:y,payloadIndex:v,className:Rt("recharts-tooltip-cursor",A)});return x.createElement(Zi,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:j},x.createElement(QSe,{cursor:d,cursorComp:b,cursorProps:z}))}function ZSe(e){var t=ySe(),n=L6(),r=vc(),i=p8();return t==null||n==null||r==null||i==null?null:x.createElement(YSe,iN({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var x8=x.createContext(null),WSe=()=>x.useContext(x8),cj={exports:{}},hI;function XSe(){return hI||(hI=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,y){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new i(p,m||d,y),w=n?n+f:f;return d._events[w]?d._events[w].fn?d._events[w]=[d._events[w],v]:d._events[w].push(v):(d._events[w]=v,d._eventsCount++),d}function o(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 y=0,v=m.length,w=new Array(v);y<v;y++)w[y]=m[y].fn;return w},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,y,v,w){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,y),!0;case 5:return j.fn.call(j.context,p,m,y,v),!0;case 6:return j.fn.call(j.context,p,m,y,v,w),!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 O=j.length,_;for(C=0;C<O;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,y);break;default:if(!E)for(_=1,E=new Array(k-1);_<k;_++)E[_-1]=arguments[_];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,y){var v=n?n+f:f;if(!this._events[v])return this;if(!p)return o(this,v),this;var w=this._events[v];if(w.fn)w.fn===p&&(!y||w.once)&&(!m||w.context===m)&&o(this,v);else{for(var b=0,j=[],k=w.length;b<k;b++)(w[b].fn!==p||y&&!w[b].once||m&&w[b].context!==m)&&j.push(w[b]);j.length?this._events[v]=j.length===1?j[0]:j:o(this,v)}return this},u.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&o(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})(cj)),cj.exports}var JSe=XSe();const eje=ha(JSe);var Dh=new eje,aN="recharts.syncEvent.tooltip",pI="recharts.syncEvent.brush",b8=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!ua(n))return e[n]}},tje={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},w8=jr({name:"options",initialState:tje,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),nje=w8.reducer,{createEventEmitter:rje}=w8.actions;function ije(e){return e.tooltip.syncInteraction}var aje={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},S8=jr({name:"chartData",initialState:aje,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:mI,setDataStartEndIndexes:sje,setComputedData:Z_e}=S8.actions,oje=S8.reducer,lje=["x","y"];function gI(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?gI(Object(n),!0).forEach(function(r){cje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cje(e,t,n){return(t=uje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uje(e){var t=dje(e,"string");return typeof t=="symbol"?t:t+""}function dje(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 fje(e,t){if(e==null)return{};var n,r,i=hje(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 hje(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 pje(){var e=Ue(AC),t=Ue(OC),n=sn(),r=Ue(xU),i=Ue(Ls),a=vc(),o=h0(),u=Ue(d=>d.rootProps.className);x.useEffect(()=>{if(e==null)return yc;var d=(f,p,m)=>{if(t!==m&&e===f){if(p.payload.active===!1){n(Zf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var y;if(o&&p!==null&&p!==void 0&&(y=p.payload)!==null&&y!==void 0&&y.coordinate&&p.payload.sourceViewBox){var v=p.payload.coordinate,{x:w,y:b}=v,j=fje(v,lje),{x:k,y:E,width:C,height:O}=p.payload.sourceViewBox,_=pu(pu({},j),{},{x:o.x+(C?(w-k)/C:0)*o.width,y:o.y+(O?(b-E)/O:0)*o.height});n(pu(pu({},p),{},{payload:pu(pu({},p.payload),{},{coordinate:_})}))}else n(p);return}if(i!=null){var A;if(typeof r=="function"){var z={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},R=r(i,z);A=i[R]}else r==="value"&&(A=i.find(H=>String(H.value)===p.payload.label));var{coordinate:$}=p.payload;if($==null||o==null){n(Zf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(A==null){n(Zf({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,o.x+o.width),V=Math.min(U,o.y+o.height),X={x:a==="horizontal"?A.coordinate:B,y:a==="horizontal"?V:A.coordinate},W=Zf({active:p.payload.active,coordinate:X,dataKey:p.payload.dataKey,index:String(A.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(W)}}};return Dh.on(aN,d),()=>{Dh.off(aN,d)}},[u,n,t,e,r,i,a,o])}function mje(){var e=Ue(AC),t=Ue(OC),n=sn();x.useEffect(()=>{if(e==null)return yc;var r=(i,a,o)=>{t!==o&&e===i&&n(sje(a))};return Dh.on(pI,r),()=>{Dh.off(pI,r)}},[n,t,e])}function gje(){var e=sn();x.useEffect(()=>{e(rje())},[e]),pje(),mje()}function yje(e,t,n,r,i,a){var o=Ue(w=>kSe(w,e,t)),u=Ue(oSe),d=Ue(OC),f=Ue(AC),p=Ue(xU),m=Ue(ije),y=m?.sourceViewBox!=null,v=h0();x.useEffect(()=>{if(!y&&f!=null&&d!=null){var w=Zf({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:u});Dh.emit(aN,f,w,d)}},[y,n,o,u,i,r,d,f,p,a,v])}function yI(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 vI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yI(Object(n),!0).forEach(function(r){vje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vje(e,t,n){return(t=xje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xje(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 wje(e){return e.dataKey}function Sje(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(Fge,t)}var xI=[],jje={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 ev(e){var t,n,r=Sr(e,jje),{active:i,allowEscapeViewBox:a,animationDuration:o,animationEasing:u,content:d,filterNull:f,isAnimationActive:p,offset:m,payloadUniqBy:y,position:v,reverseDirection:w,useTranslate3d:b,wrapperStyle:j,cursor:k,shared:E,trigger:C,defaultIndex:O,portal:_,axisId:A}=r,z=sn(),R=typeof O=="number"?String(O):O;x.useEffect(()=>{z(mwe({shared:E,trigger:C,axisId:A,active:i,defaultIndex:R}))},[z,E,C,A,i,R]);var $=h0(),F=Q6(),U=cwe(E),{activeIndex:B,isActive:V}=(t=Ue(we=>OSe(we,U,C,R)))!==null&&t!==void 0?t:{},X=Ue(we=>ASe(we,U,C,R)),W=Ue(we=>y8(we,U,C,R)),H=Ue(we=>CSe(we,U,C,R)),J=X,ce=WSe(),xe=(n=i??V)!==null&&n!==void 0?n:!1,[M,I]=e6([J,xe]),q=U==="axis"?W:void 0;yje(U,C,H,q,B,xe);var D=_??ce;if(D==null||$==null||U==null)return null;var G=J??xI;xe||(G=xI),f&&G.length&&(G=YB(G.filter(we=>we.value!=null&&(we.hide!==!0||r.includeHidden)),y,wje));var oe=G.length>0,ne=vI(vI({},r),{},{payload:G,label:q,active:xe,activeIndex:B,coordinate:H,accessibilityLayer:F}),Ae=x.createElement(eye,{allowEscapeViewBox:a,animationDuration:o,animationEasing:u,isAnimationActive:p,active:xe,coordinate:H,hasPayload:oe,offset:m,position:v,reverseDirection:w,useTranslate3d:b,viewBox:$,wrapperStyle:j,lastBoundingBox:M,innerRef:I,hasPortalFromProps:!!_},Sje(d,ne));return x.createElement(x.Fragment,null,uc.createPortal(Ae,D),xe&&x.createElement(ZSe,{cursor:k,tooltipEventType:U,coordinate:H,payload:G,index:B}))}var j8=e=>null;j8.displayName="Cell";function Nje(e,t,n){return(t=kje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kje(e){var t=Cje(e,"string");return typeof t=="symbol"?t:t+""}function Cje(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 Aje{constructor(t){Nje(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 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 Oje(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){Eje(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 Eje(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=zje(e,"string");return typeof t=="symbol"?t:t+""}function zje(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 Tje={cacheSize:2e3,enableCache:!0},N8=Oje({},Tje),wI=new Aje(N8.cacheSize),Pje={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},SI="recharts_measurement_span";function Rje(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",o=t.letterSpacing||"",u=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(o,"|").concat(u)}var jI=(e,t)=>{try{var n=document.getElementById(SI);n||(n=document.createElement("span"),n.setAttribute("id",SI),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Pje,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},lh=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||np.isSsr)return{width:0,height:0};if(!N8.enableCache)return jI(t,n);var r=Rje(t,n),i=wI.get(r);if(i)return i;var a=jI(t,n);return wI.set(r,a),a},k8;function Dje(e,t,n){return(t=Mje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mje(e){var t=Ije(e,"string");return typeof t=="symbol"?t:t+""}function Ije(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 NI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,kI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Lje=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,$je=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Bje={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Uje=["cm","mm","pt","pc","in","Q","px"];function qje(e){return Uje.includes(e)}var Ou="NaN";function Fje(e,t){return e*Bje[t]}class sr{static parse(t){var n,[,r,i]=(n=$je.exec(t))!==null&&n!==void 0?n:[];return r==null?sr.NaN:new sr(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,ua(t)&&(this.unit=""),n!==""&&!Lje.test(n)&&(this.num=NaN,this.unit=""),qje(n)&&(this.num=Fje(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new sr(NaN,""):new sr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new sr(NaN,""):new sr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new sr(NaN,""):new sr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new sr(NaN,""):new sr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return ua(this.num)}}k8=sr;Dje(sr,"NaN",new k8(NaN,""));function C8(e){if(e==null||e.includes(Ou))return Ou;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=NI.exec(t))!==null&&n!==void 0?n:[],o=sr.parse(r??""),u=sr.parse(a??""),d=i==="*"?o.multiply(u):o.divide(u);if(d.isNaN())return Ou;t=t.replace(NI,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,p,m,y]=(f=kI.exec(t))!==null&&f!==void 0?f:[],v=sr.parse(p??""),w=sr.parse(y??""),b=m==="+"?v.add(w):v.subtract(w);if(b.isNaN())return Ou;t=t.replace(kI,b.toString())}return t}var CI=/\(([^()]*)\)/;function Hje(e){for(var t=e,n;(n=CI.exec(t))!=null;){var[,r]=n;t=t.replace(CI,C8(r))}return t}function Kje(e){var t=e.replace(/\s+/g,"");return t=Hje(t),t=C8(t),t}function Gje(e){try{return Kje(e)}catch{return Ou}}function uj(e){var t=Gje(e.slice(5,-1));return t===Ou?"":t}var Vje=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Qje=["dx","dy","angle","className","breakAll"];function sN(){return sN=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},sN.apply(null,arguments)}function AI(e,t){if(e==null)return{};var n,r,i=Yje(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 Yje(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 A8=/[ \f\n\r\t\v\u2028\u2029]+/,O8=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];mn(t)||(n?i=t.toString().split(""):i=t.toString().split(A8));var a=i.map(u=>({word:u,width:lh(u,r).width})),o=n?0:lh(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function E8(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function Zje(e){return mn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var _8=(e,t,n,r)=>e.reduce((i,a)=>{var{word:o,width:u}=a,d=i[i.length-1];if(d&&u!=null&&(t==null||r||d.width+u+n<Number(t)))d.words.push(o),d.width+=u+n;else{var f={words:[o],width:u};i.push(f)}return i},[]),z8=e=>e.reduce((t,n)=>t.width>n.width?t:n),Wje="…",OI=(e,t,n,r,i,a,o,u)=>{var d=e.slice(0,t),f=O8({breakAll:n,style:r,children:d+Wje});if(!f)return[!1,[]];var p=_8(f.wordsWithComputedWidth,a,o,u),m=p.length>i||z8(p).width>Number(a);return[m,p]},Xje=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:u,breakAll:d}=e,f=Te(a),p=String(o),m=_8(t,r,n,i);if(!f||i)return m;var y=m.length>a||z8(m).width>Number(r);if(!y)return m;for(var v=0,w=p.length-1,b=0,j;v<=w&&b<=p.length-1;){var k=Math.floor((v+w)/2),E=k-1,[C,O]=OI(p,E,d,u,a,r,n,i),[_]=OI(p,k,d,u,a,r,n,i);if(!C&&!_&&(v=k+1),C&&_&&(w=k-1),!C&&_){j=O;break}b++}return j||m},EI=e=>{var t=mn(e)?[]:e.toString().split(A8);return[{words:t,width:void 0}]},Jje=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!np.isSsr){var u,d,f=O8({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:p,spaceWidth:m}=f;u=p,d=m}else return EI(r);return Xje({breakAll:a,children:r,maxLines:o,style:i},u,d,t,!!n)}return EI(r)},T8="#808080",e1e={angle:0,breakAll:!1,capHeight:"0.71em",fill:T8,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},bA=x.forwardRef((e,t)=>{var n=Sr(e,e1e),{x:r,y:i,lineHeight:a,capHeight:o,fill:u,scaleToFit:d,textAnchor:f,verticalAnchor:p}=n,m=AI(n,Vje),y=x.useMemo(()=>Jje({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:w,angle:b,className:j,breakAll:k}=m,E=AI(m,Qje);if(!Ba(r)||!Ba(i)||y.length===0)return null;var C=Number(r)+(Te(v)?v:0),O=Number(i)+(Te(w)?w:0);if(!gt(C)||!gt(O))return null;var _;switch(p){case"start":_=uj("calc(".concat(o,")"));break;case"middle":_=uj("calc(".concat((y.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:_=uj("calc(".concat(y.length-1," * -").concat(a,")"));break}var A=[],z=y[0];if(d&&z!=null){var R=z.width,{width:$}=m;A.push("scale(".concat(Te($)&&Te(R)?$/R:1,")"))}return b&&A.push("rotate(".concat(b,", ").concat(C,", ").concat(O,")")),A.length&&(E.transform=A.join(" ")),x.createElement("text",sN({},Dr(E),{ref:t,x:C,y:O,className:Rt("recharts-text",j),textAnchor:f,fill:u.includes("url")?T8:u}),y.map((F,U)=>{var B=F.words.join(k?"":" ");return x.createElement("tspan",{x:C,dy:U===0?_:a,key:"".concat(B,"-").concat(U)},B)}))});bA.displayName="Text";function _I(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?_I(Object(n),!0).forEach(function(r){t1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_I(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function t1e(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=r1e(e,"string");return typeof t=="symbol"?t:t+""}function r1e(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 i1e=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:u,upperWidth:d,lowerWidth:f}=mC(t),p=a,m=a+(d-f)/2,y=(p+m)/2,v=(d+f)/2,w=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,O=C*r,_=C>0?"end":"start",A=C>0?"start":"end",z=i;if(n==="top"){var R={x:p+d/2,y:o-j,horizontalAnchor:"middle",verticalAnchor:k};return z&&(R.height=Math.max(o-z.y,0),R.width=d),R}if(n==="bottom"){var $={x:m+f/2,y:o+u+j,horizontalAnchor:"middle",verticalAnchor:E};return z&&($.height=Math.max(z.y+z.height-(o+u),0),$.width=f),$}if(n==="left"){var F={x:y-O,y:o+u/2,horizontalAnchor:_,verticalAnchor:"middle"};return z&&(F.width=Math.max(F.x-z.x,0),F.height=u),F}if(n==="right"){var U={x:y+v+O,y:o+u/2,horizontalAnchor:A,verticalAnchor:"middle"};return z&&(U.width=Math.max(z.x+z.width-U.x,0),U.height=u),U}var B=z?{width:v,height:u}:{};return n==="insideLeft"?Ea({x:y+O,y:o+u/2,horizontalAnchor:A,verticalAnchor:"middle"},B):n==="insideRight"?Ea({x:y+v-O,y:o+u/2,horizontalAnchor:_,verticalAnchor:"middle"},B):n==="insideTop"?Ea({x:p+d/2,y:o+j,horizontalAnchor:"middle",verticalAnchor:E},B):n==="insideBottom"?Ea({x:m+f/2,y:o+u-j,horizontalAnchor:"middle",verticalAnchor:k},B):n==="insideTopLeft"?Ea({x:p+O,y:o+j,horizontalAnchor:A,verticalAnchor:E},B):n==="insideTopRight"?Ea({x:p+d-O,y:o+j,horizontalAnchor:_,verticalAnchor:E},B):n==="insideBottomLeft"?Ea({x:m+O,y:o+u-j,horizontalAnchor:A,verticalAnchor:k},B):n==="insideBottomRight"?Ea({x:m+f-O,y:o+u-j,horizontalAnchor:_,verticalAnchor:k},B):n&&typeof n=="object"&&(Te(n.x)||ec(n.x))&&(Te(n.y)||ec(n.y))?Ea({x:a+da(n.x,v),y:o+da(n.y,u),horizontalAnchor:"end",verticalAnchor:"end"},B):Ea({x:w,y:o+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},B)},a1e=["labelRef"],s1e=["content"];function zI(e,t){if(e==null)return{};var n,r,i=o1e(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 o1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function TI(e,t){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 Wf(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){l1e(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 l1e(e,t,n){return(t=c1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c1e(e){var t=u1e(e,"string");return typeof t=="symbol"?t:t+""}function u1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vs(){return vs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vs.apply(null,arguments)}var P8=x.createContext(null),d1e=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:u}=e,d=x.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return x.createElement(P8.Provider,{value:d},u)},R8=()=>{var e=x.useContext(P8),t=h0();return e||(t?mC(t):void 0)},f1e=x.createContext(null),h1e=()=>{var e=x.useContext(f1e),t=Ue(NU);return e||t},p1e=e=>{var{value:t,formatter:n}=e,r=mn(e.children)?t:e.children;return typeof n=="function"?n(r):r},wA=e=>e!=null&&typeof e=="function",m1e=(e,t)=>{var n=Qr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},g1e=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:u,cy:d,innerRadius:f,outerRadius:p,startAngle:m,endAngle:y,clockWise:v}=i,w=(f+p)/2,b=m1e(m,y),j=b>=0?1:-1,k,E;switch(t){case"insideStart":k=m+j*a,E=v;break;case"insideEnd":k=y-j*a,E=!v;break;case"end":k=y+j*a,E=v;break;default:throw new Error("Unsupported position ".concat(t))}E=b<=0?E:!E;var C=cr(u,d,w,k),O=cr(u,d,w,k+(E?1:-1)*359),_="M".concat(C.x,",").concat(C.y,`
|
|
288
|
+
A`).concat(w,",").concat(w,",0,1,").concat(E?0:1,`,
|
|
289
|
+
`).concat(O.x,",").concat(O.y),A=mn(e.id)?Sh("recharts-radial-line-"):e.id;return x.createElement("text",vs({},r,{dominantBaseline:"central",className:Rt("recharts-radial-bar-label",o)}),x.createElement("defs",null,x.createElement("path",{id:A,d:_})),x.createElement("textPath",{xlinkHref:"#".concat(A)},n))},y1e=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:u,endAngle:d}=e,f=(u+d)/2;if(n==="outside"){var{x:p,y:m}=cr(r,i,o+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 y=(a+o)/2,{x:v,y:w}=cr(r,i,y,f);return{x:v,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Dg=e=>e!=null&&"cx"in e&&Te(e.cx),v1e={angle:0,offset:5,zIndex:Zn.label,position:"middle",textBreakAll:!1};function x1e(e){if(!Dg(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 bo(e){var t=Sr(e,v1e),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:u,className:d="",textBreakAll:f,labelRef:p}=t,m=h1e(),y=R8(),v=i==="center"?y:m??y,w,b,j;n==null?w=v:Dg(n)?w=n:w=mC(n);var k=x1e(w);if(!w||mn(a)&&mn(o)&&!x.isValidElement(u)&&typeof u!="function")return null;var E=Wf(Wf({},t),{},{viewBox:w});if(x.isValidElement(u)){var{labelRef:C}=E,O=zI(E,a1e);return x.cloneElement(u,O)}if(typeof u=="function"){var{content:_}=E,A=zI(E,s1e);if(b=x.createElement(u,A),x.isValidElement(b))return b}else b=p1e(t);var z=Dr(t);if(Dg(w)){if(i==="insideStart"||i==="insideEnd"||i==="end")return g1e(t,i,b,z,w);j=y1e(w,t.offset,t.position)}else{if(!k)return null;var R=i1e({viewBox:k,position:i,offset:t.offset,parentViewBox:Dg(r)?void 0:r});j=Wf(Wf({x:R.x,y:R.y,textAnchor:R.horizontalAnchor,verticalAnchor:R.verticalAnchor},R.width!==void 0?{width:R.width}:{}),R.height!==void 0?{height:R.height}:{})}return x.createElement(Zi,{zIndex:t.zIndex},x.createElement(bA,vs({ref:p,className:Rt("recharts-label",d)},z,j,{textAnchor:E8(z.textAnchor)?z.textAnchor:j.textAnchor,breakAll:f}),b))}bo.displayName="Label";var b1e=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(bo,vs({key:"label-implicit"},r)):Ba(e)?x.createElement(bo,vs({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===bo?x.cloneElement(e,Wf({key:"label-implicit"},r)):x.createElement(bo,vs({key:"label-implicit",content:e},r)):wA(e)?x.createElement(bo,vs({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(bo,vs({},e,{key:"label-implicit"},r)):null};function w1e(e){var{label:t,labelRef:n}=e,r=R8();return b1e(t,r,n)||null}var S1e=["valueAccessor"],j1e=["dataKey","clockWise","id","textBreakAll","zIndex"];function tv(){return tv=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},tv.apply(null,arguments)}function PI(e,t){if(e==null)return{};var n,r,i=N1e(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 N1e(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 k1e=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(Zje(t))return t},D8=x.createContext(void 0),M8=D8.Provider,I8=x.createContext(void 0);I8.Provider;function C1e(){return x.useContext(D8)}function A1e(){return x.useContext(I8)}function Mg(e){var{valueAccessor:t=k1e}=e,n=PI(e,S1e),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:u}=n,d=PI(n,j1e),f=C1e(),p=A1e(),m=f||p;return!m||!m.length?null:x.createElement(Zi,{zIndex:u??Zn.label},x.createElement(xr,{className:"recharts-label-list"},m.map((y,v)=>{var w,b=mn(r)?t(y,v):zn(y.payload,r),j=mn(a)?{}:{id:"".concat(a,"-").concat(v)};return x.createElement(bo,tv({key:"label-".concat(v)},Dr(y),d,j,{fill:(w=n.fill)!==null&&w!==void 0?w:y.fill,parentViewBox:y.parentViewBox,value:b,textBreakAll:o,viewBox:y.viewBox,index:v,zIndex:0}))})))}Mg.displayName="LabelList";function L8(e){var{label:t}=e;return t?t===!0?x.createElement(Mg,{key:"labelList-implicit"}):x.isValidElement(t)||wA(t)?x.createElement(Mg,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(Mg,tv({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function oN(){return oN=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},oN.apply(null,arguments)}var $8=e=>{var{cx:t,cy:n,r,className:i}=e,a=Rt("recharts-dot",i);return Te(t)&&Te(n)&&Te(r)?x.createElement("circle",oN({},Hi(e),iC(e),{className:a,cx:t,cy:n,r})):null},O1e={radiusAxis:{},angleAxis:{}},B8=jr({name:"polarAxis",initialState:O1e,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:W_e,removeRadiusAxis:X_e,addAngleAxis:J_e,removeAngleAxis:eze}=B8.actions,E1e=B8.reducer;function _1e(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var dj={exports:{}},Ht={};var RI;function z1e(){if(RI)return Ht;RI=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"),o=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"),y=Symbol.for("react.view_transition"),v=Symbol.for("react.client.reference");function w(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 y:return b;default:switch(b=b&&b.$$typeof,b){case o:case u:case m:case p:return b;case a:return b;default:return j}}case t:return j}}}return Ht.ContextConsumer=a,Ht.ContextProvider=o,Ht.Element=e,Ht.ForwardRef=u,Ht.Fragment=n,Ht.Lazy=m,Ht.Memo=p,Ht.Portal=t,Ht.Profiler=i,Ht.StrictMode=r,Ht.Suspense=d,Ht.SuspenseList=f,Ht.isContextConsumer=function(b){return w(b)===a},Ht.isContextProvider=function(b){return w(b)===o},Ht.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Ht.isForwardRef=function(b){return w(b)===u},Ht.isFragment=function(b){return w(b)===n},Ht.isLazy=function(b){return w(b)===m},Ht.isMemo=function(b){return w(b)===p},Ht.isPortal=function(b){return w(b)===t},Ht.isProfiler=function(b){return w(b)===i},Ht.isStrictMode=function(b){return w(b)===r},Ht.isSuspense=function(b){return w(b)===d},Ht.isSuspenseList=function(b){return w(b)===f},Ht.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===o||b.$$typeof===a||b.$$typeof===u||b.$$typeof===v||b.getModuleId!==void 0)},Ht.typeOf=w,Ht}var DI;function T1e(){return DI||(DI=1,dj.exports=z1e()),dj.exports}var P1e=T1e(),MI=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",II=null,fj=null,U8=e=>{if(e===II&&Array.isArray(fj))return fj;var t=[];return x.Children.forEach(e,n=>{mn(n)||(P1e.isFragment(n)?t=t.concat(U8(n.props.children)):t.push(n))}),fj=t,II=e,t};function R1e(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>MI(i)):r=[MI(t)],U8(e).forEach(i=>{var a=Wu(i,"type.displayName")||Wu(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var q8=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,hj={},LI;function D1e(){return LI||(LI=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})(hj)),hj}var pj,$I;function M1e(){return $I||($I=1,pj=D1e().isPlainObject),pj}var I1e=M1e();const L1e=ha(I1e);var BI,UI,qI,FI,HI;function KI(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 GI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KI(Object(n),!0).forEach(function(r){$1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $1e(e,t,n){return(t=B1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B1e(e){var t=U1e(e,"string");return typeof t=="symbol"?t:t+""}function U1e(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 nv(){return nv=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},nv.apply(null,arguments)}function qf(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var VI=(e,t,n,r,i)=>{var a=n-r,o;return o=jn(BI||(BI=qf(["M ",",",""])),e,t),o+=jn(UI||(UI=qf(["L ",",",""])),e+n,t),o+=jn(qI||(qI=qf(["L ",",",""])),e+n-a/2,t+i),o+=jn(FI||(FI=qf(["L ",",",""])),e+n-a/2-r,t+i),o+=jn(HI||(HI=qf(["L ",","," Z"])),e,t),o},q1e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},F1e=e=>{var t=Sr(e,q1e),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:u}=t,{animationEasing:d,animationDuration:f,animationBegin:p,isUpdateAnimationActive:m}=t,y=x.useRef(null),[v,w]=x.useState(-1),b=x.useRef(i),j=x.useRef(a),k=x.useRef(o),E=x.useRef(n),C=x.useRef(r),O=v0(e,"trapezoid-");if(x.useEffect(()=>{if(y.current&&y.current.getTotalLength)try{var X=y.current.getTotalLength();X&&w(X)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var _=Rt("recharts-trapezoid",u);if(!m)return x.createElement("g",null,x.createElement("path",nv({},Dr(t),{className:_,d:VI(n,r,i,a,o)})));var A=b.current,z=j.current,R=k.current,$=E.current,F=C.current,U="0px ".concat(v===-1?1:v,"px"),B="".concat(v,"px ").concat(v,"px"),V=Y6(["strokeDasharray"],f,d);return x.createElement(y0,{animationId:O,key:O,canBegin:v>0,duration:f,easing:d,isActive:m,begin:p},X=>{var W=pn(A,i,X),H=pn(z,a,X),J=pn(R,o,X),ce=pn($,n,X),xe=pn(F,r,X);y.current&&(b.current=W,j.current=H,k.current=J,E.current=ce,C.current=xe);var M=X>0?{transition:V,strokeDasharray:B}:{strokeDasharray:U};return x.createElement("path",nv({},Dr(t),{className:_,d:VI(ce,xe,W,H,J),ref:y,style:GI(GI({},M),t.style)}))})},H1e=["option","shapeType","activeClassName","inActiveClassName"];function K1e(e,t){if(e==null)return{};var n,r,i=G1e(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 G1e(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 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 rv(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){V1e(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 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)}function Z1e(e,t){return rv(rv({},t),e)}function W1e(e,t){return e==="symbols"}function YI(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return x.createElement(J6,n);case"trapezoid":return x.createElement(F1e,n);case"sector":return x.createElement(nU,n);case"symbols":if(W1e(t))return x.createElement(rC,n);break;case"curve":return x.createElement(sh,n);default:return null}}function X1e(e){return x.isValidElement(e)?e.props:e}function J1e(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=K1e(e,H1e),o;if(x.isValidElement(t))o=x.cloneElement(t,rv(rv({},a),X1e(t)));else if(typeof t=="function")o=t(a,a.index);else if(L1e(t)&&typeof t!="boolean"){var u=Z1e(t,a);o=x.createElement(YI,{shapeType:n,elementProps:u})}else{var d=a;o=x.createElement(YI,{shapeType:n,elementProps:d})}return a.isActive?x.createElement(xr,{className:r},o):x.createElement(xr,{className:i},o)}var F8=(e,t,n)=>{var r=sn();return(i,a)=>o=>{e?.(i,a,o),r(Yq({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},H8=e=>{var t=sn();return(n,r)=>i=>{e?.(n,r,i),t(gwe())}},K8=(e,t,n)=>{var r=sn();return(i,a)=>o=>{e?.(i,a,o),r(ywe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function G8(e){var{tooltipEntrySettings:t}=e,n=sn(),r=Nr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(fwe(t)):i.current!==t&&n(hwe({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(pwe(i.current)),i.current=null)},[n]),null}function V8(e){var{legendPayload:t}=e,n=sn(),r=Nr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(ege(t)):i.current!==t&&n(tge({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(nge(i.current)),i.current=null)},[n]),null}var mj,eNe=()=>{var[e]=x.useState(()=>Sh("uid-"));return e},tNe=(mj=dv.useId)!==null&&mj!==void 0?mj:eNe;function nNe(e,t){var n=tNe();return t||(e?"".concat(e,"-").concat(n):n)}var rNe=x.createContext(void 0),Q8=e=>{var{id:t,type:n,children:r}=e,i=nNe("recharts-".concat(n),t);return x.createElement(rNe.Provider,{value:i},r(i))},iNe={cartesianItems:[],polarItems:[]},Y8=jr({name:"graphicalItems",initialState:iNe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:rn()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Bi(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:rn()},removeCartesianGraphicalItem:{reducer(e,t){var n=Bi(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:rn()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:rn()},removePolarGraphicalItem:{reducer(e,t){var n=Bi(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:rn()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Bi(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:rn()}}}),{addCartesianGraphicalItem:aNe,replaceCartesianGraphicalItem:sNe,removeCartesianGraphicalItem:oNe,addPolarGraphicalItem:tze,removePolarGraphicalItem:nze,replacePolarGraphicalItem:rze}=Y8.actions,lNe=Y8.reducer,cNe=e=>{var t=sn(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(aNe(e)):n.current!==e&&t(sNe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(oNe(n.current)),n.current=null)},[t]),null},Z8=x.memo(cNe),uNe=["points"];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 gj(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){dNe(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 dNe(e,t,n){return(t=fNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fNe(e){var t=hNe(e,"string");return typeof t=="symbol"?t:t+""}function hNe(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 iv(){return iv=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},iv.apply(null,arguments)}function pNe(e,t){if(e==null)return{};var n,r,i=mNe(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 mNe(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 gNe(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=Rt(r,typeof t!="boolean"?t.className:""),a=n??{},{points:o}=a,u=pNe(a,uNe);return x.createElement($8,iv({},u,{className:i}))}function yNe(e,t){return e==null?!1:t?!0:e.length===1}function vNe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:u,clipPathId:d,zIndex:f=Zn.scatter}=e;if(!yNe(t,n))return null;var p=q8(n),m=Ude(n),y=t.map((w,b)=>{var j,k,E=gj(gj(gj({r:3},o),m),{},{index:b,cx:(j=w.x)!==null&&j!==void 0?j:void 0,cy:(k=w.y)!==null&&k!==void 0?k:void 0,dataKey:a,value:w.value,payload:w.payload,points:t});return x.createElement(gNe,{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(Zi,{zIndex:f},x.createElement(xr,iv({className:r},v),y))}function WI(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 XI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WI(Object(n),!0).forEach(function(r){xNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xNe(e,t,n){return(t=bNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bNe(e){var t=wNe(e,"string");return typeof t=="symbol"?t:t+""}function wNe(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 W8=0,SNe={xAxis:{},yAxis:{},zAxis:{}},X8=jr({name:"cartesianAxis",initialState:SNe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:rn()},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:rn()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:rn()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:rn()},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:rn()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:rn()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:rn()},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:rn()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:rn()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,o=i.widthHistory||[];if(o.length===3&&o[0]===o[2]&&r===o[1]&&r!==i.width&&Math.abs(r-((a=o[0])!==null&&a!==void 0?a:0))<=1)return;var u=[...o,r].slice(-3);e.yAxis[n]=XI(XI({},i),{},{width:r,widthHistory:u})}}}}),{addXAxis:jNe,replaceXAxis:NNe,removeXAxis:kNe,addYAxis:CNe,replaceYAxis:ANe,removeYAxis:ONe,addZAxis:ize,replaceZAxis:aze,removeZAxis:sze,updateYAxisWidth:ENe}=X8.actions,_Ne=X8.reducer,zNe=ae([Wn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),TNe=ae([zNe,Ps,Rs],(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)}}),SA=()=>Ue(TNe),PNe=()=>Ue(fSe);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 yj(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){RNe(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 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)}var INe=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=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=yj(yj(yj({},u),Yh(i)),iC(i)),f;return x.isValidElement(i)?f=x.cloneElement(i,d):typeof i=="function"?f=i(d):f=x.createElement($8,d),x.createElement(xr,{className:"recharts-active-dot",clipPath:o},f)};function eL(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=Zn.activeDot}=e,u=Ue(sc),d=PNe();if(t==null||d==null)return null;var f=t.find(p=>d.includes(p.payload));return mn(f)?null:x.createElement(Zi,{zIndex:o},x.createElement(INe,{point:f,childIndex:Number(u),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var tL=(e,t,n)=>{var r=n??e;if(!mn(r))return da(r,t,0)},LNe=(e,t,n)=>{var r={},i=e.filter(C0),a=e.filter(f=>f.stackId==null),o=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(o).map(f=>{var p,[m,y]=f,v=y.map(b=>b.dataKey),w=tL(t,n,(p=y[0])===null||p===void 0?void 0:p.barSize);return{stackId:m,dataKeys:v,barSize:w}}),d=a.map(f=>{var p=[f.dataKey].filter(y=>y!=null),m=tL(t,n,f.barSize);return{stackId:void 0,dataKeys:p,barSize:m}});return[...u,...d]};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 fg(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){$Ne(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 $Ne(e,t,n){return(t=BNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BNe(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)}function qNe(e,t,n,r,i){var a,o=r.length;if(!(o<1)){var u=da(e,n,0,!0),d,f=[];if(gt((a=r[0])===null||a===void 0?void 0:a.barSize)){var p=!1,m=n/o,y=r.reduce((E,C)=>E+(C.barSize||0),0);y+=(o-1)*u,y>=n&&(y-=(o-1)*u,u=0),y>=n&&m>0&&(p=!0,m*=.9,y=o*m);var v=(n-y)/2>>0,w={offset:v-u,size:0};d=r.reduce((E,C)=>{var O,_={stackId:C.stackId,dataKeys:C.dataKeys,position:{offset:w.offset+w.size+u,size:p?m:(O=C.barSize)!==null&&O!==void 0?O:0}},A=[...E,_];return w=_.position,A},f)}else{var b=da(t,n,0,!0);n-2*b-(o-1)*u<=0&&(u=0);var j=(n-2*b-(o-1)*u)/o;j>1&&(j>>=0);var k=gt(i)?Math.min(j,i):j;d=r.reduce((E,C,O)=>[...E,{stackId:C.stackId,dataKeys:C.dataKeys,position:{offset:b+(j+u)*O+(j-k)/2,size:k}}],f)}return d}}var FNe=(e,t,n,r,i,a,o)=>{var u=mn(o)?t:o,d=qNe(n,r,i!==a?i:a,e,u);return i!==a&&d!=null&&(d=d.map(f=>fg(fg({},f),{},{position:fg(fg({},f.position),{},{offset:f.position.offset-i/2})}))),d},HNe=(e,t)=>{var n=k0(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(o=>o.key===n)}}}},KNe=(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 GNe(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&>(e.zIndex)?e.zIndex:t}var VNe=e=>{var{chartData:t}=e,n=sn(),r=Nr();return x.useEffect(()=>r?()=>{}:(n(mI(t)),()=>{n(mI(void 0))}),[t,n,r]),null},rL={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},J8=jr({name:"brush",initialState:rL,reducers:{setBrushSettings(e,t){return t.payload==null?rL:t.payload}}}),{setBrushSettings:oze}=J8.actions,QNe=J8.reducer;function YNe(e){return(e%180+180)%180}var ZNe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=YNe(i),o=a*Math.PI/180,u=Math.atan(r/n),d=o>u&&o<Math.PI-u?r/Math.sin(o):n/Math.cos(o);return Math.abs(d)},WNe={dots:[],areas:[],lines:[]},eF=jr({name:"referenceElements",initialState:WNe,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:lze,removeDot:cze,addArea:uze,removeArea:dze,addLine:fze,removeLine:hze}=eF.actions,XNe=eF.reducer,JNe=x.createContext(void 0),eke=e=>{var{children:t}=e,[n]=x.useState("".concat(Sh("recharts"),"-clip")),r=SA();if(r==null)return null;var{x:i,y:a,width:o,height:u}=r;return x.createElement(JNe.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:i,y:a,height:u,width:o}))),t)};function tF(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 tke(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return ZNe(r,n)}function nke(e,t,n){var r=n==="width",{x:i,y:a,width:o,height:u}=e;return t===1?{start:r?i:a,end:r?i+o:a+u}:{start:r?i+o:a+u,end:r?i:a}}function Mh(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 rke(e,t){return tF(e,t+1)}function ike(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:u}=t,d=0,f=1,p=o,m=function(){var w=r?.[d];if(w===void 0)return{v:tF(r,f)};var b=d,j,k=()=>(j===void 0&&(j=n(w,b)),j),E=w.coordinate,C=d===0||Mh(e,E,k,p,u);C||(d=0,p=o,f+=1),C&&(p=E+e*(k()/2+i),d+=f)},y;f<=a.length;)if(y=m(),y)return y.v;return[]}function ake(e,t,n,r,i){var a=(r||[]).slice(),o=a.length;if(o===0)return[];for(var{start:u,end:d}=t,f=1;f<=o;f++){for(var p=(o-1)%f,m=u,y=!0,v=function(){var O=r[b];if(O==null)return 0;var _=b,A,z=()=>(A===void 0&&(A=n(O,_)),A),R=O.coordinate,$=b===p||Mh(e,R,z,m,d);if(!$)return y=!1,1;$&&(m=R+e*(z()/2+i))},w,b=p;b<o&&(w=v(),!(w!==0&&w===1));b+=f);if(y){for(var j=[],k=p;k<o;k+=f){var E=r[k];E!=null&&j.push(E)}return j}}return[]}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 fr(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){ske(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 ske(e,t,n){return(t=oke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oke(e){var t=lke(e,"string");return typeof t=="symbol"?t:t+""}function lke(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 cke(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:u}=t,{end:d}=t,f=function(y){var v=a[y];if(v==null)return 1;var w=v,b,j=()=>(b===void 0&&(b=n(v,y)),b);if(y===o-1){var k=e*(w.coordinate+e*j()/2-d);a[y]=w=fr(fr({},w),{},{tickCoord:k>0?w.coordinate-k*e:w.coordinate})}else a[y]=w=fr(fr({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var E=Mh(e,w.tickCoord,j,u,d);E&&(d=w.tickCoord-e*(j()/2+i),a[y]=fr(fr({},w),{},{isShow:!0}))}},p=o-1;p>=0;p--)f(p);return a}function uke(e,t,n,r,i,a){var o=(r||[]).slice(),u=o.length,{start:d,end:f}=t;if(a){var p=r[u-1];if(p!=null){var m=n(p,u-1),y=e*(p.coordinate+e*m/2-f);if(o[u-1]=p=fr(fr({},p),{},{tickCoord:y>0?p.coordinate-y*e:p.coordinate}),p.tickCoord!=null){var v=Mh(e,p.tickCoord,()=>m,d,f);v&&(f=p.tickCoord-e*(m/2+i),o[u-1]=fr(fr({},p),{},{isShow:!0}))}}}for(var w=a?u-1:u,b=function(E){var C=o[E];if(C==null)return 1;var O=C,_,A=()=>(_===void 0&&(_=n(C,E)),_);if(E===0){var z=e*(O.coordinate-e*A()/2-d);o[E]=O=fr(fr({},O),{},{tickCoord:z<0?O.coordinate-z*e:O.coordinate})}else o[E]=O=fr(fr({},O),{},{tickCoord:O.coordinate});if(O.tickCoord!=null){var R=Mh(e,O.tickCoord,A,d,f);R&&(d=O.tickCoord+e*(A()/2+i),o[E]=fr(fr({},O),{},{isShow:!0}))}},j=0;j<w;j++)b(j);return o}function jA(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:u,interval:d,tickFormatter:f,unit:p,angle:m}=e;if(!i||!i.length||!r)return[];if(Te(d)||np.isSsr){var y;return(y=rke(i,Te(d)?d:0))!==null&&y!==void 0?y:[]}var v=[],w=u==="top"||u==="bottom"?"width":"height",b=p&&w==="width"?lh(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=(_,A)=>{var z=typeof f=="function"?f(_.value,A):_.value;return w==="width"?tke(lh(z,{fontSize:t,letterSpacing:n}),b,m):lh(z,{fontSize:t,letterSpacing:n})[w]},k=i[0],E=i[1],C=i.length>=2&&k!=null&&E!=null?Qr(E.coordinate-k.coordinate):1,O=nke(a,C,w);return d==="equidistantPreserveStart"?ike(C,O,j,i,o):d==="equidistantPreserveEnd"?ake(C,O,j,i,o):(d==="preserveStart"||d==="preserveStartEnd"?v=uke(C,O,j,i,o,d==="preserveStartEnd"):v=cke(C,O,j,i,o),v.filter(_=>_.isShow))}var dke=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(p=>{if(p){var m=p.getBoundingClientRect();m.width>o&&(o=m.width)}});var u=n?n.getBoundingClientRect().width:0,d=i+a,f=o+d+u+(n?r:0);return Math.round(f)}return 0},fke={xAxis:{},yAxis:{}},nF=jr({name:"renderedTicks",initialState:fke,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:hke,removeRenderedTicks:pke}=nF.actions,mke=nF.reducer,gke=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function yke(e,t){if(e==null)return{};var n,r,i=vke(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 vke(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 oc(){return oc=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},oc.apply(null,arguments)}function aL(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 Sn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aL(Object(n),!0).forEach(function(r){xke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xke(e,t,n){return(t=bke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bke(e){var t=wke(e,"string");return typeof t=="symbol"?t:t+""}function wke(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 ks={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:Zn.axis};function Ske(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:u,otherSvgProps:d}=e;if(!u)return null;var f=Sn(Sn(Sn({},d),Hi(u)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!o||a==="bottom"&&o);f=Sn(Sn({},f),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var m=+(a==="left"&&!o||a==="right"&&o);f=Sn(Sn({},f),{},{x1:t+m*r,y1:n,x2:t+m*r,y2:n+i})}return x.createElement("line",oc({},f,{className:Rt("recharts-cartesian-axis-line",Wu(u,"className"))}))}function jke(e,t,n,r,i,a,o,u,d){var f,p,m,y,v,w,b=u?-1:1,j=e.tickSize||o,k=Te(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=p=e.coordinate,y=n+ +!u*i,m=y-b*j,w=m-b*d,v=k;break;case"left":m=y=e.coordinate,p=t+ +!u*r,f=p-b*j,v=f-b*d,w=k;break;case"right":m=y=e.coordinate,p=t+ +u*r,f=p+b*j,v=f+b*d,w=k;break;default:f=p=e.coordinate,y=n+ +u*i,m=y+b*j,w=m+b*d,v=k;break}return{line:{x1:f,y1:m,x2:p,y2:y},tick:{x:v,y:w}}}function Nke(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function kke(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function Cke(e){var{option:t,tickProps:n,value:r}=e,i,a=Rt(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))i=x.cloneElement(t,Sn(Sn({},n),{},{className:a}));else if(typeof t=="function")i=t(Sn(Sn({},n),{},{className:a}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=Rt(o,_1e(t))),i=x.createElement(bA,oc({},n,{className:o}),r)}return i}function Ake(e){var{ticks:t,axisType:n,axisId:r}=e,i=sn();return x.useEffect(()=>{if(r==null||n==null)return yc;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(hke({ticks:a,axisId:r,axisType:n})),()=>{i(pke({axisId:r,axisType:n}))}},[i,t,r,n]),null}var Oke=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:u,padding:d,tickTextProps:f,orientation:p,mirror:m,x:y,y:v,width:w,height:b,tickSize:j,tickMargin:k,fontSize:E,letterSpacing:C,getTicksConfig:O,events:_,axisType:A,axisId:z}=e,R=jA(Sn(Sn({},O),{},{ticks:n}),E,C),$=Hi(O),F=Yh(r),U=E8($.textAnchor)?$.textAnchor:Nke(p,m),B=kke(p,m),V={};typeof i=="object"&&(V=i);var X=Sn(Sn({},$),{},{fill:"none"},V),W=R.map(ce=>Sn({entry:ce},jke(ce,y,v,w,b,p,j,m,k))),H=W.map(ce=>{var{entry:xe,line:M}=ce;return x.createElement(xr,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(xe.value,"-").concat(xe.coordinate,"-").concat(xe.tickCoord)},i&&x.createElement("line",oc({},X,M,{className:Rt("recharts-cartesian-axis-tick-line",Wu(i,"className"))})))}),J=W.map((ce,xe)=>{var M,I,{entry:q,tick:D}=ce,G=Sn(Sn(Sn(Sn({verticalAnchor:B},$),{},{textAnchor:U,stroke:"none",fill:a},D),{},{index:xe,payload:q,visibleTicksCount:R.length,tickFormatter:o,padding:d},f),{},{angle:(M=(I=f?.angle)!==null&&I!==void 0?I:$.angle)!==null&&M!==void 0?M:0}),oe=Sn(Sn({},G),F);return x.createElement(xr,oc({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(q.value,"-").concat(q.coordinate,"-").concat(q.tickCoord)},Wv(_,q,xe)),r&&x.createElement(Cke,{option:r,tickProps:oe,value:"".concat(typeof o=="function"?o(q.value,xe):q.value).concat(u||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(A,"-ticks")},x.createElement(Ake,{ticks:R,axisId:z,axisType:A}),J.length>0&&x.createElement(Zi,{zIndex:Zn.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(A,"-tick-labels"),ref:t},J)),H.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(A,"-tick-lines")},H))}),Eke=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:u,axisType:d,axisId:f}=e,p=yke(e,gke),[m,y]=x.useState(""),[v,w]=x.useState(""),b=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return dke({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 O=window.getComputedStyle(C),_=O.fontSize,A=O.letterSpacing;(_!==m||A!==v)&&(y(_),w(A))}}},[m,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:x.createElement(Zi,{zIndex:e.zIndex},x.createElement(xr,{className:Rt("recharts-cartesian-axis",a)},x.createElement(Ske,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Hi(e)}),x.createElement(Oke,{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(d1e,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(w1e,{label:e.label,labelRef:e.labelRef}),e.children)))}),NA=x.forwardRef((e,t)=>{var n=Sr(e,ks);return x.createElement(Eke,oc({},n,{ref:t}))});NA.displayName="CartesianAxis";var _ke=["x1","y1","x2","y2","key"],zke=["offset"],Tke=["xAxisId","yAxisId"],Pke=["xAxisId","yAxisId"];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 gr(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){Rke(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 Rke(e,t,n){return(t=Dke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dke(e){var t=Mke(e,"string");return typeof t=="symbol"?t:t+""}function Mke(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 Ml(){return Ml=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},Ml.apply(null,arguments)}function av(e,t){if(e==null)return{};var n,r,i=Ike(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 Ike(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 Lke=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:u}=e;return x.createElement("rect",{x:r,y:i,ry:u,width:a,height:o,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function rF(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:o,x2:u,y2:d,key:f}=n,p=av(n,_ke),m=(i=Hi(p))!==null&&i!==void 0?i:{},{offset:y}=m,v=av(m,zke);r=x.createElement("line",Ml({},v,{x1:a,y1:o,x2:u,y2:d,fill:"none",key:f}))}return r}function $ke(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,u=av(e,Tke),d=i.map((f,p)=>{var m=gr(gr({},u),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(p),index:p});return x.createElement(rF,{key:"line-".concat(p),option:r,lineItemProps:m})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function Bke(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,u=av(e,Pke),d=i.map((f,p)=>{var m=gr(gr({},u),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(p),index:p});return x.createElement(rF,{option:r,lineItemProps:m,key:"line-".concat(p)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function Uke(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,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,y)=>m-y);i!==f[0]&&f.unshift(0);var p=f.map((m,y)=>{var v=f[y+1],w=v==null,b=w?i+o-m:v-m;if(b<=0)return null;var j=y%t.length;return x.createElement("rect",{key:"react-".concat(y),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 qke(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:u,verticalPoints:d}=e;if(!t||!n||!n.length)return null;var f=d.map(m=>Math.round(m+i-i)).sort((m,y)=>m-y);i!==f[0]&&f.unshift(0);var p=f.map((m,y)=>{var v=f[y+1],w=v==null,b=w?i+o-m:v-m;if(b<=0)return null;var j=y%n.length;return x.createElement("rect",{key:"react-".concat(y),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 Fke=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return z6(jA(gr(gr(gr({},ks),n),{},{ticks:T6(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},Hke=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return z6(jA(gr(gr(gr({},ks),n),{},{ticks:T6(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},Kke={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Zn.grid};function iF(e){var t=gC(),n=yC(),r=L6(),i=gr(gr({},Sr(e,Kke)),{},{x:Te(e.x)?e.x:r.left,y:Te(e.y)?e.y:r.top,width:Te(e.width)?e.width:r.width,height:Te(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:u,y:d,width:f,height:p,syncWithTicks:m,horizontalValues:y,verticalValues:v}=i,w=Nr(),b=Ue($=>nI($,"xAxis",a,w)),j=Ue($=>nI($,"yAxis",o,w));if(!Ua(f)||!Ua(p)||!Te(u)||!Te(d))return null;var k=i.verticalCoordinatesGenerator||Fke,E=i.horizontalCoordinatesGenerator||Hke,{horizontalPoints:C,verticalPoints:O}=i;if((!C||!C.length)&&typeof E=="function"){var _=y&&y.length,A=E({yAxis:j?gr(gr({},j),{},{ticks:_?y:j.ticks}):void 0,width:t??f,height:n??p,offset:r},_?!0:m);Ay(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof A,"]")),Array.isArray(A)&&(C=A)}if((!O||!O.length)&&typeof k=="function"){var z=v&&v.length,R=k({xAxis:b?gr(gr({},b),{},{ticks:z?v:b.ticks}):void 0,width:t??f,height:n??p,offset:r},z?!0:m);Ay(Array.isArray(R),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof R,"]")),Array.isArray(R)&&(O=R)}return x.createElement(Zi,{zIndex:i.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(Lke,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(Uke,Ml({},i,{horizontalPoints:C})),x.createElement(qke,Ml({},i,{verticalPoints:O})),x.createElement($ke,Ml({},i,{offset:r,horizontalPoints:C,xAxis:b,yAxis:j})),x.createElement(Bke,Ml({},i,{offset:r,verticalPoints:O,xAxis:b,yAxis:j}))))}iF.displayName="CartesianGrid";var Gke={},aF=jr({name:"errorBars",initialState:Gke,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:pze,replaceErrorBar:mze,removeErrorBar:gze}=aF.actions,Vke=aF.reducer,Qke=["children"];function Yke(e,t){if(e==null)return{};var n,r,i=Zke(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 Zke(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 Wke={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},Xke=x.createContext(Wke);function Jke(e){var{children:t}=e,n=Yke(e,Qke);return x.createElement(Xke.Provider,{value:n},t)}function kA(e,t){var n,r,i=Ue(f=>Ms(f,e)),a=Ue(f=>Is(f,t)),o=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:qn.allowDataOverflow,u=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Fn.allowDataOverflow,d=o||u;return{needClip:d,needClipX:o,needClipY:u}}function sF(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=SA(),{needClipX:a,needClipY:o,needClip:u}=kA(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:o?f:f-m/2,width:a?p:p*2,height:o?m:m*2}))}function eCe(e){var t=Yh(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),u=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(u)||u<0)&&(u=r),{r:o,strokeWidth:u}}return{r:n,strokeWidth:r}}function Ga(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:W8}function Va(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:W8}var oF=(e,t,n)=>$o(e,"xAxis",Ga(e,t),n),lF=(e,t,n)=>Lo(e,"xAxis",Ga(e,t),n),cF=(e,t,n)=>$o(e,"yAxis",Va(e,t),n),uF=(e,t,n)=>Lo(e,"yAxis",Va(e,t),n),tCe=ae([It,oF,cF,lF,uF],(e,t,n,r,i)=>Ka(e,"xAxis")?Ju(t,r,!1):Ju(n,i,!1)),nCe=(e,t)=>t,dF=ae([D0,nCe],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),fF=e=>{var t=It(e),n=Ka(t,"xAxis");return n?"yAxis":"xAxis"},rCe=(e,t)=>{var n=fF(e);return n==="yAxis"?Va(e,t):Ga(e,t)},iCe=(e,t,n)=>Zy(e,fF(e),rCe(e,t),n),aCe=ae([dF,iCe],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=k0(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,o=a?.find(u=>u.key===i);if(o!=null)return o.map(u=>[u[0],u[1]])}}}),sCe=ae([It,oF,cF,lF,uF,aCe,iU,tCe,dF,xve],(e,t,n,r,i,a,o,u,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:y}=o;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,w;if(v&&v.length>0?w=v:w=p?.slice(m,y+1),w!=null)return CCe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:m,areaSettings:d,stackedData:a,displayedData:w,chartBaseValue:f,bandSize:u})}}),oCe=["id"],lCe=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Hl(){return Hl=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},Hl.apply(null,arguments)}function hF(e,t){if(e==null)return{};var n,r,i=cCe(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 cCe(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 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 Eu(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){uCe(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 uCe(e,t,n){return(t=dCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dCe(e){var t=fCe(e,"string");return typeof t=="symbol"?t:t+""}function fCe(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 sv(e,t){return e&&e!=="none"?e:t}var hCe=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:sv(r,i),value:l0(n,t),payload:e}]},pCe=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:u,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:yc,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:l0(o,t),hide:u,type:f,color:sv(r,a),unit:d,graphicalItemId:p}};return x.createElement(G8,{tooltipEntrySettings:m})});function mCe(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,u=Hi(r);return x.createElement(vNe,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:u,needClip:i,clipPathId:t})}function gCe(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var o,u,d={x:(o=a.x)!==null&&o!==void 0?o:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Eu(Eu({},d),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return x.createElement(M8,{value:t?i:void 0},n)}function lL(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:o,type:u,stroke:d,connectNulls:f,isRange:p}=a,{id:m}=a,y=hF(a,oCe),v=Hi(y),w=Dr(y);return x.createElement(x.Fragment,null,t?.length>1&&x.createElement(xr,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},x.createElement(sh,Hl({},w,{id:m,points:t,connectNulls:f,type:u,baseLine:n,layout:o,stroke:"none",className:"recharts-area-area"})),d!=="none"&&x.createElement(sh,Hl({},v,{className:"recharts-area-curve",layout:o,type:u,connectNulls:f,fill:"none",points:t})),d!=="none"&&p&&Array.isArray(n)&&x.createElement(sh,Hl({},v,{className:"recharts-area-curve",layout:o,type:u,connectNulls:f,fill:"none",points:n}))),x.createElement(mCe,{points:t,props:y,clipPathId:i}))}function yCe(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=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(!gt(u)||!gt(d))return null;var f=r*Math.abs(u-d),p=Math.max(...a.map(m=>m.x||0));return Te(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.x||0),p)),Te(p)?x.createElement("rect",{x:0,y:u<d?u:u-f,width:p+(o?parseInt("".concat(o),10):1),height:Math.floor(f)}):null}function vCe(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=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(!gt(u)||!gt(d))return null;var f=r*Math.abs(u-d),p=Math.max(...a.map(m=>m.y||0));return Te(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.y||0),p)),Te(p)?x.createElement("rect",{x:u<d?u:u-f,y:0,width:f,height:Math.floor(p+(o?parseInt("".concat(o),10):1))}):null}function xCe(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?x.createElement(yCe,{alpha:t,points:r,baseLine:i,strokeWidth:a}):x.createElement(vCe,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function bCe(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:o,baseLine:u,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,onAnimationStart:y,onAnimationEnd:v}=r,w=x.useMemo(()=>({points:o,baseLine:u}),[o,u]),b=v0(w,"recharts-area-"),j=vC(),[k,E]=x.useState(!1),C=!k,O=x.useCallback(()=>{typeof v=="function"&&v(),E(!1)},[v]),_=x.useCallback(()=>{typeof y=="function"&&y(),E(!0)},[y]);if(j==null)return null;var A=i.current,z=a.current;return x.createElement(gCe,{showLabels:C,points:o},r.children,x.createElement(y0,{animationId:b,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:O,onAnimationStart:_,key:b},R=>{if(A){var $=A.length/o.length,F=R===1?o:o.map((B,V)=>{var X=Math.floor(V*$);if(A[X]){var W=A[X];return Eu(Eu({},B),{},{x:pn(W.x,B.x,R),y:pn(W.y,B.y,R)})}return B}),U;return Te(u)?U=pn(z,u,R):mn(u)||ua(u)?U=pn(z,0,R):U=u.map((B,V)=>{var X=Math.floor(V*$);if(Array.isArray(z)&&z[X]){var W=z[X];return Eu(Eu({},B),{},{x:pn(W.x,B.x,R),y:pn(W.y,B.y,R)})}return B}),R>0&&(i.current=F,a.current=U),x.createElement(lL,{points:F,baseLine:U,needClip:t,clipPathId:n,props:r})}return R>0&&(i.current=o,a.current=u),x.createElement(xr,null,d&&x.createElement("defs",null,x.createElement("clipPath",{id:"animationClipPath-".concat(n)},x.createElement(xCe,{alpha:R,points:o,baseLine:u,layout:j,strokeWidth:r.strokeWidth}))),x.createElement(xr,{clipPath:"url(#animationClipPath-".concat(n,")")},x.createElement(lL,{points:o,baseLine:u,needClip:t,clipPathId:n,props:r})))}),x.createElement(L8,{label:r.label}))}function wCe(e){var{needClip:t,clipPathId:n,props:r}=e,i=x.useRef(null),a=x.useRef();return x.createElement(bCe,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class SCe extends x.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:o,needClip:u,xAxisId:d,yAxisId:f,width:p,height:m,id:y,baseLine:v,zIndex:w}=this.props;if(t)return null;var b=Rt("recharts-area",i),j=y,{r:k,strokeWidth:E}=eCe(n),C=q8(n),O=k*2+E,_=u?"url(#clipPath-".concat(C?"":"dots-").concat(j,")"):void 0;return x.createElement(Zi,{zIndex:w},x.createElement(xr,{className:b},u&&x.createElement("defs",null,x.createElement(sF,{clipPathId:j,xAxisId:d,yAxisId:f}),!C&&x.createElement("clipPath",{id:"clipPath-dots-".concat(j)},x.createElement("rect",{x:o-O/2,y:a-O/2,width:p+O,height:m+O}))),x.createElement(wCe,{needClip:u,clipPathId:j,props:this.props})),x.createElement(eL,{points:r,mainColor:sv(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:_}),this.props.isRange&&Array.isArray(v)&&x.createElement(eL,{points:v,mainColor:sv(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:_}))}}var jCe={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:Zn.area};function NCe(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:o,dot:u,fill:d,fillOpacity:f,hide:p,isAnimationActive:m,legendType:y,stroke:v,xAxisId:w,yAxisId:b}=e,j=hF(e,lCe),k=vc(),E=p8(),{needClip:C}=kA(w,b),O=Nr(),{points:_,isRange:A,baseLine:z}=(t=Ue(V=>sCe(V,e.id,O)))!==null&&t!==void 0?t:{},R=SA();if(k!=="horizontal"&&k!=="vertical"||R==null||E!=="AreaChart"&&E!=="ComposedChart")return null;var{height:$,width:F,x:U,y:B}=R;return!_||!_.length?null:x.createElement(SCe,Hl({},j,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:z,connectNulls:o,dot:u,fill:d,fillOpacity:f,height:$,hide:p,layout:k,isAnimationActive:m,isRange:A,legendType:y,needClip:C,points:_,stroke:v,width:F,left:U,top:B,xAxisId:w,yAxisId:b}))}var kCe=(e,t,n,r,i)=>{var a=n??t;if(Te(a))return a;var o=e==="horizontal"?i:r,u=o.scale.domain();if(o.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 CCe(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:o,xAxis:u,yAxis:d,displayedData:f,dataStartIndex:p,xAxisTicks:m,yAxisTicks:y,bandSize:v}=e,w=i&&i.length,b=kCe(a,o,n,u,d),j=a==="horizontal",k=!1,E=f.map((O,_)=>{var A,z,R,$;if(w)$=i[p+_];else{var F=zn(O,r);Array.isArray(F)?($=F,k=!0):$=[b,F]}var U=(A=(z=$)===null||z===void 0?void 0:z[1])!==null&&A!==void 0?A:null,B=U==null||w&&!t&&zn(O,r)==null;if(j){var V;return{x:QR({axis:u,ticks:m,bandSize:v,entry:O,index:_}),y:B?null:(V=d.scale.map(U))!==null&&V!==void 0?V:null,value:$,payload:O}}return{x:B?null:(R=u.scale.map(U))!==null&&R!==void 0?R:null,y:QR({axis:d,ticks:y,bandSize:v,entry:O,index:_}),value:$,payload:O}}),C;return w||k?C=E.map(O=>{var _,A=Array.isArray(O.value)?O.value[0]:null;if(j){var z;return{x:O.x,y:A!=null&&O.y!=null&&(z=d.scale.map(A))!==null&&z!==void 0?z:null,payload:O.payload}}return{x:A!=null&&(_=u.scale.map(A))!==null&&_!==void 0?_:null,y:O.y,payload:O.payload}}):C=j?d.scale.map(b):u.scale.map(b),{points:E,baseLine:C??0,isRange:k}}function ACe(e){var t=Sr(e,jCe),n=Nr();return x.createElement(Q8,{id:t.id,type:"area"},r=>x.createElement(x.Fragment,null,x.createElement(V8,{legendPayload:hCe(t)}),x.createElement(pCe,{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(Z8,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:P6(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),x.createElement(NCe,Hl({},t,{id:r}))))}var _u=x.memo(ACe,xd);_u.displayName="Area";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 CA(e){return x.createElement(J1e,lN({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var OCe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Te(t))return t;var a=Te(r)||mn(r);return a?t(r,i):(a||Cs(!1),n)}},ECe=(e,t,n)=>n,_Ce=(e,t)=>t,fp=ae([D0,_Ce],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),zCe=ae([fp],e=>e?.maxBarSize),TCe=(e,t,n,r)=>r,PCe=ae([It,D0,Ga,Va,ECe],(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")),RCe=(e,t,n)=>{var r=It(e),i=Ga(e,t),a=Va(e,t);if(!(i==null||a==null))return r==="horizontal"?Zy(e,"yAxis",a,n):Zy(e,"xAxis",i,n)},DCe=(e,t)=>{var n=It(e),r=Ga(e,t),i=Va(e,t);if(!(r==null||i==null))return n==="horizontal"?tI(e,"xAxis",r):tI(e,"yAxis",i)},MCe=ae([PCe,vve,DCe],LNe),ICe=(e,t,n)=>{var r,i,a=fp(e,t);if(a==null)return 0;var o=Ga(e,t),u=Va(e,t);if(o==null||u==null)return 0;var d=It(e),f=gU(e),{maxBarSize:p}=a,m=mn(p)?f:p,y,v;return d==="horizontal"?(y=$o(e,"xAxis",o,n),v=Lo(e,"xAxis",o,n)):(y=$o(e,"yAxis",u,n),v=Lo(e,"yAxis",u,n)),(r=(i=Ju(y,v,!0))!==null&&i!==void 0?i:m)!==null&&r!==void 0?r:0},pF=(e,t,n)=>{var r=It(e),i=Ga(e,t),a=Va(e,t);if(!(i==null||a==null)){var o,u;return r==="horizontal"?(o=$o(e,"xAxis",i,n),u=Lo(e,"xAxis",i,n)):(o=$o(e,"yAxis",a,n),u=Lo(e,"yAxis",a,n)),Ju(o,u)}},LCe=ae([MCe,gU,yve,yU,ICe,pF,zCe],FNe),$Ce=(e,t,n)=>{var r=Ga(e,t);if(r!=null)return $o(e,"xAxis",r,n)},BCe=(e,t,n)=>{var r=Va(e,t);if(r!=null)return $o(e,"yAxis",r,n)},UCe=(e,t,n)=>{var r=Ga(e,t);if(r!=null)return Lo(e,"xAxis",r,n)},qCe=(e,t,n)=>{var r=Va(e,t);if(r!=null)return Lo(e,"yAxis",r,n)},FCe=ae([LCe,fp],KNe),HCe=ae([RCe,fp],HNe),KCe=ae([Wn,hC,$Ce,BCe,UCe,qCe,FCe,It,iU,pF,HCe,fp,TCe],(e,t,n,r,i,a,o,u,d,f,p,m,y)=>{var{chartData:v,dataStartIndex:w,dataEndIndex:b}=d;if(!(m==null||o==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(w,b+1),k!=null)return xAe({layout:u,barSettings:m,pos:o,parentViewBox:t,bandSize:f,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:p,displayedData:k,offset:e,cells:y,dataStartIndex:w})}}),GCe=["index"];function cN(){return cN=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},cN.apply(null,arguments)}function VCe(e,t){if(e==null)return{};var n,r,i=QCe(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 QCe(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 mF=x.createContext(void 0),YCe=e=>{var t=x.useContext(mF);if(t!=null)return t.stackId;if(e!=null)return P6(e)},ZCe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),WCe=e=>{var t=x.useContext(mF);if(t!=null){var{stackId:n}=t;return"url(#".concat(ZCe(n,e),")")}},gF=e=>{var{index:t}=e,n=VCe(e,GCe),r=WCe(t);return x.createElement(xr,cN({className:"recharts-bar-stack-layer",clipPath:r},n))},XCe=["onMouseEnter","onMouseLeave","onClick"],JCe=["value","background","tooltipPosition"],eAe=["id"],tAe=["onMouseEnter","onClick","onMouseLeave"];function Bo(){return Bo=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},Bo.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 zr(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){nAe(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 nAe(e,t,n){return(t=rAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rAe(e){var t=iAe(e,"string");return typeof t=="symbol"?t:t+""}function iAe(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 ov(e,t){if(e==null)return{};var n,r,i=aAe(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 aAe(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 sAe=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:l0(n,t),payload:e}]},oAe=x.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:u,tooltipType:d,id:f}=e,p={dataDefinedOnItem:void 0,getPosition:yc,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:l0(a,t),hide:o,type:d,color:i,unit:u,graphicalItemId:f}};return x.createElement(G8,{tooltipEntrySettings:p})});function lAe(e){var t=Ue(sc),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:u,onClick:d}=a,f=ov(a,XCe),p=F8(o,r,a.id),m=H8(u),y=K8(d,r,a.id);if(!i||n==null)return null;var v=Yh(i);return x.createElement(Zi,{zIndex:GNe(i,Zn.barBackground)},n.map((w,b)=>{var{value:j,background:k,tooltipPosition:E}=w,C=ov(w,JCe);if(!k)return null;var O=p(w,b),_=m(w,b),A=y(w,b),z=zr(zr(zr(zr(zr({option:i,isActive:String(b)===t},C),{},{fill:"#eee"},k),v),Wv(f,w,b)),{},{onMouseEnter:O,onMouseLeave:_,onClick:A,dataKey:r,index:b,className:"recharts-bar-background-rectangle"});return x.createElement(CA,Bo({key:"background-bar-".concat(b)},z))}))}function cAe(e){var{showLabels:t,children:n,rects:r}=e,i=r?.map(a=>{var o={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return zr(zr({},o),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:o,fill:a.fill})});return x.createElement(M8,{value:t?i:void 0},n)}function uAe(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,u=Ue(sc),d=Ue(d8),f=n&&String(i.originalDataIndex)===u&&(d==null||o===d),[p,m]=x.useState(!1),[y,v]=x.useState(!1);x.useEffect(()=>{var C;return f?(m(!0),C=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(C)}},[f]);var w=x.useCallback(()=>{f||m(!1)},[f]),b=f&&y,j=f||p,k;f?n===!0?k=t:k=n:k=t;var E=x.createElement(CA,Bo({},r,{name:String(r.name)},i,{isActive:b,option:k,index:a,dataKey:o,onTransitionEnd:w}));return j?x.createElement(Zi,{zIndex:Zn.activeBar},x.createElement(gF,{index:i.originalDataIndex},E)):E}function dAe(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return x.createElement(CA,Bo({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function fAe(e){var t,{data:n,props:r}=e,i=(t=Hi(r))!==null&&t!==void 0?t:{},{id:a}=i,o=ov(i,eAe),{shape:u,dataKey:d,activeBar:f}=r,{onMouseEnter:p,onClick:m,onMouseLeave:y}=r,v=ov(r,tAe),w=F8(p,d,a),b=H8(y),j=K8(m,d,a);return n?x.createElement(x.Fragment,null,n.map((k,E)=>x.createElement(gF,Bo({index:k.originalDataIndex,key:"rectangle-".concat(k?.x,"-").concat(k?.y,"-").concat(k?.value,"-").concat(E),className:"recharts-bar-rectangle"},Wv(v,k,E),{onMouseEnter:w(k,E),onMouseLeave:b(k,E),onClick:j(k,E)}),f?x.createElement(uAe,{shape:u,activeBar:f,baseProps:o,entry:k,index:E,dataKey:d}):x.createElement(dAe,{shape:u,baseProps:o,entry:k,index:E,dataKey:d})))):null}function hAe(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:u,animationEasing:d,onAnimationEnd:f,onAnimationStart:p}=t,m=n.current,y=v0(t,"recharts-bar-"),[v,w]=x.useState(!1),b=!v,j=x.useCallback(()=>{typeof f=="function"&&f(),w(!1)},[f]),k=x.useCallback(()=>{typeof p=="function"&&p(),w(!0)},[p]);return x.createElement(cAe,{showLabels:b,rects:r},x.createElement(y0,{animationId:y,begin:o,duration:u,isActive:a,easing:d,onAnimationEnd:j,onAnimationStart:k,key:y},E=>{var C=E===1?r:r?.map((O,_)=>{var A=m&&m[_];if(A)return zr(zr({},O),{},{x:pn(A.x,O.x,E),y:pn(A.y,O.y,E),width:pn(A.width,O.width,E),height:pn(A.height,O.height,E)});if(i==="horizontal"){var z=pn(0,O.height,E),R=pn(O.stackedBarStart,O.y,E);return zr(zr({},O),{},{y:R,height:z})}var $=pn(0,O.width,E),F=pn(O.stackedBarStart,O.x,E);return zr(zr({},O),{},{width:$,x:F})});return E>0&&(n.current=C??null),C==null?null:x.createElement(xr,null,x.createElement(fAe,{props:t,data:C}))}),x.createElement(L8,{label:t.label}),t.children)}function pAe(e){var t=x.useRef(null);return x.createElement(hAe,{previousRectanglesRef:t,props:e})}var yF=0,mAe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:zn(e,t)}};class gAe extends x.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:o,needClip:u,background:d,id:f}=this.props;if(t||n==null)return null;var p=Rt("recharts-bar",i),m=f;return x.createElement(xr,{className:p,id:f},u&&x.createElement("defs",null,x.createElement(sF,{clipPathId:m,xAxisId:a,yAxisId:o})),x.createElement(xr,{className:"recharts-bar-rectangles",clipPath:u?"url(#clipPath-".concat(m,")"):void 0},x.createElement(lAe,{data:n,dataKey:r,background:d,allOtherBarProps:this.props}),x.createElement(pAe,this.props)))}}var yAe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:yF,xAxisId:0,yAxisId:0,zIndex:Zn.bar};function vAe(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:u,animationDuration:d,animationEasing:f,isAnimationActive:p}=e,{needClip:m}=kA(t,n),y=vc(),v=Nr(),w=R1e(e.children,j8),b=Ue(E=>KCe(E,e.id,v,w));if(y!=="vertical"&&y!=="horizontal")return null;var j,k=b?.[0];return k==null||k.height==null||k.width==null?j=0:j=y==="vertical"?k.height/2:k.width/2,x.createElement(Jke,{xAxisId:t,yAxisId:n,data:b,dataPointFormatter:mAe,errorBarOffset:j},x.createElement(gAe,Bo({},e,{layout:y,needClip:m,data:b,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:u,animationDuration:d,animationEasing:f,isAnimationActive:p})))}function xAe(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:o,xAxis:u,yAxis:d,xAxisTicks:f,yAxisTicks:p,stackedData:m,displayedData:y,offset:v,cells:w,parentViewBox:b,dataStartIndex:j}=e,k=t==="horizontal"?d:u,E=m?k.scale.domain():null,C=nme({numericAxis:k}),O=k.scale.map(C);return y.map((_,A)=>{var z,R,$,F,U,B;if(m){var V=m[A+j];if(V==null)return null;z=Wpe(V,E)}else z=zn(_,n),Array.isArray(z)||(z=[C,z]);var X=OCe(r,yF)(z[1],A);if(t==="horizontal"){var W,H=d.scale.map(z[0]),J=d.scale.map(z[1]);if(H==null||J==null)return null;R=YR({axis:u,ticks:f,bandSize:o,offset:a.offset,entry:_,index:A}),$=(W=J??H)!==null&&W!==void 0?W:void 0,F=a.size;var ce=H-J;if(U=ua(ce)?0:ce,B={x:R,y:v.top,width:F,height:v.height},Math.abs(X)>0&&Math.abs(U)<Math.abs(X)){var xe=Qr(U||X)*(Math.abs(X)-Math.abs(U));$-=xe,U+=xe}}else{var M=u.scale.map(z[0]),I=u.scale.map(z[1]);if(M==null||I==null)return null;if(R=M,$=YR({axis:d,ticks:p,bandSize:o,offset:a.offset,entry:_,index:A}),F=I-M,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(R==null||$==null||F==null||U==null||!i&&(F===0||U===0))return null;var D=zr(zr({},_),{},{stackedBarStart:O,x:R,y:$,width:F,height:U,value:m?z:z[1],payload:_,background:B,tooltipPosition:{x:R+F/2,y:$+U/2},parentViewBox:b,originalDataIndex:A},w&&w[A]&&w[A].props);return D}).filter(Boolean)}function bAe(e){var t=Sr(e,yAe),n=YCe(t.stackId),r=Nr();return x.createElement(Q8,{id:t.id,type:"bar"},i=>x.createElement(x.Fragment,null,x.createElement(V8,{legendPayload:sAe(t)}),x.createElement(oAe,{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(Z8,{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(Zi,{zIndex:t.zIndex},x.createElement(vAe,Bo({},t,{id:i})))))}var uN=x.memo(bAe,xd);uN.displayName="Bar";var wAe=["domain","range"],SAe=["domain","range"];function uL(e,t){if(e==null)return{};var n,r,i=jAe(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 jAe(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){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 vF(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=uL(e,wAe),{domain:a,range:o}=t,u=uL(t,SAe);return!dL(n,a)||!dL(r,o)?!1:xd(i,u)}var NAe=["type"],kAe=["dangerouslySetInnerHTML","ticks","scale"],CAe=["id","scale"];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)}function fL(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 hL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fL(Object(n),!0).forEach(function(r){AAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AAe(e,t,n){return(t=OAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OAe(e){var t=EAe(e,"string");return typeof t=="symbol"?t:t+""}function EAe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fN(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 zAe(e){var t=sn(),n=x.useRef(null),r=vC(),{type:i}=e,a=fN(e,NAe),o=S0(r,"xAxis",i),u=x.useMemo(()=>{if(o!=null)return hL(hL({},a),{},{type:o})},[a,o]);return x.useLayoutEffect(()=>{u!=null&&(n.current===null?t(jNe(u)):n.current!==u&&t(NNe({prev:n.current,next:u})),n.current=u)},[u,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(kNe(n.current)),n.current=null)},[t]),null}var TAe=e=>{var{xAxisId:t,className:n}=e,r=Ue(hC),i=Nr(),a="xAxis",o=Ue(k=>Fq(k,a,t,i)),u=Ue(k=>Bq(k,t)),d=Ue(k=>ewe(k,t)),f=Ue(k=>lq(k,t));if(u==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:p,ticks:m,scale:y}=e,v=fN(e,kAe),{id:w,scale:b}=f,j=fN(f,CAe);return x.createElement(NA,dN({},v,j,{x:d.x,y:d.y,width:u.width,height:u.height,className:Rt("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:o,axisType:a,axisId:t}))},PAe={allowDataOverflow:qn.allowDataOverflow,allowDecimals:qn.allowDecimals,allowDuplicatedCategory:qn.allowDuplicatedCategory,angle:qn.angle,axisLine:ks.axisLine,height:qn.height,hide:!1,includeHidden:qn.includeHidden,interval:qn.interval,label:!1,minTickGap:qn.minTickGap,mirror:qn.mirror,orientation:qn.orientation,padding:qn.padding,reversed:qn.reversed,scale:qn.scale,tick:qn.tick,tickCount:qn.tickCount,tickLine:ks.tickLine,tickSize:ks.tickSize,type:qn.type,niceTicks:qn.niceTicks,xAxisId:0},RAe=e=>{var t=Sr(e,PAe);return x.createElement(x.Fragment,null,x.createElement(zAe,{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(TAe,t))},Ih=x.memo(RAe,vF);Ih.displayName="XAxis";var DAe=["type"],MAe=["dangerouslySetInnerHTML","ticks","scale"],IAe=["id","scale"];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 pL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pL(Object(n),!0).forEach(function(r){LAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LAe(e,t,n){return(t=$Ae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Ae(e){var t=BAe(e,"string");return typeof t=="symbol"?t:t+""}function BAe(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 pN(e,t){if(e==null)return{};var n,r,i=UAe(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 UAe(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 qAe(e){var t=sn(),n=x.useRef(null),r=vC(),{type:i}=e,a=pN(e,DAe),o=S0(r,"yAxis",i),u=x.useMemo(()=>{if(o!=null)return mL(mL({},a),{},{type:o})},[o,a]);return x.useLayoutEffect(()=>{u!=null&&(n.current===null?t(CNe(u)):n.current!==u&&t(ANe({prev:n.current,next:u})),n.current=u)},[u,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(ONe(n.current)),n.current=null)},[t]),null}function FAe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=x.useRef(null),o=x.useRef(null),u=Ue(hC),d=Nr(),f=sn(),p="yAxis",m=Ue(A=>Uq(A,t)),y=Ue(A=>nwe(A,t)),v=Ue(A=>Fq(A,p,t,d)),w=Ue(A=>cq(A,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!m||wA(i)||x.isValidElement(i)||w==null)){var A=a.current;if(A){var z=A.getCalculatedWidth();Math.round(m.width)!==Math.round(z)&&f(ENe({id:t,width:z}))}}},[v,m,f,i,t,r,w]),m==null||y==null||w==null)return null;var{dangerouslySetInnerHTML:b,ticks:j,scale:k}=e,E=pN(e,MAe),{id:C,scale:O}=w,_=pN(w,IAe);return x.createElement(NA,hN({},E,_,{ref:a,labelRef:o,x:y.x,y:y.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:m.width,height:m.height,className:Rt("recharts-".concat(p," ").concat(p),n),viewBox:u,ticks:v,axisType:p,axisId:t}))}var HAe={allowDataOverflow:Fn.allowDataOverflow,allowDecimals:Fn.allowDecimals,allowDuplicatedCategory:Fn.allowDuplicatedCategory,angle:Fn.angle,axisLine:ks.axisLine,hide:!1,includeHidden:Fn.includeHidden,interval:Fn.interval,label:!1,minTickGap:Fn.minTickGap,mirror:Fn.mirror,orientation:Fn.orientation,padding:Fn.padding,reversed:Fn.reversed,scale:Fn.scale,tick:Fn.tick,tickCount:Fn.tickCount,tickLine:ks.tickLine,tickSize:ks.tickSize,type:Fn.type,niceTicks:Fn.niceTicks,width:Fn.width,yAxisId:0},KAe=e=>{var t=Sr(e,HAe);return x.createElement(x.Fragment,null,x.createElement(qAe,{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(FAe,t))},Lh=x.memo(KAe,vF);Lh.displayName="YAxis";var GAe=(e,t)=>t,AA=ae([GAe,It,NU,Jn,o8,Ls,NSe,Wn],zSe);function VAe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function OA(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(VAe(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 o=(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=>o(u.clientX,u.clientY)):o(e.clientX,e.clientY)}var xF=gi("mouseClick"),bF=Xh();bF.startListening({actionCreator:xF,effect:(e,t)=>{var n=e.payload,r=AA(t.getState(),OA(n));r?.activeIndex!=null&&t.dispatch(vwe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var mN=gi("mouseMove"),wF=Xh(),mu=null,xl=null,vj=null;wF.startListening({actionCreator:mN,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a?.includes("mousemove");mu!==null&&(cancelAnimationFrame(mu),mu=null),xl!==null&&(typeof i!="number"||!o)&&(clearTimeout(xl),xl=null),vj=OA(n);var u=()=>{var d=t.getState(),f=up(d,d.tooltip.settings.shared);if(!vj){mu=null,xl=null;return}if(f==="axis"){var p=AA(d,vj);p?.activeIndex!=null?t.dispatch(Wq({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(Zq())}mu=null,xl=null};if(!o){u();return}i==="raf"?mu=requestAnimationFrame(u):typeof i=="number"&&xl===null&&(xl=setTimeout(u,i))}});function QAe(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 gL={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},SF=jr({name:"rootProps",initialState:gL,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:gL.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}}}),YAe=SF.reducer,{updateOptions:ZAe}=SF.actions,WAe=null,XAe={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)},jF=jr({name:"polarOptions",initialState:WAe,reducers:XAe}),{updatePolarOptions:yze}=jF.actions,JAe=jF.reducer,NF=gi("keyDown"),kF=gi("focus"),CF=gi("blur"),$0=Xh(),gu=null,bl=null,hg=null;$0.startListening({actionCreator:NF,effect:(e,t)=>{hg=e.payload,gu!==null&&(cancelAnimationFrame(gu),gu=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");bl!==null&&(typeof r!="number"||!a)&&(clearTimeout(bl),bl=null);var o=()=>{try{var u=t.getState(),d=u.rootProps.accessibilityLayer!==!1;if(!d)return;var{keyboardInteraction:f}=u.tooltip,p=hg;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var m=oh(f,ac(u),ad(u),sd(u)),y=m==null?-1:Number(m),v=!Number.isFinite(y)||y<0,w=Ls(u),b=ac(u),j=up(u,u.tooltip.settings.shared);if(p==="Enter"){if(v)return;var k=Jy(u,j,"hover",String(f.index));t.dispatch(Xy({active:!f.active,activeIndex:f.index,activeCoordinate:k}));return}var E=owe(u),C=E==="left-to-right"?1:-1,O=p==="ArrowRight"?1:-1,_;if(v){var A=ad(u),z=sd(u),R=O*C,$=X=>({active:!1,index:String(X),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(_=-1,R>0){for(var F=0;F<b.length;F++)if(oh($(F),b,A,z)!=null){_=F;break}}else for(var U=b.length-1;U>=0;U--)if(oh($(U),b,A,z)!=null){_=U;break}if(_<0)return}else{_=y+O*C;var B=w?.length||b.length;if(B===0||_>=B||_<0)return}var V=Jy(u,j,"hover",String(_));t.dispatch(Xy({active:!0,activeIndex:_.toString(),activeCoordinate:V}))}finally{gu=null,bl=null}};if(!a){o();return}r==="raf"?gu=requestAnimationFrame(o):typeof r=="number"&&bl===null&&(o(),hg=null,bl=setTimeout(()=>{hg?o():(bl=null,gu=null)},r))}});$0.startListening({actionCreator:kF,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",o=up(n,n.tooltip.settings.shared),u=Jy(n,o,"hover",String(a));t.dispatch(Xy({active:!0,activeIndex:a,activeCoordinate:u}))}}}});$0.startListening({actionCreator:CF,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(Xy({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function AF(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"),OF=Xh(),pg=new Map,Ff=new Map,xj=new Map;OF.startListening({actionCreator:Ri,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=AF(r);xj.set(i,{handler:n,reactEvent:a});var o=pg.get(i);o!==void 0&&(cancelAnimationFrame(o),pg.delete(i));var u=t.getState(),{throttleDelay:d,throttledEvents:f}=u.eventSettings,p=f,m=p==="all"||p?.includes(i),y=Ff.get(i);y!==void 0&&(typeof d!="number"||!m)&&(clearTimeout(y),Ff.delete(i));var v=()=>{var j=xj.get(i);try{if(!j)return;var{handler:k,reactEvent:E}=j,C=t.getState(),O={activeCoordinate:cSe(C),activeDataKey:d8(C),activeIndex:sc(C),activeLabel:u8(C),activeTooltipIndex:sc(C),isTooltipActive:uSe(C)};k&&k(O,E)}finally{pg.delete(i),Ff.delete(i),xj.delete(i)}};if(!m){v();return}if(d==="raf"){var w=requestAnimationFrame(v);pg.set(i,w)}else if(typeof d=="number"){if(!Ff.has(i)){v();var b=setTimeout(v,d);Ff.set(i,b)}}else v()}}});var eOe=ae([Ad],e=>e.tooltipItemPayloads),tOe=ae([eOe,(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)}}}),EF=gi("touchMove"),_F=Xh(),wl=null,mo=null,yL=null,Hf=null;_F.startListening({actionCreator:EF,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Hf=AF(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");wl!==null&&(cancelAnimationFrame(wl),wl=null),mo!==null&&(typeof i!="number"||!o)&&(clearTimeout(mo),mo=null),yL=Array.from(n.touches).map(d=>OA({clientX:d.clientX,clientY:d.clientY,currentTarget:n.currentTarget}));var u=()=>{if(Hf!=null){var d=t.getState(),f=up(d,d.tooltip.settings.shared);if(f==="axis"){var p,m=(p=yL)===null||p===void 0?void 0:p[0];if(m==null){wl=null,mo=null;return}var y=AA(d,m);y?.activeIndex!=null&&t.dispatch(Wq({activeIndex:y.activeIndex,activeDataKey:void 0,activeCoordinate:y.activeCoordinate}))}else if(f==="item"){var v,w=Hf.touches[0];if(document.elementFromPoint==null||w==null)return;var b=document.elementFromPoint(w.clientX,w.clientY);if(!b||!b.getAttribute)return;var j=b.getAttribute(cme),k=(v=b.getAttribute(ume))!==null&&v!==void 0?v:void 0,E=wc(d).find(_=>_.id===k);if(j==null||E==null||k==null)return;var{dataKey:C}=E,O=tOe(d,j,k);t.dispatch(Yq({activeDataKey:C,activeIndex:j,activeCoordinate:O,activeGraphicalItemId:k}))}wl=null,mo=null}};if(!o){u();return}i==="raf"?wl=requestAnimationFrame(u):typeof i=="number"&&mo===null&&(u(),Hf=null,mo=setTimeout(()=>{Hf?u():(mo=null,wl=null)},i))}}});var zF={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},TF=jr({name:"eventSettings",initialState:zF,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:nOe}=TF.actions,rOe=TF.reducer,iOe=n6({brush:QNe,cartesianAxis:_Ne,chartData:oje,errorBars:Vke,eventSettings:rOe,graphicalItems:lNe,layout:Gpe,legend:rge,options:nje,polarAxis:E1e,polarOptions:JAe,referenceElements:XNe,renderedTicks:mke,rootProps:YAe,tooltip:xwe,zIndex:HSe}),aOe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return ype({reducer:iOe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([bF.middleware,wF.middleware,$0.middleware,OF.middleware,_F.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(y6({type:"raf"}))},devTools:{serialize:{replacer:QAe},name:"recharts-".concat(n)}})};function sOe(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Nr(),a=x.useRef(null);if(i)return n;a.current==null&&(a.current=aOe(t,r));var o=sC;return x.createElement(wge,{context:o,store:a.current},n)}function oOe(e){var{layout:t,margin:n}=e,r=sn(),i=Nr();return x.useEffect(()=>{i||(r(Fpe(t)),r(qpe(n)))},[r,i,t,n]),null}var lOe=x.memo(oOe,xd);function cOe(e){var t=sn();return x.useEffect(()=>{t(ZAe(e))},[t,e]),null}var uOe=e=>{var t=sn();return x.useEffect(()=>{t(nOe(e))},[t,e]),null},dOe=x.memo(uOe,xd);function vL(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=sn();return x.useLayoutEffect(()=>(r.current&&i(qSe({zIndex:t,element:r.current,isPanorama:n})),()=>{i(FSe({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function xL(e){var{children:t,isPanorama:n}=e,r=Ue(PSe);if(!r||r.length===0)return t;var i=r.filter(o=>o<0),a=r.filter(o=>o>0);return x.createElement(x.Fragment,null,i.map(o=>x.createElement(vL,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>x.createElement(vL,{key:o,zIndex:o,isPanorama:n})))}var fOe=["children"];function hOe(e,t){if(e==null)return{};var n,r,i=pOe(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 pOe(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 lv(){return lv=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},lv.apply(null,arguments)}var mOe={width:"100%",height:"100%",display:"block"},gOe=x.forwardRef((e,t)=>{var n=gC(),r=yC(),i=Q6();if(!Ua(n)||!Ua(r))return null;var{children:a,otherAttributes:o,title:u,desc:d}=e,f,p;return o!=null&&(typeof o.tabIndex=="number"?f=o.tabIndex:f=i?0:void 0,typeof o.role=="string"?p=o.role:p=i?"application":void 0),x.createElement(Zk,lv({},o,{title:u,desc:d,role:p,tabIndex:f,width:n,height:r,style:mOe,ref:t}),a)}),yOe=e=>{var{children:t}=e,n=Ue(f0);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return x.createElement(Zk,{width:r,height:i,x:o,y:a},t)},bL=x.forwardRef((e,t)=>{var{children:n}=e,r=hOe(e,fOe),i=Nr();return i?x.createElement(yOe,null,x.createElement(xL,{isPanorama:!0},n)):x.createElement(gOe,lv({ref:t},r),x.createElement(xL,{isPanorama:!1},n))});function vOe(){var e=sn(),[t,n]=x.useState(null),r=Ue(lme);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;gt(a)&&a!==r&&e(Kpe(a))}},[t,e,r]),n}function wL(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 xOe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wL(Object(n),!0).forEach(function(r){bOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bOe(e,t,n){return(t=wOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wOe(e){var t=SOe(e,"string");return typeof t=="symbol"?t:t+""}function SOe(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 Ro(){return Ro=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},Ro.apply(null,arguments)}var jOe=()=>(gje(),null);function cv(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var NOe=x.forwardRef((e,t)=>{var n,r,i=x.useRef(null),[a,o]=x.useState({containerWidth:cv((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:cv((r=e.style)===null||r===void 0?void 0:r.height)}),u=x.useCallback((f,p)=>{o(m=>{var y=Math.round(f),v=Math.round(p);return m.containerWidth===y&&m.containerHeight===v?m:{containerWidth:y,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 y=w=>{var b=w[0];if(b!=null){var{width:j,height:k}=b.contentRect;u(j,k)}},v=new ResizeObserver(y);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(ep,{width:a.containerWidth,height:a.containerHeight}),x.createElement("div",Ro({ref:d},e)))}),kOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=x.useState({containerWidth:cv(n),containerHeight:cv(r)}),o=x.useCallback((d,f)=>{a(p=>{var m=Math.round(d),y=Math.round(f);return p.containerWidth===m&&p.containerHeight===y?p:{containerWidth:m,containerHeight:y}})},[]),u=x.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:f,height:p}=d.getBoundingClientRect();o(f,p)}},[t,o]);return x.createElement(x.Fragment,null,x.createElement(ep,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",Ro({ref:u},e)))}),COe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(ep,{width:n,height:r}),x.createElement("div",Ro({ref:t},e)))}),AOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(kOe,Ro({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(COe,Ro({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(ep,{width:n,height:r}),x.createElement("div",Ro({ref:t},e)))});function OOe(e){return e?NOe:AOe}var EOe=x.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:u,onMouseDown:d,onMouseEnter:f,onMouseLeave:p,onMouseMove:m,onMouseUp:y,onTouchEnd:v,onTouchMove:w,onTouchStart:b,style:j,width:k,responsive:E,dispatchTouchEvents:C=!0}=e,O=x.useRef(null),_=sn(),[A,z]=x.useState(null),[R,$]=x.useState(null),F=vOe(),U=pC(),B=U?.width>0?U.width:k,V=U?.height>0?U.height:i,X=x.useCallback(he=>{F(he),typeof t=="function"&&t(he),z(he),$(he),he!=null&&(O.current=he)},[F,t,z,$]),W=x.useCallback(he=>{_(xF(he)),_(Ri({handler:a,reactEvent:he}))},[_,a]),H=x.useCallback(he=>{_(mN(he)),_(Ri({handler:f,reactEvent:he}))},[_,f]),J=x.useCallback(he=>{_(Zq()),_(Ri({handler:p,reactEvent:he}))},[_,p]),ce=x.useCallback(he=>{_(mN(he)),_(Ri({handler:m,reactEvent:he}))},[_,m]),xe=x.useCallback(()=>{_(kF())},[_]),M=x.useCallback(()=>{_(CF())},[_]),I=x.useCallback(he=>{_(NF(he.key))},[_]),q=x.useCallback(he=>{_(Ri({handler:o,reactEvent:he}))},[_,o]),D=x.useCallback(he=>{_(Ri({handler:u,reactEvent:he}))},[_,u]),G=x.useCallback(he=>{_(Ri({handler:d,reactEvent:he}))},[_,d]),oe=x.useCallback(he=>{_(Ri({handler:y,reactEvent:he}))},[_,y]),ne=x.useCallback(he=>{_(Ri({handler:b,reactEvent:he}))},[_,b]),Ae=x.useCallback(he=>{C&&_(EF(he)),_(Ri({handler:w,reactEvent:he}))},[_,C,w]),we=x.useCallback(he=>{_(Ri({handler:v,reactEvent:he}))},[_,v]),ee=OOe(E);return x.createElement(x8.Provider,{value:A},x.createElement(yB.Provider,{value:R},x.createElement(ee,{width:B??j?.width,height:V??j?.height,className:Rt("recharts-wrapper",r),style:xOe({position:"relative",cursor:"default",width:B,height:V},j),onClick:W,onContextMenu:q,onDoubleClick:D,onFocus:xe,onBlur:M,onKeyDown:I,onMouseDown:G,onMouseEnter:H,onMouseLeave:J,onMouseMove:ce,onMouseUp:oe,onTouchEnd:we,onTouchMove:Ae,onTouchStart:ne,ref:X},x.createElement(jOe,null),n)))}),_Oe=["width","height","responsive","children","className","style","compact","title","desc"];function zOe(e,t){if(e==null)return{};var n,r,i=TOe(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 TOe(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 POe=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:u,compact:d,title:f,desc:p}=e,m=zOe(e,_Oe),y=Hi(m);return d?x.createElement(x.Fragment,null,x.createElement(ep,{width:n,height:r}),x.createElement(bL,{otherAttributes:y,title:f,desc:p},a)):x.createElement(EOe,{className:o,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(bL,{otherAttributes:y,title:f,desc:p,ref:t},x.createElement(eke,null,a)))});function gN(){return gN=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},gN.apply(null,arguments)}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 ROe(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){DOe(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 DOe(e,t,n){return(t=MOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MOe(e){var t=IOe(e,"string");return typeof t=="symbol"?t:t+""}function IOe(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 LOe={top:5,right:5,bottom:5,left:5},$Oe=ROe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:LOe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},zF),PF=x.forwardRef(function(t,n){var r,i=Sr(t.categoricalChartProps,$Oe),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,categoricalChartProps:f}=t,p={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,eventEmitter:void 0};return x.createElement(sOe,{preloadedState:{options:p},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},x.createElement(VNe,{chartData:f.data}),x.createElement(lOe,{layout:i.layout,margin:i.margin}),x.createElement(dOe,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(cOe,{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(POe,gN({},i,{ref:n})))}),BOe=["axis","item"],UOe=x.forwardRef((e,t)=>x.createElement(PF,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:BOe,tooltipPayloadSearcher:b8,categoricalChartProps:e,ref:t})),qOe=["axis"],yN=x.forwardRef((e,t)=>x.createElement(PF,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:qOe,tooltipPayloadSearcher:b8,categoricalChartProps:e,ref:t}));const Uu={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},Ao={fill:"#71717a",fontSize:11},FOe="#27272a",od="#27272a",qu=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function RF(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function vN(e){return RF(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function xN(e){const t=RF(e);return`${t.getMonth()+1}/${t.getDate()}`}function EA(e){switch(e){case Vf.connected:return"positive";case Vf.paused:return"caution";case Vf.error:return"negative";case Vf.archived:return"neutral"}}function HOe(e){const t={};return e.kind&&e.kind!=="all"&&(t.kind=e.kind),e.sourceId&&(t.sourceId=e.sourceId),e.sinceMinutes!==void 0&&(t.since=new Date(Date.now()-e.sinceMinutes*6e4).toISOString()),e.limit!==void 0&&(t.limit=e.limit),t}function KOe(e){return yr({queryKey:e?Pe.serverTraffic.sources(e):["server-traffic","disabled"],queryFn:()=>KV(e),enabled:!!e,staleTime:ys})}function GOe(e){return yr({queryKey:e?Pe.serverTraffic.status(e):["server-traffic","status-disabled"],queryFn:()=>GV(e),enabled:!!e,staleTime:ys})}function VOe(e,t){return yr({queryKey:e&&t?Pe.serverTraffic.sourceDetail(e,t):["server-traffic","detail-disabled"],queryFn:()=>k5(e,t),enabled:!!(e&&t),staleTime:ys})}function QOe(e,t){return yr({queryKey:e?Pe.serverTraffic.events(e,t):["server-traffic","events-disabled"],queryFn:()=>VV(e,HOe(t)),enabled:!!e,staleTime:ys})}function YOe(e){const t=Ir();return cc({mutationFn:n=>{if(!e)throw new Error("Project is required to connect a Cloud Run source");return QV(e,n)},onSuccess:()=>{e&&t.invalidateQueries({queryKey:Pe.serverTraffic.project(e)})}})}function ZOe(e,t){const n=Ir();return cc({mutationFn:r=>{if(!e||!t)throw new Error("Project and sourceId are required to sync");return YV(e,t,r??void 0)},onSuccess:()=>{e&&(n.invalidateQueries({queryKey:Pe.serverTraffic.project(e)}),n.invalidateQueries({queryKey:Pe.runs.all}))}})}const WOe=6,ld="__other__",Fu="_socialTotal";function XOe(e,t=WOe){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)),o=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,[Fu]:0},u.set(p.date,m));const y=a.has(p.source)?p.source:ld;m[y]=(m[y]??0)+p.sessions,m[Fu]=(m[Fu]??0)+p.sessions}const d=[...u.values()].sort((p,m)=>String(p.date).localeCompare(String(m.date))),f=i.map(([p])=>p);return o>0&&f.push(ld),{data:d,sources:f,otherCount:o}}function Hu(e){return e.replace(/\+/g," ")}function DF(e,t=30){return e.length<=t?e:e.slice(0,Math.max(1,t-1))+"…"}const JOe=["7d","30d","90d","all"],wo=qu,bN="#71717a",MF="#52525b",Kf=25;function mg(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function IF(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 eEe({projectName:e}){const{data:t,isLoading:n,isError:r}=GOe(e);if(n)return l.jsx(ze,{className:"p-5",children:l.jsx("div",{className:"text-sm text-zinc-500",children:"Loading server activity…"})});if(r)return l.jsx(ze,{className:"p-5",children:l.jsx("div",{className:"text-sm text-rose-400",children:"Failed to load server activity."})});const i=t?.sources??[];return l.jsxs("section",{children:[l.jsx("div",{className:"flex items-baseline justify-between mb-3",children:l.jsxs("div",{children:[l.jsx("div",{className:"eyebrow",children:"Server activity (last 24h)"}),l.jsx("h2",{className:"text-lg font-semibold text-zinc-50",children:"Engine crawler & AI-referral hits"}),l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Server-side log evidence of bots crawling the site and AI-referral arrivals — orthogonal to GA4 click-through traffic below. "," ",l.jsx(At,{to:"/traffic",className:"text-blue-400 hover:underline",children:"Manage sources →"})]})]})}),i.length===0?l.jsx(ze,{className:"p-5",children:l.jsxs("div",{className:"text-sm text-zinc-400",children:["No server traffic source connected yet."," ",l.jsx(At,{to:"/traffic",className:"text-blue-400 hover:underline",children:"Connect a Cloud Run source"})," ","to surface bot crawls and AI referrals straight from server logs."]})}):l.jsx(ze,{className:"overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{className:"bg-zinc-900/50 text-[10px] uppercase tracking-wide text-zinc-500",children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Source"}),l.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Status"}),l.jsx("th",{className:"text-right px-4 py-2 font-medium",children:"Crawler hits 24h"}),l.jsx("th",{className:"text-right px-4 py-2 font-medium",children:"AI-referral 24h"}),l.jsx("th",{className:"text-right px-4 py-2 font-medium",children:"Last sync"}),l.jsx("th",{className:"text-left px-4 py-2 font-medium","aria-label":"open"})]})}),l.jsx("tbody",{children:i.map(a=>l.jsxs("tr",{className:"border-t border-zinc-800/60",children:[l.jsx("td",{className:"px-4 py-3 text-zinc-100",children:a.displayName}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(pt,{tone:EA(a.status),children:a.status})}),l.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-100",children:a.totals24h.crawlerHits.toLocaleString("en-US")}),l.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-100",children:a.totals24h.aiReferralHits.toLocaleString("en-US")}),l.jsx("td",{className:"px-4 py-3 text-right text-zinc-400 text-xs",children:a.lastSyncedAt?IF(a.lastSyncedAt):"never"}),l.jsx("td",{className:"px-4 py-3 text-right",children:l.jsx(At,{to:"/traffic/$projectName/$sourceId",params:{projectName:e,sourceId:a.id},className:"text-blue-400 hover:underline text-xs",children:"Detail →"})})]},a.id))})]})})]})}function tEe({projectName:e}){return l.jsxs("div",{className:"space-y-10",children:[l.jsx(eEe,{projectName:e}),l.jsx(nEe,{projectName:e})]})}function nEe({projectName:e}){const t=Ir(),[n,r]=x.useState(null),[i,a]=x.useState(null),[o,u]=x.useState(!0),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[y,v]=x.useState(null),[w,b]=x.useState(null),[j,k]=x.useState("sessions"),[E,C]=x.useState("desc"),[O,_]=x.useState("sessions"),[A,z]=x.useState("desc"),[R,$]=x.useState("sessions"),[F,U]=x.useState("desc"),[B,V]=x.useState("sessions"),[X,W]=x.useState("desc"),[H,J]=x.useState([]),[ce,xe]=x.useState([]),[M,I]=x.useState([]),[q,D]=x.useState(!1),[G,oe]=x.useState("30d");async function ne(Se){u(!0),v(null);try{const tt=await t.fetchQuery({queryKey:Pe.traffic.status(e),queryFn:()=>LV(e),staleTime:ys});if(Se.current)return;if(r(tt),!tt.connected){a(null),J([]),xe([]),I([]),u(!1);return}const[Je,rt,ri,xi]=await Promise.all([t.fetchQuery({queryKey:Pe.traffic.summary(e,G),queryFn:()=>$V(e,void 0,G),staleTime:ys}),t.fetchQuery({queryKey:Pe.traffic.aiHistory(e,G),queryFn:()=>UV(e,G).catch(()=>[]),staleTime:ys}),t.fetchQuery({queryKey:Pe.traffic.sessionHistory(e,G),queryFn:()=>FV(e,G).catch(()=>[]),staleTime:ys}),t.fetchQuery({queryKey:Pe.traffic.socialHistory(e,G),queryFn:()=>qV(e,G).catch(()=>[]),staleTime:ys})]);if(Se.current)return;a(Je),J(rt),xe(ri),I(xi),u(!1)}catch(tt){if(Se.current)return;v(tt instanceof Error?tt.message:"Failed to load GA4 data"),u(!1)}}x.useEffect(()=>{const Se={current:!1};return ne(Se),()=>{Se.current=!0}},[e,G,t]);async function Ae(){f(!0),v(null),b(null);try{const Se=await N5(e);b(`Synced ${Se.rowCount.toLocaleString()} page rows, ${Se.aiReferralCount.toLocaleString()} AI and ${Se.socialReferralCount.toLocaleString()} social referral rows (${Se.days} days)`),await t.invalidateQueries({queryKey:Pe.traffic.project(e)}),await ne({current:!1})}catch(Se){v(Se instanceof Error?Se.message:"Sync failed")}finally{f(!1)}}async function we(){m(!0),v(null),b(null);try{await HV(e),await t.invalidateQueries({queryKey:Pe.traffic.project(e)}),r({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),a(null),b("GA4 disconnected")}catch(Se){v(Se instanceof Error?Se.message:"Disconnect failed")}finally{m(!1)}}function ee(Se){j===Se?C(tt=>tt==="desc"?"asc":"desc"):(k(Se),C("desc"))}function he(Se){O===Se?z(tt=>tt==="desc"?"asc":"desc"):(_(Se),z("desc"))}function _e(Se){R===Se?U(tt=>tt==="desc"?"asc":"desc"):($(Se),U("desc"))}function Z(Se){B===Se?W(tt=>tt==="desc"?"asc":"desc"):(V(Se),W("desc"))}const Fe=x.useMemo(()=>i?.topPages?[...i.topPages].sort((Se,tt)=>{const Je=Se[j],rt=tt[j];return typeof Je=="string"&&typeof rt=="string"?E==="asc"?Je.localeCompare(rt):rt.localeCompare(Je):E==="asc"?Je-rt:rt-Je}):[],[i?.topPages,j,E]),Re=x.useMemo(()=>i?.aiReferrals?[...i.aiReferrals].sort((Se,tt)=>{const Je=Se[O],rt=tt[O];return typeof Je=="string"&&typeof rt=="string"?A==="asc"?Je.localeCompare(rt):rt.localeCompare(Je):A==="asc"?Je-rt:rt-Je}):[],[i?.aiReferrals,O,A]),st=x.useMemo(()=>i?.aiReferralLandingPages?[...i.aiReferralLandingPages].sort((Se,tt)=>{const Je=Se[B],rt=tt[B];return typeof Je=="string"&&typeof rt=="string"?X==="asc"?Je.localeCompare(rt):rt.localeCompare(Je):X==="asc"?Je-rt:rt-Je}):[],[i?.aiReferralLandingPages,B,X]),Ke=x.useMemo(()=>i?.socialReferrals?[...i.socialReferrals].sort((Se,tt)=>{const Je=Se[R],rt=tt[R];return typeof Je=="string"&&typeof rt=="string"?F==="asc"?Je.localeCompare(rt):rt.localeCompare(Je):F==="asc"?Je-rt:rt-Je}):[],[i?.socialReferrals,R,F]),{socialChartData:Kt,socialChartSources:Bt,socialOtherCount:on}=x.useMemo(()=>{const Se=XOe(M);return{socialChartData:Se.data,socialChartSources:Se.sources,socialOtherCount:Se.otherCount}},[M]),{chartData:en,chartSources:be,dateRange:Ze}=x.useMemo(()=>{const Se=[...new Set(H.map(Yt=>Yt.source))],tt=new Map;for(const Yt of ce)tt.set(Yt.date,{_totalSessions:Yt.sessions,_organicSessions:Yt.organicSessions});const Je=new Map;for(const Yt of H){const bi=`${Yt.date}::${Yt.source}`,xa=Je.get(bi)??0;Je.set(bi,Math.max(xa,Yt.sessions))}for(const[Yt,bi]of Je){const[xa,Yo]=Yt.split("::");let ba=tt.get(xa);ba||(ba={_totalSessions:0,_organicSessions:0},tt.set(xa,ba)),ba[Yo]=(ba[Yo]??0)+bi}const rt=[...tt.entries()].sort(([Yt],[bi])=>Yt.localeCompare(bi)).map(([Yt,bi])=>({date:Yt,...bi})),ri=rt.map(Yt=>Yt.date),xi=ri.length>0?{start:ri[0],end:ri[ri.length-1]}:null;return{chartData:rt,chartSources:Se,dateRange:xi}},[H,ce]);if(o&&!n)return l.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!n?.connected)return l.jsx(rEe,{projectName:e,onConnected:()=>{(async()=>(await t.invalidateQueries({queryKey:Pe.traffic.project(e)}),await ne({current:!1})))()}});const Dt=i?.organicSharePctDisplay??"0%",yt=i?.channelBreakdown?.organic.sharePctDisplay??Dt,We=i?.channelBreakdown?.organic.sessions??i?.totalOrganicSessions??0,ue=i?.aiSessionsDeduped??0,je=i?.channelBreakdown?.ai.sessions??i?.aiSessionsBySession??0,Ie=i?.channelBreakdown?.ai.sharePctDisplay??i?.aiSharePctBySessionDisplay??"0%",Ve=i?new Set(i.aiReferrals.map(Se=>Se.source.toLowerCase())).size:0,ct=Re[0]??null,fn=i?.totalDirectSessions??0,Vn=i?.directSharePctDisplay??"0%",xn=i?.channelBreakdown?.direct.sessions??fn,Qe=i?.channelBreakdown?.direct.sharePctDisplay??Vn,kn=i?.channelBreakdown?.other.sessions??i?.otherSessions??0,Xe=i?.channelBreakdown?.other.sharePctDisplay??i?.otherSharePctDisplay??"0%",ot=i?.socialSessions??0,ke=i?.socialSharePctDisplay??"0%",kr=i?.channelBreakdown?.social.sessions??ot,vi=i?.channelBreakdown?.social.sharePctDisplay??ke,va=i?new Set(i.socialReferrals.map(Se=>Se.source.toLowerCase())).size:0,Cr=Ke[0]??null;return l.jsxs(l.Fragment,{children:[y&&l.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:y}),w&&l.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:w}),l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),l.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",l.jsx("span",{className:"text-zinc-300",children:n.propertyId}),n.clientEmail&&l.jsxs(l.Fragment,{children:[" · ",l.jsx("span",{className:"text-zinc-500",children:n.clientEmail})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(me,{variant:"outline",size:"sm",disabled:d,onClick:Ae,children:[l.jsx(Yg,{className:`w-3.5 h-3.5 mr-1.5 ${d?"animate-spin":""}`}),d?"Syncing…":"Sync"]}),l.jsxs(me,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:p,onClick:we,children:[l.jsx(xY,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4 flex items-start justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",l.jsx(lr,{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.`})]})]}),l.jsx("div",{className:"flex gap-1",children:JOe.map(Se=>l.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${G===Se?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>oe(Se),children:Se==="all"?"All":Se},Se))})]}),i?l.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[l.jsx(bj,{value:mg(i.totalSessions),label:"Total Sessions",subtitle:i.totalSessions.toLocaleString(),tone:"neutral"}),l.jsx(bj,{value:mg(i.totalOrganicSessions),label:"Organic Sessions",subtitle:`${Dt} of total`,tone:"positive"}),l.jsx(bj,{value:mg(i.totalUsers),label:"Total Users",subtitle:i.totalUsers.toLocaleString(),tone:"neutral"})]}):l.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[l.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),l.jsxs(me,{variant:"outline",size:"sm",disabled:d,onClick:Ae,children:[l.jsx(Yg,{className:`w-3.5 h-3.5 mr-1.5 ${d?"animate-spin":""}`}),"Sync from GA4"]})]})]}),i&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Attribution"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Traffic by channel",l.jsx(lr,{text:"Decomposes GA4 sessions into five disjoint channels — known AI referrers first, then organic search, social, direct, and other channels. Known AI referrers are removed from their native GA4 channel before the residual Other bucket is computed. Other channels are the remaining GA4 session default channel groups, such as Referral, Email, Paid Search, Display, Cross-network, Shopping, Video, Affiliates, SMS, and Paid Other."})]})]}),Ze&&l.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"})]})]}),en.length>0&&l.jsxs(ze,{className:"surface-card p-5 mb-4",children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:be.length>0?"AI vs. total sessions":"All sessions (baseline)"}),be.length===0&&l.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),be.length===0&&l.jsx("p",{className:"text-xs text-zinc-500",children:"No AI referrals detected yet"})]}),l.jsx("div",{className:"h-64",children:l.jsx(Oy,{width:"100%",height:"100%",children:l.jsxs(yN,{data:en,margin:{top:4,right:4,bottom:0,left:0},children:[l.jsx(Ih,{dataKey:"date",tick:Ao,tickLine:!1,axisLine:{stroke:od},tickFormatter:xN}),l.jsx(Lh,{tick:Ao,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),l.jsx(ev,{...Uu,labelFormatter:vN,formatter:(Se,tt)=>{const Je=typeof Se=="number"?Se.toLocaleString():String(Se??0),rt=String(tt??"");return rt==="_totalSessions"?[Je,"Total Sessions"]:rt==="_organicSessions"?[Je,"Organic Sessions"]:[Je,rt]}}),l.jsx(wC,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:Se=>Se==="_totalSessions"?"Total Sessions":Se==="_organicSessions"?"Organic Sessions":Se}),l.jsx(_u,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),be.map((Se,tt)=>l.jsx(_u,{type:"monotone",dataKey:Se,stackId:"ai",stroke:wo[tt%wo.length],fill:wo[tt%wo.length],fillOpacity:.4,strokeWidth:1.5},Se))]})})})]}),l.jsxs(ze,{className:"surface-card p-5 mb-4",children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Channel breakdown"})]}),l.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-5",children:[l.jsx(ra,{label:"Organic",value:yt,hint:`${We.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions from Google organic search (sessionDefaultChannelGrouping = 'Organic Search'), after known AI referrers are removed for a disjoint channel breakdown."}),l.jsx(ra,{label:"Social",value:vi,hint:`${kr.toLocaleString()} sessions`,tone:"neutral",tooltip:"Sessions from social platforms (sessionDefaultChannelGrouping = 'Organic Social' or 'Paid Social'), after known AI referrers are removed for a disjoint channel breakdown."}),l.jsx(ra,{label:"Direct",value:Qe,hint:`${xn.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. Known AI referrers are removed if GA4 classified them as Direct."}),l.jsx(ra,{label:"Known AI referrers (lower bound)",value:Ie,hint:`${je.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions whose current sessionSource matched a known AI engine (e.g. chatgpt.com, claude.ai, gemini.google.com). These sessions are removed from their native GA4 channel in this card grid so the five buckets stay disjoint. 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."}),l.jsx(ra,{label:"Other channels",value:Xe,hint:`${kn.toLocaleString()} sessions`,tone:"neutral",tooltip:"Remaining GA4 session default channel groups after Known AI, Organic Search, Organic/Paid Social, and Direct are accounted for. This is a residual bucket, not a single source. It can include Referral, Email, Paid Search, Display, Cross-network, Shopping, Video, Affiliates, SMS, Mobile Push Notifications, Paid Other, and unclassified traffic."})]}),ct&&l.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: ",l.jsx("span",{className:"font-medium",children:ct.source})," via ",ct.medium,", accounting for ",ct.sessions.toLocaleString()," sessions."]})]}),l.jsxs(ze,{className:"surface-card p-5 mb-4",children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Detail"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Known AI referrers — sources detected"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:i.aiReferrals.length>0?`${Ve} unique sources, ${i.aiReferrals.length} rows`:"No source rows"})]}),i.aiReferrals.length>0?l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx(dr,{label:"Source",sortKey:"source",current:O,dir:A,onSort:he,align:"left"}),l.jsx(dr,{label:"Medium",sortKey:"medium",current:O,dir:A,onSort:he,align:"left"}),l.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),l.jsx(dr,{label:"Sessions",sortKey:"sessions",current:O,dir:A,onSort:he,align:"right"}),l.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),l.jsx(dr,{label:"Users",sortKey:"users",current:O,dir:A,onSort:he,align:"right"})]})}),l.jsx("tbody",{children:Re.map(Se=>l.jsx(aEe,{referral:Se,totalSessions:ue},`${Se.source}:${Se.medium}:${Se.sourceDimension}`))})]})}):l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[l.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI referrer sessions detected yet"}),l.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."})]})]}),l.jsxs(ze,{className:"surface-card p-5",children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Detail"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Known AI referrers — landing pages"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:st.length>0?`${st.length} rows`:"No landing-page rows"})]}),st.length>0?l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx(dr,{label:"Landing Page",sortKey:"landingPage",current:B,dir:X,onSort:Z,align:"left"}),l.jsx(dr,{label:"Source",sortKey:"source",current:B,dir:X,onSort:Z,align:"left"}),l.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),l.jsx(dr,{label:"Sessions",sortKey:"sessions",current:B,dir:X,onSort:Z,align:"right"}),l.jsx(dr,{label:"Users",sortKey:"users",current:B,dir:X,onSort:Z,align:"right"})]})}),l.jsx("tbody",{children:st.map(Se=>l.jsx(sEe,{row:Se},`${Se.landingPage}:${Se.source}:${Se.medium}:${Se.sourceDimension}`))})]})}):l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[l.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI landing pages detected yet"}),l.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&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Social Attribution"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Social Media Traffic",l.jsx(lr,{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."})]})]}),Kt.length>0&&l.jsxs(ze,{className:"surface-card p-5 mb-4",children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social sessions over time"})]}),on>0&&l.jsxs("p",{className:"text-xs text-zinc-500",children:["Showing top ",Bt.length-1," sources · ",on," more grouped as Other"]})]}),l.jsx("div",{className:"h-64",children:l.jsx(Oy,{width:"100%",height:"100%",children:l.jsxs(yN,{data:Kt,margin:{top:4,right:4,bottom:0,left:0},children:[l.jsx(Ih,{dataKey:"date",tick:Ao,tickLine:!1,axisLine:{stroke:od},tickFormatter:xN}),l.jsx(Lh,{tick:Ao,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),l.jsx(ev,{...Uu,labelFormatter:vN,formatter:(Se,tt)=>{const Je=typeof Se=="number"?Se.toLocaleString():String(Se??0),rt=String(tt??"");if(rt===Fu)return[Je,"Total Social"];if(rt===ld){const ri=`Other (${on} source${on===1?"":"s"})`;return[Je,ri]}return[Je,Hu(rt)]}}),l.jsx(_u,{type:"monotone",dataKey:Fu,stroke:MF,fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Bt.map((Se,tt)=>{const rt=Se===ld?bN:wo[tt%wo.length];return l.jsx(_u,{type:"monotone",dataKey:Se,stackId:"social",stroke:rt,fill:rt,fillOpacity:.4,strokeWidth:1.5},Se)})]})})}),l.jsx(lEe,{sources:Bt,otherCount:on})]}),l.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[l.jsxs(ze,{className:"surface-card p-5",children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social media visits"})]}),i.socialReferrals.length>0?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[l.jsx(ra,{label:"Social Sessions",value:mg(ot),hint:`${ot.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions classified as Organic Social or Paid Social by GA4's default channel grouping."}),l.jsx(ra,{label:"Share of Traffic",value:ke,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from social media platforms."}),l.jsx(ra,{label:"Platforms",value:String(va),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."})]}),Cr&&l.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:[l.jsx("p",{className:"text-xs uppercase tracking-wider text-sky-300/70 mb-1",children:"Top social source"}),l.jsx("p",{className:"font-medium truncate",title:`${Cr.source} via ${Cr.medium}`,children:DF(Hu(Cr.source),64)}),l.jsxs("p",{className:"text-xs text-sky-200/70 mt-0.5 truncate",title:Cr.medium,children:["via ",Hu(Cr.medium)," · ",Cr.sessions.toLocaleString()," sessions"]})]})]}):l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[l.jsx(ra,{label:"Social Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to social media platforms."}),l.jsx(ra,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions from social media."}),l.jsx(ra,{label:"Platforms",value:"0",hint:"known platforms",tone:"neutral",tooltip:"Number of distinct social media platforms detected."})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3 text-sm text-zinc-400",children:[l.jsx("p",{className:"mb-1.5 text-zinc-300",children:"Monitoring social media traffic via GA4 channel grouping"}),l.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."})]})]})]}),l.jsxs(ze,{className:"surface-card p-5",children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Breakdown"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Source / medium"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:i.socialReferrals.length>0?Ke.length>Kf&&!q?`Top ${Kf} of ${Ke.length}`:`${Ke.length} rows`:"No source rows"})]}),i.socialReferrals.length>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm table-fixed",children:[l.jsxs("colgroup",{children:[l.jsx("col",{className:"w-[32%]"}),l.jsx("col",{className:"w-[22%]"}),l.jsx("col",{className:"w-[12%]"}),l.jsx("col",{className:"w-[11%]"}),l.jsx("col",{className:"w-[11%]"}),l.jsx("col",{className:"w-[12%]"})]}),l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx(dr,{label:"Source",sortKey:"source",current:R,dir:F,onSort:_e,align:"left"}),l.jsx(dr,{label:"Medium",sortKey:"medium",current:R,dir:F,onSort:_e,align:"left"}),l.jsx("th",{className:"py-1 font-medium text-left",children:"Channel"}),l.jsx(dr,{label:"Sessions",sortKey:"sessions",current:R,dir:F,onSort:_e,align:"right"}),l.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),l.jsx(dr,{label:"Users",sortKey:"users",current:R,dir:F,onSort:_e,align:"right"})]})}),l.jsx("tbody",{children:(q?Ke:Ke.slice(0,Kf)).map(Se=>l.jsx(oEe,{referral:Se,totalSessions:ot},`${Se.source}:${Se.medium}:${Se.channelGroup}`))})]})}),Ke.length>Kf&&l.jsx("div",{className:"mt-3 flex justify-center",children:l.jsx("button",{type:"button",onClick:()=>D(Se=>!Se),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 ${Kf}`:`Show all ${Ke.length} sources`})})]}):l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[l.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No social media sessions detected yet"}),l.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&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",l.jsx(lr,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx(dr,{label:"Landing Page",sortKey:"landingPage",current:j,dir:E,onSort:ee,align:"left"}),l.jsx(dr,{label:"Sessions",sortKey:"sessions",current:j,dir:E,onSort:ee,align:"right"}),l.jsx(dr,{label:"Organic",sortKey:"organicSessions",current:j,dir:E,onSort:ee,align:"right"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),l.jsx(dr,{label:"Users",sortKey:"users",current:j,dir:E,onSort:ee,align:"right"})]})}),l.jsx("tbody",{children:Fe.map(Se=>l.jsx(iEe,{page:Se},Se.landingPage))})]})})]})]}),l.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[l.jsx("span",{children:i?.lastSyncedAt?`Last synced ${IF(i.lastSyncedAt)}`:"Never synced"}),l.jsx("span",{children:i?`${i.topPages.length} pages · ${i.aiReferrals.length} AI rows · ${i.socialReferrals.length} social rows`:""})]})]})}function rEe({projectName:e,onConnected:t}){const[n,r]=x.useState(""),[i,a]=x.useState(null),[o,u]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(null),y=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 w(){if(m(null),!n.trim()){m("Property ID is required.");return}if(!o){m("Please upload a service account key file.");return}f(!0);try{await BV(e,{propertyId:n.trim(),keyJson:o});try{await N5(e)}catch{}t()}catch(b){m(b instanceof Error?b.message:"Failed to connect GA4")}finally{f(!1)}}return l.jsxs(ze,{className:"surface-card p-6",children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-1",children:"Connect Google Analytics 4"}),l.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&&l.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}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{htmlFor:"ga4-property-id",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"GA4 Property ID"}),l.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"}),l.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)."})]}),l.jsxs("div",{className:"mb-5",children:[l.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Service Account Key File"}),l.jsx("input",{ref:y,type:"file",accept:".json,application/json",onChange:v,className:"hidden"}),l.jsxs("button",{type:"button",onClick:()=>y.current?.click(),className:"flex items-center gap-2 w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 border-dashed px-4 py-3 text-sm text-zinc-400 hover:border-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:[l.jsx(wY,{className:"w-4 h-4 shrink-0"}),i?l.jsx("span",{className:"text-zinc-200 truncate",children:i}):l.jsx("span",{children:"Upload .json key file"})]}),l.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 ",l.jsx("span",{className:"text-zinc-400",children:"Viewer"})," access on the GA4 property."]})]}),l.jsx(me,{variant:"default",size:"sm",disabled:d||!n.trim()||!o,onClick:w,children:d?"Connecting & syncing…":"Connect GA4"})]})}function dr({label:e,sortKey:t,current:n,dir:r,onSort:i,align:a}){const o=n===t;return l.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,o&&l.jsx("span",{className:"ml-0.5",children:r==="asc"?"↑":"↓"})]})}const LF={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function bj({value:e,label:t,subtitle:n,tone:r}){return l.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),l.jsx("p",{className:`text-2xl font-bold tabular-nums ${LF[r]}`,children:e}),l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function ra({value:e,label:t,hint:n,tone:r,tooltip:i}){return l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-4 py-3 flex flex-col",children:[l.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1 flex items-center gap-1",children:[t,i&&l.jsx(lr,{text:i})]}),l.jsx("p",{className:`text-xl font-semibold tabular-nums ${LF[r]}`,children:e}),l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function iEe({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),l.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}const $F={session:"Session",first_user:"First Visit",manual_utm:"UTM"},BF={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 aEe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=$F[e.sourceDimension]??e.sourceDimension,i=BF[e.sourceDimension]??"";return l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),l.jsx("td",{className:"py-1.5 text-zinc-500 max-w-[180px] truncate",title:e.medium,children:e.medium}),l.jsx("td",{className:"py-1.5",children:l.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})}),l.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function sEe({row:e}){const t=$F[e.sourceDimension]??e.sourceDimension,n=BF[e.sourceDimension]??"";return l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[360px] truncate",title:e.landingPage,children:e.landingPage}),l.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),l.jsx("td",{className:"py-1.5",children:l.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})}),l.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function oEe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=e.channelGroup==="Paid Social"?"Paid":"Organic",i=Hu(e.source),a=Hu(e.medium);return l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 pr-3 text-zinc-200 truncate",title:e.source,children:i}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-500 truncate",title:e.medium,children:a}),l.jsx("td",{className:"py-1.5 pr-3",children:l.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})}),l.jsx("td",{className:"py-1.5 text-right text-sky-400 tabular-nums",children:e.sessions.toLocaleString()}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function lEe({sources:e,otherCount:t}){const n=[{key:Fu,color:MF,label:"Total",tooltip:"All social sessions across every source."}];for(let r=0;r<e.length;r++){const i=e[r];if(i===ld)n.push({key:ld,color:bN,label:`Other (${t})`,tooltip:`${t} smaller source${t===1?"":"s"} grouped together`});else{const a=Hu(i);n.push({key:i,color:wo[r%wo.length]??bN,label:DF(a,32),tooltip:a})}}return l.jsx("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1.5 text-[11px] text-zinc-400",children:n.map(r=>l.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 max-w-[260px]",title:r.tooltip,children:[l.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-sm shrink-0",style:{backgroundColor:r.color},"aria-hidden":"true"}),l.jsx("span",{className:"truncate",children:r.label})]},r.key))})}function UF(e){e.invalidateQueries({queryKey:Pe.runs.all}),e.invalidateQueries({queryKey:Pe.projects.all})}function cEe(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function uEe(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 B0(e,t){U4({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),bt({title:cEe(e.kind),detail:uEe(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function dEe(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){bt({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)U4({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=ene({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});bt({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 U0(e,t){if(e instanceof vr&&e.code==="RUN_IN_PROGRESS"){bt({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}bt({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function qF(){const e=Ir();return cc({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>YG(t,n),onSuccess:(t,n)=>{UF(e),B0(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{U0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function fEe(){const e=Ir();return cc({meta:{skipGlobalErrorToast:!0},mutationFn:t=>pV(t),onSuccess:t=>{UF(e),dEe(t)},onError:t=>{bt({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function hEe(){const e=Ir();return cc({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>b5(t,n),onSuccess:(t,n)=>{Iv(e,Ot["gsc-sync"],n.projectName),B0(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{U0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function pEe(){const e=Ir();return cc({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>AV(t),onSuccess:(t,n)=>{Iv(e,t.run.kind,n.projectName),B0(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{U0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function mEe(){const e=Ir();return cc({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>kV(t,n),onSuccess:(t,n)=>{Iv(e,Ot["inspect-sitemap"],n.projectName),B0(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{U0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}const gEe=["7d","30d","90d","all"];function yEe({projectName:e}){const t=Ir(),[n,r]=x.useState(!1),[i,a]=x.useState([]),[o,u]=x.useState([]),[d,f]=x.useState([]),[p,m]=x.useState([]),[y,v]=x.useState([]),[w,b]=x.useState(null),[j,k]=x.useState(""),[E,C]=x.useState(""),[O,_]=x.useState("30"),[A,z]=x.useState(!1),[R,$]=x.useState("30d"),[F,U]=x.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[B,V]=x.useState(""),[X,W]=x.useState(!0),[H,J]=x.useState(!1),[ce,xe]=x.useState(!1),[M,I]=x.useState(!1),[q,D]=x.useState(!1),[G,oe]=x.useState(!1),[ne,Ae]=x.useState(!1),[we,ee]=x.useState(null),[he,_e]=x.useState(!1),[Z,Fe]=x.useState(!1),[Re,st]=x.useState(null),[Ke,Kt]=x.useState(""),[Bt,on]=x.useState(!1),[en,be]=x.useState(!1),[Ze,Dt]=x.useState("indexed"),[yt,We]=x.useState(null),ue=x.useMemo(()=>{if(!yt)return d;const{key:Q,dir:Ne}=yt;return[...d].sort((nt,Ct)=>{const Cn=Q===ko.CTR?Number.isFinite(nt.ctr)?nt.ctr:0:nt[Q],wa=Q===ko.CTR?Number.isFinite(Ct.ctr)?Ct.ctr:0:Ct[Q];return Ne==="asc"?Cn-wa:wa-Cn})},[d,yt]),[je,Ie]=x.useState([]),[Ve,ct]=x.useState(null),[fn,Vn]=x.useState(!1),[xn,Qe]=x.useState(null),[kn,Xe]=x.useState(null),ot=i.find(Q=>Q.connectionType==="gsc"),ke=d.length>0||p.length>0||y.length>0,kr=hEe(),vi=pEe(),va=mEe();async function Cr(Q){if(!Q){u([]),k("");return}xe(!0);try{const{sites:Ne}=await t.fetchQuery({queryKey:Pe.gsc.properties(e),queryFn:()=>yV(e),staleTime:mr});u(Ne),k(Q.propertyId??Ne[0]?.siteUrl??"")}catch(Ne){u([]),Qe(Ne instanceof Error?Ne.message:"Failed to load Search Console properties")}finally{xe(!1)}}async function Se(){D(!0);try{const Q={startDate:F.startDate,endDate:F.endDate,query:F.query,page:F.page,limit:F.limit,window:R},Ne=await t.fetchQuery({queryKey:Pe.gsc.performance(e,Q),queryFn:()=>bV(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:R}),staleTime:mr});f(Ne)}catch(Q){f([]),Qe(Q instanceof Error?Q.message:"Failed to load GSC performance data")}finally{D(!1)}}async function tt(){oe(!0);try{const Q=B.trim()||void 0,[Ne,nt]=await Promise.all([t.fetchQuery({queryKey:Pe.gsc.inspections(e,Q),queryFn:()=>SV(e,{url:Q,limit:20}),staleTime:mr}),t.fetchQuery({queryKey:Pe.gsc.deindexed(e),queryFn:()=>jV(e),staleTime:mr})]);m(Ne),v(nt)}catch(Q){m([]),v([]),Qe(Q instanceof Error?Q.message:"Failed to load GSC inspection history")}finally{oe(!1)}}async function Je(){_e(!0);try{const[Q,Ne]=await Promise.all([t.fetchQuery({queryKey:Pe.gsc.coverage(e),queryFn:()=>qN(e),staleTime:mr}),t.fetchQuery({queryKey:Pe.gsc.coverageHistory(e),queryFn:()=>NV(e).catch(()=>[]),staleTime:mr})]);ee(Q),Ie(Ne)}catch(Q){ee(null),Ie([]),Qe(Q instanceof Error?Q.message:"Failed to load coverage data")}finally{_e(!1)}}async function rt(Q){Vn(!0),Qe(null);try{const Ne=await y2(e,{urls:Q}),{succeeded:nt,failed:Ct,total:Cn}=Ne.summary;bt({title:"Indexing requested",detail:Ct===0?`${nt} URL${nt!==1?"s":""} submitted for indexing.`:`${nt}/${Cn} submitted successfully, ${Ct} failed.`,tone:Ct===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(Ne){Qe(Ne instanceof Error?Ne.message:"Failed to request indexing")}finally{Vn(!1)}}async function ri(){Vn(!0),Qe(null);try{const Q=await y2(e,{urls:[],allUnindexed:!0}),{succeeded:Ne,failed:nt,total:Ct}=Q.summary;bt({title:"Indexing requested",detail:nt===0?`${Ne} unindexed URL${Ne!==1?"s":""} submitted for indexing.`:`${Ne}/${Ct} submitted successfully, ${nt} failed.`,tone:nt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(Q){Qe(Q instanceof Error?Q.message:"Failed to request indexing")}finally{Vn(!1)}}async function xi(){if(Ke.trim()){on(!0),Qe(null);try{await xV(e,"gsc",Ke.trim()),await t.invalidateQueries({queryKey:Pe.gsc.project(e)}),a(Q=>Q.map(Ne=>Ne.connectionType==="gsc"?{...Ne,sitemapUrl:Ke.trim()}:Ne)),bt({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),Kt("")}catch(Q){Qe(Q instanceof Error?Q.message:"Failed to save sitemap URL")}finally{on(!1)}}}async function Yt(){Qe(null);try{const Q=await vi.mutateAsync({projectName:e,projectLabel:e});st(Q.sitemaps),a(Ne=>Ne.map(nt=>nt.connectionType==="gsc"?{...nt,sitemapUrl:Q.primarySitemapUrl}:nt))}catch{}}async function bi(){Fe(!0),Qe(null);try{const Q=await CV(e);t.setQueryData(Pe.gsc.sitemaps(e),Q),st(Q.sitemaps),Q.sitemaps.length===0&&Xe("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(Q){Qe(Q instanceof Error?Q.message:"Failed to list sitemaps")}finally{Fe(!1)}}async function xa(){W(!0),Qe(null);try{const[Q,Ne]=await Promise.all([UN().catch(()=>null),t.fetchQuery({queryKey:Pe.gsc.connections(e),queryFn:()=>x5(e).catch(()=>[]),staleTime:mr})]);r(!!Q?.google?.configured),a(Ne);const nt=Ne.find(Ct=>Ct.connectionType==="gsc");await Promise.all([Cr(nt),Se(),tt(),Je()])}finally{W(!1)}}x.useEffect(()=>{xa()},[e]),x.useEffect(()=>{Se()},[R]);async function Yo(){if(!n){Qe("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}J(!0),Qe(null),Xe(null);try{const{authUrl:Q}=await mV(e,"gsc");if(!Q.startsWith("https://accounts.google.com/")){Qe("Unexpected OAuth redirect URL. Please try again.");return}const Ne=window.open(Q,"_blank","width=600,height=700");if(!Ne){window.location.assign(Q);return}Xe("Finish the Google consent flow in the popup, then close it to refresh this project.");const nt=window.setInterval(()=>{Ne.closed&&(window.clearInterval(nt),Xe(null),t.invalidateQueries({queryKey:Pe.gsc.project(e)}),xa())},1e3)}catch(Q){Qe(Q instanceof Error?Q.message:"Failed to start OAuth flow")}finally{J(!1)}}async function ba(){Qe(null),Xe(null);try{await gV(e,"gsc"),await t.invalidateQueries({queryKey:Pe.gsc.project(e)}),a(Q=>Q.filter(Ne=>Ne.connectionType!=="gsc")),u([]),k("")}catch(Q){Qe(Q instanceof Error?Q.message:"Failed to disconnect")}}async function Ed(){if(j){I(!0),Qe(null);try{await vV(e,"gsc",j),await t.invalidateQueries({queryKey:Pe.gsc.project(e)}),a(Q=>Q.map(Ne=>Ne.connectionType==="gsc"?{...Ne,propertyId:j}:Ne)),bt({title:"GSC property updated",detail:`${e} is now linked to ${j}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(Q){Qe(Q instanceof Error?Q.message:"Failed to save GSC property")}finally{I(!1)}}}async function _d(){Qe(null),Xe(null);try{await kr.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(O,10)||void 0,full:A||void 0}}),await t.invalidateQueries({queryKey:Pe.gsc.project(e)})}catch{}}async function zd(){if(E.trim()){Ae(!0),Qe(null),Xe(null);try{const Q=await wV(e,E.trim());await t.invalidateQueries({queryKey:Pe.gsc.project(e)}),b(Q),C(""),await tt()}catch(Q){Qe(Q instanceof Error?Q.message:"Failed to inspect URL")}finally{Ae(!1)}}}return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),l.jsx("h2",{children:"Google Search Console"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex gap-1",children:gEe.map(Q=>l.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${R===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))}),ot&&l.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:q,onClick:()=>{Se()},children:q?"Refreshing…":"Refresh data"})]})]}),xn&&l.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:[xn,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>Qe(null),children:"×"})]}),kn&&l.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:[kn,l.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>Xe(null),children:"×"})]}),X?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):l.jsxs("div",{className:"space-y-3",children:[l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),l.jsx("h3",{children:"Domain authorization"})]}),l.jsx(pt,{tone:ot?"positive":n?"caution":"negative",children:ot?"Connected":n?"Ready to connect":"App credentials missing"})]}),ot?l.jsxs("div",{className:"mt-3 space-y-3",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),l.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),l.jsx("span",{className:"text-xs text-zinc-500",children:ot.domain}),l.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:ba,children:"Disconnect"})]}),l.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",l.jsx("code",{children:ot.domain}),"."]})]}),l.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ot.propertyId??"No property selected yet"})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:sa(ot.updatedAt)})]})]})]}):l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[l.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."}),l.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[n?l.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:H,onClick:Yo,children:H?"Opening…":"Connect Google Search Console"}):l.jsx(me,{type:"button",variant:"outline",size:"sm",asChild:!0,children:l.jsx(At,{to:"/settings",children:"Open Settings"})}),!n&&l.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),ot&&!ot.sitemapUrl&&l.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("span",{className:"mt-0.5 text-amber-400",children:l.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:l.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"})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),l.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."}),l.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx(me,{type:"button",size:"sm",disabled:vi.isPending||!ot.propertyId,onClick:Yt,children:vi.isPending?"Discovering…":"Auto-discover from GSC"}),l.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.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:Ke,onChange:Q=>Kt(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&void xi()}),l.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:Bt||!Ke.trim(),onClick:xi,children:Bt?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ot||ke)&&l.jsxs(l.Fragment,{children:[l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),l.jsx("h3",{children:"Index coverage"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[we&&we.notIndexed.length>0&&l.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:fn,onClick:()=>{ri()},children:fn?"Requesting…":`Request indexing (${we.notIndexed.length})`}),l.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:he,onClick:()=>{Je()},children:he?"Loading…":"Refresh coverage"})]})]}),we&&we.summary.total>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const Q=we.summary.indexed+we.summary.notIndexed,Ne=Q>0?we.summary.indexed/Q:0,nt=Q>0?we.summary.notIndexed/Q:0,Ct=54,Cn=2*Math.PI*Ct,wa=Cn*(1-Ne),Qa=Cn*nt,$s=Cn*Ne;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"relative h-48 w-48",children:[l.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[l.jsx("circle",{cx:"64",cy:"64",r:Ct,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),l.jsx("circle",{cx:"64",cy:"64",r:Ct,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:Cn,strokeDashoffset:wa,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),we.summary.notIndexed>0&&l.jsx("circle",{cx:"64",cy:"64",r:Ct,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Qa} ${Cn-Qa}`,strokeDashoffset:-$s,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),l.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[l.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(Ne*100).toFixed(0),"%"]}),l.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),l.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:we.summary.indexed.toLocaleString()}),l.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),l.jsx("div",{className:"h-8 w-px bg-zinc-800"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:we.summary.notIndexed.toLocaleString()}),l.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(we.reasonGroups??[]).length>0&&l.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(we.reasonGroups??[]).length," ",(we.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),we.summary.deindexed>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"h-8 w-px bg-zinc-800"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:we.summary.deindexed.toLocaleString()}),l.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),l.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(Q=>{const Ne=Q==="indexed"?we.indexed.length:Q==="notIndexed"?we.notIndexed.length:we.deindexed.length,nt=Q==="indexed"?"Indexed":Q==="notIndexed"?"Not Indexed":"Deindexed";return l.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:()=>{Dt(Q),ct(null)},children:[nt," (",Ne,")"]},Q)})}),l.jsxs("div",{className:"mt-3 overflow-x-auto",children:[Ze==="indexed"&&we.indexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Verdict"}),l.jsx("th",{className:"text-left",children:"Last Crawl"}),l.jsx("th",{className:"text-left",children:"Mobile"})]})}),l.jsx("tbody",{children:we.indexed.map(Q=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),l.jsx("td",{className:"text-zinc-400",children:Q.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Q.crawlTime?Q.crawlTime.split("T")[0]:"—"}),l.jsx("td",{className:"text-zinc-400",children:Q.isMobileFriendly===!0?"Yes":Q.isMobileFriendly===!1?"No":"—"})]},Q.id))})]}),Ze==="notIndexed"&&!Ve&&(we.reasonGroups??[]).length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"Reason"}),l.jsx("th",{className:"text-right",children:"Pages"})]})}),l.jsx("tbody",{children:(we.reasonGroups??[]).map(Q=>l.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>ct(Q.reason),children:[l.jsx("td",{className:"text-zinc-200",children:Q.reason}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.count})]},Q.reason))})]}),Ze==="notIndexed"&&!Ve&&(we.reasonGroups??[]).length===0&&we.notIndexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Indexing State"}),l.jsx("th",{className:"text-left",children:"Coverage"})]})}),l.jsx("tbody",{children:we.notIndexed.map(Q=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),l.jsx("td",{className:"text-zinc-400",children:Q.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Q.coverageState??"Unknown"})]},Q.id))})]}),Ze==="notIndexed"&&Ve&&(()=>{const Q=(we.reasonGroups??[]).find(Ne=>Ne.reason===Ve);return Q?l.jsxs("div",{children:[l.jsx("div",{className:"flex items-center gap-2 mb-3",children:l.jsxs("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>ct(null),children:["←"," Back to reasons"]})}),l.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Q.reason}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[Q.count," affected page",Q.count!==1?"s":""]})]}),l.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:fn,onClick:()=>{rt(Q.urls.map(Ne=>Ne.url))},children:fn?"Requesting…":`Request indexing (${Q.count})`})]}),l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Last Crawl"}),l.jsx("th",{className:"w-8"})]})}),l.jsx("tbody",{children:Q.urls.map(Ne=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Ne.url}),l.jsx("td",{className:"text-zinc-400",children:Ne.crawlTime?Ne.crawlTime.split("T")[0]:"—"}),l.jsx("td",{children:l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:fn,onClick:()=>{rt([Ne.url])},title:"Request indexing",children:"Index"})})]},Ne.id))})]})]}):null})(),Ze==="deindexed"&&we.deindexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Previous"}),l.jsx("th",{className:"text-left",children:"Current"}),l.jsx("th",{className:"text-left",children:"Detected"})]})}),l.jsx("tbody",{children:we.deindexed.map((Q,Ne)=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),l.jsx("td",{className:"text-zinc-400",children:Q.previousState}),l.jsx("td",{className:"text-zinc-400",children:Q.currentState}),l.jsx("td",{className:"text-zinc-400",children:Q.transitionDate.split("T")[0]})]},`${Q.url}-${Ne}`))})]}),(Ze==="indexed"&&we.indexed.length===0||Ze==="notIndexed"&&!Ve&&we.notIndexed.length===0||Ze==="deindexed"&&we.deindexed.length===0)&&l.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:he?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),l.jsx("h3",{children:"Search performance"})]}),l.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:q,onClick:()=>{Se()},children:q?"Loading…":"Apply filters"})]}),d.length>0&&(()=>{const Q=new Map;for(const ht of d){const Gt=Q.get(ht.date);Gt?(Gt.clicks+=ht.clicks,Gt.impressions+=ht.impressions):Q.set(ht.date,{clicks:ht.clicks,impressions:ht.impressions})}const Ne=[...Q.entries()].sort(([ht],[Gt])=>ht.localeCompare(Gt));if(Ne.length===0)return null;const nt=Math.max(...Ne.map(([,ht])=>ht.impressions),1),Ct=Ne.reduce((ht,[,Gt])=>ht+Gt.clicks,0),Cn=Ne.reduce((ht,[,Gt])=>ht+Gt.impressions,0),wa=Cn>0?(Ct/Cn*100).toFixed(1):"0.0",Qa=700,$s=220,Ar={top:12,bottom:36,left:48,right:12},Zo=Qa-Ar.left-Ar.right,Sa=$s-Ar.top-Ar.bottom,wi=Zo/Ne.length,Wi=Math.max(Math.min(wi*.35,24),4),Bs=Math.max(Wi*.15,1),Us=ht=>{if(ht<=0)return 1;const Gt=Math.pow(10,Math.floor(Math.log10(ht))),$r=ht/Gt,Xi=$r<=1.5?1.5:$r<=3?3:$r<=5?5:10;return Math.ceil(Xi*Gt)},hn=4,Wo=Math.ceil(Us(nt)/hn)*hn,pp=Array.from({length:hn+1},(ht,Gt)=>Wo/hn*Gt),Ya=ht=>ht>=1e3?`${(ht/1e3).toFixed(ht>=1e4?0:1)}k`:String(ht);return l.jsxs("div",{className:"mt-3",children:[l.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),l.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",l.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Ct.toLocaleString()})]})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),l.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",l.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Cn.toLocaleString()})]})]}),l.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",l.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[wa,"%"]})]})]}),l.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Qa} / ${$s}`},children:l.jsxs("svg",{viewBox:`0 0 ${Qa} ${$s}`,className:"h-full w-full",children:[pp.map((ht,Gt)=>{const $r=Ar.top+Sa-ht/Wo*Sa;return l.jsxs("g",{children:[l.jsx("line",{x1:Ar.left,y1:$r,x2:Qa-Ar.right,y2:$r,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),l.jsx("text",{x:Ar.left-6,y:$r+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Ya(ht)})]},`t-${Gt}`)}),Ne.map(([ht,Gt],$r)=>{const Xi=Ar.left+wi*$r+wi/2,Sc=Gt.impressions/Wo*Sa,Xo=Gt.clicks/Wo*Sa;return l.jsxs("g",{children:[l.jsx("title",{children:`${ht}
|
|
290
|
+
Clicks: ${Gt.clicks}
|
|
291
|
+
Impressions: ${Gt.impressions}
|
|
292
|
+
CTR: ${Gt.impressions>0?(Gt.clicks/Gt.impressions*100).toFixed(1):0}%`}),l.jsx("rect",{x:Xi-Wi-Bs/2,y:Ar.top+Sa-Sc,width:Wi,height:Math.max(Sc,1),rx:2,fill:"#3b82f6",opacity:.85}),l.jsx("rect",{x:Xi+Bs/2,y:Ar.top+Sa-Xo,width:Wi,height:Math.max(Xo,1),rx:2,fill:"#10b981",opacity:.85})]},ht)}),(()=>{const ht=Math.min(Ne.length,7);return Array.from({length:ht},(Gt,$r)=>{const Xi=Ne.length===1?0:Math.round($r/(ht-1)*(Ne.length-1)),Sc=Ar.left+wi*Xi+wi/2;return l.jsx("text",{x:Sc,y:$s-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:Ne[Xi][0].slice(5)},`xl-${Xi}`)})})()]})})]})})(),l.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[l.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(Ne=>({...Ne,startDate:Q.target.value}))}),l.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(Ne=>({...Ne,endDate:Q.target.value}))}),l.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(Ne=>({...Ne,query:Q.target.value}))}),l.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(Ne=>({...Ne,page:Q.target.value}))}),l.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(Ne=>({...Ne,limit:Q.target.value}))})]}),d.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"Date"}),l.jsx("th",{className:"text-left",children:"Query"}),l.jsx("th",{className:"text-left",children:"Page"}),Object.values(ko).map(Q=>l.jsx("th",{className:"text-right","aria-sort":yt?.key===Q?yt.dir==="asc"?"ascending":"descending":"none",children:l.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:()=>We(Ne=>Ne?.key===Q?Ne.dir==="desc"?{key:Q,dir:"asc"}:null:{key:Q,dir:"desc"}),children:[Lte[Q],yt?.key===Q?yt.dir==="desc"?" ↓":" ↑":""]})},Q))]})}),l.jsx("tbody",{children:ue.map((Q,Ne)=>l.jsxs("tr",{children:[l.jsx("td",{className:"text-zinc-400",children:Q.date}),l.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:Q.query}),l.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:Q.page}),l.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:Q.clicks.toLocaleString()}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.impressions.toLocaleString()}),l.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(Q.ctr)?Q.ctr*100:0).toFixed(1),"%"]}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.position.toFixed(1)})]},`${Q.date}:${Q.query}:${Q.page}:${Ne}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),l.jsxs(ze,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),l.jsx("h3",{children:"Inspect a URL"})]})}),l.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[l.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 zd()}),l.jsx(me,{type:"button",size:"sm",disabled:ne||!ot?.propertyId||!E.trim(),onClick:zd,children:ne?"Inspecting…":"Inspect URL"})]}),w&&l.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:w.indexingState??"Unknown"})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:w.verdict??"Unknown"})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Y2(w.isMobileFriendly)})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:sa(w.crawlTime)})]})]})]}),l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),l.jsx("h3",{children:"Inspection log"})]}),l.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:G,onClick:()=>{tt()},children:G?"Loading…":"Refresh history"})]}),l.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[l.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)}),l.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:G,onClick:()=>{tt()},children:"Apply filter"})]}),p.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Indexing"}),l.jsx("th",{className:"text-left",children:"Verdict"}),l.jsx("th",{className:"text-left",children:"Coverage"}),l.jsx("th",{className:"text-left",children:"Mobile"}),l.jsx("th",{className:"text-left",children:"Inspected"})]})}),l.jsx("tbody",{children:p.map(Q=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),l.jsx("td",{className:"text-zinc-300",children:Q.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Q.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Q.coverageState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Y2(Q.isMobileFriendly)}),l.jsx("td",{className:"text-zinc-400",children:sa(Q.inspectedAt)})]},Q.id))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),l.jsxs(ze,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),l.jsx("h3",{children:"Recent indexing losses"})]})}),y.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Previous"}),l.jsx("th",{className:"text-left",children:"Current"}),l.jsx("th",{className:"text-left",children:"Changed at"})]})}),l.jsx("tbody",{children:y.map(Q=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),l.jsx("td",{className:"text-zinc-400",children:Q.previousState??"Unknown"}),l.jsx("td",{className:"text-zinc-300",children:Q.currentState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:sa(Q.transitionDate)})]},`${Q.url}:${Q.transitionDate}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ot&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:l.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>be(Q=>!Q),children:[l.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 ${en?"rotate-90":""}`,"aria-hidden":"true",children:l.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"})}),l.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),en&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[l.jsxs(ze,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),l.jsx("h3",{children:"Pick the Search Console property"})]})}),l.jsxs("div",{className:"mt-3 space-y-2",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),l.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:ce||o.length===0,onChange:Q=>k(Q.target.value),children:o.length===0?l.jsx("option",{value:"",children:ce?"Loading properties…":"No properties available"}):o.map(Q=>l.jsxs("option",{value:Q.siteUrl,children:[Q.siteUrl," · ",Q.permissionLevel]},Q.siteUrl))}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:ce,onClick:()=>{Cr(ot)},children:ce?"Refreshing…":"Refresh properties"}),l.jsx(me,{type:"button",size:"sm",disabled:!j||M,onClick:Ed,children:M?"Saving…":"Save property"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),l.jsxs(ze,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),l.jsx("h3",{children:"Import GSC performance data"})]})}),l.jsxs("div",{className:"mt-3 space-y-3",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),l.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:O,onChange:Q=>_(Q.target.value)})]}),l.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:[l.jsx("input",{type:"checkbox",checked:A,onChange:Q=>z(Q.target.checked)}),"Replace existing imported rows for the requested range"]})]}),l.jsx(me,{type:"button",size:"sm",disabled:kr.isPending||!ot.propertyId,onClick:_d,children:kr.isPending?"Queueing…":"Queue sync"}),!ot.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),l.jsxs(ze,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),l.jsx("h3",{children:"Sitemap configuration"})]})}),l.jsxs("div",{className:"mt-3 space-y-3",children:[ot.sitemapUrl&&l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:ot.sitemapUrl})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:Z||!ot.propertyId,onClick:()=>{bi()},children:Z?"Loading…":"Browse sitemaps from GSC"}),l.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:vi.isPending||!ot.propertyId,onClick:Yt,children:vi.isPending?"Discovering…":"Auto-discover and queue inspection"})]}),l.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."}),Re&&Re.length>0&&l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[l.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",Re.length,")"]}),Re.map(Q=>{const Ne=Q.contents?.[0];return l.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-200 break-all",children:Q.path}),Q.lastSubmitted&&l.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",Q.lastSubmitted.split("T")[0]]})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[Ne&&l.jsxs("div",{className:"text-right",children:[l.jsxs("p",{className:"text-zinc-300",children:[Ne.indexed," / ",Ne.submitted]}),l.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Kt(Q.path),children:"Use"})]})]},Q.path)})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.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:ot.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Ke,onChange:Q=>Kt(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&Ke.trim()&&void xi()}),l.jsx(me,{type:"button",size:"sm",disabled:Bt||!Ke.trim(),onClick:xi,children:Bt?"Saving…":ot.sitemapUrl?"Update":"Save"})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.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}`}),l.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:va.isPending||!ot.propertyId,onClick:async()=>{const Ne=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ot.sitemapUrl||void 0;Qe(null),Xe(null);try{await va.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:Ne}})}catch{}},children:va.isPending?"Queueing…":"Inspect sitemap"})]}),!ot.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function wj({children:e,label:t="More info",placement:n="top",className:r}){const i=x.useId(),[a,o]=x.useState(!1);return l.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[l.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:()=>o(!0),onMouseLeave:()=>o(!1),onFocus:()=>o(!0),onBlur:()=>o(!1),children:l.jsx(T5,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&l.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 Sl=50;function yu(e){return typeof window>"u"?e:`${window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??""}${e}`}function gg(e){return e.toLocaleString()}function vEe(e){const t=Number(e);return Number.isFinite(t)?`${(t*100).toFixed(1)}%`:"—"}function xEe(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 bEe(e){const t=e.filter(n=>n.kind===Ot["backlink-extract"]&&!sk(n.status));return t.length===0?null:t.reduce((n,r)=>n.createdAt>r.createdAt?n:r)}function wEe(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 SEe({projectName:e}){const[t,n]=x.useState(null),[r,i]=x.useState(null),[a,o]=x.useState([]),[u,d]=x.useState(null),[f,p]=x.useState(null),[m,y]=x.useState(null),[v,w]=x.useState(Date.now()),[b,j]=x.useState(0),[k,E]=x.useState(!0),[C,O]=x.useState(!1),[_,A]=x.useState(null),z=x.useRef(null),R=x.useCallback(async()=>{E(!0),A(null);try{const[ce,xe,M,I,q]=await Promise.all([C5().catch(()=>null),sQ(e,{excludeCrawlers:!0}).catch(()=>null),oQ(e,{limit:Sl,offset:b,excludeCrawlers:!0}).catch(G=>{if(G instanceof vr&&G.code==="NOT_FOUND")return null;throw G}),lQ(e).catch(()=>[]),FG(e).catch(()=>[])]);d(ce),n(xe),i(M),o(I);const D=bEe(q);p(D),z.current=D?.id??null}catch(ce){A(ce instanceof Error?ce.message:"Failed to load backlinks")}finally{E(!1)}},[e,b]);x.useEffect(()=>{R()},[R]),x.useEffect(()=>{if(!f)return;const ce=f.id;let xe=!1;const M=async()=>{try{const q=await Vl(ce);if(xe)return;sk(q.status)?(p(null),y(q),await R()):p(D=>D?.id===q.id?{...D,...q}:D)}catch{}},I=window.setInterval(()=>{M()},3e3);return()=>{xe=!0,window.clearInterval(I)}},[f,R]),x.useEffect(()=>{if(!f)return;const ce=window.setInterval(()=>w(Date.now()),1e3);return()=>window.clearInterval(ce)},[f]),x.useEffect(()=>{if(!m||m.status==="failed")return;const ce=window.setTimeout(()=>y(null),1e4);return()=>window.clearTimeout(ce)},[m]);async function $(){O(!0),A(null);try{const ce=await cQ(e);p(ce),z.current=ce.id}catch(ce){ce instanceof vr&&ce.code==="MISSING_DEPENDENCY"?A("DuckDB is not installed. Visit the Backlinks admin page to install it."):A(ce instanceof Error?ce.message:"Failed to trigger extract")}finally{O(!1)}}const F=x.useMemo(()=>a.slice().sort((ce,xe)=>ce.queriedAt.localeCompare(xe.queriedAt)).map(ce=>({date:ce.queriedAt,linkingDomains:ce.totalLinkingDomains})),[a]),U=r?.rows??[],B=r?.total??0,V=t?.excludedLinkingDomains??0,X=B>Sl,W=Math.floor(b/Sl)+1,H=Math.max(1,Math.ceil(B/Sl));return x.useEffect(()=>{b>0&&b>=B&&j(0)},[b,B]),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Backlinks"}),l.jsx("h2",{children:"Referring domains"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1 max-w-2xl",children:["Domains linking to "," ",l.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."]})]})}),_&&l.jsx(ze,{className:"surface-card p-4 mb-4 border-rose-800/60",children:l.jsx("p",{className:"text-sm text-rose-300",children:_})}),f&&l.jsx(ze,{className:"surface-card p-4 mb-4 border-sky-800/60",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(R5,{className:"h-5 w-5 text-sky-400 animate-spin shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-100",children:"Extract running"}),l.jsx(pt,{tone:"neutral",children:f.status}),l.jsxs("span",{className:"text-xs text-zinc-500 tabular-nums",children:[wEe(f.startedAt,f.createdAt)," elapsed · refreshing every 3s"]}),l.jsxs("span",{className:"sr-only",children:["now=",v]})]}),l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Re-querying the cached Common Crawl release for"," ",l.jsx("span",{className:"text-zinc-300",children:e}),". No re-download — the ~16 GB dump already lives at"," ",l.jsx("code",{className:"text-zinc-400",children:"~/.canonry/cache/commoncrawl/"}),". Typically takes ~5 minutes."]})]})]})}),m&&!f&&l.jsx(ze,{className:`surface-card p-4 mb-4 ${m.status==="failed"?"border-rose-800/60":"border-emerald-800/60"}`,children:l.jsxs("div",{className:"flex items-start gap-3",children:[m.status==="failed"?l.jsx("span",{className:"h-5 w-5 shrink-0 mt-0.5 text-rose-400 text-lg leading-none","aria-hidden":!0,children:"!"}):l.jsx(z5,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{className:"flex-1",children:[l.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?l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:$te(m.error)}):m.status!=="failed"?l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Backlinks refreshed from the cached release."}):null]})]})}),J()]});function J(){if(k)return l.jsx(ze,{className:"surface-card p-6",children:l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading backlinks…"})});const ce=t!==null&&t.totalLinkingDomains>0,xe=m?.status==="failed",M=t!==null&&t.totalLinkingDomains===0&&!xe,I=u?.status==="ready",q=u?.status==="failed",D=u&&(u.status==="downloading"||u.status==="querying"||u.status==="queued");return ce?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"gauge-row",children:[l.jsxs("div",{className:"metric-card",children:[l.jsx("p",{className:"metric-card-eyebrow",children:"Referring domains"}),l.jsx("p",{className:"metric-card-big-value",children:l.jsx("span",{className:"text-zinc-50",children:gg(t.totalLinkingDomains)})}),l.jsxs("p",{className:"metric-card-sub",children:["unique domains linking to ",t.targetDomain]})]}),l.jsxs("div",{className:"metric-card",children:[l.jsx("p",{className:"metric-card-eyebrow",children:"Total linking hosts"}),l.jsx("p",{className:"metric-card-big-value",children:l.jsx("span",{className:"text-zinc-50",children:gg(t.totalHosts)})}),l.jsx("p",{className:"metric-card-sub",children:"aggregate host count across referring domains"})]}),l.jsxs("div",{className:"metric-card",children:[l.jsx("p",{className:"metric-card-eyebrow",children:"Top-10 concentration"}),l.jsx("p",{className:"metric-card-big-value",children:l.jsx("span",{className:"text-zinc-50",children:vEe(t.top10HostsShare)})}),l.jsx("p",{className:"metric-card-sub",children:"share of hosts from the 10 largest linking domains"})]})]}),l.jsxs("p",{className:"text-xs text-zinc-600 mt-2",children:["Release ",l.jsx("code",{className:"text-zinc-400",children:t.release})," · queried ",xEe(t.queriedAt),V>0&&l.jsxs(l.Fragment,{children:[" · ",l.jsxs("span",{className:"text-zinc-500",children:[V," crawler/proxy domain",V===1?"":"s"," hidden"]})]})]}),F.length>=2&&l.jsxs(ze,{className:"surface-card p-4 mt-4",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Referring domains over releases"}),l.jsx("div",{className:"h-40 mt-2",children:l.jsx(Oy,{width:"100%",height:"100%",children:l.jsxs(yN,{data:F,margin:{top:8,right:12,bottom:0,left:12},children:[l.jsx("defs",{children:l.jsxs("linearGradient",{id:"bl-gradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:qu[0],stopOpacity:.4}),l.jsx("stop",{offset:"100%",stopColor:qu[0],stopOpacity:0})]})}),l.jsx(Ih,{dataKey:"date",tick:Ao,stroke:od,tickFormatter:xN}),l.jsx(Lh,{tick:Ao,stroke:od,allowDecimals:!1}),l.jsx(ev,{contentStyle:Uu.contentStyle,labelStyle:Uu.labelStyle,itemStyle:Uu.itemStyle,labelFormatter:vN}),l.jsx(_u,{type:"monotone",dataKey:"linkingDomains",name:"Referring domains",stroke:qu[0],fill:"url(#bl-gradient)",strokeWidth:2})]})})})]}),l.jsxs("div",{className:"mt-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Top referring domains"}),X&&l.jsxs("p",{className:"text-xs text-zinc-600",children:["Page ",W," of ",H," · ",gg(B)," total"]})]}),l.jsx(ze,{className:"surface-card overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[l.jsx("th",{className:"px-4 py-2 font-medium",children:"Domain"}),l.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Linking hosts"})]})}),l.jsxs("tbody",{children:[U.map(G=>l.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[l.jsx("td",{className:"px-4 py-2 text-zinc-200",children:G.linkingDomain}),l.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:gg(G.numHosts)})]},G.linkingDomain)),U.length===0&&l.jsx("tr",{children:l.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&&l.jsxs("div",{className:"flex items-center justify-end gap-2 mt-2",children:[l.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:b===0,onClick:()=>j(G=>Math.max(0,G-Sl)),children:"Previous"}),l.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:b+Sl>=B,onClick:()=>j(G=>G+Sl),children:"Next"})]})]}),l.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[l.jsxs(me,{type:"button",variant:"outline",size:"sm",disabled:C||f!==null,onClick:$,children:[l.jsx(xv,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Re-run extract"]}),l.jsxs(wj,{label:"What does Re-run extract do?",children:[l.jsxs("span",{className:"block",children:["Re-queries the ",l.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," for ",l.jsx("span",{className:"text-zinc-200",children:e}),". Replaces existing backlink rows for this project under the current release."]}),l.jsxs("span",{className:"mt-2 block text-zinc-400",children:[l.jsx("span",{className:"text-zinc-200",children:"No re-download"})," of the ~16 GB dump. Typically ",l.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]}),l.jsx(me,{asChild:!0,type:"button",variant:"outline",size:"sm",children:l.jsx("a",{href:yu("/backlinks"),children:"Open admin"})})]})]}):l.jsx(ze,{className:"surface-card p-6",children:l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-zinc-900 text-zinc-400",children:l.jsx(P5,{className:"h-5 w-5","aria-hidden":!0})}),l.jsxs("div",{className:"flex-1",children:[!u&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No release sync yet"}),l.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."}),l.jsx("div",{className:"mt-4",children:l.jsx(me,{asChild:!0,type:"button",size:"sm",children:l.jsx("a",{href:yu("/backlinks"),children:"Set up backlinks"})})})]}),D&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Sync in progress"}),l.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."]}),l.jsx("div",{className:"mt-4",children:l.jsx(me,{asChild:!0,type:"button",variant:"outline",size:"sm",children:l.jsx("a",{href:yu("/backlinks"),children:"View sync status"})})})]}),q&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last sync failed"}),l.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:u.error??"The workspace release sync failed. Retry from the Backlinks admin page."}),l.jsx("div",{className:"mt-4",children:l.jsx(me,{asChild:!0,type:"button",size:"sm",children:l.jsx("a",{href:yu("/backlinks"),children:"Go to Backlinks admin"})})})]}),I&&!D&&!M&&!xe&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No backlinks yet for this project"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["Release ",l.jsx("code",{className:"text-zinc-300",children:u.release})," is ready but no backlinks have been extracted for"," ",l.jsx("code",{className:"text-zinc-300",children:e}),". Run an extract to populate data using the cached release."]}),l.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[l.jsxs(me,{type:"button",size:"sm",disabled:C||f!==null,onClick:$,children:[l.jsx(Vg,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Run extract"]}),l.jsxs(wj,{label:"What does Run extract do?",children:[l.jsxs("span",{className:"block",children:["Runs a DuckDB query against the ",l.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," to find referring domains for ",l.jsx("span",{className:"text-zinc-200",children:e}),"."]}),l.jsxs("span",{className:"mt-2 block text-zinc-400",children:["No re-download. Typically takes ",l.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]})]})]}),xe&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last extract failed"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["See the error above for details. If the cache files for release"," ",l.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."]}),l.jsx("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:l.jsx(me,{asChild:!0,type:"button",size:"sm",children:l.jsx("a",{href:yu("/backlinks"),children:"Go to Backlinks admin"})})})]}),M&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No referring domains found"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["The last extract against release ",l.jsx("code",{className:"text-zinc-300",children:t.release})," found"," ",l.jsx("span",{className:"text-zinc-300",children:"0 referring domains"})," for"," ",l.jsx("code",{className:"text-zinc-300",children:t.targetDomain}),". This can happen when:"]}),l.jsxs("ul",{className:"mt-2 space-y-1 text-xs text-zinc-500 list-disc list-inside",children:[l.jsx("li",{children:"the domain is newer than the release’s crawl window"}),l.jsx("li",{children:"the Common Crawl snapshot didn’t capture pages that link to it"}),l.jsx("li",{children:"the extract ran against a cache that was missing or incomplete"})]}),l.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."}),l.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[l.jsx(me,{asChild:!0,type:"button",size:"sm",children:l.jsx("a",{href:yu("/backlinks"),children:"Go to Backlinks admin"})}),l.jsxs(me,{type:"button",variant:"outline",size:"sm",disabled:C||f!==null,onClick:$,children:[l.jsx(Vg,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Re-run extract"]}),l.jsxs(wj,{label:"What does Re-run extract do?",children:[l.jsxs("span",{className:"block",children:["Re-queries the cached release for ",l.jsx("span",{className:"text-zinc-200",children:t.targetDomain}),". Only useful if the cache files were incomplete last time."]}),l.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 jEe({projectName:e}){const t=yr({queryKey:Pe.citationVisibility(e),queryFn:()=>WV(e),staleTime:O5}),n=t.data??null,r=t.error;if(t.isLoading&&!n)return null;if(r)return l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),l.jsx("h2",{children:"Citation + answer-mention coverage"})]})}),l.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 l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),l.jsx("h2",{children:"Citation + answer-mention coverage"})]})}),l.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:o}=n.summary;return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),l.jsxs("h2",{className:"flex items-center gap-2",children:["Cited by ",i," of ",o," engines",l.jsx(lr,{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)."})]}),l.jsxs("p",{className:"text-base text-zinc-300 flex items-center gap-2",children:["Mentioned in ",a," of ",o," engine answers",l.jsx(lr,{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&&l.jsxs("p",{className:"supporting-copy",children:["Latest run ",new Date(n.summary.latestRunAt).toLocaleString()]})]}),l.jsx(NEe,{data:n}),l.jsx(kEe,{data:n}),n.competitorGaps.length>0&&l.jsx(EEe,{data:n})]})}function NEe({data:e}){const{totalQueries:t,queriesCitedAndMentioned:n,queriesCitedOnly:r,queriesMentionedOnly:i,queriesInvisible:a}=e.summary;return l.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4 mb-4",children:[l.jsx(yg,{label:"Cited + mentioned",value:`${n} / ${t}`,helper:"In sources AND named in answer",tone:n>0?"positive":"neutral"}),l.jsx(yg,{label:"Cited only",value:`${r} / ${t}`,helper:"In sources, not named in answer",tone:r>0?"positive-dim":"neutral"}),l.jsx(yg,{label:"Mentioned only",value:`${i} / ${t}`,helper:"Named in answer, no source link",tone:i>0?"caution":"neutral"}),l.jsx(yg,{label:"Invisible",value:`${a} / ${t}`,helper:"No engine cites or mentions",tone:a>0?"negative":"neutral"})]})}function yg({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 l.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:e}),l.jsx("p",{className:`mt-1 text-2xl font-semibold tabular-nums ${i}`,children:t}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:n})]})}function kEe({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?l.jsx("p",{className:"text-sm text-zinc-500",children:"No query coverage rows."}):l.jsxs("div",{children:[l.jsx(CEe,{}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Query"}),t.map(n=>l.jsx("th",{className:"text-center",children:l.jsx(Zl,{provider:n})},n)),l.jsx("th",{className:"text-right",children:"Cite"}),l.jsx("th",{className:"text-right",children:"Ment"})]})}),l.jsx("tbody",{children:e.byQuery.map(n=>l.jsxs("tr",{children:[l.jsx("td",{className:"font-medium text-zinc-100",children:n.query}),t.map(r=>{const i=n.providers.find(a=>a.provider===r);return l.jsx("td",{className:"text-center",children:i==null?l.jsx(iY,{className:"inline h-3.5 w-3.5 text-zinc-700","aria-label":"no data"}):l.jsx(AEe,{provider:i})},r)}),l.jsx("td",{className:"text-right tabular-nums",children:l.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]})}),l.jsx("td",{className:"text-right tabular-nums",children:l.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 CEe(){return l.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-3 text-[11px] text-zinc-500",children:[l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(zu,{active:!0,tone:"cited"}),l.jsx("span",{children:"cited (in sources)"})]}),l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(zu,{active:!0,tone:"mentioned"}),l.jsx("span",{children:"mentioned (in answer)"})]}),l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(zu,{active:!1,tone:"cited"}),l.jsx(zu,{active:!1,tone:"mentioned"}),l.jsx("span",{children:"neither"})]})]})}function AEe({provider:e}){const t=OEe(e);return l.jsxs("span",{className:"inline-flex items-center justify-center gap-1",title:t,children:[l.jsx(zu,{active:e.cited,tone:"cited"}),l.jsx(zu,{active:e.mentioned,tone:"mentioned"})]})}function OEe(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 zu({active:e,tone:t}){if(!e)return l.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 l.jsx("span",{className:n,"aria-hidden":"true"})}function EEe({data:e}){return l.jsxs("div",{className:"mt-4",children:[l.jsxs("h3",{className:"text-sm font-semibold text-zinc-200 mb-2 flex items-center gap-2",children:["Competitor gaps",l.jsx(lr,{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."}),l.jsxs("span",{className:"text-[10px] font-normal uppercase tracking-wide text-zinc-500",children:[e.competitorGaps.length," ",e.competitorGaps.length===1?"gap":"gaps"]})]}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Query"}),l.jsx("th",{children:"Engine"}),l.jsx("th",{children:"Competitors cited"})]})}),l.jsx("tbody",{children:e.competitorGaps.map(t=>l.jsxs("tr",{children:[l.jsx("td",{className:"font-medium text-zinc-100",children:t.query}),l.jsx("td",{children:l.jsx(Zl,{provider:t.provider})}),l.jsx("td",{className:"text-zinc-300",children:t.citingCompetitors.join(", ")})]},`${t.queryId}::${t.provider}`))})]})})]})}const _Ee={critical:"negative",high:"negative",medium:"caution",low:"neutral"};function aa(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 zEe(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 TEe(e){const t=[e.city,e.region,e.country].filter(Boolean).join(", ");return t?`${e.label} (${t})`:e.label}function PEe({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(null),a=yr({queryKey:Pe.report(e),queryFn:()=>DV(e)});async function o(){n(!0),i(null);try{await IV(e,"client")}catch(d){const f=d instanceof vr||d instanceof Error?d.message:"Download failed";i(f)}finally{n(!1)}}if(a.isLoading)return l.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading report…"});if(a.error){const d=a.error instanceof Error?a.error.message:"Failed to load report";return l.jsx("div",{className:"py-8 text-center",children:l.jsx("p",{className:"text-sm text-rose-400",children:d})})}const u=a.data;return u?l.jsxs("div",{children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("p",{className:"eyebrow",children:"AI Visibility Report"}),l.jsx("h1",{className:"page-title",children:u.meta.project.displayName}),l.jsxs("p",{className:"page-subtitle",children:[u.meta.project.canonicalDomain," · ",u.meta.project.country," / ",u.meta.project.language.toUpperCase(),u.meta.location?` · Location: ${TEe(u.meta.location)}`:" · No location set"," · ","Generated ",zEe(u.meta.generatedAt)]}),r&&l.jsx("p",{className:"mt-2 text-xs text-rose-400",children:r})]}),l.jsx("div",{className:"page-header-right",children:l.jsxs(me,{variant:"secondary",size:"sm",onClick:o,disabled:t,children:[l.jsx(xv,{className:"size-4"}),t?"Preparing…":"Download report HTML"]})})]}),l.jsx(IEe,{report:u}),l.jsx(HEe,{report:u,audience:"client"}),l.jsx(BEe,{report:u,audience:"client"}),l.jsx(UEe,{report:u})]}):null}function REe(e,t){return e.audience==="both"||e.audience===t}const DEe={gemini:"Gemini",openai:"ChatGPT",claude:"Claude",perplexity:"Perplexity",local:"Local model","cdp:chatgpt":"ChatGPT (browser)"};function uv(e){return DEe[e]??e.charAt(0).toUpperCase()+e.slice(1)}function MEe(e){return e?e.direction==="up"?{text:`Up ${e.deltaAbs.toFixed(1)} points since last check (was ${e.prior}%)`,tone:"positive",arrow:"↑"}:e.direction==="down"?{text:`Down ${Math.abs(e.deltaAbs).toFixed(1)} points since last check (was ${e.prior}%)`,tone:"negative",arrow:"↓"}:{text:`Holding steady since last check (was ${e.prior}%)`,tone:"neutral",arrow:"→"}:null}function IEe({report:e}){const t=e.executiveSummary,n=e.citationScorecard,r=t.totalQueryCount,i=r>0?`${t.citationRate}%`:"—",a=r>0?`When customers asked AI ${r} ${r===1?"question":"questions"} about your industry, AI linked to your website in ${t.citedQueryCount} of ${r===1?"them":"those answers"}.`:"No AI check has been run yet. Run a check to see how AI tools answer customer questions about your business.",o=MEe(e.whatsChanged.citationRate),u=n.providers.length>0?n.providers.map(uv).join(", "):`${aa(t.queryCount)} ${t.queryCount===1?"question":"questions"} tested`;return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"rounded-2xl border border-zinc-800/60 bg-zinc-900/40 p-6 sm:p-8",children:[l.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-zinc-500",children:"Overview"}),l.jsx("p",{className:"mt-3 text-6xl font-bold tracking-tight text-zinc-50 sm:text-7xl",children:i}),l.jsx("p",{className:"mt-3 max-w-2xl text-base text-zinc-300 sm:text-lg",children:a}),o&&l.jsxs("p",{className:`mt-3 text-sm font-medium ${o.tone==="positive"?"text-emerald-400":o.tone==="negative"?"text-rose-400":"text-zinc-400"}`,children:[l.jsx("span",{className:"mr-1",children:o.arrow}),o.text]})]}),l.jsxs("div",{className:"mt-5 grid gap-4 sm:grid-cols-3",children:[l.jsx(Sj,{label:"AI mentions your name",value:`${t.mentionRate}%`,subtitle:r>0?`Says your name in ${t.mentionedQueryCount} of ${r} ${r===1?"answer":"answers"}`:"No data yet"}),l.jsx(Sj,{label:"AI links to your website",value:`${t.citationRate}%`,subtitle:r>0?`Cites your site as a source in ${t.citedQueryCount} of ${r} ${r===1?"answer":"answers"}`:"No data yet"}),l.jsx(Sj,{label:"AI tools tested",value:aa(t.providerCount),subtitle:u})]}),l.jsxs("div",{className:"mt-4 rounded-xl border border-zinc-800/60 bg-zinc-950/40 px-4 py-3 text-xs text-zinc-400",children:[l.jsx("span",{className:"font-semibold text-zinc-200",children:"Mentions and links are different."})," ","A ",l.jsx("span",{className:"font-medium text-zinc-200",children:"mention"})," is when AI says your name out loud in its answer. A ",l.jsx("span",{className:"font-medium text-zinc-200",children:"link"})," is when AI lists your website as a source it used. AI can do either, both, or neither — that's why we track both."]}),n.queries.length>0&&l.jsxs("div",{className:"mt-5 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Customer questions we tested"}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:["These are the ",n.queries.length," ",n.queries.length===1?"question we asked":"questions we asked"," every AI tool. The numbers above measure how often you came up."]}),l.jsx("ol",{className:"mt-4 grid gap-2 sm:grid-cols-2",children:n.queries.map((d,f)=>l.jsxs("li",{className:"flex items-start gap-3 rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-3 py-2 text-sm text-zinc-200",children:[l.jsx("span",{className:"shrink-0 text-xs font-semibold tabular-nums text-zinc-500",children:String(f+1).padStart(2,"0")}),l.jsxs("span",{children:['"',d,'"']})]},f))})]}),n.providerRates.length>0&&l.jsxs("div",{className:"mt-5 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"How often each AI tool links to your website"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Higher is better. Each bar shows the share of customer questions where the AI cited your site."}),l.jsx("div",{className:"mt-4 space-y-3",children:n.providerRates.map(d=>l.jsxs("div",{className:"grid grid-cols-[120px_1fr_120px] items-center gap-3",children:[l.jsx("span",{className:"text-sm text-zinc-300",children:uv(d.provider)}),l.jsx("div",{className:"h-3 overflow-hidden rounded-full bg-zinc-800/80",children:l.jsx("div",{className:"h-full rounded-full bg-emerald-500/70",style:{width:`${Math.max(d.citationRate,1.5)}%`}})}),l.jsxs("span",{className:"text-right text-sm font-semibold text-zinc-100",children:[d.citationRate,"% ",l.jsxs("span",{className:"font-normal text-zinc-500",children:["(",d.citedCount,"/",d.totalCount,")"]})]})]},d.provider))})]}),e.clientSummary.confidenceNotes.length>0&&l.jsx("div",{className:"mt-4 grid gap-2",children:e.clientSummary.confidenceNotes.map((d,f)=>l.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-3 py-2 text-xs text-zinc-400",children:d},f))})]})}function Sj({label:e,value:t,subtitle:n}){return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-zinc-500",children:e}),l.jsx("p",{className:"mt-3 text-4xl font-bold tracking-tight text-zinc-50 sm:text-5xl",children:t}),l.jsx("p",{className:"mt-2 text-xs text-zinc-500",children:n})]})}function LEe(e){switch(e){case"immediate":return"Do now";case"short-term":return"This month";case"medium-term":return"Next quarter"}}function $Ee(e){switch(e){case"high":return"Strong evidence";case"medium":return"Some evidence";case"low":return"Worth trying"}}function BEe({report:e,audience:t}){const n=t==="client"?e.clientSummary.actionItems:e.agencyDiagnostics.priorities.length>0?e.agencyDiagnostics.priorities:e.actionPlan.filter(a=>REe(a,t)),r=wte(e,n),i=t==="client";return l.jsxs("section",{className:"page-section-divider",children:[l.jsx(TA,{eyebrow:i?"Action plan":"Agency actions",title:i?"What to do next":"Agency Action Plan",subtitle:i?"Approve these in order. They are sorted by what will move the needle fastest.":"The highest-leverage work, sorted by urgency and evidence strength."}),r.length===0?l.jsx(PA,{message:"No recommendations yet — run an AI check to populate this."}):l.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:r.map((a,o)=>{const u=a.evidence.length>0?a.evidence:a.why,d=a.why.length>0||a.evidence.length>0;return l.jsxs("article",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-zinc-800/80 text-sm font-semibold text-zinc-100",title:"Priority — 1 will move the needle fastest",children:o+1}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"mb-2 flex flex-wrap gap-2",children:[l.jsx(pt,{tone:pte(a),children:i?LEe(a.horizon):gte(a.horizon)}),!i&&l.jsx(pt,{tone:"neutral",children:yte(a.category)}),l.jsx(pt,{tone:"neutral",children:i?$Ee(a.confidence):`${vte(a.confidence)} confidence`})]}),l.jsx("p",{className:"text-sm font-medium text-zinc-100",children:a.title})]})]}),l.jsx("p",{className:"mt-3 text-sm text-zinc-400",children:a.action}),l.jsx(KEe,{items:u,limit:3,className:"mt-3"}),d&&l.jsxs("details",{className:"mt-3 text-xs text-zinc-400",children:[l.jsx("summary",{className:"cursor-pointer text-zinc-500 hover:text-zinc-300",children:i?"See the data behind this":"Evidence details"}),a.why.length>0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("p",{className:"eyebrow-soft mb-1",children:i?"Why this matters":"Why"}),l.jsx("ul",{className:"list-disc space-y-1 pl-4",children:a.why.map((f,p)=>l.jsx("li",{children:f},p))})]}),a.evidence.length>0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("p",{className:"eyebrow-soft mb-1",children:i?"What we saw":"Evidence"}),l.jsx("ul",{className:"list-disc space-y-1 pl-4",children:a.evidence.map((f,p)=>l.jsx("li",{children:f},p))})]})]}),l.jsxs("p",{className:"mt-3 border-t border-zinc-800/60 pt-3 text-xs text-zinc-300",children:[l.jsx("span",{className:"font-medium",children:i?"What success looks like:":"Win condition:"})," ",a.successMetric]})]},`${a.priority}-${a.title}`)})})]})}function jL({label:e,value:t,displayValue:n,max:r,barClass:i}){const a=r>0?Math.max(t/r*100,1.5):0;return l.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-3 text-sm",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"truncate text-zinc-300",title:e,children:e}),l.jsx("div",{className:"mt-1 h-2 overflow-hidden rounded-full bg-zinc-800/80",children:l.jsx("div",{className:`h-full rounded-full ${i}`,style:{width:`${a}%`}})})]}),l.jsx("span",{className:"whitespace-nowrap text-sm font-semibold text-zinc-100",children:n})]})}function UEe({report:e}){const t=e.aiSourceOrigin.topDomains.slice(0,5),n=e.gsc,r=e.indexingHealth,i=Ste(e).slice(0,5),a=t.length>0?Math.max(...t.map(d=>d.count)):0,o=n?Math.max(...n.topQueries.slice(0,5).map(d=>d.impressions),1):0,u=t.length>0||n!==null||r!==null||i.length>0;return l.jsxs("section",{className:"page-section-divider",children:[l.jsx(TA,{eyebrow:"What we based this on",title:"The signals behind this plan",subtitle:"The data behind the recommendations above. Switch to Agency for the full breakdowns."}),u?l.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[t.length>0&&l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Where AI gets its answers"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"The websites AI tools cited most often when answering customer questions about your industry."}),l.jsx("div",{className:"mt-4 space-y-3",children:t.map(d=>l.jsx(jL,{label:d.domain+(d.isCompetitor?" (competitor)":""),value:d.count,displayValue:`${aa(d.count)}×`,max:a,barClass:"bg-zinc-400/70"},d.domain))})]}),r&&l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Pages Google can find on your site"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Google indexing your site increases the chances of it appearing in AI search (especially Gemini)."}),l.jsxs("p",{className:`mt-4 text-5xl font-bold tracking-tight ${r.indexedPct>=90?"text-emerald-400":r.indexedPct>=70?"text-amber-400":"text-rose-400"}`,children:[r.indexedPct,"%"]}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[aa(r.indexed)," of ",aa(r.total)," pages indexed"]}),l.jsx("div",{className:"mt-3 h-3 overflow-hidden rounded-full bg-zinc-800/80",children:l.jsx("div",{className:`h-full rounded-full ${r.indexedPct>=90?"bg-emerald-500/70":r.indexedPct>=70?"bg-amber-500/70":"bg-rose-500/70"}`,style:{width:`${Math.max(r.indexedPct,1.5)}%`}})}),l.jsxs("p",{className:"mt-3 text-xs text-zinc-400",children:[l.jsx("span",{className:"font-medium text-zinc-200",children:aa(r.notIndexed)})," ",r.notIndexed===1?"page is":"pages are"," not indexed yet."]})]}),n&&l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"What people search Google for"}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:["You appeared in ",l.jsx("span",{className:"font-semibold text-zinc-200",children:aa(n.totalImpressions)})," Google searches and got ",l.jsx("span",{className:"font-semibold text-zinc-200",children:aa(n.totalClicks)})," ",n.totalClicks===1?"click":"clicks"," this period."]}),n.topQueries.length>0&&l.jsx("div",{className:"mt-4 space-y-3",children:n.topQueries.slice(0,5).map(d=>l.jsx(jL,{label:d.query,value:d.impressions,displayValue:`${aa(d.impressions)} ${d.impressions===1?"search":"searches"}`,max:o,barClass:"bg-sky-500/70"},d.query))})]}),i.length>0&&l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Topics where you could improve"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Customer questions where better content on your site would help AI cite you."}),l.jsx("ul",{className:"mt-4 space-y-2 text-sm text-zinc-300",children:i.map((d,f)=>l.jsxs("li",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-3 py-2",children:[l.jsx("p",{className:"font-medium text-zinc-100",children:d.query}),l.jsx("p",{className:"mt-0.5 text-xs text-zinc-400",children:Jee(d.action)})]},f))})]})]}):l.jsx(PA,{message:"No supporting evidence yet — this fills in after the first AI check."})]})}const qEe=14;function _A(e){return e==="up"?"positive":e==="down"?"negative":"neutral"}function zA(e){return e==="up"?"↑":e==="down"?"↓":"→"}function jj({label:e,delta:t,unit:n}){if(!t)return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsx("p",{className:"text-2xl font-semibold tracking-tight text-zinc-500",children:"—"}),l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"No prior data"})]});const r=n==="%"?"%":"",i=t.deltaAbs>0?"+":"",a=_A(t.direction),o=a==="positive"?"text-emerald-400":a==="negative"?"text-rose-400":"text-zinc-100";return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsxs("p",{className:`text-2xl font-semibold tracking-tight ${o}`,children:[t.current,r," ",l.jsx("span",{className:"text-sm font-medium",children:zA(t.direction)})]}),l.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:[i,n==="%"?t.deltaAbs.toFixed(1):t.deltaAbs,r," vs ",t.prior,r]})]})}function NL({label:e,delta:t,countLabel:n}){if(!t)return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsx("p",{className:"text-2xl font-semibold tracking-tight text-zinc-500",children:"—"}),l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Not enough trend data"})]});const r=t.deltaAbs>0?"+":"",i=_A(t.direction),a=i==="positive"?"text-emerald-400":i==="negative"?"text-rose-400":"text-zinc-100";return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsxs("p",{className:`text-2xl font-semibold tracking-tight ${a}`,children:[aa(t.current)," ",l.jsx("span",{className:"text-sm font-medium",children:zA(t.direction)})]}),l.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:[r,aa(t.deltaAbs)," ",n," vs prior ",qEe," days"]})]})}function FEe({movements:e,audience:t}){const n=e.filter(i=>i.direction!=="flat");if(n.length===0)return null;const r=t==="client";return l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:r?"How each AI tool changed":"AI engine movements"}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:r?"AI tool":"Engine"}),l.jsx("th",{children:r?"Was":"Prior"}),l.jsx("th",{children:r?"Now":"Current"}),l.jsx("th",{children:"Change"})]})}),l.jsx("tbody",{children:n.map(i=>{const a=i.deltaAbs>0?"+":"",o=_A(i.direction),u=o==="positive"?"text-emerald-400":o==="negative"?"text-rose-400":"text-zinc-300";return l.jsxs("tr",{children:[l.jsx("td",{children:r?uv(i.provider):i.provider}),l.jsxs("td",{children:[i.prior,"%"]}),l.jsxs("td",{children:[i.current,"%"]}),l.jsxs("td",{className:u,children:[a,i.deltaAbs.toFixed(1),"% ",zA(i.direction)]})]},i.provider)})})]})})]})}function kL({insights:e,heading:t,emptyMessage:n,audience:r}){if(e.length===0)return l.jsxs("div",{className:"mt-4 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[l.jsx("p",{className:"eyebrow mb-1",children:t}),l.jsx("p",{className:"text-xs text-zinc-500",children:n})]});const i=r==="client";return l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:t}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[!i&&l.jsx("th",{children:"Severity"}),l.jsx("th",{children:i?"What changed":"Title"}),l.jsx("th",{children:i?"Customer question":"Query"}),l.jsx("th",{children:i?"AI tool":"Provider"})]})}),l.jsx("tbody",{children:e.map(a=>l.jsxs("tr",{children:[!i&&l.jsxs("td",{children:[l.jsx(pt,{tone:_Ee[a.severity],children:mte(a.severity)}),a.instanceCount>1&&l.jsxs("span",{className:"ml-2 text-[11px] text-zinc-500",children:["×",a.instanceCount]})]}),l.jsxs("td",{className:"evidence-query-cell",children:[a.title,i&&a.instanceCount>1&&l.jsxs("span",{className:"ml-2 text-[11px] text-zinc-500",children:["×",a.instanceCount]})]}),l.jsx("td",{className:"text-xs text-zinc-400",children:a.query}),l.jsx("td",{className:"text-xs text-zinc-400",children:i?uv(a.provider):a.provider})]},a.id))})]})})]})}function HEe({report:e,audience:t}){const n=e.whatsChanged,r=t==="client",i=!n.enoughHistory&&!n.gscClicksDelta&&!n.aiReferralsDelta&&n.wins.length===0&&n.regressions.length===0,a=l.jsx(TA,{eyebrow:r?"Since last check":"Section 2",title:r?"What's different since last check":"What's Changed",subtitle:r?void 0:n.headline});return i?l.jsxs("section",{className:"page-section-divider",children:[a,l.jsx(PA,{message:r?"No comparison yet — trends will appear after a few more checks.":"Trends will appear after a few more checks."})]}):l.jsxs("section",{className:"page-section-divider",children:[a,l.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-5",children:[l.jsx(jj,{label:r?"AI links to your website":"Citation rate",delta:n.citationRate,unit:"%"}),l.jsx(jj,{label:r?"AI mentions your name":"Mention rate",delta:n.mentionRate,unit:"%"}),l.jsx(jj,{label:r?"Questions AI answered with you":"Cited queries",delta:n.citedQueryCount,unit:"count"}),l.jsx(NL,{label:r?"Visitors from Google":"GSC clicks",delta:n.gscClicksDelta,countLabel:r?"visits":"clicks"}),l.jsx(NL,{label:r?"Visitors from AI tools":"AI referral sessions",delta:n.aiReferralsDelta,countLabel:r?"visits":"sessions"})]}),l.jsx(FEe,{movements:n.providerMovements,audience:t}),l.jsx(kL,{insights:n.wins,heading:r?"What got better":"Wins",emptyMessage:r?"No new wins this period.":"No new gains in the latest check.",audience:t}),l.jsx(kL,{insights:n.regressions,heading:r?"What got worse":"Regressions",emptyMessage:r?"Nothing got worse this period.":"No new regressions in the latest check.",audience:t})]})}function TA({eyebrow:e,title:t,subtitle:n}){return l.jsxs("div",{className:"mb-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsx("h2",{className:"page-title",children:t}),n&&l.jsx("p",{className:"page-subtitle mt-1",children:n})]})}function KEe({items:e,limit:t=3,className:n}){if(e.length===0)return null;const r=e.slice(0,t),i=e.length-r.length;return l.jsxs("div",{className:`flex flex-wrap gap-1.5 ${n??""}`,children:[r.map((a,o)=>l.jsx("span",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/40 px-2 py-0.5 text-[11px] text-zinc-300",children:a},o)),i>0&&l.jsxs("span",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/40 px-2 py-0.5 text-[11px] text-zinc-400",children:["+",i," more"]})]})}function PA({message:e}){return l.jsx("p",{className:"text-sm text-zinc-500 py-4 text-center",children:e})}function GEe({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=x.useState(!1),[a,o]=x.useState(!1),[u,d]=x.useState(null),[f,p]=x.useState(e.displayName),[m,y]=x.useState(e.canonicalDomain),[v,w]=x.useState(e.country),[b,j]=x.useState(e.language),[k,E]=x.useState(e.ownedDomains??[]),[C,O]=x.useState(""),[_,A]=x.useState(null),[z,R]=x.useState(!1),[$,F]=x.useState(!1),[U,B]=x.useState(""),[V,X]=x.useState(""),[W,H]=x.useState(""),[J,ce]=x.useState(""),[xe,M]=x.useState("");x.useEffect(()=>{r||(p(e.displayName),y(e.canonicalDomain),w(e.country),j(e.language),E(e.ownedDomains??[]))},[e,r]);function I(){i(!1),d(null),p(e.displayName),y(e.canonicalDomain),w(e.country),j(e.language),E(e.ownedDomains??[]),O("")}function q(){const Z=C.trim();Z&&(k.includes(Z)||E([...k,Z]),O(""))}function D(Z){E(k.filter(Fe=>Fe!==Z))}async function G(){if(!(!f.trim()||!m.trim()||!v.trim()||!b.trim())){o(!0),d(null);try{await t(e.name,{displayName:f.trim(),canonicalDomain:m.trim(),ownedDomains:k,country:v.trim(),language:b.trim()}),i(!1),bt({title:"Project settings saved",detail:`${f.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(Z){d(Z instanceof Error?Z.message:"Failed to save")}finally{o(!1)}}}async function oe(){const Z=U.trim(),Fe=V.trim(),Re=W.trim(),st=J.trim();if(!(!Z||!Fe||!Re||!st)){R(!0),A(null);try{const Ke={label:Z,city:Fe,region:Re,country:st};xe.trim()&&(Ke.timezone=xe.trim()),await ZG(e.name,Ke),n(),B(""),X(""),H(""),ce(""),M(""),F(!1),bt({title:"Location added",detail:`${Z} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${Z}`,dedupeMode:"drop"})}catch(Ke){A(Ke instanceof Error?Ke.message:"Failed to add location")}finally{R(!1)}}}async function ne(Z){R(!0),A(null);try{await WG(e.name,Z),n(),bt({title:"Location removed",detail:`${Z} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${Z}`,dedupeMode:"drop"})}catch(Fe){A(Fe instanceof Error?Fe.message:"Failed to remove location")}finally{R(!1)}}async function Ae(Z){R(!0),A(null);try{await XG(e.name,Z),n(),bt({title:"Default location updated",detail:`${Z} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Fe){A(Fe instanceof Error?Fe.message:"Failed to set default location")}finally{R(!1)}}const we=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",he="block text-xs font-medium text-zinc-400 mb-1",_e=U.trim()&&V.trim()&&W.trim()&&J.trim();return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),l.jsx("h2",{children:"Project settings"})]}),!r&&l.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!0),children:"Edit settings"})]}),u&&l.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,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>d(null),children:"×"})]}),r?l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:he,children:"Display name"}),l.jsx("input",{className:ee,type:"text",value:f,onChange:Z=>p(Z.target.value),placeholder:"My Project"})]}),l.jsxs("div",{children:[l.jsx("label",{className:he,children:"Canonical domain"}),l.jsx("input",{className:ee,type:"text",value:m,onChange:Z=>y(Z.target.value),placeholder:"example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{className:he,children:"Country"}),l.jsx("input",{className:ee,type:"text",value:v,onChange:Z=>w(Z.target.value),placeholder:"US",maxLength:2})]}),l.jsxs("div",{children:[l.jsx("label",{className:he,children:"Language"}),l.jsx("input",{className:ee,type:"text",value:b,onChange:Z=>j(Z.target.value),placeholder:"en"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:he,children:"Owned domains"}),l.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(Z=>l.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:[Z,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>D(Z),"aria-label":`Remove ${Z}`,children:"×"})]},Z))}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{className:`${ee} flex-1`,type:"text",placeholder:"docs.example.com",value:C,onChange:Z=>O(Z.target.value),onKeyDown:Z=>Z.key==="Enter"&&(Z.preventDefault(),q())}),l.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:!C.trim(),onClick:q,children:"Add"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[l.jsx(me,{type:"button",disabled:a||!we||!f.trim()||!m.trim(),onClick:G,children:a?"Saving...":"Save changes"}),l.jsx(me,{type:"button",variant:"outline",disabled:a,onClick:I,children:"Cancel"})]})]}):l.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:l.jsx("table",{className:"w-full text-sm",children:l.jsxs("tbody",{children:[l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),l.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?l.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(Z=>l.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:Z},Z))}):l.jsx("span",{className:"text-zinc-500",children:"—"})})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),l.jsxs("tr",{children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),l.jsxs("td",{className:"px-4 py-2.5",children:[_&&l.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:[_,l.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>A(null),children:"×"})]}),(e.locations??[]).length>0?l.jsxs("table",{className:"w-full text-xs mb-2",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-zinc-600",children:[l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),l.jsx("th",{className:"pb-1"})]})}),l.jsx("tbody",{children:e.locations.map(Z=>l.jsxs("tr",{className:"border-t border-zinc-800/30",children:[l.jsx("td",{className:"py-1.5 pr-3",children:l.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${Z.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:[Z.label,Z.label===e.defaultLocation?" ★":""]})}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Z.city}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Z.region}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Z.country}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:Z.timezone??"—"}),l.jsx("td",{className:"py-1.5",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[Z.label!==e.defaultLocation&&l.jsx("button",{type:"button",disabled:z,onClick:()=>Ae(Z.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${Z.label} as default location`,children:"Set default"}),l.jsx("button",{type:"button",disabled:z,onClick:()=>ne(Z.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${Z.label}`,children:"Remove"})]})})]},Z.label))})]}):l.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),$?l.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[l.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),l.jsx("input",{className:ee,type:"text",value:U,onChange:Z=>B(Z.target.value),placeholder:"nyc"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),l.jsx("input",{className:ee,type:"text",value:V,onChange:Z=>X(Z.target.value),placeholder:"New York"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),l.jsx("input",{className:ee,type:"text",value:W,onChange:Z=>H(Z.target.value),placeholder:"NY"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),l.jsx("input",{className:ee,type:"text",value:J,onChange:Z=>ce(Z.target.value),placeholder:"US",maxLength:2})]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),l.jsx("input",{className:ee,type:"text",value:xe,onChange:Z=>M(Z.target.value),placeholder:"America/New_York"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[l.jsx(me,{type:"button",size:"sm",disabled:z||!_e,onClick:oe,children:z?"Adding...":"Add location"}),l.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:z,onClick:()=>{F(!1),A(null)},children:"Cancel"})]})]}):l.jsx(me,{type:"button",size:"sm",variant:"outline",onClick:()=>F(!0),children:"+ Add location"})]})]})]})})})]})}const VEe=[{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"}],CL=["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 QEe({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[a,o]=x.useState("daily"),[u,d]=x.useState(6),[f,p]=x.useState(""),[m,y]=x.useState("UTC"),[v,w]=x.useState(!1),[b,j]=x.useState(""),[k,E]=x.useState(!1),[C,O]=x.useState(!1),[_,A]=x.useState(null);x.useEffect(()=>{sV(e).then(n).catch(()=>n(null))},[e]);const z=()=>{if(t&&t!=="loading"){const U=qte(t.preset??null,t.cronExpr);o(U.freq),d(U.hour),p(U.customCron);const B=CL.includes(t.timezone);y(B?t.timezone:"Other"),w(!B),j(B?"":t.timezone)}else o("daily"),d(6),p(""),y("UTC"),w(!1),j("");A(null),i(!0)},R=async()=>{E(!0),A(null);try{const B={timezone:v?b.trim()||"UTC":m};a==="custom"?B.cron=f.trim():B.preset=Ute(a,u);const V=await m2(e,B);n(V),i(!1),bt({title:"Schedule saved",detail:mw(V.preset??null,V.cronExpr,V.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(U){A(U instanceof Error?U.message:"Failed to save schedule")}finally{E(!1)}},$=async()=>{if(!(!t||t==="loading")){E(!0),A(null);try{const U={timezone:t.timezone,enabled:!t.enabled};t.preset?U.preset=t.preset:U.cron=t.cronExpr;const B=await m2(e,U);n(B),bt({title:B.enabled?"Schedule resumed":"Schedule paused",detail:mw(B.preset??null,B.cronExpr,B.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(U){A(U instanceof Error?U.message:"Failed to update schedule")}finally{E(!1)}}},F=async()=>{O(!0),A(null);try{await oV(e),n(null),i(!1),bt({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch(U){A(U instanceof Error?U.message:"Failed to remove schedule")}finally{O(!1)}};return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),l.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!r&&l.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:z,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&l.jsx(ze,{className:"surface-card compact-card",children:l.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!r&&t!==null&&l.jsxs(ze,{className:"surface-card compact-card",children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200",children:mw(t.preset??null,t.cronExpr,t.timezone)}),l.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",l.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&l.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&l.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx(pt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),l.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:$,children:t.enabled?"Pause":"Resume"}),l.jsx(me,{type:"button",variant:"ghost",size:"sm",disabled:C,onClick:F,children:C?"Removing...":"Remove"})]})]}),_&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:_})]}),r&&l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),l.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=>o(U.target.value),children:VEe.map(U=>l.jsx("option",{value:U.value,children:U.label},U.value))})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),l.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)=>l.jsx("option",{value:B,children:Yj(B)},B))})]})]}),a==="custom"&&l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),l.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)})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),l.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"?(w(!0),y("Other")):(w(!1),y(U.target.value))},children:[CL.map(U=>l.jsx("option",{value:U,children:U},U)),l.jsxs("option",{value:"Other",children:["Other (enter manually)","…"]})]}),v&&l.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)})]}),_&&l.jsx("p",{className:"text-rose-400 text-sm",children:_}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),A(null)},children:"Cancel"}),l.jsx(me,{type:"button",size:"sm",disabled:k||a==="custom"&&!f.trim(),onClick:R,children:k?"Saving...":"Save schedule"})]})]})]})}const YEe=[{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 ZEe({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[a,o]=x.useState(""),[u,d]=x.useState(["citation.lost","citation.gained"]),[f,p]=x.useState(!1),[m,y]=x.useState(null),[v,w]=x.useState({}),[b,j]=x.useState(new Set);x.useEffect(()=>{lV(e).then(n).catch(()=>n([]))},[e]);const k=_=>{d(A=>A.includes(_)?A.filter(z=>z!==_):[...A,_])},E=async()=>{if(!(!a.trim()||u.length===0)){p(!0),y(null);try{const _=await cV(e,{channel:"webhook",url:a.trim(),events:u});n(A=>A==="loading"?[_]:[...A,_]),o(""),d(["citation.lost","citation.gained"]),i(!1),bt({title:"Webhook added",detail:`Notifications will be sent to ${_.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(_){y(_ instanceof Error?_.message:"Failed to add webhook")}finally{p(!1)}}},C=async _=>{if(!b.has(_)){j(A=>new Set(A).add(_));try{await uV(e,_),n(A=>A==="loading"?A:A.filter(z=>z.id!==_)),bt({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${_}`,dedupeMode:"drop"})}catch(A){y(A instanceof Error?A.message:"Failed to remove webhook")}finally{j(A=>{const z=new Set(A);return z.delete(_),z})}}},O=async _=>{w(A=>({...A,[_]:{state:"testing"}}));try{const A=await dV(e,_);w(z=>({...z,[_]:{state:A.ok?"ok":"fail",status:A.status}})),A.ok&&bt({title:"Test notification sent",detail:`Webhook returned status ${A.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${_}`,dedupeMode:"replace"})}catch{w(A=>({...A,[_]:{state:"fail"}}))}};return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),l.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&l.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),y(null)},children:r?"Cancel":"+ Add webhook"})]}),r&&l.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),l.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:_=>o(_.target.value)})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),l.jsx("div",{className:"flex flex-wrap gap-3",children:YEe.map(_=>l.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[l.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:u.includes(_.value),onChange:()=>k(_.value)}),l.jsx("span",{className:"text-sm text-zinc-300",children:_.label})]},_.value))})]}),m&&l.jsx("p",{className:"text-rose-400 text-sm",children:m}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),y(null)},children:"Cancel"}),l.jsx(me,{type:"button",size:"sm",disabled:f||!a.trim()||u.length===0,onClick:E,children:f?"Adding...":"Add webhook"})]})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&l.jsx(ze,{className:"surface-card compact-card",children:l.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&&l.jsxs("div",{className:"evidence-table-wrap",children:[l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Endpoint"}),l.jsx("th",{children:"Events"}),l.jsx("th",{children:"Status"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:t.map(_=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-query-cell",children:l.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:_.urlHost,children:_.urlDisplay??_.url})}),l.jsx("td",{children:l.jsx("div",{className:"flex flex-wrap gap-1",children:_.events.map(A=>l.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:A.replace("."," ")},A))})}),l.jsx("td",{children:l.jsx(pt,{tone:_.enabled?"positive":"neutral",children:_.enabled?"Active":"Paused"})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[v[_.id]&&(()=>{const A=v[_.id],z=A.state==="testing"?"Sending…":A.state==="ok"?`Delivered${A.status?` (${A.status})`:""}`:`Failed${A.status?` (${A.status})`:""}`;return l.jsx(pt,{tone:A.state==="ok"?"positive":A.state==="fail"?"negative":"neutral",children:z})})(),l.jsx(me,{variant:"ghost",size:"sm",type:"button",disabled:v[_.id]?.state==="testing",onClick:()=>O(_.id),children:"Test"}),l.jsx(me,{variant:"ghost",size:"sm",type:"button",disabled:b.has(_.id),onClick:()=>C(_.id),children:b.has(_.id)?"Removing…":"Remove"})]})})]},_.id))})]}),m&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:m})]})]})}function WEe({projectName:e,refreshNonce:t}){const n=Ir(),[r,i]=x.useState(null),[a,o]=x.useState([]),[u,d]=x.useState(null),[f,p]=x.useState([]),[m,y]=x.useState([]),[v,w]=x.useState(null),[b,j]=x.useState(""),[k,E]=x.useState(""),[C,O]=x.useState(""),[_,A]=x.useState(!0),[z,R]=x.useState(!1),[$,F]=x.useState(null),[U,B]=x.useState("coverage");x.useEffect(()=>{V()},[e,t]);async function V(){A(!0),F(null);try{const I=await n.fetchQuery({queryKey:Pe.bing.status(e),queryFn:()=>w5(e),staleTime:mr});if(i(I),I.connected){const[q,D,G,oe]=await Promise.all([n.fetchQuery({queryKey:Pe.bing.coverage(e),queryFn:()=>FN(e).catch(()=>null),staleTime:mr}),n.fetchQuery({queryKey:Pe.bing.inspections(e),queryFn:()=>S5(e).catch(()=>[]),staleTime:mr}),n.fetchQuery({queryKey:Pe.bing.performance(e),queryFn:()=>PV(e).catch(()=>[]),staleTime:mr}),I.siteUrl?Promise.resolve([]):n.fetchQuery({queryKey:Pe.bing.sites(e),queryFn:()=>zV(e).then(ne=>ne.sites).catch(()=>[]),staleTime:mr})]);d(q),p(D),y(G),o(oe)}else d(null),p([]),y([]),o([])}catch(I){F(I instanceof Error?I.message:"Failed to load Bing data")}finally{A(!1)}}async function X(){if(k.trim()){F(null);try{const I=await EV(e,k.trim());await n.invalidateQueries({queryKey:Pe.bing.project(e)}),E(""),I.availableSites.length>0&&o(I.availableSites),await V()}catch(I){F(I instanceof Error?I.message:"Failed to connect")}}}async function W(){try{await _V(e),await n.invalidateQueries({queryKey:Pe.bing.project(e)}),i(null),o([]),d(null),p([]),y([]),w(null),O(""),F(null)}catch(I){F(I instanceof Error?I.message:"Failed to disconnect")}}async function H(){if(C)try{await TV(e,C),await n.invalidateQueries({queryKey:Pe.bing.project(e)}),await V()}catch(I){F(I instanceof Error?I.message:"Failed to set site")}}async function J(){if(b.trim())try{const I=await j5(e,b.trim());await n.invalidateQueries({queryKey:Pe.bing.project(e)}),w(I),p(q=>[I,...q])}catch(I){F(I instanceof Error?I.message:"Inspection failed")}}async function ce(I){R(!0),F(null);try{const q=await v2(e,{urls:[I]}),{succeeded:D,failed:G,total:oe}=q.summary;bt({title:"Bing submission requested",detail:G===0?`${D} URL submitted to Bing.`:`${D}/${oe} submitted successfully, ${G} failed.`,tone:G===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${I}`,dedupeMode:"replace"})}catch(q){const D=q instanceof Error?q.message:"Submission failed";F(D),bt({title:"Bing submission failed",detail:D,tone:"negative",dedupeKey:`bing:indexing:${e}:${I}`,dedupeMode:"replace"})}finally{R(!1)}}async function xe(){R(!0),F(null),bt({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const I=await v2(e,{allUnindexed:!0}),{succeeded:q,failed:D,total:G}=I.summary;bt({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(I){const q=I instanceof Error?I.message:"Batch submission failed";F(q),bt({title:"Bing submissions failed",detail:q,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{R(!1)}}if(_)return l.jsx(ze,{className:"surface-card",children:l.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!r?.connected)return l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),l.jsx("h3",{children:"Domain authorization"})]}),l.jsx(pt,{tone:"caution",children:"Not connected"})]}),l.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),l.jsxs("div",{className:"mt-3",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[l.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:I=>E(I.target.value),onKeyDown:I=>I.key==="Enter"&&X()}),l.jsx(me,{size:"sm",disabled:!k.trim(),onClick:X,children:"Connect"})]}),l.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",l.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"})]})]}),$&&l.jsx("p",{className:"mt-3 text-xs text-rose-400",children:$})]});if(!r.siteUrl)return l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),l.jsx("h3",{children:"Domain authorization"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(pt,{tone:"positive",children:"Connected"}),l.jsx(me,{size:"sm",variant:"ghost",onClick:W,children:"Disconnect"})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),l.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),l.jsx("span",{className:"text-xs text-zinc-500",children:r.domain})]}),l.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."})]}),l.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.domain})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.updatedAt?sa(r.updatedAt):"—"})]})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),a.length>0?l.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[l.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:I=>O(I.target.value),children:[l.jsx("option",{value:"",children:"Select a site..."}),a.map(I=>l.jsxs("option",{value:I.url,children:[I.url,I.verified?" (verified)":""]},I.url))]}),l.jsx(me,{size:"sm",disabled:!C,onClick:H,children:"Set Site"})]}):l.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."})]})]}),$&&l.jsx("p",{className:"mt-3 text-xs text-rose-400",children:$})]});const M=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return l.jsxs("div",{className:"space-y-3",children:[l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),l.jsx("h3",{children:"Domain authorization"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(pt,{tone:"positive",children:"Connected"}),l.jsx(me,{size:"sm",variant:"ghost",onClick:W,children:"Disconnect"})]})]}),$&&l.jsx("p",{className:"mb-3 text-xs text-rose-400",children:$}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),l.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),l.jsx("span",{className:"text-xs text-zinc-500",children:r.domain})]}),l.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",l.jsx("code",{children:r.siteUrl}),"."]})]}),l.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.siteUrl})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.updatedAt?sa(r.updatedAt):"—"})]})]})]})]}),l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),l.jsx("h3",{children:"Index monitoring"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:u?.lastInspectedAt?`Last inspected ${sa(u.lastInspectedAt)}`:"No inspection history yet"})]}),l.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:M.map(I=>l.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${U===I.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>B(I.key),children:I.label},I.key))}),U==="coverage"&&u&&l.jsxs("div",{className:"mt-4 space-y-4",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[l.jsx(Wm,{label:"Indexed",value:u.summary.indexed,tone:"positive"}),l.jsx(Wm,{label:"Not in index",value:u.summary.notIndexed+(u.summary.unknown??0),tone:"negative"}),l.jsx(Wm,{label:"Status unknown",value:u.summary.unknown??0,tone:"neutral"}),l.jsx(Wm,{label:"Coverage",value:`${u.summary.percentage}%`,tone:"neutral"})]}),u.notIndexed.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[l.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",u.notIndexed.length,")"]}),l.jsx(me,{size:"sm",variant:"ghost",disabled:z,onClick:xe,children:z?"Submitting…":"Submit all to Bing"})]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),l.jsx("tbody",{children:u.notIndexed.map(I=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:I.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:I.httpCode??"—"}),l.jsx("td",{className:"py-1.5 px-3 text-right",children:l.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:z,onClick:()=>ce(I.url),children:"Submit"})})]},I.id))})]})})]}),(u.unknown??[]).length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[l.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(u.unknown??[]).length,")"]}),l.jsx(me,{size:"sm",variant:"ghost",disabled:z,onClick:xe,children:z?"Submitting…":"Submit all to Bing"})]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),l.jsx("tbody",{children:(u.unknown??[]).map(I=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:I.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:I.lastCrawledDate?sa(I.lastCrawledDate):"—"}),l.jsx("td",{className:"py-1.5 px-3 text-right",children:l.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:z,onClick:()=>ce(I.url),children:"Submit"})})]},I.id))})]})})]}),u.indexed.length>0&&l.jsxs("div",{children:[l.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",u.indexed.length,")"]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),l.jsx("tbody",{children:u.indexed.map(I=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:I.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:I.lastCrawledDate?sa(I.lastCrawledDate):"—"})]},I.id))})]})})]})]}),U==="coverage"&&!u&&l.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),U==="inspections"&&l.jsxs("div",{className:"mt-4 space-y-3",children:[l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.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:I=>j(I.target.value),onKeyDown:I=>I.key==="Enter"&&J()}),l.jsx(me,{size:"sm",disabled:!b.trim(),onClick:J,children:"Inspect"})]}),v&&l.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[l.jsx("div",{className:"font-medium text-zinc-200",children:v.url}),l.jsxs("div",{className:"text-zinc-400",children:["In Index: ",l.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&&l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),l.jsx("tbody",{children:f.map(I=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:I.url}),l.jsx("td",{className:"py-1.5 px-3",children:l.jsx(pt,{tone:I.inIndex?"positive":"negative",children:I.inIndex?"Yes":"No"})}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:I.httpCode??"—"}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:sa(I.inspectedAt)})]},I.id))})]})})]}),U==="performance"&&l.jsx("div",{className:"mt-4",children:m.length===0?l.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Pm[ko.Clicks]}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Pm[ko.Impressions]}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Pm[ko.CTR]}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Pm[ko.Position]})]})}),l.jsx("tbody",{children:m.map((I,q)=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:I.query}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:I.clicks}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:I.impressions}),l.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(I.ctr)?I.ctr*100:0).toFixed(1),"%"]}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:I.averagePosition.toFixed(1)})]},q))})]})})})]})]})}function XEe({projectName:e}){const t=Ir(),[n,r]=x.useState("google"),[i,a]=x.useState(!0),[o,u]=x.useState("idle"),[d,f]=x.useState(null),p=x.useRef(null),[m,y]=x.useState(!1),[v,w]=x.useState(null),[b,j]=x.useState(null),[k,E]=x.useState(!1),[C,O]=x.useState(null),[_,A]=x.useState(null),[z,R]=x.useState(0);async function $(q=!1){q||a(!0),f(null);try{const[D,G,oe]=await Promise.all([UN().catch(()=>null),t.fetchQuery({queryKey:Pe.gsc.connections(e),queryFn:()=>x5(e).catch(()=>[]),staleTime:mr}),t.fetchQuery({queryKey:Pe.bing.status(e),queryFn:()=>w5(e).catch(()=>null),staleTime:mr})]),ne=G.find(ee=>ee.connectionType==="gsc")??null;y(!!D?.google?.configured),E(!!D?.bing?.configured),w(ne),O(oe);const[Ae,we]=await Promise.all([ne?t.fetchQuery({queryKey:Pe.gsc.coverage(e),queryFn:()=>qN(e).catch(()=>null),staleTime:mr}):Promise.resolve(null),oe?.connected?t.fetchQuery({queryKey:Pe.bing.coverage(e),queryFn:()=>FN(e).catch(()=>null),staleTime:mr}):Promise.resolve(null)]);j(Ae),A(we)}catch(D){f(D instanceof Error?D.message:"Failed to load search console overview")}finally{a(!1)}}async function F(){if(o!=="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 oe(){if(!v)return;const ee=await b5(e);if(!ee?.id)return;const he=2e3,Z=Date.now()+12e4;for(;Date.now()<Z;){if(D.aborted||(await new Promise(Re=>setTimeout(Re,he)),D.aborted))return;const Fe=await Vl(ee.id).catch(()=>null);if(!Fe)break;if(["completed","failed","cancelled"].includes(Fe.status)){Fe.status!=="completed"&&G.push(`Google sync ${Fe.status}`);break}}}const ne=10;async function Ae(){if(!C?.connected)return;const ee=await S5(e).catch(()=>[]),he=[...new Set(ee.map(_e=>_e.url))];if(he.length!==0)for(let _e=0;_e<he.length;_e+=ne){if(D.aborted)return;const Z=he.slice(_e,_e+ne),Re=(await Promise.allSettled(Z.map(st=>j5(e,st)))).filter(st=>st.status==="rejected").length;Re>0&&G.push(`${Re} Bing inspection(s) failed`)}}const we=await Promise.allSettled([oe(),Ae()]);for(const ee of we)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:Pe.gsc.project(e)}),t.invalidateQueries({queryKey:Pe.bing.project(e)})]),await $(!0),R(ee=>ee+1),G.length>0&&f(`Partial refresh: ${G.join("; ")}`)}catch(oe){D.aborted||f(oe instanceof Error?oe.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",W=b?.lastSyncedAt??b?.lastInspectedAt??v?.updatedAt??null,H=C?.connected?"positive":k?"caution":"negative",J=C?.connected?"Connected":k?"Ready to connect":"Needs setup",ce=_?`${_.summary.percentage}% indexed`:C?.connected?"Awaiting coverage":"No coverage data",xe=_?_.summary.notIndexed+(_.summary.unknown??0):0,M=_?`${xe} 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",I=_?.lastInspectedAt??C?.updatedAt??null;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),l.jsx("h2",{children:"Search Engine Intelligence"}),l.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."})]}),l.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:i||o!=="idle",onClick:()=>{F()},children:i?"Loading…":o==="syncing"?"Refreshing Google & Bing…":o==="reloading"?"Reloading workspaces…":"Refresh all"})]}),d&&l.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}),l.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[l.jsx(_P,{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:W,active:n==="google",onClick:()=>r("google")}),l.jsx(_P,{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…":ce,note:i?"Loading overview…":M,updatedAt:I,active:n==="bing",onClick:()=>r("bing")})]})]}),l.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([q,D])=>l.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"&&l.jsx(yEe,{projectName:e}),n==="bing"&&l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),l.jsx("h2",{children:"Bing Webmaster Tools"})]})}),l.jsx(WEe,{projectName:e,refreshNonce:z})]})]})}function JEe({insights:e}){const{openEvidence:t}=fd(),[n,r]=x.useState(null);return l.jsx("div",{className:"insight-list",children:e.map(i=>{const a=n===i.id,o=i.affectedPhrases.length>0;return l.jsxs("div",{children:[l.jsxs("div",{className:`insight-row insight-row-${i.tone} ${o?"cursor-pointer":""}`,onClick:o?()=>r(a?null:i.id):void 0,children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o&&l.jsx(Bh,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${a?"rotate-90":""}`}),l.jsx(pt,{tone:i.tone,children:i.actionLabel}),l.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:i.title}),l.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:i.detail})]}),o&&l.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[i.affectedPhrases.length," phrase",i.affectedPhrases.length>1?"s":""]})]}),a&&l.jsx("div",{className:"divide-y divide-zinc-800/20",children:i.affectedPhrases.map((u,d)=>l.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(x1,{state:u.citationState}),l.jsx("span",{className:"text-sm text-zinc-200 truncate",children:u.query}),l.jsx("div",{className:"hidden sm:flex gap-1",children:u.provider&&l.jsx(Zl,{provider:u.provider})})]}),u.evidenceId&&l.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 hp({tab:e}){const{projectId:t}=$h({from:"/projects/$projectId"}),n=qo(),{dashboard:r,isLoading:i,refetch:a}=pc();if(!r||i)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-48"}),l.jsx("div",{className:"skeleton-text-sm w-32"})]}),l.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(be=>l.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[l.jsx("div",{className:"skeleton-circle size-20"}),l.jsx("div",{className:"skeleton-text w-16 mt-3"})]},be))}),l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-28"}),l.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(be=>l.jsx("div",{className:"skeleton-text-sm w-full"},be))})]})]});const o=Yie(r,t),[u,d]=x.useState(!1),[f,p]=x.useState(!1),[m,y]=x.useState(!1),[v,w]=x.useState(""),[b,j]=x.useState(!1),[k,E]=x.useState(!1),[C,O]=x.useState(""),[_,A]=x.useState(!1),[z,R]=x.useState(!1),[$,F]=x.useState(""),[U,B]=x.useState(!1),[V,X]=x.useState(void 0),[W,H]=x.useState(!1),[J,ce]=x.useState(null),[xe,M]=x.useState(!1),I=o?.visibilityEvidence??[],q=o?.project.name??"",D=o?.project.displayName||o?.project.name||q,G=qF(),oe=(o?.recentRuns??[]).some(be=>be.kind===Ot["answer-visibility"]&&(be.status===or.running||be.status===or.queued)),ne=x.useMemo(()=>new Set(I.map(be=>be.location??"")),[I]),Ae=ne.has(""),we=x.useMemo(()=>[...ne].filter(Boolean),[ne]);x.useEffect(()=>{if(V===void 0||V===""||!q){ce(null),M(!1);return}M(!0),y5(q,V).then(be=>{ce(be),M(!1)}).catch(()=>{ce(null),M(!1)})},[V,q]);const ee=x.useMemo(()=>{if(!J)return null;const be=new Map;for(const Ze of J){for(const[Dt,yt]of Object.entries(Ze.providerRuns??{}))be.set(`${Ze.query}::${Dt}`,yt.map(We=>({runId:We.runId,citationState:We.citationState,createdAt:We.createdAt,answerMentioned:We.answerMentioned,visibilityState:We.visibilityState,visibilityTransition:We.visibilityTransition})));(!Ze.providerRuns||Object.keys(Ze.providerRuns).length===0)&&be.set(`${Ze.query}::`,Ze.runs.map(Dt=>({runId:Dt.runId,citationState:Dt.citationState,createdAt:Dt.createdAt,answerMentioned:Dt.answerMentioned,visibilityState:Dt.visibilityState,visibilityTransition:Dt.visibilityTransition})))}return be},[J]),he=x.useMemo(()=>{const be=V!==void 0?I.filter(Ze=>V===""?!Ze.location:Ze.location===V):I;return ee?be.map(Ze=>{const Dt=ee.get(`${Ze.query}::${Ze.provider}`)??ee.get(`${Ze.query}::`);return Dt?{...Ze,runHistory:Dt}:Ze}):be},[I,V,ee]);if(!o)return l.jsx("div",{className:"page-container",children:l.jsxs(ze,{className:"surface-card empty-card",children:[l.jsx("h1",{children:"Project not found"}),l.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),l.jsx(me,{asChild:!0,children:l.jsx(At,{to:"/",children:"Return to overview"})})]})});async function _e(){try{await G.mutateAsync({projectName:q,projectLabel:D,sourceAction:"project-run"}),a()}catch{}}async function Z(){p(!0);try{await JG(q),bt({title:"Project deleted",detail:`${D} was removed.`,tone:"positive",dedupeKey:`project:delete:${q}`,dedupeMode:"drop"}),n({to:"/"}),a()}catch(be){console.error("Failed to delete project:",be)}finally{p(!1)}}async function Fe(){try{const be=await eV(q),Ze=typeof be=="string"?be:JSON.stringify(be,null,2),Dt=new Blob([Ze],{type:"text/yaml"}),yt=URL.createObjectURL(Dt),We=document.createElement("a");We.href=yt,We.download=`${q}.yaml`,We.click()}catch(be){bt({title:"Export failed",detail:be instanceof Error?be.message:"Could not export project YAML.",tone:"negative"})}}async function Re(){const be=v.split(`
|
|
293
|
+
`).map(Ze=>Ze.trim()).filter(Boolean);if(be.length!==0){j(!0);try{await VG(q,be),a(),w(""),y(!1)}finally{j(!1)}}}async function st(){const be=C.trim();if(be){A(!0);try{const Dt=(await g5(q)).map(We=>We.domain),yt=[...new Set([...Dt,be])];await v5(q,yt),a(),O(""),E(!1)}finally{A(!1)}}}async function Ke(){const be=$.trim();if(be){B(!0);try{const Ze=o?.project.ownedDomains??[];await p2(q,[...Ze,be]),a(),F(""),R(!1)}finally{B(!1)}}}async function Kt(be){B(!0);try{const Ze=o?.project.ownedDomains??[];await p2(q,Ze.filter(Dt=>Dt!==be)),a()}finally{B(!1)}}async function Bt(be,Ze){await QG(be,Ze),a()}const on=be=>!Number.isNaN(Number.parseInt(be,10)),en=[{key:"overview",label:"Overview",href:`/projects/${o.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${o.project.id}/search-console`},{key:"activity",label:"Activity",href:`/projects/${o.project.id}/activity`},{key:"report",label:"Report",href:`/projects/${o.project.id}/report`},{key:"inbound",label:"Inbound",href:`/projects/${o.project.id}/inbound`}];return l.jsxs("div",{className:"page-container",children:[u?l.jsxs(ze,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[l.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),l.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",l.jsx("strong",{className:"text-zinc-200",children:o.project.displayName||o.project.name})," and all its queries, competitors, runs, and snapshots. This cannot be undone."]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(me,{type:"button",variant:"destructive",disabled:f,onClick:Z,children:f?"Deleting...":"Yes, delete project"}),l.jsx(me,{type:"button",variant:"outline",disabled:f,onClick:()=>d(!1),children:"Cancel"})]})]}):null,l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:o.project.displayName||o.project.name}),l.jsxs("p",{className:"page-subtitle",children:[o.project.canonicalDomain,(o.project.ownedDomains??[]).length===0&&!z&&l.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>R(!0),children:"+ add domain"})," "," · ",o.contextLabel]}),l.jsxs("div",{className:"tag-row",children:[l.jsx("span",{className:"tag",children:o.project.country}),l.jsx("span",{className:"tag",children:o.project.language.toUpperCase()}),o.project.tags.map(be=>l.jsx("span",{className:"tag",children:be},be))]}),((o.project.ownedDomains??[]).length>0||z)&&l.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(o.project.ownedDomains??[]).map(be=>l.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:[be,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:U,onClick:()=>Kt(be),"aria-label":`Remove ${be}`,children:"×"})]},be)),z?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.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:be=>F(be.target.value),onKeyDown:be=>be.key==="Enter"&&Ke(),autoFocus:!0}),l.jsx(me,{type:"button",size:"sm",disabled:!$.trim()||U,onClick:Ke,children:U?"...":"Add"}),l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{R(!1),F("")},children:"Cancel"})]}):l.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:()=>R(!0),children:"+ domain"})]})]}),l.jsxs("div",{className:"page-header-right",children:[l.jsx("p",{className:"text-sm text-zinc-500",children:o.dateRangeLabel}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(me,{type:"button",variant:"outline",size:"icon",onClick:Fe,"aria-label":"Export project as YAML",children:l.jsx(xv,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(me,{type:"button",variant:"outline",size:"icon",onClick:()=>d(!0),"aria-label":"Delete project",children:l.jsx(M5,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(me,{type:"button",disabled:G.isPending||oe,onClick:_e,children:G.isPending?"Starting…":oe?"Sweep running…":"Run now"})]})]})]}),l.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:en.map(be=>l.jsx(At,{to:be.href,className:`project-subnav-link ${be.key===e?"project-subnav-link-active":""}`,"aria-current":be.key===e?"page":void 0,children:be.label},be.key))}),e==="overview"?l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"gauge-row",children:[l.jsx(zg,{value:o.visibilitySummary.value,label:o.visibilitySummary.label,delta:o.visibilitySummary.delta,tone:o.visibilitySummary.tone,description:o.visibilitySummary.description,tooltip:o.visibilitySummary.tooltip,isNumeric:on(o.visibilitySummary.value),progress:o.visibilitySummary.progress,providerCoverage:o.visibilitySummary.providerCoverage}),l.jsxs("div",{className:"metric-card",children:[l.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Queries",l.jsx(lr,{text:"Tracked queries where competitors are cited in the latest completed visibility run but your domain is not."})]}),l.jsxs("p",{className:"metric-card-big-value",children:[l.jsx("span",{className:"text-zinc-50",children:o.gapQueries.value}),l.jsxs("span",{className:"text-zinc-600",children:[" / ",o.queryCounts.total]})]}),l.jsx("div",{className:"metric-card-bar",children:l.jsx("div",{className:`metric-card-bar-fill progress-fill-${o.gapQueries.tone}`,style:{width:o.gapQueries.progress!==void 0?`${Math.min(Math.max(o.gapQueries.progress,0),100)}%`:"0%"}})}),l.jsx("p",{className:"metric-card-detail",children:o.gapQueries.delta}),l.jsx("p",{className:"metric-card-sub",children:o.gapQueries.description})]}),l.jsxs("div",{className:"metric-card",children:[l.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",l.jsx(lr,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),l.jsxs("p",{className:"metric-card-big-value",children:[l.jsx("span",{className:"text-zinc-50",children:o.indexCoverage.value}),l.jsx("span",{className:"text-zinc-600",children:"%"})]}),l.jsx("div",{className:"metric-card-bar",children:l.jsx("div",{className:`metric-card-bar-fill progress-fill-${o.indexCoverage.tone}`,style:{width:`${Number.parseInt(o.indexCoverage.value,10)||0}%`}})}),l.jsx("p",{className:"metric-card-detail",children:o.indexCoverage.delta}),l.jsx("p",{className:"metric-card-sub",children:o.indexCoverage.description})]}),l.jsxs("div",{className:"metric-card",children:[l.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",l.jsx(lr,{text:"Query-level citation changes compared to the previous completed run."})]}),o.movementSummary.hasPreviousRun?l.jsxs("div",{className:"metric-card-movement",children:[l.jsxs("span",{className:o.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",o.movementSummary.gained," gained"]}),l.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),l.jsxs("span",{className:o.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",o.movementSummary.lost," lost"]})]}):l.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),l.jsx("p",{className:"metric-card-sub mt-auto",children:o.movementSummary.gained===0&&o.movementSummary.lost===0&&o.movementSummary.hasPreviousRun?"No changes since last run":o.movementSummary.gained>o.movementSummary.lost?"Visibility improving":o.movementSummary.lost>o.movementSummary.gained?"Visibility declining":""})]})]}),l.jsx(jEe,{projectName:o.project.name}),o.providerScores.length>1&&l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),l.jsxs("h2",{children:["Visibility by model ",l.jsx(lr,{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."})]})]})}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Model"}),l.jsx("th",{children:"Score"}),l.jsx("th",{children:"Cited queries"})]})}),l.jsx("tbody",{children:o.providerScores.map(be=>l.jsxs("tr",{children:[l.jsx("td",{children:l.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[l.jsx(Zl,{provider:be.provider}),be.model&&l.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:be.model})]})}),l.jsx("td",{children:l.jsxs("span",{className:`font-semibold ${be.score>=70?"text-emerald-400":be.score>=40?"text-amber-400":"text-rose-400"}`,children:[be.score,"%"]})}),l.jsxs("td",{className:"text-zinc-500",children:[be.cited," of ",be.total]})]},`${be.provider}::${be.model??"unknown"}`))})]})})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),l.jsx("h2",{children:"Citation signals"})]})}),l.jsx(JEe,{insights:o.insights})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),l.jsx("h2",{children:"Query citation tracking"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("p",{className:"supporting-copy",children:[new Set(o.visibilityEvidence.map(be=>be.query)).size," queries tracked"]}),l.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!m),children:m?"Cancel":"+ Add queries"})]})]}),m&&l.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[l.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:be=>w(be.target.value)}),l.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[l.jsxs("p",{className:"text-xs text-zinc-500",children:[v.split(`
|
|
294
|
+
`).filter(be=>be.trim()).length," queries"]}),l.jsx(me,{type:"button",size:"sm",disabled:!v.trim()||b,onClick:Re,children:b?"Adding...":"Add queries"})]})]}),o.project.locations&&o.project.locations.length>0&&l.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[l.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"}),o.project.locations.map(be=>ne.has(be.label)&&l.jsx("button",{className:`filter-chip ${V===be.label?"filter-chip-active":""}`,type:"button","aria-pressed":V===be.label,onClick:()=>{X(be.label),H(!1)},children:be.label},be.label)),Ae&&l.jsx("button",{className:`filter-chip ${V===""?"filter-chip-active":""}`,type:"button","aria-pressed":V==="",onClick:()=>{X(""),H(!1)},children:"No location"}),we.length>1&&V===void 0&&l.jsx("button",{className:`filter-chip filter-chip-compare ${W?"filter-chip-active":""}`,type:"button","aria-pressed":W,onClick:()=>H(be=>!be),title:"Side-by-side location comparison",children:"Compare"})]}),l.jsx(Mde,{evidence:he})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),l.jsx("h2",{children:"Competitive landscape"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("p",{className:"supporting-copy",children:[o.competitors.length," tracked"]}),l.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>E(!k),children:k?"Cancel":"+ Add competitor"})]})]}),k&&l.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[l.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:be=>O(be.target.value),onKeyDown:be=>be.key==="Enter"&&st()}),l.jsx(me,{type:"button",size:"sm",disabled:!C.trim()||_,onClick:st,children:_?"Adding...":"Add"})]}),l.jsx(Ide,{competitors:o.competitors})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),l.jsx("h2",{children:"Recent execution history"})]})}),l.jsx("div",{className:"run-list",children:o.recentRuns.map(be=>l.jsx(pB,{run:be},be.id))})]}),l.jsx(GEe,{project:{...o.project,displayName:o.project.displayName??o.project.name,defaultLocation:o.project.defaultLocation??null},onUpdateProject:Bt,onRefresh:()=>{a()}}),l.jsx(QEe,{projectName:o.project.name}),l.jsx(ZEe,{projectName:o.project.name})]}):e==="report"?l.jsx(PEe,{projectName:o.project.name}):e==="activity"?l.jsx(tEe,{projectName:o.project.name}):e==="inbound"?l.jsx(SEe,{projectName:o.project.name}):l.jsx(XEe,{projectName:o.project.name})]})}function e_e(){const{dashboard:e,isLoading:t}=pc(),n=fEe();if(!e||t)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-20"}),l.jsx("div",{className:"skeleton-text-sm w-72"})]}),l.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(d=>l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[l.jsxs("div",{className:"flex-1 space-y-1.5",children:[l.jsx("div",{className:"skeleton-text w-40"}),l.jsx("div",{className:"skeleton-text-sm w-56"})]}),l.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},d))})]});const r=e.runs,[i,a]=x.useState("all"),o=i==="all"?r:r.filter(d=>d.status===i),u=async()=>{try{await n.mutateAsync(void 0)}catch{}};return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Runs"}),l.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),l.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{u()},children:n.isPending?"Queueing…":"Run all projects"})]}),l.jsxs("section",{children:[l.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(d=>l.jsx("button",{className:`filter-chip ${i===d?"filter-chip-active":""}`,type:"button","aria-pressed":i===d,onClick:()=>a(d),children:d==="all"?"All runs":Nv(d)},d))}),l.jsx("div",{className:"run-list",children:o.length>0?o.map(d=>l.jsx(pB,{run:d},d.id)):l.jsxs(ze,{className:"surface-card empty-card",children:[l.jsx("h2",{children:"No runs match this filter"}),l.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function t_e({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[a,o]=x.useState(""),[u,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,w]=x.useState(""),[b,j]=x.useState(""),[k,E]=x.useState(!1),[C,O]=x.useState(null),[_,A]=x.useState(!1),z=i?u.trim().length>0:a.trim().length>0;async function R(){if(z){E(!0),O(null),A(!1);try{const F=W=>{const H=parseInt(W.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 iV(e.toLowerCase(),{...a.trim()?{apiKey:a.trim()}:{},...u.trim()?{baseUrl:u.trim()}:{},...f.trim()?{model:f.trim()}:{},...Object.keys(U).length>0?{quota:U}:{}}),o(""),d(""),p(""),y(""),w(""),j(""),A(!0),bt({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(F){O(F instanceof Error?F.message:"Failed to update provider")}finally{E(!1)}}}const $=n??"Use default model";return l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[i&&l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),l.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)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",i?" (optional)":""]}),t&&l.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 ","↗"]})]}),l.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=>o(F.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),l.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)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),l.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[l.jsxs("div",{children:[l.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=>y(F.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),l.jsxs("div",{children:[l.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/min",value:v,onChange:F=>w(F.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),l.jsxs("div",{children:[l.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)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),C&&l.jsx("p",{className:"text-xs text-rose-400",children:C}),_&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),l.jsx(me,{type:"button",size:"sm",disabled:!z||k,onClick:R,children:k?"Saving...":"Save"})]})}function n_e({onSaved:e}){const[t,n]=x.useState(""),[r,i]=x.useState(""),[a,o]=x.useState(!1),[u,d]=x.useState(null),[f,p]=x.useState(!1),m=t.trim().length>0&&r.trim().length>0;async function y(){if(m){o(!0),d(null),p(!1);try{await aV({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),p(!0),bt({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{o(!1)}}}return l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),l.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 ","↗"]})]}),l.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)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),l.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)})]}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",l.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),u&&l.jsx("p",{className:"text-xs text-rose-400",children:u}),f&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),l.jsx(me,{type:"button",size:"sm",disabled:!m||a,onClick:y,children:a?"Saving...":"Save Google OAuth app"})]})}function r_e(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState(!1),[o,u]=x.useState("localhost"),[d,f]=x.useState("9222"),[p,m]=x.useState(!1);return x.useEffect(()=>{g2().then(t).catch(y=>{const v=y instanceof Error?y.message:String(y);v.includes("501")||r(v)})},[]),l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),l.jsx("h2",{children:"ChatGPT (CDP)"})]}),l.jsx(pt,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&l.jsxs("div",{children:[l.jsx("dt",{children:"Endpoint"}),l.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&l.jsxs("div",{children:[l.jsx("dt",{children:"Browser"}),l.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&l.jsxs("div",{children:[l.jsx("dt",{children:"Tabs"}),l.jsx("dd",{children:e.targets.map(y=>l.jsxs("span",{className:"mr-2",children:[y.name,": ",y.alive?"● alive":"○ idle"]},y.name))})]})]}),l.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"}),l.jsx("div",{className:"mt-2",children:l.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!i),children:i?"Cancel":e?.connected?"Update endpoint":"Configure"})}),i&&l.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async y=>{y.preventDefault(),m(!0);try{await OV(o,parseInt(d,10)||9222);const v=await g2().catch(()=>null);v&&t(v),a(!1),bt({title:"CDP endpoint saved",detail:`${o}:${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:[l.jsxs("div",{className:"flex gap-2",children:[l.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:o,onChange:y=>u(y.target.value),"aria-label":"CDP host"}),l.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:y=>f(y.target.value),"aria-label":"CDP port"})]}),l.jsx("div",{children:l.jsx(me,{type:"submit",size:"sm",disabled:p,children:p?"Saving…":"Save endpoint"})})]})]})}const i_e={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function a_e(){const e=qh(),{dashboard:t}=pc(),n=t?.settings??e?.dashboard?.settings,a=Tv(!e,e?.health).data??e?.health??i_e,[o,u]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[y,v]=x.useState(""),[w,b]=x.useState(!1),[j,k]=x.useState(null),[E,C]=x.useState(!1);return n?l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Settings"}),l.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),l.jsxs("section",{className:"settings-grid",children:[n.providerStatuses.map(O=>l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),l.jsx("h2",{children:O.displayName??O.name})]}),l.jsx(pt,{tone:O.state==="ready"?"positive":"caution",children:O.state==="ready"?"Ready":"Needs config"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Model"}),l.jsx("dd",{className:"font-mono text-xs",children:O.model})]}),O.quota&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Concurrency"}),l.jsx("dd",{children:O.quota.maxConcurrency})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Rate limit"}),l.jsxs("dd",{children:[O.quota.maxRequestsPerMinute,"/min · ",O.quota.maxRequestsPerDay,"/day"]})]})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:O.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>u(o===O.name?null:O.name),children:o===O.name?"Cancel":O.state==="ready"?O.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),o===O.name&&l.jsx(t_e,{providerName:O.name,keyUrl:O.keyUrl,modelHint:O.modelHint,onSaved:()=>{u(null)}})]},O.name)),l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),l.jsx("h2",{children:"Search Console OAuth"})]}),l.jsx(pt,{tone:n.google.state==="ready"?"positive":"caution",children:n.google.state==="ready"?"Ready":"Needs config"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Auth model"}),l.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Storage"}),l.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.google.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>f(!d),children:d?"Cancel":n.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),d&&l.jsx(n_e,{onSaved:()=>{f(!1)}})]}),l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),l.jsx("h2",{children:"Webmaster Tools"})]}),l.jsx(pt,{tone:n.bing.state==="ready"?"positive":"caution",children:n.bing.state==="ready"?"Ready":"Needs config"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Auth model"}),l.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Storage"}),l.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.bing.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":n.bing.state==="ready"?"Update API key":"Configure Bing"})}),p&&l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),l.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"})]}),l.jsx("input",{id:"bing-api-key",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:y,onChange:O=>v(O.target.value)})]}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",l.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),j&&l.jsx("p",{className:"text-xs text-rose-400",children:j}),E&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),l.jsx(me,{type:"button",size:"sm",disabled:!y.trim()||w,onClick:async()=>{if(y.trim()){b(!0),k(null),C(!1);try{await RV(y.trim()),v(""),C(!0),m(!1),bt({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(O){k(O instanceof Error?O.message:"Failed to update Bing API key")}finally{b(!1)}}},children:w?"Saving...":"Save Bing API key"})]})]}),l.jsx(r_e,{}),l.jsxs(ze,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),l.jsx("h2",{children:"API and worker"})]})}),l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"health-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:"API"}),l.jsx("p",{className:"supporting-copy",children:a.apiStatus.detail})]}),l.jsx(pt,{tone:ry(a.apiStatus),title:Io(a.apiStatus),children:a.apiStatus.state==="ok"?"Healthy":"Attention"})]}),l.jsxs("div",{className:"health-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:"Worker"}),l.jsx("p",{className:"supporting-copy",children:a.workerStatus.detail})]}),l.jsx(pt,{tone:ry(a.workerStatus),title:Io(a.workerStatus),children:a.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),l.jsx("section",{className:"page-section",children:l.jsxs(ze,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),l.jsx("h2",{children:"Operational guidance"})]})}),l.jsx("ul",{className:"detail-list",children:n.selfHostNotes.map(O=>l.jsx("li",{children:O},O))}),l.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const s_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 o_e({current:e,labels:t}){return l.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((n,r)=>{const i=r<e,a=r===e;return l.jsxs("div",{className:`setup-step ${i?"setup-step-done":""} ${a?"setup-step-active":""}`,role:"listitem","aria-current":a?"step":void 0,children:[l.jsx("span",{className:"setup-step-number",children:i?"✓":r+1}),l.jsx("span",{className:"setup-step-label",children:n.label})]},n.label)})})}function l_e(){const e=qh(),{dashboard:t,isLoading:n,refetch:r}=pc(),i=t??e?.dashboard;if(!i||n)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-24"}),l.jsx("div",{className:"skeleton-text-sm w-80"})]}),l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-32"}),l.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(ke=>l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-1 flex-1",children:[l.jsx("div",{className:"skeleton-text w-24"}),l.jsx("div",{className:"skeleton-text-sm w-48"})]}),l.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},ke))})]})]});const a=i.settings,d=Tv(!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=Qte(i.setup,d,a),p=qo(),[m,y]=x.useState(0),[v,w]=x.useState(""),[b,j]=x.useState(""),[k,E]=x.useState(""),[C,O]=x.useState("US"),[_,A]=x.useState("en"),[z,R]=x.useState(!1),[$,F]=x.useState(null),[U,B]=x.useState(null),[V,X]=x.useState(null),[W,H]=x.useState(!1),[J,ce]=x.useState(""),[xe,M]=x.useState(!1),[I,q]=x.useState(null),[D,G]=x.useState(!1),oe=a.providerStatuses.filter(ke=>ke.state==="ready"),[ne,Ae]=x.useState(oe[0]?.name??""),[we,ee]=x.useState(5),[he,_e]=x.useState(!1),[Z,Fe]=x.useState(null),[Re,st]=x.useState(""),[Ke,Kt]=x.useState(!1),[Bt,on]=x.useState(null),[en,be]=x.useState(!1),[Ze,Dt]=x.useState(!1),[yt,We]=x.useState(!1),ue=qF(),je=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Ie=J.split(`
|
|
295
|
+
`).map(ke=>ke.trim()).filter(Boolean),Ve=Re.split(`
|
|
296
|
+
`).map(ke=>ke.trim()).filter(Boolean),ct=f.healthChecks.some(ke=>ke.id==="api"&&ke.state==="ready"),fn=async()=>{if(!(!je||!k)){H(!0),X(null);try{const ke=await vv(je,{displayName:b||v,canonicalDomain:k,country:C,language:_,autoExtractBacklinks:z});F(je),B(ke.id),bt({title:"Project created",detail:`${ke.displayName||ke.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${ke.name}`,dedupeMode:"drop"}),r(),y(2)}catch(ke){X(ke instanceof Error?ke.message:"Failed to create project")}finally{H(!1)}}},Vn=async()=>{if(!$)return;const ke=Ie;if(ke.length!==0){G(!0),q(null);try{await GG($,ke),M(!0),r(),y(3)}catch(kr){q(kr instanceof Error?kr.message:"Failed to save queries")}finally{G(!1)}}},xn=async()=>{if(!(!$||!ne)){_e(!0),Fe(null);try{const ke=await fV($,ne,we);if(ke.queries.length>0){const kr=J?J.trimEnd()+`
|
|
297
|
+
`+ke.queries.join(`
|
|
298
|
+
`):ke.queries.join(`
|
|
299
|
+
`);ce(kr)}}catch(ke){Fe(ke instanceof Error?ke.message:"Failed to generate queries")}finally{_e(!1)}}},Qe=async()=>{if(!$)return;const ke=Ve;if(ke.length!==0){be(!0),on(null);try{await v5($,ke),Kt(!0),r(),y(4)}catch(kr){on(kr instanceof Error?kr.message:"Failed to save competitors")}finally{be(!1)}}},kn=async()=>{if($){We(!0);try{await ue.mutateAsync({projectName:$,projectLabel:b||v||$,sourceAction:"setup-launch"}),Dt(!0),r()}catch{}finally{We(!1)}}},Xe=()=>y(ke=>Math.max(0,ke-1)),ot=(()=>{switch(m){case 0:return l.jsxs(ze,{className:"surface-card step-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),l.jsx("h2",{children:"System ready"})]})}),l.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),l.jsx("div",{className:"compact-stack",children:f.healthChecks.map(ke=>l.jsxs("div",{className:"health-check-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:ke.label}),l.jsx("p",{className:"supporting-copy",children:ke.detail}),ke.id==="provider"&&ke.state!=="ready"&&l.jsx(At,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),l.jsx(pt,{tone:ke.state==="ready"?"positive":"caution",title:ke.id==="api"?Io(d.apiStatus):ke.id==="worker"?Io(d.workerStatus):ke.detail,children:ke.state==="ready"?"Ready":"Attention"})]},ke.id))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx("span",{}),l.jsx(me,{type:"button",disabled:!ct,onClick:()=>y(1),children:"Continue"})]})]});case 1:return l.jsxs(ze,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),l.jsx("h2",{children:"Create project"})]}),$?l.jsx(pt,{tone:"positive",children:"Created"}):null]}),$?l.jsxs("div",{className:"compact-stack",children:[l.jsxs("p",{className:"text-zinc-300",children:["Project ",l.jsx("span",{className:"text-zinc-100 font-medium",children:$})," created successfully."]}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(me,{type:"button",variant:"outline",onClick:Xe,children:"Back"}),l.jsx(me,{type:"button",onClick:()=>y(2),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),l.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:v,onChange:ke=>w(ke.target.value)}),je&&je!==v?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",je]}):null]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),l.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:b,onChange:ke=>j(ke.target.value)})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),l.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:k,onChange:ke=>E(ke.target.value)})]}),l.jsxs("div",{className:"setup-field-row",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),l.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:C,onChange:ke=>O(ke.target.value.toUpperCase())})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),l.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:_,onChange:ke=>A(ke.target.value.toLowerCase())})]})]}),l.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:[l.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-zinc-700 bg-zinc-950",checked:z,onChange:ke=>R(ke.target.checked)}),l.jsxs("span",{className:"flex-1",children:[l.jsx("span",{className:"block text-sm text-zinc-100",children:"Auto-extract backlinks"}),l.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."," ",l.jsx(At,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),V?l.jsx("p",{className:"text-rose-400 text-sm",children:V}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(me,{type:"button",variant:"outline",onClick:Xe,children:"Back"}),l.jsx(me,{type:"button",disabled:!je||!k||W,onClick:fn,children:W?"Creating...":"Create project"})]})]})]});case 2:return l.jsxs(ze,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),l.jsx("h2",{children:"Add queries"})]}),xe?l.jsxs(pt,{tone:"positive",children:[Ie.length," saved"]}):l.jsxs(pt,{tone:"neutral",children:[Ie.length," quer",Ie.length!==1?"ies":"y"]})]}),l.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),xe?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:Ie.map(ke=>l.jsx("li",{children:ke},ke))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(me,{type:"button",variant:"outline",onClick:Xe,children:"Back"}),l.jsx(me,{type:"button",onClick:()=>y(3),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[oe.length>0?l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[l.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",l.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsxs("div",{className:"setup-field flex-1",children:[l.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),l.jsx("select",{id:"gen-provider",className:"setup-input",value:ne,onChange:ke=>Ae(ke.target.value),children:oe.map(ke=>l.jsxs("option",{value:ke.name,children:[ke.displayName??ke.name,ke.model?` (${ke.model})`:""]},ke.name))})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),l.jsx("select",{id:"gen-count",className:"setup-input",value:we,onChange:ke=>ee(Number(ke.target.value)),children:[3,5,10,15,20].map(ke=>l.jsx("option",{value:ke,children:ke},ke))})]}),l.jsx(me,{type:"button",variant:"outline",disabled:he||!ne,onClick:xn,children:he?"Analyzing site...":"Generate"})]}),Z?l.jsx("p",{className:"text-rose-400 text-sm",children:Z}):null]}):null,l.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[l.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",l.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),l.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:ke=>ce(ke.target.value)})]}),I?l.jsx("p",{className:"text-rose-400 text-sm",children:I}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(me,{type:"button",variant:"outline",onClick:Xe,children:"Back"}),l.jsx(me,{type:"button",disabled:Ie.length===0||D,onClick:Vn,children:D?"Saving...":`Save ${Ie.length} quer${Ie.length!==1?"ies":"y"}`})]})]})]});case 3:return l.jsxs(ze,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),l.jsx("h2",{children:"Add competitors"})]}),Ke?l.jsx(pt,{tone:"positive",children:"Saved"}):null]}),l.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),Ke?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:Ve.map(ke=>l.jsx("li",{children:ke},ke))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(me,{type:"button",variant:"outline",onClick:Xe,children:"Back"}),l.jsx(me,{type:"button",onClick:()=>y(4),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),l.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
|
|
302
|
+
competitor2.com`,value:Re,onChange:ke=>st(ke.target.value)})]}),Bt?l.jsx("p",{className:"text-rose-400 text-sm",children:Bt}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(me,{type:"button",variant:"outline",onClick:Xe,children:"Back"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(me,{type:"button",variant:"outline",onClick:()=>y(4),children:"Skip"}),l.jsx(me,{type:"button",disabled:Ve.length===0||en,onClick:Qe,children:en?"Saving...":`Save ${Ve.length} competitor${Ve.length!==1?"s":""}`})]})]})]})]});case 4:return l.jsxs(ze,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),l.jsx("h2",{children:"Launch first run"})]}),Ze?l.jsx(pt,{tone:"positive",children:"Queued"}):null]}),Ze?l.jsxs("div",{className:"compact-stack",children:[l.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),l.jsxs("div",{className:"setup-nav",children:[l.jsx("span",{}),l.jsx(me,{type:"button",onClick:()=>p({to:U?`/projects/${U}`:"/"}),children:"Open project"})]})]}):l.jsxs("div",{className:"compact-stack",children:[l.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",l.jsx("span",{className:"text-zinc-100 font-medium",children:$}),"."]}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(me,{type:"button",variant:"outline",onClick:Xe,children:"Back"}),l.jsx(me,{type:"button",disabled:yt,onClick:kn,children:yt?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Setup"}),l.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),l.jsx(o_e,{current:m,labels:s_e}),l.jsx("section",{className:"setup-wizard",children:ot})]})}function vu({children:e,label:t="More info",placement:n="top",className:r}){const i=x.useId(),[a,o]=x.useState(!1);return l.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[l.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:()=>o(!0),onMouseLeave:()=>o(!1),onFocus:()=>o(!0),onBlur:()=>o(!1),children:l.jsx(T5,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&l.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 c_e="https://commoncrawl.org/web-graphs";function Nj(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 vg(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 kj(e){switch(e){case"ready":return"positive";case"failed":return"negative";case"downloading":case"querying":case"queued":return"caution"}}function u_e(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState([]),[o,u]=x.useState([]),[d,f]=x.useState(null),[p,m]=x.useState(!0),[y,v]=x.useState(!1),[w,b]=x.useState(!1),[j,k]=x.useState(""),[E,C]=x.useState(!1),[O,_]=x.useState(null),[A,z]=x.useState(null),R=x.useCallback(async()=>{m(!0),_(null);try{const[V,X,W,H,J]=await Promise.all([JV(),C5().catch(()=>null),tQ().catch(()=>[]),rQ().catch(()=>[]),iQ().catch(()=>null)]);t(V),r(X),a(W),u(H),f(J)}catch(V){_(V instanceof Error?V.message:"Failed to load backlinks status")}finally{m(!1)}},[]);x.useEffect(()=>{R()},[R]);async function $(){v(!0),_(null),z(null);try{const V=await eQ();z(V.alreadyPresent?`DuckDB already installed (${V.version}).`:`Installed DuckDB ${V.version}.`),await R()}catch(V){_(V instanceof Error?V.message:"Failed to install DuckDB")}finally{v(!1)}}async function F(){const V=j.trim()||void 0;b(!0),_(null),z(null);try{const X=await nQ(V);z(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 R()}catch(X){X instanceof vr&&X.code==="MISSING_DEPENDENCY"?_("DuckDB is not installed. Install it first."):_(X instanceof Error?X.message:"Failed to trigger sync")}finally{b(!1)}}async function U(V){_(null),z(null);try{await aQ(V),z(`Pruned cached release ${V}.`),await R()}catch(X){_(X instanceof Error?X.message:"Failed to prune release")}}const B=n?.status==="ready"&&o.every(V=>V.release!==n.release);return l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Backlinks"}),l.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."})]})}),l.jsx(ze,{className:"surface-card p-4 mb-6 border-amber-800/60",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(Zg,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{className:"text-sm text-zinc-300 leading-relaxed",children:[l.jsx("p",{className:"font-medium text-amber-200",children:"Heads up — a release sync is a large download."}),l.jsxs("ul",{className:"mt-1.5 space-y-1 text-zinc-400",children:[l.jsxs("li",{children:[l.jsx("span",{className:"text-zinc-200",children:"~16 GB"})," of gzipped vertex + edge files per release, stored at"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),"."]}),l.jsxs("li",{children:[l.jsx("span",{className:"text-zinc-200",children:"10–20 min on a fast connection"})," for the download, then ~5 min for the DuckDB query."]}),l.jsx("li",{children:"One sync covers every project in this workspace. Releases are immutable, so the download only happens once per release."})]})]})]})}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"About"}),l.jsx("h2",{children:"How it works"})]})}),l.jsxs(ze,{className:"surface-card p-5",children:[l.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"," ",l.jsx("span",{className:"text-zinc-200",children:"release"})," at a time and extracts backlinks for every project in this workspace in a single pass."]}),l.jsxs("ol",{className:"space-y-3 text-sm text-zinc-400 max-w-3xl",children:[l.jsxs("li",{className:"flex gap-3",children:[l.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"}),l.jsxs("span",{children:[l.jsx("span",{className:"text-zinc-200 font-medium",children:"Download (one-time, ~16 GB)"})," — vertex + edge files cached to"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),". Runs once per release; subsequent operations reuse the cache."]})]}),l.jsxs("li",{className:"flex gap-3",children:[l.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"}),l.jsxs("span",{children:[l.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 ",l.jsx("span",{className:"text-zinc-200",children:"read"})," these dumps; it doesn’t store any canonry state."]})]}),l.jsxs("li",{className:"flex gap-3",children:[l.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"}),l.jsxs("span",{children:[l.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."]})]})]})]})]}),O&&l.jsx(ze,{className:"surface-card p-4 mb-4 border-rose-800/60",children:l.jsx("p",{className:"text-sm text-rose-300",children:O})}),A&&l.jsx(ze,{className:"surface-card p-4 mb-4 border-emerald-800/60",children:l.jsx("p",{className:"text-sm text-emerald-300",children:A})}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dependency"}),l.jsxs("h2",{className:"flex items-center gap-2",children:["DuckDB install status",l.jsxs(vu,{label:"Why DuckDB?",children:[l.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."}),l.jsxs("span",{className:"mt-2 block text-zinc-400",children:["It does ",l.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."]}),l.jsxs("span",{className:"mt-2 block text-zinc-500",children:["Installed on demand (not bundled) into ",l.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?l.jsx(pt,{tone:"positive",children:"Installed"}):l.jsx(pt,{tone:"caution",children:"Not installed"})]}),l.jsx(ze,{className:"surface-card p-5",children:p?l.jsx("p",{className:"text-sm text-zinc-500",children:"Checking…"}):e?.duckdbInstalled?l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(z5,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-sm text-zinc-200",children:["Version ",e.duckdbVersion??"unknown"," installed at"," ",l.jsx("code",{className:"text-zinc-300",children:e.pluginDir})]}),l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Required spec: ",e.duckdbSpec]})]})]}):l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(PQ,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{className:"flex-1",children:[l.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."}),l.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&&l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Will be installed into ",l.jsx("code",{className:"text-zinc-300",children:e.pluginDir})," (~40 MB)."]}),l.jsx("div",{className:"mt-3",children:l.jsxs(me,{type:"button",size:"sm",disabled:y,onClick:$,children:[l.jsx(xv,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),y?"Installing…":"Install DuckDB"]})})]})]})})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Latest sync"}),l.jsxs("h2",{className:"flex items-center gap-2",children:["Release sync",l.jsx(vu,{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&&l.jsx(pt,{tone:kj(n.status),children:n.status})]}),l.jsxs(ze,{className:"surface-card p-5",children:[l.jsxs("p",{className:"text-xs text-zinc-500 max-w-3xl mb-4",children:["A release is one Common Crawl dump (e.g. ",l.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?l.jsxs("div",{className:"space-y-2 text-sm",children:[l.jsxs("p",{className:"text-zinc-200",children:["Release ",l.jsx("code",{className:"text-zinc-300",children:n.release})]}),n.phaseDetail&&l.jsx("p",{className:"text-zinc-500",children:n.phaseDetail}),l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-xs text-zinc-500 pt-2",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Projects"}),l.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.projectsProcessed??"—"})]}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-zinc-600 uppercase tracking-wide flex items-center gap-1",children:["Rows",l.jsx(vu,{label:"What are rows?",children:"Total number of (project, referring domain) pairs persisted in SQLite from this sync, across every project in the workspace."})]}),l.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.domainsDiscovered??"—"})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Started"}),l.jsx("p",{className:"text-zinc-300 mt-0.5",children:vg(n.downloadStartedAt??n.createdAt)})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Finished"}),l.jsx("p",{className:"text-zinc-300 mt-0.5",children:vg(n.queryFinishedAt)})]})]}),n.error&&l.jsx("p",{className:"text-sm text-rose-400 pt-2",children:n.error})]}):l.jsx("p",{className:"text-sm text-zinc-500",children:"No release sync has run in this workspace yet."}),B&&l.jsx("div",{className:"mt-4 rounded border border-amber-800/60 bg-amber-950/20 p-3",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(Zg,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{className:"text-xs text-zinc-300 leading-relaxed",children:[l.jsx("p",{className:"font-medium text-amber-200",children:"Cached files for this release are missing."}),l.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"," ",l.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."]})]})]})}),l.jsxs("div",{className:"mt-4 rounded border border-zinc-800 bg-zinc-900/40 p-3",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Auto-detected release"}),d?l.jsxs("p",{className:"text-sm text-zinc-200 mt-0.5",children:[l.jsx("code",{className:"text-zinc-100",children:d.release}),l.jsxs("span",{className:"ml-2 text-xs text-zinc-500",children:["— vertex ",Nj(d.vertexBytes),", edges ",Nj(d.edgesBytes)]})]}):l.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."}),l.jsxs("a",{href:c_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",l.jsx(BQ,{className:"h-3 w-3","aria-hidden":!0})]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsxs(me,{type:"button",size:"sm",disabled:w||!e?.duckdbInstalled||!d&&!j.trim(),onClick:F,children:[l.jsx(Vg,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),w?"Queuing…":"Run sync"]}),l.jsxs(vu,{label:"What does Run sync do?",children:[l.jsxs("span",{className:"block",children:["Downloads the auto-detected (or chosen) Common Crawl release (~16 GB) to"," ",l.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."]}),l.jsxs("span",{className:"mt-2 block text-zinc-400",children:["First time for a release: ",l.jsx("span",{className:"text-zinc-200",children:"~10–20 min download + ~5 min query"}),". Re-running the same release later: ",l.jsx("span",{className:"text-zinc-200",children:"skips download, just re-queries"})," (~5 min)."]})]})]})]}),E?l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.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:w,autoFocus:!0}),l.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:w,children:"Cancel"})]}):l.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:w,children:"Use a different release →"})]}),!e?.duckdbInstalled&&l.jsx("p",{className:"text-xs text-zinc-600 mt-2",children:"Install DuckDB first to enable sync."})]})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Cached releases"}),l.jsxs("h2",{className:"flex items-center gap-2",children:["Local disk cache",l.jsxs(vu,{label:"What is this?",children:[l.jsxs("span",{className:"block",children:["Raw Common Crawl dumps stored at"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/<release>/"}),". Each release takes ~16 GB."]}),l.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 ",l.jsx("span",{className:"text-zinc-200",children:"does not delete your backlink data"})," — that lives in SQLite."]})]})]})]})}),l.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."}),l.jsx(ze,{className:"surface-card overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[l.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),l.jsx("th",{className:"px-4 py-2 font-medium",children:"Sync status"}),l.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Size"}),l.jsx("th",{className:"px-4 py-2 font-medium",children:"Last used"}),l.jsx("th",{className:"px-4 py-2 font-medium sr-only",children:"Actions"})]})}),l.jsxs("tbody",{children:[o.map(V=>l.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[l.jsx("td",{className:"px-4 py-2 text-zinc-200",children:l.jsx("code",{children:V.release})}),l.jsx("td",{className:"px-4 py-2",children:V.syncStatus?l.jsx(pt,{tone:kj(V.syncStatus),children:V.syncStatus}):l.jsx("span",{className:"text-zinc-600",children:"—"})}),l.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:Nj(V.bytes)}),l.jsx("td",{className:"px-4 py-2 text-zinc-400",children:vg(V.lastUsedAt)}),l.jsx("td",{className:"px-4 py-2 text-right",children:l.jsxs("div",{className:"inline-flex items-center gap-1",children:[l.jsxs(me,{type:"button",variant:"outline",size:"sm",onClick:()=>U(V.release),children:[l.jsx(M5,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),"Prune"]}),l.jsx(vu,{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)),o.length===0&&l.jsx("tr",{children:l.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&&l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),l.jsx("h2",{children:"Past release syncs"})]})}),l.jsx(ze,{className:"surface-card overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[l.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),l.jsx("th",{className:"px-4 py-2 font-medium",children:"Status"}),l.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Projects"}),l.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Rows"}),l.jsx("th",{className:"px-4 py-2 font-medium",children:"Finished"})]})}),l.jsx("tbody",{children:i.map(V=>l.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[l.jsx("td",{className:"px-4 py-2 text-zinc-200",children:l.jsx("code",{children:V.release})}),l.jsx("td",{className:"px-4 py-2",children:l.jsx(pt,{tone:kj(V.status),children:V.status})}),l.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:V.projectsProcessed??"—"}),l.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:V.domainsDiscovered??"—"}),l.jsx("td",{className:"px-4 py-2 text-zinc-400",children:vg(V.queryFinishedAt??V.updatedAt)})]},V.id))})]})})]})]})}function d_e({open:e,onOpenChange:t,projectName:n}){const[r,i]=x.useState(""),[a,o]=x.useState(""),[u,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,w]=x.useState(null),[b,j]=x.useState(null),k=YOe(n||null),E=()=>{i(""),o(""),d(""),p(""),y(""),w(null),j(null)},C=async _=>{if(_.preventDefault(),w(null),j(null),!r.trim()){w("GCP project ID is required.");return}if(!m.trim()){w("Service-account JSON content is required.");return}try{const A=await k.mutateAsync({gcpProjectId:r.trim(),serviceName:a.trim()||void 0,location:u.trim()||void 0,displayName:f.trim()||void 0,keyJson:m.trim()});y(""),j(`Connected ${A.displayName}.`)}catch(A){const z=A instanceof vr||A instanceof Error?A.message:String(A);w(z)}},O=async _=>{if(!_)return;const A=await _.text();y(A)};return l.jsx(U3,{open:e,onOpenChange:_=>{t(_),_||E()},children:l.jsxs(gk,{children:[l.jsxs(F3,{children:[l.jsx(yk,{children:"Connect Cloud Run traffic source"}),l.jsxs(vk,{children:["v1 supports service-account JSON only. The private key is stored in ",l.jsx("code",{children:"~/.canonry/config.yaml"})," on the server and never echoed back to the dashboard."]})]}),l.jsxs("form",{onSubmit:C,className:"mt-6 flex flex-col gap-5 overflow-y-auto pr-1",children:[l.jsx(xu,{label:"Project",description:"Canonry project this source attaches to.",children:l.jsx("input",{type:"text",value:n,disabled:!0,className:"w-full rounded border border-zinc-700 bg-zinc-900/50 px-2 py-1.5 text-sm text-zinc-300"})}),l.jsx(xu,{label:"GCP project ID",description:"The Google Cloud project hosting the Cloud Run service (e.g. my-prod-foo).",required:!0,children:l.jsx("input",{type:"text",value:r,onChange:_=>i(_.target.value),required:!0,autoComplete:"off",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"})}),l.jsx(xu,{label:"Service name (optional)",description:"Restrict log pulls to a specific Cloud Run service. Omit to pull all services in the project.",children:l.jsx("input",{type:"text",value:a,onChange:_=>o(_.target.value),autoComplete:"off",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"})}),l.jsx(xu,{label:"Location (optional)",description:"Region of the Cloud Run service (e.g. us-central1). Helpful when multiple regions emit logs.",children:l.jsx("input",{type:"text",value:u,onChange:_=>d(_.target.value),autoComplete:"off",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"})}),l.jsx(xu,{label:"Display name (optional)",description:"Friendly label shown in the dashboard. Defaults to the project + service combo.",children:l.jsx("input",{type:"text",value:f,onChange:_=>p(_.target.value),autoComplete:"off",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"})}),l.jsxs(xu,{label:"Service-account JSON",description:"Paste the contents of the SA key (JSON). The SA needs roles/logging.viewer (or any role granting logging.logEntries.list).",required:!0,children:[l.jsx("textarea",{value:m,onChange:_=>y(_.target.value),rows:6,spellCheck:!1,autoComplete:"off",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 font-mono text-[11px] text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:'{"type":"service_account","project_id":"…","private_key":"…"}',required:!0}),l.jsxs("label",{className:"mt-2 inline-flex cursor-pointer items-center gap-2 text-xs text-zinc-400 hover:text-zinc-200",children:[l.jsx("input",{type:"file",accept:"application/json,.json",className:"hidden",onChange:_=>{O(_.target.files?.[0]??null)}}),l.jsx("span",{className:"rounded-md border border-zinc-800 px-2 py-1",children:"Or upload a key file"})]})]}),v?l.jsx("p",{className:"rounded-md border border-rose-800/50 bg-rose-950/30 px-3 py-2 text-xs text-rose-200",children:v}):null,b?l.jsx("p",{className:"rounded-md border border-emerald-800/50 bg-emerald-950/30 px-3 py-2 text-xs text-emerald-200",children:b}):null,l.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2 border-t border-zinc-800/60 pt-4",children:[l.jsx(me,{type:"button",variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Close"}),l.jsx(me,{type:"submit",disabled:k.isPending,size:"sm",children:k.isPending?"Connecting…":"Connect"})]})]})]})})}function xu({label:e,description:t,required:n,children:r}){return l.jsxs("label",{className:"flex flex-col gap-1",children:[l.jsxs("span",{className:"text-xs font-medium text-zinc-200",children:[e,n?l.jsx("span",{className:"ml-1 text-rose-400",children:"*"}):null]}),r,l.jsx("span",{className:"text-[11px] text-zinc-500",children:t})]})}function f_e(e){if(!e)return"never";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 Cj(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function h_e(){const[e,t]=x.useState(""),[n,r]=x.useState(!1),a=yr({queryKey:Pe.projects.all,queryFn:yv}).data??[],o=x.useMemo(()=>e||(a[0]?.name??""),[e,a]),u=KOe(o||null),d=u.data?.sources??[];return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Server traffic"}),l.jsx("p",{className:"page-subtitle",children:"Crawler hits and AI-referral arrivals pulled directly from server logs (Cloud Run, etc.). Independent of GA — useful when you need server-side evidence that GPTBot or ChatGPT-User actually hit a page."})]}),l.jsxs(me,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),disabled:!o,children:[l.jsx(Qg,{className:"size-3.5"}),"Connect Cloud Run"]})]}),l.jsxs("section",{children:[l.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Project picker",children:a.map(f=>l.jsx("button",{type:"button",className:`filter-chip ${o===f.name?"filter-chip-active":""}`,"aria-pressed":o===f.name,onClick:()=>t(f.name),children:f.displayName??f.name},f.id))}),o?u.isLoading?l.jsx(ze,{className:"p-6 text-center text-sm text-zinc-500",children:"Loading sources…"}):d.length===0?l.jsxs(ze,{className:"p-8 text-center",children:[l.jsxs("p",{className:"text-sm text-zinc-300",children:["No traffic sources connected for ",o,"."]}),l.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Connect a Cloud Run service to start ingesting crawler and AI-referral hits from server logs."}),l.jsx("div",{className:"mt-4",children:l.jsxs(me,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),children:[l.jsx(Qg,{className:"size-3.5"}),"Connect Cloud Run"]})})]}):l.jsx(p_e,{projectName:o,sources:d}):l.jsx(ze,{className:"p-6 text-center text-sm text-zinc-500",children:"No projects yet."})]}),l.jsx(d_e,{open:n,onOpenChange:r,projectName:o})]})}function p_e({projectName:e,sources:t}){const n=KL({queries:t.map(i=>({queryKey:Pe.serverTraffic.sourceDetail(e,i.id),queryFn:()=>k5(e,i.id),staleTime:3e4}))}),r=t.map((i,a)=>({source:i,detail:n[a]?.data,isLoading:n[a]?.isLoading??!1}));return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{className:"bg-zinc-900/50 text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-4 py-2 text-left",children:"Source"}),l.jsx("th",{className:"px-4 py-2 text-left",children:"Status"}),l.jsx("th",{className:"px-4 py-2 text-left",children:"Last sync"}),l.jsx("th",{className:"px-4 py-2 text-right",children:"24h crawler"}),l.jsx("th",{className:"px-4 py-2 text-right",children:"24h AI referral"}),l.jsx("th",{className:"px-4 py-2 text-right",children:"24h samples"}),l.jsx("th",{className:"px-4 py-2 text-right"})]})}),l.jsx("tbody",{className:"divide-y divide-zinc-800/60",children:r.map(({source:i,detail:a,isLoading:o})=>l.jsxs("tr",{className:"hover:bg-zinc-900/40 transition-colors",children:[l.jsxs("td",{className:"px-4 py-3",children:[l.jsx("div",{className:"font-medium text-zinc-100",children:i.displayName}),l.jsxs("div",{className:"text-[11px] text-zinc-500 font-mono",children:[i.sourceType," · ",i.id.slice(0,8)]})]}),l.jsxs("td",{className:"px-4 py-3",children:[l.jsx(pt,{tone:EA(i.status),children:i.status}),i.lastError?l.jsx("p",{className:"mt-1 max-w-[18rem] truncate text-[11px] text-rose-400/80",title:i.lastError,children:i.lastError}):null]}),l.jsx("td",{className:"px-4 py-3 text-zinc-300",children:f_e(i.lastSyncedAt)}),l.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-100",children:o?"—":Cj(a?.totals24h.crawlerHits??0)}),l.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-100",children:o?"—":Cj(a?.totals24h.aiReferralHits??0)}),l.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-300",children:o?"—":Cj(a?.totals24h.sampleCount??0)}),l.jsx("td",{className:"px-4 py-3 text-right",children:l.jsxs(At,{to:"/traffic/$projectName/$sourceId",params:{projectName:e,sourceId:i.id},className:"inline-flex items-center gap-1 text-xs text-zinc-300 hover:text-zinc-100",children:[l.jsx(Yg,{className:"size-3"}),"View"]})})]},i.id))})]}),l.jsxs("p",{className:"border-t border-zinc-800/60 px-4 py-2 text-[11px] text-zinc-600",children:["Showing ",t.filter(i=>i.status!==Vf.archived).length," active source",t.length===1?"":"s"," for ",e,". Same shape as ",l.jsxs("code",{className:"text-zinc-400",children:["canonry traffic status ",e," --format json"]}),"."]})]})}const m_e=[{value:60,label:"Last hour"},{value:360,label:"Last 6h"},{value:1440,label:"Last 24h"},{value:10080,label:"Last 7d"}],g_e=qu[0],y_e=qu[1];function FF(e){const t=new Date(e);return`${t.getMonth()+1}/${t.getDate()} ${String(t.getHours()).padStart(2,"0")}:00`}function xg(e){if(!e)return"never";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 v_e(){const e=$h({strict:!1}),t=e.projectName??"",n=e.sourceId??"",[r,i]=x.useState("all"),[a,o]=x.useState(1440),[u,d]=x.useState(null),[f,p]=x.useState(null),m=VOe(t||null,n||null),y=QOe(t||null,{kind:r,sourceId:n||void 0,sinceMinutes:a,limit:500}),v=ZOe(t||null,n||null),w=m.data,b=y.data?.events??[],j=y.data?.totals,k=x.useMemo(()=>x_e(b),[b]),E=async()=>{d(null),p(null);try{const C=await v.mutateAsync({sinceMinutes:60});p(`Pulled ${C.pulledEvents} entries · ${C.crawlerHits} crawler · ${C.aiReferralHits} AI referral · ${C.unknownHits} unknown`)}catch(C){const O=C instanceof vr||C instanceof Error?C.message:String(C);d(O)}};return!t||!n?l.jsx("div",{className:"page-container",children:l.jsx("p",{className:"text-sm text-zinc-500",children:"Missing project name or source id in URL."})}):m.isLoading?l.jsx("div",{className:"page-container",children:l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading source…"})}):m.isError||!w?l.jsxs("div",{className:"page-container",children:[l.jsx("p",{className:"text-sm text-rose-300",children:"Could not load this source."}),l.jsxs(At,{to:"/traffic",className:"mt-2 inline-flex items-center gap-1 text-xs text-zinc-400 hover:text-zinc-200",children:[l.jsx(S2,{className:"size-3"})," Back to sources"]})]}):l.jsxs("div",{className:"page-container space-y-8",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsxs(At,{to:"/traffic",className:"inline-flex items-center gap-1 text-xs text-zinc-500 hover:text-zinc-200",children:[l.jsx(S2,{className:"size-3"})," All sources"]}),l.jsx("h1",{className:"page-title mt-2",children:w.displayName}),l.jsxs("p",{className:"page-subtitle",children:[w.sourceType," · project ",l.jsx("span",{className:"text-zinc-300",children:t})," ·",l.jsx("span",{className:"ml-1 font-mono text-zinc-400",children:w.id})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(pt,{tone:EA(w.status),children:w.status}),l.jsxs(me,{type:"button",variant:"outline",size:"sm",disabled:v.isPending,onClick:()=>{E()},children:[l.jsx(Yg,{className:`size-3.5 ${v.isPending?"animate-spin":""}`}),v.isPending?"Syncing…":"Sync now"]})]})]}),u?l.jsx("div",{className:"rounded-md border border-rose-800/50 bg-rose-950/30 px-3 py-2 text-xs text-rose-200",children:u}):null,f?l.jsx("div",{className:"rounded-md border border-emerald-800/50 bg-emerald-950/30 px-3 py-2 text-xs text-emerald-200",children:f}):null,l.jsxs("section",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[l.jsx(zg,{label:"24h crawler hits",value:String(w.totals24h.crawlerHits),delta:w.lastSyncedAt?`last sync ${xg(w.lastSyncedAt)}`:"never synced",tone:w.totals24h.crawlerHits>0?"positive":"neutral",description:"GPTBot, ChatGPT-User, PerplexityBot, etc. — verified crawler requests in the last 24h.",isNumeric:!0,progress:Math.min(100,Math.round(w.totals24h.crawlerHits/1e3*100))}),l.jsx(zg,{label:"24h AI referral hits",value:String(w.totals24h.aiReferralHits),delta:w.lastSyncedAt?`last sync ${xg(w.lastSyncedAt)}`:"never synced",tone:w.totals24h.aiReferralHits>0?"positive":"neutral",description:"Visits arriving from chat.openai.com, perplexity.ai, etc. (Referer header evidence).",isNumeric:!0,progress:Math.min(100,Math.round(w.totals24h.aiReferralHits/1e3*100))}),l.jsx(zg,{label:"24h sample rows",value:String(w.totals24h.sampleCount),delta:"bounded per sync",tone:"neutral",description:"Per-request samples retained for evidence (capped to keep storage bounded).",isNumeric:!0,progress:Math.min(100,Math.round(w.totals24h.sampleCount/100*100))})]}),l.jsxs("section",{children:[l.jsx("p",{className:"mb-4 text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:"Latest sync run"}),w.latestRun?l.jsxs(ze,{className:"p-4 text-sm",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-1.5",children:[l.jsxs("span",{className:"text-zinc-100",children:["Status: ",l.jsx("span",{className:"font-medium",children:w.latestRun.status})]}),l.jsxs("span",{className:"text-zinc-500",children:["Started: ",xg(w.latestRun.startedAt)]}),w.latestRun.finishedAt?l.jsxs("span",{className:"text-zinc-500",children:["Finished: ",xg(w.latestRun.finishedAt)]}):null,l.jsx("span",{className:"font-mono text-[11px] text-zinc-600",children:w.latestRun.runId})]}),w.latestRun.error?l.jsx("p",{className:"mt-2 rounded border border-rose-900/40 bg-rose-950/30 px-3 py-2 text-xs text-rose-300",children:w.latestRun.error}):null]}):l.jsx(ze,{className:"px-4 py-3 text-sm text-zinc-500",children:'No traffic-sync runs recorded yet. Hit "Sync now" above to create one.'})]}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-5 flex flex-wrap items-end justify-between gap-x-4 gap-y-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:"Events"}),l.jsx("h2",{className:"mt-1 text-base font-semibold text-zinc-50",children:"Hourly rollups"}),j?l.jsxs("p",{className:"mt-1.5 text-xs text-zinc-500",children:[j.crawlerHits," crawler · ",j.aiReferralHits," AI referral · over the selected window"]}):null]}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsx("div",{className:"filter-row mb-0",role:"toolbar","aria-label":"Window",children:m_e.map(C=>l.jsx("button",{type:"button",className:`filter-chip ${a===C.value?"filter-chip-active":""}`,"aria-pressed":a===C.value,onClick:()=>o(C.value),children:C.label},C.value))}),l.jsx("div",{className:"filter-row mb-0",role:"toolbar","aria-label":"Event kind",children:["all",xs.crawler,xs["ai-referral"]].map(C=>l.jsx("button",{type:"button",className:`filter-chip ${r===C?"filter-chip-active":""}`,"aria-pressed":r===C,onClick:()=>i(C),children:C==="all"?"All":C==="crawler"?"Crawler":"AI referral"},C))})]})]}),l.jsx(ze,{className:"p-4",children:k.length===0?l.jsx("p",{className:"py-12 text-center text-xs text-zinc-500",children:"No events in this window."}):l.jsx("div",{className:"h-72",children:l.jsx(Oy,{children:l.jsxs(UOe,{data:k,children:[l.jsx(iF,{stroke:FOe,strokeDasharray:"3 3"}),l.jsx(Ih,{dataKey:"label",tick:Ao,stroke:od}),l.jsx(Lh,{tick:Ao,stroke:od,allowDecimals:!1}),l.jsx(ev,{...Uu}),l.jsx(wC,{wrapperStyle:{fontSize:11}}),l.jsx(uN,{dataKey:"crawler",name:"Crawler",fill:g_e,stackId:"a"}),l.jsx(uN,{dataKey:"aiReferral",name:"AI referral",fill:y_e,stackId:"a"})]})})})})]}),l.jsxs("section",{children:[l.jsx("p",{className:"mb-4 text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:"Event rows"}),l.jsx(b_e,{events:b})]})]})}function x_e(e){const t=new Map;for(const n of e){let r=t.get(n.tsHour);r||(r={hour:n.tsHour,label:FF(n.tsHour),crawler:0,aiReferral:0},t.set(n.tsHour,r)),n.kind===xs.crawler?r.crawler+=n.hits:r.aiReferral+=n.hits}return[...t.values()].sort((n,r)=>n.hour<r.hour?-1:n.hour>r.hour?1:0)}function b_e({events:e}){return e.length===0?l.jsx(ze,{className:"p-6 text-center text-sm text-zinc-500",children:"No event rows match the current filters."}):l.jsx("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{className:"bg-zinc-900/50 text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-4 py-2 text-left",children:"Hour"}),l.jsx("th",{className:"px-4 py-2 text-left",children:"Kind"}),l.jsx("th",{className:"px-4 py-2 text-left",children:"Identity"}),l.jsx("th",{className:"px-4 py-2 text-left",children:"Evidence / status"}),l.jsx("th",{className:"px-4 py-2 text-left",children:"Path"}),l.jsx("th",{className:"px-4 py-2 text-right",children:"Hits"})]})}),l.jsx("tbody",{className:"divide-y divide-zinc-800/60",children:e.map((t,n)=>l.jsxs("tr",{className:"hover:bg-zinc-900/40 transition-colors",children:[l.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zinc-300",children:FF(t.tsHour)}),l.jsx("td",{className:"px-4 py-2 text-zinc-300",children:t.kind===xs.crawler?"Crawler":"AI referral"}),l.jsxs("td",{className:"px-4 py-2 text-zinc-100",children:[t.kind===xs.crawler?t.botId:t.product,l.jsx("span",{className:"ml-2 text-[11px] text-zinc-500",children:t.operator})]}),l.jsx("td",{className:"px-4 py-2 text-zinc-300",children:t.kind===xs.crawler?`${t.verificationStatus} · HTTP ${t.status}`:`${t.evidenceType} · ${t.sourceDomain}`}),l.jsx("td",{className:"px-4 py-2 truncate font-mono text-xs text-zinc-300",children:t.kind===xs.crawler?t.pathNormalized:t.landingPathNormalized}),l.jsx("td",{className:"px-4 py-2 text-right tabular-nums text-zinc-100",children:t.hits})]},`${t.kind}:${t.tsHour}:${n}`))})]})})}function w_e(){return l.jsx("div",{className:"page-container",children:l.jsx("section",{className:"page-section",children:l.jsxs(ze,{className:"surface-card empty-card",children:[l.jsx("h1",{children:"Route not found"}),l.jsx("p",{children:"The current path does not map to a dashboard view."}),l.jsx(me,{asChild:!0,children:l.jsx(At,{to:"/",children:"Return to overview"})})]})})})}function S_e(){return l.jsx(vue,{children:l.jsx(yue,{})})}const Jr=NG()({component:S_e,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),j_e=br({getParentRoute:()=>Jr,path:"/",component:wue,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Pe.projects.all);if(t&&t.length===0)throw zN({to:"/setup"})}}),N_e=br({getParentRoute:()=>Jr,path:"/projects",component:Pde}),Od=br({getParentRoute:()=>Jr,path:"/projects/$projectId",component:()=>l.jsx(BN,{})}),k_e=br({getParentRoute:()=>Od,path:"/",component:()=>l.jsx(hp,{tab:"overview"})}),C_e=br({getParentRoute:()=>Od,path:"/search-console",component:()=>l.jsx(hp,{tab:"search-console"})}),A_e=br({getParentRoute:()=>Od,path:"/report",component:()=>l.jsx(hp,{tab:"report"})}),O_e=br({getParentRoute:()=>Od,path:"/activity",component:()=>l.jsx(hp,{tab:"activity"})}),E_e=br({getParentRoute:()=>Od,path:"/inbound",component:()=>l.jsx(hp,{tab:"inbound"})}),__e=br({getParentRoute:()=>Jr,path:"/runs",component:e_e}),z_e=br({getParentRoute:()=>Jr,path:"/settings",component:a_e,beforeLoad:({context:e})=>{}}),T_e=br({getParentRoute:()=>Jr,path:"/setup",component:l_e,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Pe.projects.all);if(t&&t.length>0)throw zN({to:"/"})}}),P_e=br({getParentRoute:()=>Jr,path:"/backlinks",component:u_e}),R_e=br({getParentRoute:()=>Jr,path:"/traffic",component:h_e}),D_e=br({getParentRoute:()=>Jr,path:"/traffic/$projectName/$sourceId",component:v_e}),M_e=br({getParentRoute:()=>Jr,path:"*",component:w_e}),I_e=Jr.addChildren([j_e,N_e,Od.addChildren([k_e,C_e,A_e,O_e,E_e]),__e,z_e,T_e,P_e,R_e,D_e,M_e]);function L_e(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const AL=L_e(),$_e=AL==="/"?"":AL.replace(/\/$/,"");function B_e(e,t){return RG({routeTree:I_e,basepath:$_e||"/",context:{queryClient:e},...t?.initialEntries})}const HF=yQ(),U_e=B_e(HF),KF=document.getElementById("root");if(!KF)throw new Error("Expected #root element for web app bootstrap.");function q_e(){const[e,t]=x.useState(h2()?"ready":"checking"),[n,r]=x.useState(""),[i,a]=x.useState(""),[o,u]=x.useState(null),[d,f]=x.useState(!1);x.useEffect(()=>{if(h2())return;let y=!1;return tV().then(v=>{y||(v.authenticated?t("ready"):t(v.setupRequired?"setup":"login"))}).catch(v=>{y||(u(v instanceof Error?v.message:"Failed to reach the Canonry API"),t("login"))}),()=>{y=!0}},[]);const p=async y=>{if(y.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 nV(n.trim())).authenticated){u("Setup failed");return}r(""),a(""),t("ready")}catch(v){u(v instanceof vr||v instanceof Error?v.message:"Setup failed")}finally{f(!1)}},m=async y=>{if(y.preventDefault(),!!n.trim()){f(!0),u(null);try{if(!(await rV(n.trim())).authenticated){u("Incorrect password");return}r(""),t("ready")}catch(v){u(v instanceof vr||v instanceof Error?v.message:"Authentication failed")}finally{f(!1)}}};return e==="ready"?l.jsx(PK,{client:HF,children:l.jsx(IG,{router:U_e})}):l.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:l.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:l.jsx(ze,{className:"surface-card w-full",children:e==="checking"?l.jsx(Ag,{className:"py-8",children:l.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?l.jsxs(l.Fragment,{children:[l.jsxs(u1,{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),l.jsx(d1,{children:"Create a dashboard password"}),l.jsx(f1,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),l.jsx(Ag,{children:l.jsxs("form",{className:"space-y-4",onSubmit:p,children:[l.jsxs("label",{className:"block space-y-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),l.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:n,onChange:y=>r(y.target.value),placeholder:"At least 8 characters"})]}),l.jsxs("label",{className:"block space-y-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),l.jsx("input",{className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:y=>a(y.target.value),placeholder:"Re-enter password"})]}),o?l.jsx("p",{className:"text-sm text-rose-400",children:o}):null,l.jsx(me,{type:"submit",disabled:d||!n.trim()||!i.trim(),children:d?"Setting up…":"Create password & open dashboard"})]})})]}):l.jsxs(l.Fragment,{children:[l.jsxs(u1,{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),l.jsx(d1,{children:"Sign in to Canonry"}),l.jsx(f1,{children:"Enter your dashboard password to continue."})]}),l.jsx(Ag,{children:l.jsxs("form",{className:"space-y-4",onSubmit:m,children:[l.jsxs("label",{className:"block space-y-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),l.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:n,onChange:y=>r(y.target.value),placeholder:"Dashboard password"})]}),o?l.jsx("p",{className:"text-sm text-rose-400",children:o}):null,l.jsx(me,{type:"submit",disabled:d||!n.trim(),children:d?"Signing in…":"Open dashboard"})]})})]})})})})}lK.createRoot(KF).render(l.jsx(x.StrictMode,{children:l.jsx(q_e,{})}));
|