@ainyc/canonry 4.30.0 → 4.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -13
- package/assets/agent-workspace/skills/aero/SKILL.md +2 -2
- package/assets/agent-workspace/skills/aero/references/aeo-discovery.md +26 -17
- package/assets/agent-workspace/skills/aero/references/memory-patterns.md +9 -9
- package/assets/agent-workspace/skills/aero/references/orchestration.md +6 -6
- package/assets/agent-workspace/skills/aero/references/reporting.md +3 -3
- package/assets/agent-workspace/skills/canonry/SKILL.md +5 -3
- package/assets/agent-workspace/skills/canonry/references/aeo-analysis.md +9 -9
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +203 -200
- package/assets/agent-workspace/skills/canonry/references/indexing.md +35 -35
- package/assets/agent-workspace/skills/canonry/references/server-side-traffic.md +18 -18
- package/assets/agent-workspace/skills/canonry/references/wordpress-integration.md +11 -11
- package/assets/assets/index-C4UBTDDS.js +302 -0
- package/assets/assets/{index-BnALDZI7.css → index-CNKAwZMB.css} +1 -1
- package/assets/index.html +2 -2
- package/dist/{chunk-NIAAHWRF.js → chunk-5STLZRGB.js} +5 -3
- package/dist/{chunk-7UO3EGDB.js → chunk-HTNC6AWN.js} +24 -2
- package/dist/{chunk-PTFVEYUX.js → chunk-PUTJHEVR.js} +130 -13
- package/dist/{chunk-4EDC2P3J.js → chunk-U3YKRV47.js} +1 -1
- package/dist/cli.js +55 -14
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-ASXADXLF.js → intelligence-service-CJONZ7ST.js} +2 -2
- package/dist/mcp.js +2 -2
- package/package.json +8 -7
- package/assets/assets/index-BYiZYtd9.js +0 -302
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
function _K(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function ya(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fw={exports:{}},Cf={};var Lz;function zK(){if(Lz)return Cf;Lz=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+i.key),"key"in i){a={};for(var c in i)c!=="key"&&(a[c]=i[c])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:a}}return Cf.Fragment=t,Cf.jsx=n,Cf.jsxs=n,Cf}var $z;function TK(){return $z||($z=1,fw.exports=zK()),fw.exports}var s=TK(),hw={exports:{}},nt={};var Bz;function PK(){if(Bz)return nt;Bz=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=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(D){return D===null||typeof D!="object"?null:(D=y&&D[y]||D["@@iterator"],typeof D=="function"?D:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,j={};function k(D,U,I){this.props=D,this.context=U,this.refs=j,this.updater=I||w}k.prototype.isReactComponent={},k.prototype.setState=function(D,U){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,U,"setState")},k.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function E(){}E.prototype=k.prototype;function O(D,U,I){this.props=D,this.context=U,this.refs=j,this.updater=I||w}var C=O.prototype=new E;C.constructor=O,b(C,k.prototype),C.isPureReactComponent=!0;var z=Array.isArray;function A(){}var _={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function $(D,U,I){var V=I.ref;return{$$typeof:e,type:D,key:U,ref:V!==void 0?V:null,props:I}}function F(D,U){return $(D.type,U,D.props)}function q(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function B(D){var U={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(I){return U[I]})}var K=/\/+/g;function X(D,U){return typeof D=="object"&&D!==null&&D.key!=null?B(""+D.key):U.toString(36)}function Q(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(A,A):(D.status="pending",D.then(function(U){D.status==="pending"&&(D.status="fulfilled",D.value=U)},function(U){D.status==="pending"&&(D.status="rejected",D.reason=U)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function H(D,U,I,V,ce){var re=typeof D;(re==="undefined"||re==="boolean")&&(D=null);var ke=!1;if(D===null)ke=!0;else switch(re){case"bigint":case"string":case"number":ke=!0;break;case"object":switch(D.$$typeof){case e:case t:ke=!0;break;case p:return ke=D._init,H(ke(D._payload),U,I,V,ce)}}if(ke)return ce=ce(D),ke=V===""?"."+X(D,0):V,z(ce)?(I="",ke!=null&&(I=ke.replace(K,"$&/")+"/"),H(ce,U,I,"",function(fe){return fe})):ce!=null&&(q(ce)&&(ce=F(ce,I+(ce.key==null||D&&D.key===ce.key?"":(""+ce.key).replace(K,"$&/")+"/")+ke)),U.push(ce)),1;ke=0;var ze=V===""?".":V+":";if(z(D))for(var te=0;te<D.length;te++)V=D[te],re=ze+X(V,te),ke+=H(V,U,I,re,ce);else if(te=v(D),typeof te=="function")for(D=te.call(D),te=0;!(V=D.next()).done;)V=V.value,re=ze+X(V,te++),ke+=H(V,U,I,re,ce);else if(re==="object"){if(typeof D.then=="function")return H(Q(D),U,I,V,ce);throw U=String(D),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ke}function J(D,U,I){if(D==null)return D;var V=[],ce=0;return H(D,V,"","",function(re){return U.call(I,re,ce++)}),V}function de(D){if(D._status===-1){var U=D._result;U=U(),U.then(function(I){(D._status===0||D._status===-1)&&(D._status=1,D._result=I)},function(I){(D._status===0||D._status===-1)&&(D._status=2,D._result=I)}),D._status===-1&&(D._status=0,D._result=U)}if(D._status===1)return D._result.default;throw D._result}var be=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},M={map:J,forEach:function(D,U,I){J(D,function(){U.apply(this,arguments)},I)},count:function(D){var U=0;return J(D,function(){U++}),U},toArray:function(D){return J(D,function(U){return U})||[]},only:function(D){if(!q(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return nt.Activity=m,nt.Children=M,nt.Component=k,nt.Fragment=n,nt.Profiler=i,nt.PureComponent=O,nt.StrictMode=r,nt.Suspense=d,nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,nt.__COMPILER_RUNTIME={__proto__:null,c:function(D){return _.H.useMemoCache(D)}},nt.cache=function(D){return function(){return D.apply(null,arguments)}},nt.cacheSignal=function(){return null},nt.cloneElement=function(D,U,I){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var V=b({},D.props),ce=D.key;if(U!=null)for(re in U.key!==void 0&&(ce=""+U.key),U)!R.call(U,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&U.ref===void 0||(V[re]=U[re]);var re=arguments.length-2;if(re===1)V.children=I;else if(1<re){for(var ke=Array(re),ze=0;ze<re;ze++)ke[ze]=arguments[ze+2];V.children=ke}return $(D.type,ce,V)},nt.createContext=function(D){return D={$$typeof:l,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:a,_context:D},D},nt.createElement=function(D,U,I){var V,ce={},re=null;if(U!=null)for(V in U.key!==void 0&&(re=""+U.key),U)R.call(U,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(ce[V]=U[V]);var ke=arguments.length-2;if(ke===1)ce.children=I;else if(1<ke){for(var ze=Array(ke),te=0;te<ke;te++)ze[te]=arguments[te+2];ce.children=ze}if(D&&D.defaultProps)for(V in ke=D.defaultProps,ke)ce[V]===void 0&&(ce[V]=ke[V]);return $(D,re,ce)},nt.createRef=function(){return{current:null}},nt.forwardRef=function(D){return{$$typeof:c,render:D}},nt.isValidElement=q,nt.lazy=function(D){return{$$typeof:p,_payload:{_status:-1,_result:D},_init:de}},nt.memo=function(D,U){return{$$typeof:f,type:D,compare:U===void 0?null:U}},nt.startTransition=function(D){var U=_.T,I={};_.T=I;try{var V=D(),ce=_.S;ce!==null&&ce(I,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(A,be)}catch(re){be(re)}finally{U!==null&&I.types!==null&&(U.types=I.types),_.T=U}},nt.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},nt.use=function(D){return _.H.use(D)},nt.useActionState=function(D,U,I){return _.H.useActionState(D,U,I)},nt.useCallback=function(D,U){return _.H.useCallback(D,U)},nt.useContext=function(D){return _.H.useContext(D)},nt.useDebugValue=function(){},nt.useDeferredValue=function(D,U){return _.H.useDeferredValue(D,U)},nt.useEffect=function(D,U){return _.H.useEffect(D,U)},nt.useEffectEvent=function(D){return _.H.useEffectEvent(D)},nt.useId=function(){return _.H.useId()},nt.useImperativeHandle=function(D,U,I){return _.H.useImperativeHandle(D,U,I)},nt.useInsertionEffect=function(D,U){return _.H.useInsertionEffect(D,U)},nt.useLayoutEffect=function(D,U){return _.H.useLayoutEffect(D,U)},nt.useMemo=function(D,U){return _.H.useMemo(D,U)},nt.useOptimistic=function(D,U){return _.H.useOptimistic(D,U)},nt.useReducer=function(D,U,I){return _.H.useReducer(D,U,I)},nt.useRef=function(D){return _.H.useRef(D)},nt.useState=function(D){return _.H.useState(D)},nt.useSyncExternalStore=function(D,U,I){return _.H.useSyncExternalStore(D,U,I)},nt.useTransition=function(){return _.H.useTransition()},nt.version="19.2.4",nt}var Uz;function gd(){return Uz||(Uz=1,hw.exports=PK()),hw.exports}var x=gd();const qi=ya(x),wv=_K({__proto__:null,default:qi},[x]);var pw={exports:{}},Af={},mw={exports:{}},gw={};var qz;function RK(){return qz||(qz=1,(function(e){function t(H,J){var de=H.length;H.push(J);e:for(;0<de;){var be=de-1>>>1,M=H[be];if(0<i(M,J))H[be]=J,H[de]=M,de=be;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],de=H.pop();if(de!==J){H[0]=de;e:for(var be=0,M=H.length,D=M>>>1;be<D;){var U=2*(be+1)-1,I=H[U],V=U+1,ce=H[V];if(0>i(I,de))V<M&&0>i(ce,I)?(H[be]=ce,H[V]=de,be=V):(H[be]=I,H[U]=de,be=U);else if(V<M&&0>i(ce,de))H[be]=ce,H[V]=de,be=V;else break e}}return J}function i(H,J){var de=H.sortIndex-J.sortIndex;return de!==0?de:H.id-J.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}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,O=typeof setImmediate<"u"?setImmediate:null;function C(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 z(H){if(b=!1,C(H),!w)if(n(d)!==null)w=!0,A||(A=!0,B());else{var J=n(f);J!==null&&Q(z,J.startTime-H)}}var A=!1,_=-1,R=5,$=-1;function F(){return j?!0:!(e.unstable_now()-$<R)}function q(){if(j=!1,A){var H=e.unstable_now();$=H;var J=!0;try{e:{w=!1,b&&(b=!1,E(_),_=-1),v=!0;var de=y;try{t:{for(C(H),m=n(d);m!==null&&!(m.expirationTime>H&&F());){var be=m.callback;if(typeof be=="function"){m.callback=null,y=m.priorityLevel;var M=be(m.expirationTime<=H);if(H=e.unstable_now(),typeof M=="function"){m.callback=M,C(H),J=!0;break t}m===n(d)&&r(d),C(H)}else r(d);m=n(d)}if(m!==null)J=!0;else{var D=n(f);D!==null&&Q(z,D.startTime-H),J=!1}}break e}finally{m=null,y=de,v=!1}J=void 0}}finally{J?B():A=!1}}}var B;if(typeof O=="function")B=function(){O(q)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,X=K.port2;K.port1.onmessage=q,B=function(){X.postMessage(null)}}else B=function(){k(q,0)};function Q(H,J){_=k(function(){H(e.unstable_now())},J)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):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 de=y;y=J;try{return H()}finally{y=de}},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 de=y;y=H;try{return J()}finally{y=de}},e.unstable_scheduleCallback=function(H,J,de){var be=e.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?be+de:be):de=be,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=de+M,H={id:p++,callback:J,priorityLevel:H,startTime:de,expirationTime:M,sortIndex:-1},de>be?(H.sortIndex=de,t(f,H),n(d)===null&&H===n(f)&&(b?(E(_),_=-1):b=!0,Q(z,de-be))):(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 de=y;y=J;try{return H.apply(this,arguments)}finally{y=de}}}})(gw)),gw}var Fz;function DK(){return Fz||(Fz=1,mw.exports=RK()),mw.exports}var yw={exports:{}},kr={};var Hz;function IK(){if(Hz)return kr;Hz=1;var e=gd();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(d,f,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:d,containerInfo:f,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return kr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,kr.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)},kr.flushSync=function(d){var f=l.T,p=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=f,r.p=p,r.d.f()}},kr.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))},kr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},kr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,m=c(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})}},kr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=c(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)},kr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,m=c(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})}},kr.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=c(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)},kr.requestFormReset=function(d){r.d.r(d)},kr.unstable_batchedUpdates=function(d,f){return d(f)},kr.useFormState=function(d,f,p){return l.H.useFormState(d,f,p)},kr.useFormStatus=function(){return l.H.useHostTransitionStatus()},kr.version="19.2.4",kr}var Kz;function a5(){if(Kz)return yw.exports;Kz=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(),yw.exports=IK(),yw.exports}var Gz;function MK(){if(Gz)return Af;Gz=1;var e=DK(),t=gd(),n=a5();function r(o){var u="https://react.dev/errors/"+o;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)u+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+o+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function a(o){var u=o,h=o;if(o.alternate)for(;u.return;)u=u.return;else{o=u;do u=o,(u.flags&4098)!==0&&(h=u.return),o=u.return;while(o)}return u.tag===3?h:null}function l(o){if(o.tag===13){var u=o.memoizedState;if(u===null&&(o=o.alternate,o!==null&&(u=o.memoizedState)),u!==null)return u.dehydrated}return null}function c(o){if(o.tag===31){var u=o.memoizedState;if(u===null&&(o=o.alternate,o!==null&&(u=o.memoizedState)),u!==null)return u.dehydrated}return null}function d(o){if(a(o)!==o)throw Error(r(188))}function f(o){var u=o.alternate;if(!u){if(u=a(o),u===null)throw Error(r(188));return u!==o?null:o}for(var h=o,g=u;;){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),o;if(N===g)return d(S),u;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?o:u}function p(o){var u=o.tag;if(u===5||u===26||u===27||u===6)return o;for(o=o.child;o!==null;){if(u=p(o),u!==null)return u;o=o.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"),O=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function B(o){return o===null||typeof o!="object"?null:(o=q&&o[q]||o["@@iterator"],typeof o=="function"?o:null)}var K=Symbol.for("react.client.reference");function X(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===K?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case b:return"Fragment";case k:return"Profiler";case j:return"StrictMode";case z:return"Suspense";case A:return"SuspenseList";case $:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case w:return"Portal";case O:return o.displayName||"Context";case E:return(o._context.displayName||"Context")+".Consumer";case C:var u=o.render;return o=o.displayName,o||(o=u.displayName||u.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case _:return u=o.displayName||null,u!==null?u:X(o.type)||"Memo";case R:u=o._payload,o=o._init;try{return X(o(u))}catch{}}return null}var Q=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,de={pending:!1,data:null,method:null,action:null},be=[],M=-1;function D(o){return{current:o}}function U(o){0>M||(o.current=be[M],be[M]=null,M--)}function I(o,u){M++,be[M]=o.current,o.current=u}var V=D(null),ce=D(null),re=D(null),ke=D(null);function ze(o,u){switch(I(re,u),I(ce,o),I(V,null),u.nodeType){case 9:case 11:o=(o=u.documentElement)&&(o=o.namespaceURI)?oz(o):0;break;default:if(o=u.tagName,u=u.namespaceURI)u=oz(u),o=lz(u,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}U(V),I(V,o)}function te(){U(V),U(ce),U(re)}function fe(o){o.memoizedState!==null&&I(ke,o);var u=V.current,h=lz(u,o.type);u!==h&&(I(ce,o),I(V,h))}function Ee(o){ce.current===o&&(U(V),U(ce)),ke.current===o&&(U(ke),Sf._currentValue=de)}var Z,Ge;function Me(o){if(Z===void 0)try{throw Error()}catch(h){var u=h.stack.trim().match(/\n( *(at )?)/);Z=u&&u[1]||"",Ge=-1<h.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+Z+o+Ge}var lt=!1;function Te(o,u){if(!o||lt)return"";lt=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(u){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(he){var ue=he}Reflect.construct(o,[],xe)}else{try{xe.call()}catch(he){ue=he}o.call(xe.prototype)}}else{try{throw Error()}catch(he){ue=he}(xe=o())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(he){if(he&&ue&&typeof he.stack=="string")return[he.stack,ue.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 G=T.split(`
|
|
4
|
-
`),se=L.split(`
|
|
5
|
-
`);for(S=g=0;g<G.length&&!G[g].includes("DetermineComponentFrameRoot");)g++;for(;S<se.length&&!se[S].includes("DetermineComponentFrameRoot");)S++;if(g===G.length||S===se.length)for(g=G.length-1,S=se.length-1;1<=g&&0<=S&&G[g]!==se[S];)S--;for(;1<=g&&0<=S;g--,S--)if(G[g]!==se[S]){if(g!==1||S!==1)do if(g--,S--,0>S||G[g]!==se[S]){var me=`
|
|
6
|
-
`+G[g].replace(" at new "," at ");return o.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",o.displayName)),me}while(1<=g&&0<=S);break}}}finally{lt=!1,Error.prepareStackTrace=h}return(h=o?o.displayName||o.name:"")?Me(h):""}function Wt(o,u){switch(o.tag){case 26:case 27:case 5:return Me(o.type);case 16:return Me("Lazy");case 13:return o.child!==u&&u!==null?Me("Suspense Fallback"):Me("Suspense");case 19:return Me("SuspenseList");case 0:case 15:return Te(o.type,!1);case 11:return Te(o.type.render,!1);case 1:return Te(o.type,!0);case 31:return Me("Activity");default:return""}}function Ht(o){try{var u="",h=null;do u+=Wt(o,h),h=o,o=o.return;while(o);return u}catch(g){return`
|
|
7
|
-
Error generating stack: `+g.message+`
|
|
8
|
-
`+g.stack}}var on=Object.prototype.hasOwnProperty,en=e.unstable_scheduleCallback,_n=e.unstable_cancelCallback,ve=e.unstable_shouldYield,ft=e.unstable_requestPaint,Ye=e.unstable_now,rt=e.unstable_getCurrentPriorityLevel,ae=e.unstable_ImmediatePriority,Se=e.unstable_UserBlockingPriority,$e=e.unstable_NormalPriority,Ze=e.unstable_LowPriority,Xe=e.unstable_IdlePriority,Bn=e.log,fn=e.unstable_setDisableYieldValue,jn=null,Kt=null;function zn(o){if(typeof Bn=="function"&&fn(o),Kt&&typeof Kt.setStrictMode=="function")try{Kt.setStrictMode(jn,o)}catch{}}var pt=Math.clz32?Math.clz32:rr,br=Math.log,Ce=Math.LN2;function rr(o){return o>>>=0,o===0?32:31-(br(o)/Ce|0)|0}var Sa=256,Ei=262144,ir=4194304;function je(o){var u=o&42;if(u!==0)return u;switch(o&-o){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 o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function De(o,u,h){var g=o.pendingLanes;if(g===0)return 0;var S=0,N=o.suspendedLanes,T=o.pingedLanes;o=o.warmLanes;var L=g&134217727;return L!==0?(g=L&~N,g!==0?S=je(g):(T&=L,T!==0?S=je(T):h||(h=L&~o,h!==0&&(S=je(h))))):(L=g&~N,L!==0?S=je(L):T!==0?S=je(T):h||(h=g&~o,h!==0&&(S=je(h)))),S===0?0:u!==0&&u!==S&&(u&N)===0&&(N=S&-S,h=u&-u,N>=h||N===32&&(h&4194048)!==0)?u:S}function Je(o,u){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&u)===0}function Qe(o,u){switch(o){case 1:case 2:case 4:case 8:case 64:return u+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 u+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 yt(){var o=ir;return ir<<=1,(ir&62914560)===0&&(ir=4194304),o}function Za(o){for(var u=[],h=0;31>h;h++)u.push(o);return u}function Gt(o,u){o.pendingLanes|=u,u!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function wr(o,u,h,g,S,N){var T=o.pendingLanes;o.pendingLanes=h,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=h,o.entangledLanes&=h,o.errorRecoveryDisabledLanes&=h,o.shellSuspendCounter=0;var L=o.entanglements,G=o.expirationTimes,se=o.hiddenUpdates;for(h=T&~h;0<h;){var me=31-pt(h),xe=1<<me;L[me]=0,G[me]=-1;var ue=se[me];if(ue!==null)for(se[me]=null,me=0;me<ue.length;me++){var he=ue[me];he!==null&&(he.lane&=-536870913)}h&=~xe}g!==0&&na(o,g,0),N!==0&&S===0&&o.tag!==0&&(o.suspendedLanes|=N&~(T&~u))}function na(o,u,h){o.pendingLanes|=u,o.suspendedLanes&=~u;var g=31-pt(u);o.entangledLanes|=u,o.entanglements[g]=o.entanglements[g]|1073741824|h&261930}function Us(o,u){var h=o.entangledLanes|=u;for(o=o.entanglements;h;){var g=31-pt(h),S=1<<g;S&u|o[g]&u&&(o[g]|=u),h&=~S}}function Sr(o,u){var h=u&-u;return h=(h&42)!==0?1:qs(h),(h&(o.suspendedLanes|u))!==0?0:h}function qs(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function Nc(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function Md(){var o=J.p;return o!==0?o:(o=window.event,o===void 0?32:zz(o.type))}function Sp(o,u){var h=J.p;try{return J.p=o,u()}finally{J.p=h}}var hi=Math.random().toString(36).slice(2),Tn="__reactFiber$"+hi,jr="__reactProps$"+hi,Xa="__reactContainer$"+hi,kc="__reactEvents$"+hi,rx="__reactListeners$"+hi,ix="__reactHandles$"+hi,jp="__reactResources$"+hi,Xo="__reactMarker$"+hi;function Cc(o){delete o[Tn],delete o[jr],delete o[kc],delete o[rx],delete o[ix]}function W(o){var u=o[Tn];if(u)return u;for(var h=o.parentNode;h;){if(u=h[Xa]||h[Tn]){if(h=u.alternate,u.child!==null||h!==null&&h.child!==null)for(o=mz(o);o!==null;){if(h=o[Tn])return h;o=mz(o)}return u}o=h,h=o.parentNode}return null}function Ae(o){if(o=o[Tn]||o[Xa]){var u=o.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return o}return null}function at(o){var u=o.tag;if(u===5||u===26||u===27||u===6)return o.stateNode;throw Error(r(33))}function kt(o){var u=o[jp];return u||(u=o[jp]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function wt(o){o[Xo]=!0}var ra=new Set,Mr={};function Wr(o,u){Un(o,u),Un(o+"Capture",u)}function Un(o,u){for(Mr[o]=u,o=0;o<u.length;o++)ra.add(u[o])}var ax=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]*$"),Ja={},Fs={};function Ac(o){return on.call(Fs,o)?!0:on.call(Ja,o)?!1:ax.test(o)?Fs[o]=!0:(Ja[o]=!0,!1)}function Jo(o,u,h){if(Ac(u))if(h===null)o.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":o.removeAttribute(u);return;case"boolean":var g=u.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){o.removeAttribute(u);return}}o.setAttribute(u,""+h)}}function Ec(o,u,h){if(h===null)o.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(u);return}o.setAttribute(u,""+h)}}function Yr(o,u,h,g){if(g===null)o.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(h);return}o.setAttributeNS(u,h,""+g)}}function ar(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Np(o){var u=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function sx(o,u,h){var g=Object.getOwnPropertyDescriptor(o.constructor.prototype,u);if(!o.hasOwnProperty(u)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var S=g.get,N=g.set;return Object.defineProperty(o,u,{configurable:!0,get:function(){return S.call(this)},set:function(T){h=""+T,N.call(this,T)}}),Object.defineProperty(o,u,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(T){h=""+T},stopTracking:function(){o._valueTracker=null,delete o[u]}}}}function vt(o){if(!o._valueTracker){var u=Np(o)?"checked":"value";o._valueTracker=sx(o,u,""+o[u])}}function $t(o){if(!o)return!1;var u=o._valueTracker;if(!u)return!0;var h=u.getValue(),g="";return o&&(g=Np(o)?o.checked?"true":"false":o.value),o=g,o!==h?(u.setValue(o),!0):!1}function Nr(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var ja=/[\n"\\]/g;function sr(o){return o.replace(ja,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function Oc(o,u,h,g,S,N,T,L){o.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?o.type=T:o.removeAttribute("type"),u!=null?T==="number"?(u===0&&o.value===""||o.value!=u)&&(o.value=""+ar(u)):o.value!==""+ar(u)&&(o.value=""+ar(u)):T!=="submit"&&T!=="reset"||o.removeAttribute("value"),u!=null?ox(o,T,ar(u)):h!=null?ox(o,T,ar(h)):g!=null&&o.removeAttribute("value"),S==null&&N!=null&&(o.defaultChecked=!!N),S!=null&&(o.checked=S&&typeof S!="function"&&typeof S!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?o.name=""+ar(L):o.removeAttribute("name")}function tE(o,u,h,g,S,N,T,L){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(o.type=N),u!=null||h!=null){if(!(N!=="submit"&&N!=="reset"||u!=null)){vt(o);return}h=h!=null?""+ar(h):"",u=u!=null?""+ar(u):h,L||u===o.value||(o.value=u),o.defaultValue=u}g=g??S,g=typeof g!="function"&&typeof g!="symbol"&&!!g,o.checked=L?o.checked:!!g,o.defaultChecked=!!g,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(o.name=T),vt(o)}function ox(o,u,h){u==="number"&&Nr(o.ownerDocument)===o||o.defaultValue===""+h||(o.defaultValue=""+h)}function _c(o,u,h,g){if(o=o.options,u){u={};for(var S=0;S<h.length;S++)u["$"+h[S]]=!0;for(h=0;h<o.length;h++)S=u.hasOwnProperty("$"+o[h].value),o[h].selected!==S&&(o[h].selected=S),S&&g&&(o[h].defaultSelected=!0)}else{for(h=""+ar(h),u=null,S=0;S<o.length;S++){if(o[S].value===h){o[S].selected=!0,g&&(o[S].defaultSelected=!0);return}u!==null||o[S].disabled||(u=o[S])}u!==null&&(u.selected=!0)}}function nE(o,u,h){if(u!=null&&(u=""+ar(u),u!==o.value&&(o.value=u),h==null)){o.defaultValue!==u&&(o.defaultValue=u);return}o.defaultValue=h!=null?""+ar(h):""}function rE(o,u,h,g){if(u==null){if(g!=null){if(h!=null)throw Error(r(92));if(Q(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),u=h}h=ar(u),o.defaultValue=h,g=o.textContent,g===h&&g!==""&&g!==null&&(o.value=g),vt(o)}function zc(o,u){if(u){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=u;return}}o.textContent=u}var k9=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 iE(o,u,h){var g=u.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?o.setProperty(u,""):u==="float"?o.cssFloat="":o[u]="":g?o.setProperty(u,h):typeof h!="number"||h===0||k9.has(u)?u==="float"?o.cssFloat=h:o[u]=(""+h).trim():o[u]=h+"px"}function aE(o,u,h){if(u!=null&&typeof u!="object")throw Error(r(62));if(o=o.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||u!=null&&u.hasOwnProperty(g)||(g.indexOf("--")===0?o.setProperty(g,""):g==="float"?o.cssFloat="":o[g]="");for(var S in u)g=u[S],u.hasOwnProperty(S)&&h[S]!==g&&iE(o,S,g)}else for(var N in u)u.hasOwnProperty(N)&&iE(o,N,u[N])}function lx(o){if(o.indexOf("-")===-1)return!1;switch(o){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 C9=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"]]),A9=/^[\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 kp(o){return A9.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function es(){}var cx=null;function ux(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Tc=null,Pc=null;function sE(o){var u=Ae(o);if(u&&(o=u.stateNode)){var h=o[jr]||null;e:switch(o=u.stateNode,u.type){case"input":if(Oc(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),u=h.name,h.type==="radio"&&u!=null){for(h=o;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+sr(""+u)+'"][type="radio"]'),u=0;u<h.length;u++){var g=h[u];if(g!==o&&g.form===o.form){var S=g[jr]||null;if(!S)throw Error(r(90));Oc(g,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name)}}for(u=0;u<h.length;u++)g=h[u],g.form===o.form&&$t(g)}break e;case"textarea":nE(o,h.value,h.defaultValue);break e;case"select":u=h.value,u!=null&&_c(o,!!h.multiple,u,!1)}}}var dx=!1;function oE(o,u,h){if(dx)return o(u,h);dx=!0;try{var g=o(u);return g}finally{if(dx=!1,(Tc!==null||Pc!==null)&&(fm(),Tc&&(u=Tc,o=Pc,Pc=Tc=null,sE(u),o)))for(u=0;u<o.length;u++)sE(o[u])}}function Ld(o,u){var h=o.stateNode;if(h===null)return null;var g=h[jr]||null;if(g===null)return null;h=g[u];e:switch(u){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)||(o=o.type,g=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!g;break e;default:o=!1}if(o)return null;if(h&&typeof h!="function")throw Error(r(231,u,typeof h));return h}var ts=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fx=!1;if(ts)try{var $d={};Object.defineProperty($d,"passive",{get:function(){fx=!0}}),window.addEventListener("test",$d,$d),window.removeEventListener("test",$d,$d)}catch{fx=!1}var Hs=null,hx=null,Cp=null;function lE(){if(Cp)return Cp;var o,u=hx,h=u.length,g,S="value"in Hs?Hs.value:Hs.textContent,N=S.length;for(o=0;o<h&&u[o]===S[o];o++);var T=h-o;for(g=1;g<=T&&u[h-g]===S[N-g];g++);return Cp=S.slice(o,1<g?1-g:void 0)}function Ap(o){var u=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&u===13&&(o=13)):o=u,o===10&&(o=13),32<=o||o===13?o:0}function Ep(){return!0}function cE(){return!1}function Zr(o){function u(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 o)o.hasOwnProperty(L)&&(h=o[L],this[L]=h?h(N):N[L]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?Ep:cE,this.isPropagationStopped=cE,this}return m(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Ep)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Ep)},persist:function(){},isPersistent:Ep}),u}var el={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Op=Zr(el),Bd=m({},el,{view:0,detail:0}),E9=Zr(Bd),px,mx,Ud,_p=m({},Bd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yx,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Ud&&(Ud&&o.type==="mousemove"?(px=o.screenX-Ud.screenX,mx=o.screenY-Ud.screenY):mx=px=0,Ud=o),px)},movementY:function(o){return"movementY"in o?o.movementY:mx}}),uE=Zr(_p),O9=m({},_p,{dataTransfer:0}),_9=Zr(O9),z9=m({},Bd,{relatedTarget:0}),gx=Zr(z9),T9=m({},el,{animationName:0,elapsedTime:0,pseudoElement:0}),P9=Zr(T9),R9=m({},el,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),D9=Zr(R9),I9=m({},el,{data:0}),dE=Zr(I9),M9={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},L9={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"},$9={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function B9(o){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(o):(o=$9[o])?!!u[o]:!1}function yx(){return B9}var U9=m({},Bd,{key:function(o){if(o.key){var u=M9[o.key]||o.key;if(u!=="Unidentified")return u}return o.type==="keypress"?(o=Ap(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?L9[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yx,charCode:function(o){return o.type==="keypress"?Ap(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Ap(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),q9=Zr(U9),F9=m({},_p,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fE=Zr(F9),H9=m({},Bd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yx}),K9=Zr(H9),G9=m({},el,{propertyName:0,elapsedTime:0,pseudoElement:0}),V9=Zr(G9),Q9=m({},_p,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),W9=Zr(Q9),Y9=m({},el,{newState:0,oldState:0}),Z9=Zr(Y9),X9=[9,13,27,32],vx=ts&&"CompositionEvent"in window,qd=null;ts&&"documentMode"in document&&(qd=document.documentMode);var J9=ts&&"TextEvent"in window&&!qd,hE=ts&&(!vx||qd&&8<qd&&11>=qd),pE=" ",mE=!1;function gE(o,u){switch(o){case"keyup":return X9.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yE(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Rc=!1;function eH(o,u){switch(o){case"compositionend":return yE(u);case"keypress":return u.which!==32?null:(mE=!0,pE);case"textInput":return o=u.data,o===pE&&mE?null:o;default:return null}}function tH(o,u){if(Rc)return o==="compositionend"||!vx&&gE(o,u)?(o=lE(),Cp=hx=Hs=null,Rc=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return hE&&u.locale!=="ko"?null:u.data;default:return null}}var nH={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 vE(o){var u=o&&o.nodeName&&o.nodeName.toLowerCase();return u==="input"?!!nH[o.type]:u==="textarea"}function xE(o,u,h,g){Tc?Pc?Pc.push(g):Pc=[g]:Tc=g,u=xm(u,"onChange"),0<u.length&&(h=new Op("onChange","change",null,h,g),o.push({event:h,listeners:u}))}var Fd=null,Hd=null;function rH(o){tz(o,0)}function zp(o){var u=at(o);if($t(u))return o}function bE(o,u){if(o==="change")return u}var wE=!1;if(ts){var xx;if(ts){var bx="oninput"in document;if(!bx){var SE=document.createElement("div");SE.setAttribute("oninput","return;"),bx=typeof SE.oninput=="function"}xx=bx}else xx=!1;wE=xx&&(!document.documentMode||9<document.documentMode)}function jE(){Fd&&(Fd.detachEvent("onpropertychange",NE),Hd=Fd=null)}function NE(o){if(o.propertyName==="value"&&zp(Hd)){var u=[];xE(u,Hd,o,ux(o)),oE(rH,u)}}function iH(o,u,h){o==="focusin"?(jE(),Fd=u,Hd=h,Fd.attachEvent("onpropertychange",NE)):o==="focusout"&&jE()}function aH(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return zp(Hd)}function sH(o,u){if(o==="click")return zp(u)}function oH(o,u){if(o==="input"||o==="change")return zp(u)}function lH(o,u){return o===u&&(o!==0||1/o===1/u)||o!==o&&u!==u}var pi=typeof Object.is=="function"?Object.is:lH;function Kd(o,u){if(pi(o,u))return!0;if(typeof o!="object"||o===null||typeof u!="object"||u===null)return!1;var h=Object.keys(o),g=Object.keys(u);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var S=h[g];if(!on.call(u,S)||!pi(o[S],u[S]))return!1}return!0}function kE(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function CE(o,u){var h=kE(o);o=0;for(var g;h;){if(h.nodeType===3){if(g=o+h.textContent.length,o<=u&&g>=u)return{node:h,offset:u-o};o=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=kE(h)}}function AE(o,u){return o&&u?o===u?!0:o&&o.nodeType===3?!1:u&&u.nodeType===3?AE(o,u.parentNode):"contains"in o?o.contains(u):o.compareDocumentPosition?!!(o.compareDocumentPosition(u)&16):!1:!1}function EE(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var u=Nr(o.document);u instanceof o.HTMLIFrameElement;){try{var h=typeof u.contentWindow.location.href=="string"}catch{h=!1}if(h)o=u.contentWindow;else break;u=Nr(o.document)}return u}function wx(o){var u=o&&o.nodeName&&o.nodeName.toLowerCase();return u&&(u==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||u==="textarea"||o.contentEditable==="true")}var cH=ts&&"documentMode"in document&&11>=document.documentMode,Dc=null,Sx=null,Gd=null,jx=!1;function OE(o,u,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;jx||Dc==null||Dc!==Nr(g)||(g=Dc,"selectionStart"in g&&wx(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}),Gd&&Kd(Gd,g)||(Gd=g,g=xm(Sx,"onSelect"),0<g.length&&(u=new Op("onSelect","select",null,u,h),o.push({event:u,listeners:g}),u.target=Dc)))}function tl(o,u){var h={};return h[o.toLowerCase()]=u.toLowerCase(),h["Webkit"+o]="webkit"+u,h["Moz"+o]="moz"+u,h}var Ic={animationend:tl("Animation","AnimationEnd"),animationiteration:tl("Animation","AnimationIteration"),animationstart:tl("Animation","AnimationStart"),transitionrun:tl("Transition","TransitionRun"),transitionstart:tl("Transition","TransitionStart"),transitioncancel:tl("Transition","TransitionCancel"),transitionend:tl("Transition","TransitionEnd")},Nx={},_E={};ts&&(_E=document.createElement("div").style,"AnimationEvent"in window||(delete Ic.animationend.animation,delete Ic.animationiteration.animation,delete Ic.animationstart.animation),"TransitionEvent"in window||delete Ic.transitionend.transition);function nl(o){if(Nx[o])return Nx[o];if(!Ic[o])return o;var u=Ic[o],h;for(h in u)if(u.hasOwnProperty(h)&&h in _E)return Nx[o]=u[h];return o}var zE=nl("animationend"),TE=nl("animationiteration"),PE=nl("animationstart"),uH=nl("transitionrun"),dH=nl("transitionstart"),fH=nl("transitioncancel"),RE=nl("transitionend"),DE=new Map,kx="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(" ");kx.push("scrollEnd");function ia(o,u){DE.set(o,u),Wr(u,[o])}var Tp=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},Oi=[],Mc=0,Cx=0;function Pp(){for(var o=Mc,u=Cx=Mc=0;u<o;){var h=Oi[u];Oi[u++]=null;var g=Oi[u];Oi[u++]=null;var S=Oi[u];Oi[u++]=null;var N=Oi[u];if(Oi[u++]=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&&IE(h,S,N)}}function Rp(o,u,h,g){Oi[Mc++]=o,Oi[Mc++]=u,Oi[Mc++]=h,Oi[Mc++]=g,Cx|=g,o.lanes|=g,o=o.alternate,o!==null&&(o.lanes|=g)}function Ax(o,u,h,g){return Rp(o,u,h,g),Dp(o)}function rl(o,u){return Rp(o,null,null,u),Dp(o)}function IE(o,u,h){o.lanes|=h;var g=o.alternate;g!==null&&(g.lanes|=h);for(var S=!1,N=o.return;N!==null;)N.childLanes|=h,g=N.alternate,g!==null&&(g.childLanes|=h),N.tag===22&&(o=N.stateNode,o===null||o._visibility&1||(S=!0)),o=N,N=N.return;return o.tag===3?(N=o.stateNode,S&&u!==null&&(S=31-pt(h),o=N.hiddenUpdates,g=o[S],g===null?o[S]=[u]:g.push(u),u.lane=h|536870912),N):null}function Dp(o){if(50<mf)throw mf=0,Ib=null,Error(r(185));for(var u=o.return;u!==null;)o=u,u=o.return;return o.tag===3?o.stateNode:null}var Lc={};function hH(o,u,h,g){this.tag=o,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=u,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 mi(o,u,h,g){return new hH(o,u,h,g)}function Ex(o){return o=o.prototype,!(!o||!o.isReactComponent)}function ns(o,u){var h=o.alternate;return h===null?(h=mi(o.tag,u,o.key,o.mode),h.elementType=o.elementType,h.type=o.type,h.stateNode=o.stateNode,h.alternate=o,o.alternate=h):(h.pendingProps=u,h.type=o.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=o.flags&65011712,h.childLanes=o.childLanes,h.lanes=o.lanes,h.child=o.child,h.memoizedProps=o.memoizedProps,h.memoizedState=o.memoizedState,h.updateQueue=o.updateQueue,u=o.dependencies,h.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},h.sibling=o.sibling,h.index=o.index,h.ref=o.ref,h.refCleanup=o.refCleanup,h}function ME(o,u){o.flags&=65011714;var h=o.alternate;return h===null?(o.childLanes=0,o.lanes=u,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=h.childLanes,o.lanes=h.lanes,o.child=h.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=h.memoizedProps,o.memoizedState=h.memoizedState,o.updateQueue=h.updateQueue,o.type=h.type,u=h.dependencies,o.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),o}function Ip(o,u,h,g,S,N){var T=0;if(g=o,typeof o=="function")Ex(o)&&(T=1);else if(typeof o=="string")T=vK(o,h,V.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case $:return o=mi(31,h,u,S),o.elementType=$,o.lanes=N,o;case b:return il(h.children,S,N,u);case j:T=8,S|=24;break;case k:return o=mi(12,h,u,S|2),o.elementType=k,o.lanes=N,o;case z:return o=mi(13,h,u,S),o.elementType=z,o.lanes=N,o;case A:return o=mi(19,h,u,S),o.elementType=A,o.lanes=N,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case O:T=10;break e;case E:T=9;break e;case C:T=11;break e;case _:T=14;break e;case R:T=16,g=null;break e}T=29,h=Error(r(130,o===null?"null":typeof o,"")),g=null}return u=mi(T,h,u,S),u.elementType=o,u.type=g,u.lanes=N,u}function il(o,u,h,g){return o=mi(7,o,g,u),o.lanes=h,o}function Ox(o,u,h){return o=mi(6,o,null,u),o.lanes=h,o}function LE(o){var u=mi(18,null,null,0);return u.stateNode=o,u}function _x(o,u,h){return u=mi(4,o.children!==null?o.children:[],o.key,u),u.lanes=h,u.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},u}var $E=new WeakMap;function _i(o,u){if(typeof o=="object"&&o!==null){var h=$E.get(o);return h!==void 0?h:(u={value:o,source:u,stack:Ht(u)},$E.set(o,u),u)}return{value:o,source:u,stack:Ht(u)}}var $c=[],Bc=0,Mp=null,Vd=0,zi=[],Ti=0,Ks=null,Na=1,ka="";function rs(o,u){$c[Bc++]=Vd,$c[Bc++]=Mp,Mp=o,Vd=u}function BE(o,u,h){zi[Ti++]=Na,zi[Ti++]=ka,zi[Ti++]=Ks,Ks=o;var g=Na;o=ka;var S=32-pt(g)-1;g&=~(1<<S),h+=1;var N=32-pt(u)+S;if(30<N){var T=S-S%5;N=(g&(1<<T)-1).toString(32),g>>=T,S-=T,Na=1<<32-pt(u)+S|h<<S|g,ka=N+o}else Na=1<<N|h<<S|g,ka=o}function zx(o){o.return!==null&&(rs(o,1),BE(o,1,0))}function Tx(o){for(;o===Mp;)Mp=$c[--Bc],$c[Bc]=null,Vd=$c[--Bc],$c[Bc]=null;for(;o===Ks;)Ks=zi[--Ti],zi[Ti]=null,ka=zi[--Ti],zi[Ti]=null,Na=zi[--Ti],zi[Ti]=null}function UE(o,u){zi[Ti++]=Na,zi[Ti++]=ka,zi[Ti++]=Ks,Na=u.id,ka=u.overflow,Ks=o}var or=null,tn=null,Ct=!1,Gs=null,Pi=!1,Px=Error(r(519));function Vs(o){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qd(_i(u,o)),Px}function qE(o){var u=o.stateNode,h=o.type,g=o.memoizedProps;switch(u[Tn]=o,u[jr]=g,h){case"dialog":bt("cancel",u),bt("close",u);break;case"iframe":case"object":case"embed":bt("load",u);break;case"video":case"audio":for(h=0;h<yf.length;h++)bt(yf[h],u);break;case"source":bt("error",u);break;case"img":case"image":case"link":bt("error",u),bt("load",u);break;case"details":bt("toggle",u);break;case"input":bt("invalid",u),tE(u,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":bt("invalid",u);break;case"textarea":bt("invalid",u),rE(u,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||u.textContent===""+h||g.suppressHydrationWarning===!0||az(u.textContent,h)?(g.popover!=null&&(bt("beforetoggle",u),bt("toggle",u)),g.onScroll!=null&&bt("scroll",u),g.onScrollEnd!=null&&bt("scrollend",u),g.onClick!=null&&(u.onclick=es),u=!0):u=!1,u||Vs(o,!0)}function FE(o){for(or=o.return;or;)switch(or.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:or=or.return}}function Uc(o){if(o!==or)return!1;if(!Ct)return FE(o),Ct=!0,!1;var u=o.tag,h;if((h=u!==3&&u!==27)&&((h=u===5)&&(h=o.type,h=!(h!=="form"&&h!=="button")||Zb(o.type,o.memoizedProps)),h=!h),h&&tn&&Vs(o),FE(o),u===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));tn=pz(o)}else if(u===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));tn=pz(o)}else u===27?(u=tn,oo(o.type)?(o=nw,nw=null,tn=o):tn=u):tn=or?Di(o.stateNode.nextSibling):null;return!0}function al(){tn=or=null,Ct=!1}function Rx(){var o=Gs;return o!==null&&(ti===null?ti=o:ti.push.apply(ti,o),Gs=null),o}function Qd(o){Gs===null?Gs=[o]:Gs.push(o)}var Dx=D(null),sl=null,is=null;function Qs(o,u,h){I(Dx,u._currentValue),u._currentValue=h}function as(o){o._currentValue=Dx.current,U(Dx)}function Ix(o,u,h){for(;o!==null;){var g=o.alternate;if((o.childLanes&u)!==u?(o.childLanes|=u,g!==null&&(g.childLanes|=u)):g!==null&&(g.childLanes&u)!==u&&(g.childLanes|=u),o===h)break;o=o.return}}function Mx(o,u,h,g){var S=o.child;for(S!==null&&(S.return=o);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 G=0;G<u.length;G++)if(L.context===u[G]){N.lanes|=h,L=N.alternate,L!==null&&(L.lanes|=h),Ix(N.return,h,o),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),Ix(T,h,o),T=null}else T=S.child;if(T!==null)T.return=S;else for(T=S;T!==null;){if(T===o){T=null;break}if(S=T.sibling,S!==null){S.return=T.return,T=S;break}T=T.return}S=T}}function qc(o,u,h,g){o=null;for(var S=u,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;pi(S.pendingProps.value,T.value)||(o!==null?o.push(L):o=[L])}}else if(S===ke.current){if(T=S.alternate,T===null)throw Error(r(387));T.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(o!==null?o.push(Sf):o=[Sf])}S=S.return}o!==null&&Mx(u,o,h,g),u.flags|=262144}function Lp(o){for(o=o.firstContext;o!==null;){if(!pi(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function ol(o){sl=o,is=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function lr(o){return HE(sl,o)}function $p(o,u){return sl===null&&ol(o),HE(o,u)}function HE(o,u){var h=u._currentValue;if(u={context:u,memoizedValue:h,next:null},is===null){if(o===null)throw Error(r(308));is=u,o.dependencies={lanes:0,firstContext:u},o.flags|=524288}else is=is.next=u;return h}var pH=typeof AbortController<"u"?AbortController:function(){var o=[],u=this.signal={aborted:!1,addEventListener:function(h,g){o.push(g)}};this.abort=function(){u.aborted=!0,o.forEach(function(h){return h()})}},mH=e.unstable_scheduleCallback,gH=e.unstable_NormalPriority,Pn={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Lx(){return{controller:new pH,data:new Map,refCount:0}}function Wd(o){o.refCount--,o.refCount===0&&mH(gH,function(){o.controller.abort()})}var Yd=null,$x=0,Fc=0,Hc=null;function yH(o,u){if(Yd===null){var h=Yd=[];$x=0,Fc=qb(),Hc={status:"pending",value:void 0,then:function(g){h.push(g)}}}return $x++,u.then(KE,KE),u}function KE(){if(--$x===0&&Yd!==null){Hc!==null&&(Hc.status="fulfilled");var o=Yd;Yd=null,Fc=0,Hc=null;for(var u=0;u<o.length;u++)(0,o[u])()}}function vH(o,u){var h=[],g={status:"pending",value:null,reason:null,then:function(S){h.push(S)}};return o.then(function(){g.status="fulfilled",g.value=u;for(var S=0;S<h.length;S++)(0,h[S])(u)},function(S){for(g.status="rejected",g.reason=S,S=0;S<h.length;S++)(0,h[S])(void 0)}),g}var GE=H.S;H.S=function(o,u){O_=Ye(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&yH(o,u),GE!==null&&GE(o,u)};var ll=D(null);function Bx(){var o=ll.current;return o!==null?o:Vt.pooledCache}function Bp(o,u){u===null?I(ll,ll.current):I(ll,u.pool)}function VE(){var o=Bx();return o===null?null:{parent:Pn._currentValue,pool:o}}var Kc=Error(r(460)),Ux=Error(r(474)),Up=Error(r(542)),qp={then:function(){}};function QE(o){return o=o.status,o==="fulfilled"||o==="rejected"}function WE(o,u,h){switch(h=o[h],h===void 0?o.push(u):h!==u&&(u.then(es,es),u=h),u.status){case"fulfilled":return u.value;case"rejected":throw o=u.reason,ZE(o),o;default:if(typeof u.status=="string")u.then(es,es);else{if(o=Vt,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=u,o.status="pending",o.then(function(g){if(u.status==="pending"){var S=u;S.status="fulfilled",S.value=g}},function(g){if(u.status==="pending"){var S=u;S.status="rejected",S.reason=g}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw o=u.reason,ZE(o),o}throw ul=u,Kc}}function cl(o){try{var u=o._init;return u(o._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(ul=h,Kc):h}}var ul=null;function YE(){if(ul===null)throw Error(r(459));var o=ul;return ul=null,o}function ZE(o){if(o===Kc||o===Up)throw Error(r(483))}var Gc=null,Zd=0;function Fp(o){var u=Zd;return Zd+=1,Gc===null&&(Gc=[]),WE(Gc,o,u)}function Xd(o,u){u=u.props.ref,o.ref=u!==void 0?u:null}function Hp(o,u){throw u.$$typeof===y?Error(r(525)):(o=Object.prototype.toString.call(u),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":o)))}function XE(o){function u(ee,Y){if(o){var ie=ee.deletions;ie===null?(ee.deletions=[Y],ee.flags|=16):ie.push(Y)}}function h(ee,Y){if(!o)return null;for(;Y!==null;)u(ee,Y),Y=Y.sibling;return null}function g(ee){for(var Y=new Map;ee!==null;)ee.key!==null?Y.set(ee.key,ee):Y.set(ee.index,ee),ee=ee.sibling;return Y}function S(ee,Y){return ee=ns(ee,Y),ee.index=0,ee.sibling=null,ee}function N(ee,Y,ie){return ee.index=ie,o?(ie=ee.alternate,ie!==null?(ie=ie.index,ie<Y?(ee.flags|=67108866,Y):ie):(ee.flags|=67108866,Y)):(ee.flags|=1048576,Y)}function T(ee){return o&&ee.alternate===null&&(ee.flags|=67108866),ee}function L(ee,Y,ie,ye){return Y===null||Y.tag!==6?(Y=Ox(ie,ee.mode,ye),Y.return=ee,Y):(Y=S(Y,ie),Y.return=ee,Y)}function G(ee,Y,ie,ye){var Ve=ie.type;return Ve===b?me(ee,Y,ie.props.children,ye,ie.key):Y!==null&&(Y.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===R&&cl(Ve)===Y.type)?(Y=S(Y,ie.props),Xd(Y,ie),Y.return=ee,Y):(Y=Ip(ie.type,ie.key,ie.props,null,ee.mode,ye),Xd(Y,ie),Y.return=ee,Y)}function se(ee,Y,ie,ye){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==ie.containerInfo||Y.stateNode.implementation!==ie.implementation?(Y=_x(ie,ee.mode,ye),Y.return=ee,Y):(Y=S(Y,ie.children||[]),Y.return=ee,Y)}function me(ee,Y,ie,ye,Ve){return Y===null||Y.tag!==7?(Y=il(ie,ee.mode,ye,Ve),Y.return=ee,Y):(Y=S(Y,ie),Y.return=ee,Y)}function xe(ee,Y,ie){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=Ox(""+Y,ee.mode,ie),Y.return=ee,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case v:return ie=Ip(Y.type,Y.key,Y.props,null,ee.mode,ie),Xd(ie,Y),ie.return=ee,ie;case w:return Y=_x(Y,ee.mode,ie),Y.return=ee,Y;case R:return Y=cl(Y),xe(ee,Y,ie)}if(Q(Y)||B(Y))return Y=il(Y,ee.mode,ie,null),Y.return=ee,Y;if(typeof Y.then=="function")return xe(ee,Fp(Y),ie);if(Y.$$typeof===O)return xe(ee,$p(ee,Y),ie);Hp(ee,Y)}return null}function ue(ee,Y,ie,ye){var Ve=Y!==null?Y.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Ve!==null?null:L(ee,Y,""+ie,ye);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case v:return ie.key===Ve?G(ee,Y,ie,ye):null;case w:return ie.key===Ve?se(ee,Y,ie,ye):null;case R:return ie=cl(ie),ue(ee,Y,ie,ye)}if(Q(ie)||B(ie))return Ve!==null?null:me(ee,Y,ie,ye,null);if(typeof ie.then=="function")return ue(ee,Y,Fp(ie),ye);if(ie.$$typeof===O)return ue(ee,Y,$p(ee,ie),ye);Hp(ee,ie)}return null}function he(ee,Y,ie,ye,Ve){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return ee=ee.get(ie)||null,L(Y,ee,""+ye,Ve);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case v:return ee=ee.get(ye.key===null?ie:ye.key)||null,G(Y,ee,ye,Ve);case w:return ee=ee.get(ye.key===null?ie:ye.key)||null,se(Y,ee,ye,Ve);case R:return ye=cl(ye),he(ee,Y,ie,ye,Ve)}if(Q(ye)||B(ye))return ee=ee.get(ie)||null,me(Y,ee,ye,Ve,null);if(typeof ye.then=="function")return he(ee,Y,ie,Fp(ye),Ve);if(ye.$$typeof===O)return he(ee,Y,ie,$p(Y,ye),Ve);Hp(Y,ye)}return null}function Le(ee,Y,ie,ye){for(var Ve=null,Ot=null,qe=Y,ct=Y=0,jt=null;qe!==null&&ct<ie.length;ct++){qe.index>ct?(jt=qe,qe=null):jt=qe.sibling;var _t=ue(ee,qe,ie[ct],ye);if(_t===null){qe===null&&(qe=jt);break}o&&qe&&_t.alternate===null&&u(ee,qe),Y=N(_t,Y,ct),Ot===null?Ve=_t:Ot.sibling=_t,Ot=_t,qe=jt}if(ct===ie.length)return h(ee,qe),Ct&&rs(ee,ct),Ve;if(qe===null){for(;ct<ie.length;ct++)qe=xe(ee,ie[ct],ye),qe!==null&&(Y=N(qe,Y,ct),Ot===null?Ve=qe:Ot.sibling=qe,Ot=qe);return Ct&&rs(ee,ct),Ve}for(qe=g(qe);ct<ie.length;ct++)jt=he(qe,ee,ct,ie[ct],ye),jt!==null&&(o&&jt.alternate!==null&&qe.delete(jt.key===null?ct:jt.key),Y=N(jt,Y,ct),Ot===null?Ve=jt:Ot.sibling=jt,Ot=jt);return o&&qe.forEach(function(ho){return u(ee,ho)}),Ct&&rs(ee,ct),Ve}function We(ee,Y,ie,ye){if(ie==null)throw Error(r(151));for(var Ve=null,Ot=null,qe=Y,ct=Y=0,jt=null,_t=ie.next();qe!==null&&!_t.done;ct++,_t=ie.next()){qe.index>ct?(jt=qe,qe=null):jt=qe.sibling;var ho=ue(ee,qe,_t.value,ye);if(ho===null){qe===null&&(qe=jt);break}o&&qe&&ho.alternate===null&&u(ee,qe),Y=N(ho,Y,ct),Ot===null?Ve=ho:Ot.sibling=ho,Ot=ho,qe=jt}if(_t.done)return h(ee,qe),Ct&&rs(ee,ct),Ve;if(qe===null){for(;!_t.done;ct++,_t=ie.next())_t=xe(ee,_t.value,ye),_t!==null&&(Y=N(_t,Y,ct),Ot===null?Ve=_t:Ot.sibling=_t,Ot=_t);return Ct&&rs(ee,ct),Ve}for(qe=g(qe);!_t.done;ct++,_t=ie.next())_t=he(qe,ee,ct,_t.value,ye),_t!==null&&(o&&_t.alternate!==null&&qe.delete(_t.key===null?ct:_t.key),Y=N(_t,Y,ct),Ot===null?Ve=_t:Ot.sibling=_t,Ot=_t);return o&&qe.forEach(function(OK){return u(ee,OK)}),Ct&&rs(ee,ct),Ve}function qt(ee,Y,ie,ye){if(typeof ie=="object"&&ie!==null&&ie.type===b&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case v:e:{for(var Ve=ie.key;Y!==null;){if(Y.key===Ve){if(Ve=ie.type,Ve===b){if(Y.tag===7){h(ee,Y.sibling),ye=S(Y,ie.props.children),ye.return=ee,ee=ye;break e}}else if(Y.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===R&&cl(Ve)===Y.type){h(ee,Y.sibling),ye=S(Y,ie.props),Xd(ye,ie),ye.return=ee,ee=ye;break e}h(ee,Y);break}else u(ee,Y);Y=Y.sibling}ie.type===b?(ye=il(ie.props.children,ee.mode,ye,ie.key),ye.return=ee,ee=ye):(ye=Ip(ie.type,ie.key,ie.props,null,ee.mode,ye),Xd(ye,ie),ye.return=ee,ee=ye)}return T(ee);case w:e:{for(Ve=ie.key;Y!==null;){if(Y.key===Ve)if(Y.tag===4&&Y.stateNode.containerInfo===ie.containerInfo&&Y.stateNode.implementation===ie.implementation){h(ee,Y.sibling),ye=S(Y,ie.children||[]),ye.return=ee,ee=ye;break e}else{h(ee,Y);break}else u(ee,Y);Y=Y.sibling}ye=_x(ie,ee.mode,ye),ye.return=ee,ee=ye}return T(ee);case R:return ie=cl(ie),qt(ee,Y,ie,ye)}if(Q(ie))return Le(ee,Y,ie,ye);if(B(ie)){if(Ve=B(ie),typeof Ve!="function")throw Error(r(150));return ie=Ve.call(ie),We(ee,Y,ie,ye)}if(typeof ie.then=="function")return qt(ee,Y,Fp(ie),ye);if(ie.$$typeof===O)return qt(ee,Y,$p(ee,ie),ye);Hp(ee,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,Y!==null&&Y.tag===6?(h(ee,Y.sibling),ye=S(Y,ie),ye.return=ee,ee=ye):(h(ee,Y),ye=Ox(ie,ee.mode,ye),ye.return=ee,ee=ye),T(ee)):h(ee,Y)}return function(ee,Y,ie,ye){try{Zd=0;var Ve=qt(ee,Y,ie,ye);return Gc=null,Ve}catch(qe){if(qe===Kc||qe===Up)throw qe;var Ot=mi(29,qe,null,ee.mode);return Ot.lanes=ye,Ot.return=ee,Ot}}}var dl=XE(!0),JE=XE(!1),Ws=!1;function qx(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fx(o,u){o=o.updateQueue,u.updateQueue===o&&(u.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Ys(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Zs(o,u,h){var g=o.updateQueue;if(g===null)return null;if(g=g.shared,(Tt&2)!==0){var S=g.pending;return S===null?u.next=u:(u.next=S.next,S.next=u),g.pending=u,u=Dp(o),IE(o,null,h),u}return Rp(o,g,u,h),Dp(o)}function Jd(o,u,h){if(u=u.updateQueue,u!==null&&(u=u.shared,(h&4194048)!==0)){var g=u.lanes;g&=o.pendingLanes,h|=g,u.lanes=h,Us(o,h)}}function Hx(o,u){var h=o.updateQueue,g=o.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=u:N=N.next=u}else S=N=u;h={baseState:g.baseState,firstBaseUpdate:S,lastBaseUpdate:N,shared:g.shared,callbacks:g.callbacks},o.updateQueue=h;return}o=h.lastBaseUpdate,o===null?h.firstBaseUpdate=u:o.next=u,h.lastBaseUpdate=u}var Kx=!1;function ef(){if(Kx){var o=Hc;if(o!==null)throw o}}function tf(o,u,h,g){Kx=!1;var S=o.updateQueue;Ws=!1;var N=S.firstBaseUpdate,T=S.lastBaseUpdate,L=S.shared.pending;if(L!==null){S.shared.pending=null;var G=L,se=G.next;G.next=null,T===null?N=se:T.next=se,T=G;var me=o.alternate;me!==null&&(me=me.updateQueue,L=me.lastBaseUpdate,L!==T&&(L===null?me.firstBaseUpdate=se:L.next=se,me.lastBaseUpdate=G))}if(N!==null){var xe=S.baseState;T=0,me=se=G=null,L=N;do{var ue=L.lane&-536870913,he=ue!==L.lane;if(he?(St&ue)===ue:(g&ue)===ue){ue!==0&&ue===Fc&&(Kx=!0),me!==null&&(me=me.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Le=o,We=L;ue=u;var qt=h;switch(We.tag){case 1:if(Le=We.payload,typeof Le=="function"){xe=Le.call(qt,xe,ue);break e}xe=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=We.payload,ue=typeof Le=="function"?Le.call(qt,xe,ue):Le,ue==null)break e;xe=m({},xe,ue);break e;case 2:Ws=!0}}ue=L.callback,ue!==null&&(o.flags|=64,he&&(o.flags|=8192),he=S.callbacks,he===null?S.callbacks=[ue]:he.push(ue))}else he={lane:ue,tag:L.tag,payload:L.payload,callback:L.callback,next:null},me===null?(se=me=he,G=xe):me=me.next=he,T|=ue;if(L=L.next,L===null){if(L=S.shared.pending,L===null)break;he=L,L=he.next,he.next=null,S.lastBaseUpdate=he,S.shared.pending=null}}while(!0);me===null&&(G=xe),S.baseState=G,S.firstBaseUpdate=se,S.lastBaseUpdate=me,N===null&&(S.shared.lanes=0),no|=T,o.lanes=T,o.memoizedState=xe}}function eO(o,u){if(typeof o!="function")throw Error(r(191,o));o.call(u)}function tO(o,u){var h=o.callbacks;if(h!==null)for(o.callbacks=null,o=0;o<h.length;o++)eO(h[o],u)}var Vc=D(null),Kp=D(0);function nO(o,u){o=ps,I(Kp,o),I(Vc,u),ps=o|u.baseLanes}function Gx(){I(Kp,ps),I(Vc,Vc.current)}function Vx(){ps=Kp.current,U(Vc),U(Kp)}var gi=D(null),Ri=null;function Xs(o){var u=o.alternate;I(Nn,Nn.current&1),I(gi,o),Ri===null&&(u===null||Vc.current!==null||u.memoizedState!==null)&&(Ri=o)}function Qx(o){I(Nn,Nn.current),I(gi,o),Ri===null&&(Ri=o)}function rO(o){o.tag===22?(I(Nn,Nn.current),I(gi,o),Ri===null&&(Ri=o)):Js()}function Js(){I(Nn,Nn.current),I(gi,gi.current)}function yi(o){U(gi),Ri===o&&(Ri=null),U(Nn)}var Nn=D(0);function Gp(o){for(var u=o;u!==null;){if(u.tag===13){var h=u.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||ew(h)||tw(h)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var ss=0,st=null,Bt=null,Rn=null,Vp=!1,Qc=!1,fl=!1,Qp=0,nf=0,Wc=null,xH=0;function vn(){throw Error(r(321))}function Wx(o,u){if(u===null)return!1;for(var h=0;h<u.length&&h<o.length;h++)if(!pi(o[h],u[h]))return!1;return!0}function Yx(o,u,h,g,S,N){return ss=N,st=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,H.H=o===null||o.memoizedState===null?BO:db,fl=!1,N=h(g,S),fl=!1,Qc&&(N=aO(u,h,g,S)),iO(o),N}function iO(o){H.H=sf;var u=Bt!==null&&Bt.next!==null;if(ss=0,Rn=Bt=st=null,Vp=!1,nf=0,Wc=null,u)throw Error(r(300));o===null||Dn||(o=o.dependencies,o!==null&&Lp(o)&&(Dn=!0))}function aO(o,u,h,g){st=o;var S=0;do{if(Qc&&(Wc=null),nf=0,Qc=!1,25<=S)throw Error(r(301));if(S+=1,Rn=Bt=null,o.updateQueue!=null){var N=o.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}H.H=UO,N=u(h,g)}while(Qc);return N}function bH(){var o=H.H,u=o.useState()[0];return u=typeof u.then=="function"?rf(u):u,o=o.useState()[0],(Bt!==null?Bt.memoizedState:null)!==o&&(st.flags|=1024),u}function Zx(){var o=Qp!==0;return Qp=0,o}function Xx(o,u,h){u.updateQueue=o.updateQueue,u.flags&=-2053,o.lanes&=~h}function Jx(o){if(Vp){for(o=o.memoizedState;o!==null;){var u=o.queue;u!==null&&(u.pending=null),o=o.next}Vp=!1}ss=0,Rn=Bt=st=null,Qc=!1,nf=Qp=0,Wc=null}function Lr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rn===null?st.memoizedState=Rn=o:Rn=Rn.next=o,Rn}function kn(){if(Bt===null){var o=st.alternate;o=o!==null?o.memoizedState:null}else o=Bt.next;var u=Rn===null?st.memoizedState:Rn.next;if(u!==null)Rn=u,Bt=o;else{if(o===null)throw st.alternate===null?Error(r(467)):Error(r(310));Bt=o,o={memoizedState:Bt.memoizedState,baseState:Bt.baseState,baseQueue:Bt.baseQueue,queue:Bt.queue,next:null},Rn===null?st.memoizedState=Rn=o:Rn=Rn.next=o}return Rn}function Wp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function rf(o){var u=nf;return nf+=1,Wc===null&&(Wc=[]),o=WE(Wc,o,u),u=st,(Rn===null?u.memoizedState:Rn.next)===null&&(u=u.alternate,H.H=u===null||u.memoizedState===null?BO:db),o}function Yp(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return rf(o);if(o.$$typeof===O)return lr(o)}throw Error(r(438,String(o)))}function eb(o){var u=null,h=st.updateQueue;if(h!==null&&(u=h.memoCache),u==null){var g=st.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(u={data:g.data.map(function(S){return S.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),h===null&&(h=Wp(),st.updateQueue=h),h.memoCache=u,h=u.data[u.index],h===void 0)for(h=u.data[u.index]=Array(o),g=0;g<o;g++)h[g]=F;return u.index++,h}function os(o,u){return typeof u=="function"?u(o):u}function Zp(o){var u=kn();return tb(u,Bt,o)}function tb(o,u,h){var g=o.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var S=o.baseQueue,N=g.pending;if(N!==null){if(S!==null){var T=S.next;S.next=N.next,N.next=T}u.baseQueue=S=N,g.pending=null}if(N=o.baseState,S===null)o.memoizedState=N;else{u=S.next;var L=T=null,G=null,se=u,me=!1;do{var xe=se.lane&-536870913;if(xe!==se.lane?(St&xe)===xe:(ss&xe)===xe){var ue=se.revertLane;if(ue===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),xe===Fc&&(me=!0);else if((ss&ue)===ue){se=se.next,ue===Fc&&(me=!0);continue}else xe={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},G===null?(L=G=xe,T=N):G=G.next=xe,st.lanes|=ue,no|=ue;xe=se.action,fl&&h(N,xe),N=se.hasEagerState?se.eagerState:h(N,xe)}else ue={lane:xe,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},G===null?(L=G=ue,T=N):G=G.next=ue,st.lanes|=xe,no|=xe;se=se.next}while(se!==null&&se!==u);if(G===null?T=N:G.next=L,!pi(N,o.memoizedState)&&(Dn=!0,me&&(h=Hc,h!==null)))throw h;o.memoizedState=N,o.baseState=T,o.baseQueue=G,g.lastRenderedState=N}return S===null&&(g.lanes=0),[o.memoizedState,g.dispatch]}function nb(o){var u=kn(),h=u.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=o;var g=h.dispatch,S=h.pending,N=u.memoizedState;if(S!==null){h.pending=null;var T=S=S.next;do N=o(N,T.action),T=T.next;while(T!==S);pi(N,u.memoizedState)||(Dn=!0),u.memoizedState=N,u.baseQueue===null&&(u.baseState=N),h.lastRenderedState=N}return[N,g]}function sO(o,u,h){var g=st,S=kn(),N=Ct;if(N){if(h===void 0)throw Error(r(407));h=h()}else h=u();var T=!pi((Bt||S).memoizedState,h);if(T&&(S.memoizedState=h,Dn=!0),S=S.queue,ab(cO.bind(null,g,S,o),[o]),S.getSnapshot!==u||T||Rn!==null&&Rn.memoizedState.tag&1){if(g.flags|=2048,Yc(9,{destroy:void 0},lO.bind(null,g,S,h,u),null),Vt===null)throw Error(r(349));N||(ss&127)!==0||oO(g,u,h)}return h}function oO(o,u,h){o.flags|=16384,o={getSnapshot:u,value:h},u=st.updateQueue,u===null?(u=Wp(),st.updateQueue=u,u.stores=[o]):(h=u.stores,h===null?u.stores=[o]:h.push(o))}function lO(o,u,h,g){u.value=h,u.getSnapshot=g,uO(u)&&dO(o)}function cO(o,u,h){return h(function(){uO(u)&&dO(o)})}function uO(o){var u=o.getSnapshot;o=o.value;try{var h=u();return!pi(o,h)}catch{return!0}}function dO(o){var u=rl(o,2);u!==null&&ni(u,o,2)}function rb(o){var u=Lr();if(typeof o=="function"){var h=o;if(o=h(),fl){zn(!0);try{h()}finally{zn(!1)}}}return u.memoizedState=u.baseState=o,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:o},u}function fO(o,u,h,g){return o.baseState=h,tb(o,Bt,typeof g=="function"?g:os)}function wH(o,u,h,g,S){if(em(o))throw Error(r(485));if(o=u.action,o!==null){var N={payload:S,action:o,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=u.pending,h===null?(N.next=u.pending=N,hO(u,N)):(N.next=h.next,u.pending=h.next=N)}}function hO(o,u){var h=u.action,g=u.payload,S=o.state;if(u.isTransition){var N=H.T,T={};H.T=T;try{var L=h(S,g),G=H.S;G!==null&&G(T,L),pO(o,u,L)}catch(se){ib(o,u,se)}finally{N!==null&&T.types!==null&&(N.types=T.types),H.T=N}}else try{N=h(S,g),pO(o,u,N)}catch(se){ib(o,u,se)}}function pO(o,u,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){mO(o,u,g)},function(g){return ib(o,u,g)}):mO(o,u,h)}function mO(o,u,h){u.status="fulfilled",u.value=h,gO(u),o.state=h,u=o.pending,u!==null&&(h=u.next,h===u?o.pending=null:(h=h.next,u.next=h,hO(o,h)))}function ib(o,u,h){var g=o.pending;if(o.pending=null,g!==null){g=g.next;do u.status="rejected",u.reason=h,gO(u),u=u.next;while(u!==g)}o.action=null}function gO(o){o=o.listeners;for(var u=0;u<o.length;u++)(0,o[u])()}function yO(o,u){return u}function vO(o,u){if(Ct){var h=Vt.formState;if(h!==null){e:{var g=st;if(Ct){if(tn){t:{for(var S=tn,N=Pi;S.nodeType!==8;){if(!N){S=null;break t}if(S=Di(S.nextSibling),S===null){S=null;break t}}N=S.data,S=N==="F!"||N==="F"?S:null}if(S){tn=Di(S.nextSibling),g=S.data==="F!";break e}}Vs(g)}g=!1}g&&(u=h[0])}}return h=Lr(),h.memoizedState=h.baseState=u,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yO,lastRenderedState:u},h.queue=g,h=MO.bind(null,st,g),g.dispatch=h,g=rb(!1),N=ub.bind(null,st,!1,g.queue),g=Lr(),S={state:u,dispatch:null,action:o,pending:null},g.queue=S,h=wH.bind(null,st,S,N,h),S.dispatch=h,g.memoizedState=o,[u,h,!1]}function xO(o){var u=kn();return bO(u,Bt,o)}function bO(o,u,h){if(u=tb(o,u,yO)[0],o=Zp(os)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var g=rf(u)}catch(T){throw T===Kc?Up:T}else g=u;u=kn();var S=u.queue,N=S.dispatch;return h!==u.memoizedState&&(st.flags|=2048,Yc(9,{destroy:void 0},SH.bind(null,S,h),null)),[g,N,o]}function SH(o,u){o.action=u}function wO(o){var u=kn(),h=Bt;if(h!==null)return bO(u,h,o);kn(),u=u.memoizedState,h=kn();var g=h.queue.dispatch;return h.memoizedState=o,[u,g,!1]}function Yc(o,u,h,g){return o={tag:o,create:h,deps:g,inst:u,next:null},u=st.updateQueue,u===null&&(u=Wp(),st.updateQueue=u),h=u.lastEffect,h===null?u.lastEffect=o.next=o:(g=h.next,h.next=o,o.next=g,u.lastEffect=o),o}function SO(){return kn().memoizedState}function Xp(o,u,h,g){var S=Lr();st.flags|=o,S.memoizedState=Yc(1|u,{destroy:void 0},h,g===void 0?null:g)}function Jp(o,u,h,g){var S=kn();g=g===void 0?null:g;var N=S.memoizedState.inst;Bt!==null&&g!==null&&Wx(g,Bt.memoizedState.deps)?S.memoizedState=Yc(u,N,h,g):(st.flags|=o,S.memoizedState=Yc(1|u,N,h,g))}function jO(o,u){Xp(8390656,8,o,u)}function ab(o,u){Jp(2048,8,o,u)}function jH(o){st.flags|=4;var u=st.updateQueue;if(u===null)u=Wp(),st.updateQueue=u,u.events=[o];else{var h=u.events;h===null?u.events=[o]:h.push(o)}}function NO(o){var u=kn().memoizedState;return jH({ref:u,nextImpl:o}),function(){if((Tt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function kO(o,u){return Jp(4,2,o,u)}function CO(o,u){return Jp(4,4,o,u)}function AO(o,u){if(typeof u=="function"){o=o();var h=u(o);return function(){typeof h=="function"?h():u(null)}}if(u!=null)return o=o(),u.current=o,function(){u.current=null}}function EO(o,u,h){h=h!=null?h.concat([o]):null,Jp(4,4,AO.bind(null,u,o),h)}function sb(){}function OO(o,u){var h=kn();u=u===void 0?null:u;var g=h.memoizedState;return u!==null&&Wx(u,g[1])?g[0]:(h.memoizedState=[o,u],o)}function _O(o,u){var h=kn();u=u===void 0?null:u;var g=h.memoizedState;if(u!==null&&Wx(u,g[1]))return g[0];if(g=o(),fl){zn(!0);try{o()}finally{zn(!1)}}return h.memoizedState=[g,u],g}function ob(o,u,h){return h===void 0||(ss&1073741824)!==0&&(St&261930)===0?o.memoizedState=u:(o.memoizedState=h,o=z_(),st.lanes|=o,no|=o,h)}function zO(o,u,h,g){return pi(h,u)?h:Vc.current!==null?(o=ob(o,h,g),pi(o,u)||(Dn=!0),o):(ss&42)===0||(ss&1073741824)!==0&&(St&261930)===0?(Dn=!0,o.memoizedState=h):(o=z_(),st.lanes|=o,no|=o,u)}function TO(o,u,h,g,S){var N=J.p;J.p=N!==0&&8>N?N:8;var T=H.T,L={};H.T=L,ub(o,!1,u,h);try{var G=S(),se=H.S;if(se!==null&&se(L,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var me=vH(G,g);af(o,u,me,bi(o))}else af(o,u,g,bi(o))}catch(xe){af(o,u,{then:function(){},status:"rejected",reason:xe},bi())}finally{J.p=N,T!==null&&L.types!==null&&(T.types=L.types),H.T=T}}function NH(){}function lb(o,u,h,g){if(o.tag!==5)throw Error(r(476));var S=PO(o).queue;TO(o,S,u,de,h===null?NH:function(){return RO(o),h(g)})}function PO(o){var u=o.memoizedState;if(u!==null)return u;u={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:de},next:null};var h={};return u.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:h},next:null},o.memoizedState=u,o=o.alternate,o!==null&&(o.memoizedState=u),u}function RO(o){var u=PO(o);u.next===null&&(u=o.alternate.memoizedState),af(o,u.next.queue,{},bi())}function cb(){return lr(Sf)}function DO(){return kn().memoizedState}function IO(){return kn().memoizedState}function kH(o){for(var u=o.return;u!==null;){switch(u.tag){case 24:case 3:var h=bi();o=Ys(h);var g=Zs(u,o,h);g!==null&&(ni(g,u,h),Jd(g,u,h)),u={cache:Lx()},o.payload=u;return}u=u.return}}function CH(o,u,h){var g=bi();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},em(o)?LO(u,h):(h=Ax(o,u,h,g),h!==null&&(ni(h,o,g),$O(h,u,g)))}function MO(o,u,h){var g=bi();af(o,u,h,g)}function af(o,u,h,g){var S={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(em(o))LO(u,S);else{var N=o.alternate;if(o.lanes===0&&(N===null||N.lanes===0)&&(N=u.lastRenderedReducer,N!==null))try{var T=u.lastRenderedState,L=N(T,h);if(S.hasEagerState=!0,S.eagerState=L,pi(L,T))return Rp(o,u,S,0),Vt===null&&Pp(),!1}catch{}if(h=Ax(o,u,S,g),h!==null)return ni(h,o,g),$O(h,u,g),!0}return!1}function ub(o,u,h,g){if(g={lane:2,revertLane:qb(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},em(o)){if(u)throw Error(r(479))}else u=Ax(o,h,g,2),u!==null&&ni(u,o,2)}function em(o){var u=o.alternate;return o===st||u!==null&&u===st}function LO(o,u){Qc=Vp=!0;var h=o.pending;h===null?u.next=u:(u.next=h.next,h.next=u),o.pending=u}function $O(o,u,h){if((h&4194048)!==0){var g=u.lanes;g&=o.pendingLanes,h|=g,u.lanes=h,Us(o,h)}}var sf={readContext:lr,use:Yp,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useLayoutEffect:vn,useInsertionEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useSyncExternalStore:vn,useId:vn,useHostTransitionStatus:vn,useFormState:vn,useActionState:vn,useOptimistic:vn,useMemoCache:vn,useCacheRefresh:vn};sf.useEffectEvent=vn;var BO={readContext:lr,use:Yp,useCallback:function(o,u){return Lr().memoizedState=[o,u===void 0?null:u],o},useContext:lr,useEffect:jO,useImperativeHandle:function(o,u,h){h=h!=null?h.concat([o]):null,Xp(4194308,4,AO.bind(null,u,o),h)},useLayoutEffect:function(o,u){return Xp(4194308,4,o,u)},useInsertionEffect:function(o,u){Xp(4,2,o,u)},useMemo:function(o,u){var h=Lr();u=u===void 0?null:u;var g=o();if(fl){zn(!0);try{o()}finally{zn(!1)}}return h.memoizedState=[g,u],g},useReducer:function(o,u,h){var g=Lr();if(h!==void 0){var S=h(u);if(fl){zn(!0);try{h(u)}finally{zn(!1)}}}else S=u;return g.memoizedState=g.baseState=S,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:S},g.queue=o,o=o.dispatch=CH.bind(null,st,o),[g.memoizedState,o]},useRef:function(o){var u=Lr();return o={current:o},u.memoizedState=o},useState:function(o){o=rb(o);var u=o.queue,h=MO.bind(null,st,u);return u.dispatch=h,[o.memoizedState,h]},useDebugValue:sb,useDeferredValue:function(o,u){var h=Lr();return ob(h,o,u)},useTransition:function(){var o=rb(!1);return o=TO.bind(null,st,o.queue,!0,!1),Lr().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,u,h){var g=st,S=Lr();if(Ct){if(h===void 0)throw Error(r(407));h=h()}else{if(h=u(),Vt===null)throw Error(r(349));(St&127)!==0||oO(g,u,h)}S.memoizedState=h;var N={value:h,getSnapshot:u};return S.queue=N,jO(cO.bind(null,g,N,o),[o]),g.flags|=2048,Yc(9,{destroy:void 0},lO.bind(null,g,N,h,u),null),h},useId:function(){var o=Lr(),u=Vt.identifierPrefix;if(Ct){var h=ka,g=Na;h=(g&~(1<<32-pt(g)-1)).toString(32)+h,u="_"+u+"R_"+h,h=Qp++,0<h&&(u+="H"+h.toString(32)),u+="_"}else h=xH++,u="_"+u+"r_"+h.toString(32)+"_";return o.memoizedState=u},useHostTransitionStatus:cb,useFormState:vO,useActionState:vO,useOptimistic:function(o){var u=Lr();u.memoizedState=u.baseState=o;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=h,u=ub.bind(null,st,!0,h),h.dispatch=u,[o,u]},useMemoCache:eb,useCacheRefresh:function(){return Lr().memoizedState=kH.bind(null,st)},useEffectEvent:function(o){var u=Lr(),h={impl:o};return u.memoizedState=h,function(){if((Tt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},db={readContext:lr,use:Yp,useCallback:OO,useContext:lr,useEffect:ab,useImperativeHandle:EO,useInsertionEffect:kO,useLayoutEffect:CO,useMemo:_O,useReducer:Zp,useRef:SO,useState:function(){return Zp(os)},useDebugValue:sb,useDeferredValue:function(o,u){var h=kn();return zO(h,Bt.memoizedState,o,u)},useTransition:function(){var o=Zp(os)[0],u=kn().memoizedState;return[typeof o=="boolean"?o:rf(o),u]},useSyncExternalStore:sO,useId:DO,useHostTransitionStatus:cb,useFormState:xO,useActionState:xO,useOptimistic:function(o,u){var h=kn();return fO(h,Bt,o,u)},useMemoCache:eb,useCacheRefresh:IO};db.useEffectEvent=NO;var UO={readContext:lr,use:Yp,useCallback:OO,useContext:lr,useEffect:ab,useImperativeHandle:EO,useInsertionEffect:kO,useLayoutEffect:CO,useMemo:_O,useReducer:nb,useRef:SO,useState:function(){return nb(os)},useDebugValue:sb,useDeferredValue:function(o,u){var h=kn();return Bt===null?ob(h,o,u):zO(h,Bt.memoizedState,o,u)},useTransition:function(){var o=nb(os)[0],u=kn().memoizedState;return[typeof o=="boolean"?o:rf(o),u]},useSyncExternalStore:sO,useId:DO,useHostTransitionStatus:cb,useFormState:wO,useActionState:wO,useOptimistic:function(o,u){var h=kn();return Bt!==null?fO(h,Bt,o,u):(h.baseState=o,[o,h.queue.dispatch])},useMemoCache:eb,useCacheRefresh:IO};UO.useEffectEvent=NO;function fb(o,u,h,g){u=o.memoizedState,h=h(g,u),h=h==null?u:m({},u,h),o.memoizedState=h,o.lanes===0&&(o.updateQueue.baseState=h)}var hb={enqueueSetState:function(o,u,h){o=o._reactInternals;var g=bi(),S=Ys(g);S.payload=u,h!=null&&(S.callback=h),u=Zs(o,S,g),u!==null&&(ni(u,o,g),Jd(u,o,g))},enqueueReplaceState:function(o,u,h){o=o._reactInternals;var g=bi(),S=Ys(g);S.tag=1,S.payload=u,h!=null&&(S.callback=h),u=Zs(o,S,g),u!==null&&(ni(u,o,g),Jd(u,o,g))},enqueueForceUpdate:function(o,u){o=o._reactInternals;var h=bi(),g=Ys(h);g.tag=2,u!=null&&(g.callback=u),u=Zs(o,g,h),u!==null&&(ni(u,o,h),Jd(u,o,h))}};function qO(o,u,h,g,S,N,T){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(g,N,T):u.prototype&&u.prototype.isPureReactComponent?!Kd(h,g)||!Kd(S,N):!0}function FO(o,u,h,g){o=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(h,g),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(h,g),u.state!==o&&hb.enqueueReplaceState(u,u.state,null)}function hl(o,u){var h=u;if("ref"in u){h={};for(var g in u)g!=="ref"&&(h[g]=u[g])}if(o=o.defaultProps){h===u&&(h=m({},h));for(var S in o)h[S]===void 0&&(h[S]=o[S])}return h}function HO(o){Tp(o)}function KO(o){console.error(o)}function GO(o){Tp(o)}function tm(o,u){try{var h=o.onUncaughtError;h(u.value,{componentStack:u.stack})}catch(g){setTimeout(function(){throw g})}}function VO(o,u,h){try{var g=o.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function pb(o,u,h){return h=Ys(h),h.tag=3,h.payload={element:null},h.callback=function(){tm(o,u)},h}function QO(o){return o=Ys(o),o.tag=3,o}function WO(o,u,h,g){var S=h.type.getDerivedStateFromError;if(typeof S=="function"){var N=g.value;o.payload=function(){return S(N)},o.callback=function(){VO(u,h,g)}}var T=h.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(o.callback=function(){VO(u,h,g),typeof S!="function"&&(ro===null?ro=new Set([this]):ro.add(this));var L=g.stack;this.componentDidCatch(g.value,{componentStack:L!==null?L:""})})}function AH(o,u,h,g,S){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(u=h.alternate,u!==null&&qc(u,h,S,!0),h=gi.current,h!==null){switch(h.tag){case 31:case 13:return Ri===null?hm():h.alternate===null&&xn===0&&(xn=3),h.flags&=-257,h.flags|=65536,h.lanes=S,g===qp?h.flags|=16384:(u=h.updateQueue,u===null?h.updateQueue=new Set([g]):u.add(g),$b(o,g,S)),!1;case 22:return h.flags|=65536,g===qp?h.flags|=16384:(u=h.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=u):(h=u.retryQueue,h===null?u.retryQueue=new Set([g]):h.add(g)),$b(o,g,S)),!1}throw Error(r(435,h.tag))}return $b(o,g,S),hm(),!1}if(Ct)return u=gi.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=S,g!==Px&&(o=Error(r(422),{cause:g}),Qd(_i(o,h)))):(g!==Px&&(u=Error(r(423),{cause:g}),Qd(_i(u,h))),o=o.current.alternate,o.flags|=65536,S&=-S,o.lanes|=S,g=_i(g,h),S=pb(o.stateNode,g,S),Hx(o,S),xn!==4&&(xn=2)),!1;var N=Error(r(520),{cause:g});if(N=_i(N,h),pf===null?pf=[N]:pf.push(N),xn!==4&&(xn=2),u===null)return!0;g=_i(g,h),h=u;do{switch(h.tag){case 3:return h.flags|=65536,o=S&-S,h.lanes|=o,o=pb(h.stateNode,g,o),Hx(h,o),!1;case 1:if(u=h.type,N=h.stateNode,(h.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(ro===null||!ro.has(N))))return h.flags|=65536,S&=-S,h.lanes|=S,S=QO(S),WO(S,o,h,g),Hx(h,S),!1}h=h.return}while(h!==null);return!1}var mb=Error(r(461)),Dn=!1;function cr(o,u,h,g){u.child=o===null?JE(u,null,h,g):dl(u,o.child,h,g)}function YO(o,u,h,g,S){h=h.render;var N=u.ref;if("ref"in g){var T={};for(var L in g)L!=="ref"&&(T[L]=g[L])}else T=g;return ol(u),g=Yx(o,u,h,T,N,S),L=Zx(),o!==null&&!Dn?(Xx(o,u,S),ls(o,u,S)):(Ct&&L&&zx(u),u.flags|=1,cr(o,u,g,S),u.child)}function ZO(o,u,h,g,S){if(o===null){var N=h.type;return typeof N=="function"&&!Ex(N)&&N.defaultProps===void 0&&h.compare===null?(u.tag=15,u.type=N,XO(o,u,N,g,S)):(o=Ip(h.type,null,g,u,u.mode,S),o.ref=u.ref,o.return=u,u.child=o)}if(N=o.child,!jb(o,S)){var T=N.memoizedProps;if(h=h.compare,h=h!==null?h:Kd,h(T,g)&&o.ref===u.ref)return ls(o,u,S)}return u.flags|=1,o=ns(N,g),o.ref=u.ref,o.return=u,u.child=o}function XO(o,u,h,g,S){if(o!==null){var N=o.memoizedProps;if(Kd(N,g)&&o.ref===u.ref)if(Dn=!1,u.pendingProps=g=N,jb(o,S))(o.flags&131072)!==0&&(Dn=!0);else return u.lanes=o.lanes,ls(o,u,S)}return gb(o,u,h,g,S)}function JO(o,u,h,g){var S=g.children,N=o!==null?o.memoizedState:null;if(o===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((u.flags&128)!==0){if(N=N!==null?N.baseLanes|h:h,o!==null){for(g=u.child=o.child,S=0;g!==null;)S=S|g.lanes|g.childLanes,g=g.sibling;g=S&~N}else g=0,u.child=null;return e_(o,u,N,h,g)}if((h&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},o!==null&&Bp(u,N!==null?N.cachePool:null),N!==null?nO(u,N):Gx(),rO(u);else return g=u.lanes=536870912,e_(o,u,N!==null?N.baseLanes|h:h,h,g)}else N!==null?(Bp(u,N.cachePool),nO(u,N),Js(),u.memoizedState=null):(o!==null&&Bp(u,null),Gx(),Js());return cr(o,u,S,h),u.child}function of(o,u){return o!==null&&o.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function e_(o,u,h,g,S){var N=Bx();return N=N===null?null:{parent:Pn._currentValue,pool:N},u.memoizedState={baseLanes:h,cachePool:N},o!==null&&Bp(u,null),Gx(),rO(u),o!==null&&qc(o,u,g,!0),u.childLanes=S,null}function nm(o,u){return u=im({mode:u.mode,children:u.children},o.mode),u.ref=o.ref,o.child=u,u.return=o,u}function t_(o,u,h){return dl(u,o.child,null,h),o=nm(u,u.pendingProps),o.flags|=2,yi(u),u.memoizedState=null,o}function EH(o,u,h){var g=u.pendingProps,S=(u.flags&128)!==0;if(u.flags&=-129,o===null){if(Ct){if(g.mode==="hidden")return o=nm(u,g),u.lanes=536870912,of(null,o);if(Qx(u),(o=tn)?(o=hz(o,Pi),o=o!==null&&o.data==="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:Ks!==null?{id:Na,overflow:ka}:null,retryLane:536870912,hydrationErrors:null},h=LE(o),h.return=u,u.child=h,or=u,tn=null)):o=null,o===null)throw Vs(u);return u.lanes=536870912,null}return nm(u,g)}var N=o.memoizedState;if(N!==null){var T=N.dehydrated;if(Qx(u),S)if(u.flags&256)u.flags&=-257,u=t_(o,u,h);else if(u.memoizedState!==null)u.child=o.child,u.flags|=128,u=null;else throw Error(r(558));else if(Dn||qc(o,u,h,!1),S=(h&o.childLanes)!==0,Dn||S){if(g=Vt,g!==null&&(T=Sr(g,h),T!==0&&T!==N.retryLane))throw N.retryLane=T,rl(o,T),ni(g,o,T),mb;hm(),u=t_(o,u,h)}else o=N.treeContext,tn=Di(T.nextSibling),or=u,Ct=!0,Gs=null,Pi=!1,o!==null&&UE(u,o),u=nm(u,g),u.flags|=4096;return u}return o=ns(o.child,{mode:g.mode,children:g.children}),o.ref=u.ref,u.child=o,o.return=u,o}function rm(o,u){var h=u.ref;if(h===null)o!==null&&o.ref!==null&&(u.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(o===null||o.ref!==h)&&(u.flags|=4194816)}}function gb(o,u,h,g,S){return ol(u),h=Yx(o,u,h,g,void 0,S),g=Zx(),o!==null&&!Dn?(Xx(o,u,S),ls(o,u,S)):(Ct&&g&&zx(u),u.flags|=1,cr(o,u,h,S),u.child)}function n_(o,u,h,g,S,N){return ol(u),u.updateQueue=null,h=aO(u,g,h,S),iO(o),g=Zx(),o!==null&&!Dn?(Xx(o,u,N),ls(o,u,N)):(Ct&&g&&zx(u),u.flags|=1,cr(o,u,h,N),u.child)}function r_(o,u,h,g,S){if(ol(u),u.stateNode===null){var N=Lc,T=h.contextType;typeof T=="object"&&T!==null&&(N=lr(T)),N=new h(g,N),u.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=hb,u.stateNode=N,N._reactInternals=u,N=u.stateNode,N.props=g,N.state=u.memoizedState,N.refs={},qx(u),T=h.contextType,N.context=typeof T=="object"&&T!==null?lr(T):Lc,N.state=u.memoizedState,T=h.getDerivedStateFromProps,typeof T=="function"&&(fb(u,h,T,g),N.state=u.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&&hb.enqueueReplaceState(N,N.state,null),tf(u,g,N,S),ef(),N.state=u.memoizedState),typeof N.componentDidMount=="function"&&(u.flags|=4194308),g=!0}else if(o===null){N=u.stateNode;var L=u.memoizedProps,G=hl(h,L);N.props=G;var se=N.context,me=h.contextType;T=Lc,typeof me=="object"&&me!==null&&(T=lr(me));var xe=h.getDerivedStateFromProps;me=typeof xe=="function"||typeof N.getSnapshotBeforeUpdate=="function",L=u.pendingProps!==L,me||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(L||se!==T)&&FO(u,N,g,T),Ws=!1;var ue=u.memoizedState;N.state=ue,tf(u,g,N,S),ef(),se=u.memoizedState,L||ue!==se||Ws?(typeof xe=="function"&&(fb(u,h,xe,g),se=u.memoizedState),(G=Ws||qO(u,h,G,g,ue,se,T))?(me||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(u.flags|=4194308)):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=g,u.memoizedState=se),N.props=g,N.state=se,N.context=T,g=G):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),g=!1)}else{N=u.stateNode,Fx(o,u),T=u.memoizedProps,me=hl(h,T),N.props=me,xe=u.pendingProps,ue=N.context,se=h.contextType,G=Lc,typeof se=="object"&&se!==null&&(G=lr(se)),L=h.getDerivedStateFromProps,(se=typeof L=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(T!==xe||ue!==G)&&FO(u,N,g,G),Ws=!1,ue=u.memoizedState,N.state=ue,tf(u,g,N,S),ef();var he=u.memoizedState;T!==xe||ue!==he||Ws||o!==null&&o.dependencies!==null&&Lp(o.dependencies)?(typeof L=="function"&&(fb(u,h,L,g),he=u.memoizedState),(me=Ws||qO(u,h,me,g,ue,he,G)||o!==null&&o.dependencies!==null&&Lp(o.dependencies))?(se||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(g,he,G),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(g,he,G)),typeof N.componentDidUpdate=="function"&&(u.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof N.componentDidUpdate!="function"||T===o.memoizedProps&&ue===o.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||T===o.memoizedProps&&ue===o.memoizedState||(u.flags|=1024),u.memoizedProps=g,u.memoizedState=he),N.props=g,N.state=he,N.context=G,g=me):(typeof N.componentDidUpdate!="function"||T===o.memoizedProps&&ue===o.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||T===o.memoizedProps&&ue===o.memoizedState||(u.flags|=1024),g=!1)}return N=g,rm(o,u),g=(u.flags&128)!==0,N||g?(N=u.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:N.render(),u.flags|=1,o!==null&&g?(u.child=dl(u,o.child,null,S),u.child=dl(u,null,h,S)):cr(o,u,h,S),u.memoizedState=N.state,o=u.child):o=ls(o,u,S),o}function i_(o,u,h,g){return al(),u.flags|=256,cr(o,u,h,g),u.child}var yb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vb(o){return{baseLanes:o,cachePool:VE()}}function xb(o,u,h){return o=o!==null?o.childLanes&~h:0,u&&(o|=xi),o}function a_(o,u,h){var g=u.pendingProps,S=!1,N=(u.flags&128)!==0,T;if((T=N)||(T=o!==null&&o.memoizedState===null?!1:(Nn.current&2)!==0),T&&(S=!0,u.flags&=-129),T=(u.flags&32)!==0,u.flags&=-33,o===null){if(Ct){if(S?Xs(u):Js(),(o=tn)?(o=hz(o,Pi),o=o!==null&&o.data!=="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:Ks!==null?{id:Na,overflow:ka}:null,retryLane:536870912,hydrationErrors:null},h=LE(o),h.return=u,u.child=h,or=u,tn=null)):o=null,o===null)throw Vs(u);return tw(o)?u.lanes=32:u.lanes=536870912,null}var L=g.children;return g=g.fallback,S?(Js(),S=u.mode,L=im({mode:"hidden",children:L},S),g=il(g,S,h,null),L.return=u,g.return=u,L.sibling=g,u.child=L,g=u.child,g.memoizedState=vb(h),g.childLanes=xb(o,T,h),u.memoizedState=yb,of(null,g)):(Xs(u),bb(u,L))}var G=o.memoizedState;if(G!==null&&(L=G.dehydrated,L!==null)){if(N)u.flags&256?(Xs(u),u.flags&=-257,u=wb(o,u,h)):u.memoizedState!==null?(Js(),u.child=o.child,u.flags|=128,u=null):(Js(),L=g.fallback,S=u.mode,g=im({mode:"visible",children:g.children},S),L=il(L,S,h,null),L.flags|=2,g.return=u,L.return=u,g.sibling=L,u.child=g,dl(u,o.child,null,h),g=u.child,g.memoizedState=vb(h),g.childLanes=xb(o,T,h),u.memoizedState=yb,u=of(null,g));else if(Xs(u),tw(L)){if(T=L.nextSibling&&L.nextSibling.dataset,T)var se=T.dgst;T=se,g=Error(r(419)),g.stack="",g.digest=T,Qd({value:g,source:null,stack:null}),u=wb(o,u,h)}else if(Dn||qc(o,u,h,!1),T=(h&o.childLanes)!==0,Dn||T){if(T=Vt,T!==null&&(g=Sr(T,h),g!==0&&g!==G.retryLane))throw G.retryLane=g,rl(o,g),ni(T,o,g),mb;ew(L)||hm(),u=wb(o,u,h)}else ew(L)?(u.flags|=192,u.child=o.child,u=null):(o=G.treeContext,tn=Di(L.nextSibling),or=u,Ct=!0,Gs=null,Pi=!1,o!==null&&UE(u,o),u=bb(u,g.children),u.flags|=4096);return u}return S?(Js(),L=g.fallback,S=u.mode,G=o.child,se=G.sibling,g=ns(G,{mode:"hidden",children:g.children}),g.subtreeFlags=G.subtreeFlags&65011712,se!==null?L=ns(se,L):(L=il(L,S,h,null),L.flags|=2),L.return=u,g.return=u,g.sibling=L,u.child=g,of(null,g),g=u.child,L=o.child.memoizedState,L===null?L=vb(h):(S=L.cachePool,S!==null?(G=Pn._currentValue,S=S.parent!==G?{parent:G,pool:G}:S):S=VE(),L={baseLanes:L.baseLanes|h,cachePool:S}),g.memoizedState=L,g.childLanes=xb(o,T,h),u.memoizedState=yb,of(o.child,g)):(Xs(u),h=o.child,o=h.sibling,h=ns(h,{mode:"visible",children:g.children}),h.return=u,h.sibling=null,o!==null&&(T=u.deletions,T===null?(u.deletions=[o],u.flags|=16):T.push(o)),u.child=h,u.memoizedState=null,h)}function bb(o,u){return u=im({mode:"visible",children:u},o.mode),u.return=o,o.child=u}function im(o,u){return o=mi(22,o,null,u),o.lanes=0,o}function wb(o,u,h){return dl(u,o.child,null,h),o=bb(u,u.pendingProps.children),o.flags|=2,u.memoizedState=null,o}function s_(o,u,h){o.lanes|=u;var g=o.alternate;g!==null&&(g.lanes|=u),Ix(o.return,u,h)}function Sb(o,u,h,g,S,N){var T=o.memoizedState;T===null?o.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:S,treeForkCount:N}:(T.isBackwards=u,T.rendering=null,T.renderingStartTime=0,T.last=g,T.tail=h,T.tailMode=S,T.treeForkCount=N)}function o_(o,u,h){var g=u.pendingProps,S=g.revealOrder,N=g.tail;g=g.children;var T=Nn.current,L=(T&2)!==0;if(L?(T=T&1|2,u.flags|=128):T&=1,I(Nn,T),cr(o,u,g,h),g=Ct?Vd:0,!L&&o!==null&&(o.flags&128)!==0)e:for(o=u.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&s_(o,h,u);else if(o.tag===19)s_(o,h,u);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===u)break e;for(;o.sibling===null;){if(o.return===null||o.return===u)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(S){case"forwards":for(h=u.child,S=null;h!==null;)o=h.alternate,o!==null&&Gp(o)===null&&(S=h),h=h.sibling;h=S,h===null?(S=u.child,u.child=null):(S=h.sibling,h.sibling=null),Sb(u,!1,S,h,N,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,S=u.child,u.child=null;S!==null;){if(o=S.alternate,o!==null&&Gp(o)===null){u.child=S;break}o=S.sibling,S.sibling=h,h=S,S=o}Sb(u,!0,h,null,N,g);break;case"together":Sb(u,!1,null,null,void 0,g);break;default:u.memoizedState=null}return u.child}function ls(o,u,h){if(o!==null&&(u.dependencies=o.dependencies),no|=u.lanes,(h&u.childLanes)===0)if(o!==null){if(qc(o,u,h,!1),(h&u.childLanes)===0)return null}else return null;if(o!==null&&u.child!==o.child)throw Error(r(153));if(u.child!==null){for(o=u.child,h=ns(o,o.pendingProps),u.child=h,h.return=u;o.sibling!==null;)o=o.sibling,h=h.sibling=ns(o,o.pendingProps),h.return=u;h.sibling=null}return u.child}function jb(o,u){return(o.lanes&u)!==0?!0:(o=o.dependencies,!!(o!==null&&Lp(o)))}function OH(o,u,h){switch(u.tag){case 3:ze(u,u.stateNode.containerInfo),Qs(u,Pn,o.memoizedState.cache),al();break;case 27:case 5:fe(u);break;case 4:ze(u,u.stateNode.containerInfo);break;case 10:Qs(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,Qx(u),null;break;case 13:var g=u.memoizedState;if(g!==null)return g.dehydrated!==null?(Xs(u),u.flags|=128,null):(h&u.child.childLanes)!==0?a_(o,u,h):(Xs(u),o=ls(o,u,h),o!==null?o.sibling:null);Xs(u);break;case 19:var S=(o.flags&128)!==0;if(g=(h&u.childLanes)!==0,g||(qc(o,u,h,!1),g=(h&u.childLanes)!==0),S){if(g)return o_(o,u,h);u.flags|=128}if(S=u.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),I(Nn,Nn.current),g)break;return null;case 22:return u.lanes=0,JO(o,u,h,u.pendingProps);case 24:Qs(u,Pn,o.memoizedState.cache)}return ls(o,u,h)}function l_(o,u,h){if(o!==null)if(o.memoizedProps!==u.pendingProps)Dn=!0;else{if(!jb(o,h)&&(u.flags&128)===0)return Dn=!1,OH(o,u,h);Dn=(o.flags&131072)!==0}else Dn=!1,Ct&&(u.flags&1048576)!==0&&BE(u,Vd,u.index);switch(u.lanes=0,u.tag){case 16:e:{var g=u.pendingProps;if(o=cl(u.elementType),u.type=o,typeof o=="function")Ex(o)?(g=hl(o,g),u.tag=1,u=r_(null,u,o,g,h)):(u.tag=0,u=gb(null,u,o,g,h));else{if(o!=null){var S=o.$$typeof;if(S===C){u.tag=11,u=YO(null,u,o,g,h);break e}else if(S===_){u.tag=14,u=ZO(null,u,o,g,h);break e}}throw u=X(o)||o,Error(r(306,u,""))}}return u;case 0:return gb(o,u,u.type,u.pendingProps,h);case 1:return g=u.type,S=hl(g,u.pendingProps),r_(o,u,g,S,h);case 3:e:{if(ze(u,u.stateNode.containerInfo),o===null)throw Error(r(387));g=u.pendingProps;var N=u.memoizedState;S=N.element,Fx(o,u),tf(u,g,null,h);var T=u.memoizedState;if(g=T.cache,Qs(u,Pn,g),g!==N.cache&&Mx(u,[Pn],h,!0),ef(),g=T.element,N.isDehydrated)if(N={element:g,isDehydrated:!1,cache:T.cache},u.updateQueue.baseState=N,u.memoizedState=N,u.flags&256){u=i_(o,u,g,h);break e}else if(g!==S){S=_i(Error(r(424)),u),Qd(S),u=i_(o,u,g,h);break e}else for(o=u.stateNode.containerInfo,o.nodeType===9?o=o.body:o=o.nodeName==="HTML"?o.ownerDocument.body:o,tn=Di(o.firstChild),or=u,Ct=!0,Gs=null,Pi=!0,h=JE(u,null,g,h),u.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(al(),g===S){u=ls(o,u,h);break e}cr(o,u,g,h)}u=u.child}return u;case 26:return rm(o,u),o===null?(h=xz(u.type,null,u.pendingProps,null))?u.memoizedState=h:Ct||(h=u.type,o=u.pendingProps,g=bm(re.current).createElement(h),g[Tn]=u,g[jr]=o,ur(g,h,o),wt(g),u.stateNode=g):u.memoizedState=xz(u.type,o.memoizedProps,u.pendingProps,o.memoizedState),null;case 27:return fe(u),o===null&&Ct&&(g=u.stateNode=gz(u.type,u.pendingProps,re.current),or=u,Pi=!0,S=tn,oo(u.type)?(nw=S,tn=Di(g.firstChild)):tn=S),cr(o,u,u.pendingProps.children,h),rm(o,u),o===null&&(u.flags|=4194304),u.child;case 5:return o===null&&Ct&&((S=g=tn)&&(g=aK(g,u.type,u.pendingProps,Pi),g!==null?(u.stateNode=g,or=u,tn=Di(g.firstChild),Pi=!1,S=!0):S=!1),S||Vs(u)),fe(u),S=u.type,N=u.pendingProps,T=o!==null?o.memoizedProps:null,g=N.children,Zb(S,N)?g=null:T!==null&&Zb(S,T)&&(u.flags|=32),u.memoizedState!==null&&(S=Yx(o,u,bH,null,null,h),Sf._currentValue=S),rm(o,u),cr(o,u,g,h),u.child;case 6:return o===null&&Ct&&((o=h=tn)&&(h=sK(h,u.pendingProps,Pi),h!==null?(u.stateNode=h,or=u,tn=null,o=!0):o=!1),o||Vs(u)),null;case 13:return a_(o,u,h);case 4:return ze(u,u.stateNode.containerInfo),g=u.pendingProps,o===null?u.child=dl(u,null,g,h):cr(o,u,g,h),u.child;case 11:return YO(o,u,u.type,u.pendingProps,h);case 7:return cr(o,u,u.pendingProps,h),u.child;case 8:return cr(o,u,u.pendingProps.children,h),u.child;case 12:return cr(o,u,u.pendingProps.children,h),u.child;case 10:return g=u.pendingProps,Qs(u,u.type,g.value),cr(o,u,g.children,h),u.child;case 9:return S=u.type._context,g=u.pendingProps.children,ol(u),S=lr(S),g=g(S),u.flags|=1,cr(o,u,g,h),u.child;case 14:return ZO(o,u,u.type,u.pendingProps,h);case 15:return XO(o,u,u.type,u.pendingProps,h);case 19:return o_(o,u,h);case 31:return EH(o,u,h);case 22:return JO(o,u,h,u.pendingProps);case 24:return ol(u),g=lr(Pn),o===null?(S=Bx(),S===null&&(S=Vt,N=Lx(),S.pooledCache=N,N.refCount++,N!==null&&(S.pooledCacheLanes|=h),S=N),u.memoizedState={parent:g,cache:S},qx(u),Qs(u,Pn,S)):((o.lanes&h)!==0&&(Fx(o,u),tf(u,null,null,h),ef()),S=o.memoizedState,N=u.memoizedState,S.parent!==g?(S={parent:g,cache:g},u.memoizedState=S,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=S),Qs(u,Pn,g)):(g=N.cache,Qs(u,Pn,g),g!==S.cache&&Mx(u,[Pn],h,!0))),cr(o,u,u.pendingProps.children,h),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function cs(o){o.flags|=4}function Nb(o,u,h,g,S){if((u=(o.mode&32)!==0)&&(u=!1),u){if(o.flags|=16777216,(S&335544128)===S)if(o.stateNode.complete)o.flags|=8192;else if(D_())o.flags|=8192;else throw ul=qp,Ux}else o.flags&=-16777217}function c_(o,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!Nz(u))if(D_())o.flags|=8192;else throw ul=qp,Ux}function am(o,u){u!==null&&(o.flags|=4),o.flags&16384&&(u=o.tag!==22?yt():536870912,o.lanes|=u,eu|=u)}function lf(o,u){if(!Ct)switch(o.tailMode){case"hidden":u=o.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?o.tail=null:h.sibling=null;break;case"collapsed":h=o.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?u||o.tail===null?o.tail=null:o.tail.sibling=null:g.sibling=null}}function nn(o){var u=o.alternate!==null&&o.alternate.child===o.child,h=0,g=0;if(u)for(var S=o.child;S!==null;)h|=S.lanes|S.childLanes,g|=S.subtreeFlags&65011712,g|=S.flags&65011712,S.return=o,S=S.sibling;else for(S=o.child;S!==null;)h|=S.lanes|S.childLanes,g|=S.subtreeFlags,g|=S.flags,S.return=o,S=S.sibling;return o.subtreeFlags|=g,o.childLanes=h,u}function _H(o,u,h){var g=u.pendingProps;switch(Tx(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nn(u),null;case 1:return nn(u),null;case 3:return h=u.stateNode,g=null,o!==null&&(g=o.memoizedState.cache),u.memoizedState.cache!==g&&(u.flags|=2048),as(Pn),te(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(Uc(u)?cs(u):o===null||o.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Rx())),nn(u),null;case 26:var S=u.type,N=u.memoizedState;return o===null?(cs(u),N!==null?(nn(u),c_(u,N)):(nn(u),Nb(u,S,null,g,h))):N?N!==o.memoizedState?(cs(u),nn(u),c_(u,N)):(nn(u),u.flags&=-16777217):(o=o.memoizedProps,o!==g&&cs(u),nn(u),Nb(u,S,o,g,h)),null;case 27:if(Ee(u),h=re.current,S=u.type,o!==null&&u.stateNode!=null)o.memoizedProps!==g&&cs(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return nn(u),null}o=V.current,Uc(u)?qE(u):(o=gz(S,g,h),u.stateNode=o,cs(u))}return nn(u),null;case 5:if(Ee(u),S=u.type,o!==null&&u.stateNode!=null)o.memoizedProps!==g&&cs(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return nn(u),null}if(N=V.current,Uc(u))qE(u);else{var T=bm(re.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[Tn]=u,N[jr]=g;e:for(T=u.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===u)break e;for(;T.sibling===null;){if(T.return===null||T.return===u)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}u.stateNode=N;e:switch(ur(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&&cs(u)}}return nn(u),Nb(u,u.type,o===null?null:o.memoizedProps,u.pendingProps,h),null;case 6:if(o&&u.stateNode!=null)o.memoizedProps!==g&&cs(u);else{if(typeof g!="string"&&u.stateNode===null)throw Error(r(166));if(o=re.current,Uc(u)){if(o=u.stateNode,h=u.memoizedProps,g=null,S=or,S!==null)switch(S.tag){case 27:case 5:g=S.memoizedProps}o[Tn]=u,o=!!(o.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||az(o.nodeValue,h)),o||Vs(u,!0)}else o=bm(o).createTextNode(g),o[Tn]=u,u.stateNode=o}return nn(u),null;case 31:if(h=u.memoizedState,o===null||o.memoizedState!==null){if(g=Uc(u),h!==null){if(o===null){if(!g)throw Error(r(318));if(o=u.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[Tn]=u}else al(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;nn(u),o=!1}else h=Rx(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=h),o=!0;if(!o)return u.flags&256?(yi(u),u):(yi(u),null);if((u.flags&128)!==0)throw Error(r(558))}return nn(u),null;case 13:if(g=u.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(S=Uc(u),g!==null&&g.dehydrated!==null){if(o===null){if(!S)throw Error(r(318));if(S=u.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(r(317));S[Tn]=u}else al(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;nn(u),S=!1}else S=Rx(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=S),S=!0;if(!S)return u.flags&256?(yi(u),u):(yi(u),null)}return yi(u),(u.flags&128)!==0?(u.lanes=h,u):(h=g!==null,o=o!==null&&o.memoizedState!==null,h&&(g=u.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!==o&&h&&(u.child.flags|=8192),am(u,u.updateQueue),nn(u),null);case 4:return te(),o===null&&Gb(u.stateNode.containerInfo),nn(u),null;case 10:return as(u.type),nn(u),null;case 19:if(U(Nn),g=u.memoizedState,g===null)return nn(u),null;if(S=(u.flags&128)!==0,N=g.rendering,N===null)if(S)lf(g,!1);else{if(xn!==0||o!==null&&(o.flags&128)!==0)for(o=u.child;o!==null;){if(N=Gp(o),N!==null){for(u.flags|=128,lf(g,!1),o=N.updateQueue,u.updateQueue=o,am(u,o),u.subtreeFlags=0,o=h,h=u.child;h!==null;)ME(h,o),h=h.sibling;return I(Nn,Nn.current&1|2),Ct&&rs(u,g.treeForkCount),u.child}o=o.sibling}g.tail!==null&&Ye()>um&&(u.flags|=128,S=!0,lf(g,!1),u.lanes=4194304)}else{if(!S)if(o=Gp(N),o!==null){if(u.flags|=128,S=!0,o=o.updateQueue,u.updateQueue=o,am(u,o),lf(g,!0),g.tail===null&&g.tailMode==="hidden"&&!N.alternate&&!Ct)return nn(u),null}else 2*Ye()-g.renderingStartTime>um&&h!==536870912&&(u.flags|=128,S=!0,lf(g,!1),u.lanes=4194304);g.isBackwards?(N.sibling=u.child,u.child=N):(o=g.last,o!==null?o.sibling=N:u.child=N,g.last=N)}return g.tail!==null?(o=g.tail,g.rendering=o,g.tail=o.sibling,g.renderingStartTime=Ye(),o.sibling=null,h=Nn.current,I(Nn,S?h&1|2:h&1),Ct&&rs(u,g.treeForkCount),o):(nn(u),null);case 22:case 23:return yi(u),Vx(),g=u.memoizedState!==null,o!==null?o.memoizedState!==null!==g&&(u.flags|=8192):g&&(u.flags|=8192),g?(h&536870912)!==0&&(u.flags&128)===0&&(nn(u),u.subtreeFlags&6&&(u.flags|=8192)):nn(u),h=u.updateQueue,h!==null&&am(u,h.retryQueue),h=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==h&&(u.flags|=2048),o!==null&&U(ll),null;case 24:return h=null,o!==null&&(h=o.memoizedState.cache),u.memoizedState.cache!==h&&(u.flags|=2048),as(Pn),nn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function zH(o,u){switch(Tx(u),u.tag){case 1:return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 3:return as(Pn),te(),o=u.flags,(o&65536)!==0&&(o&128)===0?(u.flags=o&-65537|128,u):null;case 26:case 27:case 5:return Ee(u),null;case 31:if(u.memoizedState!==null){if(yi(u),u.alternate===null)throw Error(r(340));al()}return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 13:if(yi(u),o=u.memoizedState,o!==null&&o.dehydrated!==null){if(u.alternate===null)throw Error(r(340));al()}return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 19:return U(Nn),null;case 4:return te(),null;case 10:return as(u.type),null;case 22:case 23:return yi(u),Vx(),o!==null&&U(ll),o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 24:return as(Pn),null;case 25:return null;default:return null}}function u_(o,u){switch(Tx(u),u.tag){case 3:as(Pn),te();break;case 26:case 27:case 5:Ee(u);break;case 4:te();break;case 31:u.memoizedState!==null&&yi(u);break;case 13:yi(u);break;case 19:U(Nn);break;case 10:as(u.type);break;case 22:case 23:yi(u),Vx(),o!==null&&U(ll);break;case 24:as(Pn)}}function cf(o,u){try{var h=u.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var S=g.next;h=S;do{if((h.tag&o)===o){g=void 0;var N=h.create,T=h.inst;g=N(),T.destroy=g}h=h.next}while(h!==S)}}catch(L){Lt(u,u.return,L)}}function eo(o,u,h){try{var g=u.updateQueue,S=g!==null?g.lastEffect:null;if(S!==null){var N=S.next;g=N;do{if((g.tag&o)===o){var T=g.inst,L=T.destroy;if(L!==void 0){T.destroy=void 0,S=u;var G=h,se=L;try{se()}catch(me){Lt(S,G,me)}}}g=g.next}while(g!==N)}}catch(me){Lt(u,u.return,me)}}function d_(o){var u=o.updateQueue;if(u!==null){var h=o.stateNode;try{tO(u,h)}catch(g){Lt(o,o.return,g)}}}function f_(o,u,h){h.props=hl(o.type,o.memoizedProps),h.state=o.memoizedState;try{h.componentWillUnmount()}catch(g){Lt(o,u,g)}}function uf(o,u){try{var h=o.ref;if(h!==null){switch(o.tag){case 26:case 27:case 5:var g=o.stateNode;break;case 30:g=o.stateNode;break;default:g=o.stateNode}typeof h=="function"?o.refCleanup=h(g):h.current=g}}catch(S){Lt(o,u,S)}}function Ca(o,u){var h=o.ref,g=o.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(S){Lt(o,u,S)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(S){Lt(o,u,S)}else h.current=null}function h_(o){var u=o.type,h=o.memoizedProps,g=o.stateNode;try{e:switch(u){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){Lt(o,o.return,S)}}function kb(o,u,h){try{var g=o.stateNode;JH(g,o.type,h,u),g[jr]=u}catch(S){Lt(o,o.return,S)}}function p_(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&oo(o.type)||o.tag===4}function Cb(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||p_(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&oo(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Ab(o,u,h){var g=o.tag;if(g===5||g===6)o=o.stateNode,u?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(o,u):(u=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,u.appendChild(o),h=h._reactRootContainer,h!=null||u.onclick!==null||(u.onclick=es));else if(g!==4&&(g===27&&oo(o.type)&&(h=o.stateNode,u=null),o=o.child,o!==null))for(Ab(o,u,h),o=o.sibling;o!==null;)Ab(o,u,h),o=o.sibling}function sm(o,u,h){var g=o.tag;if(g===5||g===6)o=o.stateNode,u?h.insertBefore(o,u):h.appendChild(o);else if(g!==4&&(g===27&&oo(o.type)&&(h=o.stateNode),o=o.child,o!==null))for(sm(o,u,h),o=o.sibling;o!==null;)sm(o,u,h),o=o.sibling}function m_(o){var u=o.stateNode,h=o.memoizedProps;try{for(var g=o.type,S=u.attributes;S.length;)u.removeAttributeNode(S[0]);ur(u,g,h),u[Tn]=o,u[jr]=h}catch(N){Lt(o,o.return,N)}}var us=!1,In=!1,Eb=!1,g_=typeof WeakSet=="function"?WeakSet:Set,Yn=null;function TH(o,u){if(o=o.containerInfo,Wb=Am,o=EE(o),wx(o)){if("selectionStart"in o)var h={start:o.selectionStart,end:o.selectionEnd};else e:{h=(h=o.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,G=-1,se=0,me=0,xe=o,ue=null;t:for(;;){for(var he;xe!==h||S!==0&&xe.nodeType!==3||(L=T+S),xe!==N||g!==0&&xe.nodeType!==3||(G=T+g),xe.nodeType===3&&(T+=xe.nodeValue.length),(he=xe.firstChild)!==null;)ue=xe,xe=he;for(;;){if(xe===o)break t;if(ue===h&&++se===S&&(L=T),ue===N&&++me===g&&(G=T),(he=xe.nextSibling)!==null)break;xe=ue,ue=xe.parentNode}xe=he}h=L===-1||G===-1?null:{start:L,end:G}}else h=null}h=h||{start:0,end:0}}else h=null;for(Yb={focusedElem:o,selectionRange:h},Am=!1,Yn=u;Yn!==null;)if(u=Yn,o=u.child,(u.subtreeFlags&1028)!==0&&o!==null)o.return=u,Yn=o;else for(;Yn!==null;){switch(u=Yn,N=u.alternate,o=u.flags,u.tag){case 0:if((o&4)!==0&&(o=u.updateQueue,o=o!==null?o.events:null,o!==null))for(h=0;h<o.length;h++)S=o[h],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&N!==null){o=void 0,h=u,S=N.memoizedProps,N=N.memoizedState,g=h.stateNode;try{var Le=hl(h.type,S);o=g.getSnapshotBeforeUpdate(Le,N),g.__reactInternalSnapshotBeforeUpdate=o}catch(We){Lt(h,h.return,We)}}break;case 3:if((o&1024)!==0){if(o=u.stateNode.containerInfo,h=o.nodeType,h===9)Jb(o);else if(h===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":Jb(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=u.sibling,o!==null){o.return=u.return,Yn=o;break}Yn=u.return}}function y_(o,u,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:fs(o,h),g&4&&cf(5,h);break;case 1:if(fs(o,h),g&4)if(o=h.stateNode,u===null)try{o.componentDidMount()}catch(T){Lt(h,h.return,T)}else{var S=hl(h.type,u.memoizedProps);u=u.memoizedState;try{o.componentDidUpdate(S,u,o.__reactInternalSnapshotBeforeUpdate)}catch(T){Lt(h,h.return,T)}}g&64&&d_(h),g&512&&uf(h,h.return);break;case 3:if(fs(o,h),g&64&&(o=h.updateQueue,o!==null)){if(u=null,h.child!==null)switch(h.child.tag){case 27:case 5:u=h.child.stateNode;break;case 1:u=h.child.stateNode}try{tO(o,u)}catch(T){Lt(h,h.return,T)}}break;case 27:u===null&&g&4&&m_(h);case 26:case 5:fs(o,h),u===null&&g&4&&h_(h),g&512&&uf(h,h.return);break;case 12:fs(o,h);break;case 31:fs(o,h),g&4&&b_(o,h);break;case 13:fs(o,h),g&4&&w_(o,h),g&64&&(o=h.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(h=UH.bind(null,h),oK(o,h))));break;case 22:if(g=h.memoizedState!==null||us,!g){u=u!==null&&u.memoizedState!==null||In,S=us;var N=In;us=g,(In=u)&&!N?hs(o,h,(h.subtreeFlags&8772)!==0):fs(o,h),us=S,In=N}break;case 30:break;default:fs(o,h)}}function v_(o){var u=o.alternate;u!==null&&(o.alternate=null,v_(u)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(u=o.stateNode,u!==null&&Cc(u)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var ln=null,Xr=!1;function ds(o,u,h){for(h=h.child;h!==null;)x_(o,u,h),h=h.sibling}function x_(o,u,h){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(jn,h)}catch{}switch(h.tag){case 26:In||Ca(h,u),ds(o,u,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:In||Ca(h,u);var g=ln,S=Xr;oo(h.type)&&(ln=h.stateNode,Xr=!1),ds(o,u,h),xf(h.stateNode),ln=g,Xr=S;break;case 5:In||Ca(h,u);case 6:if(g=ln,S=Xr,ln=null,ds(o,u,h),ln=g,Xr=S,ln!==null)if(Xr)try{(ln.nodeType===9?ln.body:ln.nodeName==="HTML"?ln.ownerDocument.body:ln).removeChild(h.stateNode)}catch(N){Lt(h,u,N)}else try{ln.removeChild(h.stateNode)}catch(N){Lt(h,u,N)}break;case 18:ln!==null&&(Xr?(o=ln,dz(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,h.stateNode),lu(o)):dz(ln,h.stateNode));break;case 4:g=ln,S=Xr,ln=h.stateNode.containerInfo,Xr=!0,ds(o,u,h),ln=g,Xr=S;break;case 0:case 11:case 14:case 15:eo(2,h,u),In||eo(4,h,u),ds(o,u,h);break;case 1:In||(Ca(h,u),g=h.stateNode,typeof g.componentWillUnmount=="function"&&f_(h,u,g)),ds(o,u,h);break;case 21:ds(o,u,h);break;case 22:In=(g=In)||h.memoizedState!==null,ds(o,u,h),In=g;break;default:ds(o,u,h)}}function b_(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{lu(o)}catch(h){Lt(u,u.return,h)}}}function w_(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{lu(o)}catch(h){Lt(u,u.return,h)}}function PH(o){switch(o.tag){case 31:case 13:case 19:var u=o.stateNode;return u===null&&(u=o.stateNode=new g_),u;case 22:return o=o.stateNode,u=o._retryCache,u===null&&(u=o._retryCache=new g_),u;default:throw Error(r(435,o.tag))}}function om(o,u){var h=PH(o);u.forEach(function(g){if(!h.has(g)){h.add(g);var S=qH.bind(null,o,g);g.then(S,S)}})}function Jr(o,u){var h=u.deletions;if(h!==null)for(var g=0;g<h.length;g++){var S=h[g],N=o,T=u,L=T;e:for(;L!==null;){switch(L.tag){case 27:if(oo(L.type)){ln=L.stateNode,Xr=!1;break e}break;case 5:ln=L.stateNode,Xr=!1;break e;case 3:case 4:ln=L.stateNode.containerInfo,Xr=!0;break e}L=L.return}if(ln===null)throw Error(r(160));x_(N,T,S),ln=null,Xr=!1,N=S.alternate,N!==null&&(N.return=null),S.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)S_(u,o),u=u.sibling}var aa=null;function S_(o,u){var h=o.alternate,g=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:Jr(u,o),ei(o),g&4&&(eo(3,o,o.return),cf(3,o),eo(5,o,o.return));break;case 1:Jr(u,o),ei(o),g&512&&(In||h===null||Ca(h,h.return)),g&64&&us&&(o=o.updateQueue,o!==null&&(g=o.callbacks,g!==null&&(h=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var S=aa;if(Jr(u,o),ei(o),g&512&&(In||h===null||Ca(h,h.return)),g&4){var N=h!==null?h.memoizedState:null;if(g=o.memoizedState,h===null)if(g===null)if(o.stateNode===null){e:{g=o.type,h=o.memoizedProps,S=S.ownerDocument||S;t:switch(g){case"title":N=S.getElementsByTagName("title")[0],(!N||N[Xo]||N[Tn]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=S.createElement(g),S.head.insertBefore(N,S.querySelector("head > title"))),ur(N,g,h),N[Tn]=o,wt(N),g=N;break e;case"link":var T=Sz("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),ur(N,g,h),S.head.appendChild(N);break;case"meta":if(T=Sz("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),ur(N,g,h),S.head.appendChild(N);break;default:throw Error(r(468,g))}N[Tn]=o,wt(N),g=N}o.stateNode=g}else jz(S,o.type,o.stateNode);else o.stateNode=wz(S,g,o.memoizedProps);else N!==g?(N===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):N.count--,g===null?jz(S,o.type,o.stateNode):wz(S,g,o.memoizedProps)):g===null&&o.stateNode!==null&&kb(o,o.memoizedProps,h.memoizedProps)}break;case 27:Jr(u,o),ei(o),g&512&&(In||h===null||Ca(h,h.return)),h!==null&&g&4&&kb(o,o.memoizedProps,h.memoizedProps);break;case 5:if(Jr(u,o),ei(o),g&512&&(In||h===null||Ca(h,h.return)),o.flags&32){S=o.stateNode;try{zc(S,"")}catch(Le){Lt(o,o.return,Le)}}g&4&&o.stateNode!=null&&(S=o.memoizedProps,kb(o,S,h!==null?h.memoizedProps:S)),g&1024&&(Eb=!0);break;case 6:if(Jr(u,o),ei(o),g&4){if(o.stateNode===null)throw Error(r(162));g=o.memoizedProps,h=o.stateNode;try{h.nodeValue=g}catch(Le){Lt(o,o.return,Le)}}break;case 3:if(jm=null,S=aa,aa=wm(u.containerInfo),Jr(u,o),aa=S,ei(o),g&4&&h!==null&&h.memoizedState.isDehydrated)try{lu(u.containerInfo)}catch(Le){Lt(o,o.return,Le)}Eb&&(Eb=!1,j_(o));break;case 4:g=aa,aa=wm(o.stateNode.containerInfo),Jr(u,o),ei(o),aa=g;break;case 12:Jr(u,o),ei(o);break;case 31:Jr(u,o),ei(o),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,om(o,g)));break;case 13:Jr(u,o),ei(o),o.child.flags&8192&&o.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(cm=Ye()),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,om(o,g)));break;case 22:S=o.memoizedState!==null;var G=h!==null&&h.memoizedState!==null,se=us,me=In;if(us=se||S,In=me||G,Jr(u,o),In=me,us=se,ei(o),g&8192)e:for(u=o.stateNode,u._visibility=S?u._visibility&-2:u._visibility|1,S&&(h===null||G||us||In||pl(o)),h=null,u=o;;){if(u.tag===5||u.tag===26){if(h===null){G=h=u;try{if(N=G.stateNode,S)T=N.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{L=G.stateNode;var xe=G.memoizedProps.style,ue=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;L.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Le){Lt(G,G.return,Le)}}}else if(u.tag===6){if(h===null){G=u;try{G.stateNode.nodeValue=S?"":G.memoizedProps}catch(Le){Lt(G,G.return,Le)}}}else if(u.tag===18){if(h===null){G=u;try{var he=G.stateNode;S?fz(he,!0):fz(G.stateNode,!1)}catch(Le){Lt(G,G.return,Le)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===o)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break e;for(;u.sibling===null;){if(u.return===null||u.return===o)break e;h===u&&(h=null),u=u.return}h===u&&(h=null),u.sibling.return=u.return,u=u.sibling}g&4&&(g=o.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,om(o,h))));break;case 19:Jr(u,o),ei(o),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,om(o,g)));break;case 30:break;case 21:break;default:Jr(u,o),ei(o)}}function ei(o){var u=o.flags;if(u&2){try{for(var h,g=o.return;g!==null;){if(p_(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(o);sm(o,N,S);break;case 5:var T=h.stateNode;h.flags&32&&(zc(T,""),h.flags&=-33);var L=Cb(o);sm(o,L,T);break;case 3:case 4:var G=h.stateNode.containerInfo,se=Cb(o);Ab(o,se,G);break;default:throw Error(r(161))}}catch(me){Lt(o,o.return,me)}o.flags&=-3}u&4096&&(o.flags&=-4097)}function j_(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var u=o;j_(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),o=o.sibling}}function fs(o,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)y_(o,u.alternate,u),u=u.sibling}function pl(o){for(o=o.child;o!==null;){var u=o;switch(u.tag){case 0:case 11:case 14:case 15:eo(4,u,u.return),pl(u);break;case 1:Ca(u,u.return);var h=u.stateNode;typeof h.componentWillUnmount=="function"&&f_(u,u.return,h),pl(u);break;case 27:xf(u.stateNode);case 26:case 5:Ca(u,u.return),pl(u);break;case 22:u.memoizedState===null&&pl(u);break;case 30:pl(u);break;default:pl(u)}o=o.sibling}}function hs(o,u,h){for(h=h&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var g=u.alternate,S=o,N=u,T=N.flags;switch(N.tag){case 0:case 11:case 15:hs(S,N,h),cf(4,N);break;case 1:if(hs(S,N,h),g=N,S=g.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(se){Lt(g,g.return,se)}if(g=N,S=g.updateQueue,S!==null){var L=g.stateNode;try{var G=S.shared.hiddenCallbacks;if(G!==null)for(S.shared.hiddenCallbacks=null,S=0;S<G.length;S++)eO(G[S],L)}catch(se){Lt(g,g.return,se)}}h&&T&64&&d_(N),uf(N,N.return);break;case 27:m_(N);case 26:case 5:hs(S,N,h),h&&g===null&&T&4&&h_(N),uf(N,N.return);break;case 12:hs(S,N,h);break;case 31:hs(S,N,h),h&&T&4&&b_(S,N);break;case 13:hs(S,N,h),h&&T&4&&w_(S,N);break;case 22:N.memoizedState===null&&hs(S,N,h),uf(N,N.return);break;case 30:break;default:hs(S,N,h)}u=u.sibling}}function Ob(o,u){var h=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),o=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(o=u.memoizedState.cachePool.pool),o!==h&&(o!=null&&o.refCount++,h!=null&&Wd(h))}function _b(o,u){o=null,u.alternate!==null&&(o=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==o&&(u.refCount++,o!=null&&Wd(o))}function sa(o,u,h,g){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)N_(o,u,h,g),u=u.sibling}function N_(o,u,h,g){var S=u.flags;switch(u.tag){case 0:case 11:case 15:sa(o,u,h,g),S&2048&&cf(9,u);break;case 1:sa(o,u,h,g);break;case 3:sa(o,u,h,g),S&2048&&(o=null,u.alternate!==null&&(o=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==o&&(u.refCount++,o!=null&&Wd(o)));break;case 12:if(S&2048){sa(o,u,h,g),o=u.stateNode;try{var N=u.memoizedProps,T=N.id,L=N.onPostCommit;typeof L=="function"&&L(T,u.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(G){Lt(u,u.return,G)}}else sa(o,u,h,g);break;case 31:sa(o,u,h,g);break;case 13:sa(o,u,h,g);break;case 23:break;case 22:N=u.stateNode,T=u.alternate,u.memoizedState!==null?N._visibility&2?sa(o,u,h,g):df(o,u):N._visibility&2?sa(o,u,h,g):(N._visibility|=2,Zc(o,u,h,g,(u.subtreeFlags&10256)!==0||!1)),S&2048&&Ob(T,u);break;case 24:sa(o,u,h,g),S&2048&&_b(u.alternate,u);break;default:sa(o,u,h,g)}}function Zc(o,u,h,g,S){for(S=S&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var N=o,T=u,L=h,G=g,se=T.flags;switch(T.tag){case 0:case 11:case 15:Zc(N,T,L,G,S),cf(8,T);break;case 23:break;case 22:var me=T.stateNode;T.memoizedState!==null?me._visibility&2?Zc(N,T,L,G,S):df(N,T):(me._visibility|=2,Zc(N,T,L,G,S)),S&&se&2048&&Ob(T.alternate,T);break;case 24:Zc(N,T,L,G,S),S&&se&2048&&_b(T.alternate,T);break;default:Zc(N,T,L,G,S)}u=u.sibling}}function df(o,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var h=o,g=u,S=g.flags;switch(g.tag){case 22:df(h,g),S&2048&&Ob(g.alternate,g);break;case 24:df(h,g),S&2048&&_b(g.alternate,g);break;default:df(h,g)}u=u.sibling}}var ff=8192;function Xc(o,u,h){if(o.subtreeFlags&ff)for(o=o.child;o!==null;)k_(o,u,h),o=o.sibling}function k_(o,u,h){switch(o.tag){case 26:Xc(o,u,h),o.flags&ff&&o.memoizedState!==null&&xK(h,aa,o.memoizedState,o.memoizedProps);break;case 5:Xc(o,u,h);break;case 3:case 4:var g=aa;aa=wm(o.stateNode.containerInfo),Xc(o,u,h),aa=g;break;case 22:o.memoizedState===null&&(g=o.alternate,g!==null&&g.memoizedState!==null?(g=ff,ff=16777216,Xc(o,u,h),ff=g):Xc(o,u,h));break;default:Xc(o,u,h)}}function C_(o){var u=o.alternate;if(u!==null&&(o=u.child,o!==null)){u.child=null;do u=o.sibling,o.sibling=null,o=u;while(o!==null)}}function hf(o){var u=o.deletions;if((o.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var g=u[h];Yn=g,E_(g,o)}C_(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)A_(o),o=o.sibling}function A_(o){switch(o.tag){case 0:case 11:case 15:hf(o),o.flags&2048&&eo(9,o,o.return);break;case 3:hf(o);break;case 12:hf(o);break;case 22:var u=o.stateNode;o.memoizedState!==null&&u._visibility&2&&(o.return===null||o.return.tag!==13)?(u._visibility&=-3,lm(o)):hf(o);break;default:hf(o)}}function lm(o){var u=o.deletions;if((o.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var g=u[h];Yn=g,E_(g,o)}C_(o)}for(o=o.child;o!==null;){switch(u=o,u.tag){case 0:case 11:case 15:eo(8,u,u.return),lm(u);break;case 22:h=u.stateNode,h._visibility&2&&(h._visibility&=-3,lm(u));break;default:lm(u)}o=o.sibling}}function E_(o,u){for(;Yn!==null;){var h=Yn;switch(h.tag){case 0:case 11:case 15:eo(8,h,u);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:Wd(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,Yn=g;else e:for(h=o;Yn!==null;){g=Yn;var S=g.sibling,N=g.return;if(v_(g),g===h){Yn=null;break e}if(S!==null){S.return=N,Yn=S;break e}Yn=N}}}var RH={getCacheForType:function(o){var u=lr(Pn),h=u.data.get(o);return h===void 0&&(h=o(),u.data.set(o,h)),h},cacheSignal:function(){return lr(Pn).controller.signal}},DH=typeof WeakMap=="function"?WeakMap:Map,Tt=0,Vt=null,xt=null,St=0,Mt=0,vi=null,to=!1,Jc=!1,zb=!1,ps=0,xn=0,no=0,ml=0,Tb=0,xi=0,eu=0,pf=null,ti=null,Pb=!1,cm=0,O_=0,um=1/0,dm=null,ro=null,qn=0,io=null,tu=null,ms=0,Rb=0,Db=null,__=null,mf=0,Ib=null;function bi(){return(Tt&2)!==0&&St!==0?St&-St:H.T!==null?qb():Md()}function z_(){if(xi===0)if((St&536870912)===0||Ct){var o=Ei;Ei<<=1,(Ei&3932160)===0&&(Ei=262144),xi=o}else xi=536870912;return o=gi.current,o!==null&&(o.flags|=32),xi}function ni(o,u,h){(o===Vt&&(Mt===2||Mt===9)||o.cancelPendingCommit!==null)&&(nu(o,0),ao(o,St,xi,!1)),Gt(o,h),((Tt&2)===0||o!==Vt)&&(o===Vt&&((Tt&2)===0&&(ml|=h),xn===4&&ao(o,St,xi,!1)),Aa(o))}function T_(o,u,h){if((Tt&6)!==0)throw Error(r(327));var g=!h&&(u&127)===0&&(u&o.expiredLanes)===0||Je(o,u),S=g?LH(o,u):Lb(o,u,!0),N=g;do{if(S===0){Jc&&!g&&ao(o,u,0,!1);break}else{if(h=o.current.alternate,N&&!IH(h)){S=Lb(o,u,!1),N=!1;continue}if(S===2){if(N=u,o.errorRecoveryDisabledLanes&N)var T=0;else T=o.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){u=T;e:{var L=o;S=pf;var G=L.current.memoizedState.isDehydrated;if(G&&(nu(L,T).flags|=256),T=Lb(L,T,!1),T!==2){if(zb&&!G){L.errorRecoveryDisabledLanes|=N,ml|=N,S=4;break e}N=ti,ti=S,N!==null&&(ti===null?ti=N:ti.push.apply(ti,N))}S=T}if(N=!1,S!==2)continue}}if(S===1){nu(o,0),ao(o,u,0,!0);break}e:{switch(g=o,N=S,N){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:ao(g,u,xi,!to);break e;case 2:ti=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(S=cm+300-Ye(),10<S)){if(ao(g,u,xi,!to),De(g,0,!0)!==0)break e;ms=u,g.timeoutHandle=cz(P_.bind(null,g,h,ti,dm,Pb,u,xi,ml,eu,to,N,"Throttled",-0,0),S);break e}P_(g,h,ti,dm,Pb,u,xi,ml,eu,to,N,null,-0,0)}}break}while(!0);Aa(o)}function P_(o,u,h,g,S,N,T,L,G,se,me,xe,ue,he){if(o.timeoutHandle=-1,xe=u.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:es},k_(u,N,xe);var Le=(N&62914560)===N?cm-Ye():(N&4194048)===N?O_-Ye():0;if(Le=bK(xe,Le),Le!==null){ms=N,o.cancelPendingCommit=Le(U_.bind(null,o,u,N,h,g,S,T,L,G,me,xe,null,ue,he)),ao(o,N,T,!se);return}}U_(o,u,N,h,g,S,T,L,G)}function IH(o){for(var u=o;;){var h=u.tag;if((h===0||h===11||h===15)&&u.flags&16384&&(h=u.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(!pi(N(),S))return!1}catch{return!1}}if(h=u.child,u.subtreeFlags&16384&&h!==null)h.return=u,u=h;else{if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function ao(o,u,h,g){u&=~Tb,u&=~ml,o.suspendedLanes|=u,o.pingedLanes&=~u,g&&(o.warmLanes|=u),g=o.expirationTimes;for(var S=u;0<S;){var N=31-pt(S),T=1<<N;g[N]=-1,S&=~T}h!==0&&na(o,h,u)}function fm(){return(Tt&6)===0?(gf(0),!1):!0}function Mb(){if(xt!==null){if(Mt===0)var o=xt.return;else o=xt,is=sl=null,Jx(o),Gc=null,Zd=0,o=xt;for(;o!==null;)u_(o.alternate,o),o=o.return;xt=null}}function nu(o,u){var h=o.timeoutHandle;h!==-1&&(o.timeoutHandle=-1,nK(h)),h=o.cancelPendingCommit,h!==null&&(o.cancelPendingCommit=null,h()),ms=0,Mb(),Vt=o,xt=h=ns(o.current,null),St=u,Mt=0,vi=null,to=!1,Jc=Je(o,u),zb=!1,eu=xi=Tb=ml=no=xn=0,ti=pf=null,Pb=!1,(u&8)!==0&&(u|=u&32);var g=o.entangledLanes;if(g!==0)for(o=o.entanglements,g&=u;0<g;){var S=31-pt(g),N=1<<S;u|=o[S],g&=~N}return ps=u,Pp(),h}function R_(o,u){st=null,H.H=sf,u===Kc||u===Up?(u=YE(),Mt=3):u===Ux?(u=YE(),Mt=4):Mt=u===mb?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,vi=u,xt===null&&(xn=1,tm(o,_i(u,o.current)))}function D_(){var o=gi.current;return o===null?!0:(St&4194048)===St?Ri===null:(St&62914560)===St||(St&536870912)!==0?o===Ri:!1}function I_(){var o=H.H;return H.H=sf,o===null?sf:o}function M_(){var o=H.A;return H.A=RH,o}function hm(){xn=4,to||(St&4194048)!==St&&gi.current!==null||(Jc=!0),(no&134217727)===0&&(ml&134217727)===0||Vt===null||ao(Vt,St,xi,!1)}function Lb(o,u,h){var g=Tt;Tt|=2;var S=I_(),N=M_();(Vt!==o||St!==u)&&(dm=null,nu(o,u)),u=!1;var T=xn;e:do try{if(Mt!==0&&xt!==null){var L=xt,G=vi;switch(Mt){case 8:Mb(),T=6;break e;case 3:case 2:case 9:case 6:gi.current===null&&(u=!0);var se=Mt;if(Mt=0,vi=null,ru(o,L,G,se),h&&Jc){T=0;break e}break;default:se=Mt,Mt=0,vi=null,ru(o,L,G,se)}}MH(),T=xn;break}catch(me){R_(o,me)}while(!0);return u&&o.shellSuspendCounter++,is=sl=null,Tt=g,H.H=S,H.A=N,xt===null&&(Vt=null,St=0,Pp()),T}function MH(){for(;xt!==null;)L_(xt)}function LH(o,u){var h=Tt;Tt|=2;var g=I_(),S=M_();Vt!==o||St!==u?(dm=null,um=Ye()+500,nu(o,u)):Jc=Je(o,u);e:do try{if(Mt!==0&&xt!==null){u=xt;var N=vi;t:switch(Mt){case 1:Mt=0,vi=null,ru(o,u,N,1);break;case 2:case 9:if(QE(N)){Mt=0,vi=null,$_(u);break}u=function(){Mt!==2&&Mt!==9||Vt!==o||(Mt=7),Aa(o)},N.then(u,u);break e;case 3:Mt=7;break e;case 4:Mt=5;break e;case 7:QE(N)?(Mt=0,vi=null,$_(u)):(Mt=0,vi=null,ru(o,u,N,7));break;case 5:var T=null;switch(xt.tag){case 26:T=xt.memoizedState;case 5:case 27:var L=xt;if(T?Nz(T):L.stateNode.complete){Mt=0,vi=null;var G=L.sibling;if(G!==null)xt=G;else{var se=L.return;se!==null?(xt=se,pm(se)):xt=null}break t}}Mt=0,vi=null,ru(o,u,N,5);break;case 6:Mt=0,vi=null,ru(o,u,N,6);break;case 8:Mb(),xn=6;break e;default:throw Error(r(462))}}$H();break}catch(me){R_(o,me)}while(!0);return is=sl=null,H.H=g,H.A=S,Tt=h,xt!==null?0:(Vt=null,St=0,Pp(),xn)}function $H(){for(;xt!==null&&!ve();)L_(xt)}function L_(o){var u=l_(o.alternate,o,ps);o.memoizedProps=o.pendingProps,u===null?pm(o):xt=u}function $_(o){var u=o,h=u.alternate;switch(u.tag){case 15:case 0:u=n_(h,u,u.pendingProps,u.type,void 0,St);break;case 11:u=n_(h,u,u.pendingProps,u.type.render,u.ref,St);break;case 5:Jx(u);default:u_(h,u),u=xt=ME(u,ps),u=l_(h,u,ps)}o.memoizedProps=o.pendingProps,u===null?pm(o):xt=u}function ru(o,u,h,g){is=sl=null,Jx(u),Gc=null,Zd=0;var S=u.return;try{if(AH(o,S,u,h,St)){xn=1,tm(o,_i(h,o.current)),xt=null;return}}catch(N){if(S!==null)throw xt=S,N;xn=1,tm(o,_i(h,o.current)),xt=null;return}u.flags&32768?(Ct||g===1?o=!0:Jc||(St&536870912)!==0?o=!1:(to=o=!0,(g===2||g===9||g===3||g===6)&&(g=gi.current,g!==null&&g.tag===13&&(g.flags|=16384))),B_(u,o)):pm(u)}function pm(o){var u=o;do{if((u.flags&32768)!==0){B_(u,to);return}o=u.return;var h=_H(u.alternate,u,ps);if(h!==null){xt=h;return}if(u=u.sibling,u!==null){xt=u;return}xt=u=o}while(u!==null);xn===0&&(xn=5)}function B_(o,u){do{var h=zH(o.alternate,o);if(h!==null){h.flags&=32767,xt=h;return}if(h=o.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!u&&(o=o.sibling,o!==null)){xt=o;return}xt=o=h}while(o!==null);xn=6,xt=null}function U_(o,u,h,g,S,N,T,L,G){o.cancelPendingCommit=null;do mm();while(qn!==0);if((Tt&6)!==0)throw Error(r(327));if(u!==null){if(u===o.current)throw Error(r(177));if(N=u.lanes|u.childLanes,N|=Cx,wr(o,h,N,T,L,G),o===Vt&&(xt=Vt=null,St=0),tu=u,io=o,ms=h,Rb=N,Db=S,__=g,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,FH($e,function(){return G_(),null})):(o.callbackNode=null,o.callbackPriority=0),g=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||g){g=H.T,H.T=null,S=J.p,J.p=2,T=Tt,Tt|=4;try{TH(o,u,h)}finally{Tt=T,J.p=S,H.T=g}}qn=1,q_(),F_(),H_()}}function q_(){if(qn===1){qn=0;var o=io,u=tu,h=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||h){h=H.T,H.T=null;var g=J.p;J.p=2;var S=Tt;Tt|=4;try{S_(u,o);var N=Yb,T=EE(o.containerInfo),L=N.focusedElem,G=N.selectionRange;if(T!==L&&L&&L.ownerDocument&&AE(L.ownerDocument.documentElement,L)){if(G!==null&&wx(L)){var se=G.start,me=G.end;if(me===void 0&&(me=se),"selectionStart"in L)L.selectionStart=se,L.selectionEnd=Math.min(me,L.value.length);else{var xe=L.ownerDocument||document,ue=xe&&xe.defaultView||window;if(ue.getSelection){var he=ue.getSelection(),Le=L.textContent.length,We=Math.min(G.start,Le),qt=G.end===void 0?We:Math.min(G.end,Le);!he.extend&&We>qt&&(T=qt,qt=We,We=T);var ee=CE(L,We),Y=CE(L,qt);if(ee&&Y&&(he.rangeCount!==1||he.anchorNode!==ee.node||he.anchorOffset!==ee.offset||he.focusNode!==Y.node||he.focusOffset!==Y.offset)){var ie=xe.createRange();ie.setStart(ee.node,ee.offset),he.removeAllRanges(),We>qt?(he.addRange(ie),he.extend(Y.node,Y.offset)):(ie.setEnd(Y.node,Y.offset),he.addRange(ie))}}}}for(xe=[],he=L;he=he.parentNode;)he.nodeType===1&&xe.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<xe.length;L++){var ye=xe[L];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}Am=!!Wb,Yb=Wb=null}finally{Tt=S,J.p=g,H.T=h}}o.current=u,qn=2}}function F_(){if(qn===2){qn=0;var o=io,u=tu,h=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||h){h=H.T,H.T=null;var g=J.p;J.p=2;var S=Tt;Tt|=4;try{y_(o,u.alternate,u)}finally{Tt=S,J.p=g,H.T=h}}qn=3}}function H_(){if(qn===4||qn===3){qn=0,ft();var o=io,u=tu,h=ms,g=__;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?qn=5:(qn=0,tu=io=null,K_(o,o.pendingLanes));var S=o.pendingLanes;if(S===0&&(ro=null),Nc(h),u=u.stateNode,Kt&&typeof Kt.onCommitFiberRoot=="function")try{Kt.onCommitFiberRoot(jn,u,void 0,(u.current.flags&128)===128)}catch{}if(g!==null){u=H.T,S=J.p,J.p=2,H.T=null;try{for(var N=o.onRecoverableError,T=0;T<g.length;T++){var L=g[T];N(L.value,{componentStack:L.stack})}}finally{H.T=u,J.p=S}}(ms&3)!==0&&mm(),Aa(o),S=o.pendingLanes,(h&261930)!==0&&(S&42)!==0?o===Ib?mf++:(mf=0,Ib=o):mf=0,gf(0)}}function K_(o,u){(o.pooledCacheLanes&=u)===0&&(u=o.pooledCache,u!=null&&(o.pooledCache=null,Wd(u)))}function mm(){return q_(),F_(),H_(),G_()}function G_(){if(qn!==5)return!1;var o=io,u=Rb;Rb=0;var h=Nc(ms),g=H.T,S=J.p;try{J.p=32>h?32:h,H.T=null,h=Db,Db=null;var N=io,T=ms;if(qn=0,tu=io=null,ms=0,(Tt&6)!==0)throw Error(r(331));var L=Tt;if(Tt|=4,A_(N.current),N_(N,N.current,T,h),Tt=L,gf(0,!1),Kt&&typeof Kt.onPostCommitFiberRoot=="function")try{Kt.onPostCommitFiberRoot(jn,N)}catch{}return!0}finally{J.p=S,H.T=g,K_(o,u)}}function V_(o,u,h){u=_i(h,u),u=pb(o.stateNode,u,2),o=Zs(o,u,2),o!==null&&(Gt(o,2),Aa(o))}function Lt(o,u,h){if(o.tag===3)V_(o,o,h);else for(;u!==null;){if(u.tag===3){V_(u,o,h);break}else if(u.tag===1){var g=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(ro===null||!ro.has(g))){o=_i(h,o),h=QO(2),g=Zs(u,h,2),g!==null&&(WO(h,g,u,o),Gt(g,2),Aa(g));break}}u=u.return}}function $b(o,u,h){var g=o.pingCache;if(g===null){g=o.pingCache=new DH;var S=new Set;g.set(u,S)}else S=g.get(u),S===void 0&&(S=new Set,g.set(u,S));S.has(h)||(zb=!0,S.add(h),o=BH.bind(null,o,u,h),u.then(o,o))}function BH(o,u,h){var g=o.pingCache;g!==null&&g.delete(u),o.pingedLanes|=o.suspendedLanes&h,o.warmLanes&=~h,Vt===o&&(St&h)===h&&(xn===4||xn===3&&(St&62914560)===St&&300>Ye()-cm?(Tt&2)===0&&nu(o,0):Tb|=h,eu===St&&(eu=0)),Aa(o)}function Q_(o,u){u===0&&(u=yt()),o=rl(o,u),o!==null&&(Gt(o,u),Aa(o))}function UH(o){var u=o.memoizedState,h=0;u!==null&&(h=u.retryLane),Q_(o,h)}function qH(o,u){var h=0;switch(o.tag){case 31:case 13:var g=o.stateNode,S=o.memoizedState;S!==null&&(h=S.retryLane);break;case 19:g=o.stateNode;break;case 22:g=o.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(u),Q_(o,h)}function FH(o,u){return en(o,u)}var gm=null,iu=null,Bb=!1,ym=!1,Ub=!1,so=0;function Aa(o){o!==iu&&o.next===null&&(iu===null?gm=iu=o:iu=iu.next=o),ym=!0,Bb||(Bb=!0,KH())}function gf(o,u){if(!Ub&&ym){Ub=!0;do for(var h=!1,g=gm;g!==null;){if(o!==0){var S=g.pendingLanes;if(S===0)var N=0;else{var T=g.suspendedLanes,L=g.pingedLanes;N=(1<<31-pt(42|o)+1)-1,N&=S&~(T&~L),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(h=!0,X_(g,N))}else N=St,N=De(g,g===Vt?N:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(N&3)===0||Je(g,N)||(h=!0,X_(g,N));g=g.next}while(h);Ub=!1}}function HH(){W_()}function W_(){ym=Bb=!1;var o=0;so!==0&&tK()&&(o=so);for(var u=Ye(),h=null,g=gm;g!==null;){var S=g.next,N=Y_(g,u);N===0?(g.next=null,h===null?gm=S:h.next=S,S===null&&(iu=h)):(h=g,(o!==0||(N&3)!==0)&&(ym=!0)),g=S}qn!==0&&qn!==5||gf(o),so!==0&&(so=0)}function Y_(o,u){for(var h=o.suspendedLanes,g=o.pingedLanes,S=o.expirationTimes,N=o.pendingLanes&-62914561;0<N;){var T=31-pt(N),L=1<<T,G=S[T];G===-1?((L&h)===0||(L&g)!==0)&&(S[T]=Qe(L,u)):G<=u&&(o.expiredLanes|=L),N&=~L}if(u=Vt,h=St,h=De(o,o===u?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),g=o.callbackNode,h===0||o===u&&(Mt===2||Mt===9)||o.cancelPendingCommit!==null)return g!==null&&g!==null&&_n(g),o.callbackNode=null,o.callbackPriority=0;if((h&3)===0||Je(o,h)){if(u=h&-h,u===o.callbackPriority)return u;switch(g!==null&&_n(g),Nc(h)){case 2:case 8:h=Se;break;case 32:h=$e;break;case 268435456:h=Xe;break;default:h=$e}return g=Z_.bind(null,o),h=en(h,g),o.callbackPriority=u,o.callbackNode=h,u}return g!==null&&g!==null&&_n(g),o.callbackPriority=2,o.callbackNode=null,2}function Z_(o,u){if(qn!==0&&qn!==5)return o.callbackNode=null,o.callbackPriority=0,null;var h=o.callbackNode;if(mm()&&o.callbackNode!==h)return null;var g=St;return g=De(o,o===Vt?g:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),g===0?null:(T_(o,g,u),Y_(o,Ye()),o.callbackNode!=null&&o.callbackNode===h?Z_.bind(null,o):null)}function X_(o,u){if(mm())return null;T_(o,u,!0)}function KH(){rK(function(){(Tt&6)!==0?en(ae,HH):W_()})}function qb(){if(so===0){var o=Fc;o===0&&(o=Sa,Sa<<=1,(Sa&261888)===0&&(Sa=256)),so=o}return so}function J_(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:kp(""+o)}function ez(o,u){var h=u.ownerDocument.createElement("input");return h.name=u.name,h.value=u.value,o.id&&h.setAttribute("form",o.id),u.parentNode.insertBefore(h,u),o=new FormData(o),h.parentNode.removeChild(h),o}function GH(o,u,h,g,S){if(u==="submit"&&h&&h.stateNode===S){var N=J_((S[jr]||null).action),T=g.submitter;T&&(u=(u=T[jr]||null)?J_(u.formAction):T.getAttribute("formAction"),u!==null&&(N=u,T=null));var L=new Op("action","action",null,g,S);o.push({event:L,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(so!==0){var G=T?ez(S,T):new FormData(S);lb(h,{pending:!0,data:G,method:S.method,action:N},null,G)}}else typeof N=="function"&&(L.preventDefault(),G=T?ez(S,T):new FormData(S),lb(h,{pending:!0,data:G,method:S.method,action:N},N,G))},currentTarget:S}]})}}for(var Fb=0;Fb<kx.length;Fb++){var Hb=kx[Fb],VH=Hb.toLowerCase(),QH=Hb[0].toUpperCase()+Hb.slice(1);ia(VH,"on"+QH)}ia(zE,"onAnimationEnd"),ia(TE,"onAnimationIteration"),ia(PE,"onAnimationStart"),ia("dblclick","onDoubleClick"),ia("focusin","onFocus"),ia("focusout","onBlur"),ia(uH,"onTransitionRun"),ia(dH,"onTransitionStart"),ia(fH,"onTransitionCancel"),ia(RE,"onTransitionEnd"),Un("onMouseEnter",["mouseout","mouseover"]),Un("onMouseLeave",["mouseout","mouseover"]),Un("onPointerEnter",["pointerout","pointerover"]),Un("onPointerLeave",["pointerout","pointerover"]),Wr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yf="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(" "),WH=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(yf));function tz(o,u){u=(u&4)!==0;for(var h=0;h<o.length;h++){var g=o[h],S=g.event;g=g.listeners;e:{var N=void 0;if(u)for(var T=g.length-1;0<=T;T--){var L=g[T],G=L.instance,se=L.currentTarget;if(L=L.listener,G!==N&&S.isPropagationStopped())break e;N=L,S.currentTarget=se;try{N(S)}catch(me){Tp(me)}S.currentTarget=null,N=G}else for(T=0;T<g.length;T++){if(L=g[T],G=L.instance,se=L.currentTarget,L=L.listener,G!==N&&S.isPropagationStopped())break e;N=L,S.currentTarget=se;try{N(S)}catch(me){Tp(me)}S.currentTarget=null,N=G}}}}function bt(o,u){var h=u[kc];h===void 0&&(h=u[kc]=new Set);var g=o+"__bubble";h.has(g)||(nz(u,o,2,!1),h.add(g))}function Kb(o,u,h){var g=0;u&&(g|=4),nz(h,o,g,u)}var vm="_reactListening"+Math.random().toString(36).slice(2);function Gb(o){if(!o[vm]){o[vm]=!0,ra.forEach(function(h){h!=="selectionchange"&&(WH.has(h)||Kb(h,!1,o),Kb(h,!0,o))});var u=o.nodeType===9?o:o.ownerDocument;u===null||u[vm]||(u[vm]=!0,Kb("selectionchange",!1,u))}}function nz(o,u,h,g){switch(zz(u)){case 2:var S=jK;break;case 8:S=NK;break;default:S=ow}h=S.bind(null,u,h,o),S=void 0,!fx||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(S=!0),g?S!==void 0?o.addEventListener(u,h,{capture:!0,passive:S}):o.addEventListener(u,h,!0):S!==void 0?o.addEventListener(u,h,{passive:S}):o.addEventListener(u,h,!1)}function Vb(o,u,h,g,S){var N=g;if((u&1)===0&&(u&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 G=T.tag;if((G===3||G===4)&&T.stateNode.containerInfo===S)return;T=T.return}for(;L!==null;){if(T=W(L),T===null)return;if(G=T.tag,G===5||G===6||G===26||G===27){g=N=T;continue e}L=L.parentNode}}g=g.return}oE(function(){var se=N,me=ux(h),xe=[];e:{var ue=DE.get(o);if(ue!==void 0){var he=Op,Le=o;switch(o){case"keypress":if(Ap(h)===0)break e;case"keydown":case"keyup":he=q9;break;case"focusin":Le="focus",he=gx;break;case"focusout":Le="blur",he=gx;break;case"beforeblur":case"afterblur":he=gx;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":he=uE;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=_9;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=K9;break;case zE:case TE:case PE:he=P9;break;case RE:he=V9;break;case"scroll":case"scrollend":he=E9;break;case"wheel":he=W9;break;case"copy":case"cut":case"paste":he=D9;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=fE;break;case"toggle":case"beforetoggle":he=Z9}var We=(u&4)!==0,qt=!We&&(o==="scroll"||o==="scrollend"),ee=We?ue!==null?ue+"Capture":null:ue;We=[];for(var Y=se,ie;Y!==null;){var ye=Y;if(ie=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||ie===null||ee===null||(ye=Ld(Y,ee),ye!=null&&We.push(vf(Y,ye,ie))),qt)break;Y=Y.return}0<We.length&&(ue=new he(ue,Le,null,h,me),xe.push({event:ue,listeners:We}))}}if((u&7)===0){e:{if(ue=o==="mouseover"||o==="pointerover",he=o==="mouseout"||o==="pointerout",ue&&h!==cx&&(Le=h.relatedTarget||h.fromElement)&&(W(Le)||Le[Xa]))break e;if((he||ue)&&(ue=me.window===me?me:(ue=me.ownerDocument)?ue.defaultView||ue.parentWindow:window,he?(Le=h.relatedTarget||h.toElement,he=se,Le=Le?W(Le):null,Le!==null&&(qt=a(Le),We=Le.tag,Le!==qt||We!==5&&We!==27&&We!==6)&&(Le=null)):(he=null,Le=se),he!==Le)){if(We=uE,ye="onMouseLeave",ee="onMouseEnter",Y="mouse",(o==="pointerout"||o==="pointerover")&&(We=fE,ye="onPointerLeave",ee="onPointerEnter",Y="pointer"),qt=he==null?ue:at(he),ie=Le==null?ue:at(Le),ue=new We(ye,Y+"leave",he,h,me),ue.target=qt,ue.relatedTarget=ie,ye=null,W(me)===se&&(We=new We(ee,Y+"enter",Le,h,me),We.target=ie,We.relatedTarget=qt,ye=We),qt=ye,he&&Le)t:{for(We=YH,ee=he,Y=Le,ie=0,ye=ee;ye;ye=We(ye))ie++;ye=0;for(var Ve=Y;Ve;Ve=We(Ve))ye++;for(;0<ie-ye;)ee=We(ee),ie--;for(;0<ye-ie;)Y=We(Y),ye--;for(;ie--;){if(ee===Y||Y!==null&&ee===Y.alternate){We=ee;break t}ee=We(ee),Y=We(Y)}We=null}else We=null;he!==null&&rz(xe,ue,he,We,!1),Le!==null&&qt!==null&&rz(xe,qt,Le,We,!0)}}e:{if(ue=se?at(se):window,he=ue.nodeName&&ue.nodeName.toLowerCase(),he==="select"||he==="input"&&ue.type==="file")var Ot=bE;else if(vE(ue))if(wE)Ot=oH;else{Ot=aH;var qe=iH}else he=ue.nodeName,!he||he.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?se&&lx(se.elementType)&&(Ot=bE):Ot=sH;if(Ot&&(Ot=Ot(o,se))){xE(xe,Ot,h,me);break e}qe&&qe(o,ue,se),o==="focusout"&&se&&ue.type==="number"&&se.memoizedProps.value!=null&&ox(ue,"number",ue.value)}switch(qe=se?at(se):window,o){case"focusin":(vE(qe)||qe.contentEditable==="true")&&(Dc=qe,Sx=se,Gd=null);break;case"focusout":Gd=Sx=Dc=null;break;case"mousedown":jx=!0;break;case"contextmenu":case"mouseup":case"dragend":jx=!1,OE(xe,h,me);break;case"selectionchange":if(cH)break;case"keydown":case"keyup":OE(xe,h,me)}var ct;if(vx)e:{switch(o){case"compositionstart":var jt="onCompositionStart";break e;case"compositionend":jt="onCompositionEnd";break e;case"compositionupdate":jt="onCompositionUpdate";break e}jt=void 0}else Rc?gE(o,h)&&(jt="onCompositionEnd"):o==="keydown"&&h.keyCode===229&&(jt="onCompositionStart");jt&&(hE&&h.locale!=="ko"&&(Rc||jt!=="onCompositionStart"?jt==="onCompositionEnd"&&Rc&&(ct=lE()):(Hs=me,hx="value"in Hs?Hs.value:Hs.textContent,Rc=!0)),qe=xm(se,jt),0<qe.length&&(jt=new dE(jt,o,null,h,me),xe.push({event:jt,listeners:qe}),ct?jt.data=ct:(ct=yE(h),ct!==null&&(jt.data=ct)))),(ct=J9?eH(o,h):tH(o,h))&&(jt=xm(se,"onBeforeInput"),0<jt.length&&(qe=new dE("onBeforeInput","beforeinput",null,h,me),xe.push({event:qe,listeners:jt}),qe.data=ct)),GH(xe,o,se,h,me)}tz(xe,u)})}function vf(o,u,h){return{instance:o,listener:u,currentTarget:h}}function xm(o,u){for(var h=u+"Capture",g=[];o!==null;){var S=o,N=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||N===null||(S=Ld(o,h),S!=null&&g.unshift(vf(o,S,N)),S=Ld(o,u),S!=null&&g.push(vf(o,S,N))),o.tag===3)return g;o=o.return}return[]}function YH(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function rz(o,u,h,g,S){for(var N=u._reactName,T=[];h!==null&&h!==g;){var L=h,G=L.alternate,se=L.stateNode;if(L=L.tag,G!==null&&G===g)break;L!==5&&L!==26&&L!==27||se===null||(G=se,S?(se=Ld(h,N),se!=null&&T.unshift(vf(h,se,G))):S||(se=Ld(h,N),se!=null&&T.push(vf(h,se,G)))),h=h.return}T.length!==0&&o.push({event:u,listeners:T})}var ZH=/\r\n?/g,XH=/\u0000|\uFFFD/g;function iz(o){return(typeof o=="string"?o:""+o).replace(ZH,`
|
|
9
|
-
`).replace(XH,"")}function az(o,u){return u=iz(u),iz(o)===u}function Ut(o,u,h,g,S,N){switch(h){case"children":typeof g=="string"?u==="body"||u==="textarea"&&g===""||zc(o,g):(typeof g=="number"||typeof g=="bigint")&&u!=="body"&&zc(o,""+g);break;case"className":Ec(o,"class",g);break;case"tabIndex":Ec(o,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Ec(o,h,g);break;case"style":aE(o,g,N);break;case"data":if(u!=="object"){Ec(o,"data",g);break}case"src":case"href":if(g===""&&(u!=="a"||h!=="href")){o.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){o.removeAttribute(h);break}g=kp(""+g),o.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){o.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"?(u!=="input"&&Ut(o,u,"name",S.name,S,null),Ut(o,u,"formEncType",S.formEncType,S,null),Ut(o,u,"formMethod",S.formMethod,S,null),Ut(o,u,"formTarget",S.formTarget,S,null)):(Ut(o,u,"encType",S.encType,S,null),Ut(o,u,"method",S.method,S,null),Ut(o,u,"target",S.target,S,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){o.removeAttribute(h);break}g=kp(""+g),o.setAttribute(h,g);break;case"onClick":g!=null&&(o.onclick=es);break;case"onScroll":g!=null&&bt("scroll",o);break;case"onScrollEnd":g!=null&&bt("scrollend",o);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));o.innerHTML=h}}break;case"multiple":o.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":o.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"){o.removeAttribute("xlink:href");break}h=kp(""+g),o.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"?o.setAttribute(h,""+g):o.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"?o.setAttribute(h,""):o.removeAttribute(h);break;case"capture":case"download":g===!0?o.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(h,g):o.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?o.setAttribute(h,g):o.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?o.removeAttribute(h):o.setAttribute(h,g);break;case"popover":bt("beforetoggle",o),bt("toggle",o),Jo(o,"popover",g);break;case"xlinkActuate":Yr(o,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Yr(o,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Yr(o,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Yr(o,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Yr(o,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Yr(o,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Yr(o,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Yr(o,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Yr(o,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Jo(o,"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=C9.get(h)||h,Jo(o,h,g))}}function Qb(o,u,h,g,S,N){switch(h){case"style":aE(o,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));o.innerHTML=h}}break;case"children":typeof g=="string"?zc(o,g):(typeof g=="number"||typeof g=="bigint")&&zc(o,""+g);break;case"onScroll":g!=null&&bt("scroll",o);break;case"onScrollEnd":g!=null&&bt("scrollend",o);break;case"onClick":g!=null&&(o.onclick=es);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Mr.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(S=h.endsWith("Capture"),u=h.slice(2,S?h.length-7:void 0),N=o[jr]||null,N=N!=null?N[h]:null,typeof N=="function"&&o.removeEventListener(u,N,S),typeof g=="function")){typeof N!="function"&&N!==null&&(h in o?o[h]=null:o.hasAttribute(h)&&o.removeAttribute(h)),o.addEventListener(u,g,S);break e}h in o?o[h]=g:g===!0?o.setAttribute(h,""):Jo(o,h,g)}}}function ur(o,u,h){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":bt("error",o),bt("load",o);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,u));default:Ut(o,u,N,T,h,null)}}S&&Ut(o,u,"srcSet",h.srcSet,h,null),g&&Ut(o,u,"src",h.src,h,null);return;case"input":bt("invalid",o);var L=N=T=S=null,G=null,se=null;for(g in h)if(h.hasOwnProperty(g)){var me=h[g];if(me!=null)switch(g){case"name":S=me;break;case"type":T=me;break;case"checked":G=me;break;case"defaultChecked":se=me;break;case"value":N=me;break;case"defaultValue":L=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,u));break;default:Ut(o,u,g,me,h,null)}}tE(o,N,L,G,se,T,S,!1);return;case"select":bt("invalid",o),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:Ut(o,u,S,L,h,null)}u=N,h=T,o.multiple=!!g,u!=null?_c(o,!!g,u,!1):h!=null&&_c(o,!!g,h,!0);return;case"textarea":bt("invalid",o),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:Ut(o,u,T,L,h,null)}rE(o,g,S,N);return;case"option":for(G in h)h.hasOwnProperty(G)&&(g=h[G],g!=null)&&(G==="selected"?o.selected=g&&typeof g!="function"&&typeof g!="symbol":Ut(o,u,G,g,h,null));return;case"dialog":bt("beforetoggle",o),bt("toggle",o),bt("cancel",o),bt("close",o);break;case"iframe":case"object":bt("load",o);break;case"video":case"audio":for(g=0;g<yf.length;g++)bt(yf[g],o);break;case"image":bt("error",o),bt("load",o);break;case"details":bt("toggle",o);break;case"embed":case"source":case"link":bt("error",o),bt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in h)if(h.hasOwnProperty(se)&&(g=h[se],g!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ut(o,u,se,g,h,null)}return;default:if(lx(u)){for(me in h)h.hasOwnProperty(me)&&(g=h[me],g!==void 0&&Qb(o,u,me,g,h,void 0));return}}for(L in h)h.hasOwnProperty(L)&&(g=h[L],g!=null&&Ut(o,u,L,g,h,null))}function JH(o,u,h,g){switch(u){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,G=null,se=null,me=null;for(he in h){var xe=h[he];if(h.hasOwnProperty(he)&&xe!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":G=xe;default:g.hasOwnProperty(he)||Ut(o,u,he,null,g,xe)}}for(var ue in g){var he=g[ue];if(xe=h[ue],g.hasOwnProperty(ue)&&(he!=null||xe!=null))switch(ue){case"type":N=he;break;case"name":S=he;break;case"checked":se=he;break;case"defaultChecked":me=he;break;case"value":T=he;break;case"defaultValue":L=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,u));break;default:he!==xe&&Ut(o,u,ue,he,g,xe)}}Oc(o,T,L,G,se,me,N,S);return;case"select":he=T=L=ue=null;for(N in h)if(G=h[N],h.hasOwnProperty(N)&&G!=null)switch(N){case"value":break;case"multiple":he=G;default:g.hasOwnProperty(N)||Ut(o,u,N,null,g,G)}for(S in g)if(N=g[S],G=h[S],g.hasOwnProperty(S)&&(N!=null||G!=null))switch(S){case"value":ue=N;break;case"defaultValue":L=N;break;case"multiple":T=N;default:N!==G&&Ut(o,u,S,N,g,G)}u=L,h=T,g=he,ue!=null?_c(o,!!h,ue,!1):!!g!=!!h&&(u!=null?_c(o,!!h,u,!0):_c(o,!!h,h?[]:"",!1));return;case"textarea":he=ue=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:Ut(o,u,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":ue=S;break;case"defaultValue":he=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(r(91));break;default:S!==N&&Ut(o,u,T,S,g,N)}nE(o,ue,he);return;case"option":for(var Le in h)ue=h[Le],h.hasOwnProperty(Le)&&ue!=null&&!g.hasOwnProperty(Le)&&(Le==="selected"?o.selected=!1:Ut(o,u,Le,null,g,ue));for(G in g)ue=g[G],he=h[G],g.hasOwnProperty(G)&&ue!==he&&(ue!=null||he!=null)&&(G==="selected"?o.selected=ue&&typeof ue!="function"&&typeof ue!="symbol":Ut(o,u,G,ue,g,he));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var We in h)ue=h[We],h.hasOwnProperty(We)&&ue!=null&&!g.hasOwnProperty(We)&&Ut(o,u,We,null,g,ue);for(se in g)if(ue=g[se],he=h[se],g.hasOwnProperty(se)&&ue!==he&&(ue!=null||he!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,u));break;default:Ut(o,u,se,ue,g,he)}return;default:if(lx(u)){for(var qt in h)ue=h[qt],h.hasOwnProperty(qt)&&ue!==void 0&&!g.hasOwnProperty(qt)&&Qb(o,u,qt,void 0,g,ue);for(me in g)ue=g[me],he=h[me],!g.hasOwnProperty(me)||ue===he||ue===void 0&&he===void 0||Qb(o,u,me,ue,g,he);return}}for(var ee in h)ue=h[ee],h.hasOwnProperty(ee)&&ue!=null&&!g.hasOwnProperty(ee)&&Ut(o,u,ee,null,g,ue);for(xe in g)ue=g[xe],he=h[xe],!g.hasOwnProperty(xe)||ue===he||ue==null&&he==null||Ut(o,u,xe,ue,g,he)}function sz(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function eK(){if(typeof performance.getEntriesByType=="function"){for(var o=0,u=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&&sz(T)){for(T=0,L=S.responseEnd,g+=1;g<h.length;g++){var G=h[g],se=G.startTime;if(se>L)break;var me=G.transferSize,xe=G.initiatorType;me&&sz(xe)&&(G=G.responseEnd,T+=me*(G<L?1:(L-se)/(G-se)))}if(--g,u+=8*(N+T)/(S.duration/1e3),o++,10<o)break}}if(0<o)return u/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Wb=null,Yb=null;function bm(o){return o.nodeType===9?o:o.ownerDocument}function oz(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function lz(o,u){if(o===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&u==="foreignObject"?0:o}function Zb(o,u){return o==="textarea"||o==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var Xb=null;function tK(){var o=window.event;return o&&o.type==="popstate"?o===Xb?!1:(Xb=o,!0):(Xb=null,!1)}var cz=typeof setTimeout=="function"?setTimeout:void 0,nK=typeof clearTimeout=="function"?clearTimeout:void 0,uz=typeof Promise=="function"?Promise:void 0,rK=typeof queueMicrotask=="function"?queueMicrotask:typeof uz<"u"?function(o){return uz.resolve(null).then(o).catch(iK)}:cz;function iK(o){setTimeout(function(){throw o})}function oo(o){return o==="head"}function dz(o,u){var h=u,g=0;do{var S=h.nextSibling;if(o.removeChild(h),S&&S.nodeType===8)if(h=S.data,h==="/$"||h==="/&"){if(g===0){o.removeChild(S),lu(u);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")xf(o.ownerDocument.documentElement);else if(h==="head"){h=o.ownerDocument.head,xf(h);for(var N=h.firstChild;N;){var T=N.nextSibling,L=N.nodeName;N[Xo]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&N.rel.toLowerCase()==="stylesheet"||h.removeChild(N),N=T}}else h==="body"&&xf(o.ownerDocument.body);h=S}while(h);lu(u)}function fz(o,u){var h=o;o=0;do{var g=h.nextSibling;if(h.nodeType===1?u?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(u?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(o===0)break;o--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||o++;h=g}while(h)}function Jb(o){var u=o.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var h=u;switch(u=u.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Jb(h),Cc(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}o.removeChild(h)}}function aK(o,u,h,g){for(;o.nodeType===1;){var S=h;if(o.nodeName.toLowerCase()!==u.toLowerCase()){if(!g&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(g){if(!o[Xo])switch(u){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(N=o.getAttribute("rel"),N==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(N!==S.rel||o.getAttribute("href")!==(S.href==null||S.href===""?null:S.href)||o.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin)||o.getAttribute("title")!==(S.title==null?null:S.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(N=o.getAttribute("src"),(N!==(S.src==null?null:S.src)||o.getAttribute("type")!==(S.type==null?null:S.type)||o.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin))&&N&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(u==="input"&&o.type==="hidden"){var N=S.name==null?null:""+S.name;if(S.type==="hidden"&&o.getAttribute("name")===N)return o}else return o;if(o=Di(o.nextSibling),o===null)break}return null}function sK(o,u,h){if(u==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!h||(o=Di(o.nextSibling),o===null))return null;return o}function hz(o,u){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!u||(o=Di(o.nextSibling),o===null))return null;return o}function ew(o){return o.data==="$?"||o.data==="$~"}function tw(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function oK(o,u){var h=o.ownerDocument;if(o.data==="$~")o._reactRetry=u;else if(o.data!=="$?"||h.readyState!=="loading")u();else{var g=function(){u(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),o._reactRetry=g}}function Di(o){for(;o!=null;o=o.nextSibling){var u=o.nodeType;if(u===1||u===3)break;if(u===8){if(u=o.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return o}var nw=null;function pz(o){o=o.nextSibling;for(var u=0;o;){if(o.nodeType===8){var h=o.data;if(h==="/$"||h==="/&"){if(u===0)return Di(o.nextSibling);u--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||u++}o=o.nextSibling}return null}function mz(o){o=o.previousSibling;for(var u=0;o;){if(o.nodeType===8){var h=o.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(u===0)return o;u--}else h!=="/$"&&h!=="/&"||u++}o=o.previousSibling}return null}function gz(o,u,h){switch(u=bm(h),o){case"html":if(o=u.documentElement,!o)throw Error(r(452));return o;case"head":if(o=u.head,!o)throw Error(r(453));return o;case"body":if(o=u.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function xf(o){for(var u=o.attributes;u.length;)o.removeAttributeNode(u[0]);Cc(o)}var Ii=new Map,yz=new Set;function wm(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var gs=J.d;J.d={f:lK,r:cK,D:uK,C:dK,L:fK,m:hK,X:mK,S:pK,M:gK};function lK(){var o=gs.f(),u=fm();return o||u}function cK(o){var u=Ae(o);u!==null&&u.tag===5&&u.type==="form"?RO(u):gs.r(o)}var au=typeof document>"u"?null:document;function vz(o,u,h){var g=au;if(g&&typeof u=="string"&&u){var S=sr(u);S='link[rel="'+o+'"][href="'+S+'"]',typeof h=="string"&&(S+='[crossorigin="'+h+'"]'),yz.has(S)||(yz.add(S),o={rel:o,crossOrigin:h,href:u},g.querySelector(S)===null&&(u=g.createElement("link"),ur(u,"link",o),wt(u),g.head.appendChild(u)))}}function uK(o){gs.D(o),vz("dns-prefetch",o,null)}function dK(o,u){gs.C(o,u),vz("preconnect",o,u)}function fK(o,u,h){gs.L(o,u,h);var g=au;if(g&&o&&u){var S='link[rel="preload"][as="'+sr(u)+'"]';u==="image"&&h&&h.imageSrcSet?(S+='[imagesrcset="'+sr(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(S+='[imagesizes="'+sr(h.imageSizes)+'"]')):S+='[href="'+sr(o)+'"]';var N=S;switch(u){case"style":N=su(o);break;case"script":N=ou(o)}Ii.has(N)||(o=m({rel:"preload",href:u==="image"&&h&&h.imageSrcSet?void 0:o,as:u},h),Ii.set(N,o),g.querySelector(S)!==null||u==="style"&&g.querySelector(bf(N))||u==="script"&&g.querySelector(wf(N))||(u=g.createElement("link"),ur(u,"link",o),wt(u),g.head.appendChild(u)))}}function hK(o,u){gs.m(o,u);var h=au;if(h&&o){var g=u&&typeof u.as=="string"?u.as:"script",S='link[rel="modulepreload"][as="'+sr(g)+'"][href="'+sr(o)+'"]',N=S;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=ou(o)}if(!Ii.has(N)&&(o=m({rel:"modulepreload",href:o},u),Ii.set(N,o),h.querySelector(S)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(wf(N)))return}g=h.createElement("link"),ur(g,"link",o),wt(g),h.head.appendChild(g)}}}function pK(o,u,h){gs.S(o,u,h);var g=au;if(g&&o){var S=kt(g).hoistableStyles,N=su(o);u=u||"default";var T=S.get(N);if(!T){var L={loading:0,preload:null};if(T=g.querySelector(bf(N)))L.loading=5;else{o=m({rel:"stylesheet",href:o,"data-precedence":u},h),(h=Ii.get(N))&&rw(o,h);var G=T=g.createElement("link");wt(G),ur(G,"link",o),G._p=new Promise(function(se,me){G.onload=se,G.onerror=me}),G.addEventListener("load",function(){L.loading|=1}),G.addEventListener("error",function(){L.loading|=2}),L.loading|=4,Sm(T,u,g)}T={type:"stylesheet",instance:T,count:1,state:L},S.set(N,T)}}}function mK(o,u){gs.X(o,u);var h=au;if(h&&o){var g=kt(h).hoistableScripts,S=ou(o),N=g.get(S);N||(N=h.querySelector(wf(S)),N||(o=m({src:o,async:!0},u),(u=Ii.get(S))&&iw(o,u),N=h.createElement("script"),wt(N),ur(N,"link",o),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(S,N))}}function gK(o,u){gs.M(o,u);var h=au;if(h&&o){var g=kt(h).hoistableScripts,S=ou(o),N=g.get(S);N||(N=h.querySelector(wf(S)),N||(o=m({src:o,async:!0,type:"module"},u),(u=Ii.get(S))&&iw(o,u),N=h.createElement("script"),wt(N),ur(N,"link",o),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(S,N))}}function xz(o,u,h,g){var S=(S=re.current)?wm(S):null;if(!S)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(u=su(h.href),h=kt(S).hoistableStyles,g=h.get(u),g||(g={type:"style",instance:null,count:0,state:null},h.set(u,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){o=su(h.href);var N=kt(S).hoistableStyles,T=N.get(o);if(T||(S=S.ownerDocument||S,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(o,T),(N=S.querySelector(bf(o)))&&!N._p&&(T.instance=N,T.state.loading=5),Ii.has(o)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},Ii.set(o,h),N||yK(S,o,h,T.state))),u&&g===null)throw Error(r(528,""));return T}if(u&&g!==null)throw Error(r(529,""));return null;case"script":return u=h.async,h=h.src,typeof h=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=ou(h),h=kt(S).hoistableScripts,g=h.get(u),g||(g={type:"script",instance:null,count:0,state:null},h.set(u,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function su(o){return'href="'+sr(o)+'"'}function bf(o){return'link[rel="stylesheet"]['+o+"]"}function bz(o){return m({},o,{"data-precedence":o.precedence,precedence:null})}function yK(o,u,h,g){o.querySelector('link[rel="preload"][as="style"]['+u+"]")?g.loading=1:(u=o.createElement("link"),g.preload=u,u.addEventListener("load",function(){return g.loading|=1}),u.addEventListener("error",function(){return g.loading|=2}),ur(u,"link",h),wt(u),o.head.appendChild(u))}function ou(o){return'[src="'+sr(o)+'"]'}function wf(o){return"script[async]"+o}function wz(o,u,h){if(u.count++,u.instance===null)switch(u.type){case"style":var g=o.querySelector('style[data-href~="'+sr(h.href)+'"]');if(g)return u.instance=g,wt(g),g;var S=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(o.ownerDocument||o).createElement("style"),wt(g),ur(g,"style",S),Sm(g,h.precedence,o),u.instance=g;case"stylesheet":S=su(h.href);var N=o.querySelector(bf(S));if(N)return u.state.loading|=4,u.instance=N,wt(N),N;g=bz(h),(S=Ii.get(S))&&rw(g,S),N=(o.ownerDocument||o).createElement("link"),wt(N);var T=N;return T._p=new Promise(function(L,G){T.onload=L,T.onerror=G}),ur(N,"link",g),u.state.loading|=4,Sm(N,h.precedence,o),u.instance=N;case"script":return N=ou(h.src),(S=o.querySelector(wf(N)))?(u.instance=S,wt(S),S):(g=h,(S=Ii.get(N))&&(g=m({},h),iw(g,S)),o=o.ownerDocument||o,S=o.createElement("script"),wt(S),ur(S,"link",g),o.head.appendChild(S),u.instance=S);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(g=u.instance,u.state.loading|=4,Sm(g,h.precedence,o));return u.instance}function Sm(o,u,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===u)N=L;else if(N!==S)break}N?N.parentNode.insertBefore(o,N.nextSibling):(u=h.nodeType===9?h.head:h,u.insertBefore(o,u.firstChild))}function rw(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.title==null&&(o.title=u.title)}function iw(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.integrity==null&&(o.integrity=u.integrity)}var jm=null;function Sz(o,u,h){if(jm===null){var g=new Map,S=jm=new Map;S.set(h,g)}else S=jm,g=S.get(h),g||(g=new Map,S.set(h,g));if(g.has(o))return g;for(g.set(o,null),h=h.getElementsByTagName(o),S=0;S<h.length;S++){var N=h[S];if(!(N[Xo]||N[Tn]||o==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var T=N.getAttribute(u)||"";T=o+T;var L=g.get(T);L?L.push(N):g.set(T,[N])}}return g}function jz(o,u,h){o=o.ownerDocument||o,o.head.insertBefore(h,u==="title"?o.querySelector("head > title"):null)}function vK(o,u,h){if(h===1||u.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;return u.rel==="stylesheet"?(o=u.disabled,typeof u.precedence=="string"&&o==null):!0;case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function Nz(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function xK(o,u,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=su(g.href),N=u.querySelector(bf(S));if(N){u=N._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(o.count++,o=Nm.bind(o),u.then(o,o)),h.state.loading|=4,h.instance=N,wt(N);return}N=u.ownerDocument||u,g=bz(g),(S=Ii.get(S))&&rw(g,S),N=N.createElement("link"),wt(N);var T=N;T._p=new Promise(function(L,G){T.onload=L,T.onerror=G}),ur(N,"link",g),h.instance=N}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(h,u),(u=h.state.preload)&&(h.state.loading&3)===0&&(o.count++,h=Nm.bind(o),u.addEventListener("load",h),u.addEventListener("error",h))}}var aw=0;function bK(o,u){return o.stylesheets&&o.count===0&&Cm(o,o.stylesheets),0<o.count||0<o.imgCount?function(h){var g=setTimeout(function(){if(o.stylesheets&&Cm(o,o.stylesheets),o.unsuspend){var N=o.unsuspend;o.unsuspend=null,N()}},6e4+u);0<o.imgBytes&&aw===0&&(aw=62500*eK());var S=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Cm(o,o.stylesheets),o.unsuspend)){var N=o.unsuspend;o.unsuspend=null,N()}},(o.imgBytes>aw?50:800)+u);return o.unsuspend=h,function(){o.unsuspend=null,clearTimeout(g),clearTimeout(S)}}:null}function Nm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cm(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var km=null;function Cm(o,u){o.stylesheets=null,o.unsuspend!==null&&(o.count++,km=new Map,u.forEach(wK,o),km=null,Nm.call(o))}function wK(o,u){if(!(u.state.loading&4)){var h=km.get(o);if(h)var g=h.get(null);else{h=new Map,km.set(o,h);for(var S=o.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=u.instance,T=S.getAttribute("data-precedence"),N=h.get(T)||g,N===g&&h.set(null,S),h.set(T,S),this.count++,g=Nm.bind(this),S.addEventListener("load",g),S.addEventListener("error",g),N?N.parentNode.insertBefore(S,N.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(S,o.firstChild)),u.state.loading|=4}}var Sf={$$typeof:O,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function SK(o,u,h,g,S,N,T,L,G){this.tag=1,this.containerInfo=o,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=Za(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Za(0),this.hiddenUpdates=Za(null),this.identifierPrefix=g,this.onUncaughtError=S,this.onCaughtError=N,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function kz(o,u,h,g,S,N,T,L,G,se,me,xe){return o=new SK(o,u,h,T,G,se,me,xe,L),u=1,N===!0&&(u|=24),N=mi(3,null,null,u),o.current=N,N.stateNode=o,u=Lx(),u.refCount++,o.pooledCache=u,u.refCount++,N.memoizedState={element:g,isDehydrated:h,cache:u},qx(N),o}function Cz(o){return o?(o=Lc,o):Lc}function Az(o,u,h,g,S,N){S=Cz(S),g.context===null?g.context=S:g.pendingContext=S,g=Ys(u),g.payload={element:h},N=N===void 0?null:N,N!==null&&(g.callback=N),h=Zs(o,g,u),h!==null&&(ni(h,o,u),Jd(h,o,u))}function Ez(o,u){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var h=o.retryLane;o.retryLane=h!==0&&h<u?h:u}}function sw(o,u){Ez(o,u),(o=o.alternate)&&Ez(o,u)}function Oz(o){if(o.tag===13||o.tag===31){var u=rl(o,67108864);u!==null&&ni(u,o,67108864),sw(o,67108864)}}function _z(o){if(o.tag===13||o.tag===31){var u=bi();u=qs(u);var h=rl(o,u);h!==null&&ni(h,o,u),sw(o,u)}}var Am=!0;function jK(o,u,h,g){var S=H.T;H.T=null;var N=J.p;try{J.p=2,ow(o,u,h,g)}finally{J.p=N,H.T=S}}function NK(o,u,h,g){var S=H.T;H.T=null;var N=J.p;try{J.p=8,ow(o,u,h,g)}finally{J.p=N,H.T=S}}function ow(o,u,h,g){if(Am){var S=lw(g);if(S===null)Vb(o,u,g,Em,h),Tz(o,g);else if(CK(S,o,u,h,g))g.stopPropagation();else if(Tz(o,g),u&4&&-1<kK.indexOf(o)){for(;S!==null;){var N=Ae(S);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var T=je(N.pendingLanes);if(T!==0){var L=N;for(L.pendingLanes|=2,L.entangledLanes|=2;T;){var G=1<<31-pt(T);L.entanglements[1]|=G,T&=~G}Aa(N),(Tt&6)===0&&(um=Ye()+500,gf(0))}}break;case 31:case 13:L=rl(N,2),L!==null&&ni(L,N,2),fm(),sw(N,2)}if(N=lw(g),N===null&&Vb(o,u,g,Em,h),N===S)break;S=N}S!==null&&g.stopPropagation()}else Vb(o,u,g,null,h)}}function lw(o){return o=ux(o),cw(o)}var Em=null;function cw(o){if(Em=null,o=W(o),o!==null){var u=a(o);if(u===null)o=null;else{var h=u.tag;if(h===13){if(o=l(u),o!==null)return o;o=null}else if(h===31){if(o=c(u),o!==null)return o;o=null}else if(h===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;o=null}else u!==o&&(o=null)}}return Em=o,null}function zz(o){switch(o){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(rt()){case ae:return 2;case Se:return 8;case $e:case Ze:return 32;case Xe:return 268435456;default:return 32}default:return 32}}var uw=!1,lo=null,co=null,uo=null,jf=new Map,Nf=new Map,fo=[],kK="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 Tz(o,u){switch(o){case"focusin":case"focusout":lo=null;break;case"dragenter":case"dragleave":co=null;break;case"mouseover":case"mouseout":uo=null;break;case"pointerover":case"pointerout":jf.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nf.delete(u.pointerId)}}function kf(o,u,h,g,S,N){return o===null||o.nativeEvent!==N?(o={blockedOn:u,domEventName:h,eventSystemFlags:g,nativeEvent:N,targetContainers:[S]},u!==null&&(u=Ae(u),u!==null&&Oz(u)),o):(o.eventSystemFlags|=g,u=o.targetContainers,S!==null&&u.indexOf(S)===-1&&u.push(S),o)}function CK(o,u,h,g,S){switch(u){case"focusin":return lo=kf(lo,o,u,h,g,S),!0;case"dragenter":return co=kf(co,o,u,h,g,S),!0;case"mouseover":return uo=kf(uo,o,u,h,g,S),!0;case"pointerover":var N=S.pointerId;return jf.set(N,kf(jf.get(N)||null,o,u,h,g,S)),!0;case"gotpointercapture":return N=S.pointerId,Nf.set(N,kf(Nf.get(N)||null,o,u,h,g,S)),!0}return!1}function Pz(o){var u=W(o.target);if(u!==null){var h=a(u);if(h!==null){if(u=h.tag,u===13){if(u=l(h),u!==null){o.blockedOn=u,Sp(o.priority,function(){_z(h)});return}}else if(u===31){if(u=c(h),u!==null){o.blockedOn=u,Sp(o.priority,function(){_z(h)});return}}else if(u===3&&h.stateNode.current.memoizedState.isDehydrated){o.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Om(o){if(o.blockedOn!==null)return!1;for(var u=o.targetContainers;0<u.length;){var h=lw(o.nativeEvent);if(h===null){h=o.nativeEvent;var g=new h.constructor(h.type,h);cx=g,h.target.dispatchEvent(g),cx=null}else return u=Ae(h),u!==null&&Oz(u),o.blockedOn=h,!1;u.shift()}return!0}function Rz(o,u,h){Om(o)&&h.delete(u)}function AK(){uw=!1,lo!==null&&Om(lo)&&(lo=null),co!==null&&Om(co)&&(co=null),uo!==null&&Om(uo)&&(uo=null),jf.forEach(Rz),Nf.forEach(Rz)}function _m(o,u){o.blockedOn===u&&(o.blockedOn=null,uw||(uw=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,AK)))}var zm=null;function Dz(o){zm!==o&&(zm=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){zm===o&&(zm=null);for(var u=0;u<o.length;u+=3){var h=o[u],g=o[u+1],S=o[u+2];if(typeof g!="function"){if(cw(g||h)===null)continue;break}var N=Ae(h);N!==null&&(o.splice(u,3),u-=3,lb(N,{pending:!0,data:S,method:h.method,action:g},g,S))}}))}function lu(o){function u(G){return _m(G,o)}lo!==null&&_m(lo,o),co!==null&&_m(co,o),uo!==null&&_m(uo,o),jf.forEach(u),Nf.forEach(u);for(var h=0;h<fo.length;h++){var g=fo[h];g.blockedOn===o&&(g.blockedOn=null)}for(;0<fo.length&&(h=fo[0],h.blockedOn===null);)Pz(h),h.blockedOn===null&&fo.shift();if(h=(o.ownerDocument||o).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var S=h[g],N=h[g+1],T=S[jr]||null;if(typeof N=="function")T||Dz(h);else if(T){var L=null;if(N&&N.hasAttribute("formAction")){if(S=N,T=N[jr]||null)L=T.formAction;else if(cw(S)!==null)continue}else L=T.action;typeof L=="function"?h[g+1]=L:(h.splice(g,3),g-=3),Dz(h)}}}function Iz(){function o(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(T){return S=T})},focusReset:"manual",scroll:"manual"})}function u(){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",o),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),S!==null&&(S(),S=null)}}}function dw(o){this._internalRoot=o}Tm.prototype.render=dw.prototype.render=function(o){var u=this._internalRoot;if(u===null)throw Error(r(409));var h=u.current,g=bi();Az(h,g,o,u,null,null)},Tm.prototype.unmount=dw.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var u=o.containerInfo;Az(o.current,2,null,o,null,null),fm(),u[Xa]=null}};function Tm(o){this._internalRoot=o}Tm.prototype.unstable_scheduleHydration=function(o){if(o){var u=Md();o={blockedOn:null,target:o,priority:u};for(var h=0;h<fo.length&&u!==0&&u<fo[h].priority;h++);fo.splice(h,0,o),h===0&&Pz(o)}};var Mz=t.version;if(Mz!=="19.2.4")throw Error(r(527,Mz,"19.2.4"));J.findDOMNode=function(o){var u=o._reactInternals;if(u===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=f(u),o=o!==null?p(o):null,o=o===null?null:o.stateNode,o};var EK={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pm.isDisabled&&Pm.supportsFiber)try{jn=Pm.inject(EK),Kt=Pm}catch{}}return Af.createRoot=function(o,u){if(!i(o))throw Error(r(299));var h=!1,g="",S=HO,N=KO,T=GO;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(g=u.identifierPrefix),u.onUncaughtError!==void 0&&(S=u.onUncaughtError),u.onCaughtError!==void 0&&(N=u.onCaughtError),u.onRecoverableError!==void 0&&(T=u.onRecoverableError)),u=kz(o,1,!1,null,null,h,g,null,S,N,T,Iz),o[Xa]=u.current,Gb(o),new dw(u)},Af.hydrateRoot=function(o,u,h){if(!i(o))throw Error(r(299));var g=!1,S="",N=HO,T=KO,L=GO,G=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&&(G=h.formState)),u=kz(o,1,!0,u,h??null,g,S,G,N,T,L,Iz),u.context=Cz(null),h=u.current,g=bi(),g=qs(g),S=Ys(g),S.callback=null,Zs(h,S,g),h=g,u.current.lanes=h,Gt(u,h),Aa(u),o[Xa]=u.current,Gb(o),new Tm(u)},Af.version="19.2.4",Af}var Vz;function LK(){if(Vz)return pw.exports;Vz=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(),pw.exports=MK(),pw.exports}var $K=LK(),uc=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(){}},BK={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},UK=class{#t=BK;#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)}},El=new UK;function qK(e){setTimeout(e,0)}var Gl=typeof window>"u"||"Deno"in globalThis;function Er(){}function FK(e,t){return typeof e=="function"?e(t):e}function Vj(e){return typeof e=="number"&&e>=0&&e!==1/0}function s5(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zo(e,t){return typeof e=="function"?e(t):e}function Ui(e,t){return typeof e=="function"?e(t):e}function Qz(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==qN(l,t.options))return!1}else if(!gh(t.queryKey,l))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||a&&!a(t))}function Wz(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Vl(t.options.mutationKey)!==Vl(a))return!1}else if(!gh(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function qN(e,t){return(t?.queryKeyHashFn||Vl)(e)}function Vl(e){return JSON.stringify(e,(t,n)=>Qj(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function gh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>gh(e[n],t[n])):!1}var HK=Object.prototype.hasOwnProperty;function FN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Yz(e)&&Yz(t);if(!r&&!(Qj(e)&&Qj(t)))return t;const a=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,d=r?new Array(c):{};let f=0;for(let p=0;p<c;p++){const m=r?p:l[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=FN(y,v,n+1);d[m]=w,w===y&&f++}return a===c&&f===a?e:d}function yh(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Yz(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qj(e){if(!Zz(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Zz(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Zz(e){return Object.prototype.toString.call(e)==="[object Object]"}function KK(e){return new Promise(t=>{El.setTimeout(t,e)})}function Wj(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?FN(e,t):t}function GK(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function VK(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var HN=Symbol();function o5(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===HN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function KN(e,t){return typeof e=="function"?e(...t):!!e}function QK(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 WK=class extends uc{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Gl&&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"}},GN=new WK;function Yj(){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 YK=qK;function ZK(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=YK;const a=c=>{t?e.push(c):i(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||l()}return d},batchCalls:c=>(...d)=>{a(()=>{c(...d)})},schedule:a,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var Sn=ZK(),XK=class extends uc{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Gl&&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}},Qg=new XK;function JK(e){return Math.min(1e3*2**e,3e4)}function l5(e){return(e??"online")==="online"?Qg.isOnline():!0}var Zj=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c5(e){let t=!1,n=0,r;const i=Yj(),a=()=>i.status!=="pending",l=b=>{if(!a()){const j=new Zj(b);y(j),e.onCancel?.(j)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>GN.isFocused()&&(e.networkMode==="always"||Qg.isOnline())&&e.canRun(),p=()=>l5(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??(Gl?0:3),O=e.retryDelay??JK,C=typeof O=="function"?O(n,k):O,z=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,k);if(t||!z){y(k);return}n++,e.onFail?.(n,k),KK(C).then(()=>f()?void 0:v()).then(()=>{t?y(k):w()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:d,canStart:p,start:()=>(p()?w():v().then(w),i)}}var u5=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vj(this.gcTime)&&(this.#t=El.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Gl?1/0:300*1e3))}clearGcTimeout(){this.#t&&(El.clearTimeout(this.#t),this.#t=void 0)}},e7=class extends u5{#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=Jz(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=Jz(this.options);t.data!==void 0&&(this.setState(Xz(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Wj(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(Er).catch(Er):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Ui(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===HN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>zo(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:!s5(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const c=o5(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(c,f,this):c(f)},l=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(c),c})();this.options.behavior?.onFetch(l,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#s({type:"fetch",meta:l.fetchOptions?.meta}),this.#r=c5({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:c=>{c instanceof Zj&&c.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(c,d)=>{this.#s({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof Zj){if(c.silent)return this.#r.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#s({type:"error",error:c}),this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...d5(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Xz(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),Sn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function d5(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:l5(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Xz(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Jz(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 VN=class extends uc{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=Yj(),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),e2(this.#e,this.options)?this.#m():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Xj(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Xj(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 Ui(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#e.setOptions(this.options),t._defaulted&&!yh(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&t2(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||Ui(this.options.enabled,this.#e)!==Ui(t.enabled,this.#e)||zo(this.options.staleTime,this.#e)!==zo(t.staleTime,this.#e))&&this.#g();const i=this.#y();r&&(this.#e!==n||Ui(this.options.enabled,this.#e)!==Ui(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 n7(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(Er)),t}#g(){this.#b();const e=zo(this.options.staleTime,this.#e);if(Gl||this.#i.isStale||!Vj(e))return;const n=s5(this.#i.dataUpdatedAt,e)+1;this.#c=El.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,!(Gl||Ui(this.options.enabled,this.#e)===!1||!Vj(this.#l)||this.#l===0)&&(this.#u=El.setInterval(()=>{(this.options.refetchIntervalInBackground||GN.isFocused())&&this.#m()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(El.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(El.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,i=this.#i,a=this.#r,l=this.#a,d=e!==n?e.state:this.#n,{state:f}=e;let p={...f},m=!1,y;if(t._optimisticResults){const R=this.hasListeners(),$=!R&&e2(e,t),F=R&&t2(e,n,t,r);($||F)&&(p={...p,...d5(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===l?.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=Wj(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=Wj(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",O=b==="error",C=E&&k,z=y!==void 0,_={status:b,fetchStatus:p.fetchStatus,isPending:E,isSuccess:b==="success",isError:O,isInitialLoading:C,isLoading:C,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:O&&!z,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:O&&z,isStale:QN(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Ui(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const R=_.data!==void 0,$=_.status==="error"&&!R,F=K=>{$?K.reject(_.error):R&&K.resolve(_.data)},q=()=>{const K=this.#o=_.promise=Yj();F(K)},B=this.#o;switch(B.status){case"pending":e.queryHash===n.queryHash&&F(B);break;case"fulfilled":($||_.data!==B.value)&&q();break;case"rejected":(!$||_.error!==B.reason)&&q();break}}return _}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#a=this.options,this.#r.data!==void 0&&(this.#f=this.#e),yh(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#h.size)return!0;const a=new Set(i??this.#h);return this.options.throwOnError&&a.add("error"),Object.keys(this.#i).some(l=>{const c=l;return this.#i[c]!==e[c]&&a.has(c)})};this.#j({listeners:n()})}#S(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#j(e){Sn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function t7(e,t){return Ui(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function e2(e,t){return t7(e,t)||e.state.data!==void 0&&Xj(e,t,t.refetchOnMount)}function Xj(e,t,n){if(Ui(t.enabled,e)!==!1&&zo(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&QN(e,t)}return!1}function t2(e,t,n,r){return(e!==t||Ui(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&QN(e,n)}function QN(e,t){return Ui(t.enabled,e)!==!1&&e.isStaleByTime(zo(t.staleTime,e))}function n7(e,t){return!yh(e.getCurrentResult(),t)}function n2(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let p=!1;const m=w=>{QK(w,()=>t.signal,()=>p=!0)},y=o5(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})(),O=await y(E),{maxPages:C}=t.options,z=j?VK:GK;return{pages:z(w.pages,O,C),pageParams:z(w.pageParams,b,C)}};if(i&&a.length){const w=i==="backward",b=w?r7:r2,j={pages:a,pageParams:l},k=b(r,j);c=await v(j,k,w)}else{const w=e??a.length;do{const b=d===0?l[0]??r.initialPageParam:r2(r,c);if(d>0&&b==null)break;c=await v(c,b),d++}while(d<w)}return c};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 r2(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 r7(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var i7=class extends u5{#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||f5(),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=c5({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,l)=>{this.#r({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const l=await this.options.onMutate?.(e,n);l!==this.state.context&&this.#r({type:"pending",context:l,variables:e,isPaused:i})}const a=await this.#i.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(l){Promise.reject(l)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(l){Promise.reject(l)}throw this.#r({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Sn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function f5(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var h5=class extends uc{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 i7({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=Rm(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=Rm(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=Rm(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=Rm(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Sn.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=>Wz(t,n))}findAll(e={}){return this.getAll().filter(t=>Wz(e,t))}notify(e){Sn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Sn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Er))))}};function Rm(e){return e.options.scope?.id}var a7=class extends uc{#t;#e=void 0;#n;#i;constructor(t,n){super(),this.#t=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#t.defaultMutationOptions(t),yh(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Vl(n.mutationKey)!==Vl(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??f5();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){Sn.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 i2(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function s7(e,t,n){const r=e.slice(0);return r[t]=n,r}var o7=class extends uc{#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,Sn.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const i=r.map(p=>p.observer),a=i.map(p=>p.getCurrentResult()),l=n.length!==i.length,c=i.some((p,m)=>p!==n[m]),d=l||c,f=d?!0:a.some((p,m)=>{const y=this.#e[m];return!y||!yh(p,y)});!d&&!f||(d&&(this.#d=r,this.#r=i),this.#e=a,this.hasListeners()&&(d&&(i2(n,i).forEach(p=>{p.destroy()}),i2(i,n).forEach(p=>{p.subscribe(m=>{this.#l(p,m)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,t){const n=this.#u(e),r=n.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=n.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#c(a??r,t,i),()=>this.#f(r,n)]}#f(e,t){return t.map((n,r)=>{const i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,a=>{t.forEach(l=>{l.observer.trackProp(a)})})})}#c(e,t,n){if(t){const r=this.#p,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((a,l)=>a!==r[l]));return(!this.#a||this.#e!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#e,n!==void 0&&(this.#p=n),this.#a=FN(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#r.forEach(r=>{const i=r.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(r):t.set(i,[r])});const n=[];return e.forEach(r=>{const i=this.#t.defaultQueryOptions(r),l=t.get(i.queryHash)?.shift()??new VN(this.#t,i);n.push({defaultedQueryOptions:i,observer:l})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=s7(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&&Sn.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},l7=class extends uc{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??qN(r,t);let a=this.get(i);return a||(a=new e7({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(){Sn.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=>Qz(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Qz(e,n)):t}notify(e){Sn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Sn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Sn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},c7=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new l7,this.#e=e.mutationCache||new h5,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=GN.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=Qg.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(zo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=this.#t.get(r.queryHash)?.state.data,l=FK(t,a);if(l!==void 0)return this.#t.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Sn.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;Sn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return Sn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Sn.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Er).catch(Er)}invalidateQueries(e,t={}){return Sn.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=Sn.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(Er)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Er)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(zo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Er).catch(Er)}fetchInfiniteQuery(e){return e.behavior=n2(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Er).catch(Er)}ensureInfiniteQueryData(e){return e.behavior=n2(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Qg.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(Vl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{gh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Vl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{gh(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=qN(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===HN&&(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()}},p5=x.createContext(void 0),vr=e=>{const t=x.useContext(p5);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},u7=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(p5.Provider,{value:e,children:t})),m5=x.createContext(!1),g5=()=>x.useContext(m5);m5.Provider;function d7(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var f7=x.createContext(d7()),y5=()=>x.useContext(f7),v5=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?KN(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},x5=e=>{x.useEffect(()=>{e.clearReset()},[e])},b5=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||KN(n,[e.error,r])),w5=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))}},h7=(e,t)=>e.isLoading&&e.isFetching&&!t,Jj=(e,t)=>e?.suspense&&t.isPending,e1=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function S5({queries:e,...t},n){const r=vr(),i=g5(),a=y5(),l=x.useMemo(()=>e.map(b=>{const j=r.defaultQueryOptions(b);return j._optimisticResults=i?"isRestoring":"optimistic",j}),[e,r,i]);l.forEach(b=>{w5(b);const j=r.getQueryCache().get(b.queryHash);v5(b,a,j)}),x5(a);const[c]=x.useState(()=>new o7(r,l,t)),[d,f,p]=c.getOptimisticResult(l,t.combine),m=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(b=>m?c.subscribe(Sn.batchCalls(b)):Er,[c,m]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),x.useEffect(()=>{c.setQueries(l,t)},[l,t,c]);const v=d.some((b,j)=>Jj(l[j],b))?d.flatMap((b,j)=>{const k=l[j];if(k&&Jj(k,b)){const E=new VN(r,k);return e1(k,E,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const w=d.find((b,j)=>{const k=l[j];return k&&b5({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 p7(e,t,n){const r=g5(),i=y5(),a=vr(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const c=a.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",w5(l),v5(l,i,c),x5(i);const d=!a.getQueryCache().get(l.queryHash),[f]=x.useState(()=>new t(a,l)),p=f.getOptimisticResult(l),m=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(y=>{const v=m?f.subscribe(Sn.batchCalls(y)):Er;return f.updateResult(),v},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setOptions(l)},[l,f]),Jj(l,p))throw e1(l,f,i);if(b5({result:p,errorResetBoundary:i,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(l,p),l.experimental_prefetchInRender&&!Gl&&h7(p,r)&&(d?e1(l,f,i):c?.promise)?.catch(Er).finally(()=>{f.updateResult()}),l.notifyOnChangeProps?p:f.trackResult(p)}function Vn(e,t){return p7(e,VN)}function Ba(e,t){const n=vr(),[r]=x.useState(()=>new a7(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(l=>r.subscribe(Sn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((l,c)=>{r.mutate(l,c).catch(Er)},[r]);if(i.error&&KN(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Dm=typeof window<"u"?x.useLayoutEffect:x.useEffect;function vw(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 m7(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 g7(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}var y7=!1;function vh(e){return e[e.length-1]}function v7(e){return typeof e=="function"}function Co(e,t){return v7(e)?e(t):e}var x7=Object.prototype.hasOwnProperty,a2=Object.prototype.propertyIsEnumerable,b7=()=>Object.create(null),gl=(e,t)=>Ol(e,t,b7);function Ol(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=l2(e)&&l2(i);if(!a&&!(Wg(e)&&Wg(i)))return i;const l=a?e:s2(e);if(!l)return i;const c=a?i:s2(i);if(!c)return i;const d=l.length,f=c.length,p=a?new Array(f):n();let m=0;for(let y=0;y<f;y++){const v=a?y:c[y],w=e[v],b=i[v];if(w===b){p[v]=w,(a?y<d:x7.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 s2(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!a2.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(!a2.call(e,i))return!1;r.push(i)}return r}function Wg(e){if(!o2(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!o2(n)||!n.hasOwnProperty("isPrototypeOf"))}function o2(e){return Object.prototype.toString.call(e)==="[object Object]"}function l2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ll(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(!Ll(e[r],t[r],n))return!1;return!0}if(Wg(e)&&Wg(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!Ll(e[l],t[l],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let a=0;for(const l in t)if((!r||t[l]!==void 0)&&(a++,a>i||!Ll(e[l],t[l],n)))return!1;return i===a}return!1}function Ju(e){let t,n;const r=new Promise((i,a)=>{t=i,n=a});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function xh(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function w7(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function c2(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 w7(t)}var S7=["http:","https:","mailto:","tel:"];function Yg(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Ef(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+=c2(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+c2(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function j7(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Zg(e){const t=new Map;let n,r;const i=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,n=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const l=t.get(a);if(l)return i(l),l.value},set(a,l){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const c=t.get(a);if(c)c.value=l,i(c);else{const d={key:a,value:l,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,r=void 0}}}var N7="Invariant failed";function Es(e,t){if(!e)throw new Error(N7)}var _l=4,j5=5;function k7(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 WN(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 c=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=c,n[4]=c,n[5]=c,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=k7(a);if(l){const[c,d]=l,f=a.charCodeAt(c+1);if(f===45){if(c+2<a.length&&a.charCodeAt(c+2)===36){const p=c+3,m=d;if(p<m)return n[0]=3,n[1]=t+c,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=i,n}}else if(f===36){const p=c+1,m=c+2;return m===d?(n[0]=2,n[1]=t+c,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=e.length,n):(n[0]=1,n[1]=t+c,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 Sv(e,t,n,r,i,a,l){l?.(n);let c=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(;c<f;){const v=WN(d,c,t);let w;const b=c,j=v[5];switch(c=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 O=zl(n.fullPath??n.from);O.parent=i,O.depth=a,w=O,i.static.set(k,O)}}else{const E=k.toLowerCase(),O=i.staticInsensitive?.get(E);if(O)w=O;else{i.staticInsensitive??=new Map;const C=zl(n.fullPath??n.from);C.parent=i,C.depth=a,w=C,i.staticInsensitive.set(E,C)}}break}case 1:{const k=d.substring(b,v[1]),E=d.substring(v[4],j),O=p&&!!(k||E),C=k?O?k:k.toLowerCase():void 0,z=E?O?E:E.toLowerCase():void 0,A=!m&&i.dynamic?.find(_=>!_.skipOnParamError&&_.caseSensitive===O&&_.prefix===C&&_.suffix===z);if(A)w=A;else{const _=bw(1,n.fullPath??n.from,O,C,z);w=_,_.depth=a,_.parent=i,i.dynamic??=[],i.dynamic.push(_)}break}case 3:{const k=d.substring(b,v[1]),E=d.substring(v[4],j),O=p&&!!(k||E),C=k?O?k:k.toLowerCase():void 0,z=E?O?E:E.toLowerCase():void 0,A=!m&&i.optional?.find(_=>!_.skipOnParamError&&_.caseSensitive===O&&_.prefix===C&&_.suffix===z);if(A)w=A;else{const _=bw(3,n.fullPath??n.from,O,C,z);w=_,_.parent=i,_.depth=a,i.optional??=[],i.optional.push(_)}break}case 2:{const k=d.substring(b,v[1]),E=d.substring(v[4],j),O=p&&!!(k||E),C=k?O?k:k.toLowerCase():void 0,z=E?O?E:E.toLowerCase():void 0,A=bw(2,n.fullPath??n.from,O,C,z);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=zl(n.fullPath??n.from);v.kind=j5,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=zl(n.fullPath??n.from);v.kind=_l,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)Sv(e,t,d,c,i,a,l)}function xw(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 bo(e){if(e.pathless)for(const t of e.pathless)bo(t);if(e.static)for(const t of e.static.values())bo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())bo(t);if(e.dynamic?.length){e.dynamic.sort(xw);for(const t of e.dynamic)bo(t)}if(e.optional?.length){e.optional.sort(xw);for(const t of e.optional)bo(t)}if(e.wildcard?.length){e.wildcard.sort(xw);for(const t of e.wildcard)bo(t)}}function zl(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 bw(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 C7(e,t){const n=zl("/"),r=new Uint16Array(6);for(const i of e)Sv(!1,r,i,1,n,0);bo(n),t.masksTree=n,t.flatCache=Zg(1e3)}function A7(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=YN(e,t.masksTree);return t.flatCache.set(e,r),r}function E7(e,t,n,r,i){e||="/",r||="/";const a=t?`case\0${e}`:e;let l=i.singleCache.get(a);return l||(l=zl("/"),Sv(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(a,l)),YN(r,l,n)}function O7(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=YN(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=T7(a.route)),t.matchCache.set(r,a),a}function _7(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function z7(e,t=!1,n){const r=zl(e.fullPath),i=new Uint16Array(6),a={},l={};let c=0;return Sv(t,i,e,1,r,0,d=>{if(n?.(d,c),Es(!(d.id in a),`Duplicate routes found with id: ${String(d.id)}`),a[d.id]=d,c!==0&&d.path){const f=_7(d.fullPath);(!l[f]||d.fullPath.endsWith("/"))&&(l[f]=d)}c++}),bo(r),{processedTree:{segmentTree:r,singleCache:Zg(1e3),matchCache:Zg(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function YN(e,t,n=!1){const r=e.split("/"),i=R7(e,r,t,n);if(!i)return null;const[a]=N5(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function N5(e,t,n){const r=P7(n.node);let i=null;const a=Object.create(null);let l=n.extract?.part??0,c=n.extract?.node??0,d=n.extract?.path??0,f=n.extract?.segment??0;for(;c<r.length;l++,c++,d++,f++){const p=r[c];if(p.kind===_l)break;if(p.kind===j5){f--,l--,d--;continue}const m=t[l],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<<c){l--,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:l,node:c,path:d,segment:f}]}function T7(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function P7(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=!vh(t),a=i&&e!=="/",l=t.length-(i?1:0),c=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let d=null,f=null,p=null;for(;c.length;){const m=c.pop(),{node:y,index:v,skipped:w,depth:b,statics:j,dynamics:k,optionals:E}=m;let{extract:O,rawParams:C,parsedParams:z}=m;if(y.skipOnParamError){if(!ww(e,t,m))continue;C=m.rawParams,O=m.extract,z=m.parsedParams}r&&y.route&&y.kind!==_l&&Of(f,m)&&(f=m);const A=v===l;if(A&&(y.route&&!a&&Of(p,m)&&(p=m),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const _=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:O,rawParams:C,parsedParams:z};let F=!0;if(y.index.skipOnParamError&&(ww(e,t,$)||(F=!1)),F){if(j===l&&!k&&!E&&!w)return $;Of(p,$)&&(p=$)}}if(y.wildcard&&Of(d,m))for(const $ of y.wildcard){const{prefix:F,suffix:q}=$;if(F&&(A||!($.caseSensitive?_:R??=_.toLowerCase()).startsWith(F)))continue;if(q){if(A)continue;const K=t.slice(v).join("/").slice(-q.length);if(($.caseSensitive?K:K.toLowerCase())!==q)continue}const B={node:$,index:l,skipped:w,depth:b,statics:j,dynamics:k,optionals:E,extract:O,rawParams:C,parsedParams:z};if(!($.skipOnParamError&&!ww(e,t,B))){d=B;break}}if(y.optional){const $=w|1<<b,F=b+1;for(let q=y.optional.length-1;q>=0;q--){const B=y.optional[q];c.push({node:B,index:v,skipped:$,depth:F,statics:j,dynamics:k,optionals:E,extract:O,rawParams:C,parsedParams:z})}if(!A)for(let q=y.optional.length-1;q>=0;q--){const B=y.optional[q],{prefix:K,suffix:X}=B;if(K||X){const Q=B.caseSensitive?_:R??=_.toLowerCase();if(K&&!Q.startsWith(K)||X&&!Q.endsWith(X))continue}c.push({node:B,index:v+1,skipped:w,depth:F,statics:j,dynamics:k,optionals:E+1,extract:O,rawParams:C,parsedParams:z})}}if(!A&&y.dynamic&&_)for(let $=y.dynamic.length-1;$>=0;$--){const F=y.dynamic[$],{prefix:q,suffix:B}=F;if(q||B){const K=F.caseSensitive?_:R??=_.toLowerCase();if(q&&!K.startsWith(q)||B&&!K.endsWith(B))continue}c.push({node:F,index:v+1,skipped:w,depth:b+1,statics:j,dynamics:k+1,optionals:E,extract:O,rawParams:C,parsedParams:z})}if(!A&&y.staticInsensitive){const $=y.staticInsensitive.get(R??=_.toLowerCase());$&&c.push({node:$,index:v+1,skipped:w,depth:b+1,statics:j+1,dynamics:k,optionals:E,extract:O,rawParams:C,parsedParams:z})}if(!A&&y.static){const $=y.static.get(_);$&&c.push({node:$,index:v+1,skipped:w,depth:b+1,statics:j+1,dynamics:k,optionals:E,extract:O,rawParams:C,parsedParams:z})}if(y.pathless){const $=b+1;for(let F=y.pathless.length-1;F>=0;F--){const q=y.pathless[F];c.push({node:q,index:v,skipped:w,depth:$,statics:j,dynamics:k,optionals:E,extract:O,rawParams:C,parsedParams:z})}}}if(p&&d)return Of(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 ww(e,t,n){try{const[r,i]=N5(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 Of(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===_l)>(e.node.kind===_l)||t.node.kind===_l==(e.node.kind===_l)&&t.depth>e.depth))):!0}function _g(e){return ZN(e.filter(t=>t!==void 0).join("/"))}function ZN(e){return e.replace(/\/{2,}/g,"/")}function k5(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function To(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function C5(e){return To(k5(e))}function Xg(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function D7(e,t,n){return Xg(e,n)===Xg(t,n)}function I7({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),a=!i&&t===".";let l;if(r){l=i?t:a?e:e+"\0"+t;const m=r.get(l);if(m)return m}let c;if(a)c=e.split("/");else if(i)c=t.split("/");else{for(c=e.split("/");c.length>1&&vh(c)==="";)c.pop();const m=t.split("/");for(let y=0,v=m.length;y<v;y++){const w=m[y];w===""?y?y===v-1&&c.push(w):c=[w]:w===".."?c.pop():w==="."||c.push(w)}}c.length>1&&(vh(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));let d,f="";for(let m=0;m<c.length;m++){m>0&&(f+="/");const y=c[m];if(!y)continue;d=WN(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=ZN(f);const p=f||"/";return l&&r&&r.set(l,p),p}function M7(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 Sw(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=>d2(i,n)).join("/"):d2(r,n)}function u2({path:e,params:t,decoder:n,...r}){let i=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:i};const l=e.length;let c=0,d,f="";for(;c<l;){const p=c;d=WN(e,p,d);const m=d[5];if(c=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=Sw("_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=Sw(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=Sw(v,t,n)??"";f+="/"+b+k+j;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:i}}function d2(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function Fr(e){return!!e?.isNotFound}function L7(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var t1="tsr-scroll-restoration-v1_3",$7=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function B7(){const e=L7();if(!e)return null;const t=e.getItem(t1);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=Co(r,n)||n;try{e.setItem(t1,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Im=B7(),U7=e=>e.state.__TSR_key||e.href;function q7(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 Jg=!1;function F7({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const c=t||window.history.state?.__TSR_key,d=l[c];Jg=!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)}}Jg=!1}function H7(e,t){if(!Im||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Im))return;e.isScrollRestorationSetup=!0,Jg=!1;const n=e.options.getScrollRestorationKey||U7;window.history.scrollRestoration="manual";const r=i=>{if(Jg||!e.isScrollRestoring)return;let a="";if(i.target===document||i.target===window)a="window";else{const c=i.target.getAttribute("data-scroll-restoration-id");c?a=`[data-scroll-restoration-id="${c}"]`:a=q7(i.target)}const l=n(e.state.location);Im.set(c=>{const d=c[l]||={},f=d[a]||={};if(a==="window")f.scrollX=window.scrollX||0,f.scrollY=window.scrollY||0;else if(a){const p=document.querySelector(a);p&&(f.scrollX=p.scrollLeft||0,f.scrollY=p.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",$7(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:t1,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Im.set(l=>(l[a]||={},l)))})}function K7(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 G7(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 jw(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function V7(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]=jw(i):Array.isArray(a)?a.push(jw(i)):n[r]=[a,jw(i)]}return n}var Q7=Y7(JSON.parse),W7=Z7(JSON.stringify,JSON.parse);function Y7(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=V7(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function Z7(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=G7(i,r);return a?`?${a}`:""}}var $l="__root__";function XN(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 ii(e){return e instanceof Response&&!!e.options}function X7(e){return{input:({url:t})=>{for(const n of e)t=n1(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=A5(e[n],t);return t}}}function J7(e){const t=C5(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const c=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return c===i?l.pathname="/":c.startsWith(a)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=_g(["/",t,l.pathname]),l)}}function n1(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 A5(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 E5({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:l,shallowPropagate:c};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 l(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&&c(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&&c(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 c(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 JN=0,yl=0,ah=0;const xs=[],{link:Uze,unlink:O5,propagate:qze,checkDirty:eG,shallowPropagate:Fze}=E5({update(e){return e.depsTail!==void 0?iG(e):aG(e)},notify(e){let t=ah,n=t;do if(xs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(ah=t;n<--t;){const r=xs[n];xs[n++]=xs[t],xs[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,jv(e)):lG.call(e)}});function tG(){return JN}function nG(){++JN}function rG(){--JN||oG()}function iG(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,jv(e)}}function aG(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function sG(e){const t=e.flags;if(t&16||t&32&&eG(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,jv(e)}}else e.flags=2}function oG(){try{for(;yl<ah;){const e=xs[yl];xs[yl++]=void 0,sG(e)}}finally{for(;yl<ah;){const e=xs[yl];xs[yl++]=void 0,e.flags|=10}yl=0,ah=0}}function lG(){this.depsTail=void 0,this.flags=0,jv(this);const e=this.subs;e!==void 0&&O5(e)}function jv(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=O5(n,e)}function ek(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 r1=[];let zg=0;const{link:f2,unlink:cG,propagate:uG,checkDirty:_5,shallowPropagate:h2}=E5({update(e){return e._update()},notify(e){r1[i1++]=e,e.flags&=~cn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=cn.Mutable|cn.Dirty,ey(e))}});let Mm=0,i1=0,Ta;function ey(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=cG(n,e)}function z5(){if(!(tG()>0)){for(;Mm<i1;){const e=r1[Mm];r1[Mm++]=void 0,e.notify()}Mm=0,i1=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 Ta!==void 0&&f2(i,Ta,zg),i._snapshot},subscribe(a){const l=ek(a),c={current:!1},d=dG(()=>{i.get(),c.current?l.next?.(i._snapshot):c.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=Ta,c=Object.is;if(n)Ta=i,++zg,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||!c(d,f)?(i._snapshot=f,!0):!1}finally{Ta=l,n&&(i.flags&=~cn.RecursedCheck),ey(i)}}};return n?(i.flags=cn.Mutable|cn.Dirty,i.get=function(){const a=i.flags;if(a&cn.Dirty||a&cn.Pending&&_5(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&h2(l)}}else a&cn.Pending&&(i.flags=a&~cn.Pending);return Ta!==void 0&&f2(i,Ta,zg),i._snapshot}):i.set=function(a){if(i._update(a)){const l=i.subs;l!==void 0&&(uG(l),h2(l),z5())}},i}function dG(e){const t=()=>{const r=Ta;Ta=n,++zg,n.depsTail=void 0,n.flags=cn.Watching|cn.RecursedCheck;try{return e()}finally{Ta=r,n.flags&=~cn.RecursedCheck,ey(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&&_5(this.deps,this)?t():this.flags=cn.Watching},stop(){this.flags=cn.None,this.depsTail=void 0,ey(this)}};return t(),n}class fG{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(ek(t))}}class hG{constructor(t){this.atom=T5(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ek(t))}}function pG(e){return typeof e=="function"?new hG(e):new fG(e)}function mG(e){try{nG(),e()}finally{rG(),z5()}}function sh(e){let t;return mG(()=>{t=e()}),t}var a1=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Nv=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Bl=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const l=e.matches[a];if(!l)continue;const c=e.router.getMatch(l.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},p2=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),i=r>=0?r:0;let a=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let l=a;l>=0;l--){const c=e.matches[l];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return l}return n?a:i},Ao=(e,t,n)=>{if(!(!ii(n)&&!Fr(n)))throw ii(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:ii(n)?"redirected":r.status==="pending"?"success":r.status,context:Bl(e,t.index),isFetching:!1,error:n})),Fr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),ii(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},P5=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},m2=(e,t,n)=>{const r=Bl(e,n);e.updateMatch(t,i=>({...i,context:r}))},_f=(e,t,n,r)=>{const{id:i,routeId:a}=e.matches[t],l=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Ao(e,e.router.getMatch(i),n);try{l.options.onError?.(n)}catch(c){n=c,Ao(e,e.router.getMatch(i),n)}e.updateMatch(i,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!ii(n)&&!Fr(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&&!Nv(e,t)&&(n.options.loader||n.options.beforeLoad||I5(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{a1(e)},i);r._nonReactive.pendingTimeout=a}},gG=(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")&&Ao(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},yG=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Ju(()=>{a?.resolve(),a=void 0});const{paramsError:l,searchError:c}=i;l&&_f(e,n,l,"PARSE_PARAMS"),c&&_f(e,n,c,"VALIDATE_SEARCH"),R5(e,t,r,i);const d=new AbortController;let f=!1;const p=()=>{f||(f=!0,e.updateMatch(t,C=>({...C,isFetching:"beforeLoad",fetchCount:C.fetchCount+1,abortController:d})))},m=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,C=>({...C,isFetching:!1}))};if(!r.options.beforeLoad){sh(()=>{p(),m()});return}i._nonReactive.beforeLoadPromise=Ju();const y={...Bl(e,n,!1),...i.__routeContext},{search:v,params:w,cause:b}=i,j=Nv(e,t),k={search:v,abortController:d,params:w,preload:j,context:y,location:e.location,navigate:C=>e.router.navigate({...C,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":b,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},E=C=>{if(C===void 0){sh(()=>{p(),m()});return}(ii(C)||Fr(C))&&(p(),_f(e,n,C,"BEFORE_LOAD")),sh(()=>{p(),e.updateMatch(t,z=>({...z,__beforeLoadContext:C})),m()})};let O;try{if(O=r.options.beforeLoad(k),xh(O))return p(),O.catch(C=>{_f(e,n,C,"BEFORE_LOAD")}).then(E)}catch(C){p(),_f(e,n,C,"BEFORE_LOAD")}E(O)},vG=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>c(),l=()=>yG(e,n,t,i),c=()=>{if(P5(e,n))return;const d=gG(e,n,i);return xh(d)?d.then(l):l()};return a()},xG=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([a,l,c])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:c,scripts:l,styles:a?.styles}))},D5=(e,t,n,r,i)=>{const a=t[r-1],{params:l,loaderDeps:c,abortController:d,cause:f}=e.router.getMatch(n),p=Bl(e,r),m=Nv(e,n);return{params:l,deps:c,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}},g2=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(y7??e.router.isServer)||a.ssr===!0)&&bh(i);const l=i.options.loader,c=typeof l=="function"?l:l?.handler,d=c?.(D5(e,t,n,r,i)),f=!!c&&xh(d);if((f||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,m=>({...m,isFetching:"loader"})),c){const m=f?await d:d;Ao(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:Bl(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let c=l;if(c?.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:Bl(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,Fr(l)&&await i.options.notFoundComponent?.preload?.(),Ao(e,e.router.getMatch(n),l);try{i.options.onError?.(l)}catch(f){c=f,Ao(e,e.router.getMatch(n),f)}!ii(c)&&!Fr(c)&&await bh(i,["errorComponent"]),e.updateMatch(n,f=>({...f,error:c,context:Bl(e,r),status:"error",isFetching:!1}))}}catch(a){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),Ao(e,l,a)}},bG=async(e,t,n)=>{async function r(v,w,b,j,k){const E=Date.now()-w.updatedAt,O=v?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,C=k.options.shouldReload,z=typeof C=="function"?C(D5(e,t,i,n,k)):C,{status:A,invalid:_}=j,R=E>O&&(!!e.forceStaleReload||j.cause==="enter"||b!==void 0&&b!==j.id);l=A==="success"&&(_||(z??R)),v&&k.options.preload===!1||(l&&!e.sync&&p?(c=!0,(async()=>{try{await g2(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($){ii($)&&await e.router.navigate($.options)}})()):A!=="success"||l?await g2(e,t,i,n,k):m2(e,i,n))}const{id:i,routeId:a}=e.matches[n];let l=!1,c=!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(P5(e,i)){if(!e.router.getMatch(i))return e.matches[n];m2(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=Nv(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&&Ao(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=Ju(),j!==k.preload&&e.updateMatch(i,E=>({...E,preload:j})),await r(b,v,w,k,d)}}const m=e.router.getMatch(i);c||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,c||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const y=c?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 y2(e){const t=e,n=[];t.router.state.matches.some(y=>y._forcePending)&&a1(t);let r;for(let y=0;y<t.matches.length;y++){try{const v=vG(t,y);xh(v)&&await v}catch(v){if(ii(v))throw v;if(Fr(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?p2(t,r):void 0,l=r&&t.preload?0:a!==void 0?Math.min(a+1,i):i;let c,d;for(let y=0;y<l;y++)n.push(bG(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(ii(w))throw w;Fr(w)?c??=w:d??=w}if(d!==void 0)throw d}const f=c??(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=p2(t,f);Es(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 bh(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 bh(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=xG(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=a1(t);if(xh(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function v2(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function bh(e,t=Tg){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...a}=r.options;Object.assign(e.options,a),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Tg?(()=>{if(e._componentsPromise===void 0){const r=v2(e,Tg);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():v2(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function I5(e){for(const t of Tg)if(e.options[t]?.preload)return!0;return!1}var Tg=["component","errorComponent","pendingComponent","notFoundComponent"],Po="__TSR_index",x2="popstate",b2="beforeunload";function wG(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},a=async({task:l,navigateOpts:c,...d})=>{if(c?.ignoreBlocker??!1){l();return}const f=e.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&f.length&&p)for(const m of f){const y=ty(d.path,d.state);if(await m.blockerFn({currentLocation:t,nextLocation:y,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,c,d)=>{const f=t.state[Po];c=w2(f+1,c),a({task:()=>{e.pushState(l,c),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:c})},replace:(l,c,d)=>{const f=t.state[Po];c=w2(f,c),a({task:()=>{e.replaceState(l,c),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:c})},go:(l,c)=>{a({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:c,type:"GO"})},back:l=>{a({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{a({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Po]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function w2(e,t){t||(t={});const n=tk();return{...t,key:n,__TSR_key:n,[Po]:e}}function SG(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const a=()=>i,l=R=>i=R,c=(R=>R),d=(()=>ty(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const R=tk();t.history.replaceState({[Po]: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&&(_._ignoreSubscribers=!0,(j.isPush?t.history.pushState:t.history.replaceState)(j.state,"",j.href),_._ignoreSubscribers=!1,j=void 0,k=void 0,p=void 0)},O=(R,$,F)=>{const q=c($);k||(p=f),f=ty($,F),j={href:q,state:F,isPush:j?.isPush||R==="push"},k||(k=Promise.resolve().then(()=>E()))},C=R=>{f=d(),_.notify({type:R})},z=async()=>{if(y){y=!1;return}const R=d(),$=R.state[Po]-f.state[Po],F=$===1,q=$===-1,B=!F&&!q||m;m=!1;const K=B?"GO":q?"BACK":"FORWARD",X=B?{type:"GO",index:$}:{type:q?"BACK":"FORWARD"};if(v)v=!1;else{const Q=a();if(typeof document<"u"&&Q.length){for(const H of Q)if(await H.blockerFn({currentLocation:f,nextLocation:R,action:K})){y=!0,t.history.go(1),_.notify(X);return}}}f=d(),_.notify(X)},A=R=>{if(w){w=!1;return}let $=!1;const F=a();if(typeof document<"u"&&F.length)for(const q of F){const B=q.enableBeforeUnload??!0;if(B===!0){$=!0;break}if(typeof B=="function"&&B()===!0){$=!0;break}}if($)return R.preventDefault(),R.returnValue=""},_=wG({getLocation:b,getLength:()=>t.history.length,pushState:(R,$)=>O("push",R,$),replaceState:(R,$)=>O("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=>c(R),flush:E,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(b2,A,{capture:!0}),t.removeEventListener(x2,z)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(b2,A,{capture:!0}),t.addEventListener(x2,z),t.history.pushState=function(...R){const $=n.apply(t.history,R);return _._ignoreSubscribers||C("PUSH"),$},t.history.replaceState=function(...R){const $=r.apply(t.history,R);return _._ignoreSubscribers||C("REPLACE"),$},_}function jG(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function ty(e,t){const n=jG(e),r=n.indexOf("#"),i=n.indexOf("?"),a=tk();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||{[Po]:0,key:a,__TSR_key:a}}}function tk(){return(Math.random()+1).toString(36).substring(7)}function Ul(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 NG(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var kG=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=M7(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=SG()),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=Zg(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=pG(AG(this.latestLocation)),H7(this));let l=!1;const c=this.options.basepath??"/",d=this.options.rewrite;if(i||r!==c||a!==d){this.basepath=c;const f=[],p=C5(c);p&&p!=="/"&&f.push(J7({basepath:c})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:X7(f),this.history&&this.updateLatestLocation(),l=!0}l&&this.__store&&this.__store.setState(f=>({...f,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=z7(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&C7(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,n)=>{const r={eventType:t,fn:n};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=t=>{this.subscribers.forEach(n=>{n.eventType===t.type&&n.fn(t)})},this.parseLocation=(t,n)=>{const r=({pathname:c,search:d,hash:f,href:p,state:m})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const j=this.options.parseSearch(d),k=this.options.stringifySearch(j);return{href:c+k+f,publicHref:p,pathname:Ef(c).path,external:!1,searchStr:k,search:gl(n?.search,j),hash:Ef(f.slice(1)).path,state:Ol(n?.state,m)}}const y=new URL(p,this.origin),v=n1(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:Ef(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:b,search:gl(n?.search,w),hash:Ef(v.hash.slice(1)).path,state:Ol(n?.state,m)}},i=r(t),{__tempLocation:a,__tempKey:l}=i.state;if(a&&(!l||l===this.tempLocationKey)){const c=r(a);return c.state.key=i.state.key,c.state.__TSR_key=i.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:i}}return i},this.resolvePathWithBase=(t,n)=>I7({base:t,to:ZN(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=>EG({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const n=this.getMatch(t);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(r=>r.status==="pending"),n=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...n]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=t=>{const n=(i={})=>{const a=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,l=this.matchRoutesLightweight(a);i.from;const c=i.unsafeRelative==="path"?a.pathname:i.from??l.fullPath,d=this.resolvePathWithBase(c,"."),f=l.search,p=Object.assign(Object.create(null),l.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,Co(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:Ef(u2({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($,Pg(F.options.validateSearch,{...$,...j}))}catch{}}),j=$}j=OG({search:j,dest:i,destRoutes:w,_includeValidateSearch:t._includeValidateSearch}),j=gl(f,j);const k=this.options.stringifySearch(j),E=i.hash===!0?a.hash:i.hash?Co(i.hash,a.hash):void 0,O=E?`#${E}`:"";let C=i.state===!0?a.state:i.state?Co(i.state,a.state):{};C=Ol(a.state,C);const z=`${b}${k}${O}`;let A,_,R=!1;if(this.rewrite){const $=new URL(z,this.origin),F=A5(this.rewrite,$);A=$.href.replace($.origin,""),F.origin!==this.origin?(_=F.href,R=!0):_=F.pathname+F.search+F.hash}else A=j7(z),_=A;return{publicHref:_,href:A,pathname:b,search:j,searchStr:k,state:C,hash:E??"",external:R,unmaskOnReload:i.unmaskOnReload}},r=(i={},a)=>{const l=n(i);let c=a?n(a):void 0;if(!c){const d=Object.create(null);if(this.options.routeMasks){const f=A7(l.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,Co(m,d));a={from:t.from,...y,params:v},c=n(a)}}}return c&&(l.maskedLocation=c),l};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:n,...r})=>{const i=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(f=>{r.state[f]=this.latestLocation.state[f]});const d=Ll(r.state,this.latestLocation.state);return c.forEach(f=>{delete r.state[f]}),d},a=To(this.latestLocation.href)===To(r.href);let l=this.commitLocationPromise;if(this.commitLocationPromise=Ju(()=>{l?.resolve(),l=void 0}),a&&i())this.load();else{let{maskedLocation:c,hashScrollIntoView:d,...f}=r;c&&(f={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[r.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:n})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:n,hashScrollIntoView:r,viewTransition:i,ignoreBlocker:a,href:l,...c}={})=>{if(l){const p=this.history.location.state.__TSR_index,m=ty(l,{__TSR_index:t?p:p+1}),y=new URL(m.pathname,this.origin);c.to=n1(this.rewrite,y).pathname,c.search=this.options.parseSearch(m.search),c.hash=m.hash.slice(1)}const d=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const f=this.commitLocation({...d,viewTransition:i,replace:t,resetScroll:n,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:t,reloadDocument:n,href:r,publicHref:i,...a})=>{let l=!1;if(r)try{new URL(`${r}`),l=!0}catch{}if(l&&!n&&(n=!0),n){if(t!==void 0||!r){const d=this.buildLocation({to:t,...a});r=r??d.publicHref,i=i??d.publicHref}const c=!l&&i?i:r;if(Yg(c,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(c):window.location.href=c,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(c=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Ul({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...Ul({resolvedLocation:f,location:d})}),await y2({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=[];sh(()=>{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){ii(d)?(n=d,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Fr(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),c()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(c=>c.status==="error")&&(l=500),l!==void 0&&this.__store.setState(c=>({...c,statusCode:l}))},this.startViewTransition=t=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,a=this.state.resolvedLocation,l=typeof n.types=="function"?n.types(Ul({resolvedLocation:a,location:i})):n.types;if(l===!1){t();return}r={update:t,types:l}}else r=t;document.startViewTransition(r)}else t()},this.updateMatch=(t,n)=>{this.startTransition(()=>{const r=this.state.pendingMatches?.some(i=>i.id===t)?"pendingMatches":this.state.matches.some(i=>i.id===t)?"matches":this.state.cachedMatches.some(i=>i.id===t)?"cachedMatches":"";r&&(r==="cachedMatches"?this.__store.setState(i=>({...i,cachedMatches:NG(i.cachedMatches.map(a=>a.id===t?n(a):a))})):this.__store.setState(i=>({...i,[r]:i[r]?.map(a=>a.id===t?n(a):a)})))})},this.getMatch=t=>{const n=r=>r.id===t;return this.state.cachedMatches.find(n)??this.state.pendingMatches?.find(n)??this.state.matches.find(n)},this.invalidate=t=>{const n=r=>t?.filter?.(r)??!0?{...r,invalid:!0,...t?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r;return this.__store.setState(r=>({...r,matches:r.matches.map(n),cachedMatches:r.cachedMatches.map(n),pendingMatches:r.pendingMatches?.map(n)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const n=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const r=t.options._builtLocation??this.buildLocation(t.options),i=this.getParsedLocationHref(r);t.options.href=i,t.headers.set("Location",i)}else if(n)try{const r=new URL(n);if(this.origin&&r.origin===this.origin){const i=r.pathname+r.search+r.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}if(t.options.href&&!t.options._builtLocation&&Yg(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{const n=t?.filter;n!==void 0?this.__store.setState(r=>({...r,cachedMatches:r.cachedMatches.filter(i=>!n(i))})):this.__store.setState(r=>({...r,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=n=>{const r=this.looseRoutesById[n.routeId];if(!r.options.loader)return!0;const i=(n.preload?r.options.preloadGcTime??this.options.defaultPreloadGcTime:r.options.gcTime??this.options.defaultGcTime)??300*1e3;return n.status==="error"?!0:Date.now()-n.updatedAt>=i};this.clearCache({filter:t})},this.loadRouteChunk=bh,this.preloadRoute=async t=>{const n=t._builtLocation??this.buildLocation(t);let r=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:t});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(l=>l.id)),a=new Set([...i,...this.state.cachedMatches.map(l=>l.id)]);sh(()=>{r.forEach(l=>{a.has(l.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,l]}))})});try{return r=await y2({router:this,matches:r,location:n,preload:!0,updateMatch:(l,c)=>{i.has(l)?r=r.map(d=>d.id===l?c(d):d):this.updateMatch(l,c)}}),r}catch(l){if(ii(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:n});Fr(l)||console.error(l);return}},this.matchRoute=(t,n)=>{const r={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(r);if(n?.pending&&this.state.status!=="pending")return!1;const a=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=E7(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,a.pathname,this.processedTree);return!l||t.params&&!Ll(l.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?Ll(a.search,i.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??W7,parseSearch:e.parseSearch??Q7,protocolAllowlist:e.protocolAllowlist??S7}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n;let{matchedRoutes:l}=n,c=!1;(r?r.path!=="/"&&i["**"]:To(e.pathname))&&(this.options.notFoundRoute?l=[...l,this.options.notFoundRoute]:c=!0);const d=c?zG(this.options.notFoundMode,l):void 0,f=new Array(l.length),p=new Map(this.state.matches.map(m=>[m.routeId,m]));for(let m=0;m<l.length;m++){const y=l[m],v=f[m-1];let w,b,j;{const K=v?.search??e.search,X=v?._strictSearch??void 0;try{const Q=Pg(y.options.validateSearch,{...K})??void 0;w={...K,...Q},b={...X,...Q},j=void 0}catch(Q){let H=Q;if(Q instanceof ny||(H=new ny(Q.message,{cause:Q})),t?.throwOnError)throw H;w=K,b={},j=H}}const k=y.options.loaderDeps?.({search:w})??"",E=k?JSON.stringify(k):"",{interpolatedPath:O,usedParams:C}=u2({path:y.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),z=y.id+O+E,A=this.getMatch(z),_=p.get(y.id),R=A?._strictParams??C;let $;if(!A)try{S2(y,C,a,R)}catch(K){if(Fr(K)||ii(K)?$=K:$=new CG(K.message,{cause:K}),t?.throwOnError)throw $}Object.assign(i,R);const F=_?"stay":"enter";let q;if(A)q={...A,cause:F,params:_?.params??i,_strictParams:R,search:gl(_?_.search:A.search,w),_strictSearch:b};else{const K=y.options.loader||y.options.beforeLoad||y.lazyFn||I5(y)?"pending":"success";q={id:z,ssr:y.options.ssr,index:m,routeId:y.id,params:_?.params??i,_strictParams:R,pathname:O,updatedAt:Date.now(),search:_?gl(_.search,w):w,_strictSearch:b,searchError:void 0,status:K,isFetching:!1,error:void 0,paramsError:$,__routeContext:void 0,_nonReactive:{loadPromise:Ju()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:_?Ol(_.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||(q.globalNotFound=d===y.id),q.searchError=j;const B=this.getParentContext(v);q.context={...B,...q.__routeContext,...q.__beforeLoadContext},f[m]=q}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?gl(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:O=>this.navigate({...O,_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=vh(t),a={...e.search};for(const f of t)try{Object.assign(a,Pg(f.options.validateSearch,a))}catch{}const l=vh(this.state.matches),c=l&&l.routeId===i.id&&e.pathname===this.state.location.pathname;let d;if(c)d=l.params;else{const f=Object.assign(Object.create(null),n);for(const p of t)try{S2(p,n,r??{},f)}catch{}d=f}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:d}}},ny=class extends Error{},CG=class extends Error{};function AG(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Pg(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new ny("Async validation not supported");if(n.issues)throw new ny(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 EG({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=To(e);let a,l;const c=O7(i,n,!0);return c&&(a=c.route,Object.assign(r,c.rawParams),l=Object.assign(Object.create(null),c.parsedParams)),{matchedRoutes:c?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:l}}function OG({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return _G(n)(e,t,r??!1)}function _G(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const a=({search:l,next:c})=>{let d=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((p,m)=>m(p),l));const f=c(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((p,m)=>m(p),f):f};t.middlewares.push(a)}if(i.options.validateSearch){const a=({search:l,next:c})=>{const d=c(l);if(!t._includeValidateSearch)return d;try{return{...d,...Pg(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:Co(a.search,i):{}};t.middlewares.push(n);const r=(i,a,l)=>{if(i>=l.length)return a;const c=l[i];return c({search:a,next:f=>r(i+1,f,l)})};return function(a,l,c){return t.dest=l,t._includeValidateSearch=c,r(0,a,t.middlewares)}}function zG(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 $l}function S2(e,t,n,r){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const a in t)a in n&&(r[a]=n[a]);else{const a=i(r);Object.assign(r,a)}}var TG="Error preloading route! ☝️",M5=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=$l:this.parentRoute||Es(!1);let i=r?$l:n?.path;i&&i!=="/"&&(i=k5(i));const a=n?.id||i;let l=r?$l:_g([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=_g(["/",l]));const c=l==="__root__"?"/":_g([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=c,this._to=To(c)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>XN({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.")}},PG=class extends M5{constructor(e){super(e)}};function nk(e){const t=e.errorComponent??rk;return s.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 rk({error:e}){const[t,n]=x.useState(!1);return s.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[s.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),s.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"})]}),s.jsx("div",{style:{height:".25rem"}}),t?s.jsx("div",{children:s.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?s.jsx("code",{children:e.message}):null})}):null]})}function DG({children:e,fallback:t=null}){return L5()?s.jsx(qi.Fragment,{children:e}):s.jsx(qi.Fragment,{children:t})}function L5(){return qi.useSyncExternalStore(IG,()=>!0,()=>!1)}function IG(){return()=>{}}var $5=x.createContext(null);function Zi(e){const t=x.useContext($5);return e?.warn,t}var Nw={exports:{}},kw={},Cw={exports:{}},Aw={};var j2;function MG(){if(j2)return Aw;j2=1;var e=gd();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,l=e.useDebugValue;function c(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]),l(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:c;return Aw.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Aw}var N2;function LG(){return N2||(N2=1,Cw.exports=MG()),Cw.exports}var k2;function $G(){if(k2)return kw;k2=1;var e=gd(),t=LG();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,c=e.useMemo,d=e.useDebugValue;return kw.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=c(function(){function k(A){if(!E){if(E=!0,O=A,A=y(A),v!==void 0&&b.hasValue){var _=b.value;if(v(_,A))return C=_}return C=A}if(_=C,r(O,A))return _;var R=y(A);return v!==void 0&&v(_,R)?(O=A,_):(O=A,C=R)}var E=!1,O,C,z=m===void 0?null:m;return[function(){return k(p())},z===null?void 0:function(){return k(z())}]},[p,m,y,v]);var j=i(f,w[0],w[1]);return l(function(){b.hasValue=!0,b.value=j},[j]),d(j),j},kw}var C2;function BG(){return C2||(C2=1,Nw.exports=$G()),Nw.exports}var B5=BG();function UG(e,t){return e===t}function qG(e,t,n=UG){const r=x.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(l);return c},[e]),i=x.useCallback(()=>e?.get(),[e]);return B5.useSyncExternalStoreWithSelector(r,i,i,t,n)}function li(e){const t=Zi({warn:e?.router===void 0}),n=e?.router||t,r=x.useRef(void 0);return qG(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 kv=x.createContext(void 0),FG=x.createContext(void 0);function Ho(e){const t=x.useContext(e.from?FG:kv);return li({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(Es(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function ik(e){return Ho({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function ak(e){const{select:t,...n}=e;return Ho({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Wh(e){return Ho({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 Cv(e){return Ho({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Ko(e){const t=Zi();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function sk(e){return Ho({...e,select:t=>e.select?e.select(t.context):t.context})}var dc=a5();const HG=ya(dc);function KG(e,t){const n=Zi(),r=g7(t),{activeProps:i,inactiveProps:a,activeOptions:l,to:c,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:y,resetScroll:v,viewTransition:w,children:b,target:j,disabled:k,style:E,className:O,onClick:C,onBlur:z,onFocus:A,onMouseEnter:_,onMouseLeave:R,onTouchStart:$,ignoreBlocker:F,params:q,search:B,hash:K,state:X,mask:Q,reloadDocument:H,unsafeRelative:J,from:de,_fromLocation:be,...M}=e,D=L5(),U=li({select:rt=>{const ae=rt.matches[rt.matches.length-1];return{search:ae?.search,hash:rt.location.hash,path:ae?.pathname}},structuralSharing:!0}),I=e.from,V=x.useMemo(()=>({...e,from:I}),[n,U,I,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ce=x.useMemo(()=>n.buildLocation({...V}),[n,V]),re=ce.maskedLocation?ce.maskedLocation.publicHref:ce.publicHref,ke=ce.maskedLocation?ce.maskedLocation.external:ce.external,ze=x.useMemo(()=>ZG(re,ke,n.history,k),[k,ke,re,n.history]),te=x.useMemo(()=>{if(ze?.external)return Yg(ze.href,n.protocolAllowlist)?void 0:ze.href;if(!XG(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),Yg(c,n.protocolAllowlist)?void 0:c}catch{}},[c,ze,n.protocolAllowlist]),fe=li({select:rt=>{if(te)return!1;if(l?.exact){if(!D7(rt.location.pathname,ce.pathname,n.basepath))return!1}else{const ae=Xg(rt.location.pathname,n.basepath),Se=Xg(ce.pathname,n.basepath);if(!(ae.startsWith(Se)&&(ae.length===Se.length||ae[Se.length]==="/")))return!1}return(l?.includeSearch??!0)&&!Ll(rt.location.search,ce.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?D&&rt.location.hash===ce.hash:!0}}),Ee=fe?Co(i,{})??GG:Ew,Z=fe?Ew:Co(a,{})??Ew,Ge=[O,Ee.className,Z.className].filter(Boolean).join(" "),Me=(E||Ee.style||Z.style)&&{...E,...Ee.style,...Z.style},[lt,Te]=x.useState(!1),Wt=x.useRef(!1),Ht=e.reloadDocument||te?!1:d??n.options.defaultPreload,on=f??n.options.defaultPreloadDelay??0,en=x.useCallback(()=>{n.preloadRoute({...V,_builtLocation:ce}).catch(rt=>{console.warn(rt),console.warn(TG)})},[n,V,ce]);m7(r,x.useCallback(rt=>{rt?.isIntersecting&&en()},[en]),YG,{disabled:!!k||Ht!=="viewport"}),x.useEffect(()=>{Wt.current||!k&&Ht==="render"&&(en(),Wt.current=!0)},[k,en,Ht]);const _n=rt=>{const ae=rt.currentTarget.getAttribute("target"),Se=j!==void 0?j:ae;if(!k&&!JG(rt)&&!rt.defaultPrevented&&(!Se||Se==="_self")&&rt.button===0){rt.preventDefault(),dc.flushSync(()=>{Te(!0)});const $e=n.subscribe("onResolved",()=>{$e(),Te(!1)});n.navigate({...V,replace:m,resetScroll:v,hashScrollIntoView:p,startTransition:y,viewTransition:w,ignoreBlocker:F})}};if(te)return{...M,ref:r,href:te,...b&&{children:b},...j&&{target:j},...k&&{disabled:k},...E&&{style:E},...O&&{className:O},...C&&{onClick:C},...z&&{onBlur:z},...A&&{onFocus:A},..._&&{onMouseEnter:_},...R&&{onMouseLeave:R},...$&&{onTouchStart:$}};const ve=rt=>{if(k||Ht!=="intent")return;if(!on){en();return}const ae=rt.currentTarget;if(zf.has(ae))return;const Se=setTimeout(()=>{zf.delete(ae),en()},on);zf.set(ae,Se)},ft=rt=>{k||Ht!=="intent"||en()},Ye=rt=>{if(k||!Ht||!on)return;const ae=rt.currentTarget,Se=zf.get(ae);Se&&(clearTimeout(Se),zf.delete(ae))};return{...M,...Ee,...Z,href:ze?.href,ref:r,onClick:cu([C,_n]),onBlur:cu([z,Ye]),onFocus:cu([A,ve]),onMouseEnter:cu([_,ve]),onMouseLeave:cu([R,Ye]),onTouchStart:cu([$,ft]),disabled:!!k,target:j,...Me&&{style:Me},...Ge&&{className:Ge},...k&&VG,...fe&&QG,...D&<&&WG}}var Ew={},GG={className:"active"},VG={role:"link","aria-disabled":!0},QG={"data-status":"active","aria-current":"page"},WG={"data-transitioning":"transitioning"},zf=new WeakMap,YG={rootMargin:"100px"},cu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function ZG(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function XG(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Et=x.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...a}=KG(r,t),l=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:c,...d}=a;return x.createElement("a",d,l)}return x.createElement(n,a,l)});function JG(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var eV=class extends M5{constructor(e){super(e),this.useMatch=t=>Ho({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>sk({...t,from:this.id}),this.useSearch=t=>Cv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Wh({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>ak({...t,from:this.id}),this.useLoaderData=t=>ik({...t,from:this.id}),this.useNavigate=()=>Ko({from:this.fullPath}),this.Link=qi.forwardRef((t,n)=>s.jsx(Et,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function xr(e){return new eV(e)}function tV(){return e=>rV(e)}var nV=class extends PG{constructor(e){super(e),this.useMatch=t=>Ho({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>sk({...t,from:this.id}),this.useSearch=t=>Cv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Wh({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>ak({...t,from:this.id}),this.useLoaderData=t=>ik({...t,from:this.id}),this.useNavigate=()=>Ko({from:this.fullPath}),this.Link=qi.forwardRef((t,n)=>s.jsx(Et,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function rV(e){return new nV(e)}function A2(e){return typeof e=="object"?new E2(e,{silent:!0}).createRoute(e):new E2(e,{silent:!0}).createRoute}var E2=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=xr(n);return r.isRoot=!1,r},this.silent=t?.silent}},O2=class{constructor(e){this.useMatch=t=>Ho({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>sk({...t,from:this.options.id}),this.useSearch=t=>Cv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Wh({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>ak({...t,from:this.options.id}),this.useLoaderData=t=>ik({...t,from:this.options.id}),this.useNavigate=()=>Ko({from:Zi().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function _2(e){return typeof e=="object"?new O2(e):t=>new O2({id:e,...t})}function iV(e){const t=li({select:n=>`not-found-${n.location.pathname}-${n.status}`});return s.jsx(nk,{getResetKey:()=>t,onCatch:(n,r)=>{if(Fr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Fr(n))return e.fallback?.(n);throw n},children:e.children})}function aV(){return s.jsx("p",{children:"Not Found"})}function Au(e){return s.jsx(s.Fragment,{children:e.children})}function U5(e,t,n){return t.options.notFoundComponent?s.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?s.jsx(e.options.defaultNotFoundComponent,{...n}):s.jsx(aV,{})}function sV(){return Zi().isScrollRestoring,null}var q5=x.memo(function({matchId:t}){const n=Zi(),r=li({select:w=>{const b=w.matches.findIndex(k=>k.id===t),j=w.matches[b];return Es(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,l=a?s.jsx(a,{}):null,c=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:Au,y=c?nk:Au,v=f?iV:Au;return s.jsxs(i.isRoot?i.options.shellComponent??Au:Au,{children:[s.jsx(kv.Provider,{value:t,children:s.jsx(m,{fallback:l,children:s.jsx(y,{getResetKey:()=>r.resetKey,errorComponent:c||rk,onCatch:(w,b)=>{if(Fr(w))throw w;d?.(w,b)},children:s.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?s.jsx(DG,{fallback:l,children:s.jsx(z2,{matchId:t})}):s.jsx(z2,{matchId:t})})})})}),r.parentRouteId===$l&&n.options.scrollRestoration?s.jsxs(s.Fragment,{children:[s.jsx(oV,{}),s.jsx(sV,{})]}):null]})});function oV(){const e=Zi(),t=x.useRef(void 0);return s.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Ul(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var z2=x.memo(function({matchId:t}){const n=Zi(),{match:r,key:i,routeId:a}=li({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}),l=n.routesById[a],c=x.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?s.jsx(d,{},i):s.jsx(ok,{})},[i,l.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const d=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const f=n.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise){const p=Ju();f._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),f._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return Es(Fr(r.error)),U5(n,l,r.error);if(r.status==="redirected")throw Es(ii(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return c}),ok=x.memo(function(){const t=Zi(),n=x.useContext(kv),r=li({select:f=>f.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],a=li({select:f=>{const p=f.matches.find(m=>m.id===n);return Es(p),p.globalNotFound}}),l=li({select:f=>{const p=f.matches;return p[p.findIndex(m=>m.id===n)+1]?.id}}),c=t.options.defaultPendingComponent?s.jsx(t.options.defaultPendingComponent,{}):null;if(a)return U5(t,i,void 0);if(!l)return null;const d=s.jsx(q5,{matchId:l});return r===$l?s.jsx(x.Suspense,{fallback:c,children:d}):d});function lV(){const e=Zi(),t=x.useRef({router:e,mounted:!1}),[n,r]=x.useState(!1),{hasPendingMatches:i,isLoading:a}=li({select:m=>({isLoading:m.isLoading,hasPendingMatches:m.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),l=vw(a),c=a||n||i,d=vw(c),f=a||i,p=vw(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 To(e.latestLocation.publicHref)!==To(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{m()}},[e,e.history]),Dm(()=>{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]),Dm(()=>{l&&!a&&e.emit({type:"onLoad",...Ul(e.state)})},[l,e,a]),Dm(()=>{p&&!f&&e.emit({type:"onBeforeRouteMount",...Ul(e.state)})},[f,p,e]),Dm(()=>{if(d&&!c){const m=Ul(e.state);e.emit({type:"onResolved",...m}),e.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),m.hrefChanged&&K7(e)}},[c,d,e]),null}function cV(){const e=Zi(),t=e.routesById[$l].options.pendingComponent??e.options.defaultPendingComponent,n=t?s.jsx(t,{}):null,r=s.jsxs(typeof document<"u"&&e.ssr?Au:x.Suspense,{fallback:n,children:[s.jsx(lV,{}),s.jsx(uV,{})]});return e.options.InnerWrap?s.jsx(e.options.InnerWrap,{children:r}):r}function uV(){const e=Zi(),t=li({select:i=>i.matches[0]?.id}),n=li({select:i=>i.loadedAt}),r=t?s.jsx(q5,{matchId:t}):null;return s.jsx(kv.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:s.jsx(nk,{getResetKey:()=>n,errorComponent:rk,onCatch:void 0,children:r})})}var dV=e=>new fV(e),fV=class extends kG{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=A2,globalThis.createLazyFileRoute=_2):typeof window<"u"&&(window.createFileRoute=A2,window.createLazyFileRoute=_2);function hV({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=s.jsx($5.Provider,{value:e,children:t});return e.options.Wrap?s.jsx(e.options.Wrap,{children:r}):r}function pV({router:e,...t}){return s.jsx(hV,{router:e,...t,children:s.jsx(cV,{})})}function F5(e){return li({select:t=>t.location})}class yr extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function mV(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const H5=mV();function gV(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function yV(e){return`${gV()}${e}`}function vV(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 xV(){return""}function Ow(){return!!xV()}let K5=null;function T2(e){K5=e}function G5(){K5?.()}async function Ne(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}`,l;if(i)try{const c=JSON.parse(i);typeof c.error=="string"?a=c.error:c.error?.message?(a=c.error.message,l=c.error.code):c.message&&(a=c.message)}catch{a=i}throw(r.status===401||r.status===403)&&!e.startsWith("/session")&&G5(),new yr(a,r.status,l)}if(r.status!==204)return r.json()}function Av(){return Ne("/projects")}function V5(e){return Ne(`/projects/${encodeURIComponent(e)}`)}function Q5(){return Ne("/runs")}function bV(e){return Ne(`/projects/${encodeURIComponent(e)}/runs`)}function Ql(e){return Ne(`/runs/${encodeURIComponent(e)}`)}function wV(e){return Ne(`/projects/${encodeURIComponent(e)}/queries`)}function W5(e){return Ne(`/projects/${encodeURIComponent(e)}/competitors`)}function Y5(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const r=n.toString();return Ne(`/projects/${encodeURIComponent(e)}/timeline${r?`?${r}`:""}`)}function SV(e,t){const r=new URLSearchParams().toString();return Ne(`/projects/${encodeURIComponent(e)}/overview${r?`?${r}`:""}`)}function Ev(e,t){return Ne(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function jV(e,t){return Ne(`/projects/${encodeURIComponent(e)}/queries`,{method:"PUT",body:JSON.stringify({queries:t})})}function NV(e,t){return Ne(`/projects/${encodeURIComponent(e)}/queries`,{method:"POST",body:JSON.stringify({queries:t})})}function Z5(e,t){return Ne(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function P2(e,t){const n=await V5(e);return Ev(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 kV(e,t){const n=await V5(e);return Ev(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 CV(e,t){const n={};return t?.location&&(n.location=t.location),t?.allLocations&&(n.allLocations=!0),t?.noLocation&&(n.noLocation=!0),Ne(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function AV(e,t){return Ne(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function EV(e,t){await Ne(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function OV(e,t){return Ne(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function _V(e){await Ne(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function zV(e){return Ne(`/projects/${encodeURIComponent(e)}/export`)}function lk(){return Ne("/settings")}function R2(){return Ne("/session")}function TV(e){return Ne("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function PV(e){return Ne("/session",{method:"POST",body:JSON.stringify({password:e})})}function RV(e,t){return Ne(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function DV(e){return Ne("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function IV(e){try{return await Ne(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof yr&&t.statusCode===404)return null;throw t}}function D2(e,t){return Ne(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function MV(e){await Ne(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function LV(e){return Ne(`/projects/${encodeURIComponent(e)}/notifications`)}function $V(e,t){return Ne(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function BV(e,t){await Ne(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function UV(e,t){return Ne(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function qV(e,t,n){return Ne(`/projects/${encodeURIComponent(e)}/queries/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function FV(e){return Ne("/apply",{method:"POST",body:JSON.stringify(e)})}function HV(e){return Ne("/runs",{method:"POST",body:JSON.stringify(e??{})})}function X5(e){return Ne(`/projects/${encodeURIComponent(e)}/google/connections`)}function KV(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function GV(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function VV(e){return Ne(`/projects/${encodeURIComponent(e)}/google/properties`)}function QV(e,t,n){return Ne(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function WV(e,t,n){return Ne(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function J5(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function YV(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)),t?.offset!==void 0&&t.offset>0&&n.set("offset",String(t.offset));const r=n.toString()?`?${n.toString()}`:"";return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/performance${r}`)}function ZV(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function XV(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 Ne(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${r}`)}function JV(e){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function ck(e){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function eQ(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function tQ(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function nQ(e){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function rQ(e){return Ne(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function iQ(e,t){return Ne(`/projects/${encodeURIComponent(e)}/discover/run`,{method:"POST",body:JSON.stringify(t??{})})}function aQ(e,t){const n=new URLSearchParams;n.set("limit",String(t.limit));const r=n.toString()?`?${n.toString()}`:"";return Ne(`/projects/${encodeURIComponent(e)}/discover/sessions${r}`)}function sQ(e,t){return Ne(`/projects/${encodeURIComponent(e)}/discover/sessions/${encodeURIComponent(t)}`)}function oQ(e,t){return Ne(`/projects/${encodeURIComponent(e)}/discover/sessions/${encodeURIComponent(t)}/promote`)}function lQ(e,t,n){return Ne(`/projects/${encodeURIComponent(e)}/discover/sessions/${encodeURIComponent(t)}/promote`,{method:"POST",body:JSON.stringify(n??{})})}function I2(){return Ne("/cdp/status")}function cQ(e,t){return Ne("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function M2(e,t){return Ne(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function e4(e){return Ne(`/projects/${encodeURIComponent(e)}/bing/status`)}function uQ(e,t){return Ne(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function dQ(e){return Ne(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function fQ(e){return Ne(`/projects/${encodeURIComponent(e)}/bing/sites`)}function hQ(e,t){return Ne(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function uk(e){return Ne(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function t4(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Ne(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function n4(e,t){return Ne(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function pQ(e,t){return Ne(`/projects/${encodeURIComponent(e)}/bing/inspect-sitemap`,{method:"POST",body:void 0})}function L2(e,t){return Ne(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function mQ(e){return Ne(`/projects/${encodeURIComponent(e)}/bing/performance`)}function gQ(e){return Ne("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function yQ(e){return Ne(`/projects/${encodeURIComponent(e)}/report`)}function vQ(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function xQ(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 yr(`Failed to download report: ${r.status}`,r.status);const i=await r.blob(),a=URL.createObjectURL(i),l=vQ(r.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,c=document.createElement("a");c.href=a,c.download=l,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(a)}function bQ(e){return Ne(`/projects/${encodeURIComponent(e)}/ga/status`)}function wQ(e,t,n){const r=new URLSearchParams;n&&n!=="all"&&r.set("window",n);const i=r.toString()?`?${r}`:"";return Ne(`/projects/${encodeURIComponent(e)}/ga/traffic${i}`)}function r4(e,t){return Ne(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function SQ(e,t){return Ne(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function jQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Ne(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history${n}`)}function NQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Ne(`/projects/${encodeURIComponent(e)}/ga/social-referral-history${n}`)}function kQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Ne(`/projects/${encodeURIComponent(e)}/ga/session-history${n}`)}function CQ(e){return Ne(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function AQ(e){return Ne(`/projects/${encodeURIComponent(e)}/traffic/sources`)}function EQ(e){return Ne(`/projects/${encodeURIComponent(e)}/traffic/status`)}function i4(e,t){return Ne(`/projects/${encodeURIComponent(e)}/traffic/sources/${encodeURIComponent(t)}`)}function OQ(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 Ne(`/projects/${encodeURIComponent(e)}/traffic/events${r}`)}function _Q(e,t){return Ne(`/projects/${encodeURIComponent(e)}/traffic/connect/cloud-run`,{method:"POST",body:JSON.stringify(t)})}function zQ(e,t){return Ne(`/projects/${encodeURIComponent(e)}/traffic/connect/wordpress`,{method:"POST",body:JSON.stringify(t)})}function TQ(e,t,n){return Ne(`/projects/${encodeURIComponent(e)}/traffic/sources/${encodeURIComponent(t)}/sync`,{method:"POST",body:JSON.stringify(n??{})})}function PQ(e,t){return Ne(`/projects/${encodeURIComponent(e)}/insights`)}function RQ(e){return Ne(`/projects/${encodeURIComponent(e)}/citations/visibility`)}async function DQ(e,t){const n=yV(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:vV(e,r.status)};const i=await r.json(),a=typeof i.version=="string"?i.version:"unknown",l=typeof i.databaseUrlConfigured=="boolean"?i.databaseUrlConfigured:void 0,c=typeof i.lastHeartbeatAt=="string"?i.lastHeartbeatAt:void 0,d=[a,l===!1?"database not configured":"database configured",c?`heartbeat ${c}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:d,version:a,databaseConfigured:l,lastHeartbeatAt:c}}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 IQ(){return Ne("/backlinks/status")}function MQ(){return Ne("/backlinks/install",{method:"POST"})}function a4(){return Ne("/backlinks/syncs/latest")}function LQ(){return Ne("/backlinks/syncs")}function $Q(e){return Ne("/backlinks/syncs",{method:"POST",body:JSON.stringify(e?{release:e}:{})})}function BQ(){return Ne("/backlinks/releases")}function UQ(){return Ne("/backlinks/latest-release")}function qQ(e){return Ne(`/backlinks/cache/${encodeURIComponent(e)}`,{method:"DELETE"})}function FQ(e,t={}){const n=new URLSearchParams;t.release&&n.set("release",t.release),t.excludeCrawlers&&n.set("excludeCrawlers","1");const r=n.toString();return Ne(`/projects/${encodeURIComponent(e)}/backlinks/summary${r?`?${r}`:""}`)}function HQ(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 Ne(`/projects/${encodeURIComponent(e)}/backlinks/domains${r?`?${r}`:""}`)}function KQ(e){return Ne(`/projects/${encodeURIComponent(e)}/backlinks/history`)}function GQ(e,t){return Ne(`/projects/${encodeURIComponent(e)}/backlinks/extract`,{method:"POST",body:JSON.stringify({release:void 0})})}const VQ=6e3,QQ=5,WQ=180;let Or=[],YQ=0;const s1=new Set,o1=new Map,l1=new Map;function ry(){const e=[...Or];for(const t of s1)t(e)}function dk(e){const t=o1.get(e);t&&(clearTimeout(t),o1.delete(e));const n=l1.get(e);n&&(clearTimeout(n),l1.delete(e))}function s4(e){dk(e);const t=Or.length;Or=Or.filter(n=>n.id!==e),Or.length!==t&&ry()}function $2(e){dk(e.id),o1.set(e.id,setTimeout(()=>{c1(e.id)},e.durationMs))}function ZQ(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function dt(e,t="negative",n=VQ){const r=ZQ(e,t,n),i={id:String(++YQ),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=Or.find(l=>l.dedupeKey===r.dedupeKey);if(a){if((r.dedupeMode??"drop")==="drop")return a.id;const l={...a,title:i.title,detail:i.detail,tone:i.tone,durationMs:i.durationMs,cta:i.cta,state:"open"};return Or=Or.map(c=>c.id===a.id?l:c),ry(),$2(l),a.id}}return Or.length>=QQ&&s4(Or[0].id),Or=[...Or,i],ry(),$2(i),i.id}function c1(e){const t=Or.find(n=>n.id===e);!t||t.state==="closing"||(dk(e),Or=Or.map(n=>n.id===e?{...n,state:"closing"}:n),ry(),l1.set(e,setTimeout(()=>{s4(e)},WQ)))}function XQ(e){return s1.add(e),()=>{s1.delete(e)}}function B2(){return Or}const JQ=5*6e4,o4=30*6e4,bs=3e4,_r=6e4,u1=3e4;function eW(){return new c7({defaultOptions:{queries:{staleTime:JQ,retry:1,refetchOnWindowFocus:!1}},mutationCache:new h5({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||dt({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const tW=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),nW=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),U2=e=>{const t=nW(e);return t.charAt(0).toUpperCase()+t.slice(1)},l4=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),rW=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var iW={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 aW=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:l,...c},d)=>x.createElement("svg",{ref:d,...iW,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:l4("lucide",i),...!a&&!rW(c)&&{"aria-hidden":"true"},...c},[...l.map(([f,p])=>x.createElement(f,p)),...Array.isArray(a)?a:[a]]));const Nt=(e,t)=>{const n=x.forwardRef(({className:r,...i},a)=>x.createElement(aW,{ref:a,iconNode:t,className:l4(`lucide-${tW(U2(e))}`,`lucide-${e}`,r),...i}));return n.displayName=U2(e),n};const sW=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],q2=Nt("arrow-left",sW);const oW=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],lW=Nt("arrow-up",oW);const cW=[["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"}]],uW=Nt("book-open",cW);const dW=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],c4=Nt("check",dW);const fW=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],hW=Nt("chevron-down",fW);const pW=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Yh=Nt("chevron-right",pW);const mW=[["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"}]],gW=Nt("circle-alert",mW);const yW=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],fk=Nt("circle-check",yW);const vW=[["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"}]],u4=Nt("circle-question-mark",vW);const xW=[["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"}]],bW=Nt("copy",xW);const wW=[["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"}]],Ov=Nt("download",wW);const SW=[["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"}]],jW=Nt("external-link",SW);const NW=[["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"}]],kW=Nt("file-text",NW);const CW=[["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"}]],AW=Nt("github",CW);const EW=[["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"}]],OW=Nt("globe",EW);const _W=[["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"}]],zW=Nt("layout-dashboard",_W);const TW=[["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"}]],d4=Nt("link-2",TW);const PW=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],f4=Nt("loader-circle",PW);const RW=[["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"}]],DW=Nt("maximize-2",RW);const IW=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],MW=Nt("menu",IW);const LW=[["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"}]],$W=Nt("minimize-2",LW);const BW=[["path",{d:"M5 12h14",key:"1ays0h"}]],UW=Nt("minus",BW);const qW=[["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"}]],wh=Nt("play",qW);const FW=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ou=Nt("plus",FW);const HW=[["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"}]],KW=Nt("radar",HW);const GW=[["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"}]],Sh=Nt("refresh-cw",GW);const VW=[["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"}]],QW=Nt("rocket",VW);const WW=[["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"}]],h4=Nt("rotate-ccw",WW);const YW=[["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"}]],ZW=Nt("settings",YW);const XW=[["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"}]],F2=Nt("sparkles",XW);const JW=[["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"}]],p4=Nt("trash-2",JW);const eY=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],iy=Nt("triangle-alert",eY);const tY=[["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"}]],nY=Nt("unplug",tY);const rY=[["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"}]],iY=Nt("upload",rY);const aY=[["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"}]],sY=Nt("wrench",aY);const oY=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],yd=Nt("x",oY);function ge(e,t,n){function r(c,d){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:d,constr:l,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,d);const f=l.prototype,p=Object.keys(f);for(let m=0;m<p.length;m++){const y=p[m];y in c||(c[y]=f[y].bind(c))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function l(c){var d;const f=n?.Parent?new a:this;r(f,c),(d=f._zod).deferred??(d.deferred=[]);for(const p of f._zod.deferred)p();return f}return Object.defineProperty(l,"init",{value:r}),Object.defineProperty(l,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class Bu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class m4 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const g4={};function Lo(e){return g4}function y4(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 d1(e,t){return typeof t=="bigint"?t.toString():t}function _v(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function hk(e){return e==null}function pk(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function lY(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const d=r.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const a=n>i?n:i,l=Number.parseInt(e.toFixed(a).replace(".","")),c=Number.parseInt(t.toFixed(a).replace(".",""));return l%c/10**a}const H2=Symbol("evaluating");function Dt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==H2)return r===void 0&&(r=H2,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function fc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Go(...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 v4="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function jh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const uY=_v(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ed(e){if(jh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(jh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function x4(e){return ed(e)?{...e}:Array.isArray(e)?[...e]:e}const dY=new Set(["string","number","symbol"]);function td(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vo(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Ke(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 fY(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const hY={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 pY(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=Go(e._zod.def,{get shape(){const l={};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(l[c]=n.shape[c])}return fc(this,"shape",l),l},checks:[]});return Vo(e,a)}function mY(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=Go(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete l[c]}return fc(this,"shape",l),l},checks:[]});return Vo(e,a)}function gY(e,t){if(!ed(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const a=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(a,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Go(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return fc(this,"shape",a),a}});return Vo(e,i)}function yY(e,t){if(!ed(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Go(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return fc(this,"shape",r),r}});return Vo(e,n)}function vY(e,t){const n=Go(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return fc(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Vo(e,n)}function xY(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=Go(t._zod.def,{get shape(){const c=t._zod.def.shape,d={...c};if(n)for(const f in n){if(!(f in c))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(d[f]=e?new e({type:"optional",innerType:c[f]}):c[f])}else for(const f in c)d[f]=e?new e({type:"optional",innerType:c[f]}):c[f];return fc(this,"shape",d),d},checks:[]});return Vo(t,l)}function bY(e,t,n){const r=Go(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(a[l]=new e({type:"nonoptional",innerType:i[l]}))}else for(const l in i)a[l]=new e({type:"nonoptional",innerType:i[l]});return fc(this,"shape",a),a}});return Vo(t,r)}function _u(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 zu(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Lm(e){return typeof e=="string"?e:e?.message}function $o(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=Lm(e.inst?._zod.def?.error?.(e))??Lm(t?.error?.(e))??Lm(n.customError?.(e))??Lm(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function mk(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Nh(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const b4=(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,d1,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},w4=ge("$ZodError",b4),S4=ge("$ZodError",b4,{Parent:Error});function wY(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 SY(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(l=>r({issues:l}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let l=n,c=0;for(;c<a.path.length;){const d=a.path[c];c===a.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(a))):l[d]=l[d]||{_errors:[]},l=l[d],c++}}};return r(e),n}const gk=e=>(t,n,r,i)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},a);if(l instanceof Promise)throw new Bu;if(l.issues.length){const c=new(i?.Err??e)(l.issues.map(d=>$o(d,a,Lo())));throw v4(c,i?.callee),c}return l.value},yk=e=>async(t,n,r,i)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},a);if(l instanceof Promise&&(l=await l),l.issues.length){const c=new(i?.Err??e)(l.issues.map(d=>$o(d,a,Lo())));throw v4(c,i?.callee),c}return l.value},zv=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 Bu;return a.issues.length?{success:!1,error:new(e??w4)(a.issues.map(l=>$o(l,i,Lo())))}:{success:!0,data:a.value}},jY=zv(S4),Tv=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(l=>$o(l,i,Lo())))}:{success:!0,data:a.value}},NY=Tv(S4),kY=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return gk(e)(t,n,i)},CY=e=>(t,n,r)=>gk(e)(t,n,r),AY=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return yk(e)(t,n,i)},EY=e=>async(t,n,r)=>yk(e)(t,n,r),OY=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return zv(e)(t,n,i)},_Y=e=>(t,n,r)=>zv(e)(t,n,r),zY=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Tv(e)(t,n,i)},TY=e=>async(t,n,r)=>Tv(e)(t,n,r),PY=/^[cC][^\s-]{8,}$/,RY=/^[0-9a-z]+$/,DY=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,IY=/^[0-9a-vA-V]{20}$/,MY=/^[A-Za-z0-9]{27}$/,LY=/^[a-zA-Z0-9_-]{21}$/,$Y=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,BY=/^([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})$/,G2=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)$/,UY=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,qY="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function FY(){return new RegExp(qY,"u")}const HY=/^(?:(?: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])$/,KY=/^(([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}|:))$/,GY=/^((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])$/,VY=/^(([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])$/,QY=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,j4=/^[A-Za-z0-9_-]*$/,WY=/^\+[1-9]\d{6,14}$/,N4="(?:(?:\\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])))",YY=new RegExp(`^${N4}$`);function k4(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 ZY(e){return new RegExp(`^${k4(e)}$`)}function XY(e){const t=k4({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(`^${N4}T(?:${r})$`)}const JY=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},eZ=/^-?\d+$/,C4=/^-?\d+(?:\.\d+)?$/,tZ=/^(?:true|false)$/i,nZ=/^[^A-Z]*$/,rZ=/^[^a-z]*$/,di=ge("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),A4={number:"number",bigint:"bigint",object:"date"},E4=ge("$ZodCheckLessThan",(e,t)=>{di.init(e,t);const n=A4[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})}}),O4=ge("$ZodCheckGreaterThan",(e,t)=>{di.init(e,t);const n=A4[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})}}),iZ=ge("$ZodCheckMultipleOf",(e,t)=>{di.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):lY(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})}}),aZ=ge("$ZodCheckNumberFormat",(e,t)=>{di.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,a]=hY[t.format];e._zod.onattach.push(l=>{const c=l._zod.bag;c.format=t.format,c.minimum=i,c.maximum=a,n&&(c.pattern=eZ)}),e._zod.check=l=>{const c=l.value;if(n){if(!Number.isInteger(c)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<i&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),c>a&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),sZ=ge("$ZodCheckMaxLength",(e,t)=>{var n;di.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!hk(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const l=mk(i);r.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),oZ=ge("$ZodCheckMinLength",(e,t)=>{var n;di.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!hk(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const l=mk(i);r.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),lZ=ge("$ZodCheckLengthEquals",(e,t)=>{var n;di.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!hk(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,a=i.length;if(a===t.length)return;const l=mk(i),c=a>t.length;r.issues.push({origin:l,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Pv=ge("$ZodCheckStringFormat",(e,t)=>{var n,r;di.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)=>{Pv.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})}}),uZ=ge("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=nZ),Pv.init(e,t)}),dZ=ge("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=rZ),Pv.init(e,t)}),fZ=ge("$ZodCheckIncludes",(e,t)=>{di.init(e,t);const n=td(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})}}),hZ=ge("$ZodCheckStartsWith",(e,t)=>{di.init(e,t);const n=new RegExp(`^${td(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})}}),pZ=ge("$ZodCheckEndsWith",(e,t)=>{di.init(e,t);const n=new RegExp(`.*${td(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})}}),mZ=ge("$ZodCheckOverwrite",(e,t)=>{di.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class gZ{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
10
|
-
`).filter(l=>l),i=Math.min(...r.map(l=>l.length-l.trimStart().length)),a=r.map(l=>l.slice(i)).map(l=>" ".repeat(this.indent*2)+l);for(const l of a)this.content.push(l)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
|
|
11
|
-
`))}}const yZ={major:4,minor:3,patch:6},mn=ge("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=yZ;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const a of i._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(l,c,d)=>{let f=_u(l),p;for(const m of c){if(m._zod.def.when){if(!m._zod.def.when(l))continue}else if(f)continue;const y=l.issues.length,v=m._zod.check(l);if(v instanceof Promise&&d?.async===!1)throw new Bu;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,l.issues.length!==y&&(f||(f=_u(l,y)))});else{if(l.issues.length===y)continue;f||(f=_u(l,y))}}return p?p.then(()=>l):l},a=(l,c,d)=>{if(_u(l))return l.aborted=!0,l;const f=i(c,r,d);if(f instanceof Promise){if(d.async===!1)throw new Bu;return f.then(p=>e._zod.parse(p,d))}return e._zod.parse(f,d)};e._zod.run=(l,c)=>{if(c.skipChecks)return e._zod.parse(l,c);if(c.direction==="backward"){const f=e._zod.parse({value:l.value,issues:[]},{...c,skipChecks:!0});return f instanceof Promise?f.then(p=>a(p,l,c)):a(f,l,c)}const d=e._zod.parse(l,c);if(d instanceof Promise){if(c.async===!1)throw new Bu;return d.then(f=>i(f,r,c))}return i(d,r,c)}}Dt(e,"~standard",()=>({validate:i=>{try{const a=jY(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return NY(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),vk=ge("$ZodString",(e,t)=>{mn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??JY(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)=>{Pv.init(e,t),vk.init(e,t)}),vZ=ge("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=BY),dn.init(e,t)}),xZ=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=G2(r))}else t.pattern??(t.pattern=G2());dn.init(e,t)}),bZ=ge("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=UY),dn.init(e,t)}),wZ=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})}}}),SZ=ge("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=FY()),dn.init(e,t)}),jZ=ge("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=LY),dn.init(e,t)}),NZ=ge("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=PY),dn.init(e,t)}),kZ=ge("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=RY),dn.init(e,t)}),CZ=ge("$ZodULID",(e,t)=>{t.pattern??(t.pattern=DY),dn.init(e,t)}),AZ=ge("$ZodXID",(e,t)=>{t.pattern??(t.pattern=IY),dn.init(e,t)}),EZ=ge("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=MY),dn.init(e,t)}),OZ=ge("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=XY(t)),dn.init(e,t)}),_Z=ge("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=YY),dn.init(e,t)}),zZ=ge("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ZY(t)),dn.init(e,t)}),TZ=ge("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=$Y),dn.init(e,t)}),PZ=ge("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=HY),dn.init(e,t),e._zod.bag.format="ipv4"}),RZ=ge("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=KY),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})}}}),DZ=ge("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=GY),dn.init(e,t)}),IZ=ge("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=VY),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 l=Number(a);if(`${l}`!==a)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function _4(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const MZ=ge("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=QY),dn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{_4(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function LZ(e){if(!j4.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return _4(n)}const $Z=ge("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=j4),dn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{LZ(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),BZ=ge("$ZodE164",(e,t)=>{t.pattern??(t.pattern=WY),dn.init(e,t)});function UZ(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 qZ=ge("$ZodJWT",(e,t)=>{dn.init(e,t),e._zod.check=n=>{UZ(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),z4=ge("$ZodNumber",(e,t)=>{mn.init(e,t),e._zod.pattern=e._zod.bag.pattern??C4,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}}),FZ=ge("$ZodNumberFormat",(e,t)=>{aZ.init(e,t),z4.init(e,t)}),HZ=ge("$ZodBoolean",(e,t)=>{mn.init(e,t),e._zod.pattern=tZ,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}}),KZ=ge("$ZodUnknown",(e,t)=>{mn.init(e,t),e._zod.parse=n=>n}),GZ=ge("$ZodNever",(e,t)=>{mn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function V2(e,t,n){e.issues.length&&t.issues.push(...zu(n,e.issues)),t.value[n]=e.value}const VZ=ge("$ZodArray",(e,t)=>{mn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const a=[];for(let l=0;l<i.length;l++){const c=i[l],d=t.element._zod.run({value:c,issues:[]},r);d instanceof Promise?a.push(d.then(f=>V2(f,n,l))):V2(d,n,l)}return a.length?Promise.all(a).then(()=>n):n}});function ay(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...zu(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function T4(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=fY(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function P4(e,t,n,r,i,a){const l=[],c=i.keySet,d=i.catchall._zod,f=d.def.type,p=d.optout==="optional";for(const m in t){if(c.has(m))continue;if(f==="never"){l.push(m);continue}const y=d.run({value:t[m],issues:[]},r);y instanceof Promise?e.push(y.then(v=>ay(v,n,m,t,p))):ay(y,n,m,t,p)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const QZ=ge("$ZodObject",(e,t)=>{if(mn.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...c};return Object.defineProperty(t,"shape",{value:d}),d}})}const r=_v(()=>T4(t));Dt(e._zod,"propValues",()=>{const c=t.shape,d={};for(const f in c){const p=c[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=jh,a=t.catchall;let l;e._zod.parse=(c,d)=>{l??(l=r.value);const f=c.value;if(!i(f))return c.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),c;c.value={};const p=[],m=l.shape;for(const y of l.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=>ay(j,c,y,f,w))):ay(b,c,y,f,w)}return a?P4(p,f,c,d,r.value,e):p.length?Promise.all(p).then(()=>c):c}}),WZ=ge("$ZodObjectJIT",(e,t)=>{QZ.init(e,t);const n=e._zod.parse,r=_v(()=>T4(t)),i=y=>{const v=new gZ(["shape","payload","ctx"]),w=r.value,b=O=>{const C=K2(O);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};v.write("const input = payload.value;");const j=Object.create(null);let k=0;for(const O of w.keys)j[O]=`key_${k++}`;v.write("const newResult = {};");for(const O of w.keys){const C=j[O],z=K2(O),_=y[O]?._zod?.optout==="optional";v.write(`const ${C} = ${b(O)};`),_?v.write(`
|
|
12
|
-
if (${C}.issues.length) {
|
|
13
|
-
if (${z} in input) {
|
|
14
|
-
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
15
|
-
...iss,
|
|
16
|
-
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
17
|
-
})));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (${C}.value === undefined) {
|
|
22
|
-
if (${z} in input) {
|
|
23
|
-
newResult[${z}] = undefined;
|
|
24
|
-
}
|
|
25
|
-
} else {
|
|
26
|
-
newResult[${z}] = ${C}.value;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
`):v.write(`
|
|
30
|
-
if (${C}.issues.length) {
|
|
31
|
-
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
32
|
-
...iss,
|
|
33
|
-
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
34
|
-
})));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (${C}.value === undefined) {
|
|
38
|
-
if (${z} in input) {
|
|
39
|
-
newResult[${z}] = undefined;
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
newResult[${z}] = ${C}.value;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
`)}v.write("payload.value = newResult;"),v.write("return payload;");const E=v.compile();return(O,C)=>E(y,O,C)};let a;const l=jh,c=!g4.jitless,f=c&&uY.value,p=t.catchall;let m;e._zod.parse=(y,v)=>{m??(m=r.value);const w=y.value;return l(w)?c&&f&&v?.async===!1&&v.jitless!==!0?(a||(a=i(t.shape)),y=a(y,v),p?P4([],w,y,v,m,e):y):n(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),y)}});function Q2(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=>!_u(a));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(l=>$o(l,r,Lo())))}),t)}const R4=ge("$ZodUnion",(e,t)=>{mn.init(e,t),Dt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Dt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Dt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Dt(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=>pk(a.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let l=!1;const c=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},a);if(f instanceof Promise)c.push(f),l=!0;else{if(f.issues.length===0)return f;c.push(f)}}return l?Promise.all(c).then(d=>Q2(d,i,e,a)):Q2(c,i,e,a)}}),YZ=ge("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,R4.init(e,t);const n=e._zod.parse;Dt(e._zod,"propValues",()=>{const i={};for(const a of t.options){const l=a._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const[c,d]of Object.entries(l)){i[c]||(i[c]=new Set);for(const f of d)i[c].add(f)}}return i});const r=_v(()=>{const i=t.options,a=new Map;for(const l of i){const c=l._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const d of c){if(a.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);a.set(d,l)}}return a});e._zod.parse=(i,a)=>{const l=i.value;if(!jh(l))return i.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),i;const c=r.value.get(l?.[t.discriminator]);return c?c._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),i)}}),ZZ=ge("$ZodIntersection",(e,t)=>{mn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},r),l=t.right._zod.run({value:i,issues:[]},r);return a instanceof Promise||l instanceof Promise?Promise.all([a,l]).then(([d,f])=>W2(n,d,f)):W2(n,a,l)}});function f1(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(ed(e)&&ed(t)){const n=Object.keys(t),r=Object.keys(e).filter(a=>n.indexOf(a)!==-1),i={...e,...t};for(const a of r){const l=f1(e[a],t[a]);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};i[a]=l.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],a=t[r],l=f1(i,a);if(!l.valid)return{valid:!1,mergeErrorPath:[r,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function W2(e,t,n){const r=new Map;let i;for(const c of t.issues)if(c.code==="unrecognized_keys"){i??(i=c);for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(c);for(const c of n.issues)if(c.code==="unrecognized_keys")for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(c);const a=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(a.length&&i&&e.issues.push({...i,keys:a}),_u(e))return e;const l=f1(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const XZ=ge("$ZodRecord",(e,t)=>{mn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!ed(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],l=t.keyType._zod.values;if(l){n.value={};const c=new Set;for(const f of l)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){c.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(...zu(f,m.issues)),n.value[f]=m.value})):(p.issues.length&&n.issues.push(...zu(f,p.issues)),n.value[f]=p.value)}let d;for(const f in i)c.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 c of Reflect.ownKeys(i)){if(c==="__proto__")continue;let d=t.keyType._zod.run({value:c,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&C4.test(c)&&d.issues.length){const m=t.keyType._zod.run({value:Number(c),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[c]=i[c]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>$o(m,r,Lo())),input:c,path:[c],inst:e});continue}const p=t.valueType._zod.run({value:i[c],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...zu(c,m.issues)),n.value[d.value]=m.value})):(p.issues.length&&n.issues.push(...zu(c,p.issues)),n.value[d.value]=p.value)}}return a.length?Promise.all(a).then(()=>n):n}}),JZ=ge("$ZodEnum",(e,t)=>{mn.init(e,t);const n=y4(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>dY.has(typeof i)).map(i=>typeof i=="string"?td(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const l=i.value;return r.has(l)||i.issues.push({code:"invalid_value",values:n,input:l,inst:e}),i}}),eX=ge("$ZodLiteral",(e,t)=>{if(mn.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"?td(r):r?td(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}}),tX=ge("$ZodTransform",(e,t)=>{mn.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new m4(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(n.value=l,n));if(i instanceof Promise)throw new Bu;return n.value=i,n}});function Y2(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const D4=ge("$ZodOptional",(e,t)=>{mn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Dt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Dt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${pk(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=>Y2(a,n.value)):Y2(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),nX=ge("$ZodExactOptional",(e,t)=>{D4.init(e,t),Dt(e._zod,"values",()=>t.innerType._zod.values),Dt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),rX=ge("$ZodNullable",(e,t)=>{mn.init(e,t),Dt(e._zod,"optin",()=>t.innerType._zod.optin),Dt(e._zod,"optout",()=>t.innerType._zod.optout),Dt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${pk(n.source)}|null)$`):void 0}),Dt(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)}),iX=ge("$ZodDefault",(e,t)=>{mn.init(e,t),e._zod.optin="optional",Dt(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 aX=ge("$ZodPrefault",(e,t)=>{mn.init(e,t),e._zod.optin="optional",Dt(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))}),sX=ge("$ZodNonOptional",(e,t)=>{mn.init(e,t),Dt(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=>X2(a,e)):X2(i,e)}});function X2(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 oX=ge("$ZodCatch",(e,t)=>{mn.init(e,t),Dt(e._zod,"optin",()=>t.innerType._zod.optin),Dt(e._zod,"optout",()=>t.innerType._zod.optout),Dt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(l=>$o(l,r,Lo()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>$o(a,r,Lo()))},input:n.value}),n.issues=[]),n)}}),lX=ge("$ZodPipe",(e,t)=>{mn.init(e,t),Dt(e._zod,"values",()=>t.in._zod.values),Dt(e._zod,"optin",()=>t.in._zod.optin),Dt(e._zod,"optout",()=>t.out._zod.optout),Dt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const a=t.out._zod.run(n,r);return a instanceof Promise?a.then(l=>$m(l,t.in,r)):$m(a,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>$m(a,t.out,r)):$m(i,t.out,r)}});function $m(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const cX=ge("$ZodReadonly",(e,t)=>{mn.init(e,t),Dt(e._zod,"propValues",()=>t.innerType._zod.propValues),Dt(e._zod,"values",()=>t.innerType._zod.values),Dt(e._zod,"optin",()=>t.innerType?._zod?.optin),Dt(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(J2):J2(i)}});function J2(e){return e.value=Object.freeze(e.value),e}const uX=ge("$ZodCustom",(e,t)=>{di.init(e,t),mn.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=>eT(a,n,r,e));eT(i,n,r,e)}});function eT(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(Nh(i))}}var tT;class dX{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 fX(){return new dX}(tT=globalThis).__zod_globalRegistry??(tT.__zod_globalRegistry=fX());const Jf=globalThis.__zod_globalRegistry;function hX(e,t){return new e({type:"string",...Ke(t)})}function pX(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ke(t)})}function nT(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ke(t)})}function mX(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ke(t)})}function gX(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ke(t)})}function yX(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ke(t)})}function vX(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ke(t)})}function xX(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ke(t)})}function bX(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ke(t)})}function wX(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ke(t)})}function SX(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ke(t)})}function jX(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ke(t)})}function NX(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ke(t)})}function kX(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ke(t)})}function CX(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ke(t)})}function AX(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ke(t)})}function EX(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ke(t)})}function OX(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ke(t)})}function _X(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ke(t)})}function zX(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ke(t)})}function TX(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ke(t)})}function PX(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ke(t)})}function RX(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ke(t)})}function DX(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ke(t)})}function IX(e,t){return new e({type:"string",format:"date",check:"string_format",...Ke(t)})}function MX(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ke(t)})}function LX(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ke(t)})}function $X(e,t){return new e({type:"number",checks:[],...Ke(t)})}function BX(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ke(t)})}function UX(e,t){return new e({type:"boolean",...Ke(t)})}function qX(e){return new e({type:"unknown"})}function FX(e,t){return new e({type:"never",...Ke(t)})}function rT(e,t){return new E4({check:"less_than",...Ke(t),value:e,inclusive:!1})}function _w(e,t){return new E4({check:"less_than",...Ke(t),value:e,inclusive:!0})}function iT(e,t){return new O4({check:"greater_than",...Ke(t),value:e,inclusive:!1})}function zw(e,t){return new O4({check:"greater_than",...Ke(t),value:e,inclusive:!0})}function aT(e,t){return new iZ({check:"multiple_of",...Ke(t),value:e})}function I4(e,t){return new sZ({check:"max_length",...Ke(t),maximum:e})}function sy(e,t){return new oZ({check:"min_length",...Ke(t),minimum:e})}function M4(e,t){return new lZ({check:"length_equals",...Ke(t),length:e})}function HX(e,t){return new cZ({check:"string_format",format:"regex",...Ke(t),pattern:e})}function KX(e){return new uZ({check:"string_format",format:"lowercase",...Ke(e)})}function GX(e){return new dZ({check:"string_format",format:"uppercase",...Ke(e)})}function VX(e,t){return new fZ({check:"string_format",format:"includes",...Ke(t),includes:e})}function QX(e,t){return new hZ({check:"string_format",format:"starts_with",...Ke(t),prefix:e})}function WX(e,t){return new pZ({check:"string_format",format:"ends_with",...Ke(t),suffix:e})}function vd(e){return new mZ({check:"overwrite",tx:e})}function YX(e){return vd(t=>t.normalize(e))}function ZX(){return vd(e=>e.trim())}function XX(){return vd(e=>e.toLowerCase())}function JX(){return vd(e=>e.toUpperCase())}function eJ(){return vd(e=>cY(e))}function tJ(e,t,n){return new e({type:"array",element:t,...Ke(n)})}function nJ(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ke(n)})}function rJ(e){const t=iJ(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Nh(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(Nh(i))}},e(n.value,n)));return t}function iJ(e,t){const n=new di({check:"custom",...Ke(t)});return n._zod.check=e,n}function L4(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??Jf,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 l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const c=e._zod.toJSONSchema?.();if(c)l.schema=c;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,p);else{const y=l.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&&(l.ref||(l.ref=m),Ln(m,t,p),t.seen.get(m).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&$r(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((r=l.schema).default??(r.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function $4(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const l of e.seen.entries()){const c=e.metadataRegistry.get(l[0])?.id;if(c){const d=r.get(c);if(d&&d!==l[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,l[0])}}const i=l=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(l[0])?.id,y=e.external.uri??(w=>w);if(m)return{ref:y(m)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${y("__shared")}#/${c}/${v}`}}if(l[1]===n)return{ref:"#"};const f=`#/${c}/`,p=l[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},a=l=>{if(l[1].schema.$ref)return;const c=l[1],{ref:d,defId:f}=i(l);c.def={...c.schema},f&&(c.defId=f);const p=c.schema;for(const m in p)delete p[m];p.$ref=d};if(e.cycles==="throw")for(const l of e.seen.entries()){const c=l[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
46
|
-
|
|
47
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const c=l[1];if(t===l[0]){a(l);continue}if(e.external){const f=e.external.registry.get(l[0])?.id;if(t!==l[0]&&f){a(l);continue}}if(e.metadataRegistry.get(l[0])?.id){a(l);continue}if(c.cycle){a(l);continue}if(c.count>1&&e.reused==="ref"){a(l);continue}}}function B4(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const c=e.seen.get(l);if(c.ref===null)return;const d=c.def??c.schema,f={...d},p=c.ref;if(c.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),l._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=l._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:l,jsonSchema:d,path:c.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(l)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const l of e.seen.entries()){const c=l[1];c.def&&c.defId&&(a[c.defId]=c.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:oy(t,"input",e.processors),output:oy(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function $r(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return $r(r.element,n);if(r.type==="set")return $r(r.valueType,n);if(r.type==="lazy")return $r(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return $r(r.innerType,n);if(r.type==="intersection")return $r(r.left,n)||$r(r.right,n);if(r.type==="record"||r.type==="map")return $r(r.keyType,n)||$r(r.valueType,n);if(r.type==="pipe")return $r(r.in,n)||$r(r.out,n);if(r.type==="object"){for(const i in r.shape)if($r(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if($r(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if($r(i,n))return!0;return!!(r.rest&&$r(r.rest,n))}return!1}const aJ=(e,t={})=>n=>{const r=L4({...n,processors:t});return Ln(e,r),$4(r,e),B4(r,e)},oy=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},l=L4({...i??{},target:a,io:t,processors:n});return Ln(e,l),$4(l,e),B4(l,e)},sJ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},oJ=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:a,maximum:l,format:c,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof l=="number"&&(i.maxLength=l),c&&(i.format=sJ[c]??c,i.format===""&&delete i.format,c==="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}))])}},lJ=(e,t,n,r)=>{const i=n,{minimum:a,maximum:l,format:c,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:p}=e._zod.bag;typeof c=="string"&&c.includes("int")?i.type="integer":i.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=p,i.exclusiveMinimum=!0):i.exclusiveMinimum=p),typeof a=="number"&&(i.minimum=a,typeof p=="number"&&t.target!=="draft-04"&&(p>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=f,i.exclusiveMaximum=!0):i.exclusiveMaximum=f),typeof l=="number"&&(i.maximum=l,typeof f=="number"&&t.target!=="draft-04"&&(f<=l?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},cJ=(e,t,n,r)=>{n.type="boolean"},uJ=(e,t,n,r)=>{n.not={}},dJ=(e,t,n,r)=>{},fJ=(e,t,n,r)=>{const i=e._zod.def,a=y4(i.entries);a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),n.enum=a},hJ=(e,t,n,r)=>{const i=e._zod.def,a=[];for(const l of i.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(l))}else a.push(l);if(a.length!==0)if(a.length===1){const l=a[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),a.every(l=>typeof l=="boolean")&&(n.type="boolean"),a.every(l=>l===null)&&(n.type="null"),n.enum=a},pJ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},mJ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},gJ=(e,t,n,r)=>{const i=n,a=e._zod.def,{minimum:l,maximum:c}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof c=="number"&&(i.maxItems=c),i.type="array",i.items=Ln(a.element,t,{...r,path:[...r.path,"items"]})},yJ=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const l=a.shape;for(const f in l)i.properties[f]=Ln(l[f],t,{...r,path:[...r.path,"properties",f]});const c=new Set(Object.keys(l)),d=new Set([...c].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)},vJ=(e,t,n,r)=>{const i=e._zod.def,a=i.inclusive===!1,l=i.options.map((c,d)=>Ln(c,t,{...r,path:[...r.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=l:n.anyOf=l},xJ=(e,t,n,r)=>{const i=e._zod.def,a=Ln(i.left,t,{...r,path:[...r.path,"allOf",0]}),l=Ln(i.right,t,{...r,path:[...r.path,"allOf",1]}),c=f=>"allOf"in f&&Object.keys(f).length===1,d=[...c(a)?a.allOf:[a],...c(l)?l.allOf:[l]];n.allOf=d},bJ=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object";const l=a.keyType,d=l._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){const p=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=l._zod.values;if(f){const p=[...f].filter(m=>typeof m=="string"||typeof m=="number");p.length>0&&(i.required=p)}},wJ=(e,t,n,r)=>{const i=e._zod.def,a=Ln(i.innerType,t,r),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},SJ=(e,t,n,r)=>{const i=e._zod.def;Ln(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},jJ=(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))},NJ=(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)))},kJ=(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 l;try{l=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},CJ=(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 l=t.seen.get(e);l.ref=a},AJ=(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},U4=(e,t,n,r)=>{const i=e._zod.def;Ln(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},EJ=ge("ZodISODateTime",(e,t)=>{OZ.init(e,t),yn.init(e,t)});function OJ(e){return DX(EJ,e)}const _J=ge("ZodISODate",(e,t)=>{_Z.init(e,t),yn.init(e,t)});function zJ(e){return IX(_J,e)}const TJ=ge("ZodISOTime",(e,t)=>{zZ.init(e,t),yn.init(e,t)});function PJ(e){return MX(TJ,e)}const RJ=ge("ZodISODuration",(e,t)=>{TZ.init(e,t),yn.init(e,t)});function DJ(e){return LX(RJ,e)}const IJ=(e,t)=>{w4.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>SY(e,n)},flatten:{value:n=>wY(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,d1,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,d1,2)}},isEmpty:{get(){return e.issues.length===0}}})},Xi=ge("ZodError",IJ,{Parent:Error}),MJ=gk(Xi),LJ=yk(Xi),$J=zv(Xi),BJ=Tv(Xi),UJ=kY(Xi),qJ=CY(Xi),FJ=AY(Xi),HJ=EY(Xi),KJ=OY(Xi),GJ=_Y(Xi),VJ=zY(Xi),QJ=TY(Xi),gn=ge("ZodType",(e,t)=>(mn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:oy(e,"input"),output:oy(e,"output")}}),e.toJSONSchema=aJ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Go(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)=>Vo(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>MJ(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>$J(e,n,r),e.parseAsync=async(n,r)=>LJ(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>BJ(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>UJ(e,n,r),e.decode=(n,r)=>qJ(e,n,r),e.encodeAsync=async(n,r)=>FJ(e,n,r),e.decodeAsync=async(n,r)=>HJ(e,n,r),e.safeEncode=(n,r)=>KJ(e,n,r),e.safeDecode=(n,r)=>GJ(e,n,r),e.safeEncodeAsync=async(n,r)=>VJ(e,n,r),e.safeDecodeAsync=async(n,r)=>QJ(e,n,r),e.refine=(n,r)=>e.check(Uee(n,r)),e.superRefine=n=>e.check(qee(n)),e.overwrite=n=>e.check(vd(n)),e.optional=()=>lT(e),e.exactOptional=()=>Eee(e),e.nullable=()=>cT(e),e.nullish=()=>lT(cT(e)),e.nonoptional=n=>Ree(e,n),e.array=()=>we(e),e.or=n=>K4([e,n]),e.and=n=>See(e,n),e.transform=n=>uT(e,Cee(n)),e.default=n=>zee(e,n),e.prefault=n=>Pee(e,n),e.catch=n=>Iee(e,n),e.pipe=n=>uT(e,n),e.readonly=()=>$ee(e),e.describe=n=>{const r=e.clone();return Jf.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Jf.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Jf.get(e);const r=e.clone();return Jf.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),q4=ge("_ZodString",(e,t)=>{vk.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>oJ(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(HX(...r)),e.includes=(...r)=>e.check(VX(...r)),e.startsWith=(...r)=>e.check(QX(...r)),e.endsWith=(...r)=>e.check(WX(...r)),e.min=(...r)=>e.check(sy(...r)),e.max=(...r)=>e.check(I4(...r)),e.length=(...r)=>e.check(M4(...r)),e.nonempty=(...r)=>e.check(sy(1,...r)),e.lowercase=r=>e.check(KX(r)),e.uppercase=r=>e.check(GX(r)),e.trim=()=>e.check(ZX()),e.normalize=(...r)=>e.check(YX(...r)),e.toLowerCase=()=>e.check(XX()),e.toUpperCase=()=>e.check(JX()),e.slugify=()=>e.check(eJ())}),WJ=ge("ZodString",(e,t)=>{vk.init(e,t),q4.init(e,t),e.email=n=>e.check(pX(YJ,n)),e.url=n=>e.check(xX(ZJ,n)),e.jwt=n=>e.check(RX(fee,n)),e.emoji=n=>e.check(bX(XJ,n)),e.guid=n=>e.check(nT(sT,n)),e.uuid=n=>e.check(mX(Bm,n)),e.uuidv4=n=>e.check(gX(Bm,n)),e.uuidv6=n=>e.check(yX(Bm,n)),e.uuidv7=n=>e.check(vX(Bm,n)),e.nanoid=n=>e.check(wX(JJ,n)),e.guid=n=>e.check(nT(sT,n)),e.cuid=n=>e.check(SX(eee,n)),e.cuid2=n=>e.check(jX(tee,n)),e.ulid=n=>e.check(NX(nee,n)),e.base64=n=>e.check(zX(cee,n)),e.base64url=n=>e.check(TX(uee,n)),e.xid=n=>e.check(kX(ree,n)),e.ksuid=n=>e.check(CX(iee,n)),e.ipv4=n=>e.check(AX(aee,n)),e.ipv6=n=>e.check(EX(see,n)),e.cidrv4=n=>e.check(OX(oee,n)),e.cidrv6=n=>e.check(_X(lee,n)),e.e164=n=>e.check(PX(dee,n)),e.datetime=n=>e.check(OJ(n)),e.date=n=>e.check(zJ(n)),e.time=n=>e.check(PJ(n)),e.duration=n=>e.check(DJ(n))});function P(e){return hX(WJ,e)}const yn=ge("ZodStringFormat",(e,t)=>{dn.init(e,t),q4.init(e,t)}),YJ=ge("ZodEmail",(e,t)=>{bZ.init(e,t),yn.init(e,t)}),sT=ge("ZodGUID",(e,t)=>{vZ.init(e,t),yn.init(e,t)}),Bm=ge("ZodUUID",(e,t)=>{xZ.init(e,t),yn.init(e,t)}),ZJ=ge("ZodURL",(e,t)=>{wZ.init(e,t),yn.init(e,t)}),XJ=ge("ZodEmoji",(e,t)=>{SZ.init(e,t),yn.init(e,t)}),JJ=ge("ZodNanoID",(e,t)=>{jZ.init(e,t),yn.init(e,t)}),eee=ge("ZodCUID",(e,t)=>{NZ.init(e,t),yn.init(e,t)}),tee=ge("ZodCUID2",(e,t)=>{kZ.init(e,t),yn.init(e,t)}),nee=ge("ZodULID",(e,t)=>{CZ.init(e,t),yn.init(e,t)}),ree=ge("ZodXID",(e,t)=>{AZ.init(e,t),yn.init(e,t)}),iee=ge("ZodKSUID",(e,t)=>{EZ.init(e,t),yn.init(e,t)}),aee=ge("ZodIPv4",(e,t)=>{PZ.init(e,t),yn.init(e,t)}),see=ge("ZodIPv6",(e,t)=>{RZ.init(e,t),yn.init(e,t)}),oee=ge("ZodCIDRv4",(e,t)=>{DZ.init(e,t),yn.init(e,t)}),lee=ge("ZodCIDRv6",(e,t)=>{IZ.init(e,t),yn.init(e,t)}),cee=ge("ZodBase64",(e,t)=>{MZ.init(e,t),yn.init(e,t)}),uee=ge("ZodBase64URL",(e,t)=>{$Z.init(e,t),yn.init(e,t)}),dee=ge("ZodE164",(e,t)=>{BZ.init(e,t),yn.init(e,t)}),fee=ge("ZodJWT",(e,t)=>{qZ.init(e,t),yn.init(e,t)}),F4=ge("ZodNumber",(e,t)=>{z4.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>lJ(e,r,i),e.gt=(r,i)=>e.check(iT(r,i)),e.gte=(r,i)=>e.check(zw(r,i)),e.min=(r,i)=>e.check(zw(r,i)),e.lt=(r,i)=>e.check(rT(r,i)),e.lte=(r,i)=>e.check(_w(r,i)),e.max=(r,i)=>e.check(_w(r,i)),e.int=r=>e.check(oT(r)),e.safe=r=>e.check(oT(r)),e.positive=r=>e.check(iT(0,r)),e.nonnegative=r=>e.check(zw(0,r)),e.negative=r=>e.check(rT(0,r)),e.nonpositive=r=>e.check(_w(0,r)),e.multipleOf=(r,i)=>e.check(aT(r,i)),e.step=(r,i)=>e.check(aT(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 ne(e){return $X(F4,e)}const hee=ge("ZodNumberFormat",(e,t)=>{FZ.init(e,t),F4.init(e,t)});function oT(e){return BX(hee,e)}const pee=ge("ZodBoolean",(e,t)=>{HZ.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>cJ(e,n,r)});function ot(e){return UX(pee,e)}const mee=ge("ZodUnknown",(e,t)=>{KZ.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dJ()});function Wl(){return qX(mee)}const gee=ge("ZodNever",(e,t)=>{GZ.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uJ(e,n,r)});function yee(e){return FX(gee,e)}const vee=ge("ZodArray",(e,t)=>{VZ.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gJ(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(sy(n,r)),e.nonempty=n=>e.check(sy(1,n)),e.max=(n,r)=>e.check(I4(n,r)),e.length=(n,r)=>e.check(M4(n,r)),e.unwrap=()=>e.element});function we(e,t){return tJ(vee,e,t)}const xee=ge("ZodObject",(e,t)=>{WZ.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yJ(e,n,r,i),Dt(e,"shape",()=>t.shape),e.keyof=()=>He(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Wl()}),e.loose=()=>e.clone({...e._zod.def,catchall:Wl()}),e.strict=()=>e.clone({...e._zod.def,catchall:yee()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>gY(e,n),e.safeExtend=n=>yY(e,n),e.merge=n=>vY(e,n),e.pick=n=>pY(e,n),e.omit=n=>mY(e,n),e.partial=(...n)=>xY(V4,e,n[0]),e.required=(...n)=>bY(Q4,e,n[0])});function oe(e,t){const n={type:"object",shape:e??{},...Ke(t)};return new xee(n)}const H4=ge("ZodUnion",(e,t)=>{R4.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vJ(e,n,r,i),e.options=t.options});function K4(e,t){return new H4({type:"union",options:e,...Ke(t)})}const bee=ge("ZodDiscriminatedUnion",(e,t)=>{H4.init(e,t),YZ.init(e,t)});function G4(e,t,n){return new bee({type:"union",options:t,discriminator:e,...Ke(n)})}const wee=ge("ZodIntersection",(e,t)=>{ZZ.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>xJ(e,n,r,i)});function See(e,t){return new wee({type:"intersection",left:e,right:t})}const jee=ge("ZodRecord",(e,t)=>{XZ.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bJ(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function Va(e,t,n){return new jee({type:"record",keyType:e,valueType:t,...Ke(n)})}const h1=ge("ZodEnum",(e,t)=>{JZ.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>fJ(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const a={};for(const l of r)if(n.has(l))a[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new h1({...t,checks:[],...Ke(i),entries:a})},e.exclude=(r,i)=>{const a={...t.entries};for(const l of r)if(n.has(l))delete a[l];else throw new Error(`Key ${l} not found in enum`);return new h1({...t,checks:[],...Ke(i),entries:a})}});function He(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new h1({type:"enum",entries:n,...Ke(t)})}const Nee=ge("ZodLiteral",(e,t)=>{eX.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hJ(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 Kr(e,t){return new Nee({type:"literal",values:Array.isArray(e)?e:[e],...Ke(t)})}const kee=ge("ZodTransform",(e,t)=>{tX.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>mJ(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new m4(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(Nh(a,n.value,t));else{const l=a;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Nh(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function Cee(e){return new kee({type:"transform",transform:e})}const V4=ge("ZodOptional",(e,t)=>{D4.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>U4(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function lT(e){return new V4({type:"optional",innerType:e})}const Aee=ge("ZodExactOptional",(e,t)=>{nX.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>U4(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Eee(e){return new Aee({type:"optional",innerType:e})}const Oee=ge("ZodNullable",(e,t)=>{rX.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function cT(e){return new Oee({type:"nullable",innerType:e})}const _ee=ge("ZodDefault",(e,t)=>{iX.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>jJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zee(e,t){return new _ee({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():x4(t)}})}const Tee=ge("ZodPrefault",(e,t)=>{aX.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>NJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Pee(e,t){return new Tee({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():x4(t)}})}const Q4=ge("ZodNonOptional",(e,t)=>{sX.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>SJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Ree(e,t){return new Q4({type:"nonoptional",innerType:e,...Ke(t)})}const Dee=ge("ZodCatch",(e,t)=>{oX.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>kJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Iee(e,t){return new Dee({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Mee=ge("ZodPipe",(e,t)=>{lX.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>CJ(e,n,r,i),e.in=t.in,e.out=t.out});function uT(e,t){return new Mee({type:"pipe",in:e,out:t})}const Lee=ge("ZodReadonly",(e,t)=>{cX.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>AJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function $ee(e){return new Lee({type:"readonly",innerType:e})}const Bee=ge("ZodCustom",(e,t)=>{uX.init(e,t),gn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pJ(e,n)});function Uee(e,t={}){return nJ(Bee,e,t)}function qee(e){return rJ(e)}oe({maxConcurrency:ne().int().positive(),maxRequestsPerMinute:ne().int().positive(),maxRequestsPerDay:ne().int().positive()});const Ps=P().min(1);P().min(1);const xk=oe({label:P().min(1),city:P().min(1),region:P().min(1),country:P().length(2),timezone:P().optional()}),bk=He(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);oe({id:P(),projectId:P(),channel:Kr("webhook"),url:P().url(),urlDisplay:P(),urlHost:P(),events:we(bk),enabled:ot().default(!0),source:P().optional(),webhookSecret:P().optional(),createdAt:P(),updatedAt:P()});oe({channel:Kr("webhook"),url:P().url(),events:we(bk).min(1),source:P().optional()});const W4=He(["cli","api","config-file"]);function Fee(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 Hee(e,t){return t?e.some(n=>n.label===t):!0}oe({displayName:P().min(1),canonicalDomain:P().min(1),ownedDomains:we(P().min(1)).optional(),country:P().length(2),language:P().min(2),tags:we(P()).optional(),labels:Va(P(),P()).optional(),providers:we(Ps).optional(),locations:we(xk).optional(),defaultLocation:P().nullable().optional(),autoExtractBacklinks:ot().optional(),configSource:W4.optional()});oe({id:P(),name:P(),displayName:P().optional(),canonicalDomain:P(),ownedDomains:we(P()).default([]),country:P().length(2),language:P().min(2),tags:we(P()).default([]),labels:Va(P(),P()).default({}),locations:we(xk).default([]),defaultLocation:P().nullable().optional(),autoExtractBacklinks:ot().default(!1),configSource:W4.default("cli"),configRevision:ne().int().positive().default(1),createdAt:P().optional(),updatedAt:P().optional()});oe({id:P(),query:P(),createdAt:P()});oe({id:P(),keyword:P(),createdAt:P()});oe({queries:we(P().trim().min(1)).min(1)});oe({keywords:we(P().trim().min(1)).min(1)});oe({provider:Ps,count:ne().int().min(1).max(20).optional()});oe({id:P(),domain:P(),createdAt:P()});oe({competitors:we(P().trim().min(1)).min(1)});function ly(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}const Kee=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 Gee(e){const t=ly(e);if(!t)return"";const n=t.split("/")[0]?.split(":")[0]??"";if(!n)return"";const r=n.split(".").filter(Boolean);if(r.length<2)return"";if(r.length===2)return r.join(".");const i=r.slice(-2).join(".");return Kee.has(i)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function Vee(e){const t=Gee(e);return t?t.split(".")[0]??"":""}function Qee(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],n=new Set,r=[];for(const i of t){const a=i.trim();if(!a)continue;const l=ly(a);n.has(l)||(n.add(l),r.push(a))}return r}const Wee=oe({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:Va(P(),P()).optional().default({})}),Yee=oe({preset:P().optional(),cron:P().optional(),timezone:P().optional().default("UTC"),providers:we(Ps).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),Zee=oe({channel:Kr("webhook"),url:P().url(),events:we(bk).min(1)}),Xee=oe({gsc:oe({propertyUrl:P()}).optional(),syncSchedule:oe({preset:P().optional(),cron:P().optional()}).optional()}).optional(),dT=we(P().min(1)),Jee=oe({displayName:P().min(1),canonicalDomain:P().min(1),ownedDomains:we(P().min(1)).optional().default([]),country:P().length(2),language:P().min(2),queries:dT.optional(),keywords:dT.optional(),competitors:we(P().min(1)).optional().default([]),providers:we(Ps).optional().default([]),locations:we(xk).optional().default([]),defaultLocation:P().optional(),schedule:Yee,notifications:we(Zee).optional().default([]),google:Xee,autoExtractBacklinks:ot().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=Fee(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),Hee(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});oe({apiVersion:Kr("canonry/v1"),kind:Kr("Project"),metadata:Wee,spec:Jee});const ete=He(["gsc","ga4"]);oe({id:P(),domain:P(),connectionType:ete,propertyId:P().nullable().optional(),sitemapUrl:P().nullable().optional(),scopes:we(P()).default([]),createdAt:P(),updatedAt:P()});oe({date:P(),query:P(),page:P(),country:P().nullable().optional(),device:P().nullable().optional(),clicks:ne(),impressions:ne(),ctr:ne(),position:ne()});const p1=oe({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:ot().nullable().optional(),richResults:we(P()).default([]),inspectedAt:P()});He(["stable","reindexed","deindexed","still-missing","new"]);const tte=oe({url:P(),previousState:P().nullable(),currentState:P().nullable(),transitionDate:P()}),nte=oe({reason:P(),count:ne(),urls:we(p1).default([])});oe({summary:oe({total:ne(),indexed:ne(),notIndexed:ne(),deindexed:ne(),percentage:ne()}),lastInspectedAt:P().nullable(),lastSyncedAt:P().nullable(),indexed:we(p1).default([]),notIndexed:we(p1).default([]),deindexed:we(tte).default([]),reasonGroups:we(nte).default([])});oe({url:P(),type:He(["URL_UPDATED","URL_DELETED"]),notifiedAt:P()});oe({url:P(),type:He(["URL_UPDATED","URL_DELETED"]),notifiedAt:P(),status:He(["success","error"]),error:P().optional()});oe({date:P(),indexed:ne(),notIndexed:ne(),reasonBreakdown:Va(P(),ne()).default({})});oe({id:P(),domain:P(),siteUrl:P().nullable().optional(),createdAt:P(),updatedAt:P()});const Tw=oe({id:P(),url:P(),httpCode:ne().nullable().optional(),inIndex:ot().nullable().optional(),lastCrawledDate:P().nullable().optional(),inIndexDate:P().nullable().optional(),inspectedAt:P(),documentSize:ne().nullable().optional(),anchorCount:ne().nullable().optional(),discoveryDate:P().nullable().optional()});oe({summary:oe({total:ne(),indexed:ne(),notIndexed:ne(),unknown:ne().optional(),percentage:ne()}),lastInspectedAt:P().nullable(),indexed:we(Tw).default([]),notIndexed:we(Tw).default([]),unknown:we(Tw).default([]).optional()});oe({query:P(),impressions:ne(),clicks:ne(),ctr:ne(),averagePosition:ne()});oe({date:P(),indexed:ne(),notIndexed:ne(),unknown:ne()});oe({url:P(),status:He(["success","error"]),submittedAt:P(),error:P().optional()});const xd=He(["live","staging"]);oe({projectName:P(),url:P(),stagingUrl:P().optional(),username:P(),defaultEnv:xd,createdAt:P(),updatedAt:P()});const fT=oe({url:P(),reachable:ot(),pageCount:ne().nullable().optional(),version:P().nullable().optional(),error:P().nullable().optional(),plugins:we(P()).optional(),authenticatedUser:oe({id:ne(),slug:P()}).nullable().optional()});oe({connected:ot(),projectName:P(),defaultEnv:xd,live:fT.nullable(),staging:fT.nullable(),adminUrl:P().nullable().optional()});const rte=oe({id:ne(),slug:P(),title:P(),status:P(),modifiedAt:P().nullable().optional(),link:P().nullable().optional()}),Y4=oe({title:P().nullable(),description:P().nullable(),noindex:ot().nullable(),writable:ot().default(!1),writeTargets:we(P()).default([])}),ite=oe({type:P(),json:Va(P(),Wl())}),ate=rte.extend({env:xd,content:P(),seo:Y4,schemaBlocks:we(ite).default([])}),hT=ate.extend({contentHash:P(),contentSnippet:P()}),Z4=oe({manualRequired:Kr(!0),targetUrl:P(),adminUrl:P().nullable().optional(),content:P(),nextSteps:we(P()).default([])}),ste=oe({slug:P(),severity:He(["high","medium","low"]),code:He(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:P()});oe({slug:P(),title:P(),status:P(),wordCount:ne(),seo:Y4,schemaPresent:ot(),issues:we(ste).default([])});const ote=oe({slug:P(),status:He(["applied","skipped","manual"]),error:P().optional(),manualAssist:Z4.optional()});oe({env:xd,strategy:He(["plugin","manual"]),results:we(ote)});const lte=oe({slug:P(),status:He(["deployed","stripped","skipped","failed"]),schemasInjected:we(P()).optional(),manualAssist:Z4.optional(),error:P().optional()});oe({env:xd,results:we(lte)});const cte=oe({slug:P(),title:P(),canonrySchemas:we(P()),thirdPartySchemas:we(P()),hasCanonrySchema:ot()});oe({env:xd,pages:we(cte)});const ute=oe({name:P(),status:He(["completed","skipped","failed"]),summary:P().optional(),error:P().optional()});oe({projectName:P(),steps:we(ute)});oe({slug:P(),live:hT,staging:hT,hasDifferences:ot(),differences:oe({title:ot(),slug:ot(),content:ot(),seoTitle:ot(),seoDescription:ot(),noindex:ot(),schema:ot()})});const Rv=He(["queued","running","completed","partial","failed","cancelled"]),pr=Rv.enum,X4=He(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","bing-inspect-sitemap","backlink-extract","traffic-sync","aeo-discover-seed","aeo-discover-probe"]),ht=X4.enum,J4=He(["manual","scheduled","config-apply","backfill"]),oh=J4.enum,Yl=He(["cited","not-cited"]),kh=Yl.enum,cy=He(["visible","not-visible"]);cy.enum;const e3=He(["new","cited","lost","emerging","not-cited"]);e3.enum;oe({kind:Kr(ht["answer-visibility"]).optional(),trigger:Kr(oh.manual).optional(),providers:we(Ps).optional(),queries:we(P().min(1)).min(1).optional(),location:P().min(1).optional(),allLocations:ot().optional(),noLocation:ot().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const dte=oe({message:P(),raw:Wl().optional()}),fte=oe({message:P().optional(),providers:Va(P(),dte).optional()}),hte=oe({id:P(),projectId:P(),kind:X4,status:Rv,trigger:J4.default("manual"),location:P().nullable().optional(),queries:we(P()).nullable().optional(),startedAt:P().nullable().optional(),finishedAt:P().nullable().optional(),error:fte.nullable().optional(),createdAt:P()});function wk(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 t3=oe({uri:P(),title:P()}),n3=oe({id:P(),runId:P(),queryId:P(),query:P().optional(),provider:Ps,citationState:Yl,answerMentioned:ot().optional(),visibilityState:cy.optional(),transition:e3.optional(),answerText:P().nullable().optional(),citedDomains:we(P()).default([]),competitorOverlap:we(P()).default([]),recommendedCompetitors:we(P()).default([]),matchedTerms:we(P()).default([]),groundingSources:we(t3).default([]),searchQueries:we(P()).default([]),model:P().nullable().optional(),location:P().nullable().optional(),createdAt:P()});oe({snapshots:we(n3),total:ne().int().nonnegative()});const pte=oe({queryId:P().nullable(),query:P().nullable(),run1State:Yl.nullable(),run2State:Yl.nullable(),run1AnswerMentioned:ot().nullable(),run2AnswerMentioned:ot().nullable(),run1VisibilityState:cy.nullable(),run2VisibilityState:cy.nullable(),changed:ot(),visibilityChanged:ot()});oe({run1:P(),run2:P(),diff:we(pte)});const mte=hte.extend({snapshots:we(n3).optional()});oe({totalRuns:ne().int().nonnegative(),run:mte.nullable()});oe({id:P(),projectId:P().nullable().optional(),actor:P(),action:P(),entityType:P(),entityId:P().nullable().optional(),diff:Wl().optional(),createdAt:P()});const gte=He(["yes","no","unknown","not-mentioned"]),pT=we(P().min(1));oe({companyName:P().min(1),domain:P().min(1),queries:pT.optional(),phrases:pT.optional(),competitors:we(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 yte=oe({name:P(),count:ne().int().nonnegative()}),vte=oe({id:P(),name:P(),weight:ne(),score:ne(),grade:P(),status:He(["pass","partial","fail"]),findings:we(oe({type:P(),message:P()})).default([]),recommendations:we(P()).default([])}),xte=oe({url:P(),finalUrl:P(),auditedAt:P(),overallScore:ne(),overallGrade:P(),summary:P(),factors:we(vte).default([])}),bte=oe({industry:P(),summary:P(),services:we(P()).default([]),categoryTerms:we(P()).default([])}),wte=oe({provider:P(),displayName:P(),model:P().nullable().optional(),mentioned:ot(),cited:ot(),describedAccurately:gte,accuracyNotes:P().nullable().optional(),incorrectClaims:we(P()).default([]),recommendedCompetitors:we(P()).default([]),citedDomains:we(P()).default([]),groundingSources:we(t3).default([]),searchQueries:we(P()).default([]),answerText:P(),error:P().nullable().optional()}),Ste=oe({query:P(),providerResults:we(wte).default([])}),jte=oe({totalQueries:ne().int().nonnegative(),totalProviders:ne().int().nonnegative(),totalComparisons:ne().int().nonnegative(),mentionCount:ne().int().nonnegative(),citationCount:ne().int().nonnegative(),topCompetitors:we(yte).default([]),visibilityGap:P(),whatThisMeans:we(P()).default([]),recommendedActions:we(P()).default([])});oe({companyName:P(),domain:P(),homepageUrl:P(),generatedAt:P(),queries:we(P()).default([]),competitors:we(P()).default([]),profile:bte,audit:xte,queryResults:we(Ste).default([]),summary:jte});const Sk=He(["answer-visibility","traffic-sync"]);Sk.enum;oe({id:P(),projectId:P(),kind:Sk,cronExpr:P(),preset:P().nullable().optional(),timezone:P().default("UTC"),enabled:ot().default(!0),providers:we(Ps).default([]),sourceId:P().nullable().optional(),lastRunAt:P().nullable().optional(),nextRunAt:P().nullable().optional(),createdAt:P(),updatedAt:P()});oe({kind:Sk.optional(),preset:P().optional(),cron:P().optional(),timezone:P().optional().default("UTC"),enabled:ot().optional().default(!0),providers:we(Ps).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 Nte=He(["mentioned","cited"]);Nte.enum;oe({id:P(),projectId:P(),propertyId:P(),clientEmail:P(),connected:ot(),createdAt:P(),updatedAt:P()});oe({date:P(),landingPage:P(),sessions:ne(),organicSessions:ne(),users:ne()});const jk=He(["session","first_user","manual_utm"]),kte=oe({source:P(),medium:P(),sessions:ne(),users:ne(),sourceDimension:jk}),Cte=oe({source:P(),medium:P(),sourceDimension:jk,landingPage:P(),sessions:ne(),users:ne()}),Ate=oe({source:P(),medium:P(),sessions:ne(),users:ne(),channelGroup:P()}),Tf=oe({sessions:ne(),sharePct:ne(),sharePctDisplay:P()}),Ete=oe({organic:Tf,social:Tf,direct:Tf,ai:Tf,other:Tf});oe({totalSessions:ne(),totalOrganicSessions:ne(),totalDirectSessions:ne(),totalUsers:ne(),topPages:we(oe({landingPage:P(),sessions:ne(),organicSessions:ne(),directSessions:ne(),users:ne()})),aiReferrals:we(kte),aiReferralLandingPages:we(Cte),aiSessionsDeduped:ne(),aiUsersDeduped:ne(),aiSessionsBySession:ne(),aiUsersBySession:ne(),socialReferrals:we(Ate),socialSessions:ne(),socialUsers:ne(),channelBreakdown:Ete,organicSharePct:ne(),aiSharePct:ne(),aiSharePctBySession:ne(),directSharePct:ne(),socialSharePct:ne(),organicSharePctDisplay:P(),aiSharePctDisplay:P(),aiSharePctBySessionDisplay:P(),directSharePctDisplay:P(),socialSharePctDisplay:P(),otherSessions:ne(),otherSharePct:ne(),otherSharePctDisplay:P(),lastSyncedAt:P().nullable()});oe({date:P(),source:P(),medium:P(),landingPage:P(),sessions:ne(),users:ne(),sourceDimension:jk});oe({date:P(),source:P(),medium:P(),sessions:ne(),users:ne(),channelGroup:P()});oe({date:P(),sessions:ne(),organicSessions:ne(),users:ne()});function uy(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const Ote=He(["aero","user","compaction"]);Ote.enum;const r3=128;oe({key:P().min(1).max(r3),value:P().min(1)});oe({key:P().min(1).max(r3)});const Nk=He(["queued","downloading","querying","ready","failed"]);Nk.enum;oe({id:P(),release:P(),status:Nk,phaseDetail:P().nullable().optional(),vertexPath:P().nullable().optional(),edgesPath:P().nullable().optional(),vertexSha256:P().nullable().optional(),edgesSha256:P().nullable().optional(),vertexBytes:ne().int().nullable().optional(),edgesBytes:ne().int().nullable().optional(),projectsProcessed:ne().int().nullable().optional(),domainsDiscovered:ne().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 _te=oe({linkingDomain:P(),numHosts:ne().int()}),zte=oe({projectId:P(),release:P(),targetDomain:P(),totalLinkingDomains:ne().int(),totalHosts:ne().int(),top10HostsShare:P(),queriedAt:P(),excludedLinkingDomains:ne().int().optional(),excludedHosts:ne().int().optional()});oe({summary:zte.nullable(),total:ne().int(),rows:we(_te)});oe({release:P(),totalLinkingDomains:ne().int(),totalHosts:ne().int(),top10HostsShare:P(),queriedAt:P()});oe({duckdbInstalled:ot(),duckdbVersion:P().nullable().optional(),duckdbSpec:P(),pluginDir:P()});oe({installed:ot(),version:P(),path:P(),alreadyPresent:ot()});oe({release:P(),vertexUrl:P(),edgesUrl:P(),vertexBytes:ne().int().nullable(),edgesBytes:ne().int().nullable(),lastModified:P().nullable()});oe({release:P(),syncStatus:Nk.nullable(),bytes:ne().int(),lastUsedAt:P().nullable()});He(["snapshot","insight"]);const Tte=oe({kind:Kr("snapshot"),id:P(),runId:P(),query:P(),provider:P(),model:P().nullable(),citationState:Yl,matchedField:He(["answerText","citedDomains","searchQueries","query"]),snippet:P(),createdAt:P()}),Pte=oe({kind:Kr("insight"),id:P(),runId:P().nullable(),type:He(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost"]),severity:He(["critical","high","medium","low"]),title:P(),query:P(),provider:P(),matchedField:He(["title","query","recommendation","cause"]),snippet:P(),dismissed:ot(),createdAt:P()}),Rte=G4("kind",[Tte,Pte]);oe({query:P(),totalHits:ne().int().nonnegative(),truncated:ot(),hits:we(Rte)});const i3=He(["create","expand","refresh","add-schema"]);i3.enum;function Dte(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}const a3=He(["gsc","competitor-evidence","both"]);a3.enum;const s3=He(["high","medium","low"]);s3.enum;const Ite=He(["blog-post","comparison","listicle","how-to","guide","glossary"]);Ite.enum;const o3=He(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);o3.enum;const Mte=oe({url:P(),gscImpressions:ne().nonnegative(),gscClicks:ne().nonnegative(),gscAvgPosition:ne().nonnegative().nullable(),organicSessions:ne().nonnegative()}),Lte=oe({domain:P(),url:P(),title:P(),citationCount:ne().int().nonnegative()}),$te=oe({demand:ne(),competitor:ne(),absence:ne(),gapSeverity:ne()}),Bte=oe({actionId:P(),state:o3,lastUpdated:P()}),Ute=oe({targetRef:P(),query:P(),action:i3,ourBestPage:Mte.nullable(),winningCompetitor:Lte.nullable(),score:ne(),scoreBreakdown:$te,drivers:we(P()),demandSource:a3,actionConfidence:s3,existingAction:Bte.nullable()});oe({targets:we(Ute),contextMetrics:oe({totalAiReferralSessions:ne().int().nonnegative(),latestRunId:P(),runTimestamp:P()})});const qte=oe({uri:P(),title:P(),domain:P(),isOurDomain:ot(),isCompetitor:ot(),citationCount:ne().int().nonnegative(),providers:we(Ps)}),Fte=oe({query:P(),groundingSources:we(qte)});oe({sources:we(Fte),latestRunId:P()});const Hte=oe({query:P(),competitorDomains:we(P()),competitorCount:ne().int().nonnegative(),missRate:ne().min(0).max(1),lastSeenInRunId:P()});oe({gaps:we(Hte),latestRunId:P()});const l3=He(["ok","warn","fail","skipped"]);l3.enum;const kk=He(["global","project"]);kk.enum;const c3=He(["auth","config","providers","integrations","database","schedules"]);c3.enum;const Kte=oe({id:P(),category:c3,scope:kk,title:P(),status:l3,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:Va(P(),Wl()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:ne().int().nonnegative().describe("How long the check took to execute.")});oe({scope:kk,project:P().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:P().describe("ISO-8601 timestamp when this doctor run started."),durationMs:ne().int().nonnegative(),summary:oe({total:ne().int().nonnegative(),ok:ne().int().nonnegative(),warn:ne().int().nonnegative(),fail:ne().int().nonnegative(),skipped:ne().int().nonnegative()}),checks:we(Kte)});const Gte=oe({provider:P(),citationState:Yl,cited:ot(),mentioned:ot(),runId:P(),runCreatedAt:P()}),Vte=oe({queryId:P(),query:P(),providers:we(Gte),citedCount:ne().int().nonnegative(),mentionedCount:ne().int().nonnegative(),totalProviders:ne().int().nonnegative()}),Qte=oe({queryId:P(),query:P(),provider:P(),citingCompetitors:we(P()),runId:P(),runCreatedAt:P()}),Wte=oe({providersConfigured:ne().int().nonnegative(),providersCiting:ne().int().nonnegative(),providersMentioning:ne().int().nonnegative(),totalQueries:ne().int().nonnegative(),queriesCitedAndMentioned:ne().int().nonnegative(),queriesCitedOnly:ne().int().nonnegative(),queriesMentionedOnly:ne().int().nonnegative(),queriesInvisible:ne().int().nonnegative(),latestRunId:P().nullable(),latestRunAt:P().nullable()});oe({summary:Wte,byQuery:we(Vte),competitorGaps:we(Qte),status:He(["ready","no-data"]),reason:He(["no-runs-yet","no-queries"]).optional()});function Yte(e){return e.horizon==="immediate"?"negative":e.confidence==="high"?"caution":e.confidence==="low"?"neutral":"caution"}function Zte(e){switch(e){case"critical":return"Critical";case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}function Xte(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function Jte(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 ene(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}const tne=new Set(["a","an","and","for","from","in","near","of","on","or","the","to"]);function u3(e){return e.toLowerCase().match(/[a-z0-9]+/g)??[]}function d3(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 f3(e){const t=e.meta.location;return t?new Set([t.label,t.city,t.region,t.country].flatMap(u3).map(d3).filter(Boolean)):new Set}function h3(e,t){const n=u3(e).map(d3).filter(Boolean).filter(r=>!tne.has(r)).filter(r=>!t.has(r));return[...new Set(n)].sort().join(" ")}function nne(e){return e.title.match(/"([^"]+)"/)?.[1]??e.successMetric.match(/"([^"]+)"/)?.[1]??e.title}function rne(e,t){const n=f3(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 l=h3(nne(a),n);!l||r.has(l)||(r.add(l),i.push(a))}return i}function ine(e){const t=f3(e),n=e.contentOpportunities;if(n.length<=1||t.size===0)return n;const r=new Set;return n.filter(i=>{const a=h3(i.query,t);return!a||r.has(a)?!1:(r.add(a),!0)})}const ane=He(["claude","codex"]);ane.enum;const sne=He(["claude","codex","all"]);sne.enum;const Ck=He(["cloud-run","wordpress","cloudflare","vercel","generic-log"]);Ck.enum;const one=He(["raw-request-events","aggregate-request-metrics","request-url","status-code","user-agent","remote-ip","referer","cursor-pull"]);one.enum;const lne=He(["raw-request","aggregate-bucket"]),cne=lne.enum,une=He(["observed","provider-aggregated","inferred"]),dne=une.enum,fne=oe({type:P().nullable(),labels:Va(P(),P())}),hne=oe({sourceType:Ck,evidenceKind:Kr(cne["raw-request"]),confidence:Kr(dne.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:ne().int().nullable(),userAgent:P().nullable(),remoteIp:P().nullable(),referer:P().nullable(),latencyMs:ne().nullable(),requestSizeBytes:ne().int().nullable(),responseSizeBytes:ne().int().nullable(),providerResource:fne,providerLabels:Va(P(),P())});oe({events:we(hne),rawEntryCount:ne().int().nonnegative(),skippedEntryCount:ne().int().nonnegative(),nextPageToken:P().optional(),filter:P()});const p3=He(["connected","paused","error","archived"]),eh=p3.enum,m3=He(["oauth","service-account"]);m3.enum;const pne=He(["verified","claimed_unverified","unknown_ai_like"]);pne.enum;oe({gcpProjectId:P().min(1),serviceName:P().nullable().optional(),location:P().nullable().optional(),authMode:m3});oe({baseUrl:P().url(),username:P().min(1)});const Ak=He(["production","preview"]);Ak.enum;oe({projectId:P().min(1),teamId:P().min(1),environment:Ak});const g3=oe({id:P(),projectId:P(),sourceType:Ck,displayName:P(),status:p3,lastSyncedAt:P().nullable(),lastCursor:P().nullable(),lastError:P().nullable(),archivedAt:P().nullable(),config:Va(P(),Wl()),createdAt:P(),updatedAt:P()});oe({gcpProjectId:P().min(1),serviceName:P().min(1).optional(),location:P().min(1).optional(),displayName:P().min(1).optional(),keyJson:P().optional()});oe({baseUrl:P().url(),username:P().min(1),applicationPassword:P().min(1),displayName:P().min(1).optional()});oe({projectId:P().min(1),teamId:P().min(1),token:P().min(1),environment:Ak.optional(),displayName:P().min(1).optional()});oe({sourceId:P(),runId:P(),syncedAt:P(),pulledEvents:ne().int().nonnegative(),crawlerHits:ne().int().nonnegative(),aiReferralHits:ne().int().nonnegative(),unknownHits:ne().int().nonnegative(),crawlerBucketRows:ne().int().nonnegative(),aiReferralBucketRows:ne().int().nonnegative(),sampleRows:ne().int().nonnegative(),windowStart:P(),windowEnd:P()});oe({days:ne().int().positive().optional()});oe({sourceId:P(),runId:P(),status:Rv,windowStart:P(),windowEnd:P(),daysRequested:ne().int().positive(),daysApplied:ne().int().positive()});const mne=oe({crawlerHits:ne().int().nonnegative(),aiReferralHits:ne().int().nonnegative(),sampleCount:ne().int().nonnegative()});oe({sources:we(g3)});const gne=g3.extend({totals24h:mne,latestRun:oe({runId:P(),status:Rv,startedAt:P().nullable(),finishedAt:P().nullable(),error:P().nullable()}).nullable()});oe({sources:we(gne)});const yne=He(["crawler","ai-referral"]),Da=yne.enum,vne=oe({kind:Kr(Da.crawler),sourceId:P(),tsHour:P(),botId:P(),operator:P(),verificationStatus:P(),pathNormalized:P(),status:ne().int(),hits:ne().int().nonnegative()}),xne=oe({kind:Kr(Da["ai-referral"]),sourceId:P(),tsHour:P(),product:P(),operator:P(),sourceDomain:P(),evidenceType:P(),landingPathNormalized:P(),status:ne().int(),hits:ne().int().nonnegative()}),bne=G4("kind",[vne,xne]);oe({windowStart:P(),windowEnd:P(),totals:oe({crawlerHits:ne().int().nonnegative(),aiReferralHits:ne().int().nonnegative()}),events:we(bne)});const Ek=He(["cited","aspirational","wasted-surface"]),mT=Ek.enum;mT.cited,mT.aspirational;const Ok=He(["queued","seeding","probing","completed","failed"]);Ok.enum;const y3=oe({domain:P().min(1),hits:ne().int().positive()}),wne=oe({id:P(),sessionId:P(),projectId:P(),query:P(),bucket:Ek.nullable().default(null),citationState:Yl,citedDomains:we(P()).default([]),createdAt:P()}),Sne=oe({id:P(),projectId:P(),status:Ok,icpDescription:P().nullable().optional(),seedProvider:P().nullable().optional(),seedCountRaw:ne().int().nullable().optional(),seedCount:ne().int().nullable().optional(),dedupThreshold:ne().nullable().optional(),probeCount:ne().int().nullable().optional(),citedCount:ne().int().nullable().default(null),aspirationalCount:ne().int().nullable().default(null),wastedCount:ne().int().nullable().default(null),competitorMap:we(y3).default([]),error:P().nullable().optional(),startedAt:P().nullable().optional(),finishedAt:P().nullable().optional(),createdAt:P()});Sne.extend({probes:we(wne).default([])});const jne=500;oe({icpDescription:P().min(1).optional(),dedupThreshold:ne().min(0).max(1).optional(),maxProbes:ne().int().positive().max(jne).optional()});oe({buckets:we(Ek).min(1).optional(),includeCompetitors:ot().optional()});oe({sessionId:P(),projectId:P(),status:Ok,queriesByBucket:oe({cited:we(P()),aspirational:we(P()),"wasted-surface":we(P())}),suggestedCompetitors:we(y3)});oe({sessionId:P(),projectId:P(),promoted:oe({queries:we(P()),competitors:we(P())}),skipped:oe({queries:we(P()),competitors:we(P())})});K4([Kr("cli"),P().regex(/^discovery:.+$/)]);function Pw(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 Nne(e,t){return t<=0?null:Math.round((e-t)/t*100)}function gT(e,t,n="vs prior 7 days"){return e.deltaPct===null?e.prior===0?"First baseline week":"":e.deltaPct>0?`Up ${e.deltaPct}% ${n} (${Pw(e.prior)} ${t})`:e.deltaPct<0?`Down ${Math.abs(e.deltaPct)}% ${n} (${Pw(e.prior)} ${t})`:`Flat ${n} (${Pw(e.prior)} ${t})`}var Eo=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(Eo||{});const kne={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},Um={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},Cne=wk;function Ane(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 Dv(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function ua(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function yT(e){return e===null?"Unknown":e?"Pass":"Fail"}function m1(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function Ene(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function One(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 Rw(e,t,n){const r=n==="UTC"?"UTC":n.split("/").pop()?.replace(/_/g," ")??n;if(!e)return`Custom: ${t} · ${r}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${r}`;const i=e.match(/^daily(?:@(\d+))?$/);if(i){const l=i[1]?parseInt(i[1]):6;return`Every day at ${m1(l)} · ${r}`}const a=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(a){const l={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},c=a[2]?parseInt(a[2]):6;return`Every ${l[a[1]]} at ${m1(c)} · ${r}`}return`${e} · ${r}`}function dy(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function v3(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 _ne(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 zne(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function Tne(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function Bo(e){const t=[e.detail,e.hint].filter(Boolean);return t.length>0?t.join(`
|
|
52
|
-
`):void 0}function Pne(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:dy(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:dy(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const i=n.providerStatuses.filter(d=>d.state==="ready").length,a=n.providerStatuses.length,l=i>0,c=n.providerStatuses.filter(d=>d.state==="ready").map(d=>Tne(d)).join(" · ");return{...r,label:"Providers",tone:l?"positive":"caution",detail:`${i} of ${a} configured`,meta:c||"None configured"}})}function Rne(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 Dne(e,t,n){const r=Rne(t,n),i=structuredClone(e);return i.healthChecks=i.healthChecks.map(a=>{if(a.id==="api")return{...a,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(a.id==="worker")return{...a,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const l=n.providerStatuses.some(c=>c.state==="ready");return{...a,detail:l?"At least one provider configured.":"No providers configured.",state:l?"ready":"attention"}}),i.launchState.enabled=r===void 0,i.launchState.blockedReason=r,i.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",i}const x3="canonry.run-tracker",g1=new Set;let vT=!1,Ine=0,Iv={runs:{},batches:{}};function Mne(){const e=Zl();for(const t of g1)t(e)}function Lne(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function $ne(){typeof window>"u"||window.sessionStorage.setItem(x3,JSON.stringify(Iv))}function b3(){vT||(vT=!0,!(typeof window>"u")&&(Iv=Lne(window.sessionStorage.getItem(x3))))}function Mv(e){Iv=e,$ne(),Mne()}function Zl(){return b3(),Iv}function Bne(e){return b3(),g1.add(e),()=>{g1.delete(e)}}function w3(e){const t=Zl();Mv({...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 xT(e){const t=Zl();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;Mv({...t,runs:r})}function Une(e){const t=Zl(),n=`batch_${Date.now()}_${++Ine}`;return Mv({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function qne(e){const t=Zl();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;Mv({...t,batches:r})}function _k(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function Fne(e,t){let n=0,r=0,i=0,a=0,l=0;for(const c of e){const d=t[c]?.status;d==="completed"?n+=1:d==="partial"?r+=1:d==="failed"?i+=1:d==="cancelled"?a+=1:l+=1}return{completed:n,partial:r,failed:i,cancelled:a,pending:l,finished:l===0}}function bT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function zk(...e){return t=>{let n=!1;const r=e.map(i=>{const a=bT(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():bT(e[i],null)}}}}function hc(...e){return x.useCallback(zk(...e),e)}var Hne=Symbol.for("react.lazy"),fy=wv[" use ".trim().toString()];function Kne(e){return typeof e=="object"&&e!==null&&"then"in e}function S3(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Hne&&"_payload"in e&&Kne(e._payload)}function Gne(e){const t=Qne(e),n=x.forwardRef((r,i)=>{let{children:a,...l}=r;S3(a)&&typeof fy=="function"&&(a=fy(a._payload));const c=x.Children.toArray(a),d=c.find(Yne);if(d){const f=d.props.children,p=c.map(m=>m===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:m);return s.jsx(t,{...l,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return s.jsx(t,{...l,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var Vne=Gne("Slot");function Qne(e){const t=x.forwardRef((n,r)=>{let{children:i,...a}=n;if(S3(i)&&typeof fy=="function"&&(i=fy(i._payload)),x.isValidElement(i)){const l=Xne(i),c=Zne(a,i.props);return i.type!==x.Fragment&&(c.ref=r?zk(r,l):l),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Wne=Symbol("radix.slottable");function Yne(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Wne}function Zne(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]=(...c)=>{const d=a(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Xne(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 j3(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=j3(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=j3(e))&&(r&&(r+=" "),r+=t);return r}const wT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ST=Rt,N3=(e,t)=>n=>{var r;if(t?.variants==null)return ST(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,l=Object.keys(i).map(f=>{const p=n?.[f],m=a?.[f];if(p===null)return null;const y=wT(p)||wT(m);return i[f][y]}),c=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,...c}[b]):{...a,...c}[b]===j})?[...f,m,y]:f},[]);return ST(e,l,d,n?.class,n?.className)},Jne=(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},ere=(e,t)=>({classGroupId:e,validator:t}),k3=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),hy="-",jT=[],tre="arbitrary..",nre=e=>{const t=ire(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return rre(l);const c=l.split(hy),d=c[0]===""&&c.length>1?1:0;return C3(c,d,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const d=r[l],f=n[l];return d?f?Jne(f,d):d:f||jT}return n[l]||jT}}},C3=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=C3(e,t+1,a);if(f)return f}const l=n.validators;if(l===null)return;const c=t===0?e.join(hy):e.slice(t).join(hy),d=l.length;for(let f=0;f<d;f++){const p=l[f];if(p.validator(c))return p.classGroupId}},rre=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?tre+r:void 0})(),ire=e=>{const{theme:t,classGroups:n}=e;return are(n,t)},are=(e,t)=>{const n=k3();for(const r in e){const i=e[r];Tk(i,n,r,t)}return n},Tk=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];sre(l,t,n,r)}},sre=(e,t,n,r)=>{if(typeof e=="string"){ore(e,t,n);return}if(typeof e=="function"){lre(e,t,n,r);return}cre(e,t,n,r)},ore=(e,t,n)=>{const r=e===""?t:A3(t,e);r.classGroupId=n},lre=(e,t,n,r)=>{if(ure(e)){Tk(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(ere(n,e))},cre=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[c,d]=i[l];Tk(d,A3(t,c),n,r)}},A3=(e,t)=>{let n=e;const r=t.split(hy),i=r.length;for(let a=0;a<i;a++){const l=r[a];let c=n.nextPart.get(l);c||(c=k3(),n.nextPart.set(l,c)),n=c}return n},ure=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,dre=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,l)=>{n[a]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=r[a])!==void 0)return i(a,l),l},set(a,l){a in n?n[a]=l:i(a,l)}}},y1="!",NT=":",fre=[],kT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),hre=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let l=0,c=0,d=0,f;const p=i.length;for(let b=0;b<p;b++){const j=i[b];if(l===0&&c===0){if(j===NT){a.push(i.slice(d,b)),d=b+1;continue}if(j==="/"){f=b;continue}}j==="["?l++:j==="]"?l--:j==="("?c++:j===")"&&c--}const m=a.length===0?i:i.slice(d);let y=m,v=!1;m.endsWith(y1)?(y=m.slice(0,-1),v=!0):m.startsWith(y1)&&(y=m.slice(1),v=!0);const w=f&&f>d?f-d:void 0;return kT(a,v,y,w)};if(t){const i=t+NT,a=r;r=l=>l.startsWith(i)?a(l.slice(i.length)):kT(fre,!1,l,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},pre=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const l=n[a],c=l[0]==="[",d=t.has(l);c||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(l)):i.push(l)}return i.length>0&&(i.sort(),r.push(...i)),r}},mre=e=>({cache:dre(e.cacheSize),parseClassName:hre(e),sortModifiers:pre(e),...nre(e)}),gre=/\s+/,yre=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,l=[],c=e.trim().split(gre);let d="";for(let f=c.length-1;f>=0;f-=1){const p=c[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(":"),O=v?E+y1:E,C=O+k;if(l.indexOf(C)>-1)continue;l.push(C);const z=i(k,j);for(let A=0;A<z.length;++A){const _=z[A];l.push(O+_)}d=p+(d.length>0?" "+d:d)}return d},vre=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=E3(n))&&(i&&(i+=" "),i+=r);return i},E3=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=E3(e[r]))&&(n&&(n+=" "),n+=t);return n},xre=(e,...t)=>{let n,r,i,a;const l=d=>{const f=t.reduce((p,m)=>m(p),e());return n=mre(f),r=n.cache.get,i=n.cache.set,a=c,c(d)},c=d=>{const f=r(d);if(f)return f;const p=yre(d,n);return i(d,p),p};return a=l,(...d)=>a(vre(...d))},bre=[],Fn=e=>{const t=n=>n[e]||bre;return t.isThemeGetter=!0,t},O3=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_3=/^\((?:(\w[\w-]*):)?(.+)\)$/i,wre=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Sre=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jre=/\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$/,Nre=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kre=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Cre=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,po=e=>wre.test(e),mt=e=>!!e&&!Number.isNaN(Number(e)),mo=e=>!!e&&Number.isInteger(Number(e)),Dw=e=>e.endsWith("%")&&mt(e.slice(0,-1)),ys=e=>Sre.test(e),z3=()=>!0,Are=e=>jre.test(e)&&!Nre.test(e),Pk=()=>!1,Ere=e=>kre.test(e),Ore=e=>Cre.test(e),_re=e=>!Be(e)&&!Ue(e),zre=e=>Qo(e,R3,Pk),Be=e=>O3.test(e),vl=e=>Qo(e,D3,Are),CT=e=>Qo(e,$re,mt),Tre=e=>Qo(e,M3,z3),Pre=e=>Qo(e,I3,Pk),AT=e=>Qo(e,T3,Pk),Rre=e=>Qo(e,P3,Ore),qm=e=>Qo(e,L3,Ere),Ue=e=>_3.test(e),Pf=e=>pc(e,D3),Dre=e=>pc(e,I3),ET=e=>pc(e,T3),Ire=e=>pc(e,R3),Mre=e=>pc(e,P3),Fm=e=>pc(e,L3,!0),Lre=e=>pc(e,M3,!0),Qo=(e,t,n)=>{const r=O3.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},pc=(e,t,n=!1)=>{const r=_3.exec(e);return r?r[1]?t(r[1]):n:!1},T3=e=>e==="position"||e==="percentage",P3=e=>e==="image"||e==="url",R3=e=>e==="length"||e==="size"||e==="bg-size",D3=e=>e==="length",$re=e=>e==="number",I3=e=>e==="family-name",M3=e=>e==="number"||e==="weight",L3=e=>e==="shadow",Bre=()=>{const e=Fn("color"),t=Fn("font"),n=Fn("text"),r=Fn("font-weight"),i=Fn("tracking"),a=Fn("leading"),l=Fn("breakpoint"),c=Fn("container"),d=Fn("spacing"),f=Fn("radius"),p=Fn("shadow"),m=Fn("inset-shadow"),y=Fn("text-shadow"),v=Fn("drop-shadow"),w=Fn("blur"),b=Fn("perspective"),j=Fn("aspect"),k=Fn("ease"),E=Fn("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],z=()=>[...C(),Ue,Be],A=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],R=()=>[Ue,Be,d],$=()=>[po,"full","auto",...R()],F=()=>[mo,"none","subgrid",Ue,Be],q=()=>["auto",{span:["full",mo,Ue,Be]},mo,Ue,Be],B=()=>[mo,"auto",Ue,Be],K=()=>["auto","min","max","fr",Ue,Be],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...R()],J=()=>[po,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],de=()=>[po,"screen","full","dvw","lvw","svw","min","max","fit",...R()],be=()=>[po,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],M=()=>[e,Ue,Be],D=()=>[...C(),ET,AT,{position:[Ue,Be]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",Ire,zre,{size:[Ue,Be]}],V=()=>[Dw,Pf,vl],ce=()=>["","none","full",f,Ue,Be],re=()=>["",mt,Pf,vl],ke=()=>["solid","dashed","dotted","double"],ze=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>[mt,Dw,ET,AT],fe=()=>["","none",w,Ue,Be],Ee=()=>["none",mt,Ue,Be],Z=()=>["none",mt,Ue,Be],Ge=()=>[mt,Ue,Be],Me=()=>[po,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ys],breakpoint:[ys],color:[z3],container:[ys],"drop-shadow":[ys],ease:["in","out","in-out"],font:[_re],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ys],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ys],shadow:[ys],spacing:["px",mt],text:[ys],"text-shadow":[ys],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",po,Be,Ue,j]}],container:["container"],columns:[{columns:[mt,Be,Ue,c]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:z()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[mo,"auto",Ue,Be]}],basis:[{basis:[po,"full","auto",c,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[mt,po,"auto","initial","none",Be]}],grow:[{grow:["",mt,Ue,Be]}],shrink:[{shrink:["",mt,Ue,Be]}],order:[{order:[mo,"first","last","none",Ue,Be]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:q()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:q()}],"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":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],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",...de()]}],"min-inline-size":[{"min-inline":["auto",...de()]}],"max-inline-size":[{"max-inline":["none",...de()]}],"block-size":[{block:["auto",...be()]}],"min-block-size":[{"min-block":["auto",...be()]}],"max-block-size":[{"max-block":["none",...be()]}],w:[{w:[c,"screen",...J()]}],"min-w":[{"min-w":[c,"screen","none",...J()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",n,Pf,vl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Lre,Tre]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Dw,Be]}],"font-family":[{font:[Dre,Pre,t]}],"font-features":[{"font-features":[Be]}],"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,Ue,Be]}],"line-clamp":[{"line-clamp":[mt,"none",Ue,CT]}],leading:[{leading:[a,...R()]}],"list-image":[{"list-image":["none",Ue,Be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ue,Be]}],"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:[...ke(),"wavy"]}],"text-decoration-thickness":[{decoration:[mt,"from-font","auto",Ue,vl]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[mt,"auto",Ue,Be]}],"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",Ue,Be]}],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",Ue,Be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},mo,Ue,Be],radial:["",Ue,Be],conic:[mo,Ue,Be]},Mre,Rre]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ke(),"hidden","none"]}],"divide-style":[{divide:[...ke(),"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:[...ke(),"none","hidden"]}],"outline-offset":[{"outline-offset":[mt,Ue,Be]}],"outline-w":[{outline:["",mt,Pf,vl]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",p,Fm,qm]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",m,Fm,qm]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[mt,vl]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",y,Fm,qm]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[mt,Ue,Be]}],"mix-blend":[{"mix-blend":[...ze(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ze()}],"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":te()}],"mask-image-linear-to-pos":[{"mask-linear-to":te()}],"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":te()}],"mask-image-t-to-pos":[{"mask-t-to":te()}],"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":te()}],"mask-image-r-to-pos":[{"mask-r-to":te()}],"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":te()}],"mask-image-b-to-pos":[{"mask-b-to":te()}],"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":te()}],"mask-image-l-to-pos":[{"mask-l-to":te()}],"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":te()}],"mask-image-x-to-pos":[{"mask-x-to":te()}],"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":te()}],"mask-image-y-to-pos":[{"mask-y-to":te()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Ue,Be]}],"mask-image-radial-from-pos":[{"mask-radial-from":te()}],"mask-image-radial-to-pos":[{"mask-radial-to":te()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[mt]}],"mask-image-conic-from-pos":[{"mask-conic-from":te()}],"mask-image-conic-to-pos":[{"mask-conic-to":te()}],"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:D()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ue,Be]}],filter:[{filter:["","none",Ue,Be]}],blur:[{blur:fe()}],brightness:[{brightness:[mt,Ue,Be]}],contrast:[{contrast:[mt,Ue,Be]}],"drop-shadow":[{"drop-shadow":["","none",v,Fm,qm]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",mt,Ue,Be]}],"hue-rotate":[{"hue-rotate":[mt,Ue,Be]}],invert:[{invert:["",mt,Ue,Be]}],saturate:[{saturate:[mt,Ue,Be]}],sepia:[{sepia:["",mt,Ue,Be]}],"backdrop-filter":[{"backdrop-filter":["","none",Ue,Be]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[mt,Ue,Be]}],"backdrop-contrast":[{"backdrop-contrast":[mt,Ue,Be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",mt,Ue,Be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[mt,Ue,Be]}],"backdrop-invert":[{"backdrop-invert":["",mt,Ue,Be]}],"backdrop-opacity":[{"backdrop-opacity":[mt,Ue,Be]}],"backdrop-saturate":[{"backdrop-saturate":[mt,Ue,Be]}],"backdrop-sepia":[{"backdrop-sepia":["",mt,Ue,Be]}],"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",Ue,Be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[mt,"initial",Ue,Be]}],ease:[{ease:["linear","initial",k,Ue,Be]}],delay:[{delay:[mt,Ue,Be]}],animate:[{animate:["none",E,Ue,Be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Ue,Be]}],"perspective-origin":[{"perspective-origin":z()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:Z()}],"scale-x":[{"scale-x":Z()}],"scale-y":[{"scale-y":Z()}],"scale-z":[{"scale-z":Z()}],"scale-3d":["scale-3d"],skew:[{skew:Ge()}],"skew-x":[{"skew-x":Ge()}],"skew-y":[{"skew-y":Ge()}],transform:[{transform:[Ue,Be,"","none","gpu","cpu"]}],"transform-origin":[{origin:z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Me()}],"translate-x":[{"translate-x":Me()}],"translate-y":[{"translate-y":Me()}],"translate-z":[{"translate-z":Me()}],"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",Ue,Be]}],"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",Ue,Be]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[mt,Pf,vl,CT]}],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"]}},Ure=xre(Bre);function Ji(...e){return Ure(Rt(e))}const qre=N3("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-zinc-50 text-black hover:bg-zinc-200",secondary:"border border-zinc-800 bg-zinc-950 text-zinc-100 hover:bg-zinc-900",ghost:"text-zinc-400 hover:bg-zinc-900 hover:text-zinc-50",outline:"border border-zinc-800 bg-transparent text-zinc-100 hover:bg-zinc-900",destructive:"bg-rose-600 text-white hover:bg-rose-700"},size:{default:"h-9 px-4",sm:"h-8 px-3 text-xs",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),pe=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const l=r?Vne:"button";return s.jsx(l,{ref:a,className:Ji(qre({variant:t,size:n,className:e})),...i})});pe.displayName="Button";const Fre=N3("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 $3({className:e,variant:t,...n}){return s.jsx("div",{className:Ji(Fre({variant:t}),e),...n})}function OT({compact:e=!1,version:t}){const n=!e&&t&&t!=="unknown";return s.jsxs(Et,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[s.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),s.jsxs("span",{className:"brand-copy",children:[s.jsx("span",{className:"brand-mark",children:"Canonry"}),n?s.jsxs("span",{className:"brand-version",children:["v",t]}):null]})]})}function Xl({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 s.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 tt({tone:e,children:t,...n}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return s.jsx($3,{variant:r,...n,children:t})}function Lv({status:e}){return s.jsx(tt,{tone:v3(e),children:Dv(e)})}function Ro(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function Hre(e,t){const n=x.createContext(t),r=a=>{const{children:l,...c}=a,d=x.useMemo(()=>c,Object.values(c));return s.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function i(a){const l=x.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function Kre(e,t=[]){let n=[];function r(a,l){const c=x.createContext(l),d=n.length;n=[...n,l];const f=m=>{const{scope:y,children:v,...w}=m,b=y?.[e]?.[d]||c,j=x.useMemo(()=>w,Object.values(w));return s.jsx(b.Provider,{value:j,children:v})};f.displayName=a+"Provider";function p(m,y){const v=y?.[e]?.[d]||c,w=x.useContext(v);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[f,p]}const i=()=>{const a=n.map(l=>x.createContext(l));return function(c){const d=c?.[e]||a;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return i.scopeName=e,[r,Gre(i,...t)]}function Gre(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const l=r.reduce((c,{useScope:d,scopeName:f})=>{const m=d(a)[`__scope${f}`];return{...c,...m}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Ch=globalThis?.document?x.useLayoutEffect:()=>{},Vre=wv[" useId ".trim().toString()]||(()=>{}),Qre=0;function Iw(e){const[t,n]=x.useState(Vre());return Ch(()=>{n(r=>r??String(Qre++))},[e]),e||(t?`radix-${t}`:"")}var Wre=wv[" useInsertionEffect ".trim().toString()]||Ch;function Yre({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,l]=Zre({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:i;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const m=p.current;m!==c&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const f=x.useCallback(p=>{if(c){const m=Xre(p)?p(e):p;m!==e&&l.current?.(m)}else a(p)},[c,e,a,l]);return[d,f]}function Zre({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),a=x.useRef(t);return Wre(()=>{a.current=t},[t]),x.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Xre(e){return typeof e=="function"}function B3(e){const t=Jre(e),n=x.forwardRef((r,i)=>{const{children:a,...l}=r,c=x.Children.toArray(a),d=c.find(tie);if(d){const f=d.props.children,p=c.map(m=>m===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:m);return s.jsx(t,{...l,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return s.jsx(t,{...l,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function Jre(e){const t=x.forwardRef((n,r)=>{const{children:i,...a}=n;if(x.isValidElement(i)){const l=rie(i),c=nie(a,i.props);return i.type!==x.Fragment&&(c.ref=r?zk(r,l):l),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var eie=Symbol("radix.slottable");function tie(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===eie}function nie(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]=(...c)=>{const d=a(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function rie(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 iie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rs=iie.reduce((e,t)=>{const n=B3(`Primitive.${t}`),r=x.forwardRef((i,a)=>{const{asChild:l,...c}=i,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function aie(e,t){e&&dc.flushSync(()=>e.dispatchEvent(t))}function Ah(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function sie(e,t=globalThis?.document){const n=Ah(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 oie="DismissableLayer",v1="dismissableLayer.update",lie="dismissableLayer.pointerDownOutside",cie="dismissableLayer.focusOutside",_T,U3=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),q3=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...d}=e,f=x.useContext(U3),[p,m]=x.useState(null),y=p?.ownerDocument??globalThis?.document,[,v]=x.useState({}),w=hc(t,_=>m(_)),b=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=b.indexOf(j),E=p?b.indexOf(p):-1,O=f.layersWithOutsidePointerEventsDisabled.size>0,C=E>=k,z=fie(_=>{const R=_.target,$=[...f.branches].some(F=>F.contains(R));!C||$||(i?.(_),l?.(_),_.defaultPrevented||c?.())},y),A=hie(_=>{const R=_.target;[...f.branches].some(F=>F.contains(R))||(a?.(_),l?.(_),_.defaultPrevented||c?.())},y);return sie(_=>{E===f.layers.size-1&&(r?.(_),!_.defaultPrevented&&c&&(_.preventDefault(),c()))},y),x.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(_T=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),zT(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=_T)}},[p,y,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),zT())},[p,f]),x.useEffect(()=>{const _=()=>v({});return document.addEventListener(v1,_),()=>document.removeEventListener(v1,_)},[]),s.jsx(Rs.div,{...d,ref:w,style:{pointerEvents:O?C?"auto":"none":void 0,...e.style},onFocusCapture:Ro(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Ro(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Ro(e.onPointerDownCapture,z.onPointerDownCapture)})});q3.displayName=oie;var uie="DismissableLayerBranch",die=x.forwardRef((e,t)=>{const n=x.useContext(U3),r=x.useRef(null),i=hc(t,r);return x.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),s.jsx(Rs.div,{...e,ref:i})});die.displayName=uie;function fie(e,t=globalThis?.document){const n=Ah(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const a=c=>{if(c.target&&!r.current){let d=function(){F3(lie,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function hie(e,t=globalThis?.document){const n=Ah(e),r=x.useRef(!1);return x.useEffect(()=>{const i=a=>{a.target&&!r.current&&F3(cie,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 zT(){const e=new CustomEvent(v1);document.dispatchEvent(e)}function F3(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?aie(i,a):i.dispatchEvent(a)}var Mw="focusScope.autoFocusOnMount",Lw="focusScope.autoFocusOnUnmount",TT={bubbles:!1,cancelable:!0},pie="FocusScope",H3=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...l}=e,[c,d]=x.useState(null),f=Ah(i),p=Ah(a),m=x.useRef(null),y=hc(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(O){if(v.paused||!c)return;const C=O.target;c.contains(C)?m.current=C:xo(m.current,{select:!0})},j=function(O){if(v.paused||!c)return;const C=O.relatedTarget;C!==null&&(c.contains(C)||xo(m.current,{select:!0}))},k=function(O){if(document.activeElement===document.body)for(const z of O)z.removedNodes.length>0&&xo(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",j);const E=new MutationObserver(k);return c&&E.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",j),E.disconnect()}}},[r,c,v.paused]),x.useEffect(()=>{if(c){RT.add(v);const b=document.activeElement;if(!c.contains(b)){const k=new CustomEvent(Mw,TT);c.addEventListener(Mw,f),c.dispatchEvent(k),k.defaultPrevented||(mie(bie(K3(c)),{select:!0}),document.activeElement===b&&xo(c))}return()=>{c.removeEventListener(Mw,f),setTimeout(()=>{const k=new CustomEvent(Lw,TT);c.addEventListener(Lw,p),c.dispatchEvent(k),k.defaultPrevented||xo(b??document.body,{select:!0}),c.removeEventListener(Lw,p),RT.remove(v)},0)}}},[c,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,[O,C]=gie(E);O&&C?!b.shiftKey&&k===C?(b.preventDefault(),n&&xo(O,{select:!0})):b.shiftKey&&k===O&&(b.preventDefault(),n&&xo(C,{select:!0})):k===E&&b.preventDefault()}},[n,r,v.paused]);return s.jsx(Rs.div,{tabIndex:-1,...l,ref:y,onKeyDown:w})});H3.displayName=pie;function mie(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(xo(r,{select:t}),document.activeElement!==n)return}function gie(e){const t=K3(e),n=PT(t,e),r=PT(t.reverse(),e);return[n,r]}function K3(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 PT(e,t){for(const n of e)if(!yie(n,{upTo:t}))return n}function yie(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 vie(e){return e instanceof HTMLInputElement&&"select"in e}function xo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&vie(e)&&t&&e.select()}}var RT=xie();function xie(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=DT(e,t),e.unshift(t)},remove(t){e=DT(e,t),e[0]?.resume()}}}function DT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function bie(e){return e.filter(t=>t.tagName!=="A")}var wie="Portal",G3=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,a]=x.useState(!1);Ch(()=>a(!0),[]);const l=n||i&&globalThis?.document?.body;return l?HG.createPortal(s.jsx(Rs.div,{...r,ref:t}),l):null});G3.displayName=wie;function Sie(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var $v=e=>{const{present:t,children:n}=e,r=jie(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=hc(r.ref,Nie(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:a}):null};$v.displayName="Presence";function jie(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),a=x.useRef("none"),l=e?"mounted":"unmounted",[c,d]=Sie(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Hm(r.current);a.current=c==="mounted"?f:"none"},[c]),Ch(()=>{const f=r.current,p=i.current;if(p!==e){const y=a.current,v=Hm(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&y!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),Ch(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,m=v=>{const b=Hm(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=Hm(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(c),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Hm(e){return e?.animationName||"none"}function Nie(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 $w=0;function kie(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??IT()),document.body.insertAdjacentElement("beforeend",e[1]??IT()),$w++,()=>{$w===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),$w--}},[])}function IT(){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 Pa=function(){return Pa=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},Pa.apply(this,arguments)};function V3(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 Cie(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 Rg="right-scroll-bar-position",Dg="width-before-scroll-bar",Aie="with-scroll-bars-hidden",Eie="--removed-body-scroll-bar-size";function Bw(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Oie(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 _ie=typeof window<"u"?x.useLayoutEffect:x.useEffect,MT=new WeakMap;function zie(e,t){var n=Oie(null,function(r){return e.forEach(function(i){return Bw(i,r)})});return _ie(function(){var r=MT.get(n);if(r){var i=new Set(r),a=new Set(e),l=n.current;i.forEach(function(c){a.has(c)||Bw(c,null)}),a.forEach(function(c){i.has(c)||Bw(c,l)})}MT.set(n,e)},[e]),n}function Tie(e){return e}function Pie(e,t){t===void 0&&(t=Tie);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var l=t(a,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(a){for(r=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(a),l=n}var d=function(){var p=l;l=[],p.forEach(a)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){l.push(p),f()},filter:function(p){return l=l.filter(p),n}}}};return i}function Rie(e){e===void 0&&(e={});var t=Pie(null);return t.options=Pa({async:!0,ssr:!1},e),t}var Q3=function(e){var t=e.sideCar,n=V3(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,Pa({},n))};Q3.isSideCarExport=!0;function Die(e,t){return e.useMedium(t),Q3}var W3=Rie(),Uw=function(){},Bv=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:Uw,onWheelCapture:Uw,onTouchMoveCapture:Uw}),i=r[0],a=r[1],l=e.forwardProps,c=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,O=e.gapMode,C=V3(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),z=y,A=zie([n,t]),_=Pa(Pa({},C),i);return x.createElement(x.Fragment,null,p&&x.createElement(z,{sideCar:W3,removeScrollBar:f,shards:m,noRelative:v,noIsolation:w,inert:b,setCallbacks:a,allowPinchZoom:!!j,lockRef:n,gapMode:O}),l?x.cloneElement(x.Children.only(c),Pa(Pa({},_),{ref:A})):x.createElement(E,Pa({},_,{className:d,ref:A}),c))});Bv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bv.classNames={fullWidth:Dg,zeroRight:Rg};var Iie=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Mie(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Iie();return t&&e.setAttribute("nonce",t),e}function Lie(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $ie(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Bie=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Mie())&&(Lie(t,n),$ie(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Uie=function(){var e=Bie();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Y3=function(){var e=Uie(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},qie={left:0,top:0,right:0,gap:0},qw=function(e){return parseInt(e||"",10)||0},Fie=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[qw(n),qw(r),qw(i)]},Hie=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qie;var t=Fie(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])}},Kie=Y3(),Uu="data-scroll-locked",Gie=function(e,t,n,r){var i=e.left,a=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
53
|
-
.`.concat(Aie,` {
|
|
54
|
-
overflow: hidden `).concat(r,`;
|
|
55
|
-
padding-right: `).concat(c,"px ").concat(r,`;
|
|
56
|
-
}
|
|
57
|
-
body[`).concat(Uu,`] {
|
|
58
|
-
overflow: hidden `).concat(r,`;
|
|
59
|
-
overscroll-behavior: contain;
|
|
60
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
61
|
-
padding-left: `.concat(i,`px;
|
|
62
|
-
padding-top: `).concat(a,`px;
|
|
63
|
-
padding-right: `).concat(l,`px;
|
|
64
|
-
margin-left:0;
|
|
65
|
-
margin-top:0;
|
|
66
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
67
|
-
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.`).concat(Rg,` {
|
|
71
|
-
right: `).concat(c,"px ").concat(r,`;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.`).concat(Dg,` {
|
|
75
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.`).concat(Rg," .").concat(Rg,` {
|
|
79
|
-
right: 0 `).concat(r,`;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.`).concat(Dg," .").concat(Dg,` {
|
|
83
|
-
margin-right: 0 `).concat(r,`;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
body[`).concat(Uu,`] {
|
|
87
|
-
`).concat(Eie,": ").concat(c,`px;
|
|
88
|
-
}
|
|
89
|
-
`)},LT=function(){var e=parseInt(document.body.getAttribute(Uu)||"0",10);return isFinite(e)?e:0},Vie=function(){x.useEffect(function(){return document.body.setAttribute(Uu,(LT()+1).toString()),function(){var e=LT()-1;e<=0?document.body.removeAttribute(Uu):document.body.setAttribute(Uu,e.toString())}},[])},Qie=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Vie();var a=x.useMemo(function(){return Hie(i)},[i]);return x.createElement(Kie,{styles:Gie(a,!t,i,n?"":"!important")})},x1=!1;if(typeof window<"u")try{var Km=Object.defineProperty({},"passive",{get:function(){return x1=!0,!0}});window.addEventListener("test",Km,Km),window.removeEventListener("test",Km,Km)}catch{x1=!1}var uu=x1?{passive:!1}:!1,Wie=function(e){return e.tagName==="TEXTAREA"},Z3=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Wie(e)&&n[t]==="visible")},Yie=function(e){return Z3(e,"overflowY")},Zie=function(e){return Z3(e,"overflowX")},$T=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=X3(e,r);if(i){var a=J3(e,r),l=a[1],c=a[2];if(l>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Xie=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Jie=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},X3=function(e,t){return e==="v"?Yie(t):Zie(t)},J3=function(e,t){return e==="v"?Xie(t):Jie(t)},eae=function(e,t){return e==="h"&&t==="rtl"?-1:1},tae=function(e,t,n,r,i){var a=eae(e,window.getComputedStyle(t).direction),l=a*r,c=n.target,d=t.contains(c),f=!1,p=l>0,m=0,y=0;do{if(!c)break;var v=J3(e,c),w=v[0],b=v[1],j=v[2],k=b-j-a*w;(w||k)&&X3(e,c)&&(m+=k,y+=w);var E=c.parentNode;c=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(p&&Math.abs(m)<1||!p&&Math.abs(y)<1)&&(f=!0),f},Gm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},BT=function(e){return[e.deltaX,e.deltaY]},UT=function(e){return e&&"current"in e?e.current:e},nae=function(e,t){return e[0]===t[0]&&e[1]===t[1]},rae=function(e){return`
|
|
90
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
91
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
92
|
-
`)},iae=0,du=[];function aae(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(iae++)[0],a=x.useState(Y3)[0],l=x.useRef(e);x.useEffect(function(){l.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var b=Cie([e.lockRef.current],(e.shards||[]).map(UT),!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 c=x.useCallback(function(b,j){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var k=Gm(b),E=n.current,O="deltaX"in b?b.deltaX:E[0]-k[0],C="deltaY"in b?b.deltaY:E[1]-k[1],z,A=b.target,_=Math.abs(O)>Math.abs(C)?"h":"v";if("touches"in b&&_==="h"&&A.type==="range")return!1;var R=window.getSelection(),$=R&&R.anchorNode,F=$?$===A||$.contains(A):!1;if(F)return!1;var q=$T(_,A);if(!q)return!0;if(q?z=_:(z=_==="v"?"h":"v",q=$T(_,A)),!q)return!1;if(!r.current&&"changedTouches"in b&&(O||C)&&(r.current=z),!z)return!0;var B=r.current||z;return tae(B,j,b,B==="h"?O:C)},[]),d=x.useCallback(function(b){var j=b;if(!(!du.length||du[du.length-1]!==a)){var k="deltaY"in j?BT(j):Gm(j),E=t.current.filter(function(z){return z.name===j.type&&(z.target===j.target||j.target===z.shadowParent)&&nae(z.delta,k)})[0];if(E&&E.should){j.cancelable&&j.preventDefault();return}if(!E){var O=(l.current.shards||[]).map(UT).filter(Boolean).filter(function(z){return z.contains(j.target)}),C=O.length>0?c(j,O[0]):!l.current.noIsolation;C&&j.cancelable&&j.preventDefault()}}},[]),f=x.useCallback(function(b,j,k,E){var O={name:b,delta:j,target:k,should:E,shadowParent:sae(k)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(C){return C!==O})},1)},[]),p=x.useCallback(function(b){n.current=Gm(b),r.current=void 0},[]),m=x.useCallback(function(b){f(b.type,BT(b),b.target,c(b,e.lockRef.current))},[]),y=x.useCallback(function(b){f(b.type,Gm(b),b.target,c(b,e.lockRef.current))},[]);x.useEffect(function(){return du.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:y}),document.addEventListener("wheel",d,uu),document.addEventListener("touchmove",d,uu),document.addEventListener("touchstart",p,uu),function(){du=du.filter(function(b){return b!==a}),document.removeEventListener("wheel",d,uu),document.removeEventListener("touchmove",d,uu),document.removeEventListener("touchstart",p,uu)}},[]);var v=e.removeScrollBar,w=e.inert;return x.createElement(x.Fragment,null,w?x.createElement(a,{styles:rae(i)}):null,v?x.createElement(Qie,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function sae(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const oae=Die(W3,aae);var e$=x.forwardRef(function(e,t){return x.createElement(Bv,Pa({},e,{ref:t,sideCar:oae}))});e$.classNames=Bv.classNames;var lae=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},fu=new WeakMap,Vm=new WeakMap,Qm={},Fw=0,t$=function(e){return e&&(e.host||t$(e.parentNode))},cae=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=t$(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})},uae=function(e,t,n,r){var i=cae(t,Array.isArray(e)?e:[e]);Qm[n]||(Qm[n]=new WeakMap);var a=Qm[n],l=[],c=new Set,d=new Set(i),f=function(m){!m||c.has(m)||(c.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(c.has(y))p(y);else try{var v=y.getAttribute(r),w=v!==null&&v!=="false",b=(fu.get(y)||0)+1,j=(a.get(y)||0)+1;fu.set(y,b),a.set(y,j),l.push(y),b===1&&w&&Vm.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),c.clear(),Fw++,function(){l.forEach(function(m){var y=fu.get(m)-1,v=a.get(m)-1;fu.set(m,y),a.set(m,v),y||(Vm.has(m)||m.removeAttribute(r),Vm.delete(m)),v||m.removeAttribute(n)}),Fw--,Fw||(fu=new WeakMap,fu=new WeakMap,Vm=new WeakMap,Qm={})}},dae=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=lae(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),uae(r,i,n,"aria-hidden")):function(){return null}},Uv="Dialog",[n$]=Kre(Uv),[fae,va]=n$(Uv),r$=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:l=!0}=e,c=x.useRef(null),d=x.useRef(null),[f,p]=Yre({prop:r,defaultProp:i??!1,onChange:a,caller:Uv});return s.jsx(fae,{scope:t,triggerRef:c,contentRef:d,contentId:Iw(),titleId:Iw(),descriptionId:Iw(),open:f,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(m=>!m),[p]),modal:l,children:n})};r$.displayName=Uv;var i$="DialogTrigger",hae=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=va(i$,n),a=hc(t,i.triggerRef);return s.jsx(Rs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ik(i.open),...r,ref:a,onClick:Ro(e.onClick,i.onOpenToggle)})});hae.displayName=i$;var Rk="DialogPortal",[pae,a$]=n$(Rk,{forceMount:void 0}),s$=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=va(Rk,t);return s.jsx(pae,{scope:t,forceMount:n,children:x.Children.map(r,l=>s.jsx($v,{present:n||a.open,children:s.jsx(G3,{asChild:!0,container:i,children:l})}))})};s$.displayName=Rk;var py="DialogOverlay",o$=x.forwardRef((e,t)=>{const n=a$(py,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=va(py,e.__scopeDialog);return a.modal?s.jsx($v,{present:r||a.open,children:s.jsx(gae,{...i,ref:t})}):null});o$.displayName=py;var mae=B3("DialogOverlay.RemoveScroll"),gae=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=va(py,n);return s.jsx(e$,{as:mae,allowPinchZoom:!0,shards:[i.contentRef],children:s.jsx(Rs.div,{"data-state":Ik(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Jl="DialogContent",l$=x.forwardRef((e,t)=>{const n=a$(Jl,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=va(Jl,e.__scopeDialog);return s.jsx($v,{present:r||a.open,children:a.modal?s.jsx(yae,{...i,ref:t}):s.jsx(vae,{...i,ref:t})})});l$.displayName=Jl;var yae=x.forwardRef((e,t)=>{const n=va(Jl,e.__scopeDialog),r=x.useRef(null),i=hc(t,n.contentRef,r);return x.useEffect(()=>{const a=r.current;if(a)return dae(a)},[]),s.jsx(c$,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ro(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ro(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&a.preventDefault()}),onFocusOutside:Ro(e.onFocusOutside,a=>a.preventDefault())})}),vae=x.forwardRef((e,t)=>{const n=va(Jl,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return s.jsx(c$,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=a.target;n.triggerRef.current?.contains(l)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),c$=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...l}=e,c=va(Jl,n),d=x.useRef(null),f=hc(t,d);return kie(),s.jsxs(s.Fragment,{children:[s.jsx(H3,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:s.jsx(q3,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Ik(c.open),...l,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(xae,{titleId:c.titleId}),s.jsx(wae,{contentRef:d,descriptionId:c.descriptionId})]})]})}),Dk="DialogTitle",u$=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=va(Dk,n);return s.jsx(Rs.h2,{id:i.titleId,...r,ref:t})});u$.displayName=Dk;var d$="DialogDescription",f$=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=va(d$,n);return s.jsx(Rs.p,{id:i.descriptionId,...r,ref:t})});f$.displayName=d$;var h$="DialogClose",p$=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=va(h$,n);return s.jsx(Rs.button,{type:"button",...r,ref:t,onClick:Ro(e.onClick,()=>i.onOpenChange(!1))})});p$.displayName=h$;function Ik(e){return e?"open":"closed"}var m$="DialogTitleWarning",[Hze,g$]=Hre(m$,{contentName:Jl,titleName:Dk,docsSlug:"dialog"}),xae=({titleId:e})=>{const t=g$(m$),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},bae="DialogDescriptionWarning",wae=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${g$(bae).contentName}}.`;return x.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},y$=r$,v$=s$,Mk=o$,Lk=l$,$k=u$,x$=f$,b$=p$;const Bk=y$,Sae=v$,w$=x.forwardRef(({className:e,...t},n)=>s.jsx(Mk,{ref:n,className:Ji("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));w$.displayName=Mk.displayName;const jae=400,Nae=1200,kae=720,qv=x.forwardRef(({className:e,children:t,...n},r)=>{const[i,a]=x.useState(kae),l=x.useRef(!1),c=x.useRef(0),d=x.useRef(0),f=x.useCallback(y=>{l.current=!0,c.current=y.clientX,d.current=i,y.target.setPointerCapture(y.pointerId),y.preventDefault()},[i]),p=x.useCallback(y=>{if(!l.current)return;const v=c.current-y.clientX,w=Math.min(Nae,Math.max(jae,d.current+v));a(w)},[]),m=x.useCallback(()=>{l.current=!1},[]);return s.jsxs(Sae,{children:[s.jsx(w$,{}),s.jsxs(Lk,{ref:r,className:Ji("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:[s.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,s.jsxs(b$,{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:[s.jsx(yd,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});qv.displayName=Lk.displayName;const Uk=({className:e,...t})=>s.jsx("div",{className:Ji("flex flex-col gap-1.5 pr-10",e),...t}),Fv=x.forwardRef(({className:e,...t},n)=>s.jsx($k,{ref:n,className:Ji("text-lg font-medium text-zinc-50",e),...t}));Fv.displayName=$k.displayName;const Hv=x.forwardRef(({className:e,...t},n)=>s.jsx(x$,{ref:n,className:Ji("text-sm text-zinc-500",e),...t}));Hv.displayName=x$.displayName;function Cae({title:e,subtitle:t,children:n,open:r,onClose:i}){return s.jsx(Bk,{open:r,onOpenChange:a=>a?void 0:i(),children:s.jsxs(qv,{children:[s.jsxs(Uk,{className:"drawer-head",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),s.jsx(Fv,{id:"drawer-title",children:e}),s.jsx(Hv,{className:"sr-only",children:t})]}),s.jsx("div",{className:"drawer-body",children:n})]})})}function mr({text:e}){const[t,n]=x.useState(null),r=x.useRef(null),i=x.useCallback(()=>{if(!r.current)return;const l=r.current.getBoundingClientRect();n({top:l.top,left:l.left+l.width/2})},[]),a=x.useCallback(()=>n(null),[]);return s.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,children:[s.jsxs("svg",{ref:r,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[s.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),s.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),t!==null&&dc.createPortal(s.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 Aae=/[\s\-_]+/;function Eae(e){const t=e.split(Aae).filter(Boolean);return t.length===0?null:t.map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function qT(e,t){const n=Oae(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"?qi.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const l=[...i].sort((f,p)=>p.length-f.length).map(Eae).filter(f=>!!f);if(l.length===0)return r.map((f,p)=>f.type==="bold"?qi.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const c=new RegExp(`(${l.join("|")})`,"gi"),d=new Map;for(const f of n)for(const p of f.terms){const m=uy(p);m&&!d.has(m)&&d.set(m,f.className)}return r.flatMap((f,p)=>f.value.split(c).map((y,v)=>{if(!y)return null;if(v%2===1){const b=d.get(uy(y))??"answer-highlight";return f.type==="bold"?qi.createElement("mark",{key:`hl-${p}-${v}`,className:b},qi.createElement("strong",{className:"text-zinc-200 font-semibold"},y)):qi.createElement("mark",{key:`hl-${p}-${v}`,className:b},y)}return f.type==="bold"?qi.createElement("strong",{key:`b-${p}-${v}`,className:"text-zinc-200 font-semibold"},y):y})).filter(Boolean)}function Oae(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Hw(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 _ae({evidence:e,project:t,onClose:n}){const[r,i]=x.useState(!1),[a,l]=x.useState("mentions"),[c,d]=x.useState(-1),[f,p]=x.useState(null),[m,y]=x.useState(!1),[v,w]=x.useState({}),b=Qee(t.project),j=new Set(b.map(ly)),k=e.runHistory,E=k.length>1,[O,C]=x.useState(null),z=x.useRef(!1);x.useEffect(()=>{if(z.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const V=k.at(-1);V&&(z.current=!0,Ql(V.runId).then(ce=>{const re=ce.snapshots.find(ke=>ke.query===e.query&&ke.provider===e.provider);re&&C({citationState:re.citationState,answerMentioned:re.answerMentioned,visibilityState:re.visibilityState,visibilityTransition:V.visibilityTransition,provider:re.provider,model:re.model??e.model,answerSnippet:re.answerText??e.answerSnippet,citedDomains:re.citedDomains??e.citedDomains,competitorDomains:re.competitorOverlap??e.competitorDomains,recommendedCompetitors:re.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:re.matchedTerms??e.matchedTerms??[],groundingSources:re.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,k]);const A=c>=0&&f!==null,_=A?f:O||{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=_.visibilityState==="pending"||_.citationState==="pending",$=R?!1:_.visibilityState!=null?_.visibilityState==="visible":_.answerMentioned!=null?_.answerMentioned:_.citationState===kh.cited||_.citationState==="emerging",F=_.answerMentioned!=null||_.visibilityState!=null||_.recommendedCompetitors.length>0,q=_.citedDomains.length>0||_.groundingSources.length>0||_.evidenceUrls.length>0,B=t.project.displayName||t.project.name,K=[...b.map(ly),B,B.split(" ").slice(0,2).join(" "),..._.matchedTerms].filter(V=>V.trim().length>2),X=[..._.competitorDomains.flatMap(V=>{const ce=Vee(V);return ce.length>=4?[ce]:[]}),..._.recommendedCompetitors].filter(V=>V.trim().length>2),Q=[{terms:K,className:"answer-highlight-brand"},...X.length>0?[{terms:X,className:"answer-highlight-competitor"}]:[]],H=R?"pending":_.visibilityTransition==="lost"?"lost":$?"cited":"not-cited",J=x.useRef(0),de=x.useCallback(async V=>{const ce=++J.current;if(V===-1||V===k.length-1){d(-1),p(null),i(!1);return}d(V),i(!1);const re=k[V],ke=`${re.runId}::${e.query}::${e.provider}`;if(v[ke]){p(v[ke]);return}y(!0);try{const ze=await Ql(re.runId);if(ce!==J.current)return;const te=ze.snapshots.find(Ee=>Ee.query===e.query&&Ee.provider===e.provider)??ze.snapshots.find(Ee=>Ee.query===e.query),fe=te?{citationState:te.citationState,answerMentioned:te.answerMentioned,visibilityState:te.visibilityState,visibilityTransition:re.visibilityTransition,provider:te.provider,model:te.model??null,answerSnippet:te.answerText??"",citedDomains:te.citedDomains,competitorDomains:te.competitorOverlap,recommendedCompetitors:te.recommendedCompetitors??[],matchedTerms:te.matchedTerms??[],groundingSources:te.groundingSources,evidenceUrls:[],changeLabel:Hw(re.visibilityTransition,re.visibilityState),summary:""}:{citationState:re.citationState,answerMentioned:re.answerMentioned,visibilityState:re.visibilityState,visibilityTransition:re.visibilityTransition,provider:e.provider,model:re.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Hw(re.visibilityTransition,re.visibilityState),summary:"Snapshot data not available for this run."};w(Ee=>({...Ee,[ke]:fe})),p(fe)}catch{if(ce!==J.current)return;p({citationState:re.citationState,answerMentioned:re.answerMentioned,visibilityState:re.visibilityState,visibilityTransition:re.visibilityTransition,provider:e.provider,model:re.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Hw(re.visibilityTransition,re.visibilityState),summary:"Failed to load historical run data."})}finally{ce===J.current&&y(!1)}},[k,e.query,e.provider,v]),M=(A||e.historyScope!=="provider")&&_.model?`${_.provider} (${_.model}) · ${_.changeLabel.toLowerCase()}`:`${_.provider} · ${_.changeLabel.toLowerCase()}`,D=!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(" · "):"",U=$?{label:"Visible in answer",title:"Your brand or domain is mentioned in this answer",meta:M}:_.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},I=()=>{if(!_.answerSnippet)return null;const V=_.answerSnippet.split(`
|
|
97
|
-
`),ce=[];let re=[],ke=0;const ze=()=>{if(re.length===0)return;const te=re.join(" ").trim();te&&ce.push(s.jsx("p",{className:ce.length>0?"mt-2.5":"",children:qT(te,Q)},ke++)),re=[]};for(const te of V){const fe=te.trim();if(/^[-\u2013\u2014]{3,}$/.test(fe)){ze(),ce.push(s.jsx("hr",{className:"border-zinc-800/60 my-3"},ke++));continue}const Ee=fe.match(/^(#{1,3})\s+(.+)$/);if(Ee){ze();const Z=Ee[1].length,Ge=Ee[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||Ee[2],Me=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";ce.push(s.jsx("p",{className:Me,children:qT(Ge,Q)},ke++));continue}if(fe===""){ze();continue}re.push(fe)}return ze(),ce};return s.jsx(y$,{open:!0,onOpenChange:V=>{V||n()},children:s.jsxs(v$,{children:[s.jsx(Mk,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),s.jsxs(Lk,{className:"evidence-modal","aria-describedby":void 0,children:[s.jsxs("div",{className:"evidence-modal-header",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," ","·"," ",_.provider||"All providers"]}),s.jsx($k,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),s.jsxs(b$,{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:[s.jsx(yd,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]}),E&&s.jsxs("div",{className:"evidence-modal-timeline",children:[s.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),s.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:k.map((V,ce)=>{const re=c===-1&&ce===k.length-1||c===ce,ke=V.visibilityState??(V.answerMentioned?"visible":"not-visible"),ze=V.visibilityTransition??ke,te=ke==="visible"?"bg-emerald-400":ze==="emerging"?"bg-amber-400":ze==="lost"?"bg-rose-400":"bg-zinc-600",Ee=new Date(V.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Z=!!(V.model&&ce>0&&k[ce-1]?.model&&k[ce-1].model!==V.model);return s.jsxs("button",{type:"button",className:`evidence-run-dot ${re?"evidence-run-dot--selected":""}`,onClick:()=>de(ce===k.length-1?-1:ce),"aria-label":[`Run ${Ee}: ${ke}`,V.model?`model ${V.model}`:null,Z?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":re,children:[s.jsx("span",{className:`size-2 rounded-full ${te} ${Z?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),s.jsx("span",{className:"text-[10px] text-zinc-500",children:Ee})]},ce)})}),c>=0&&c<k.length&&s.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(k[c].createdAt).toLocaleString()," ","—"," ",s.jsx("span",{className:"capitalize",children:k[c].visibilityState??(k[c].answerMentioned?"visible":"not-visible")}),s.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>de(-1),children:["←"," Back to latest"]})]}),!A&&(e.modelTransitions?.length??0)>0&&s.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(V=>s.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:`${V.fromModel??"unknown"} -> ${V.toModel??"unknown"} on ${new Date(V.createdAt).toLocaleDateString()}`},`${V.runId}:${V.toModel??"unknown"}`))})]}),s.jsxs("div",{className:"evidence-modal-body",children:[m&&s.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&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"evidence-modal-main",children:[s.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${H}`,children:[s.jsx("p",{className:`evidence-position-label evidence-position-label--${H}`,children:U.label}),s.jsx("p",{className:`evidence-position-title evidence-position-title--${H}`,children:U.title}),s.jsx("p",{className:"evidence-position-meta",children:U.meta}),D&&s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:D})]}),_.answerSnippet&&s.jsxs("div",{children:[s.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),s.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:I()}),_.answerSnippet.length>280&&s.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>i(!r),children:r?"↑ Collapse":"↓ Show full answer"})]}),!_.answerSnippet&&!m&&s.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&&s.jsxs("div",{children:[s.jsx("p",{className:"drawer-section-label",children:$?"Why you're visible":"What to fix"}),s.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((V,ce)=>s.jsxs("div",{className:"action-item",children:[s.jsx("svg",{className:`action-item-icon ${$?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:$?s.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):s.jsxs(s.Fragment,{children:[s.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),s.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),s.jsx("span",{className:"action-item-text",children:V})]},ce))})]}),_.summary&&s.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:_.summary})]}),s.jsxs("div",{className:"evidence-modal-sidebar",children:[(F||q)&&s.jsxs("div",{className:"sidebar-tabs",children:[s.jsx("button",{className:`sidebar-tab ${a==="mentions"?"sidebar-tab--active":""}`,onClick:()=>l("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),s.jsx("button",{className:`sidebar-tab ${a==="sources"?"sidebar-tab--active":""}`,onClick:()=>l("sources"),type:"button",title:"Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.",children:"Sources"})]}),a==="mentions"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsxs("div",{className:"drawer-section-label flex items-center",children:[s.jsx("span",{children:"Answer visibility"}),s.jsx(mr,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),s.jsxs("div",{className:`mention-status mention-status--${$?"visible":"not-visible"}`,children:[s.jsx("span",{className:"mention-status-icon",children:R?"…":$?"✓":"—"}),s.jsx("span",{className:"mention-status-label",children:R?"Pending":$?"Visible":"Not visible"})]}),_.matchedTerms.length>0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:_.matchedTerms.map(V=>s.jsx("span",{className:"mention-chip mention-chip--brand",children:V},V))})]}),!R&&!$&&_.matchedTerms.length===0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:K.map(V=>s.jsx("span",{className:"mention-chip mention-chip--muted",children:V},V))}),s.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(_.recommendedCompetitors.length>0||_.competitorDomains.length>0)&&s.jsxs("div",{children:[s.jsxs("div",{className:"drawer-section-label flex items-center",children:[s.jsx("span",{children:"Competitors in answer"}),s.jsx(mr,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const V=_.competitorDomains.map(ke=>ke.replace(/^www\./,"")),ce=new Set(V.map(ke=>uy(ke.replace(/\.[^.]+$/,""))));return[..._.recommendedCompetitors.filter(ke=>!ce.has(uy(ke))),...V].map(ke=>s.jsx("span",{className:"mention-chip mention-chip--competitor",children:ke},ke))})()})]})]}),a==="sources"&&s.jsxs(s.Fragment,{children:[_.citedDomains.length>0&&s.jsxs("div",{children:[s.jsxs("div",{className:"drawer-section-label flex items-center",children:[s.jsx("span",{children:"Domains from source links"}),s.jsx(mr,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),s.jsx("div",{className:"citation-leaderboard",children:_.citedDomains.map((V,ce)=>{const re=V.toLowerCase().replace(/^www\./,""),ke=j.has(re),ze=!ke&&_.competitorDomains.some(fe=>fe.toLowerCase().replace(/^www\./,"")===re),te=ke?"you":ze?"competitor":"other";return s.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${te}`,children:[s.jsxs("span",{className:"citation-leaderboard-rank",children:["#",ce+1]}),s.jsx("span",{className:"citation-leaderboard-domain",children:V}),ke&&s.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),ze&&s.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},V)})})]}),_.groundingSources.length>0&&s.jsxs("div",{children:[s.jsxs("div",{className:"drawer-section-label flex items-center",children:[s.jsxs("span",{children:["Grounding source links (",_.groundingSources.length,")"]}),s.jsx(mr,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),s.jsx("ul",{className:"grid gap-0.5",children:_.groundingSources.map((V,ce)=>s.jsx("li",{className:"truncate text-sm",children:s.jsx("a",{href:V.uri,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:V.title||V.uri})},ce))})]}),_.evidenceUrls.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),s.jsx("ul",{className:"grid gap-1",children:_.evidenceUrls.map(V=>s.jsx("li",{className:"truncate text-sm",children:s.jsx("a",{href:V,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:V})},V))})]}),_.citedDomains.length===0&&_.groundingSources.length===0&&_.evidenceUrls.length===0&&s.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&&!q&&s.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 ca(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 Kw=[{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 Kv(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 zae=Kv({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"}),Tae=Kv({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"}),Pae=Kv({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"}),Rae=Kv({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"}),Dae=[{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:ca(["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:ca(["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:ca(["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:ca(["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:ca(["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:ca(["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:ca(["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:ca(["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:ca(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Kw[0],Kw[1],ca(["cited","cited","cited","cited","cited"]),Kw[2],2/7,ca(["not-cited","not-cited","not-cited","cited"]);function Iae(e,t){return e.projects.find(n=>n.project.id===t)}function Mae(e,t){return e.runs.find(n=>n.id===t)}function Lae(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 $ae={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral"},Bae={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited"},Uae={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor"};function qae(e){return{id:e.id,tone:$ae[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??Uae[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:Bae[e.type]}]}}function Fae(e){return e.filter(t=>!t.dismissed).map(qae)}function S$(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 FT(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function Hae(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 j$(e){switch(e){case ht["answer-visibility"]:return"Answer visibility sweep";case ht["gsc-sync"]:return"GSC sync";case ht["inspect-sitemap"]:return"Sitemap inspection";case ht["ga-sync"]:return"GA sync";case ht["traffic-sync"]:return"Traffic sync";case ht["bing-inspect"]:return"Bing URL inspection";case ht["bing-inspect-sitemap"]:return"Bing sitemap inspection";case ht["site-audit"]:return"Site audit";case ht["backlink-extract"]:return"Backlink extract";case ht["aeo-discover-seed"]:return"Discovery (seed phase)";case ht["aeo-discover-probe"]:return"Discovery (probe phase)"}}function Kae(e){return e===oh.manual?"Manual":e===oh.scheduled?"Scheduled":e===oh["config-apply"]?"Config apply":e}function qk(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:j$(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?FT(e.startedAt):FT(e.createdAt),duration:Hae(e.startedAt,e.finishedAt),statusDetail:e.error?N$(e.error):Gae(e),summary:Vae(e),triggerLabel:Kae(e.trigger)}}function N$(e){const t=wk(e);return t.length>200?t.slice(0,200)+"…":t}function Gae(e){switch(e.status){case pr.queued:return"Waiting for execution slot.";case pr.running:return"Provider queries in progress.";case pr.completed:return"All queries checked.";case pr.partial:return"Run completed with some queries skipped.";case pr.failed:return e.error?N$(e.error):"Run failed.";case pr.cancelled:return"Run was cancelled.";default:return""}}function Vae(e){const t=j$(e.kind);switch(e.status){case pr.queued:return`${t} queued`;case pr.running:return`${t} in progress`;case pr.completed:return`${t} completed`;case pr.partial:return`${t} partially completed`;case pr.failed:return`${t} failed`;case pr.cancelled:return`${t} cancelled`;default:return e.status}}function Qae(e,t,n,r){const i=[];let a=0;const l=new Set;if(n.length>0){const c=n.flatMap(w=>w.snapshots),d=new Map;for(const w of c)if(w.query){const b=`${w.query}::${w.provider}::${w.location??""}`;d.set(b,w)}const f=new Set(c.map(w=>w.location??null));f.size===0&&f.add(null);const p=new Set(c.map(w=>w.provider)),m=new Set(t.flatMap(w=>Object.keys(w.providerRuns??{}))),y=[...new Set([...p,...m])].sort(),v=y.length>0?y:["gemini"];for(const w of t){if(w.runs.length===0)continue;l.add(w.query);const b=w.runs.at(-1),j=b?.transition??"not-cited";for(const k of v){const E=[...f].filter(z=>d.has(`${w.query}::${k}::${z??""}`)),O=(w.providerRuns?.[k]?.length??0)>0,C=E.length>0?E:O?[null]:[];for(const z of C){const A=z??"",_=d.get(`${w.query}::${k}::${A}`),R=_?.model??null,$=R?`${k}:${R}`:null,F=w.providerRuns?.[k],q=$?w.modelRuns?.[$]:void 0,B=fe=>fe?.filter(Ee=>(Ee.location??null)===z),K=E.length>0?B(F):F,X=E.length>0?B(q):q,Q=(K?.length?K:null)??(X?.length?X:null),H=K?.length?"provider":X?.length?"model":"query",J=Q?Q.at(-1).transition:j,de=Q?Q.at(-1).visibilityTransition??(Q.at(-1).visibilityState==="visible"?"visible":"not-visible"):b?.visibilityTransition??(b?.visibilityState==="visible"?"visible":"not-visible"),be=Q?.at(-1)?.citationState,M=Q?.at(-1)?.visibilityState,D=_?J==="lost"?"lost":J==="emerging"?"emerging":_.citationState===kh.cited?"cited":"not-cited":be===kh.cited?"cited":"not-cited",U=_?.visibilityState??(M==="visible"?"visible":M==="pending"?"pending":"not-visible"),I=HT(Q||w.runs),V=KT(Q||w.runs),ce=Wae(w,k),re=(Q??w.runs).map(fe=>({runId:fe.runId,citationState:fe.citationState,createdAt:fe.createdAt,model:ce.get(fe.runId)??null,answerMentioned:fe.answerMentioned,visibilityState:fe.visibilityState,visibilityTransition:fe.visibilityTransition})),ke=Yae(re),ze=H==="provider"&&ke.length<=1?"model":H,te=Zae(re);i.push({id:`evidence_${e}_${a++}`,query:w.query,provider:_?.provider??k,model:_?.model??null,location:_?.location??z,citationState:D,answerMentioned:_?.answerMentioned,visibilityState:U,visibilityChangeLabel:GT(de,V,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:GT(J,I),answerSnippet:_?.answerText??"",citedDomains:_?.citedDomains??[],evidenceUrls:[],competitorDomains:_?.competitorOverlap??[],recommendedCompetitors:_?.recommendedCompetitors??[],matchedTerms:_?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:_?.groundingSources??[],summary:Xae(U,de,w.query),runHistory:re,historyScope:ze,modelsSeen:ke,modelTransitions:te})}}}}for(const c of r)l.has(c.query)||i.push({id:`evidence_${e}_${a++}`,query:c.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:`"${c.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"query",modelsSeen:[],modelTransitions:[]});return i}function Wae(e,t){const n=new Map,r=`${t}:`;for(const[i,a]of Object.entries(e.modelRuns??{})){if(!i.startsWith(r))continue;const l=i.slice(r.length),c=l==="unknown"?null:l;for(const d of a)n.set(d.runId,c)}return n}function Yae(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function Zae(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 HT(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 KT(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 GT(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?`${Rf(r.positive)} in latest run`:`${Rf(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return Rf(r.first);case"not-cited":case"not-visible":return t<=1?`${Rf(r.negative)} in latest run`:`${Rf(r.negative)} across ${t} runs`;default:return e}}function Rf(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Xae(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 Jae(e){const t=S$(e.project),n=Qae(t.name,e.timeline,e.latestRunDetails,e.queries),i=[...e.runs].sort((a,l)=>l.createdAt.localeCompare(a.createdAt)).map(a=>qk(a,e.project.displayName||e.project.name));return e.overview?ese(t,e.overview,n,i):tse(t,n,i)}function ese(e,t,n,r){const i=Fae(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 tse(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 nse(e){const t=S$(e.project),n=[...e.runs].sort((y,v)=>v.createdAt.localeCompare(y.createdAt)),r=n.find(y=>y.kind===ht["answer-visibility"])??n[0],i=e.project.displayName||e.project.name,a=r?qk(r,i):rse(e.project.id,i),l=e.overview;if(!l)return{project:t,visibilityScore:0,visibilityDelta:"No data",visibilityTone:"neutral",lastRun:a,insight:"No runs completed yet.",trend:[],competitorPressureLabel:"None"};const c=l.scores.visibility,d=c.progress??0,f=l.queryCounts.citedQueries,p=l.queryCounts.totalQueries,m=l.providers.length;return{project:t,visibilityScore:d,visibilityDelta:p>0?`${f} of ${p} queries`:"No data",visibilityTone:c.tone,providerCoverage:c.providerCoverage,lastRun:a,insight:p>0?`${f} of ${p} queries visible across ${m} provider${m===1?"":"s"}.`:"No runs completed yet.",trend:[],competitorPressureLabel:l.scores.competitorPressure.value}}function rse(e,t){return{id:"none",projectId:e,projectName:t,kind:ht["answer-visibility"],kindLabel:"No runs yet",status:pr.queued,trigger:oh.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function ise(e,t){const n=[],r=[],i=[];for(const l of e){r.push(Jae(l)),i.push(nse(l));const c=[...l.runs].sort((d,f)=>f.createdAt.localeCompare(d.createdAt));for(const d of c)n.push(qk(d,l.project.displayName||l.project.name))}n.sort((l,c)=>c.createdAt.localeCompare(l.createdAt));const a=e.length>0;return{portfolioOverview:{projects:i,attentionItems:a?ase(r):[{id:"attention_setup",tone:"neutral",title:"No projects yet",detail:"Create your first project using the setup wizard, CLI, or API.",actionLabel:"Open setup",href:"/setup"}],recentRuns:n.slice(0,5),systemHealth:[{id:"api",label:"API",tone:"positive",detail:"Connected",meta:"Real-time data"},{id:"provider",label:"Gemini",tone:"positive",detail:"Configured",meta:"Provider active"}],lastUpdatedAt:new Date().toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),...a?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small query set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:r,runs:n,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},queryImportState:{mode:"paste",queryCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:a,ctaLabel:a?"Trigger run":"Create a project first",summary:a?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(l=>({name:l.name,displayName:l.displayName,keyUrl:l.keyUrl,modelHint:l.modelHint,model:l.model,state:l.configured?"ready":"needs-config",detail:l.configured?"Provider is configured.":"API key is missing.",quota:l.quota})),google:{state:t?.google?.configured?"ready":"needs-config",detail:t?.google?.configured?"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard.":"Google OAuth client ID and client secret are not configured yet."},bing:{state:t?.bing?.configured?"ready":"needs-config",detail:t?.bing?.configured?"Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.":"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}}}function ase(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===pr.running||a.status===pr.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 _e={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"]},discovery:{project:e=>["discovery",e],sessions:e=>["discovery",e,"sessions"],session:(e,t)=>["discovery",e,"sessions",t],promotePreview:(e,t)=>["discovery",e,"sessions",t,"promote-preview"]},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]}},k$=x.createContext(null);k$.Provider;function Zh(){return x.useContext(k$)}function mc(e){const n=Zh()?.dashboard??null,r=Vn({queryKey:_e.projects.all,queryFn:Av,enabled:!n}),i=Vn({queryKey:_e.runs.all,queryFn:Q5,enabled:!n,staleTime:u1,refetchInterval:w=>w.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:u1}),a=Vn({queryKey:_e.settings,queryFn:()=>lk().catch(()=>null),enabled:!n}),l=r.data??[],c=i.data??[],d=S5({queries:l.map(w=>{const b=c.filter(A=>A.projectId===w.id),j=b.filter(A=>(A.status==="completed"||A.status==="partial")&&A.kind==="answer-visibility").sort((A,_)=>_.createdAt.localeCompare(A.createdAt)),k=j[0]?.createdAt??null,E=k?j.filter(A=>A.createdAt===k).map(A=>A.id):[],O=j.find(A=>A.createdAt!==k)?.createdAt??null,C=O?j.filter(A=>A.createdAt===O).map(A=>A.id):[],z=[...E].sort().join(",");return{queryKey:_e.projects.detail(w.id,z||void 0),queryFn:async()=>{const[A,_,R,$,F,q,B,K,X]=await Promise.all([wV(w.name).catch(()=>[]),W5(w.name).catch(()=>[]),Y5(w.name).catch(()=>[]),E.length?Promise.all(E.map(Q=>Ql(Q).catch(()=>null))).then(Q=>Q.filter(H=>H!=null)):Promise.resolve([]),C.length?Promise.all(C.map(Q=>Ql(Q).catch(()=>null))).then(Q=>Q.filter(H=>H!=null)):Promise.resolve([]),ck(w.name).catch(()=>null),uk(w.name).catch(()=>null),PQ(w.name).catch(()=>null),SV(w.name).catch(()=>null)]);return{project:w,runs:b,queries:A,competitors:_,timeline:R,latestRunDetails:$,previousRunDetails:F,gscCoverage:q,bingCoverage:B,dbInsights:K,overview:X}},enabled:!n&&r.isSuccess&&i.isSuccess,staleTime:o4}})}),f=d.every(w=>w.isSuccess),p=x.useMemo(()=>{if(n)return n;if(!r.data||!i.data||l.length>0&&!f)return null;const w=d.map(b=>b.data?{...b.data,runs:c.filter(j=>j.projectId===b.data.project.id)}:null).filter(b=>b!=null);return ise(w,a.data??null)},[n,r.data,i.data,a.data,f,d,l.length,c]),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 sse(){const e=await DQ("/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 Gv(e,t){return Vn({queryKey:_e.health,queryFn:sse,enabled:e,refetchInterval:15e3,initialData:t})}function ose(e){return Vn({queryKey:_e.runs.detail(e??""),queryFn:()=>Ql(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function bd(){const e=Ko(),t=Cv({strict:!1}),n=li({select:d=>d.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:d=>e({to:n,from:ui.to,search:f=>({...f,runId:d,evidenceId:void 0})}),openEvidence:d=>e({to:n,from:ui.to,search:f=>({...f,evidenceId:d,runId:void 0})}),closeDrawer:()=>e({to:n,from:ui.to,search:d=>({...d,runId:void 0,evidenceId:void 0})})}}const lse={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function cse(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function use(){const e=x.useSyncExternalStore(XQ,B2,B2),t=Ko(),{openRun:n}=bd(),r=x.useCallback(a=>{c1(a)},[]),i=x.useCallback(a=>{a.cta&&(a.cta.intent==="open-run-drawer"?n(a.cta.runId):t({to:"/runs"}),c1(a.id))},[t,n]);return e.length===0?null:s.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(a=>s.jsxs("section",{role:a.tone==="negative"?"alert":"status","aria-live":a.tone==="negative"?"assertive":"polite","data-state":a.state,className:`toast-card ${lse[a.tone]}`,children:[s.jsxs("div",{className:"toast-copy",children:[s.jsx("p",{className:"toast-title",children:a.title}),a.detail?s.jsx("p",{className:"toast-detail",children:a.detail}):null,a.cta?s.jsx("button",{type:"button",className:"toast-action",onClick:()=>i(a),"aria-label":cse(a),children:a.cta.label}):null]}),s.jsx("button",{type:"button",onClick:()=>r(a.id),className:"toast-dismiss","aria-label":"Dismiss",children:s.jsx(yd,{className:"size-3.5"})})]},a.id))})}function dse(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const fse=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hse=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pse={};function VT(e,t){return(pse.jsx?hse:fse).test(e)}const mse=/[ \t\n\f\r]/g;function gse(e){return typeof e=="object"?e.type==="text"?QT(e.value):!1:QT(e)}function QT(e){return e.replace(mse,"")===""}let Xh=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Xh.prototype.normal={};Xh.prototype.property={};Xh.prototype.space=void 0;function C$(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Xh(n,r,t)}function b1(e){return e.toLowerCase()}class fi{constructor(t,n){this.attribute=n,this.property=t}}fi.prototype.attribute="";fi.prototype.booleanish=!1;fi.prototype.boolean=!1;fi.prototype.commaOrSpaceSeparated=!1;fi.prototype.commaSeparated=!1;fi.prototype.defined=!1;fi.prototype.mustUseProperty=!1;fi.prototype.number=!1;fi.prototype.overloadedBoolean=!1;fi.prototype.property="";fi.prototype.spaceSeparated=!1;fi.prototype.space=void 0;let yse=0;const ut=gc(),Mn=gc(),w1=gc(),Oe=gc(),Yt=gc(),qu=gc(),wi=gc();function gc(){return 2**++yse}const S1=Object.freeze(Object.defineProperty({__proto__:null,boolean:ut,booleanish:Mn,commaOrSpaceSeparated:wi,commaSeparated:qu,number:Oe,overloadedBoolean:w1,spaceSeparated:Yt},Symbol.toStringTag,{value:"Module"})),Gw=Object.keys(S1);class Fk extends fi{constructor(t,n,r,i){let a=-1;if(super(t,n),WT(this,"space",i),typeof r=="number")for(;++a<Gw.length;){const l=Gw[a];WT(this,Gw[a],(r&S1[l])===S1[l])}}}Fk.prototype.defined=!0;function WT(e,t,n){n&&(e[t]=n)}function wd(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new Fk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[b1(r)]=r,n[b1(a.attribute)]=r}return new Xh(t,n,e.space)}const A$=wd({properties:{ariaActiveDescendant:null,ariaAtomic:Mn,ariaAutoComplete:null,ariaBusy:Mn,ariaChecked:Mn,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:Yt,ariaCurrent:null,ariaDescribedBy:Yt,ariaDetails:null,ariaDisabled:Mn,ariaDropEffect:Yt,ariaErrorMessage:null,ariaExpanded:Mn,ariaFlowTo:Yt,ariaGrabbed:Mn,ariaHasPopup:null,ariaHidden:Mn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Yt,ariaLevel:Oe,ariaLive:null,ariaModal:Mn,ariaMultiLine:Mn,ariaMultiSelectable:Mn,ariaOrientation:null,ariaOwns:Yt,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:Mn,ariaReadOnly:Mn,ariaRelevant:null,ariaRequired:Mn,ariaRoleDescription:Yt,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:Mn,ariaSetSize:Oe,ariaSort:null,ariaValueMax:Oe,ariaValueMin:Oe,ariaValueNow:Oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function E$(e,t){return t in e?e[t]:t}function O$(e,t){return E$(e,t.toLowerCase())}const vse=wd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qu,acceptCharset:Yt,accessKey:Yt,action:null,allow:null,allowFullScreen:ut,allowPaymentRequest:ut,allowUserMedia:ut,alt:null,as:null,async:ut,autoCapitalize:null,autoComplete:Yt,autoFocus:ut,autoPlay:ut,blocking:Yt,capture:null,charSet:null,checked:ut,cite:null,className:Yt,cols:Oe,colSpan:null,content:null,contentEditable:Mn,controls:ut,controlsList:Yt,coords:Oe|qu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ut,defer:ut,dir:null,dirName:null,disabled:ut,download:w1,draggable:Mn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ut,formTarget:null,headers:Yt,height:Oe,hidden:w1,high:Oe,href:null,hrefLang:null,htmlFor:Yt,httpEquiv:Yt,id:null,imageSizes:null,imageSrcSet:null,inert:ut,inputMode:null,integrity:null,is:null,isMap:ut,itemId:null,itemProp:Yt,itemRef:Yt,itemScope:ut,itemType:Yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ut,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:ut,muted:ut,name:null,nonce:null,noModule:ut,noValidate:ut,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:ut,optimum:Oe,pattern:null,ping:Yt,placeholder:null,playsInline:ut,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ut,referrerPolicy:null,rel:Yt,required:ut,reversed:ut,rows:Oe,rowSpan:Oe,sandbox:Yt,scope:null,scoped:ut,seamless:ut,selected:ut,shadowRootClonable:ut,shadowRootDelegatesFocus:ut,shadowRootMode:null,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:Mn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oe,step:null,style:null,tabIndex:Oe,target:null,title:null,translate:null,type:null,typeMustMatch:ut,useMap:null,value:Mn,width:Oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Yt,axis:null,background:null,bgColor:null,border:Oe,borderColor:null,bottomMargin:Oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ut,declare:ut,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:ut,noHref:ut,noShade:ut,noWrap:ut,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:Mn,standby:null,summary:null,text:null,topMargin:Oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ut,disableRemotePlayback:ut,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:O$}),xse=wd({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:wi,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:Yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Oe,diffuseConstant:Oe,direction:null,display:null,dur:null,divisor:Oe,dominantBaseline:null,download:ut,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oe,enableBackground:null,end:null,event:null,exponent:Oe,externalResourcesRequired:null,fill:null,fillOpacity:Oe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:qu,g2:qu,glyphName:qu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:wi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Oe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:wi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:wi,rev:wi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:wi,requiredFeatures:wi,requiredFonts:wi,requiredFormats:wi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:wi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:wi,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:wi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:E$}),_$=wd({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()}}),z$=wd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:O$}),T$=wd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),bse={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"},wse=/[A-Z]/g,YT=/-[a-z]/g,Sse=/^data[-\w.:]+$/i;function jse(e,t){const n=b1(t);let r=t,i=fi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Sse.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(YT,kse);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!YT.test(a)){let l=a.replace(wse,Nse);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Fk}return new i(r,t)}function Nse(e){return"-"+e.toLowerCase()}function kse(e){return e.charAt(1).toUpperCase()}const Cse=C$([A$,vse,_$,z$,T$],"html"),Hk=C$([A$,xse,_$,z$,T$],"svg");function Ase(e){return e.join(" ").trim()}var hu={},Vw,ZT;function Ese(){if(ZT)return Vw;ZT=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\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,O=1;function C(X){var Q=X.match(t);Q&&(E+=Q.length);var H=X.lastIndexOf(d);O=~H?X.length-H:O+X.length}function z(){var X={line:E,column:O};return function(Q){return Q.position=new A(X),$(),Q}}function A(X){this.start=X,this.end={line:E,column:O},this.source=k.source}A.prototype.content=j;function _(X){var Q=new Error(k.source+":"+E+":"+O+": "+X);if(Q.reason=X,Q.filename=k.source,Q.line=E,Q.column=O,Q.source=j,!k.silent)throw Q}function R(X){var Q=X.exec(j);if(Q){var H=Q[0];return C(H),j=j.slice(H.length),Q}}function $(){R(n)}function F(X){var Q;for(X=X||[];Q=q();)Q!==!1&&X.push(Q);return X}function q(){var X=z();if(!(f!=j.charAt(0)||p!=j.charAt(1))){for(var Q=2;m!=j.charAt(Q)&&(p!=j.charAt(Q)||f!=j.charAt(Q+1));)++Q;if(Q+=2,m===j.charAt(Q-1))return _("End of comment missing");var H=j.slice(2,Q-2);return O+=2,C(H),j=j.slice(Q),O+=2,X({type:y,comment:H})}}function B(){var X=z(),Q=R(r);if(Q){if(q(),!R(i))return _("property missing ':'");var H=R(a),J=X({type:v,property:b(Q[0].replace(e,m)),value:H?b(H[0].replace(e,m)):m});return R(l),J}}function K(){var X=[];F(X);for(var Q;Q=B();)Q!==!1&&(X.push(Q),F(X));return X}return $(),K()}function b(j){return j?j.replace(c,m):m}return Vw=w,Vw}var XT;function Ose(){if(XT)return hu;XT=1;var e=hu&&hu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(hu,"__esModule",{value:!0}),hu.default=n;const t=e(Ese());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),c=typeof i=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;c?i(f,p,d):p&&(a=a||{},a[f]=p)}),a}return hu}var Df={},JT;function _se(){if(JT)return Df;JT=1,Object.defineProperty(Df,"__esModule",{value:!0}),Df.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},l=function(f,p){return p.toUpperCase()},c=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,c):f=f.replace(r,c),f.replace(t,l))};return Df.camelCase=d,Df}var If,eP;function zse(){if(eP)return If;eP=1;var e=If&&If.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Ose()),n=_se();function r(i,a){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(c,d){c&&d&&(l[(0,n.camelCase)(c,a)]=d)}),l}return r.default=r,If=r,If}var Tse=zse();const Pse=ya(Tse),P$=R$("end"),Kk=R$("start");function R$(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 Rse(e){const t=Kk(e),n=P$(e);if(t&&n)return{start:t,end:n}}function lh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?tP(e.position):"start"in e||"end"in e?tP(e):"line"in e||"column"in e?j1(e):""}function j1(e){return nP(e&&e.line)+":"+nP(e&&e.column)}function tP(e){return j1(e&&e.start)+"-"+j1(e&&e.end)}function nP(e){return e&&typeof e=="number"?e:1}class Pr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(l=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const c=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=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=lh(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Pr.prototype.file="";Pr.prototype.name="";Pr.prototype.reason="";Pr.prototype.message="";Pr.prototype.stack="";Pr.prototype.column=void 0;Pr.prototype.line=void 0;Pr.prototype.ancestors=void 0;Pr.prototype.cause=void 0;Pr.prototype.fatal=void 0;Pr.prototype.place=void 0;Pr.prototype.ruleId=void 0;Pr.prototype.source=void 0;const Gk={}.hasOwnProperty,Dse=new Map,Ise=/[A-Z]/g,Mse=new Set(["table","tbody","thead","tfoot","tr"]),Lse=new Set(["td","th"]),D$="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $se(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=Vse(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=Gse(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"?Hk:Cse,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 Bse(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Use(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Fse(e,t,n);if(t.type==="mdxjsEsm")return qse(e,t);if(t.type==="root")return Hse(e,t,n);if(t.type==="text")return Kse(e,t)}function Bse(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Hk,e.schema=i),e.ancestors.push(t);const a=L$(e,t.tagName,!1),l=Qse(e,t);let c=Qk(e,t);return Mse.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!gse(d):!0})),M$(e,l,a,t),Vk(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function Use(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)}Eh(e,t.position)}function qse(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Eh(e,t.position)}function Fse(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Hk,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:L$(e,t.name,!0),l=Wse(e,t),c=Qk(e,t);return M$(e,l,a,t),Vk(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function Hse(e,t,n){const r={};return Vk(r,Qk(e,t)),e.create(t,e.Fragment,r,n)}function Kse(e,t){return t.value}function M$(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Vk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Gse(e,t,n){return r;function r(i,a,l,c){const f=Array.isArray(l.children)?n:t;return c?f(a,l,c):f(a,l)}}function Vse(e,t){return n;function n(r,i,a,l){const c=Array.isArray(a.children),d=Kk(r);return t(i,a,l,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function Qse(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Gk.call(t.properties,i)){const a=Yse(e,i,t.properties[i]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&Lse.has(t.tagName)?r=c:n[l]=c}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Wse(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Eh(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 c=r.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else Eh(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Qk(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Dse;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=i.get(d)||0;l=d+"-"+f,i.set(d,f+1)}}const c=I$(e,a,l);c!==void 0&&n.push(c)}return n}function Yse(e,t,n){const r=jse(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?dse(n):Ase(n)),r.property==="style"){let i=typeof n=="object"?n:Zse(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Xse(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?bse[r.property]||r.property:r.attribute,n]}}function Zse(e,t){try{return Pse(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Pr("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=D$+"#cannot-parse-style-attribute",i}}function L$(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,l;for(;++a<i.length;){const c=VT(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}r=l}else r=VT(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Gk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Eh(e)}function Eh(e,t){const n=new Pr("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=D$+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Xse(e){const t={};let n;for(n in e)Gk.call(e,n)&&(t[Jse(n)]=e[n]);return t}function Jse(e){let t=e.replace(Ise,eoe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function eoe(e){return"-"+e.toLowerCase()}const Qw={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"]},toe={};function noe(e,t){const n=toe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return $$(e,r,i)}function $$(e,t,n){if(roe(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 rP(e.children,t,n)}return Array.isArray(e)?rP(e,t,n):""}function rP(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=$$(e[i],t,n);return r.join("")}function roe(e){return!!(e&&typeof e=="object")}const iP=document.createElement("i");function Wk(e){const t="&"+e+";";iP.innerHTML=t;const n=iP.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ua(e,t,n,r){const i=e.length;let a=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Fi(e,t){return e.length>0?(Ua(e,e.length,0,t),e):t}const aP={}.hasOwnProperty;function ioe(e){const t={};let n=-1;for(;++n<e.length;)aoe(t,e[n]);return t}function aoe(e,t){let n;for(n in t){const i=(aP.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){aP.call(i,l)||(i[l]=[]);const c=a[l];soe(i[l],Array.isArray(c)?c:c?[c]:[])}}}function soe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ua(e,0,0,r)}function B$(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 Fu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ra=Wo(/[A-Za-z]/),ji=Wo(/[\dA-Za-z]/),ooe=Wo(/[#-'*+\--9=?A-Z^-~]/);function N1(e){return e!==null&&(e<32||e===127)}const k1=Wo(/\d/),loe=Wo(/[\dA-Fa-f]/),coe=Wo(/[!-/:-@[-`{-~]/);function et(e){return e!==null&&e<-2}function ci(e){return e!==null&&(e<0||e===32)}function Pt(e){return e===-2||e===-1||e===32}const uoe=Wo(new RegExp("\\p{P}|\\p{S}","u")),doe=Wo(/\s/);function Wo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Sd(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&ji(e.charCodeAt(n+1))&&ji(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(l=String.fromCharCode(a,c),i=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Xt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return Pt(d)?(e.enter(n),c(d)):t(d)}function c(d){return Pt(d)&&a++<i?(e.consume(d),c):(e.exit(n),t(d))}}const foe={tokenize:hoe};function hoe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Xt(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),a(c)}function a(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return et(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),l)}}const poe={tokenize:moe},sP={tokenize:goe};function moe(e){const t=this,n=[];let r=0,i,a,l;return c;function c(O){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,d,f)(O)}return f(O)}function d(O){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const C=t.events.length;let z=C,A;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){A=t.events[z][1].end;break}k(r);let _=C;for(;_<t.events.length;)t.events[_][1].end={...A},_++;return Ua(t.events,z+1,0,t.events.slice(C)),t.events.length=_,f(O)}return c(O)}function f(O){if(r===n.length){if(!i)return y(O);if(i.currentConstruct&&i.currentConstruct.concrete)return w(O);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(sP,p,m)(O)}function p(O){return i&&E(),k(r),y(O)}function m(O){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,w(O)}function y(O){return t.containerState={},e.attempt(sP,v,w)(O)}function v(O){return r++,n.push([t.currentConstruct,t.containerState]),y(O)}function w(O){if(O===null){i&&E(),k(0),e.consume(O);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),b(O)}function b(O){if(O===null){j(e.exit("chunkFlow"),!0),k(0),e.consume(O);return}return et(O)?(e.consume(O),j(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(O),b)}function j(O,C){const z=t.sliceStream(O);if(C&&z.push(null),O.previous=a,a&&(a.next=O),a=O,i.defineSkip(O.start),i.write(z),t.parser.lazy[O.start.line]){let A=i.events.length;for(;A--;)if(i.events[A][1].start.offset<l&&(!i.events[A][1].end||i.events[A][1].end.offset>l))return;const _=t.events.length;let R=_,$,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=_;A<t.events.length;)t.events[A][1].end={...F},A++;Ua(t.events,R+1,0,t.events.slice(_)),t.events.length=A}}function k(O){let C=n.length;for(;C-- >O;){const z=n[C];t.containerState=z[1],z[0].exit.call(t,e)}n.length=O}function E(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function goe(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 oP(e){if(e===null||ci(e)||doe(e))return 1;if(uoe(e))return 2}function Yk(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 C1={name:"attention",resolveAll:yoe,tokenize:voe};function yoe(e,t){let n=-1,r,i,a,l,c,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};lP(m,-d),lP(y,d),l={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},c={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:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Fi(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Fi(f,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",a,t]]),f=Fi(f,Yk(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Fi(f,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=Fi(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Ua(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function voe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=oP(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===a)return e.consume(d),c;const f=e.exit("attentionSequence"),p=oP(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 lP(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const xoe={name:"autolink",tokenize:boe};function boe(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 Ra(v)?(e.consume(v),l):v===64?n(v):f(v)}function l(v){return v===43||v===45||v===46||ji(v)?(r=1,c(v)):f(v)}function c(v){return v===58?(e.consume(v),r=0,d):(v===43||v===45||v===46||ji(v))&&r++<32?(e.consume(v),c):(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||N1(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):ooe(v)?(e.consume(v),f):n(v)}function p(v){return ji(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||ji(v))&&r++<63){const w=v===45?y:m;return e.consume(v),w}return n(v)}}const Vv={partial:!0,tokenize:woe};function woe(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 U$={continuation:{tokenize:joe},exit:Noe,name:"blockQuote",tokenize:Soe};function Soe(e,t,n){const r=this;return i;function i(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return Pt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function joe(e,t,n){const r=this;return i;function i(l){return Pt(l)?Xt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(U$,t,n)(l)}}function Noe(e){e.exit("blockQuote")}const q$={name:"characterEscape",tokenize:koe};function koe(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 coe(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const F$={name:"characterReference",tokenize:Coe};function Coe(e,t,n){const r=this;let i=0,a,l;return c;function c(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,l=ji,p(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=loe,p):(e.enter("characterReferenceValue"),a=7,l=k1,p(m))}function p(m){if(m===59&&i){const y=e.exit("characterReferenceValue");return l===ji&&!Wk(r.sliceSerialize(y))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&i++<a?(e.consume(m),p):n(m)}}const cP={partial:!0,tokenize:Eoe},uP={concrete:!0,name:"codeFenced",tokenize:Aoe};function Aoe(e,t,n){const r=this,i={partial:!0,tokenize:z};let a=0,l=0,c;return d;function d(A){return f(A)}function f(A){const _=r.events[r.events.length-1];return a=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,c=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(A)}function p(A){return A===c?(l++,e.consume(A),p):l<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(cP,b,C)(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===c?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===c?n(A):(e.consume(A),w)}function b(A){return e.attempt(i,C,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(cP,b,C)(A):(e.enter("codeFlowValue"),O(A))}function O(A){return A===null||et(A)?(e.exit("codeFlowValue"),E(A)):(e.consume(A),O)}function C(A){return e.exit("codeFenced"),t(A)}function z(A,_,R){let $=0;return F;function F(Q){return A.enter("lineEnding"),A.consume(Q),A.exit("lineEnding"),q}function q(Q){return A.enter("codeFencedFence"),Pt(Q)?Xt(A,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):B(Q)}function B(Q){return Q===c?(A.enter("codeFencedFenceSequence"),K(Q)):R(Q)}function K(Q){return Q===c?($++,A.consume(Q),K):$>=l?(A.exit("codeFencedFenceSequence"),Pt(Q)?Xt(A,X,"whitespace")(Q):X(Q)):R(Q)}function X(Q){return Q===null||et(Q)?(A.exit("codeFencedFence"),_(Q)):R(Q)}}}function Eoe(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Ww={name:"codeIndented",tokenize:_oe},Ooe={partial:!0,tokenize:zoe};function _oe(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?l(f):n(f)}function l(f){return f===null?d(f):et(f)?e.attempt(Ooe,l,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||et(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function zoe(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):et(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):Xt(e,a,"linePrefix",5)(l)}function a(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):et(l)?i(l):n(l)}}const Toe={name:"codeText",previous:Roe,resolve:Poe,tokenize:Doe};function Poe(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 Roe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Doe(e,t,n){let r=0,i,a;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),c(m)}function c(m){return m===96?(e.consume(m),r++,c):(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 Ioe{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&&Mf(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),Mf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Mf(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);Mf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Mf(this.left,n.reverse())}}}function Mf(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 H$(e){const t={};let n=-1,r,i,a,l,c,d,f;const p=new Ioe(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,Moe(p,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(l=p.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},c=p.slice(i,n),c.unshift(r),p.splice(i,n-i+1,c))}}return Ua(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function Moe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.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&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(b=y+1,j.push(b),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):j.pop(),y=j.length;y--;){const k=c.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 Loe={resolve:Boe,tokenize:Uoe},$oe={partial:!0,tokenize:qoe};function Boe(e){return H$(e),e}function Uoe(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?a(c):et(c)?e.check($oe,l,a)(c):(e.consume(c),i)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function qoe(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Xt(e,a,"linePrefix")}function a(l){if(l===null||et(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function K$(e,t,n,r,i,a,l,c,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||N1(k)?n(k):(e.enter(r),e.enter(l),e.enter(c),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(c),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===62?(e.exit("chunkString"),e.exit(c),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||ci(k))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(k)):p<f&&k===40?(e.consume(k),p++,b):k===41?(e.consume(k),p--,b):k===null||k===32||k===40||N1(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 G$(e,t,n,r,i,a){const l=this;let c=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 c>999||v===null||v===91||v===93&&!d||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):et(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||v===91||v===93||et(v)||c++>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),c++,m):m(v)}}function V$(e,t,n,r,i,a){let l;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),l=y===40?41:y,d):n(y)}function d(y){return y===l?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(a),f(y))}function f(y){return y===l?(e.exit(a),d(l)):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===l||y===null||et(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?m:p)}function m(y){return y===l||y===92?(e.consume(y),p):p(y)}}function ch(e,t){let n;return r;function r(i){return et(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Pt(i)?Xt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Foe={name:"definition",tokenize:Koe},Hoe={partial:!0,tokenize:Goe};function Koe(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),l(v)}function l(v){return G$.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return i=Fu(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 ci(v)?ch(e,f)(v):f(v)}function f(v){return K$(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(Hoe,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 Goe(e,t,n){return r;function r(c){return ci(c)?ch(e,i)(c):n(c)}function i(c){return V$(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return Pt(c)?Xt(e,l,"whitespace")(c):l(c)}function l(c){return c===null||et(c)?t(c):n(c)}}const Voe={name:"hardBreakEscape",tokenize:Qoe};function Qoe(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 Woe={name:"headingAtx",resolve:Yoe,tokenize:Zoe};function Yoe(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ua(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function Zoe(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||ci(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||et(p)?(e.exit("atxHeading"),t(p)):Pt(p)?Xt(e,c,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||ci(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const Xoe=["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"],dP=["pre","script","style","textarea"],Joe={concrete:!0,name:"htmlFlow",resolveTo:nle,tokenize:rle},ele={partial:!0,tokenize:ale},tle={partial:!0,tokenize:ile};function nle(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 rle(e,t,n){const r=this;let i,a,l,c,d;return f;function f(I){return p(I)}function p(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),m}function m(I){return I===33?(e.consume(I),y):I===47?(e.consume(I),a=!0,b):I===63?(e.consume(I),i=3,r.interrupt?t:M):Ra(I)?(e.consume(I),l=String.fromCharCode(I),j):n(I)}function y(I){return I===45?(e.consume(I),i=2,v):I===91?(e.consume(I),i=5,c=0,w):Ra(I)?(e.consume(I),i=4,r.interrupt?t:M):n(I)}function v(I){return I===45?(e.consume(I),r.interrupt?t:M):n(I)}function w(I){const V="CDATA[";return I===V.charCodeAt(c++)?(e.consume(I),c===V.length?r.interrupt?t:B:w):n(I)}function b(I){return Ra(I)?(e.consume(I),l=String.fromCharCode(I),j):n(I)}function j(I){if(I===null||I===47||I===62||ci(I)){const V=I===47,ce=l.toLowerCase();return!V&&!a&&dP.includes(ce)?(i=1,r.interrupt?t(I):B(I)):Xoe.includes(l.toLowerCase())?(i=6,V?(e.consume(I),k):r.interrupt?t(I):B(I)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):a?E(I):O(I))}return I===45||ji(I)?(e.consume(I),l+=String.fromCharCode(I),j):n(I)}function k(I){return I===62?(e.consume(I),r.interrupt?t:B):n(I)}function E(I){return Pt(I)?(e.consume(I),E):F(I)}function O(I){return I===47?(e.consume(I),F):I===58||I===95||Ra(I)?(e.consume(I),C):Pt(I)?(e.consume(I),O):F(I)}function C(I){return I===45||I===46||I===58||I===95||ji(I)?(e.consume(I),C):z(I)}function z(I){return I===61?(e.consume(I),A):Pt(I)?(e.consume(I),z):O(I)}function A(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),d=I,_):Pt(I)?(e.consume(I),A):R(I)}function _(I){return I===d?(e.consume(I),d=null,$):I===null||et(I)?n(I):(e.consume(I),_)}function R(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||ci(I)?z(I):(e.consume(I),R)}function $(I){return I===47||I===62||Pt(I)?O(I):n(I)}function F(I){return I===62?(e.consume(I),q):n(I)}function q(I){return I===null||et(I)?B(I):Pt(I)?(e.consume(I),q):n(I)}function B(I){return I===45&&i===2?(e.consume(I),H):I===60&&i===1?(e.consume(I),J):I===62&&i===4?(e.consume(I),D):I===63&&i===3?(e.consume(I),M):I===93&&i===5?(e.consume(I),be):et(I)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ele,U,K)(I)):I===null||et(I)?(e.exit("htmlFlowData"),K(I)):(e.consume(I),B)}function K(I){return e.check(tle,X,U)(I)}function X(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),Q}function Q(I){return I===null||et(I)?K(I):(e.enter("htmlFlowData"),B(I))}function H(I){return I===45?(e.consume(I),M):B(I)}function J(I){return I===47?(e.consume(I),l="",de):B(I)}function de(I){if(I===62){const V=l.toLowerCase();return dP.includes(V)?(e.consume(I),D):B(I)}return Ra(I)&&l.length<8?(e.consume(I),l+=String.fromCharCode(I),de):B(I)}function be(I){return I===93?(e.consume(I),M):B(I)}function M(I){return I===62?(e.consume(I),D):I===45&&i===2?(e.consume(I),M):B(I)}function D(I){return I===null||et(I)?(e.exit("htmlFlowData"),U(I)):(e.consume(I),D)}function U(I){return e.exit("htmlFlow"),t(I)}}function ile(e,t,n){const r=this;return i;function i(l){return et(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ale(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Vv,t,n)}}const sle={name:"htmlText",tokenize:ole};function ole(e,t,n){const r=this;let i,a,l;return c;function c(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),z):M===63?(e.consume(M),O):Ra(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):Ra(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)?(l=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 D="CDATA[";return M===D.charCodeAt(a++)?(e.consume(M),a===D.length?b:w):n(M)}function b(M){return M===null?n(M):M===93?(e.consume(M),j):et(M)?(l=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)?(l=E,J(M)):(e.consume(M),E)}function O(M){return M===null?n(M):M===63?(e.consume(M),C):et(M)?(l=O,J(M)):(e.consume(M),O)}function C(M){return M===62?H(M):O(M)}function z(M){return Ra(M)?(e.consume(M),A):n(M)}function A(M){return M===45||ji(M)?(e.consume(M),A):_(M)}function _(M){return et(M)?(l=_,J(M)):Pt(M)?(e.consume(M),_):H(M)}function R(M){return M===45||ji(M)?(e.consume(M),R):M===47||M===62||ci(M)?$(M):n(M)}function $(M){return M===47?(e.consume(M),H):M===58||M===95||Ra(M)?(e.consume(M),F):et(M)?(l=$,J(M)):Pt(M)?(e.consume(M),$):H(M)}function F(M){return M===45||M===46||M===58||M===95||ji(M)?(e.consume(M),F):q(M)}function q(M){return M===61?(e.consume(M),B):et(M)?(l=q,J(M)):Pt(M)?(e.consume(M),q):$(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,K):et(M)?(l=B,J(M)):Pt(M)?(e.consume(M),B):(e.consume(M),X)}function K(M){return M===i?(e.consume(M),i=void 0,Q):M===null?n(M):et(M)?(l=K,J(M)):(e.consume(M),K)}function X(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||ci(M)?$(M):(e.consume(M),X)}function Q(M){return M===47||M===62||ci(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"),de}function de(M){return Pt(M)?Xt(e,be,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):be(M)}function be(M){return e.enter("htmlTextData"),l(M)}}const Zk={name:"labelEnd",resolveAll:dle,resolveTo:fle,tokenize:hle},lle={tokenize:ple},cle={tokenize:mle},ule={tokenize:gle};function dle(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Ua(e,0,e.length,n),e}function fle(e,t){let n=e.length,r=0,i,a,l,c;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=Fi(c,e.slice(a+1,a+r+3)),c=Fi(c,[["enter",p,t]]),c=Fi(c,Yk(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),c=Fi(c,[["exit",p,t],e[l-2],e[l-1],["exit",f,t]]),c=Fi(c,e.slice(l+1)),c=Fi(c,[["exit",d,t]]),Ua(e,a,e.length,c),e}function hle(e,t,n){const r=this;let i=r.events.length,a,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return c;function c(y){return a?a._inactive?m(y):(l=r.parser.defined.includes(Fu(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(lle,p,l?p:m)(y):y===91?e.attempt(cle,p,l?f:m)(y):l?p(y):m(y)}function f(y){return e.attempt(ule,p,m)(y)}function p(y){return t(y)}function m(y){return a._balanced=!0,n(y)}}function ple(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 ci(m)?ch(e,a)(m):a(m)}function a(m){return m===41?p(m):K$(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return ci(m)?ch(e,d)(m):p(m)}function c(m){return n(m)}function d(m){return m===34||m===39||m===40?V$(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return ci(m)?ch(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function mle(e,t,n){const r=this;return i;function i(c){return G$.call(r,e,a,l,"reference","referenceMarker","referenceString")(c)}function a(c){return r.parser.defined.includes(Fu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function gle(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 yle={name:"labelStartImage",resolveAll:Zk.resolveAll,tokenize:vle};function vle(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const xle={name:"labelStartLink",resolveAll:Zk.resolveAll,tokenize:ble};function ble(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Yw={name:"lineEnding",tokenize:wle};function wle(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Xt(e,t,"linePrefix")}}const Ig={name:"thematicBreak",tokenize:Sle};function Sle(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),l(f)}function l(f){return i=f,c(f)}function c(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,c,"whitespace")(f):c(f))}}const ri={continuation:{tokenize:Cle},exit:Ele,name:"list",tokenize:kle},jle={partial:!0,tokenize:Ole},Nle={partial:!0,tokenize:Ale};function kle(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return c;function c(v){const w=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:k1(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(Ig,n,f)(v):f(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return n(v)}function d(v){return k1(v)&&++l<10?(e.consume(v),d):(!r.interrupt||l<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(Vv,r.interrupt?n:p,e.attempt(jle,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 Cle(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Vv,i,a);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Xt(e,t,"listItemIndent",r.containerState.size+1)(c)}function a(c){return r.containerState.furtherBlankLines||!Pt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Nle,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Xt(e,e.attempt(ri,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function Ale(e,t,n){const r=this;return Xt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function Ele(e){e.exit(this.containerState.type)}function Ole(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 l=r.events[r.events.length-1];return!Pt(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const fP={name:"setextUnderline",resolveTo:_le,tokenize:zle};function _le(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function zle(e,t,n){const r=this;let i;return a;function a(f){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=f,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===i?(e.consume(f),c):(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 Tle={tokenize:Ple};function Ple(e){const t=this,n=e.attempt(Vv,r,e.attempt(this.parser.constructs.flowInitial,i,Xt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Loe,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 Rle={resolveAll:W$()},Dle=Q$("string"),Ile=Q$("text");function Q$(e){return{resolveAll:W$(e==="text"?Mle:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,l,c);return l;function l(p){return f(p)?a(p):c(p)}function c(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 W$(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 Mle(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,l=-1,c=0,d;for(;a--;){const f=i[a];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(f===-2)d=!0,c++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},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 Lle={42:ri,43:ri,45:ri,48:ri,49:ri,50:ri,51:ri,52:ri,53:ri,54:ri,55:ri,56:ri,57:ri,62:U$},$le={91:Foe},Ble={[-2]:Ww,[-1]:Ww,32:Ww},Ule={35:Woe,42:Ig,45:[fP,Ig],60:Joe,61:fP,95:Ig,96:uP,126:uP},qle={38:F$,92:q$},Fle={[-5]:Yw,[-4]:Yw,[-3]:Yw,33:yle,38:F$,42:C1,60:[xoe,sle],91:xle,92:[Voe,q$],93:Zk,95:C1,96:Toe},Hle={null:[C1,Rle]},Kle={null:[42,95]},Gle={null:[]},Vle=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Kle,contentInitial:$le,disable:Gle,document:Lle,flow:Ule,flowInitial:Ble,insideSpan:Hle,string:qle,text:Fle},Symbol.toStringTag,{value:"Module"}));function Qle(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let l=[],c=[];const d={attempt:_(z),check:_(A),consume:E,enter:O,exit:C,interrupt:_(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(q){return l=Fi(l,q),j(),l[l.length-1]!==null?[]:(R(t,0),f.events=Yk(a,f.events,f),f.events)}function y(q,B){return Yle(v(q),B)}function v(q){return Wle(l,q)}function w(){const{_bufferIndex:q,_index:B,line:K,column:X,offset:Q}=r;return{_bufferIndex:q,_index:B,line:K,column:X,offset:Q}}function b(q){i[q.line]=q.column,F()}function j(){let q;for(;r._index<l.length;){const B=l[r._index];if(typeof B=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<B.length;)k(B.charCodeAt(r._bufferIndex));else k(B)}}function k(q){p=p(q)}function E(q){et(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,F()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=q}function O(q,B){const K=B||{};return K.type=q,K.start=w(),f.events.push(["enter",K,f]),c.push(K),K}function C(q){const B=c.pop();return B.end=w(),f.events.push(["exit",B,f]),B}function z(q,B){R(q,B.from)}function A(q,B){B.restore()}function _(q,B){return K;function K(X,Q,H){let J,de,be,M;return Array.isArray(X)?U(X):"tokenize"in X?U([X]):D(X);function D(re){return ke;function ke(ze){const te=ze!==null&&re[ze],fe=ze!==null&&re.null,Ee=[...Array.isArray(te)?te:te?[te]:[],...Array.isArray(fe)?fe:fe?[fe]:[]];return U(Ee)(ze)}}function U(re){return J=re,de=0,re.length===0?H:I(re[de])}function I(re){return ke;function ke(ze){return M=$(),be=re,re.partial||(f.currentConstruct=re),re.name&&f.parser.constructs.disable.null.includes(re.name)?ce():re.tokenize.call(B?Object.assign(Object.create(f),B):f,d,V,ce)(ze)}}function V(re){return q(be,M),Q}function ce(re){return M.restore(),++de<J.length?I(J[de]):H}}}function R(q,B){q.resolveAll&&!a.includes(q)&&a.push(q),q.resolve&&Ua(f.events,B,f.events.length-B,q.resolve(f.events.slice(B),f)),q.resolveTo&&(f.events=q.resolveTo(f.events,f))}function $(){const q=w(),B=f.previous,K=f.currentConstruct,X=f.events.length,Q=Array.from(c);return{from:X,restore:H};function H(){r=q,f.previous=B,f.currentConstruct=K,f.events.length=X,c=Q,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Wle(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,a)];else{if(l=e.slice(n,i),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}a>0&&l.push(e[i].slice(0,a))}return l}function Yle(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
|
|
99
|
-
`;break}case-3:{l=`\r
|
|
100
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(a)}i=a===-2,r.push(l)}return r.join("")}function Zle(e){const r={constructs:ioe([Vle,...(e||{}).extensions||[]]),content:i(foe),defined:[],document:i(poe),flow:i(Tle),lazy:{},string:i(Dle),text:i(Ile)};return r;function i(a){return l;function l(c){return Qle(r,a,c)}}}function Xle(e){for(;!H$(e););return e}const hP=/[\0\t\n\r]/g;function Jle(){let e=1,t="",n=!0,r;return i;function i(a,l,c){const d=[];let f,p,m,y,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(hP.lastIndex=m,f=hP.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 c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const ece=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tce(e){return e.replace(ece,nce)}function nce(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return B$(n.slice(a?2:1),a?16:10)}return Wk(n)||e}const Y$={}.hasOwnProperty;function rce(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),ice(n)(Xle(Zle(n).document().write(Jle()(e,t,!0))))}function ice(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(on),autolinkProtocol:$,autolinkEmail:$,atxHeading:a(lt),blockQuote:a(fe),characterEscape:$,characterReference:$,codeFenced:a(Ee),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Ee,l),codeText:a(Z,l),codeTextData:$,data:$,codeFlowValue:$,definition:a(Ge),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Me),hardBreakEscape:a(Te),hardBreakTrailing:a(Te),htmlFlow:a(Wt,l),htmlFlowData:$,htmlText:a(Wt,l),htmlTextData:$,image:a(Ht),label:l,link:a(on),listItem:a(_n),listItemValue:y,listOrdered:a(en,m),listUnordered:a(en),paragraph:a(ve),reference:I,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(lt),strong:a(ft),thematicBreak:a(rt)},exit:{atxHeading:d(),atxHeadingSequence:z,autolink:d(),autolinkEmail:te,autolinkProtocol:ze,blockQuote:d(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:re,characterReference:ke,codeFenced:d(j),codeFencedFence:b,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:F,codeIndented:d(k),codeText:d(Q),codeTextData:F,data:F,definition:d(),definitionDestinationString:C,definitionLabelString:E,definitionTitleString:O,emphasis:d(),hardBreakEscape:d(B),hardBreakTrailing:d(B),htmlFlow:d(K),htmlFlowData:F,htmlText:d(X),htmlTextData:F,image:d(J),label:be,labelText:de,lineEnding:q,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:V,resourceDestinationString:M,resourceTitleString:D,resource:U,setextHeading:d(R),setextHeadingLineSequence:_,setextHeadingText:A,strong:d(),thematicBreak:d()}};Z$(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ae){let Se={type:"root",children:[]};const $e={stack:[Se],tokenStack:[],config:t,enter:c,exit:f,buffer:l,resume:p,data:n},Ze=[];let Xe=-1;for(;++Xe<ae.length;)if(ae[Xe][1].type==="listOrdered"||ae[Xe][1].type==="listUnordered")if(ae[Xe][0]==="enter")Ze.push(Xe);else{const Bn=Ze.pop();Xe=i(ae,Bn,Xe)}for(Xe=-1;++Xe<ae.length;){const Bn=t[ae[Xe][0]];Y$.call(Bn,ae[Xe][1].type)&&Bn[ae[Xe][1].type].call(Object.assign({sliceSerialize:ae[Xe][2].sliceSerialize},$e),ae[Xe][1])}if($e.tokenStack.length>0){const Bn=$e.tokenStack[$e.tokenStack.length-1];(Bn[1]||pP).call($e,void 0,Bn[0])}for(Se.position={start:go(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:go(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<t.transforms.length;)Se=t.transforms[Xe](Se)||Se;return Se}function i(ae,Se,$e){let Ze=Se-1,Xe=-1,Bn=!1,fn,jn,Kt,zn;for(;++Ze<=$e;){const pt=ae[Ze];switch(pt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pt[0]==="enter"?Xe++:Xe--,zn=void 0;break}case"lineEndingBlank":{pt[0]==="enter"&&(fn&&!zn&&!Xe&&!Kt&&(Kt=Ze),zn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:zn=void 0}if(!Xe&&pt[0]==="enter"&&pt[1].type==="listItemPrefix"||Xe===-1&&pt[0]==="exit"&&(pt[1].type==="listUnordered"||pt[1].type==="listOrdered")){if(fn){let br=Ze;for(jn=void 0;br--;){const Ce=ae[br];if(Ce[1].type==="lineEnding"||Ce[1].type==="lineEndingBlank"){if(Ce[0]==="exit")continue;jn&&(ae[jn][1].type="lineEndingBlank",Bn=!0),Ce[1].type="lineEnding",jn=br}else if(!(Ce[1].type==="linePrefix"||Ce[1].type==="blockQuotePrefix"||Ce[1].type==="blockQuotePrefixWhitespace"||Ce[1].type==="blockQuoteMarker"||Ce[1].type==="listItemIndent"))break}Kt&&(!jn||Kt<jn)&&(fn._spread=!0),fn.end=Object.assign({},jn?ae[jn][1].start:pt[1].end),ae.splice(jn||Ze,0,["exit",fn,pt[2]]),Ze++,$e++}if(pt[1].type==="listItemPrefix"){const br={type:"listItem",_spread:!1,start:Object.assign({},pt[1].start),end:void 0};fn=br,ae.splice(Ze,0,["enter",br,pt[2]]),Ze++,$e++,Kt=void 0,zn=!0}}}return ae[Se][1]._spread=Bn,$e}function a(ae,Se){return $e;function $e(Ze){c.call(this,ae(Ze),Ze),Se&&Se.call(this,Ze)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(ae,Se,$e){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([Se,$e||void 0]),ae.position={start:go(Se.start),end:void 0}}function d(ae){return Se;function Se($e){ae&&ae.call(this,$e),f.call(this,$e)}}function f(ae,Se){const $e=this.stack.pop(),Ze=this.tokenStack.pop();if(Ze)Ze[0].type!==ae.type&&(Se?Se.call(this,ae,Ze[0]):(Ze[1]||pP).call(this,ae,Ze[0]));else throw new Error("Cannot close `"+ae.type+"` ("+lh({start:ae.start,end:ae.end})+"): it’s not open");$e.position.end=go(ae.end)}function p(){return noe(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(ae){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ae=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=ae}function w(){const ae=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=ae}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const ae=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ae=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ae.replace(/(\r?\n|\r)$/g,"")}function E(ae){const Se=this.resume(),$e=this.stack[this.stack.length-1];$e.label=Se,$e.identifier=Fu(this.sliceSerialize(ae)).toLowerCase()}function O(){const ae=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ae}function C(){const ae=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ae}function z(ae){const Se=this.stack[this.stack.length-1];if(!Se.depth){const $e=this.sliceSerialize(ae).length;Se.depth=$e}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function _(ae){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function $(ae){const $e=this.stack[this.stack.length-1].children;let Ze=$e[$e.length-1];(!Ze||Ze.type!=="text")&&(Ze=Ye(),Ze.position={start:go(ae.start),end:void 0},$e.push(Ze)),this.stack.push(Ze)}function F(ae){const Se=this.stack.pop();Se.value+=this.sliceSerialize(ae),Se.position.end=go(ae.end)}function q(ae){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $e=Se.children[Se.children.length-1];$e.position.end=go(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Se.type)&&($.call(this,ae),F.call(this,ae))}function B(){this.data.atHardBreak=!0}function K(){const ae=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ae}function X(){const ae=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ae}function Q(){const ae=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ae}function H(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=Se,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function J(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=Se,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function de(ae){const Se=this.sliceSerialize(ae),$e=this.stack[this.stack.length-2];$e.label=tce(Se),$e.identifier=Fu(Se).toLowerCase()}function be(){const ae=this.stack[this.stack.length-1],Se=this.resume(),$e=this.stack[this.stack.length-1];if(this.data.inReference=!0,$e.type==="link"){const Ze=ae.children;$e.children=Ze}else $e.alt=Se}function M(){const ae=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ae}function D(){const ae=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ae}function U(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function V(ae){const Se=this.resume(),$e=this.stack[this.stack.length-1];$e.label=Se,$e.identifier=Fu(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function ce(ae){this.data.characterReferenceType=ae.type}function re(ae){const Se=this.sliceSerialize(ae),$e=this.data.characterReferenceType;let Ze;$e?(Ze=B$(Se,$e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ze=Wk(Se);const Xe=this.stack[this.stack.length-1];Xe.value+=Ze}function ke(ae){const Se=this.stack.pop();Se.position.end=go(ae.end)}function ze(ae){F.call(this,ae);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(ae)}function te(ae){F.call(this,ae);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(ae)}function fe(){return{type:"blockquote",children:[]}}function Ee(){return{type:"code",lang:null,meta:null,value:""}}function Z(){return{type:"inlineCode",value:""}}function Ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Me(){return{type:"emphasis",children:[]}}function lt(){return{type:"heading",depth:0,children:[]}}function Te(){return{type:"break"}}function Wt(){return{type:"html",value:""}}function Ht(){return{type:"image",title:null,url:"",alt:null}}function on(){return{type:"link",title:null,url:"",children:[]}}function en(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function _n(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function ve(){return{type:"paragraph",children:[]}}function ft(){return{type:"strong",children:[]}}function Ye(){return{type:"text",value:""}}function rt(){return{type:"thematicBreak"}}}function go(e){return{line:e.line,column:e.column,offset:e.offset}}function Z$(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Z$(e,r):ace(e,r)}}function ace(e,t){let n;for(n in t)if(Y$.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 pP(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+lh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+lh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+lh({start:t.start,end:t.end})+") is still open")}function sce(e){const t=this;t.parser=n;function n(r){return rce(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function oce(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 lce(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
101
|
-
`}]}function cce(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 uce(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dce(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fce(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Sd(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function hce(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 pce(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function X$(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function mce(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return X$(e,t);const i={src:Sd(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 gce(e,t){const n={src:Sd(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 yce(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 vce(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return X$(e,t);const i={href:Sd(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 xce(e,t){const n={href:Sd(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 bce(e,t,n){const r=e.all(t),i=n?wce(n):J$(t),a={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(i||c!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
|
|
103
|
-
`}),p.type==="element"&&p.tagName==="p"&&!i?l.push(...p.children):l.push(p)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
|
104
|
-
`});const f={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,f),e.applyData(t,f)}function wce(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=J$(n[r])}return t}function J$(e){const t=e.spread;return t??e.children.length>1}function Sce(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function jce(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nce(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function kce(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Cce(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Kk(t.children[1]),d=P$(t.children[t.children.length-1]);c&&d&&(l.position={start:c,end:d}),i.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Ace(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let d=-1;const f=[];for(;++d<c;){const m=t.children[d],y={},v=l?l[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 Ece(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const mP=9,gP=32;function Oce(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(yP(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(yP(t.slice(i),i>0,!1)),a.join("")}function yP(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===mP||a===gP;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===mP||a===gP;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function _ce(e,t){const n={type:"text",value:Oce(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function zce(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Tce={blockquote:oce,break:lce,code:cce,delete:uce,emphasis:dce,footnoteReference:fce,heading:hce,html:pce,imageReference:mce,image:gce,inlineCode:yce,linkReference:vce,link:xce,listItem:bce,list:Sce,paragraph:jce,root:Nce,strong:kce,table:Cce,tableCell:Ece,tableRow:Ace,text:_ce,thematicBreak:zce,toml:Wm,yaml:Wm,definition:Wm,footnoteDefinition:Wm};function Wm(){}const eB=-1,Qv=0,uh=1,my=2,Xk=3,Jk=4,eC=5,tC=6,tB=7,nB=8,vP=typeof self=="object"?self:globalThis,Pce=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,l]=t[i];switch(a){case Qv:case eB:return n(l,i);case uh:{const c=n([],i);for(const d of l)c.push(r(d));return c}case my:{const c=n({},i);for(const[d,f]of l)c[r(d)]=r(f);return c}case Xk:return n(new Date(l),i);case Jk:{const{source:c,flags:d}=l;return n(new RegExp(c,d),i)}case eC:{const c=n(new Map,i);for(const[d,f]of l)c.set(r(d),r(f));return c}case tC:{const c=n(new Set,i);for(const d of l)c.add(r(d));return c}case tB:{const{name:c,message:d}=l;return n(new vP[c](d),i)}case nB:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(new vP[a](l),i)};return r},xP=e=>Pce(new Map,e)(0),pu="",{toString:Rce}={},{keys:Dce}=Object,Lf=e=>{const t=typeof e;if(t!=="object"||!e)return[Qv,t];const n=Rce.call(e).slice(8,-1);switch(n){case"Array":return[uh,pu];case"Object":return[my,pu];case"Date":return[Xk,pu];case"RegExp":return[Jk,pu];case"Map":return[eC,pu];case"Set":return[tC,pu];case"DataView":return[uh,n]}return n.includes("Array")?[uh,n]:n.includes("Error")?[tB,n]:[my,n]},Ym=([e,t])=>e===Qv&&(t==="function"||t==="symbol"),Ice=(e,t,n,r)=>{const i=(l,c)=>{const d=r.push(l)-1;return n.set(c,d),d},a=l=>{if(n.has(l))return n.get(l);let[c,d]=Lf(l);switch(c){case Qv:{let p=l;switch(d){case"bigint":c=nB,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([eB],l)}return i([c,p],l)}case uh:{if(d){let y=l;return d==="DataView"?y=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(l)),i([d,[...y]],l)}const p=[],m=i([c,p],l);for(const y of l)p.push(a(y));return m}case my:{if(d)switch(d){case"BigInt":return i([d,l.toString()],l);case"Boolean":case"Number":case"String":return i([d,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const p=[],m=i([c,p],l);for(const y of Dce(l))(e||!Ym(Lf(l[y])))&&p.push([a(y),a(l[y])]);return m}case Xk:return i([c,l.toISOString()],l);case Jk:{const{source:p,flags:m}=l;return i([c,{source:p,flags:m}],l)}case eC:{const p=[],m=i([c,p],l);for(const[y,v]of l)(e||!(Ym(Lf(y))||Ym(Lf(v))))&&p.push([a(y),a(v)]);return m}case tC:{const p=[],m=i([c,p],l);for(const y of l)(e||!Ym(Lf(y)))&&p.push(a(y));return m}}const{message:f}=l;return i([c,{name:d,message:f}],l)};return a},bP=(e,{json:t,lossy:n}={})=>{const r=[];return Ice(!(t||n),!!t,new Map,r)(e),r},gy=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?xP(bP(e,t)):structuredClone(e):(e,t)=>xP(bP(e,t));function Mce(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 Lce(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function $ce(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Mce,r=e.options.footnoteBackLabel||Lce,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];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=Sd(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),c.push(k)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...gy(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
105
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
106
|
-
`}]}}const rB=(function(e){if(e==null)return Fce;if(typeof e=="function")return Wv(e);if(typeof e=="object")return Array.isArray(e)?Bce(e):Uce(e);if(typeof e=="string")return qce(e);throw new Error("Expected function, string, or object as test")});function Bce(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=rB(e[n]);return Wv(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Uce(e){const t=e;return Wv(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function qce(e){return Wv(t);function t(n){return n&&n.type===e}}function Wv(e){return t;function t(n,r,i){return!!(Hce(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Fce(){return!0}function Hce(e){return e!==null&&typeof e=="object"&&"type"in e}const iB=[],Kce=!0,wP=!1,Gce="skip";function Vce(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=rB(i),l=r?-1:1;c(e,void 0,[])();function c(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=iB,w,b,j;if((!t||a(d,f,p[p.length-1]||void 0))&&(v=Qce(n(d,p)),v[0]===wP))return v;if("children"in d&&d.children){const k=d;if(k.children&&v[0]!==Gce)for(b=(r?k.children.length:-1)+l,j=p.concat(k);b>-1&&b<k.children.length;){const E=k.children[b];if(w=c(E,b,j)(),w[0]===wP)return w;b=typeof w[1]=="number"?w[1]:b+l}}return v}}}function Qce(e){return Array.isArray(e)?e:typeof e=="number"?[Kce,e]:e==null?iB:[e]}function aB(e,t,n,r){let i,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,i=n):(a=t,l=n,i=r),Vce(e,a,c,i);function c(d,f){const p=f[f.length-1],m=p?p.children.indexOf(d):void 0;return l(d,m,p)}}const A1={}.hasOwnProperty,Wce={};function Yce(e,t){const n=t||Wce,r=new Map,i=new Map,a=new Map,l={...Tce,...n.handlers},c={all:f,applyData:Xce,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:Zce,wrap:eue};return aB(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)}}),c;function d(p,m){const y=p.type,v=c.handlers[y];if(A1.call(c.handlers,y)&&v)return v(c,p,m);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in p){const{children:b,...j}=p,k=gy(j);return k.children=c.all(p),k}return gy(p)}return(c.options.unknownHandler||Jce)(c,p,m)}function f(p){const m=[];if("children"in p){const y=p.children;let v=-1;for(;++v<y.length;){const w=c.one(y[v],p);if(w){if(v&&y[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=SP(w.value)),!Array.isArray(w)&&w.type==="element")){const b=w.children[0];b&&b.type==="text"&&(b.value=SP(b.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function Zce(e,t){e.position&&(t.position=Rse(e))}function Xce(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,gy(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Jce(e,t){const n=t.data||{},r="value"in t&&!(A1.call(n,"hProperties")||A1.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 eue(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 SP(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function jP(e,t){const n=Yce(e,t),r=n.one(e,void 0),i=$ce(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 tue(e,t){return e&&"run"in e?async function(n,r){const i=jP(n,{file:r,...t});await e.run(i,r)}:function(n,r){return jP(n,{file:r,...e||t})}}function NP(e){if(e)throw e}var Zw,kP;function nue(){if(kP)return Zw;kP=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)},l=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},c=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Zw=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=c(b,p),y=c(f,p),b!==y&&(E&&y&&(a(y)||(v=i(y)))?(v?(v=!1,w=m&&i(m)?m:[]):w=m&&a(m)?m:{},l(b,{name:p,newValue:d(E,w,y)})):typeof y<"u"&&l(b,{name:p,newValue:y}));return b},Zw}var rue=nue();const Xw=ya(rue);function E1(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 iue(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...i);function c(d,...f){const p=e[++a];let m=-1;if(d){l(d);return}for(;++m<i.length;)(f[m]===null||f[m]===void 0)&&(f[m]=i[m]);i=f,p?aue(p,c)(...f):l(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function aue(e,t){let n;return r;function r(...l){const c=e.length>l.length;let d;c&&l.push(i);try{d=e.apply(this,l)}catch(f){const p=f;if(c&&n)throw p;return i(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(a,i):d instanceof Error?i(d):a(d))}function i(l,...c){n||(n=!0,t(l,...c))}function a(l){i(null,l)}}const za={basename:sue,dirname:oue,extname:lue,join:cue,sep:"/"};function sue(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Jh(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else l<0&&(a=!0,l=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function oue(e){if(Jh(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 lue(e){Jh(e);let t=e.length,n=-1,r=0,i=-1,a=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===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 cue(...e){let t=-1,n;for(;++t<e.length;)Jh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":uue(n)}function uue(e){Jh(e);const t=e.codePointAt(0)===47;let n=due(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function due(e,t){let n="",r=0,i=-1,a=0,l=-1,c,d;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(i===l-1||a===1))if(i!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=l,a=0;continue}}else if(n.length>0){n="",r=0,i=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,a=0}else c===46&&a>-1?a++:a=-1}return n}function Jh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const fue={cwd:hue};function hue(){return"/"}function O1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function pue(e){if(typeof e=="string")e=new URL(e);else if(!O1(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 mue(e)}function mue(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 Jw=["history","path","basename","stem","extname","dirname"];class sB{constructor(t){let n;t?O1(t)?n={path:t}:typeof t=="string"||gue(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":fue.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Jw.length;){const a=Jw[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)Jw.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?za.basename(this.path):void 0}set basename(t){tS(t,"basename"),eS(t,"basename"),this.path=za.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?za.dirname(this.path):void 0}set dirname(t){CP(this.basename,"dirname"),this.path=za.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?za.extname(this.path):void 0}set extname(t){if(eS(t,"extname"),CP(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=za.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){O1(t)&&(t=pue(t)),tS(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?za.basename(this.path,this.extname):void 0}set stem(t){tS(t,"stem"),eS(t,"stem"),this.path=za.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Pr(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 eS(e,t){if(e&&e.includes(za.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+za.sep+"`")}function tS(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function CP(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function gue(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const yue=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),vue={}.hasOwnProperty;class nC extends yue{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=iue()}copy(){const t=new nC;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Xw(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(iS("data",this.frozen),this.namespace[t]=n,this):vue.call(this.namespace,t)&&this.namespace[t]||void 0:t?(iS("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=Zm(t),r=this.parser||this.Parser;return nS("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),nS("process",this.parser||this.Parser),rS("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,l){const c=Zm(t),d=r.parse(c);r.run(d,c,function(p,m,y){if(p||!m||!y)return f(p);const v=m,w=r.stringify(v,y);wue(w)?y.value=w:y.result=w,f(p,y)});function f(p,m){p||!m?l(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),nS("processSync",this.parser||this.Parser),rS("processSync",this.compiler||this.Compiler),this.process(t,i),EP("processSync","process",n),r;function i(a,l){n=!0,NP(a),r=l}}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(l,c){const d=Zm(n);i.run(t,d,f);function f(p,m,y){const v=m||t;p?c(p):l?l(v):r(void 0,v,y)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),EP("runSync","run",r),i;function a(l,c){NP(l),i=c,r=!0}}stringify(t,n){this.freeze();const r=Zm(n),i=this.compiler||this.Compiler;return rS("stringify",i),AP(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(iS("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,m)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(i.settings=Xw(!0,i.settings,f.settings))}function c(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];E1(b)&&E1(v)&&(v=Xw(!0,b,v)),r[y]=[f,v,...w]}}}}const xue=new nC().freeze();function nS(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function rS(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function iS(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(!E1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function EP(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Zm(e){return bue(e)?e:new sB(e)}function bue(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function wue(e){return typeof e=="string"||Sue(e)}function Sue(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const jue="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",OP=[],_P={allowDangerousHtml:!0},Nue=/^(https?|ircs?|mailto|xmpp)$/i,kue=[{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 Cue(e){const t=Aue(e),n=Eue(e);return Oue(t.runSync(t.parse(n),n),e)}function Aue(e){const t=e.rehypePlugins||OP,n=e.remarkPlugins||OP,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,..._P}:_P;return xue().use(sce).use(n).use(tue,r).use(t)}function Eue(e){const t=e.children||"",n=new sB;return typeof t=="string"&&(n.value=t),n}function Oue(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||_ue;for(const p of kue)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+jue+p.id,void 0);return aB(e,f),$se(e,{Fragment:s.Fragment,components:i,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function f(p,m,y){if(p.type==="raw"&&y&&typeof m=="number")return l?y.children.splice(m,1):y.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in Qw)if(Object.hasOwn(Qw,v)&&Object.hasOwn(p.properties,v)){const w=p.properties[v],b=Qw[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 c&&p.children?y.children.splice(m,1,...p.children):y.children.splice(m,1),m}}}function _ue(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||Nue.test(e.slice(0,t))?e:""}function zue(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Yv=zue();function Zv(e){(e===401||e===403)&&G5()}async function zP(e){const t=await fetch(`${Yv}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!t.ok){Zv(t.status);const n=await t.json().catch(()=>({}));throw new yr(n?.error?.message??`transcript fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function Tue(e){const t=await fetch(`${Yv}/projects/${encodeURIComponent(e)}/agent/providers`,{credentials:"include"});if(!t.ok){Zv(t.status);const n=await t.json().catch(()=>({}));throw new yr(n?.error?.message??`providers fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function Pue(e){const t=await fetch(`${Yv}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!t.ok){Zv(t.status);const n=await t.json().catch(()=>({}));throw new yr(n?.error?.message??`reset failed: ${t.status}`,t.status,n?.error?.code)}}async function Rue({project:e,prompt:t,provider:n,modelId:r,scope:i,signal:a,onEvent:l}){const c={prompt:t};n&&(c.provider=n),r&&(c.modelId=r),i&&(c.scope=i);const d=await fetch(`${Yv}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(c),signal:a});if(!d.ok||!d.body){Zv(d.status);const v=await d.json().catch(()=>({}));throw new yr(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{l(JSON.parse(E))}catch{}}b=m.indexOf(`
|
|
114
|
-
|
|
115
|
-
`)}}}finally{a?.removeEventListener("abort",y);try{f.releaseLock()}catch{}}}function oB(e){return!e||e.role!=="assistant"?"":e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}const Due=[{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?"}],Iue=[{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"}],Xm=e=>`canonry:aero:provider:${e}`,TP=e=>`canonry:aero:scope:${e}`;function Mue({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(!1),[a,l]=x.useState([]),[c,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(Xm(e))??null),[O,C]=x.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(TP(e))==="all"?"all":"read-only"),z=x.useRef(null),A=x.useRef(null),_=x.useRef(null),[R,$]=x.useState(0),F=x.useMemo(()=>{const U=c.trimStart();if(!U.startsWith("/"))return[];if(/\s/.test(U))return[];const I=U.toLowerCase();return Iue.filter(V=>V.command.startsWith(I)||V.label.toLowerCase().includes(I.slice(1)))},[c]);x.useEffect(()=>{$(U=>F.length===0?0:Math.min(U,F.length-1))},[F.length]);const q=Vn({queryKey:_e.agent.providers(e),queryFn:()=>Tue(e),enabled:t,staleTime:6e4}),B=x.useMemo(()=>{const U=q.data?.providers??[];if(k){const V=U.find(ce=>ce.id===k&&ce.configured);if(V)return V}const I=q.data?.defaultProvider;return I?U.find(V=>V.id===I)??null:null},[k,q.data]);x.useEffect(()=>{if(!q.data||!k)return;q.data.providers.find(I=>I.id===k&&I.configured)||(E(null),window.localStorage.removeItem(Xm(e)))},[q.data,k,e]);const K=x.useCallback(U=>{E(U),!(typeof window>"u")&&(U?window.localStorage.setItem(Xm(e),U):window.localStorage.removeItem(Xm(e)))},[e]),X=x.useCallback(()=>{C(U=>{const I=U==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(TP(e),I),I})},[e]);x.useEffect(()=>{if(!t)return;const U=I=>{I.key==="Escape"&&(r?i(!1):n(!1))};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[t,r]),x.useEffect(()=>{if(!t)return;let U=!1;j(null);const I=()=>{U||f||zP(e).then(re=>{U||l(re.messages)}).catch(re=>{U||j(re instanceof Error?re.message:"Failed to load transcript")})};I();const ce=window.setInterval(I,15e3);return()=>{U=!0,window.clearInterval(ce)}},[t,e,f]),x.useEffect(()=>()=>{z.current?.abort()},[e]),x.useEffect(()=>{const U=A.current;U&&(U.scrollTop=U.scrollHeight)},[a,v,m]);async function Q(U){const I=U.trim();if(!I||f)return;j(null),d(""),p(!0),w(""),y([]);const V={role:"user",content:I,timestamp:Date.now()};l(re=>[...re,V]);const ce=new AbortController;z.current=ce;try{await Rue({project:e,prompt:I,provider:k??void 0,scope:O,signal:ce.signal,onEvent:H});const re=await zP(e);l(re.messages)}catch(re){re.name!=="AbortError"&&j(re instanceof Error?re.message:"Prompt failed")}finally{p(!1),w(""),z.current=null}}function H(U){switch(U.type){case"message_update":w(oB(U.message));break;case"message_end":U.message.role==="assistant"&&w("");break;case"tool_execution_start":y(I=>[...I,{id:U.toolCallId,name:U.toolName,args:U.args,startedAt:Date.now()}]);break;case"tool_execution_end":y(I=>I.map(V=>V.id===U.toolCallId?{...V,endedAt:Date.now(),isError:U.isError,result:U.result}:V));break;case"error":j(U.message);break}}async function J(){z.current?.abort();try{await Pue(e),l([]),j(null)}catch(U){j(U instanceof Error?U.message:"Reset failed")}}const de=a.length===0,be=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",D=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 s.jsx("div",{className:be,onClick:U=>{r&&U.target===U.currentTarget&&i(!1)},children:s.jsx("div",{className:M,children:t?s.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:[s.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(F2,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),s.jsx("span",{className:"text-sm font-medium text-zinc-100",children:"Aero"}),s.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:f?"working…":e})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Lue,{providers:q.data?.providers??[],active:B,override:k,onPick:K,disabled:f}),s.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:s.jsx(h4,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),s.jsx("button",{type:"button",onClick:()=>i(U=>!U),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?s.jsx($W,{className:"h-3.5 w-3.5","aria-hidden":"true"}):s.jsx(DW,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),s.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:s.jsx(yd,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),s.jsxs("div",{ref:A,className:D,children:[b&&s.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}),de&&!f&&s.jsxs("div",{className:"flex flex-col gap-3 py-2",children:[s.jsxs("p",{className:"text-xs text-zinc-500",children:["Ask anything about ",s.jsx("span",{className:"text-zinc-300",children:e}),", or start with:"]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:Due.map(U=>s.jsx("button",{type:"button",onClick:()=>Q(U.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:U.label},U.label))})]}),Fue(a,e,k,O),m.length>0&&s.jsx("div",{className:"mt-3 space-y-1.5",children:m.map(U=>s.jsx(lB,{trail:U},U.id))}),f&&v&&s.jsxs("div",{className:"mt-3",children:[s.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),s.jsx(cB,{content:v})]}),f&&!v&&m.every(U=>U.endedAt!==void 0)&&s.jsx(Vue,{})]}),s.jsx($ue,{projectName:e,activeProvider:B,scope:O,onToggleScope:X,disabled:f}),s.jsxs("div",{className:"relative",children:[F.length>0&&s.jsx(Bue,{matches:F,selectedIndex:R,onHover:$,onPick:U=>{d(""),_.current?.focus(),U.action==="clear"?J():Q(U.prompt)}}),s.jsxs("form",{className:"flex items-end gap-2 border-t border-zinc-800/70 bg-zinc-950/80 px-3 py-2.5",onSubmit:U=>{if(U.preventDefault(),F.length>0){const I=F[R];d(""),I.action==="clear"?J():Q(I.prompt);return}Q(c)},children:[s.jsx("textarea",{ref:_,value:c,onChange:U=>d(U.target.value),onKeyDown:U=>{if(F.length>0){if(U.key==="ArrowDown"){U.preventDefault(),$(I=>(I+1)%F.length);return}if(U.key==="ArrowUp"){U.preventDefault(),$(I=>(I-1+F.length)%F.length);return}if(U.key==="Tab"){U.preventDefault();const I=F[R];d(`${I.command} `);return}if(U.key==="Escape"){U.preventDefault(),d("");return}}if(U.key==="Enter"&&!U.shiftKey)if(U.preventDefault(),F.length>0){const I=F[R];d(""),I.action==="clear"?J():Q(I.prompt)}else Q(c)},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"}),s.jsx("button",{type:"submit",disabled:f||!c.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:s.jsx(lW,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}):s.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:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(F2,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Ask Aero about ",e,"…"]}),s.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-600",children:"Enter"})]})})})}function Lue({providers:e,active:t,override:n,onPick:r,disabled:i}){const[a,l]=x.useState(!1),c=x.useRef(null);if(x.useEffect(()=>{if(!a)return;const p=y=>{c.current?.contains(y.target)||l(!1)},m=y=>{y.key==="Escape"&&l(!1)};return window.addEventListener("mousedown",p),window.addEventListener("keydown",m),()=>{window.removeEventListener("mousedown",p),window.removeEventListener("keydown",m)}},[a]),e.length===0)return null;const d=t?.label.replace(/\s+\(.+\)$/,"")??"No provider",f=t?.defaultModel;return s.jsxs("div",{ref:c,className:"relative",children:[s.jsxs("button",{type:"button",onClick:()=>l(p=>!p),disabled:i,className:"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-zinc-400 transition hover:bg-zinc-800/60 hover:text-zinc-200 disabled:opacity-50","aria-label":"Switch agent model","aria-haspopup":"listbox","aria-expanded":a,title:t?`${t.label} · ${t.defaultModel}`:"Pick a provider",children:[s.jsx("span",{className:"font-medium text-zinc-200",children:d}),f&&s.jsx("span",{className:"hidden font-mono text-[10px] text-zinc-500 sm:inline",children:f}),s.jsx(hW,{className:"h-3 w-3","aria-hidden":"true"})]}),a&&s.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:[s.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-2 text-[10px] uppercase tracking-wider text-zinc-500",children:"Aero provider"}),s.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 s.jsx("li",{children:s.jsxs("button",{type:"button",role:"option","aria-selected":m,disabled:!p.configured,onClick:()=>{p.configured&&(r(y?null:p.id),l(!1))},className:"flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition enabled:hover:bg-zinc-900 disabled:cursor-not-allowed disabled:opacity-50",children:[s.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:m?s.jsx(c4,{className:"h-3 w-3 text-emerald-400","aria-hidden":"true"}):null}),s.jsxs("span",{className:"flex-1",children:[s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"font-medium text-zinc-100",children:p.label}),y&&s.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&&s.jsx("span",{className:"rounded-full border border-zinc-800 px-1.5 text-[9px] uppercase tracking-wider text-zinc-500",children:"Key missing"})]}),s.jsx("span",{className:"mt-0.5 block font-mono text-[10px] text-zinc-500",children:p.defaultModel}),p.keySource==="env"&&s.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!p.configured&&s.jsxs("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:["Add key in config.yaml or export"," ",s.jsx("code",{className:"font-mono text-zinc-400",children:Uue(p.id)})]})]})]})},p.id)})}),n&&s.jsx("button",{type:"button",onClick:()=>{r(null),l(!1)},className:"w-full border-t border-zinc-800/60 px-3 py-2 text-left text-[11px] text-zinc-400 transition hover:bg-zinc-900 hover:text-zinc-100",children:"Reset to auto-detected default"})]})]})}function $ue({projectName:e,activeProvider:t,scope:n,onToggleScope:r,disabled:i}){const a=t?.label.replace(/\s+\(.+\)$/,"")??null,l=n==="all";return s.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:[s.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:[s.jsx("span",{className:"text-zinc-600",children:"project"}),s.jsx("span",{className:"font-medium text-zinc-200",children:e})]}),a&&s.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:[s.jsx("span",{className:"text-zinc-600",children:"model"}),s.jsx("span",{className:"font-medium text-zinc-200",children:a})]}),s.jsxs("button",{type:"button",onClick:r,disabled:i,className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] transition disabled:opacity-50 ${l?"border-amber-800/60 bg-amber-950/40 text-amber-300 hover:border-amber-700 hover:text-amber-200":"border-zinc-800 bg-zinc-900/70 text-zinc-400 hover:border-zinc-700 hover:text-zinc-200"}`,title:l?"Aero can invoke write tools (run sweep, dismiss insight, etc). Click to restrict.":"Aero is restricted to read-only tools. Click to allow writes.",children:[s.jsx("span",{className:l?"text-amber-500":"text-zinc-600",children:"scope"}),s.jsx("span",{className:"font-medium",children:l?"all tools":"read-only"})]})]})}function Bue({matches:e,selectedIndex:t,onHover:n,onPick:r}){return s.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:[s.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500",children:"Commands"}),s.jsx("ul",{role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:e.map((i,a)=>{const l=a===t;return s.jsx("li",{children:s.jsxs("button",{type:"button",role:"option","aria-selected":l,onMouseEnter:()=>n(a),onClick:()=>r(i),className:`flex w-full items-center gap-3 px-3 py-1.5 text-left text-xs transition ${l?"bg-zinc-900 text-zinc-100":"text-zinc-300 hover:bg-zinc-900/60"}`,children:[s.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:i.command}),s.jsx("span",{className:"font-medium",children:i.label}),s.jsx("span",{className:"ml-auto text-[10px] text-zinc-500",children:i.hint})]})},i.command)})}),s.jsxs("div",{className:"border-t border-zinc-800/60 px-3 py-1.5 text-[10px] text-zinc-600",children:[s.jsx("span",{className:"mr-3",children:"↑↓ to select"}),s.jsx("span",{className:"mr-3",children:"Enter to run"}),s.jsx("span",{children:"Tab to autocomplete"})]})]})}function Uue(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 que(e,t){const n=e.timestamp??0;return`${e.role}:${n}:${t}`}function Fue(e,t,n,r){const i=[];for(let a=0;a<e.length;a++){const l=e[a],c=que(l,a);if(l.role==="user"){const d=typeof l.content=="string"?l.content:JSON.stringify(l.content);if(d.startsWith("[system]"))continue;i.push(s.jsx(Hue,{text:d,projectName:t,providerOverride:n,scope:r},c));continue}if(l.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=Gue(l,d,l.timestamp??0),m=oB(l);i.push(s.jsxs(x.Fragment,{children:[p.length>0&&s.jsx("div",{className:"mt-3 space-y-1.5",children:p.map(y=>s.jsx(lB,{trail:y},y.id))}),m.trim()&&s.jsxs("div",{className:"mt-3",children:[s.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),s.jsx(cB,{content:m})]})]},c)),a=f-1;continue}}return i}function Hue({text:e,projectName:t,providerOverride:n,scope:r}){const[i,a]=x.useState(!1),l=x.useMemo(()=>Kue(t,e,n,r),[t,e,n,r]);async function c(){try{await navigator.clipboard.writeText(l),a(!0),window.setTimeout(()=>a(!1),1500)}catch{}}return s.jsxs("div",{className:"group relative mt-3 rounded-md bg-zinc-900/60 px-3 py-2 text-zinc-200",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("div",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"You"}),s.jsx("button",{type:"button",onClick:c,className:"inline-flex items-center gap-1 rounded border border-zinc-800/70 bg-zinc-950/60 px-1.5 py-0.5 text-[10px] text-zinc-400 opacity-0 transition hover:border-zinc-700 hover:text-zinc-100 group-hover:opacity-100 focus:opacity-100","aria-label":"Copy as CLI command",title:l,children:i?s.jsxs(s.Fragment,{children:[s.jsx(c4,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):s.jsxs(s.Fragment,{children:[s.jsx(bW,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),s.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function Kue(e,t,n,r){const i=["canonry","agent","ask",PP(e),PP(t)];return n&&i.push("--provider",n),r==="read-only"&&i.push("--scope","read-only"),i.join(" ")}function PP(e){return`'${e.replace(/'/g,"'\\''")}'`}function Gue(e,t,n){const r=[];for(const i of e.content){if(i.type!=="toolCall")continue;const a=i,l=t.get(a.id);r.push({id:a.id,name:a.name,args:a.arguments,startedAt:n,endedAt:l?.timestamp,isError:l?.isError,result:l?.content})}return r}function lB({trail:e}){const[t,n]=x.useState(!1),r=e.endedAt===void 0,i=!r&&e.isError===!0,a=e.endedAt!=null?e.endedAt-e.startedAt:null,l=a==null||a<0?null:a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`,c=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 s.jsxs("div",{className:`rounded-md border ${c} ${d} font-mono`,children:[s.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:[s.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:r?s.jsx(f4,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):i?s.jsx(iy,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):s.jsx(sY,{className:"h-3 w-3 text-zinc-500","aria-hidden":"true"})}),s.jsx("span",{className:"text-[11px] font-semibold text-zinc-100",children:e.name}),s.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px] text-zinc-500",children:[r?s.jsx("span",{className:"text-emerald-400",children:"running…"}):s.jsxs(s.Fragment,{children:[s.jsx("span",{children:i?"failed":"ok"}),l&&s.jsx("span",{children:l})]}),s.jsx(Yh,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`,"aria-hidden":"true"})]})]}),t&&s.jsxs("div",{className:"border-t border-zinc-800/60 px-2.5 py-2 text-[11px] text-zinc-400",children:[s.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:"Args"}),s.jsx("pre",{className:"mb-2 overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:RP(e.args)}),!r&&e.result!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:i?"Error":"Result"}),s.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:RP(e.result)})]})]})]})}function RP(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 cB({content:e}){return s.jsx("div",{className:"aero-markdown text-zinc-100",children:s.jsx(Cue,{components:{h1:t=>s.jsx("h1",{...t,className:"mt-3 mb-2 text-base font-semibold text-zinc-50"}),h2:t=>s.jsx("h2",{...t,className:"mt-3 mb-2 text-sm font-semibold text-zinc-50"}),h3:t=>s.jsx("h3",{...t,className:"mt-3 mb-1.5 text-sm font-semibold text-zinc-100"}),h4:t=>s.jsx("h4",{...t,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-300"}),p:t=>s.jsx("p",{...t,className:"mb-2 leading-relaxed"}),ul:t=>s.jsx("ul",{...t,className:"mb-2 ml-4 list-disc space-y-1"}),ol:t=>s.jsx("ol",{...t,className:"mb-2 ml-4 list-decimal space-y-1"}),li:t=>s.jsx("li",{...t,className:"marker:text-zinc-600"}),strong:t=>s.jsx("strong",{...t,className:"font-semibold text-zinc-50"}),em:t=>s.jsx("em",{...t,className:"text-zinc-200"}),code:({children:t,...n})=>s.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=>s.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=>s.jsx("a",{...t,className:"text-emerald-400 underline decoration-emerald-700 hover:decoration-emerald-400",target:"_blank",rel:"noopener noreferrer"}),table:t=>s.jsx("div",{className:"mb-2 overflow-x-auto",children:s.jsx("table",{...t,className:"w-full border-collapse text-xs"})}),thead:t=>s.jsx("thead",{...t,className:"border-b border-zinc-800"}),th:t=>s.jsx("th",{...t,className:"px-2 py-1 text-left font-semibold text-zinc-300"}),tr:t=>s.jsx("tr",{...t,className:"border-b border-zinc-900"}),td:t=>s.jsx("td",{...t,className:"px-2 py-1 text-zinc-200"}),blockquote:t=>s.jsx("blockquote",{...t,className:"mb-2 border-l-2 border-zinc-700 pl-3 italic text-zinc-400"}),hr:()=>s.jsx("hr",{className:"my-3 border-zinc-800"})},children:e})})}function Vue(){return s.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[s.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),s.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[s.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-emerald-400/80"}),s.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-emerald-400/60"}),s.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-emerald-400/40"})]})]})}function Que(){const e=F5(),t=/^\/projects\/([^/]+)/.exec(e.pathname),n=t?decodeURIComponent(t[1]):null,r=Vn({queryKey:_e.projects.all,queryFn:Av,enabled:n!==null,staleTime:6e4});if(!n)return null;const i=r.data??[],a=i.find(l=>l.id===n)??i.find(l=>l.name===n);return a?s.jsx(Mue,{projectName:a.name},a.name):null}function Xv(e,t,n){switch(e.invalidateQueries({queryKey:_e.runs.all}),e.invalidateQueries({queryKey:_e.projects.all}),t){case ht["answer-visibility"]:case ht["site-audit"]:case ht["backlink-extract"]:return;case ht["gsc-sync"]:case ht["inspect-sitemap"]:e.invalidateQueries({queryKey:_e.gsc.project(n)});return;case ht["ga-sync"]:e.invalidateQueries({queryKey:_e.traffic.project(n)});return;case ht["traffic-sync"]:e.invalidateQueries({queryKey:_e.traffic.project(n)}),e.invalidateQueries({queryKey:_e.serverTraffic.project(n)});return;case ht["bing-inspect"]:case ht["bing-inspect-sitemap"]:e.invalidateQueries({queryKey:_e.bing.project(n)});return;case ht["aeo-discover-seed"]:case ht["aeo-discover-probe"]:return;default:return t}}const DP=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:AW},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:uW},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:kW}],IP=e=>({label:e,state:"checking",detail:"Checking service health"}),Wue={apiStatus:IP("API"),workerStatus:IP("Worker")};function Yue(e){switch(e){case ht["answer-visibility"]:return"Visibility sweep";case ht["gsc-sync"]:return"GSC sync";case ht["inspect-sitemap"]:return"Sitemap inspection";case ht["ga-sync"]:return"GA sync";case ht["traffic-sync"]:return"Traffic sync";case ht["bing-inspect"]:return"Bing URL inspection";case ht["bing-inspect-sitemap"]:return"Bing sitemap inspection";case ht["site-audit"]:return"Site audit";case ht["backlink-extract"]:return"Backlink extract";case ht["aeo-discover-seed"]:return"Discovery (seed phase)";case ht["aeo-discover-probe"]:return"Discovery (probe phase)"}}function Zue(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function Xue(e){const t=Yue(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function Jue(e,t){return e.error?`${t}: ${wk(e.error)}`:e.location?`${t} · ${e.location}`:t}function ede(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function tde(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 nde(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function rde(){const e=vr(),t=x.useSyncExternalStore(Bne,Zl,Zl),n=Object.keys(t.runs).length>0||Object.keys(t.batches).length>0,r=Vn({queryKey:_e.runs.all,queryFn:Q5,enabled:n,staleTime:u1,refetchInterval:3e3}),i=Vn({queryKey:_e.projects.all,queryFn:Av,enabled:n}),a=x.useRef({}),l=x.useCallback(()=>{r.refetch()},[r.refetch]);return x.useEffect(()=>{n&&l()},[n,l]),x.useEffect(()=>{if(!n||typeof window>"u")return;const c=()=>{document.visibilityState==="visible"&&l()};return window.addEventListener("focus",l),document.addEventListener("visibilitychange",c),()=>{window.removeEventListener("focus",l),document.removeEventListener("visibilitychange",c)}},[n,l]),x.useEffect(()=>{const c=r.data??[],d=i.data??[],f=Object.fromEntries(c.map(m=>[m.id,m])),p=Object.fromEntries(c.map(m=>[m.id,m.status]));for(const m of Object.values(t.runs)){const y=f[m.runId];if(!y||!_k(y.status)||(a.current[y.id]??m.lastAnnouncedStatus)===y.status)continue;const w=d.find(j=>j.id===y.projectId);if(w&&Xv(e,y.kind,w.name),m.sourceAction==="run-all"){xT(y.id);continue}const b=ede(y.projectId,m.projectLabel,d);dt({title:Xue(y),detail:Jue(y,b),tone:Zue(y.status),dedupeKey:`run:${y.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:y.id}}),xT(y.id)}for(const m of Object.values(t.batches)){const y=Fne(m.runIds,f);y.finished&&(dt({title:"Run-all batch finished",detail:tde(y,m.skippedCount),tone:nde(y),dedupeKey:`batch:${m.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),qne(m.batchId))}a.current=p},[i.data,r.data,t,e]),null}function ide(){const e=Zh(),{dashboard:t,isLoading:n,refetch:r}=mc(),l=Gv(!e,e?.health).data??e?.health??Wue,c=F5(),{runId:d,evidenceId:f,closeDrawer:p}=bd(),[m,y]=x.useState(!1),v=ose(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)},[c.pathname]),x.useEffect(()=>{if(typeof window>"u"||!d&&!f)return;const C=z=>{z.key==="Escape"&&p()};return window.addEventListener("keydown",C),()=>{window.removeEventListener("keydown",C)}},[d,f,p]);const j=t??e?.dashboard??null,k=d&&j?Mae(j,d):void 0,E=f&&j?Lae(j,f):void 0,O=(()=>{const C=c.pathname;if(C==="/")return"Portfolio";if(C==="/projects")return"Projects";if(C==="/runs")return"Runs";if(C==="/settings")return"Settings";if(C==="/setup")return"Setup";if(C==="/backlinks")return"Backlinks";if(C==="/traffic"||C.startsWith("/traffic/"))return"Server traffic";if(C.startsWith("/projects/")){const A=C.split("/").filter(Boolean)[1];if(A&&j){const _=j.projects.find(R=>R.project.id===A);if(_)return _.project.name}return"Project"}return"Not found"})();return s.jsxs("div",{className:"app-shell",children:[s.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),s.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[s.jsx("div",{className:"sidebar-brand",children:s.jsx(OT,{version:l.apiStatus.version})}),s.jsxs("nav",{className:"sidebar-nav",children:[s.jsxs(Et,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(zW,{className:"sidebar-icon"}),s.jsx("span",{children:"Overview"})]}),s.jsxs(Et,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[s.jsx(OW,{className:"sidebar-icon"}),s.jsx("span",{children:"Projects"})]}),s.jsxs(Et,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(wh,{className:"sidebar-icon"}),s.jsx("span",{children:"Runs"})]}),s.jsxs(Et,{to:"/traffic",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[s.jsx(KW,{className:"sidebar-icon"}),s.jsx("span",{children:"Server traffic"})]}),s.jsxs(Et,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(d4,{className:"sidebar-icon"}),s.jsx("span",{children:"Backlinks"})]}),s.jsxs(Et,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(ZW,{className:"sidebar-icon"}),s.jsx("span",{children:"Settings"})]}),n?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(C=>s.jsxs("div",{className:"sidebar-skeleton-item",children:[s.jsx("span",{className:"skeleton-circle size-2"}),s.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+C*15}%`}})]},C))]}):j&&j.projects.length>0?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"sidebar-section-title",children:"Projects"}),j.projects.map(C=>{const z=C.visibilitySummary.tone;return s.jsxs(Et,{to:"/projects/$projectId",params:{projectId:C.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[s.jsx("span",{className:`sidebar-dot sidebar-dot-${z}`}),s.jsx("span",{children:C.project.name})]},C.project.id)})]}):n?null:s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"sidebar-section-title",children:"Resources"}),s.jsxs(Et,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(QW,{className:"sidebar-icon"}),s.jsx("span",{children:"Setup"})]})]})]}),s.jsx("div",{className:"sidebar-footer",children:DP.map(({label:C,href:z,Icon:A})=>s.jsx("a",{className:"sidebar-footer-icon",href:z,target:"_blank",rel:"noopener noreferrer",title:C,"aria-label":C,children:s.jsx(A,{className:"size-4"})},z))})]}),s.jsxs("div",{className:"main-area",children:[s.jsxs("header",{className:"topbar",children:[s.jsxs("div",{className:"topbar-left",children:[s.jsx("div",{className:"topbar-brand-mobile",children:s.jsx(OT,{compact:!0})}),s.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[s.jsx(Et,{to:"/",children:"Home"}),s.jsx(Yh,{className:"breadcrumb-sep size-3"}),s.jsx("span",{className:"breadcrumb-current",children:O})]})]}),s.jsxs("div",{className:"topbar-actions",children:[s.jsxs("div",{className:"health-pill-row",children:[s.jsxs("span",{className:`health-pill health-pill-${l.apiStatus.state}`,title:Bo(l.apiStatus),children:["API ",l.apiStatus.state==="ok"?"ok":l.apiStatus.state]}),s.jsxs("span",{className:`health-pill health-pill-${l.workerStatus.state}`,title:Bo(l.workerStatus),children:["Worker ",l.workerStatus.state==="ok"?"ok":l.workerStatus.state]})]}),s.jsxs(pe,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":m,"aria-controls":"mobile-nav",onClick:()=>y(C=>!C),children:[s.jsx(MW,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),s.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${m?"mobile-nav-open":""}`,children:[s.jsxs(pe,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>y(!1),children:[s.jsx(yd,{className:"size-5"}),s.jsx("span",{className:"sr-only",children:"Close navigation"})]}),s.jsx(Et,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),s.jsx(Et,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),s.jsx(Et,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),s.jsx(Et,{to:"/traffic",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Server traffic"}),s.jsx(Et,{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?s.jsxs("div",{className:"mobile-nav-section",children:[s.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),j.projects.map(C=>s.jsx(Et,{to:"/projects/$projectId",params:{projectId:C.project.id},className:"mobile-nav-link",children:C.project.name},C.project.id))]}):null]}),s.jsx("main",{id:"content",className:"page-shell",children:n&&!e?s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-40"}),s.jsx("div",{className:"skeleton-text-sm w-72"})]}),s.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(C=>s.jsxs("div",{className:"page-skeleton-card",children:[s.jsx("div",{className:"skeleton-text w-24"}),s.jsx("div",{className:"skeleton-text w-full"}),s.jsx("div",{className:"skeleton-text-sm w-3/4"})]},C))}),s.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(C=>s.jsxs("div",{className:"page-skeleton-card",children:[s.jsx("div",{className:"skeleton-text w-20"}),s.jsx("div",{className:"space-y-2",children:[1,2,3].map(z=>s.jsx("div",{className:"skeleton-text-sm w-full"},z))})]},C))})]}):s.jsx(ok,{})}),s.jsxs("footer",{className:"footer",children:[s.jsxs("span",{className:"footer-brand",children:[s.jsx("span",{children:s.jsx("a",{href:"https://canonry.ai",children:"Canonry"})}),l.apiStatus.version&&l.apiStatus.version!=="unknown"?s.jsxs("span",{className:"footer-version",children:["v",l.apiStatus.version]}):null]}),s.jsx("div",{className:"footer-links",children:DP.map(({label:C,href:z,Icon:A})=>s.jsx("a",{href:z,target:"_blank",rel:"noopener noreferrer",title:C,"aria-label":C,className:"footer-icon",children:s.jsx(A,{className:"size-3.5"})},z))})]})]}),k?s.jsxs(Cae,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:p,children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[s.jsx(Lv,{status:k.status}),s.jsx("span",{className:"text-zinc-400",children:k.startedAt}),s.jsx("span",{className:"text-zinc-500",children:k.duration}),s.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&s.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.statusDetail}),s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),b?s.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):w&&w.snapshots.length>0?s.jsxs("div",{className:"space-y-2",children:[w.snapshots.map(C=>s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[s.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:C.query??"Unknown query"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Xl,{provider:C.provider}),s.jsx($3,{variant:C.citationState===kh.cited?"success":"neutral",children:C.citationState})]})]}),C.model&&s.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:C.model}),C.citedDomains.length>0&&s.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[s.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",C.citedDomains.join(", ")]}),C.competitorOverlap.length>0&&s.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",C.competitorOverlap.join(", ")]}),C.groundingSources&&C.groundingSources.length>0&&s.jsxs("details",{className:"mt-2",children:[s.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[C.groundingSources.length," grounding source",C.groundingSources.length!==1?"s":""]}),s.jsx("ul",{className:"mt-1 space-y-0.5",children:C.groundingSources.map((z,A)=>s.jsx("li",{className:"text-xs text-zinc-500 truncate",children:s.jsx("a",{href:z.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:z.title||z.uri})},A))})]}),C.answerText&&s.jsxs("details",{className:"mt-1",children:[s.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),s.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:C.answerText})]})]},C.id)),w.status==="running"&&s.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Running remaining queries..."]})]}):w&&w.status==="running"?s.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[s.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"?s.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[s.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?s.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[s.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),s.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:Ane(w.error)})]}):s.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?s.jsx(_ae,{evidence:E.evidence,project:E.project,onClose:p}):null,s.jsx(rde,{}),s.jsx(use,{}),s.jsx(Que,{})]})}class ade 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?s.jsx("div",{className:"page-container",children:s.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[s.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:s.jsx(iy,{className:"size-6 text-rose-400"})}),s.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),s.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),s.jsxs("div",{className:"flex gap-3 mt-2",children:[s.jsxs(pe,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[s.jsx(h4,{className:"size-3.5 mr-1.5"}),"Try again"]}),s.jsx(pe,{variant:"secondary",size:"sm",onClick:()=>{const t=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=t||"/"},children:"Go home"})]})]})}):this.props.children}}const Pe=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ji("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}));Pe.displayName="Card";const _1=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ji("flex flex-col gap-1.5 p-5",e),...t}));_1.displayName="CardHeader";const z1=x.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:Ji("font-medium tracking-tight text-zinc-50",e),...t}));z1.displayName="CardTitle";const T1=x.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:Ji("text-sm text-zinc-500",e),...t}));T1.displayName="CardDescription";const Mg=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ji("p-5 pt-0",e),...t}));Mg.displayName="CardContent";function sde({points:e,tone:t}){const n=x.useId();if(e.length===0)return null;const r=42,i=132,a=5,l=Math.min(...e),d=Math.max(...e)-l||1,f=i-a*2,p=r-a*2,m=e.map((y,v)=>{const w=a+v/Math.max(e.length-1,1)*f,b=a+(1-(y-l)/d)*p;return`${w},${b}`}).join(" ");return s.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${i} ${r}`,"aria-hidden":"true",children:[s.jsx("defs",{children:s.jsx("clipPath",{id:n,children:s.jsx("rect",{x:a,y:a,width:f,height:p,rx:"8"})})}),s.jsx("line",{className:"sparkline-guide",x1:a,x2:i-a,y1:r-a,y2:r-a}),s.jsx("polyline",{clipPath:`url(#${n})`,points:m,vectorEffect:"non-scaling-stroke"})]})}function ode({project:e}){return s.jsxs(Et,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[s.jsxs("div",{className:"project-row-primary",children:[s.jsxs("div",{children:[s.jsx("p",{className:"project-name",children:e.project.name}),s.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),s.jsx("p",{className:"project-insight",children:e.insight})]}),s.jsx("div",{className:"project-row-stat",children:s.jsxs("div",{className:"metric-inline-block",children:[s.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),s.jsx("p",{className:`metric-inline-value ${e.visibilityTone==="caution"?"text-amber-400":""}`,children:e.visibilityScore}),s.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta}),e.providerCoverage&&s.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),s.jsx("div",{className:"project-row-stat",children:s.jsxs("div",{className:"metric-inline-block",children:[s.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),s.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),s.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Dv(e.lastRun.status)]})]})}),s.jsx("div",{className:"project-row-chart",children:s.jsx(sde,{points:e.trend,tone:v3(e.lastRun.status)})}),s.jsx("span",{className:"project-row-link",children:s.jsx(Yh,{className:"h-4 w-4 text-zinc-500"})})]})}function lde(){const e=Zh(),{dashboard:t,isLoading:n}=mc(),r=t??e?.dashboard;if(!r||n)return s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-32"}),s.jsx("div",{className:"skeleton-text-sm w-64"})]}),s.jsx("div",{className:"space-y-3",children:[1,2,3].map(p=>s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsx("div",{className:"skeleton-text w-36"}),s.jsx("div",{className:"skeleton-text-sm w-48"})]}),s.jsx("div",{className:"skeleton-text w-16"}),s.jsx("div",{className:"skeleton-text w-16"}),s.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},p))})]});const i=r.portfolioOverview,c=Gv(!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=Pne(i.systemHealth,c,r.settings),{openRun:f}=bd();return s.jsxs("div",{className:"page-container",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Portfolio"}),s.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),s.jsx("div",{className:"page-header-right",children:s.jsx("p",{className:"text-[11px] text-zinc-600",children:i.lastUpdatedAt})})]}),i.projects.length>0?s.jsx("div",{className:"project-list project-list-scrollable",children:i.projects.map(p=>s.jsx(ode,{project:p},p.project.id))}):s.jsxs(Pe,{className:"surface-card empty-card",children:[s.jsx("h3",{children:i.emptyState?.title??"No projects yet"}),s.jsx("p",{className:"supporting-copy",children:i.emptyState?.detail}),s.jsx(pe,{size:"sm",asChild:!0,children:s.jsx(Et,{to:i.emptyState?.ctaHref==="/setup"||!i.emptyState?.ctaHref?"/setup":"/",children:i.emptyState?.ctaLabel??"Launch setup"})})]}),s.jsxs("div",{className:"overview-secondary-grid",children:[i.attentionItems.length>0&&s.jsxs("section",{className:"overview-secondary-section",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),s.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),s.jsx("div",{className:"attention-list attention-list-scrollable",children:i.attentionItems.map(p=>s.jsxs(Et,{to:p.href,className:`attention-item attention-item-${p.tone}`,children:[s.jsxs("div",{children:[s.jsx("p",{className:"attention-title",children:p.title}),s.jsx("p",{className:"attention-detail",children:p.detail})]}),s.jsx("span",{className:"attention-action",children:p.actionLabel})]},p.id))})]}),s.jsxs("section",{className:"overview-secondary-section",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),s.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),s.jsx("div",{className:"compact-stack compact-stack-scrollable",children:i.recentRuns.length>0?i.recentRuns.map(p=>s.jsxs("button",{className:"compact-run",type:"button",onClick:()=>f(p.id),children:[s.jsxs("div",{children:[s.jsx("p",{className:"compact-run-title",children:p.projectName}),s.jsx("p",{className:"compact-run-detail",children:p.summary})]}),s.jsx(Lv,{status:p.status})]},p.id)):s.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),s.jsxs("section",{className:"page-section",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),s.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),s.jsx("div",{className:"health-grid",children:d.map(p=>s.jsxs(Pe,{className:"surface-card compact-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:p.label}),s.jsx("h3",{children:p.detail})]}),s.jsx(tt,{tone:p.tone,title:p.id==="api"?Bo(c.apiStatus):p.id==="worker"?Bo(c.workerStatus):void 0,children:p.label})]}),s.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const rC=Symbol.for("yaml.alias"),P1=Symbol.for("yaml.document"),Do=Symbol.for("yaml.map"),uB=Symbol.for("yaml.pair"),qa=Symbol.for("yaml.scalar"),jd=Symbol.for("yaml.seq"),Qi=Symbol.for("yaml.node.type"),yc=e=>!!e&&typeof e=="object"&&e[Qi]===rC,Jv=e=>!!e&&typeof e=="object"&&e[Qi]===P1,ep=e=>!!e&&typeof e=="object"&&e[Qi]===Do,On=e=>!!e&&typeof e=="object"&&e[Qi]===uB,Jt=e=>!!e&&typeof e=="object"&&e[Qi]===qa,tp=e=>!!e&&typeof e=="object"&&e[Qi]===jd;function Cn(e){if(e&&typeof e=="object")switch(e[Qi]){case Do:case jd:return!0}return!1}function An(e){if(e&&typeof e=="object")switch(e[Qi]){case rC:case Do:case qa:case jd:return!0}return!1}const dB=e=>(Jt(e)||Cn(e))&&!!e.anchor,Nl=Symbol("break visit"),cde=Symbol("skip children"),dh=Symbol("remove node");function Nd(e,t){const n=ude(t);Jv(e)?Tu(null,e.contents,n,Object.freeze([e]))===dh&&(e.contents=null):Tu(null,e,n,Object.freeze([]))}Nd.BREAK=Nl;Nd.SKIP=cde;Nd.REMOVE=dh;function Tu(e,t,n,r){const i=dde(e,t,n,r);if(An(i)||On(i))return fde(e,r,i),Tu(e,i,n,r);if(typeof i!="symbol"){if(Cn(t)){r=Object.freeze(r.concat(t));for(let a=0;a<t.items.length;++a){const l=Tu(a,t.items[a],n,r);if(typeof l=="number")a=l-1;else{if(l===Nl)return Nl;l===dh&&(t.items.splice(a,1),a-=1)}}}else if(On(t)){r=Object.freeze(r.concat(t));const a=Tu("key",t.key,n,r);if(a===Nl)return Nl;a===dh&&(t.key=null);const l=Tu("value",t.value,n,r);if(l===Nl)return Nl;l===dh&&(t.value=null)}}return i}function ude(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 dde(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(ep(t))return n.Map?.(e,t,r);if(tp(t))return n.Seq?.(e,t,r);if(On(t))return n.Pair?.(e,t,r);if(Jt(t))return n.Scalar?.(e,t,r);if(yc(t))return n.Alias?.(e,t,r)}function fde(e,t,n){const r=t[t.length-1];if(Cn(r))r.items[e]=n;else if(On(r))e==="key"?r.key=n:r.value=n;else if(Jv(r))r.contents=n;else{const i=yc(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const hde={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},pde=e=>e.replace(/[!,[\]{}]/g,t=>hde[t]);class Br{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Br.defaultYaml,t),this.tags=Object.assign({},Br.defaultTags,n)}clone(){const t=new Br(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Br(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Br.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Br.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Br.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Br.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[a,l]=r;return this.tags[a]=l,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[a]=r;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const l=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,l),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const l=t.slice(2,-1);return l==="!"||l==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),l)}const[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const a=this.tags[r];if(a)try{return a+decodeURIComponent(i)}catch(l){return n(String(l)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+pde(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&&An(t.contents)){const a={};Nd(t.contents,(l,c)=>{An(c)&&c.tag&&(a[c.tag]=!0)}),i=Object.keys(a)}else i=[];for(const[a,l]of r)a==="!!"&&l==="tag:yaml.org,2002:"||(!t||i.some(c=>c.startsWith(l)))&&n.push(`%TAG ${a} ${l}`);return n.join(`
|
|
117
|
-
`)}}Br.defaultYaml={explicit:!1,version:"1.2"};Br.defaultTags={"!!":"tag:yaml.org,2002:"};function fB(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 hB(e){const t=new Set;return Nd(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function pB(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function mde(e,t){const n=[],r=new Map;let i=null;return{onAnchor:a=>{n.push(a),i??(i=hB(e));const l=pB(t,i);return i.add(l),l},setAnchors:()=>{for(const a of n){const l=r.get(a);if(typeof l=="object"&&l.anchor&&(Jt(l.node)||Cn(l.node)))l.node.anchor=l.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=a,c}}},sourceObjects:r}}function Pu(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,a=r.length;i<a;++i){const l=r[i],c=Pu(e,r,String(i),l);c===void 0?delete r[i]:c!==l&&(r[i]=c)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const a=r.get(i),l=Pu(e,r,i,a);l===void 0?r.delete(i):l!==a&&r.set(i,l)}else if(r instanceof Set)for(const i of Array.from(r)){const a=Pu(e,r,i,i);a===void 0?r.delete(i):a!==i&&(r.delete(i),r.add(a))}else for(const[i,a]of Object.entries(r)){const l=Pu(e,r,i,a);l===void 0?delete r[i]:l!==a&&(r[i]=l)}return e.call(t,n,r)}function Vi(e,t,n){if(Array.isArray(e))return e.map((r,i)=>Vi(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!dB(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 iC{constructor(t){Object.defineProperty(this,Qi,{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(!Jv(t))throw new TypeError("A document argument is required");const l={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Vi(this,"",l);if(typeof i=="function")for(const{count:d,res:f}of l.anchors.values())i(f,d);return typeof a=="function"?Pu(a,{"":c},"",c):c}}class aC extends iC{constructor(t){super(rC),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=[],Nd(t,{Node:(a,l)=>{(yc(l)||dB(l))&&r.push(l)}}),n&&(n.aliasResolveCache=r));let i;for(const a of r){if(a===this)break;a.anchor===this.source&&(i=a)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:a}=n,l=this.resolve(i,n);if(!l){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let c=r.get(l);if(c||(Vi(l,null,n),c=r.get(l)),c?.res===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(a>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Lg(i,l,r)),c.count*c.aliasCount>a)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return c.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(fB(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 Lg(e,t,n){if(yc(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Cn(t)){let r=0;for(const i of t.items){const a=Lg(e,i,n);a>r&&(r=a)}return r}else if(On(t)){const r=Lg(e,t.key,n),i=Lg(e,t.value,n);return Math.max(r,i)}return 1}const mB=e=>!e||typeof e!="function"&&typeof e!="object";class it extends iC{constructor(t){super(qa),this.value=t}toJSON(t,n){return n?.keep?this.value:Vi(this.value,t,n)}toString(){return String(this.value)}}it.BLOCK_FOLDED="BLOCK_FOLDED";it.BLOCK_LITERAL="BLOCK_LITERAL";it.PLAIN="PLAIN";it.QUOTE_DOUBLE="QUOTE_DOUBLE";it.QUOTE_SINGLE="QUOTE_SINGLE";const gde="tag:yaml.org,2002:";function yde(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 Oh(e,t,n){if(Jv(e)&&(e=e.contents),An(e))return e;if(On(e)){const m=n.schema[Do].createNode?.(n.schema,null,n);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:l,sourceObjects:c}=n;let d;if(r&&e&&typeof e=="object"){if(d=c.get(e),d)return d.anchor??(d.anchor=i(e)),new aC(d.anchor);d={anchor:null,node:null},c.set(e,d)}t?.startsWith("!!")&&(t=gde+t.slice(2));let f=yde(e,t,l.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new it(e);return d&&(d.node=m),m}f=e instanceof Map?l[Do]:Symbol.iterator in Object(e)?l[jd]:l[Do]}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 it(e);return t?p.tag=t:f.default||(p.tag=f.tag),d&&(d.node=p),p}function yy(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const a=t[i];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const l=[];l[a]=r,r=l}else r=new Map([[a,r]])}return Oh(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const th=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class gB extends iC{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=>An(r)||On(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(th(t))this.add(n);else{const[r,...i]=t,a=this.get(r,!0);if(Cn(a))a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,yy(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(Cn(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:Cn(a)?a.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!On(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 Cn(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(Cn(a))a.setIn(i,n);else if(a===void 0&&this.schema)this.set(r,yy(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const vde=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ss(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Tl=(e,t,n)=>e.endsWith(`
|
|
118
|
-
`)?Ss(n,t):n.includes(`
|
|
119
|
-
`)?`
|
|
120
|
-
`+Ss(n,t):(e.endsWith(" ")?"":" ")+n,yB="flow",R1="block",$g="quoted";function e0(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:l,onOverflow:c}={}){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===R1&&(b=MP(e,b,t.length),b!==-1&&(m=b+d));for(let O;O=e[b+=1];){if(n===$g&&O==="\\"){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(O===`
|
|
121
|
-
`)n===R1&&(b=MP(e,b,t.length)),m=b+t.length+d,y=void 0;else{if(O===" "&&v&&v!==" "&&v!==`
|
|
122
|
-
`&&v!==" "){const C=e[b+1];C&&C!==" "&&C!==`
|
|
123
|
-
`&&C!==" "&&(y=b)}if(b>=m)if(y)f.push(y),m=y+d,y=void 0;else if(n===$g){for(;v===" "||v===" ";)v=O,O=e[b+=1],w=!0;const C=b>k+1?b-2:j-1;if(p[C])return e;f.push(C),p[C]=!0,m=C+d,y=void 0}else w=!0}v=O}if(w&&c&&c(),f.length===0)return e;l&&l();let E=e.slice(0,f[0]);for(let O=0;O<f.length;++O){const C=f[O],z=f[O+1]||e.length;C===0?E=`
|
|
124
|
-
${t}${e.slice(0,z)}`:(n===$g&&p[C]&&(E+=`${e[C]}\\`),E+=`
|
|
125
|
-
${t}${e.slice(C+1,z)}`)}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 t0=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),n0=e=>/^(%|---|\.\.\.)/m.test(e);function xde(e,t,n){if(!t||t<0)return!1;const r=t-n,i=e.length;if(i<=r)return!1;for(let a=0,l=0;a<i;++a)if(e[a]===`
|
|
127
|
-
`){if(a-l>r)return!0;if(l=a+1,i-l<=r)return!1}return!0}function fh(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(n0(e)?" ":"");let l="",c=0;for(let d=0,f=n[d];f;f=n[++d])if(f===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(l+=n.slice(c,d)+"\\ ",d+=1,c=d,f="\\"),f==="\\")switch(n[d+1]){case"u":{l+=n.slice(c,d);const p=n.substr(d+2,4);switch(p){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:p.substr(0,2)==="00"?l+="\\x"+p.substr(2):l+=n.substr(d,6)}d+=5,c=d+1}break;case"n":if(r||n[d+2]==='"'||n.length<i)d+=1;else{for(l+=n.slice(c,d)+`
|
|
128
|
-
|
|
129
|
-
`;n[d+2]==="\\"&&n[d+3]==="n"&&n[d+4]!=='"';)l+=`
|
|
130
|
-
`,d+=2;l+=a,n[d+2]===" "&&(l+="\\"),d+=1,c=d+1}break;default:d+=1}return l=c?l+n.slice(c):n,r?l:e0(l,a,$g,t0(t,!1))}function D1(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
131
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return fh(e,t);const n=t.indent||(n0(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
132
|
-
${n}`)+"'";return t.implicitKey?r:e0(r,n,yB,t0(t,!1))}function Ru(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=fh;else{const i=e.includes('"'),a=e.includes("'");i&&!a?r=D1:a&&!i?r=fh:r=n?D1:fh}return r(e,t)}let I1;try{I1=new RegExp(`(^|(?<!
|
|
133
|
-
))
|
|
134
|
-
+(?!
|
|
135
|
-
|$)`,"g")}catch{I1=/\n+(?!\n|$)/g}function Bg({comment:e,type:t,value:n},r,i,a){const{blockQuote:l,commentString:c,lineWidth:d}=r.options;if(!l||/\n[\t ]+$/.test(n))return Ru(n,r);const f=r.indent||(r.forceBlockIndent||n0(n)?" ":""),p=l==="literal"?!0:l==="folded"||t===it.BLOCK_FOLDED?!1:t===it.BLOCK_LITERAL?!0:!xde(n,d,f.length);if(!n)return p?`|
|
|
136
|
-
`:`>
|
|
137
|
-
`;let m,y;for(y=n.length;y>0;--y){const z=n[y-1];if(z!==`
|
|
138
|
-
`&&z!==" "&&z!==" ")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(I1,`$&${f}`));let b=!1,j,k=-1;for(j=0;j<n.length;++j){const z=n[j];if(z===" ")b=!0;else if(z===`
|
|
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 C=(b?f?"2":"1":"")+m;if(e&&(C+=" "+c(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const z=n.replace(/\n+/g,`
|
|
142
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let A=!1;const _=t0(r,!0);l!=="folded"&&t!==it.BLOCK_FOLDED&&(_.onOverflow=()=>{A=!0});const R=e0(`${E}${z}${v}`,f,R1,_);if(!A)return`>${C}
|
|
143
|
-
${f}${R}`}return n=n.replace(/\n+/g,`$&${f}`),`|${C}
|
|
144
|
-
${f}${E}${n}${v}`}function bde(e,t,n,r){const{type:i,value:a}=e,{actualString:l,implicitKey:c,indent:d,indentStep:f,inFlow:p}=t;if(c&&a.includes(`
|
|
145
|
-
`)||p&&/[[\]{},]/.test(a))return Ru(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return c||p||!a.includes(`
|
|
146
|
-
`)?Ru(a,t):Bg(e,t,n,r);if(!c&&!p&&i!==it.PLAIN&&a.includes(`
|
|
147
|
-
`))return Bg(e,t,n,r);if(n0(a)){if(d==="")return t.forceBlockIndent=!0,Bg(e,t,n,r);if(c&&d===f)return Ru(a,t)}const m=a.replace(/\n+/g,`$&
|
|
148
|
-
${d}`);if(l){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 Ru(a,t)}return c?m:e0(m,d,yB,t0(t,!1))}function sC(e,t,n,r){const{implicitKey:i,inFlow:a}=t,l=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==it.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(c=it.QUOTE_DOUBLE);const d=p=>{switch(p){case it.BLOCK_FOLDED:case it.BLOCK_LITERAL:return i||a?Ru(l.value,t):Bg(l,t,n,r);case it.QUOTE_DOUBLE:return fh(l.value,t);case it.QUOTE_SINGLE:return D1(l.value,t);case it.PLAIN:return bde(l,t,n,r);default:return null}};let f=d(c);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 vB(e,t){const n=Object.assign({blockQuote:!0,commentString:vde,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 wde(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(l=>l.test);a.length>0&&(i=a)}n=i.find(a=>a.format===t.format)??i.find(a=>!a.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function Sde(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],a=(Jt(e)||Cn(e))&&e.anchor;a&&fB(a)&&(n.add(a),i.push(`&${a}`));const l=e.tag??(t.default?null:t.tag);return l&&i.push(r.directives.tagString(l)),i.join(" ")}function nd(e,t,n,r){if(On(e))return e.toString(t,n,r);if(yc(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=An(e)?e:t.doc.createNode(e,{onTagObj:d=>i=d});i??(i=wde(t.doc.schema.tags,a));const l=Sde(a,i,t);l.length>0&&(t.indentAtStart=(t.indentAtStart??0)+l.length+1);const c=typeof i.stringify=="function"?i.stringify(a,t,n,r):Jt(a)?sC(a,t,n,r):a.toString(t,n,r);return l?Jt(a)||c[0]==="{"||c[0]==="["?`${l} ${c}`:`${l}
|
|
149
|
-
${t.indent}${c}`:c}function jde({key:e,value:t},n,r,i){const{allNullValues:a,doc:l,indent:c,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:m}}=n;let y=An(e)&&e.comment||null;if(m){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(Cn(e)||!An(e)&&typeof e=="object"){const _="With simple keys, collection cannot be used as a key value";throw new Error(_)}}let v=!m&&(!e||y&&t==null&&!n.inFlow||Cn(e)||(Jt(e)?e.type===it.BLOCK_FOLDED||e.type===it.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(m||!a),indent:c+d});let w=!1,b=!1,j=nd(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+=Tl(j,n.indent,f(y)):b&&i&&i(),j;w&&(y=null),v?(y&&(j+=Tl(j,n.indent,f(y))),j=`? ${j}
|
|
150
|
-
${c}:`):(j=`${j}:`,y&&(j+=Tl(j,n.indent,f(y))));let k,E,O;An(t)?(k=!!t.spaceBefore,E=t.commentBefore,O=t.comment):(k=!1,E=null,O=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!v&&!y&&Jt(t)&&(n.indentAtStart=j.length+1),b=!1,!p&&d.length>=2&&!n.inFlow&&!v&&tp(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let C=!1;const z=nd(t,n,()=>C=!0,()=>b=!0);let A=" ";if(y||k||E){if(A=k?`
|
|
151
|
-
`:"",E){const _=f(E);A+=`
|
|
152
|
-
${Ss(_,n.indent)}`}z===""&&!n.inFlow?A===`
|
|
153
|
-
`&&O&&(A=`
|
|
154
|
-
|
|
155
|
-
`):A+=`
|
|
156
|
-
${n.indent}`}else if(!v&&Cn(t)){const _=z[0],R=z.indexOf(`
|
|
157
|
-
`),$=R!==-1,F=n.inFlow??t.flow??t.items.length===0;if($||!F){let q=!1;if($&&(_==="&"||_==="!")){let B=z.indexOf(" ");_==="&"&&B!==-1&&B<R&&z[B+1]==="!"&&(B=z.indexOf(" ",B+1)),(B===-1||R<B)&&(q=!0)}q||(A=`
|
|
158
|
-
${n.indent}`)}}else(z===""||z[0]===`
|
|
159
|
-
`)&&(A="");return j+=A+z,n.inFlow?C&&r&&r():O&&!C?j+=Tl(j,n.indent,f(O)):b&&i&&i(),j}function Nde(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Jm="<<",ks={identify:e=>e===Jm||typeof e=="symbol"&&e.description===Jm,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new it(Symbol(Jm)),{addToJSMap:xB}),stringify:()=>Jm},kde=(e,t)=>(ks.identify(t)||Jt(t)&&(!t.type||t.type===it.PLAIN)&&ks.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===ks.tag&&n.default);function xB(e,t,n){if(n=e&&yc(n)?n.resolve(e.doc):n,tp(n))for(const r of n.items)aS(e,t,r);else if(Array.isArray(n))for(const r of n)aS(e,t,r);else aS(e,t,n)}function aS(e,t,n){const r=e&&yc(n)?n.resolve(e.doc):n;if(!ep(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[a,l]of i)t instanceof Map?t.has(a)||t.set(a,l):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:l,writable:!0,enumerable:!0,configurable:!0});return t}function bB(e,t,{key:n,value:r}){if(An(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(kde(e,n))xB(e,t,r);else{const i=Vi(n,"",e);if(t instanceof Map)t.set(i,Vi(r,i,e));else if(t instanceof Set)t.add(i);else{const a=Cde(n,i,e),l=Vi(r,a,e);a in t?Object.defineProperty(t,a,{value:l,writable:!0,enumerable:!0,configurable:!0}):t[a]=l}}return t}function Cde(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(An(e)&&n?.doc){const r=vB(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)+'..."'),Nde(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 oC(e,t,n){const r=Oh(e,void 0,n),i=Oh(t,void 0,n);return new Hr(r,i)}class Hr{constructor(t,n=null){Object.defineProperty(this,Qi,{value:uB}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return An(n)&&(n=n.clone(t)),An(r)&&(r=r.clone(t)),new Hr(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return bB(n,r,this)}toString(t,n,r){return t?.doc?jde(this,t,n,r):JSON.stringify(this)}}function wB(e,t,n){return(t.inFlow??e.flow?Ede:Ade)(e,t,n)}function Ade({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:l,onComment:c}){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(An(b))!m&&b.spaceBefore&&y.push(""),vy(n,y,b.commentBefore,m),b.comment&&(j=b.comment);else if(On(b)){const E=An(b.key)?b.key:null;E&&(!m&&E.spaceBefore&&y.push(""),vy(n,y,E.commentBefore,m))}m=!1;let k=nd(b,p,()=>j=null,()=>m=!0);j&&(k+=Tl(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
|
-
`+Ss(f(e),d),c&&c()):m&&l&&l(),v}function Ede({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:a,flowCollectionPadding:l,options:{commentString:c}}=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(An(b))b.spaceBefore&&m.push(""),vy(t,m,b.commentBefore,!1),b.comment&&(j=b.comment);else if(On(b)){const E=An(b.key)?b.key:null;E&&(E.spaceBefore&&m.push(""),vy(t,m,E.commentBefore,!1),E.comment&&(f=!0));const O=An(b.value)?b.value:null;O?(O.comment&&(j=O.comment),O.commentBefore&&(f=!0)):b.value==null&&E?.comment&&(j=E.comment)}j&&(f=!0);let k=nd(b,d,()=>j=null);w<e.length-1&&(k+=","),j&&(k+=Tl(k,r,c(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}${l}${m.join(" ")}${l}${v}`}function vy({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=Ss(t(r),e);n.push(a.trimStart())}}function Pl(e,t){const n=Jt(t)?t.value:t;for(const r of e)if(On(r)&&(r.key===t||r.key===n||Jt(r.key)&&r.key.value===n))return r}class Hi extends gB{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Do,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:a}=r,l=new this(t),c=(d,f)=>{if(typeof a=="function")f=a.call(n,d,f);else if(Array.isArray(a)&&!a.includes(d))return;(f!==void 0||i)&&l.items.push(oC(d,f,r))};if(n instanceof Map)for(const[d,f]of n)c(d,f);else if(n&&typeof n=="object")for(const d of Object.keys(n))c(d,n[d]);return typeof t.sortMapEntries=="function"&&l.items.sort(t.sortMapEntries),l}add(t,n){let r;On(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Hr(t,t?.value):r=new Hr(t.key,t.value);const i=Pl(this.items,r.key),a=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Jt(i.value)&&mB(r.value)?i.value.value=r.value:i.value=r.value}else if(a){const l=this.items.findIndex(c=>a(r,c)<0);l===-1?this.items.push(r):this.items.splice(l,0,r)}else this.items.push(r)}delete(t){const n=Pl(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Pl(this.items,t)?.value;return(!n&&Jt(i)?i.value:i)??void 0}has(t){return!!Pl(this.items,t)}set(t,n){this.add(new Hr(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)bB(n,i,a);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!On(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})),wB(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const kd={collection:"map",default:!0,nodeClass:Hi,tag:"tag:yaml.org,2002:map",resolve(e,t){return ep(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Hi.from(e,t,n)};class ec extends gB{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(jd,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=eg(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=eg(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Jt(i)?i.value:i}has(t){const n=eg(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=eg(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];Jt(i)&&mB(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(Vi(a,String(i++),n));return r}toString(t,n,r){return t?wB(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n)){let l=0;for(let c of n){if(typeof i=="function"){const d=n instanceof Set?c:String(l++);c=i.call(n,d,c)}a.items.push(Oh(c,void 0,r))}}return a}}function eg(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 Cd={collection:"seq",default:!0,nodeClass:ec,tag:"tag:yaml.org,2002:seq",resolve(e,t){return tp(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>ec.from(e,t,n)},r0={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),sC(e,t,n,r)}},i0={identify:e=>e==null,createNode:()=>new it(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new it(null),stringify:({source:e},t)=>typeof e=="string"&&i0.test.test(e)?e:t.options.nullStr},lC={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new it(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&lC.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 xa({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let a=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(a)){let l=a.indexOf(".");l<0&&(l=a.length,a+=".");let c=t-(a.length-l-1);for(;c-- >0;)a+="0"}return a}const SB={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:xa},jB={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():xa(e)}},NB={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 it(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:xa},a0=e=>typeof e=="bigint"||Number.isInteger(e),cC=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function kB(e,t,n){const{value:r}=e;return a0(r)&&r>=0?n+r.toString(t):xa(e)}const CB={identify:e=>a0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>cC(e,2,8,n),stringify:e=>kB(e,8,"0o")},AB={identify:a0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>cC(e,0,10,n),stringify:xa},EB={identify:e=>a0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>cC(e,2,16,n),stringify:e=>kB(e,16,"0x")},Ode=[kd,Cd,r0,i0,lC,CB,AB,EB,SB,jB,NB];function LP(e){return typeof e=="bigint"||Number.isInteger(e)}const tg=({value:e})=>JSON.stringify(e),_de=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:tg},{identify:e=>e==null,createNode:()=>new it(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:tg},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:tg},{identify:LP,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})=>LP(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:tg}],zde={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Tde=[kd,Cd].concat(_de,zde),uC={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return"";const l=n;let c;if(typeof btoa=="function"){let d="";for(let f=0;f<l.length;++f)d+=String.fromCharCode(l[f]);c=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=it.BLOCK_LITERAL),t!==it.QUOTE_DOUBLE){const d=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),f=Math.ceil(c.length/d),p=new Array(f);for(let m=0,y=0;m<f;++m,y+=d)p[m]=c.substr(y,d);c=p.join(t===it.BLOCK_LITERAL?`
|
|
167
|
-
`:" ")}return sC({comment:e,type:t,value:c},r,i,a)}};function OB(e,t){if(tp(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!On(r)){if(ep(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new Hr(new it(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]=On(r)?r:new Hr(r)}}else t("Expected a sequence for this tag");return e}function _B(e,t,n){const{replacer:r}=n,i=new ec(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let l of t){typeof r=="function"&&(l=r.call(t,String(a++),l));let c,d;if(Array.isArray(l))if(l.length===2)c=l[0],d=l[1];else throw new TypeError(`Expected [key, value] tuple: ${l}`);else if(l&&l instanceof Object){const f=Object.keys(l);if(f.length===1)c=f[0],d=l[c];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else c=l;i.items.push(oC(c,d,n))}return i}const dC={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:OB,createNode:_B};class Hu extends ec{constructor(){super(),this.add=Hi.prototype.add.bind(this),this.delete=Hi.prototype.delete.bind(this),this.get=Hi.prototype.get.bind(this),this.has=Hi.prototype.has.bind(this),this.set=Hi.prototype.set.bind(this),this.tag=Hu.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n?.onCreate&&n.onCreate(r);for(const i of this.items){let a,l;if(On(i)?(a=Vi(i.key,"",n),l=Vi(i.value,a,n)):a=Vi(i,"",n),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,l)}return r}static from(t,n,r){const i=_B(t,n,r),a=new this;return a.items=i.items,a}}Hu.tag="tag:yaml.org,2002:omap";const fC={collection:"seq",identify:e=>e instanceof Map,nodeClass:Hu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=OB(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 Hu,n)},createNode:(e,t,n)=>Hu.from(e,t,n)};function zB({value:e,source:t},n){return t&&(e?TB:PB).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const TB={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 it(!0),stringify:zB},PB={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 it(!1),stringify:zB},Pde={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:xa},Rde={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():xa(e)}},Dde={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 it(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:xa},np=e=>typeof e=="bigint"||Number.isInteger(e);function s0(e,t,n,{intAsBigInt:r}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const l=BigInt(e);return i==="-"?BigInt(-1)*l:l}const a=parseInt(e,n);return i==="-"?-1*a:a}function hC(e,t,n){const{value:r}=e;if(np(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return xa(e)}const Ide={identify:np,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>s0(e,2,2,n),stringify:e=>hC(e,2,"0b")},Mde={identify:np,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>s0(e,1,8,n),stringify:e=>hC(e,8,"0")},Lde={identify:np,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>s0(e,0,10,n),stringify:xa},$de={identify:np,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>s0(e,2,16,n),stringify:e=>hC(e,16,"0x")};class Ku extends Hi{constructor(t){super(t),this.tag=Ku.tag}add(t){let n;On(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Hr(t.key,null):n=new Hr(t,null),Pl(this.items,n.key)||this.items.push(n)}get(t,n){const r=Pl(this.items,t);return!n&&On(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=Pl(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Hr(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let l of n)typeof i=="function"&&(l=i.call(n,l,l)),a.items.push(oC(l,null,r));return a}}Ku.tag="tag:yaml.org,2002:set";const pC={collection:"map",identify:e=>e instanceof Set,nodeClass:Ku,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Ku.from(e,t,n),resolve(e,t){if(ep(e)){if(e.hasAllNullValues(!0))return Object.assign(new Ku,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function mC(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=l=>t?BigInt(l):Number(l),a=r.replace(/_/g,"").split(":").reduce((l,c)=>l*i(60)+i(c),i(0));return n==="-"?i(-1)*a:a}function RB(e){let{value:t}=e,n=l=>l;if(typeof t=="bigint")n=l=>BigInt(l);else if(isNaN(t)||!isFinite(t))return xa(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(l=>String(l).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const DB={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})=>mC(e,n),stringify:RB},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=>mC(e,!1),stringify:RB},o0={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(o0.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,a,l,c]=t.map(Number),d=t[7]?Number((t[7]+"00").substr(1,3)):0;let f=Date.UTC(n,r-1,i,a||0,l||0,c||0,d);const p=t[8];if(p&&p!=="Z"){let m=mC(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$/,"")??""},$P=[kd,Cd,r0,i0,TB,PB,Ide,Mde,Lde,$de,Pde,Rde,Dde,uC,ks,fC,dC,pC,DB,IB,o0],BP=new Map([["core",Ode],["failsafe",[kd,Cd,r0]],["json",Tde],["yaml11",$P],["yaml-1.1",$P]]),UP={binary:uC,bool:lC,float:NB,floatExp:jB,floatNaN:SB,floatTime:IB,int:AB,intHex:EB,intOct:CB,intTime:DB,map:kd,merge:ks,null:i0,omap:fC,pairs:dC,seq:Cd,set:pC,timestamp:o0},Bde={"tag:yaml.org,2002:binary":uC,"tag:yaml.org,2002:merge":ks,"tag:yaml.org,2002:omap":fC,"tag:yaml.org,2002:pairs":dC,"tag:yaml.org,2002:set":pC,"tag:yaml.org,2002:timestamp":o0};function sS(e,t,n){const r=BP.get(t);if(r&&!e)return n&&!r.includes(ks)?r.concat(ks):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const a=Array.from(BP.keys()).filter(l=>l!=="yaml11").map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${a} or define customTags array`)}if(Array.isArray(e))for(const a of e)i=i.concat(a);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(ks)),i.reduce((a,l)=>{const c=typeof l=="string"?UP[l]:l;if(!c){const d=JSON.stringify(l),f=Object.keys(UP).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${f}`)}return a.includes(c)||a.push(c),a},[])}const Ude=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class gC{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:a,sortMapEntries:l,toStringDefaults:c}){this.compat=Array.isArray(t)?sS(t,"compat"):t?sS(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=i?Bde:{},this.tags=sS(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,Do,{value:kd}),Object.defineProperty(this,qa,{value:r0}),Object.defineProperty(this,jd,{value:Cd}),this.sortMapEntries=typeof l=="function"?l:l===!0?Ude:null}clone(){const t=Object.create(gC.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function qde(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=vB(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=a(e.commentBefore);n.unshift(Ss(d,""))}let l=!1,c=null;if(e.contents){if(An(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=a(e.contents.commentBefore);n.push(Ss(p,""))}i.forceBlockIndent=!!e.comment,c=e.contents.comment}const d=c?void 0:()=>l=!0;let f=nd(e.contents,i,()=>c=null,d);c&&(f+=Tl(f,"",a(c))),(f[0]==="|"||f[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${f}`:n.push(f)}else n.push(nd(e.contents,i));if(e.directives?.docEnd)if(e.comment){const d=a(e.comment);d.includes(`
|
|
170
|
-
`)?(n.push("..."),n.push(Ss(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&l&&(d=d.replace(/^\n+/,"")),d&&((!l||c)&&n[n.length-1]!==""&&n.push(""),n.push(Ss(a(d),"")))}return n.join(`
|
|
171
|
-
`)+`
|
|
172
|
-
`}class l0{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Qi,{value:P1});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);const a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=a;let{version:l}=a;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(l=this.directives.yaml.version)):this.directives=new Br({version:l}),this.setSchema(l,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(l0.prototype,{[Qi]:{value:P1}});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=An(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){mu(this.contents)&&this.contents.add(t)}addIn(t,n){mu(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=hB(this);t.anchor=!n||r.has(n)?pB(n||"a",r):n}return new aC(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const j=E=>typeof E=="number"||E instanceof String||E instanceof Number,k=n.filter(j).map(String);k.length>0&&(n=n.concat(k)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:l,flow:c,keepUndefined:d,onTagObj:f,tag:p}=r??{},{onAnchor:m,setAnchors:y,sourceObjects:v}=mde(this,l||"a"),w={aliasDuplicateObjects:a??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:v},b=Oh(t,p,w);return c&&Cn(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 Hr(i,a)}delete(t){return mu(this.contents)?this.contents.delete(t):!1}deleteIn(t){return th(t)?this.contents==null?!1:(this.contents=null,!0):mu(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Cn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return th(t)?!n&&Jt(this.contents)?this.contents.value:this.contents:Cn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Cn(this.contents)?this.contents.has(t):!1}hasIn(t){return th(t)?this.contents!==void 0:Cn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=yy(this.schema,[t],n):mu(this.contents)&&this.contents.set(t,n)}setIn(t,n){th(t)?this.contents=n:this.contents==null?this.contents=yy(this.schema,Array.from(t),n):mu(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 Br({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 Br({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 gC(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:a,reviver:l}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},d=Vi(this.contents,n??"",c);if(typeof a=="function")for(const{count:f,res:p}of c.anchors.values())a(p,f);return typeof l=="function"?Pu(l,{"":d},"",d):d}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return qde(this,t)}}function mu(e){if(Cn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class MB extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class ng extends MB{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class Fde extends MB{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const qP=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,l=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(a>=60&&l.length>80){const c=Math.min(a-39,l.length-79);l="…"+l.substring(c),a-=c-1}if(l.length>80&&(l=l.substring(0,79)+"…"),r>1&&/^ *$/.test(l.substring(0,a))){let c=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`…
|
|
173
|
-
`),l=c+l}if(/[^ ]/.test(l)){let c=1;const d=n.linePos[1];d?.line===r&&d.col>i&&(c=Math.max(1,Math.min(d.col-i,80-a)));const f=" ".repeat(a)+"^".repeat(c);n.message+=`:
|
|
174
|
-
|
|
175
|
-
${l}
|
|
176
|
-
${f}
|
|
177
|
-
`}};function rd(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:l,startOnNewline:c}){let d=!1,f=c,p=c,m="",y="",v=!1,w=!1,b=null,j=null,k=null,E=null,O=null,C=null,z=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:(!C||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,z??(z=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,z??(z=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`),C&&a(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${t??"collection"}`),C=R,f=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){O&&a(R,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),O=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],_=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<=l||r?.type==="block-map"||r?.type==="block-seq")&&a(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:O,found:C,spaceBefore:d,comment:m,hasNewline:v,anchor:j,tag:k,newlineAfterProp:E,end:_,start:z??_}}function _h(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(_h(t.key)||_h(t.value))return!0}return!1;default:return!0}}function M1(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&_h(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function LB(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(a,l)=>a===l||Jt(a)&&Jt(l)&&a.value===l.value;return t.some(a=>i(a.key,n))}const FP="All mapping items must start at the same column";function Hde({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=a?.nodeClass??Hi,c=new l(n.schema);n.atRoot&&(n.atRoot=!1);let d=r.offset,f=null;for(const p of r.items){const{start:m,key:y,sep:v,value:w}=p,b=rd(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",FP)),!b.anchor&&!b.tag&&!v){f=b.end,b.comment&&(c.comment?c.comment+=`
|
|
179
|
-
`+b.comment:c.comment=b.comment);continue}(b.newlineAfterProp||_h(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",FP);n.atKey=!0;const k=b.end,E=y?e(n,y,b,i):t(n,k,m,null,b,i);n.schema.compat&&M1(r.indent,y,i),n.atKey=!1,LB(n,c.items,E)&&i(k,"DUPLICATE_KEY","Map keys must be unique");const O=rd(v??[],{indicator:"map-value-ind",next:w,offset:E.range[2],onError:i,parentIndent:r.indent,startOnNewline:!y||y.type==="block-scalar"});if(d=O.end,O.found){j&&(w?.type==="block-map"&&!O.hasNewline&&i(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&b.start<O.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 C=w?e(n,w,O,i):t(n,d,v,null,O,i);n.schema.compat&&M1(r.indent,w,i),d=C.range[2];const z=new Hr(E,C);n.options.keepSourceTokens&&(z.srcToken=p),c.items.push(z)}else{j&&i(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),O.comment&&(E.comment?E.comment+=`
|
|
180
|
-
`+O.comment:E.comment=O.comment);const C=new Hr(E);n.options.keepSourceTokens&&(C.srcToken=p),c.items.push(C)}}return f&&f<d&&i(f,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,d,f??d],c}function Kde({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=a?.nodeClass??ec,c=new l(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset,f=null;for(const{start:p,value:m}of r.items){const y=rd(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&&(c.comment=y.comment);continue}const v=m?e(n,m,y,i):t(n,y.end,p,null,y,i);n.schema.compat&&M1(r.indent,m,i),d=v.range[2],c.items.push(v)}return c.range=[r.offset,d,f??d],c}function rp(e,t,n,r){let i="";if(e){let a=!1,l="";for(const c of e){const{source:d,type:f}=c;switch(f){case"space":a=!0;break;case"comment":{n&&!a&&r(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=d.substring(1)||" ";i?i+=l+p:i=p,l="";break}case"newline":i&&(l+=d),a=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=d.length}}return{comment:i,offset:t}}const oS="Block collections are not allowed within flow collections",lS=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Gde({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=r.start.source==="{",c=l?"flow map":"flow sequence",d=a?.nodeClass??(l?Hi:ec),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:O,sep:C,value:z}=k,A=rd(E,{flow:c,indicator:"explicit-key-ind",next:O??C?.[0],offset:m,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!C&&!z){j===0&&A.comma?i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):j<r.items.length-1&&i(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),A.comment&&(f.comment?f.comment+=`
|
|
181
|
-
`+A.comment:f.comment=A.comment),m=A.end;continue}!l&&n.options.strict&&_h(O)&&i(O,"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 ${c}`);else if(A.comma||i(A.start,"MISSING_CHAR",`Missing , between ${c} items`),A.comment){let _="";e:for(const R of E)switch(R.type){case"comma":case"space":break;case"comment":_=R.source.substring(1);break e;default:break e}if(_){let R=f.items[f.items.length-1];On(R)&&(R=R.value??R.key),R.comment?R.comment+=`
|
|
182
|
-
`+_:R.comment=_,A.comment=A.comment.substring(_.length+1)}}if(!l&&!C&&!A.found){const _=z?e(n,z,A,i):t(n,A.end,C,null,A,i);f.items.push(_),m=_.range[2],lS(z)&&i(_.range,"BLOCK_IN_FLOW",oS)}else{n.atKey=!0;const _=A.end,R=O?e(n,O,A,i):t(n,_,E,null,A,i);lS(O)&&i(R.range,"BLOCK_IN_FLOW",oS),n.atKey=!1;const $=rd(C??[],{flow:c,indicator:"map-value-ind",next:z,offset:R.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if($.found){if(!l&&!A.found&&n.options.strict){if(C)for(const B of C){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 z&&("source"in z&&z.source?.[0]===":"?i(z,"MISSING_CHAR",`Missing space after : in ${c}`):i($.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const F=z?e(n,z,$,i):$.found?t(n,$.end,C,null,$,i):null;F?lS(z)&&i(F.range,"BLOCK_IN_FLOW",oS):$.comment&&(R.comment?R.comment+=`
|
|
183
|
-
`+$.comment:R.comment=$.comment);const q=new Hr(R,F);if(n.options.keepSourceTokens&&(q.srcToken=k),l){const B=f;LB(n,B.items,R)&&i(_,"DUPLICATE_KEY","Map keys must be unique"),B.items.push(q)}else{const B=new Hi(n.schema);B.flow=!0,B.items.push(q);const K=(F??R).range;B.range=[R.range[0],K[1],K[2]],f.items.push(B)}m=F?F.range[2]:$.end}}const y=l?"}":"]",[v,...w]=r.end;let b=m;if(v?.source===y)b=v.offset+v.source.length;else{const j=c[0].toUpperCase()+c.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=rp(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 cS(e,t,n,r,i,a){const l=n.type==="block-map"?Hde(e,t,n,r,a):n.type==="block-seq"?Kde(e,t,n,r,a):Gde(e,t,n,r,a),c=l.constructor;return i==="!"||i===c.tagName?(l.tag=c.tagName,l):(i&&(l.tag=i),l)}function Vde(e,t,n,r,i){const a=r.tag,l=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 c=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!l||l==="!"||l===Hi.tagName&&c==="map"||l===ec.tagName&&c==="seq")return cS(e,t,n,i,l);let d=t.schema.tags.find(y=>y.tag===l&&y.collection===c);if(!d){const y=t.schema.knownTags[l];if(y?.collection===c)t.schema.tags.push(Object.assign({},y,{default:!1})),d=y;else return y?i(a,"BAD_COLLECTION_TYPE",`${y.tag} used for ${c} collection, but expects ${y.collection??"scalar"}`,!0):i(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),cS(e,t,n,i,l)}const f=cS(e,t,n,i,l,d),p=d.resolve?.(f,y=>i(a,"TAG_RESOLVE_FAILED",y),t.options)??f,m=An(p)?p:new it(p);return m.range=f.range,m.tag=l,d?.format&&(m.format=d.format),m}function Qde(e,t,n){const r=t.offset,i=Wde(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const a=i.mode===">"?it.BLOCK_FOLDED:it.BLOCK_LITERAL,l=t.source?Yde(t.source):[];let c=l.length;for(let b=l.length-1;b>=0;--b){const j=l[b][1];if(j===""||j==="\r")c=b;else break}if(c===0){const b=i.chomp==="+"&&l.length>0?`
|
|
185
|
-
`.repeat(Math.max(1,l.length-1)):"";let j=r+i.length;return t.source&&(j+=t.source.length),{value:b,type:a,comment:i.comment,range:[r,j,j]}}let d=t.indent+i.indent,f=t.offset+i.length,p=0;for(let b=0;b<c;++b){const[j,k]=l[b];if(k===""||k==="\r")i.indent===0&&j.length>d&&(d=j.length);else{j.length<d&&n(f+j.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(d=j.length),p=b,d===0&&!e.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=j.length+k.length+1}for(let b=l.length-1;b>=c;--b)l[b][0].length>d&&(c=b+1);let m="",y="",v=!1;for(let b=0;b<p;++b)m+=l[b][0].slice(d)+`
|
|
186
|
-
`;for(let b=p;b<c;++b){let[j,k]=l[b];f+=j.length+k.length+1;const E=k[k.length-1]==="\r";if(E&&(k=k.slice(0,-1)),k&&j.length<d){const C=`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",C),j=""}a===it.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=c;b<l.length;++b)m+=`
|
|
196
|
-
`+l[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 Wde({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],a=i[0];let l=0,c="",d=-1;for(let y=1;y<i.length;++y){const v=i[y];if(!c&&(v==="-"||v==="+"))c=v;else{const w=Number(v);!l&&w?l=w: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:l,chomp:c,comment:p,length:m}}function Yde(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),a=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let l=1;l<t.length;l+=2)a.push([t[l],t[l+1]]);return a}function Zde(e,t,n){const{offset:r,type:i,source:a,end:l}=e;let c,d;const f=(y,v,w)=>n(r+y,v,w);switch(i){case"scalar":c=it.PLAIN,d=Xde(a,f);break;case"single-quoted-scalar":c=it.QUOTE_SINGLE,d=Jde(a,f);break;case"double-quoted-scalar":c=it.QUOTE_DOUBLE,d=efe(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=rp(l,p,t,n);return{value:d,type:c,comment:m.comment,range:[r,p,m.offset]}}function Xde(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}`),$B(e)}function Jde(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),$B(e.slice(1,-1)).replace(/''/g,"'")}function $B(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
200
|
-
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
201
|
-
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=" ",l=t.lastIndex;for(n.lastIndex=l;r=n.exec(e);)r[1]===""?a===`
|
|
202
|
-
`?i+=a:a=`
|
|
203
|
-
`:(i+=a+r[1],a=" "),l=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=l,r=c.exec(e),i+a+(r?.[1]??"")}function efe(e,t){let n="";for(let r=1;r<e.length-1;++r){const i=e[r];if(!(i==="\r"&&e[r+1]===`
|
|
204
|
-
`))if(i===`
|
|
205
|
-
`){const{fold:a,offset:l}=tfe(e,r);n+=a,r=l}else if(i==="\\"){let a=e[++r];const l=nfe[a];if(l)n+=l;else if(a===`
|
|
206
|
-
`)for(a=e[r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="\r"&&e[r+1]===`
|
|
207
|
-
`)for(a=e[++r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="x"||a==="u"||a==="U"){const c={x:2,u:4,U:8}[a];n+=rfe(e,r+1,c,t),r+=c}else{const c=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(i===" "||i===" "){const a=r;let l=e[r+1];for(;l===" "||l===" ";)l=e[++r+1];l!==`
|
|
208
|
-
`&&!(l==="\r"&&e[r+2]===`
|
|
209
|
-
`)&&(n+=r>a?e.slice(a,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function tfe(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 nfe={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
214
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function rfe(e,t,n,r){const i=e.substr(t,n),l=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(l)){const c=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}return String.fromCodePoint(l)}function BB(e,t,n,r){const{value:i,type:a,comment:l,range:c}=t.type==="block-scalar"?Qde(e,t,r):Zde(t,e.options.strict,r),d=n?e.directives.tagName(n.source,m=>r(n,"TAG_RESOLVE_FAILED",m)):null;let f;e.options.stringKeys&&e.atKey?f=e.schema[qa]:d?f=ife(e.schema,i,d,n,r):t.type==="scalar"?f=afe(e,i,t,r):f=e.schema[qa];let p;try{const m=f.resolve(i,y=>r(n??t,"TAG_RESOLVE_FAILED",y),e.options);p=Jt(m)?m:new it(m)}catch(m){const y=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",y),p=new it(i)}return p.range=c,p.source=i,a&&(p.type=a),d&&(p.tag=d),f.format&&(p.format=f.format),l&&(p.comment=l),p}function ife(e,t,n,r,i){if(n==="!")return e[qa];const a=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)a.push(c);else return c;for(const c of a)if(c.test?.test(t))return c;const l=e.knownTags[n];return l&&!l.collection?(e.tags.push(Object.assign({},l,{default:!1,test:void 0})),l):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[qa])}function afe({atKey:e,directives:t,schema:n},r,i,a){const l=n.tags.find(c=>(c.default===!0||e&&c.default==="key")&&c.test?.test(r))||n[qa];if(n.compat){const c=n.compat.find(d=>d.default&&d.test?.test(r))??n[qa];if(l.tag!==c.tag){const d=t.tagString(l.tag),f=t.tagString(c.tag),p=`Value may be parsed as either ${d} or ${f}`;a(i,"TAG_RESOLVE_FAILED",p,!0)}}return l}function sfe(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 ofe={composeNode:UB,composeEmptyNode:yC};function UB(e,t,n,r){const i=e.atKey,{spaceBefore:a,comment:l,anchor:c,tag:d}=n;let f,p=!0;switch(t.type){case"alias":f=lfe(e,t,r),(c||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=BB(e,t,d,r),c&&(f.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=Vde(ofe,e,t,n,r),c&&(f.anchor=c.source.substring(1));break;default:{const m=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",m),f=yC(e,t.offset,void 0,null,n,r),p=!1}}return c&&f.anchor===""&&r(c,"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),l&&(t.type==="scalar"&&t.source===""?f.comment=l:f.commentBefore=l),e.options.keepSourceTokens&&p&&(f.srcToken=t),f}function yC(e,t,n,r,{spaceBefore:i,comment:a,anchor:l,tag:c,end:d},f){const p={type:"scalar",offset:sfe(t,n,r),indent:-1,source:""},m=BB(e,p,c,f);return l&&(m.anchor=l.source.substring(1),m.anchor===""&&f(l,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(m.spaceBefore=!0),a&&(m.comment=a,m.range[2]=d),m}function lfe({options:e},{offset:t,source:n,end:r},i){const a=new aC(n.substring(1));a.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const l=t+n.length,c=rp(r,l,e.strict,i);return a.range=[t,l,c.offset],c.comment&&(a.comment=c.comment),a}function cfe(e,t,{offset:n,start:r,value:i,end:a},l){const c=Object.assign({_directives:t},e),d=new l0(void 0,c),f={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=rd(r,{indicator:"doc-start",next:i??a?.[0],offset:n,onError:l,parentIndent:0,startOnNewline:!0});p.found&&(d.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&l(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=i?UB(f,i,p,l):yC(f,p.end,r,null,p,l);const m=d.contents.range[2],y=rp(a,m,!1,l);return y.comment&&(d.comment=y.comment),d.range=[n,m,y.offset],d}function $f(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 HP(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 ufe{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,a)=>{const l=$f(n);a?this.warnings.push(new Fde(l,r,i)):this.errors.push(new ng(l,r,i))},this.directives=new Br({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=HP(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(Cn(a)&&!a.flow&&a.items.length>0){let l=a.items[0];On(l)&&(l=l.key);const c=l.commentBefore;l.commentBefore=c?`${r}
|
|
219
|
-
${c}`:r}else{const l=a.commentBefore;a.commentBefore=l?`${r}
|
|
220
|
-
${l}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:HP(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=$f(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=cfe(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 ng($f(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 ng($f(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=rp(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 ng($f(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 l0(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 qB="\uFEFF",FB="",HB="",L1="";function dfe(e){switch(e){case qB:return"byte-order-mark";case FB:return"doc-mode";case HB:return"flow-error-end";case L1: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 oa(e){switch(e){case void 0:case" ":case`
|
|
224
|
-
`:case"\r":case" ":return!0;default:return!1}}const KP=new Set("0123456789ABCDEFabcdef"),ffe=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),rg=new Set(",[]{}"),hfe=new Set(` ,[]{}
|
|
225
|
-
\r `),uS=e=>!e||hfe.has(e);class pfe{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==="...")&&oa(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]===qB&&(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 FB,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==="...")&&oa(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&&!oa(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===":")&&oa(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(uS),"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("..."))&&oa(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield HB,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(uS),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const l=this.charAt(1);if(this.flowKey||oa(l)||l===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let a=0;for(;this.buffer[n-1-a]==="\\";)a+=1;if(a%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let i=r.indexOf(`
|
|
231
|
-
`,this.pos);if(i!==-1){for(;i!==-1;){const a=this.continueScalar(i+1);if(a===-1)break;i=r.indexOf(`
|
|
232
|
-
`,a)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>oa(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let a=this.pos;r=this.buffer[a];++a)switch(r){case" ":n+=1;break;case`
|
|
233
|
-
`:t=a,n=0;break;case"\r":{const l=this.buffer[a+1];if(!l&&!this.atEnd)return this.setNext("block-scalar");if(l===`
|
|
234
|
-
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const a=this.continueScalar(t+1);if(a===-1)break;t=this.buffer.indexOf(`
|
|
235
|
-
`,a)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
236
|
-
`;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let a=t-1,l=this.buffer[a];l==="\r"&&(l=this.buffer[--a]);const c=a;for(;l===" ";)l=this.buffer[--a];if(l===`
|
|
237
|
-
`&&a>=this.pos&&a+1+n>c)t=a;else break}while(!0);return yield L1,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(oa(a)||t&&rg.has(a))break;n=r}else if(oa(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&&rg.has(a))break;if(i===`
|
|
240
|
-
`){const l=this.continueScalar(r+1);if(l===-1)break;r=Math.max(r,l-2)}}else{if(t&&rg.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield L1,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(uS))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(oa(n)||t&&rg.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(;!oa(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(ffe.has(n))n=this.buffer[++t];else if(n==="%"&&KP.has(this.buffer[t+1])&&KP.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 mfe{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 wo(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function GP(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 KB(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 ig(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 gu(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 VP(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!wo(t.start,"explicit-key-ind")&&!wo(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,KB(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 gfe{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 pfe,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=dfe(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"&&VP(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&&GP(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":{GP(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=ig(this.peek(2)),r=gu(n);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
243
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
244
|
-
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(i&&n.sep&&!n.value){const l=[];for(let c=0;c<n.sep.length;++c){const d=n.sep[c];switch(d.type){case"newline":l.push(c);break;case"space":break;case"comment":d.indent>t.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(a=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(wo(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(KB(n.key)&&!wo(n.sep,"newline")){const l=gu(n.start),c=n.key,d=n.sep;d.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:d}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(wo(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=gu(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):wo(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!wo(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:a});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||wo(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=ig(r),a=gu(i);VP(t);const l=t.end.splice(1,t.end.length);l.push(this.sourceToken);const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
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=ig(t),r=gu(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=ig(t),r=gu(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 yfe(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new mfe||null,prettyErrors:t}}function vfe(e,t={}){const{lineCounter:n,prettyErrors:r}=yfe(t),i=new gfe(n?.addNewLine),a=new ufe(t),l=Array.from(a.compose(i.parse(e)));if(r&&n)for(const c of l)c.errors.forEach(qP(e,n)),c.warnings.forEach(qP(e,n));return l.length>0?l:Object.assign([],{empty:!0},a.streamInfo())}function xfe({onApplied:e}){const[t,n]=x.useState(""),[r,i]=x.useState(!1),[a,l]=x.useState([]),[c,d]=x.useState([]),f=async()=>{if(!t.trim())return;i(!0),l([]),d([]);const p=vfe(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 FV(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)}`)}}l(y),d(m),i(!1),y.length>0&&(dt({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 s.jsxs("section",{className:"mt-8",children:[s.jsx("div",{className:"page-section-divider"}),s.jsx("div",{className:"section-head mt-6",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),s.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),s.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",s.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",s.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),s.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&&s.jsx("ul",{className:"mt-2 space-y-1",children:a.map((p,m)=>s.jsx("li",{className:"text-emerald-400 text-sm",children:p},m))}),c.length>0&&s.jsx("ul",{className:"mt-2 space-y-1",children:c.map((p,m)=>s.jsx("li",{className:"text-rose-400 text-sm",children:p},m))}),s.jsx("div",{className:"mt-3",children:s.jsx(pe,{type:"button",disabled:!t.trim()||r,onClick:f,children:r?"Applying...":"Apply"})})]})}function bfe(){const{dashboard:e,isLoading:t,refetch:n}=mc();if(!e||t)return s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-28"}),s.jsx("div",{className:"skeleton-text-sm w-40"})]}),s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[s.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(_=>s.jsx("div",{className:"skeleton-text-sm w-16"},_))}),[1,2,3].map(_=>s.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[s.jsxs("div",{className:"flex-1 space-y-1",children:[s.jsx("div",{className:"skeleton-text w-28"}),s.jsx("div",{className:"skeleton-text-sm w-16"})]}),s.jsx("div",{className:"skeleton-text w-24"}),s.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),s.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),s.jsx("div",{className:"skeleton-text-sm w-8"})]},_))]})]});const r=e.projects,i=Ko(),[a,l]=x.useState(!1),[c,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),[O,C]=x.useState(null),z=c.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),A=async()=>{if(!(!z||!m)){E(!0),C(null);try{const _=await Ev(z,{displayName:f||c,canonicalDomain:m,country:v,language:b});dt({title:"Project created",detail:`${_.displayName||_.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${_.name}`,dedupeMode:"drop"}),n(),d(""),p(""),y(""),w("US"),j("en"),l(!1),i({to:"/projects/$projectId",params:{projectId:_.id}})}catch(_){C(_ instanceof Error?_.message:"Failed to create project")}finally{E(!1)}}};return s.jsxs("div",{className:"page-container",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Projects"}),s.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),s.jsx("div",{className:"page-header-right",children:s.jsxs(pe,{type:"button",onClick:()=>l(_=>!_),children:[s.jsx(Ou,{className:"size-4 mr-1.5"}),"Add project"]})})]}),a?s.jsxs(Pe,{className:"surface-card mb-6",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),s.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),s.jsxs("div",{className:"compact-stack mt-4",children:[s.jsxs("div",{className:"setup-field-row",children:[s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),s.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:c,onChange:_=>d(_.target.value)}),z&&z!==c?s.jsxs("p",{className:"supporting-copy",children:["Slug: ",z]}):null]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),s.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:f,onChange:_=>p(_.target.value)})]})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),s.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:m,onChange:_=>y(_.target.value)})]}),s.jsxs("div",{className:"setup-field-row",children:[s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),s.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:v,onChange:_=>w(_.target.value.toUpperCase())})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),s.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:b,onChange:_=>j(_.target.value.toLowerCase())})]})]})]}),O?s.jsx("p",{className:"text-rose-400 text-sm mt-3",children:O}):null,s.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[s.jsx(pe,{type:"button",disabled:!z||!m||k,onClick:A,children:k?"Creating...":"Create project"}),s.jsx(pe,{type:"button",variant:"ghost",onClick:()=>l(!1),children:"Cancel"})]})]}):null,r.length>0?s.jsx("div",{className:"data-table-wrapper",children:s.jsxs("table",{className:"data-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Domain"}),s.jsx("th",{children:"Visibility"}),s.jsx("th",{children:"Last run"}),s.jsx("th",{className:"text-right",children:"Country"})]})}),s.jsx("tbody",{children:r.map(_=>{const R=_.recentRuns[0];return s.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:_.project.id}}),children:[s.jsxs("td",{children:[s.jsx(Et,{to:"/projects/$projectId",params:{projectId:_.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:$=>$.stopPropagation(),children:_.project.displayName||_.project.name}),s.jsx("p",{className:"text-[11px] text-zinc-500",children:_.project.name})]}),s.jsx("td",{className:"text-zinc-400",children:_.project.canonicalDomain}),s.jsx("td",{children:s.jsx(tt,{tone:_.visibilitySummary.tone,children:_.visibilitySummary.value})}),s.jsx("td",{className:"text-zinc-500 text-sm",children:R?s.jsx(Lv,{status:R.status}):s.jsx("span",{className:"text-zinc-600",children:"No runs"})}),s.jsx("td",{className:"text-right text-zinc-500",children:_.project.country})]},_.project.id)})})]})}):a?null:s.jsxs(Pe,{className:"surface-card empty-card",children:[s.jsx("h3",{children:"No projects yet"}),s.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),s.jsxs(pe,{type:"button",onClick:()=>l(!0),children:[s.jsx(Ou,{className:"size-4 mr-1.5"}),"Add project"]})]}),s.jsx(xfe,{onApplied:()=>{n()}})]})}function $1({state:e,label:t}){return s.jsx(tt,{tone:_ne(e),children:t??Dv(e)})}function GB({run:e}){const{openRun:t}=bd();return s.jsxs("article",{className:"run-row",children:[s.jsxs("div",{className:"run-row-main",children:[s.jsxs("div",{className:"run-row-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"run-row-title",children:e.summary}),s.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),s.jsx(Lv,{status:e.status})]}),s.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),s.jsxs("dl",{className:"run-row-meta",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:e.startedAt})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Duration"}),s.jsx("dd",{children:e.duration})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Trigger"}),s.jsx("dd",{children:e.triggerLabel})]})]}),s.jsx(pe,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function Ug({value:e,label:t,delta:n,tone:r,description:i,tooltip:a,isNumeric:l=!0,progress:c,providerCoverage:d}){const m=2*Math.PI*48,y=Number.parseInt(e,10),v=typeof c=="number"&&Number.isFinite(c)?Math.min(Math.max(c,0),100)/100:l&&!Number.isNaN(y)?Math.min(y/100,1):.5,w=m*(1-v);return s.jsxs("div",{className:"score-gauge",children:[s.jsxs("div",{className:"gauge-ring-wrapper",children:[s.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[s.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),s.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)"})]}),s.jsx("div",{className:"gauge-center",children:s.jsx("span",{className:l?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),s.jsxs("p",{className:"gauge-label",children:[t,a&&s.jsx(mr,{text:a})]}),s.jsx("p",{className:"gauge-delta",children:n}),d&&s.jsx("p",{className:"gauge-provider-coverage",children:d}),s.jsx("p",{className:"gauge-description",children:i})]})}function QP({history:e,maxDots:t=12}){const n=e.slice(-t);if(n.length===0)return s.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 s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:i}),s.jsx("div",{className:"flex items-center gap-[3px]",title:`${n.length} runs`,children:n.map((l,c)=>s.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[l.citationState]??"bg-zinc-700"} ${l.model&&c>0&&n[c-1]?.model&&n[c-1].model!==l.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[l.citationState,new Date(l.createdAt).toLocaleDateString(),l.model?`model ${l.model}`:null,l.model&&c>0&&n[c-1]?.model&&n[c-1].model!==l.model?"model changed":null].filter(Boolean).join(" — ")},c))}),s.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:a})]})}function wfe(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 WP(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 YP(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 ZP(e,t){const n=t==="mentions"?"mentioned":"cited",r=t==="mentions"?"Mentioned":"Cited";if(e.length===0)return"Awaiting first run";if(e.length===1)return"First observation";const i=e[e.length-1].citationState,a=e[e.length-2].citationState;if(a!=="cited"&&i==="cited")return`Newly ${n}`;if(a==="cited"&&i!=="cited")return"Lost since last run";let l=0;for(let c=e.length-1;c>=0&&e[c].citationState===i;c--)l++;return i==="cited"?l<=1?`${r} in latest run`:`${r} for ${l} runs`:l<=1?`Not ${n} in latest run`:`Not ${n} across ${l} runs`}function Sfe(e,t){return t==="citations"?e:e.map(n=>({...n,citationState:WP(n,t),runHistory:n.runHistory.map(r=>({...r,citationState:WP(r,t)}))}))}function jfe({evidence:e,compareLocations:t=!1}){const{openEvidence:n}=bd(),[r,i]=x.useState(new Set),[a,l]=x.useState("citations"),c=x.useMemo(()=>{const y=Sfe(e,a),v=new Map;for(const w of y){const b=w.query,j=t?w.location??null:null,k=t?JSON.stringify([b,j]):b,E=v.get(k)??{key:k,phrase:b,location:j,items:[]};E.items.push(w),v.set(k,E)}return[...v.values()]},[e,a,t]),d=y=>{i(v=>{const w=new Set(v);return w.has(y)?w.delete(y):w.add(y),w})},f=a==="mentions"?"mentioned":"cited",p=a==="mentions"?"Mention History":"Citation History",m=a==="mentions"?"mentioned":"cited";return s.jsxs("div",{children:[s.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"View by"}),s.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:[s.jsx("button",{type:"button",role:"tab","aria-selected":a==="citations",className:`px-2.5 py-1 text-xs font-medium rounded transition-colors ${a==="citations"?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,onClick:()=>l("citations"),children:"Citations"}),s.jsx("button",{type:"button",role:"tab","aria-selected":a==="mentions",className:`px-2.5 py-1 text-xs font-medium rounded transition-colors ${a==="mentions"?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,onClick:()=>l("mentions"),children:"Mentions"})]}),s.jsx("span",{className:"text-[11px] text-zinc-500",children:a==="mentions"?"Brand or domain in answer text":"Brand or domain in source links"})]}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:{width:"2rem"}}),s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:p}),s.jsx("th",{children:"Change"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:c.map(({key:y,phrase:v,location:w,items:b})=>{const j=r.has(y),k=b.map(A=>A.citationState),E=k.includes("cited")?"cited":k.includes("emerging")?"emerging":k.includes("lost")?"lost":k.every(A=>A==="pending")?"pending":"not-cited",O=wfe(b),C=b.filter(A=>A.citationState===kh.cited||A.citationState==="emerging").length,z=ZP(O,a);return s.jsxs(x.Fragment,{children:[s.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>d(y),"aria-expanded":j,children:[s.jsx("td",{children:s.jsx(Yh,{size:14,className:`transition-transform duration-150 text-zinc-500 ${j?"rotate-90":""}`})}),s.jsx("td",{className:"evidence-query-cell",children:s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-zinc-100",children:v}),t&&s.jsx("span",{className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-500",children:w??"No location"}),s.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:b.map(A=>s.jsx(Xl,{provider:A.provider},A.id))})]})}),s.jsx("td",{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx($1,{state:E,label:YP(E,a)}),s.jsxs("span",{className:"text-[11px] text-zinc-500",title:`${C} of ${b.length} engines ${m}`,children:[C,"/",b.length]})]})}),s.jsx("td",{children:s.jsx(QP,{history:O})}),s.jsx("td",{className:"evidence-change-cell",children:z}),s.jsx("td",{})]}),j&&b.map(A=>s.jsxs("tr",{className:"bg-zinc-900/30",children:[s.jsx("td",{}),s.jsx("td",{className:"evidence-query-cell pl-5",children:s.jsx(Xl,{provider:A.provider})}),s.jsx("td",{children:s.jsx($1,{state:A.citationState,label:YP(A.citationState,a)})}),s.jsx("td",{children:s.jsx(QP,{history:A.runHistory})}),s.jsx("td",{className:"evidence-change-cell",children:ZP(A.runHistory,a)}),s.jsx("td",{children:s.jsx(pe,{variant:"ghost",size:"sm",type:"button",onClick:_=>{_.stopPropagation(),n(A.id)},children:"View"})})]},A.id))]},y)})})]})}),s.jsxs("p",{className:"sr-only","aria-live":"polite",children:["Showing ",f==="cited"?"citations (sources)":"mentions (answer text)","."]})]})}function Nfe({competitors:e}){return e.length===0?s.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):s.jsx("div",{className:"competitor-table-wrap",children:s.jsxs("table",{className:"competitor-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Domain"}),s.jsx("th",{children:"Pressure"}),s.jsx("th",{children:"Citations"}),s.jsx("th",{children:"Queries"})]})}),s.jsx("tbody",{children:e.map(t=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),s.jsx("td",{children:s.jsx(tt,{tone:zne(t.pressureLabel),children:t.pressureLabel})}),s.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalQueries>0?`${t.citationCount} / ${t.totalQueries}`:"—"}),s.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedQueries.length>0?t.citedQueries.join(", "):"Not cited"})]},t.id))})]})})}function XP({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:a,coverageValue:l,note:c,updatedAt:d,active:f,onClick:p}){return s.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:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),s.jsx("h3",{children:t})]}),s.jsx(tt,{tone:r,children:n})]}),s.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:i}),s.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:a})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:l})]})]}),s.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:[s.jsx("span",{children:c}),s.jsx("span",{children:d?`Updated ${ua(d)}`:"No recent sync yet"})]})]})}function ag({label:e,value:t,tone:n}){const r=n==="positive"?"text-emerald-400":n==="negative"?"text-rose-400":"text-zinc-200";return s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),s.jsx("p",{className:`mt-2 text-2xl font-semibold ${r}`,children:t})]})}var kfe=["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 vC(e){if(typeof e!="string")return!1;var t=kfe;return t.includes(e)}var Cfe=["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"],Afe=new Set(Cfe);function VB(e){return typeof e!="string"?!1:Afe.has(e)}function QB(e){return typeof e=="string"&&e.startsWith("data-")}function Wi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(VB(n)||QB(n))&&(t[n]=e[n]);return t}function ip(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Wi(t)}return typeof e=="object"&&!Array.isArray(e)?Wi(e):null}function Gr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(VB(n)||QB(n)||vC(n))&&(t[n]=e[n]);return t}function Efe(e){return e==null?null:x.isValidElement(e)?Gr(e.props):typeof e=="object"&&!Array.isArray(e)?Gr(e):null}var Ofe=["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 _fe(e,t){if(e==null)return{};var n,r,i=zfe(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 zfe(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 xC=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:l,style:c,title:d,desc:f}=e,p=_fe(e,Ofe),m=a||{width:r,height:i,x:0,y:0},y=Rt("recharts-surface",l);return x.createElement("svg",B1({},Gr(p),{className:y,width:r,height:i,style:c,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)}),Tfe=["children","className"];function U1(){return U1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U1.apply(null,arguments)}function Pfe(e,t){if(e==null)return{};var n,r,i=Rfe(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 Rfe(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 Tr=x.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Pfe(e,Tfe),a=Rt("recharts-layer",r);return x.createElement("g",U1({className:a},Gr(i),{ref:t}),n)}),WB=x.createContext(null),Dfe=()=>x.useContext(WB);function Zt(e){return function(){return e}}const YB=Math.cos,xy=Math.sin,ba=Math.sqrt,by=Math.PI,c0=2*by,q1=Math.PI,F1=2*q1,kl=1e-6,Ife=F1-kl;function ZB(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Mfe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ZB;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 Lfe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?ZB:Mfe(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+l}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let l=this._x1,c=this._y1,d=r-t,f=i-n,p=l-t,m=c-n,y=p*p+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(y>kl)if(!(Math.abs(m*d-f*p)>kl)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-l,w=i-c,b=d*d+f*f,j=v*v+w*w,k=Math.sqrt(b),E=Math.sqrt(y),O=a*Math.tan((q1-Math.acos((b+y-j)/(2*k*E)))/2),C=O/E,z=O/k;Math.abs(C-1)>kl&&this._append`L${t+C*p},${n+C*m}`,this._append`A${a},${a},0,0,${+(m*v>p*w)},${this._x1=t+z*d},${this._y1=n+z*f}`}}arc(t,n,r,i,a,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),d=r*Math.sin(i),f=t+c,p=n+d,m=1^l,y=l?i-a:a-i;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>kl||Math.abs(this._y1-p)>kl)&&this._append`L${f},${p}`,r&&(y<0&&(y=y%F1+F1),y>Ife?this._append`A${r},${r},0,1,${m},${t-c},${n-d}A${r},${r},0,1,${m},${this._x1=f},${this._y1=p}`:y>kl&&this._append`A${r},${r},0,${+(y>=q1)},${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 bC(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 Lfe(t)}function wC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function XB(e){this._context=e}XB.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 u0(e){return new XB(e)}function JB(e){return e[0]}function e6(e){return e[1]}function t6(e,t){var n=Zt(!0),r=null,i=u0,a=null,l=bC(c);e=typeof e=="function"?e:e===void 0?JB:Zt(e),t=typeof t=="function"?t:t===void 0?e6:Zt(t);function c(d){var f,p=(d=wC(d)).length,m,y=!1,v;for(r==null&&(a=i(v=l())),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 c.x=function(d){return arguments.length?(e=typeof d=="function"?d:Zt(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:Zt(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:Zt(!!d),c):n},c.curve=function(d){return arguments.length?(i=d,r!=null&&(a=i(r)),c):i},c.context=function(d){return arguments.length?(d==null?r=a=null:a=i(r=d),c):r},c}function sg(e,t,n){var r=null,i=Zt(!0),a=null,l=u0,c=null,d=bC(f);e=typeof e=="function"?e:e===void 0?JB:Zt(+e),t=typeof t=="function"?t:Zt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?e6:Zt(+n);function f(m){var y,v,w,b=(m=wC(m)).length,j,k=!1,E,O=new Array(b),C=new Array(b);for(a==null&&(c=l(E=d())),y=0;y<=b;++y){if(!(y<b&&i(j=m[y],y,m))===k)if(k=!k)v=y,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),w=y-1;w>=v;--w)c.point(O[w],C[w]);c.lineEnd(),c.areaEnd()}k&&(O[y]=+e(j,y,m),C[y]=+t(j,y,m),c.point(r?+r(j,y,m):O[y],n?+n(j,y,m):C[y]))}if(E)return c=null,E+""||null}function p(){return t6().defined(i).curve(l).context(a)}return f.x=function(m){return arguments.length?(e=typeof m=="function"?m:Zt(+m),r=null,f):e},f.x0=function(m){return arguments.length?(e=typeof m=="function"?m:Zt(+m),f):e},f.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:Zt(+m),f):r},f.y=function(m){return arguments.length?(t=typeof m=="function"?m:Zt(+m),n=null,f):t},f.y0=function(m){return arguments.length?(t=typeof m=="function"?m:Zt(+m),f):t},f.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:Zt(+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:Zt(!!m),f):i},f.curve=function(m){return arguments.length?(l=m,a!=null&&(c=l(a)),f):l},f.context=function(m){return arguments.length?(m==null?a=c=null:c=l(a=m),f):a},f}class n6{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 $fe(e){return new n6(e,!0)}function Bfe(e){return new n6(e,!1)}const SC={draw(e,t){const n=ba(t/by);e.moveTo(n,0),e.arc(0,0,n,0,c0)}},Ufe={draw(e,t){const n=ba(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()}},r6=ba(1/3),qfe=r6*2,Ffe={draw(e,t){const n=ba(t/qfe),r=n*r6;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Hfe={draw(e,t){const n=ba(t),r=-n/2;e.rect(r,r,n,n)}},Kfe=.8908130915292852,i6=xy(by/10)/xy(7*by/10),Gfe=xy(c0/10)*i6,Vfe=-YB(c0/10)*i6,Qfe={draw(e,t){const n=ba(t*Kfe),r=Gfe*n,i=Vfe*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const l=c0*a/5,c=YB(l),d=xy(l);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*i,d*r+c*i)}e.closePath()}},dS=ba(3),Wfe={draw(e,t){const n=-ba(t/(dS*3));e.moveTo(0,n*2),e.lineTo(-dS*n,-n),e.lineTo(dS*n,-n),e.closePath()}},Mi=-.5,Li=ba(3)/2,H1=1/ba(12),Yfe=(H1/2+1)*3,Zfe={draw(e,t){const n=ba(t/Yfe),r=n/2,i=n*H1,a=r,l=n*H1+n,c=-a,d=l;e.moveTo(r,i),e.lineTo(a,l),e.lineTo(c,d),e.lineTo(Mi*r-Li*i,Li*r+Mi*i),e.lineTo(Mi*a-Li*l,Li*a+Mi*l),e.lineTo(Mi*c-Li*d,Li*c+Mi*d),e.lineTo(Mi*r+Li*i,Mi*i-Li*r),e.lineTo(Mi*a+Li*l,Mi*l-Li*a),e.lineTo(Mi*c+Li*d,Mi*d-Li*c),e.closePath()}};function Xfe(e,t){let n=null,r=bC(i);e=typeof e=="function"?e:Zt(e||SC),t=typeof t=="function"?t:Zt(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:Zt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Zt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function wy(){}function Sy(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function a6(e){this._context=e}a6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Sy(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Sy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Jfe(e){return new a6(e)}function s6(e){this._context=e}s6.prototype={areaStart:wy,areaEnd:wy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Sy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ehe(e){return new s6(e)}function o6(e){this._context=e}o6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Sy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function the(e){return new o6(e)}function l6(e){this._context=e}l6.prototype={areaStart:wy,areaEnd:wy,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function nhe(e){return new l6(e)}function JP(e){return e<0?-1:1}function eR(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),c=(a*i+l*r)/(r+i);return(JP(a)+JP(l))*Math.min(Math.abs(a),Math.abs(l),.5*Math.abs(c))||0}function tR(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function fS(e,t,n){var r=e._x0,i=e._y0,a=e._x1,l=e._y1,c=(a-r)/3;e._context.bezierCurveTo(r+c,i+c*t,a-c,l-c*n,a,l)}function jy(e){this._context=e}jy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:fS(this,this._t0,tR(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,fS(this,tR(this,n=eR(this,e,t)),n);break;default:fS(this,this._t0,n=eR(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function c6(e){this._context=new u6(e)}(c6.prototype=Object.create(jy.prototype)).point=function(e,t){jy.prototype.point.call(this,t,e)};function u6(e){this._context=e}u6.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 rhe(e){return new jy(e)}function ihe(e){return new c6(e)}function d6(e){this._context=e}d6.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=nR(e),i=nR(t),a=0,l=1;l<n;++a,++l)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[l],t[l]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function nR(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),l=new Array(n);for(i[0]=0,a[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(l[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function ahe(e){return new d6(e)}function d0(e,t){this._context=e,this._t=t}d0.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 she(e){return new d0(e,.5)}function ohe(e){return new d0(e,0)}function lhe(e){return new d0(e,1)}function tc(e,t){if((l=e.length)>1)for(var n=1,r,i,a=e[t[0]],l,c=a.length;n<l;++n)for(i=a,a=e[t[n]],r=0;r<c;++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 che(e,t){return e[t]}function uhe(e){const t=[];return t.key=e,t}function dhe(){var e=Zt([]),t=K1,n=tc,r=che;function i(a){var l=Array.from(e.apply(this,arguments),uhe),c,d=l.length,f=-1,p;for(const m of a)for(c=0,++f;c<d;++c)(l[c][f]=[0,+r(m,l[c].key,f,a)]).data=m;for(c=0,p=wC(t(l));c<d;++c)l[p[c]].index=c;return n(l,p),l}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Zt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Zt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?K1:typeof a=="function"?a:Zt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??tc,i):n},i}function fhe(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,l;i<a;++i){for(l=n=0;n<r;++n)l+=e[n][i][1]||0;if(l)for(n=0;n<r;++n)e[n][i][1]/=l}tc(e,t)}}function hhe(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var l=0,c=0;l<i;++l)c+=e[l][n][1]||0;r[n][1]+=r[n][0]=-c/2}tc(e,t)}}function phe(e,t){if(!(!((l=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,l;r<a;++r){for(var c=0,d=0,f=0;c<l;++c){for(var p=e[t[c]],m=p[r][1]||0,y=p[r-1][1]||0,v=(m-y)/2,w=0;w<c;++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,tc(e,t)}}var hS={},pS={},rR;function mhe(){return rR||(rR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(pS)),pS}var mS={},iR;function f6(){return iR||(iR=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})(mS)),mS}var gS={},aR;function jC(){return aR||(aR=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})(gS)),gS}var yS={},vS={},sR;function ghe(){return sR||(sR=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})(vS)),vS}var oR;function NC(){return oR||(oR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ghe(),n=jC();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],l=i.length;if(l===0)return a;let c=0,d="",f="",p=!1;for(i.charCodeAt(0)===46&&(a.push(""),c++);c<l;){const m=i[c];f?m==="\\"&&c+1<l?(c++,d+=i[c]):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,c++}return d&&a.push(d),a}e.toPath=r})(yS)),yS}var lR;function kC(){return lR||(lR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mhe(),n=f6(),r=jC(),i=NC();function a(c,d,f){if(c==null)return f;switch(typeof d){case"string":{if(t.isUnsafeProperty(d))return f;const p=c[d];return p===void 0?n.isDeepKey(d)?a(c,i.toPath(d),f):f:p}case"number":case"symbol":{typeof d=="number"&&(d=r.toKey(d));const p=c[d];return p===void 0?f:p}default:{if(Array.isArray(d))return l(c,d,f);if(Object.is(d?.valueOf(),-0)?d="-0":d=String(d),t.isUnsafeProperty(d))return f;const p=c[d];return p===void 0?f:p}}}function l(c,d,f){if(d.length===0)return f;let p=c;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})(hS)),hS}var xS,cR;function yhe(){return cR||(cR=1,xS=kC().get),xS}var vhe=yhe();const id=ya(vhe);var xhe=4;function Oo(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xhe,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function wn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,l)=>{var c=n[l-1];return typeof c=="string"?i+c+a:c!==void 0?i+Oo(c)+a:i+a},"")}var ai=e=>e===0?0:e>0?1:-1,pa=e=>typeof e=="number"&&e!=+e,nc=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Re=e=>(typeof e=="number"||e instanceof Number)&&!pa(e),Fa=e=>Re(e)||typeof e=="string",bhe=0,zh=e=>{var t=++bhe;return"".concat(e||"").concat(t)},ma=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(!Re(t)&&typeof t!="string")return r;var a;if(nc(t)){if(n==null)return r;var l=t.indexOf("%");a=n*parseFloat(t.slice(0,l))/100}else a=+t;return pa(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},h6=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 hn(e,t,n){return Re(e)&&Re(t)?Oo(e+n*(t-e)):t}function p6(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):id(r,t))===n)}var pn=e=>e===null||typeof e>"u",ap=e=>pn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function si(e){return e!=null}function vc(){}var whe=["type","size","sizeType"];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 uR(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 dR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uR(Object(n),!0).forEach(function(r){She(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function She(e,t,n){return(t=jhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jhe(e){var t=Nhe(e,"string");return typeof t=="symbol"?t:t+""}function Nhe(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 khe(e,t){if(e==null)return{};var n,r,i=Che(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 Che(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 m6={symbolCircle:SC,symbolCross:Ufe,symbolDiamond:Ffe,symbolSquare:Hfe,symbolStar:Qfe,symbolTriangle:Wfe,symbolWye:Zfe},Ahe=Math.PI/180,Ehe=e=>{var t="symbol".concat(ap(e));return m6[t]||SC},Ohe=(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*Ahe;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}},_he=(e,t)=>{m6["symbol".concat(ap(e))]=t},CC=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=khe(e,whe),a=dR(dR({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var c=()=>{var y=Ehe(l),v=Xfe().type(y).size(Ohe(n,r,l)),w=v();if(w!==null)return w},{className:d,cx:f,cy:p}=a,m=Gr(a);return Re(f)&&Re(p)&&Re(n)?x.createElement("path",G1({},m,{className:Rt("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:c()})):null};CC.registerSymbol=_he;var g6=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,AC=(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=>{vC(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},zhe=(e,t,n)=>r=>(e(t,n,r),null),f0=(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];vC(i)&&typeof a=="function"&&(r||(r={}),r[i]=zhe(a,t,n))}),r};function fR(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 The(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fR(Object(n),!0).forEach(function(r){Phe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Phe(e,t,n){return(t=Rhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rhe(e){var t=Dhe(e,"string");return typeof t=="symbol"?t:t+""}function Dhe(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 Rr(e,t){var n=The({},e),r=t,i=Object.keys(t),a=i.reduce((l,c)=>(l[c]===void 0&&r[c]!==void 0&&(l[c]=r[c]),l),n);return a}function Ny(){return Ny=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ny.apply(null,arguments)}function hR(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 y6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hR(Object(n),!0).forEach(function(r){Ihe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ihe(e,t,n){return(t=Mhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mhe(e){var t=Lhe(e,"string");return typeof t=="symbol"?t:t+""}function Lhe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bi=32,$he={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Bhe(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Uhe(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Bi/2,a=Bi/6,l=Bi/3,c=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:c,strokeDasharray:Bhe(t.payload),x1:0,y1:i,x2:Bi,y2:i,className:"recharts-legend-icon"});if(d==="line")return x.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
|
|
255
|
-
A`).concat(a,",").concat(a,",0,1,1,").concat(2*l,",").concat(i,`
|
|
256
|
-
H`).concat(Bi,"M").concat(2*l,",").concat(i,`
|
|
257
|
-
A`).concat(a,",").concat(a,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(d==="rect")return x.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Bi/8,"h").concat(Bi,"v").concat(Bi*3/4,"h").concat(-Bi,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var f=y6({},t);return delete f.legendIcon,x.cloneElement(t.legendIcon,f)}return x.createElement(CC,{fill:c,cx:i,cy:i,size:Bi,sizeType:"diameter",type:d})}function qhe(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:l,labelStyle:c}=e,d={x:0,y:0,width:Bi,height:Bi},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 c=="object"?y6({},c):{};b.color=m.inactive?a:b.color||m.color;var j=v?v(m.value,m,y):m.value;return x.createElement("li",Ny({className:w,style:f,key:"legend-item-".concat(y)},f0(e,m,y)),x.createElement(xC,{width:n,height:n,viewBox:d,style:p,"aria-label":"".concat(m.value," legend icon")},x.createElement(Uhe,{data:m,iconType:l,inactiveColor:a})),x.createElement("span",{className:"recharts-legend-item-text",style:b},j))})}var Fhe=e=>{var t=Rr(e,$he),{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(qhe,Ny({},t,{payload:n})))},bS={},wS={},pR;function Hhe(){return pR||(pR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a<n.length;a++){const l=n[a],c=r(l,a,n);i.has(c)||i.set(c,l)}return Array.from(i.values())}e.uniqBy=t})(wS)),wS}var SS={},mR;function Khe(){return mR||(mR=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})(SS)),SS}var jS={},gR;function v6(){return gR||(gR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(jS)),jS}var NS={},kS={},CS={},yR;function Ghe(){return yR||(yR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(CS)),CS}var vR;function x6(){return vR||(vR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ghe();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(kS)),kS}var AS={},xR;function Vhe(){return xR||(xR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(AS)),AS}var bR;function Qhe(){return bR||(bR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=x6(),n=Vhe();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(NS)),NS}var ES={},OS={},wR;function Whe(){return wR||(wR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kC();function n(r){return function(i){return t.get(i,r)}}e.property=n})(OS)),OS}var _S={},zS={},TS={},PS={},SR;function b6(){return SR||(SR=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 RS={},jR;function w6(){return jR||(jR=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})(RS)),RS}var DS={},NR;function S6(){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})(DS)),DS}var kR;function Yhe(){return kR||(kR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=b6(),n=w6(),r=S6();function i(p,m,y){return typeof y!="function"?i(p,m,()=>{}):a(p,m,function v(w,b,j,k,E,O){const C=y(w,b,j,k,E,O);return C!==void 0?!!C:a(w,b,v,O)},new Map)}function a(p,m,y,v){if(m===p)return!0;switch(typeof m){case"object":return l(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 l(p,m,y,v){if(m==null)return!0;if(Array.isArray(m))return d(p,m,y,v);if(m instanceof Map)return c(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 c(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 O=p[E];let C=!1;if(y(O,j,b,p,m,v)&&(C=!0),C){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})(TS)),TS}var CR;function j6(){return CR||(CR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Yhe();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(zS)),zS}var IS={},MS={},LS={},AR;function Zhe(){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})(LS)),LS}var $S={},ER;function EC(){return ER||(ER=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})($S)),$S}var BS={},OR;function N6(){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]",l="[object Symbol]",c="[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]",O="[object Uint32Array]",C="[object BigUint64Array]",z="[object Int8Array]",A="[object Int16Array]",_="[object Int32Array]",R="[object BigInt64Array]",$="[object Float32Array]",F="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=y,e.arrayTag=p,e.bigInt64ArrayTag=R,e.bigUint64ArrayTag=C,e.booleanTag=i,e.dataViewTag=b,e.dateTag=c,e.errorTag=w,e.float32ArrayTag=$,e.float64ArrayTag=F,e.functionTag=m,e.int16ArrayTag=A,e.int32ArrayTag=_,e.int8ArrayTag=z,e.mapTag=d,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=f,e.stringTag=n,e.symbolTag=l,e.uint16ArrayTag=E,e.uint32ArrayTag=O,e.uint8ArrayTag=j,e.uint8ClampedArrayTag=k})(BS)),BS}var US={},_R;function Xhe(){return _R||(_R=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(US)),US}var zR;function k6(){return zR||(zR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Zhe(),n=EC(),r=N6(),i=w6(),a=Xhe();function l(p,m){return c(p,void 0,p,new Map,m)}function c(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]=c(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,c(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(c(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]=c(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]=c(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=l,e.cloneDeepWithImpl=c,e.copyProperties=d})(MS)),MS}var TR;function Jhe(){return TR||(TR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=k6();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(IS)),IS}var PR;function epe(){return PR||(PR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=j6(),n=Jhe();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(_S)),_S}var qS={},FS={},HS={},RR;function tpe(){return RR||(RR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=k6(),n=EC(),r=N6();function i(a,l){return t.cloneDeepWith(a,(c,d,f,p)=>{const m=l?.(c,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})(HS)),HS}var DR;function npe(){return DR||(DR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tpe();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(FS)),FS}var KS={},GS={},IR;function C6(){return IR||(IR=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})(GS)),GS}var VS={},MR;function rpe(){return MR||(MR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=EC();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(VS)),VS}var LR;function ipe(){return LR||(LR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=f6(),n=C6(),r=rpe(),i=NC();function a(l,c){let d;if(Array.isArray(c)?d=c:typeof c=="string"&&t.isDeepKey(c)&&l?.[c]==null?d=i.toPath(c):d=[c],d.length===0)return!1;let f=l;for(let p=0;p<d.length;p++){const m=d[p];if((f==null||!Object.hasOwn(f,m))&&!((Array.isArray(f)||r.isArguments(f))&&n.isIndex(m)&&m<f.length))return!1;f=f[m]}return!0}e.has=a})(KS)),KS}var $R;function ape(){return $R||($R=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=j6(),n=jC(),r=npe(),i=kC(),a=ipe();function l(c,d){switch(typeof c){case"object":{Object.is(c?.valueOf(),-0)&&(c="-0");break}case"number":{c=n.toKey(c);break}}return d=r.cloneDeep(d),function(f){const p=i.get(f,c);return p===void 0?a.has(f,c):d===void 0?p===void 0:t.isMatch(p,d)}}e.matchesProperty=l})(qS)),qS}var BR;function spe(){return BR||(BR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=v6(),n=Whe(),r=epe(),i=ape();function a(l){if(l==null)return t.identity;switch(typeof l){case"function":return l;case"object":return Array.isArray(l)&&l.length===2?i.matchesProperty(l[0],l[1]):r.matches(l);case"string":case"symbol":case"number":return n.property(l)}}e.iteratee=a})(ES)),ES}var UR;function ope(){return UR||(UR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Hhe(),n=Khe(),r=v6(),i=Qhe(),a=spe();function l(c,d=r.identity){return i.isArrayLikeObject(c)?t.uniqBy(Array.from(c),n.ary(a.iteratee(d),1)):[]}e.uniqBy=l})(bS)),bS}var QS,qR;function lpe(){return qR||(qR=1,QS=ope().uniqBy),QS}var cpe=lpe();const FR=ya(cpe);function A6(e,t,n){return t===!0?FR(e,n):typeof t=="function"?FR(e,t):e}var OC=x.createContext(null),upe=e=>e,sn=()=>{var e=x.useContext(OC);return e?e.store.dispatch:upe},qg=()=>{},dpe=()=>qg,fpe=(e,t)=>e===t;function Fe(e){var t=x.useContext(OC),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:qg,[t,e]);return B5.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:dpe,t?t.store.getState:qg,t?t.store.getState:qg,n,fpe)}function hpe(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ppe(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function mpe(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 HR=e=>Array.isArray(e)?e:[e];function gpe(e){const t=Array.isArray(e[0])?e[0]:e;return mpe(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ype(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var vpe=class{constructor(e){this.value=e}deref(){return this.value}},xpe=typeof WeakRef<"u"?WeakRef:vpe,bpe=0,KR=1;function og(){return{s:bpe,v:void 0,o:null,p:null}}function E6(e,t={}){let n=og();const{resultEqualityCheck:r}=t;let i,a=0;function l(){let c=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=c.o;w===null&&(c.o=w=new WeakMap);const b=w.get(v);b===void 0?(c=og(),w.set(v,c)):c=b}else{let w=c.p;w===null&&(c.p=w=new Map);const b=w.get(v);b===void 0?(c=og(),w.set(v,c)):c=b}}const f=c;let p;if(c.s===KR)p=c.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 xpe(p):p}return f.s=KR,f.v=p,p}return l.clearCache=()=>{n=og(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function wpe(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,l=0,c,d={},f=i.pop();typeof f=="object"&&(d=f,f=i.pop()),hpe(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p={...n,...d},{memoize:m,memoizeOptions:y=[],argsMemoize:v=E6,argsMemoizeOptions:w=[]}=p,b=HR(y),j=HR(w),k=gpe(i),E=m(function(){return a++,f.apply(null,arguments)},...b),O=v(function(){l++;const z=ype(k,arguments);return c=E.apply(null,z),c},...j);return Object.assign(O,{resultFunc:f,memoizedResultFunc:E,dependencies:k,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>c,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var le=wpe(E6),Spe=Object.assign((e,t=le)=>{ppe(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((l,c,d)=>(l[n[d]]=c,l),{}))},{withTypes:()=>Spe}),WS={},YS={},ZS={},GR;function jpe(){return GR||(GR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,a)=>{if(r!==i){const l=t(r),c=t(i);if(l===c&&l===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?c-l:l-c}return 0};e.compareValues=n})(ZS)),ZS}var XS={},JS={},VR;function O6(){return VR||(VR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(JS)),JS}var QR;function Npe(){return QR||(QR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=O6(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,l){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(r.test(a)||!n.test(a))||l!=null&&Object.hasOwn(l,a)}e.isKey=i})(XS)),XS}var WR;function kpe(){return WR||(WR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jpe(),n=Npe(),r=NC();function i(a,l,c,d){if(a==null)return[];c=d?void 0:c,Array.isArray(a)||(a=Object.values(a)),Array.isArray(l)||(l=l==null?[null]:[l]),l.length===0&&(l=[null]),Array.isArray(c)||(c=c==null?[]:[c]),c=c.map(v=>String(v));const 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=l.map(v=>(Array.isArray(v)&&v.length===1&&(v=v[0]),v==null||typeof v=="function"||Array.isArray(v)||n.isKey(v)?v:{key:v,path:r.toPath(v)}));return a.map(v=>({original:v,criteria:m.map(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],c[b]);if(j!==0)return j}return 0}).map(v=>v.original)}e.orderBy=i})(YS)),YS}var ej={},YR;function Cpe(){return YR||(YR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),l=(c,d)=>{for(let f=0;f<c.length;f++){const p=c[f];Array.isArray(p)&&d<a?l(p,d+1):i.push(p)}};return l(n,0),i}e.flatten=t})(ej)),ej}var tj={},ZR;function _6(){return ZR||(ZR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=C6(),n=x6(),r=b6(),i=S6();function a(l,c,d){return r.isObject(d)&&(typeof c=="number"&&n.isArrayLike(d)&&t.isIndex(c)&&c<d.length||typeof c=="string"&&c in d)?i.isEqualsSameValueZero(d[c],l):!1}e.isIterateeCall=a})(tj)),tj}var XR;function Ape(){return XR||(XR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kpe(),n=Cpe(),r=_6();function i(a,...l){const c=l.length;return c>1&&r.isIterateeCall(a,l[0],l[1])?l=[]:c>2&&r.isIterateeCall(l[0],l[1],l[2])&&(l=[l[0]]),t.orderBy(a,n.flatten(l),["asc"])}e.sortBy=i})(WS)),WS}var nj,JR;function Epe(){return JR||(JR=1,nj=Ape().sortBy),nj}var Ope=Epe();const h0=ya(Ope);var z6=e=>e.legend.settings,_pe=e=>e.legend.size,zpe=e=>e.legend.payload,Tpe=le([zpe,z6],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?h0(r,n):r});function Ppe(){return Fe(Tpe)}var lg=1;function T6(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=x.useState({height:0,left:0,top:0,width:0}),r=x.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),l={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(l.height-t.height)>lg||Math.abs(l.left-t.left)>lg||Math.abs(l.top-t.top)>lg||Math.abs(l.width-t.width)>lg)&&n({height:l.height,left:l.left,top:l.top,width:l.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function dr(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 Rpe=typeof Symbol=="function"&&Symbol.observable||"@@observable",eD=Rpe,rj=()=>Math.random().toString(36).substring(7).split("").join("."),Dpe={INIT:`@@redux/INIT${rj()}`,REPLACE:`@@redux/REPLACE${rj()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${rj()}`},ky=Dpe;function _C(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 P6(e,t,n){if(typeof e!="function")throw new Error(dr(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(dr(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(dr(1));return n(P6)(e,t)}let r=e,i=t,a=new Map,l=a,c=0,d=!1;function f(){l===a&&(l=new Map,a.forEach((j,k)=>{l.set(k,j)}))}function p(){if(d)throw new Error(dr(3));return i}function m(j){if(typeof j!="function")throw new Error(dr(4));if(d)throw new Error(dr(5));let k=!0;f();const E=c++;return l.set(E,j),function(){if(k){if(d)throw new Error(dr(6));k=!1,f(),l.delete(E),a=null}}}function y(j){if(!_C(j))throw new Error(dr(7));if(typeof j.type>"u")throw new Error(dr(8));if(typeof j.type!="string")throw new Error(dr(17));if(d)throw new Error(dr(9));try{d=!0,i=r(i,j)}finally{d=!1}return(a=l).forEach(E=>{E()}),j}function v(j){if(typeof j!="function")throw new Error(dr(10));r=j,y({type:ky.REPLACE})}function w(){const j=m;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(dr(11));function E(){const C=k;C.next&&C.next(p())}return E(),{unsubscribe:j(E)}},[eD](){return this}}}return y({type:ky.INIT}),{dispatch:y,subscribe:m,getState:p,replaceReducer:v,[eD]:w}}function Ipe(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:ky.INIT})>"u")throw new Error(dr(12));if(typeof n(void 0,{type:ky.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(dr(13))})}function R6(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const l=t[a];typeof e[l]=="function"&&(n[l]=e[l])}const r=Object.keys(n);let i;try{Ipe(n)}catch(a){i=a}return function(l={},c){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=l[m],w=y(v,c);if(typeof w>"u")throw c&&c.type,new Error(dr(14));f[m]=w,d=d||w!==v}return d=d||r.length!==Object.keys(l).length,d?f:l}}function Cy(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Mpe(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(dr(15))};const l={getState:i.getState,dispatch:(d,...f)=>a(d,...f)},c=e.map(d=>d(l));return a=Cy(...c)(i.dispatch),{...i,dispatch:a}}}function D6(e){return _C(e)&&"type"in e&&typeof e.type=="string"}var I6=Symbol.for("immer-nothing"),tD=Symbol.for("immer-draftable"),Vr=Symbol.for("immer-state");function da(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ni=Object,ad=Ni.getPrototypeOf,Ay="constructor",p0="prototype",V1="configurable",Ey="enumerable",Fg="writable",Th="value",Os=e=>!!e&&!!e[Vr];function ga(e){return e?M6(e)||g0(e)||!!e[tD]||!!e[Ay]?.[tD]||y0(e)||v0(e):!1}var Lpe=Ni[p0][Ay].toString(),nD=new WeakMap;function M6(e){if(!e||!zC(e))return!1;const t=ad(e);if(t===null||t===Ni[p0])return!0;const n=Ni.hasOwnProperty.call(t,Ay)&&t[Ay];if(n===Object)return!0;if(!Eu(n))return!1;let r=nD.get(n);return r===void 0&&(r=Function.toString.call(n),nD.set(n,r)),r===Lpe}function m0(e,t,n=!0){sp(e)===0?(n?Reflect.ownKeys(e):Ni.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function sp(e){const t=e[Vr];return t?t.type_:g0(e)?1:y0(e)?2:v0(e)?3:0}var rD=(e,t,n=sp(e))=>n===2?e.has(t):Ni[p0].hasOwnProperty.call(e,t),Q1=(e,t,n=sp(e))=>n===2?e.get(t):e[t],Oy=(e,t,n,r=sp(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function $pe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var g0=Array.isArray,y0=e=>e instanceof Map,v0=e=>e instanceof Set,zC=e=>typeof e=="object",Eu=e=>typeof e=="function",ij=e=>typeof e=="boolean";function Bpe(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var vs=e=>e.copy_||e.base_,TC=e=>e.modified_?e.copy_:e.base_;function W1(e,t){if(y0(e))return new Map(e);if(v0(e))return new Set(e);if(g0(e))return Array[p0].slice.call(e);const n=M6(e);if(t===!0||t==="class_only"&&!n){const r=Ni.getOwnPropertyDescriptors(e);delete r[Vr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],c=r[l];c[Fg]===!1&&(c[Fg]=!0,c[V1]=!0),(c.get||c.set)&&(r[l]={[V1]:!0,[Fg]:!0,[Ey]:c[Ey],[Th]:e[l]})}return Ni.create(ad(e),r)}else{const r=ad(e);if(r!==null&&n)return{...e};const i=Ni.create(r);return Ni.assign(i,e)}}function PC(e,t=!1){return x0(e)||Os(e)||!ga(e)||(sp(e)>1&&Ni.defineProperties(e,{set:cg,add:cg,clear:cg,delete:cg}),Ni.freeze(e),t&&m0(e,(n,r)=>{PC(r,!0)},!1)),e}function Upe(){da(2)}var cg={[Th]:Upe};function x0(e){return e===null||!zC(e)?!0:Ni.isFrozen(e)}var _y="MapSet",Y1="Patches",iD="ArrayMethods",L6={};function rc(e){const t=L6[e];return t||da(0,e),t}var aD=e=>!!L6[e],Ph,$6=()=>Ph,qpe=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:aD(_y)?rc(_y):void 0,arrayMethodsPlugin_:aD(iD)?rc(iD):void 0});function sD(e,t){t&&(e.patchPlugin_=rc(Y1),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Z1(e){X1(e),e.drafts_.forEach(Fpe),e.drafts_=null}function X1(e){e===Ph&&(Ph=e.parent_)}var oD=e=>Ph=qpe(Ph,e);function Fpe(e){const t=e[Vr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function lD(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Vr].modified_&&(Z1(t),da(4)),ga(e)&&(e=cD(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Vr].base_,e,t)}else e=cD(t,n);return Hpe(t,e,!0),Z1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==I6?e:void 0}function cD(e,t){if(x0(t))return t;const n=t[Vr];if(!n)return zy(t,e.handledSet_,e);if(!b0(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);q6(n,e)}return n.copy_}function Hpe(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&PC(t,n)}function B6(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var b0=(e,t)=>e.scope_===t,Kpe=[];function U6(e,t,n,r){const i=vs(e),a=e.type_;if(r!==void 0&&Q1(i,r,a)===t){Oy(i,r,n,a);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;m0(i,(d,f)=>{if(Os(f)){const p=c.get(f)||[];p.push(d),c.set(f,p)}})}const l=e.draftLocations_.get(t)??Kpe;for(const c of l)Oy(i,c,n,a)}function Gpe(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!b0(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const l=TC(a);U6(e,a.draft_??a,l,n),q6(a,i)})}function q6(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)}B6(e)}}function Vpe(e,t,n){const{scope_:r}=e;if(Os(n)){const i=n[Vr];b0(i,r)&&i.callbacks_.push(function(){Hg(e);const l=TC(i);U6(e,n,l,t)})}else ga(n)&&e.callbacks_.push(function(){const a=vs(e);e.type_===3?a.has(n)&&zy(n,r.handledSet_,r):Q1(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&zy(Q1(e.copy_,t,e.type_),r.handledSet_,r)})}function zy(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Os(e)||t.has(e)||!ga(e)||x0(e)||(t.add(e),m0(e,(r,i)=>{if(Os(i)){const a=i[Vr];if(b0(a,n)){const l=TC(a);Oy(e,r,l,e.type_),B6(a)}}else ga(i)&&zy(i,t,n)})),e}function Qpe(e,t){const n=g0(e),r={type_:n?1:0,scope_:t?t.scope_:$6(),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=Ty;n&&(i=[r],a=Rh);const{revoke:l,proxy:c}=Proxy.revocable(i,a);return r.draft_=c,r.revoke_=l,[c,r]}var Ty={get(e,t){if(t===Vr)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=vs(e);if(!rD(i,t,e.type_))return Wpe(e,i,t);const a=i[t];if(e.finalized_||!ga(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Bpe(t))return a;if(a===aj(e.base_,t)){Hg(e);const l=e.type_===1?+t:t,c=eN(e.scope_,a,e,l);return e.copy_[l]=c}return a},has(e,t){return t in vs(e)},ownKeys(e){return Reflect.ownKeys(vs(e))},set(e,t,n){const r=F6(vs(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=aj(vs(e),t),a=i?.[Vr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if($pe(n,i)&&(n!==void 0||rD(e.base_,t,e.type_)))return!0;Hg(e),J1(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),Vpe(e,t,n)),!0},deleteProperty(e,t){return Hg(e),aj(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),J1(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=vs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Fg]:!0,[V1]:e.type_!==1||t!=="length",[Ey]:r[Ey],[Th]:n[t]}},defineProperty(){da(11)},getPrototypeOf(e){return ad(e.base_)},setPrototypeOf(){da(12)}},Rh={};for(let e in Ty){let t=Ty[e];Rh[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Rh.deleteProperty=function(e,t){return Rh.set.call(this,e,t,void 0)};Rh.set=function(e,t,n){return Ty.set.call(this,e[0],t,n,e[0])};function aj(e,t){const n=e[Vr];return(n?vs(n):e)[t]}function Wpe(e,t,n){const r=F6(t,n);return r?Th in r?r[Th]:r.get?.call(e.draft_):void 0}function F6(e,t){if(!(t in e))return;let n=ad(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=ad(n)}}function J1(e){e.modified_||(e.modified_=!0,e.parent_&&J1(e.parent_))}function Hg(e){e.copy_||(e.assigned_=new Map,e.copy_=W1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ype=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Eu(n)&&!Eu(r)){const l=r;r=n;const c=this;return function(f=l,...p){return c.produce(f,m=>r.call(this,m,...p))}}Eu(r)||da(6),i!==void 0&&!Eu(i)&&da(7);let a;if(ga(n)){const l=oD(this),c=eN(l,n,void 0);let d=!0;try{a=r(c),d=!1}finally{d?Z1(l):X1(l)}return sD(l,i),lD(a,l)}else if(!n||!zC(n)){if(a=r(n),a===void 0&&(a=n),a===I6&&(a=void 0),this.autoFreeze_&&PC(a,!0),i){const l=[],c=[];rc(Y1).generateReplacementPatches_(n,a,{patches_:l,inversePatches_:c}),i(l,c)}return a}else da(1,n)},this.produceWithPatches=(n,r)=>{if(Eu(n))return(c,...d)=>this.produceWithPatches(c,f=>n(f,...d));let i,a;return[this.produce(n,r,(c,d)=>{i=c,a=d}),i,a]},ij(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),ij(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),ij(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){ga(t)||da(8),Os(t)&&(t=Ki(t));const n=oD(this),r=eN(n,t,void 0);return r[Vr].isManual_=!0,X1(n),r}finishDraft(t,n){const r=t&&t[Vr];(!r||!r.isManual_)&&da(9);const{scope_:i}=r;return sD(i,n),lD(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=rc(Y1).applyPatches_;return Os(t)?i(t,n):this.produce(t,a=>i(a,n))}};function eN(e,t,n,r){const[i,a]=y0(t)?rc(_y).proxyMap_(t,n):v0(t)?rc(_y).proxySet_(t,n):Qpe(t,n);return(n?.scope_??$6()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?Gpe(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 Ki(e){return Os(e)||da(10,e),H6(e)}function H6(e){if(!ga(e)||x0(e))return e;const t=e[Vr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=W1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=W1(e,!0);return m0(n,(i,a)=>{Oy(n,i,H6(a))},r),t&&(t.finalized_=!1),n}var Zpe=new Ype,K6=Zpe.produce;function G6(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var Xpe=G6(),Jpe=G6,eme=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Cy:Cy.apply(null,arguments)};function Ci(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(ki(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=>D6(r)&&r.type===e,n}var V6=class nh extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,nh.prototype)}static get[Symbol.species](){return nh}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new nh(...t[0].concat(this)):new nh(...t.concat(this))}};function uD(e){return ga(e)?K6(e,()=>{}):e}function ug(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function tme(e){return typeof e=="boolean"}var nme=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let l=new V6;return n&&(tme(n)?l.push(Xpe):l.push(Jpe(n.extraArgument))),l},Q6="RTK_autoBatch",rn=()=>e=>({payload:e,meta:{[Q6]:!0}}),dD=e=>t=>{setTimeout(t,e)},W6=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,l=!1;const c=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:dD(10):e.type==="callback"?e.queueNotification:dD(e.timeout),f=()=>{l=!1,a&&(a=!1,c.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const m=()=>i&&p(),y=r.subscribe(m);return c.add(p),()=>{y(),c.delete(p)}},dispatch(p){try{return i=!p?.meta?.[Q6],a=!i,a&&(l||(l=!0,d(f))),r.dispatch(p)}finally{i=!0}}})},rme=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new V6(e);return r&&i.push(W6(typeof r=="object"?r:void 0)),i};function ime(e){const t=nme(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:l=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(_C(n))c=R6(n);else throw new Error(ki(1));let d;typeof r=="function"?d=r(t):d=t();let f=Cy;i&&(f=eme({trace:!1,...typeof i=="object"&&i}));const p=Mpe(...d),m=rme(p);let y=typeof l=="function"?l(m):m();const v=f(...y);return P6(c,a,v)}function Y6(e){const t={},n=[];let r;const i={addCase(a,l){const c=typeof a=="string"?a:a.type;if(!c)throw new Error(ki(28));if(c in t)throw new Error(ki(29));return t[c]=l,i},addAsyncThunk(a,l){return l.pending&&(t[a.pending.type]=l.pending),l.rejected&&(t[a.rejected.type]=l.rejected),l.fulfilled&&(t[a.fulfilled.type]=l.fulfilled),l.settled&&n.push({matcher:a.settled,reducer:l.settled}),i},addMatcher(a,l){return n.push({matcher:a,reducer:l}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function ame(e){return typeof e=="function"}function sme(e,t){let[n,r,i]=Y6(t),a;if(ame(e))a=()=>uD(e());else{const c=uD(e);a=()=>c}function l(c=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(Os(p)){const v=m(p,d);return v===void 0?p:v}else{if(ga(p))return K6(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},c)}return l.getInitialState=a,l}var ome="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",lme=(e=21)=>{let t="",n=e;for(;n--;)t+=ome[Math.random()*64|0];return t},cme=Symbol.for("rtk-slice-createasyncthunk");function ume(e,t){return`${e}/${t}`}function dme({creators:e}={}){const t=e?.asyncThunk?.[cme];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(ki(11));const l=(typeof r.reducers=="function"?r.reducers(hme()):r.reducers)||{},c=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(O,C){const z=typeof O=="string"?O:O.type;if(!z)throw new Error(ki(12));if(z in d.sliceCaseReducersByType)throw new Error(ki(13));return d.sliceCaseReducersByType[z]=C,f},addMatcher(O,C){return d.sliceMatchers.push({matcher:O,reducer:C}),f},exposeAction(O,C){return d.actionCreators[O]=C,f},exposeCaseReducer(O,C){return d.sliceCaseReducersByName[O]=C,f}};c.forEach(O=>{const C=l[O],z={reducerName:O,type:ume(i,O),createNotation:typeof r.reducers=="function"};mme(C)?yme(z,C,f,t):pme(z,C,f)});function p(){const[O={},C=[],z=void 0]=typeof r.extraReducers=="function"?Y6(r.extraReducers):[r.extraReducers],A={...O,...d.sliceCaseReducersByType};return sme(r.initialState,_=>{for(let R in A)_.addCase(R,A[R]);for(let R of d.sliceMatchers)_.addMatcher(R.matcher,R.reducer);for(let R of C)_.addMatcher(R.matcher,R.reducer);z&&_.addDefaultCase(z)})}const m=O=>O,y=new Map,v=new WeakMap;let w;function b(O,C){return w||(w=p()),w(O,C)}function j(){return w||(w=p()),w.getInitialState()}function k(O,C=!1){function z(_){let R=_[O];return typeof R>"u"&&C&&(R=ug(v,z,j)),R}function A(_=m){const R=ug(y,C,()=>new WeakMap);return ug(R,_,()=>{const $={};for(const[F,q]of Object.entries(r.selectors??{}))$[F]=fme(q,_,()=>ug(v,_,j),C);return $})}return{reducerPath:O,getSelectors:A,get selectors(){return A(z)},selectSlice:z}}const E={name:i,reducer:b,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:j,...k(a),injectInto(O,{reducerPath:C,...z}={}){const A=C??a;return O.inject({reducerPath:A,reducer:b},z),{...E,...k(A,!0)}}};return E}}function fme(e,t,n,r){function i(a,...l){let c=t(a);return typeof c>"u"&&r&&(c=n()),e(c,...l)}return i.unwrapped=e,i}var Dr=dme();function hme(){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 pme({type:e,reducerName:t,createNotation:n},r,i){let a,l;if("reducer"in r){if(n&&!gme(r))throw new Error(ki(17));a=r.reducer,l=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,l?Ci(e,l):Ci(e))}function mme(e){return e._reducerDefinitionType==="asyncThunk"}function gme(e){return e._reducerDefinitionType==="reducerWithPrepare"}function yme({type:e,reducerName:t},n,r,i){if(!i)throw new Error(ki(18));const{payloadCreator:a,fulfilled:l,pending:c,rejected:d,settled:f,options:p}=n,m=i(e,a,p);r.exposeAction(t,m),l&&r.addCase(m.fulfilled,l),c&&r.addCase(m.pending,c),d&&r.addCase(m.rejected,d),f&&r.addMatcher(m.settled,f),r.exposeCaseReducer(t,{fulfilled:l||dg,pending:c||dg,rejected:d||dg,settled:f||dg})}function dg(){}var vme="task",Z6="listener",X6="completed",RC="cancelled",xme=`task-${RC}`,bme=`task-${X6}`,tN=`${Z6}-${RC}`,wme=`${Z6}-${X6}`,w0=class{constructor(e){this.code=e,this.message=`${vme} ${RC} (reason: ${e})`}name="TaskAbortError";message},DC=(e,t)=>{if(typeof e!="function")throw new TypeError(ki(32))},Py=()=>{},J6=(e,t=Py)=>(e.catch(t),e),eU=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),ql=e=>{if(e.aborted)throw new w0(e.reason)};function tU(e,t){let n=Py;return new Promise((r,i)=>{const a=()=>i(new w0(e.reason));if(e.aborted){a();return}n=eU(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Py})}var Sme=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof w0?"cancelled":"rejected",error:n}}finally{t?.()}},Ry=e=>t=>J6(tU(e,t).then(n=>(ql(e),n))),nU=e=>{const t=Ry(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Gu}=Object,fD={},S0="listenerMiddleware",jme=(e,t)=>{const n=r=>eU(e,()=>r.abort(e.reason));return(r,i)=>{DC(r);const a=new AbortController;n(a);const l=Sme(async()=>{ql(e),ql(a.signal);const c=await r({pause:Ry(a.signal),delay:nU(a.signal),signal:a.signal});return ql(a.signal),c},()=>a.abort(bme));return i?.autoJoin&&t.push(l.catch(Py)),{result:Ry(e)(l),cancel(){a.abort(xme)}}}},Nme=(e,t)=>{const n=async(r,i)=>{ql(t);let a=()=>{};const c=[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&&c.push(new Promise(d=>setTimeout(d,i,null)));try{const d=await tU(t,Promise.race(c));return ql(t),d}finally{a()}};return(r,i)=>J6(n(r,i))},rU=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Ci(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(ki(21));return DC(a),{predicate:i,type:t,effect:a}},iU=Gu(e=>{const{type:t,predicate:n,effect:r}=rU(e);return{id:lme(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(ki(22))}}},{withTypes:()=>iU}),hD=(e,t)=>{const{type:n,effect:r,predicate:i}=rU(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},nN=e=>{e.pending.forEach(t=>{t.abort(tN)})},kme=(e,t)=>()=>{for(const n of t.keys())nN(n);e.clear()},pD=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},aU=Gu(Ci(`${S0}/add`),{withTypes:()=>aU}),Cme=Ci(`${S0}/removeAll`),sU=Gu(Ci(`${S0}/remove`),{withTypes:()=>sU}),Ame=(...e)=>{console.error(`${S0}/error`,...e)},op=(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:l=Ame}=e;DC(l);const c=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),w=>{v.unsubscribe(),w?.cancelActive&&nN(v)}),d=v=>{const w=hD(t,v)??iU(v);return c(w)};Gu(d,{withTypes:()=>d});const f=v=>{const w=hD(t,v);return w&&(w.unsubscribe(),v.cancelActive&&nN(w)),!!w};Gu(f,{withTypes:()=>f});const p=async(v,w,b,j)=>{const k=new AbortController,E=Nme(d,k.signal),O=[];try{v.pending.add(k),r(v),await Promise.resolve(v.effect(w,Gu({},b,{getOriginalState:j,condition:(C,z)=>E(C,z).then(Boolean),take:E,delay:nU(k.signal),pause:Ry(k.signal),extra:a,signal:k.signal,fork:jme(k.signal,O),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((C,z,A)=>{C!==k&&(C.abort(tN),A.delete(C))})},cancel:()=>{k.abort(tN),v.pending.delete(k)},throwIfCancelled:()=>{ql(k.signal)}})))}catch(C){C instanceof w0||pD(l,C,{raisedBy:"effect"})}finally{await Promise.all(O),k.abort(wme),i(v),v.pending.delete(k)}},m=kme(t,n);return{middleware:v=>w=>b=>{if(!D6(b))return w(b);if(aU.match(b))return d(b.payload);if(Cme.match(b)){m();return}if(sU.match(b))return f(b.payload);let j=v.getState();const k=()=>{if(j===fD)throw new Error(ki(23));return j};let E;try{if(E=w(b),t.size>0){const O=v.getState(),C=Array.from(t.values());for(const z of C){let A=!1;try{A=z.predicate(b,O,j)}catch(_){A=!1,pD(l,_,{raisedBy:"predicate"})}A&&p(z,b,v,k)}}}finally{j=fD}return E},startListening:d,stopListening:f,clearListeners:m}};function ki(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 Eme={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},oU=Dr({name:"chartLayout",initialState:Eme,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:Ome,setLayout:_me,setChartSize:zme,setScale:Tme}=oU.actions,Pme=oU.reducer;function lU(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 Ha(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function mD(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?mD(Object(n),!0).forEach(function(r){Rme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rme(e,t,n){return(t=Dme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dme(e){var t=Ime(e,"string");return typeof t=="symbol"?t:t+""}function Ime(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 En(e,t,n){return pn(e)||pn(t)?n:Fa(t)?id(e,t,n):typeof t=="function"?t(e):n}var Mme=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:l,layout:c}=t;if((c==="vertical"||c==="horizontal"&&l==="middle")&&a!=="center"&&Re(e[a]))return Du(Du({},e),{},{[a]:e[a]+(r||0)});if((c==="horizontal"||c==="vertical"&&a==="center")&&l!=="middle"&&Re(e[l]))return Du(Du({},e),{},{[l]:e[l]+(i||0)})}return e},Qa=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",cU=(e,t,n,r)=>{if(r)return e.map(c=>c.coordinate);var i,a,l=e.map(c=>(c.coordinate===t&&(i=!0),c.coordinate===n&&(a=!0),c.coordinate));return i||l.push(t),a||l.push(n),l},uU=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:l,realScaleType:c,isCategorical:d,categoricalDomain:f,tickCount:p,ticks:m,niceTicks:y,axisType:v}=e;if(!l)return null;var w=c==="scaleBand"&&l.bandwidth?l.bandwidth()/2:2,b=i==="category"&&l.bandwidth?l.bandwidth()/w:0;if(b=v==="angleAxis"&&a&&a.length>=2?ai(a[0]-a[1])*2*b:b,m||y){var j=(m||y||[]).map((k,E)=>{var O=r?r.indexOf(k):k,C=l.map(O);return gt(C)?{coordinate:C+b,value:k,offset:b,index:E}:null}).filter(si);return j}return d&&f?f.map((k,E)=>{var O=l.map(k);return gt(O)?{coordinate:O+b,value:k,index:E,offset:b}:null}).filter(si):l.ticks&&p!=null?l.ticks(p).map((k,E)=>{var O=l.map(k);return gt(O)?{coordinate:O+b,value:k,index:E,offset:b}:null}).filter(si):l.domain().map((k,E)=>{var O=l.map(k);return gt(O)?{coordinate:O+b,value:r?r[k]:k,index:E,offset:b}:null}).filter(si)},Lme=(e,t)=>{if(!t||t.length!==2||!Re(t[0])||!Re(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(!Re(e[0])||e[0]<n)&&(i[0]=n),(!Re(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},$me=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,l=0,c=0;c<n;++c){var d=e[c],f=d?.[i];if(f!=null){var p=f[1],m=f[0],y=pa(p)?m:p;y>=0?(f[0]=a,a+=y,f[1]=a):(f[0]=l,l+=y,f[1]=l)}}}},Bme=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,l=0;l<n;++l){var c=e[l],d=c?.[i];if(d!=null){var f=pa(d[1])?d[0]:d[1];f>=0?(d[0]=a,a+=f,d[1]=a):(d[0]=0,d[1]=0)}}}},Ume={sign:$me,expand:fhe,none:tc,silhouette:hhe,wiggle:phe,positive:Bme},qme=(e,t,n)=>{var r,i=(r=Ume[n])!==null&&r!==void 0?r:tc,a=dhe().keys(t).value((c,d)=>Number(En(c,d,0))).order(K1).offset(i),l=a(e);return l.forEach((c,d)=>{c.forEach((f,p)=>{var m=En(e[p],t[d],0);Array.isArray(m)&&m.length===2&&Re(m[0])&&Re(m[1])&&(f[0]=m[0],f[1]=m[1])})}),l};function dU(e){return e==null?void 0:String(e)}function gD(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:l}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!pn(i[t.dataKey])){var c=p6(n,"value",i[t.dataKey]);if(c)return c.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var d=En(i,pn(l)?t.dataKey:l),f=t.scale.map(d);return Re(f)?f:null}var yD=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:l}=e;if(t.type==="category")return n[l]?n[l].coordinate+r:null;var c=En(a,t.dataKey,t.scale.domain()[l]);if(pn(c))return null;var d=t.scale.map(c);return Re(d)?d-i/2+r:null},Fme=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]},Hme=e=>{var t=e.flat(2).filter(Re);return[Math.min(...t),Math.max(...t)]},Kme=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Gme=(e,t,n)=>{if(e!=null)return Kme(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:l}=a,c=l.reduce((d,f)=>{var p=lU(f,t,n),m=Hme(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(c[0],r[0]),Math.max(c[1],r[1])]},[1/0,-1/0]))},vD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,xD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,sd=(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=h0(t,p=>p.coordinate),a=1/0,l=1,c=i.length;l<c;l++){var d=i[l],f=i[l-1];a=Math.min((d?.coordinate||0)-(f?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function bD(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Du(Du({},t),{},{dataKey:n,payload:r,value:i,name:a})}function j0(e,t){if(e)return String(e);if(typeof t=="string")return t}var Vme=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Qme=(e,t)=>t==="centric"?e.angle:e.radius,Ds=e=>e.layout.width,Is=e=>e.layout.height,Wme=e=>e.layout.scale,fU=e=>e.layout.margin,N0=le(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),k0=le(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Yme="data-recharts-item-index",Zme="data-recharts-item-id",lp=60;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 fg(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){Xme(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 Xme(e,t,n){return(t=Jme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jme(e){var t=ege(e,"string");return typeof t=="symbol"?t:t+""}function ege(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 tge=e=>e.brush.height;function nge(e){var t=k0(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:lp;return n+i}return n},0)}function rge(e){var t=k0(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:lp;return n+i}return n},0)}function ige(e){var t=N0(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function age(e){var t=N0(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Jn=le([Ds,Is,fU,tge,nge,rge,ige,age,z6,_pe],(e,t,n,r,i,a,l,c,d,f)=>{var p={left:(n.left||0)+i,right:(n.right||0)+a},m={top:(n.top||0)+l,bottom:(n.bottom||0)+c},y=fg(fg({},m),p),v=y.bottom;y.bottom+=r,y=Mme(y,d,f);var w=e-y.left-y.right,b=t-y.top-y.bottom;return fg(fg({brushBottom:v},y),{},{width:Math.max(w,0),height:Math.max(b,0)})}),sge=le(Jn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),IC=le(Ds,Is,(e,t)=>({x:0,y:0,width:e,height:t})),oge=x.createContext(null),Ir=()=>x.useContext(oge)!=null,C0=e=>e.brush,A0=le([C0,Jn,fU],(e,t,n)=>({height:e.height,x:Re(e.x)?e.x:t.left,y:Re(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Re(e.width)?e.width:t.width})),sj={},oj={},lj={},SD;function lge(){return SD||(SD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let l,c=null;const d=a!=null&&a.includes("leading"),f=a==null||a.includes("trailing"),p=()=>{c!==null&&(n.apply(l,c),l=void 0,c=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(),l=void 0,c=null},j=()=>{p()},k=function(...E){if(i?.aborted)return;l=this,c=E;const O=y==null;v(),d&&O&&p()};return k.schedule=v,k.cancel=b,k.flush=j,i?.addEventListener("abort",b,{once:!0}),k}e.debounce=t})(lj)),lj}var jD;function cge(){return jD||(jD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lge();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:l=!1,trailing:c=!0,maxWait:d}=a,f=Array(2);l&&(f[0]="leading"),c&&(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})(oj)),oj}var ND;function uge(){return ND||(ND=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cge();function n(r,i=0,a={}){const{leading:l=!0,trailing:c=!0}=a;return t.debounce(r,i,{leading:l,maxWait:i,trailing:c})}e.throttle=n})(sj)),sj}var cj,kD;function dge(){return kD||(kD=1,cj=uge().throttle),cj}var fge=dge();const hge=ya(fge);var Dy=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},Ia={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},hU=(e,t,n)=>{var{width:r=Ia.width,height:i=Ia.height,aspect:a,maxHeight:l}=n,c=nc(r)?e:Number(r),d=nc(i)?t:Number(i);return a&&a>0&&(c?d=c/a:d&&(c=d*a),l&&d!=null&&d>l&&(d=l)),{calculatedWidth:c,calculatedHeight:d}},pge={width:0,height:0,overflow:"visible"},mge={width:0,overflowX:"visible"},gge={height:0,overflowY:"visible"},yge={},vge=e=>{var{width:t,height:n}=e,r=nc(t),i=nc(n);return r&&i?pge:r?mge:i?gge:yge};function xge(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=Ia.width,a=Ia.height):i===void 0?i=r&&r>0?void 0:Ia.width:a===void 0&&(a=r&&r>0?void 0:Ia.height),{width:i,height:a}}function rN(){return rN=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},rN.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 AD(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){bge(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 bge(e,t,n){return(t=wge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wge(e){var t=Sge(e,"string");return typeof t=="symbol"?t:t+""}function Sge(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 pU=x.createContext(Ia.initialDimension);function jge(e){return Ha(e.width)&&Ha(e.height)}function mU(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return jge(i)?x.createElement(pU.Provider,{value:i},t):null}var MC=()=>x.useContext(pU),Nge=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Ia.initialDimension,width:i,height:a,minWidth:l=Ia.minWidth,minHeight:c,maxHeight:d,children:f,debounce:p=Ia.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}),O=x.useCallback((R,$)=>{E(F=>{var q=Math.round(R),B=Math.round($);return F.containerWidth===q&&F.containerHeight===B?F:{containerWidth:q,containerHeight:B}})},[]);x.useEffect(()=>{if(b.current==null||typeof ResizeObserver>"u")return vc;var R=B=>{var K,X=B[0];if(X!=null){var{width:Q,height:H}=X.contentRect;O(Q,H),(K=j.current)===null||K===void 0||K.call(j,Q,H)}};p>0&&(R=hge(R,p,{trailing:!0,leading:!1}));var $=new ResizeObserver(R),{width:F,height:q}=b.current.getBoundingClientRect();return O(F,q),$.observe(b.current),()=>{$.disconnect()}},[O,p]);var{containerWidth:C,containerHeight:z}=k;Dy(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:A,calculatedHeight:_}=hU(C,z,{width:i,height:a,aspect:n,maxHeight:d});return Dy(A!=null&&A>0||_!=null&&_>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
258
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
259
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
260
|
-
height and width.`,A,_,i,a,l,c,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:l,minHeight:c,maxHeight:d}),ref:b},x.createElement("div",{style:vge({width:i,height:a})},x.createElement(mU,{width:A,height:_},f)))}),Iy=x.forwardRef((e,t)=>{var n=MC();if(Ha(n.width)&&Ha(n.height))return e.children;var{width:r,height:i}=xge({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=hU(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Re(a)&&Re(l)?x.createElement(mU,{width:a,height:l},e.children):x.createElement(Nge,rN({},e,{width:r,height:i,ref:t}))});function LC(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 E0=()=>{var e,t=Ir(),n=Fe(sge),r=Fe(A0),i=(e=Fe(C0))===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}},kge={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},gU=()=>{var e;return(e=Fe(Jn))!==null&&e!==void 0?e:kge},$C=()=>Fe(Ds),BC=()=>Fe(Is),Cge=()=>Fe(e=>e.layout.margin),It=e=>e.layout.layoutType,xc=()=>Fe(It),UC=()=>{var e=xc();if(e==="horizontal"||e==="vertical")return e},yU=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Age=()=>{var e=xc();return e!==void 0},cp=e=>{var t=sn(),n=Ir(),{width:r,height:i}=e,a=MC(),l=r,c=i;return a&&(l=a.width>0?a.width:r,c=a.height>0?a.height:i),x.useEffect(()=>{!n&&Ha(l)&&Ha(c)&&t(zme({width:l,height:c}))},[t,n,l,c]),null},vU=Symbol.for("immer-nothing"),ED=Symbol.for("immer-draftable"),Ai=Symbol.for("immer-state");function fa(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Dh=Object.getPrototypeOf;function od(e){return!!e&&!!e[Ai]}function ic(e){return e?xU(e)||Array.isArray(e)||!!e[ED]||!!e.constructor?.[ED]||up(e)||_0(e):!1}var Ege=Object.prototype.constructor.toString(),OD=new WeakMap;function xU(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===Ege}function My(e,t,n=!0){O0(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 O0(e){const t=e[Ai];return t?t.type_:Array.isArray(e)?1:up(e)?2:_0(e)?3:0}function iN(e,t){return O0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function bU(e,t,n){const r=O0(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Oge(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function up(e){return e instanceof Map}function _0(e){return e instanceof Set}function Cl(e){return e.copy_||e.base_}function aN(e,t){if(up(e))return new Map(e);if(_0(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=xU(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Ai];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],c=r[l];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(r[l]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[l]})}return Object.create(Dh(e),r)}else{const r=Dh(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function qC(e,t=!1){return z0(e)||od(e)||!ic(e)||(O0(e)>1&&Object.defineProperties(e,{set:hg,add:hg,clear:hg,delete:hg}),Object.freeze(e),t&&Object.values(e).forEach(n=>qC(n,!0))),e}function _ge(){fa(2)}var hg={value:_ge};function z0(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var zge={};function ac(e){const t=zge[e];return t||fa(0,e),t}var Ih;function wU(){return Ih}function Tge(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function _D(e,t){t&&(ac("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function sN(e){oN(e),e.drafts_.forEach(Pge),e.drafts_=null}function oN(e){e===Ih&&(Ih=e.parent_)}function zD(e){return Ih=Tge(Ih,e)}function Pge(e){const t=e[Ai];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function TD(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Ai].modified_&&(sN(t),fa(4)),ic(e)&&(e=Ly(t,e),t.parent_||$y(t,e)),t.patches_&&ac("Patches").generateReplacementPatches_(n[Ai].base_,e,t.patches_,t.inversePatches_)):e=Ly(t,n,[]),sN(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==vU?e:void 0}function Ly(e,t,n){if(z0(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Ai];if(!i)return My(t,(a,l)=>PD(e,i,t,a,l,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return $y(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let l=a,c=!1;i.type_===3&&(l=new Set(a),a.clear(),c=!0),My(l,(d,f)=>PD(e,i,a,d,f,n,c),r),$y(e,a,!1),n&&e.patches_&&ac("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function PD(e,t,n,r,i,a,l){if(i==null||typeof i!="object"&&!l)return;const c=z0(i);if(!(c&&!l)){if(od(i)){const d=a&&t&&t.type_!==3&&!iN(t.assigned_,r)?a.concat(r):void 0,f=Ly(e,i,d);if(bU(n,r,f),od(f))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(ic(i)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&c)return;Ly(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(up(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&$y(e,i)}}}function $y(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&qC(t,n)}function Rge(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:wU(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=FC;n&&(i=[r],a=Mh);const{revoke:l,proxy:c}=Proxy.revocable(i,a);return r.draft_=c,r.revoke_=l,c}var FC={get(e,t){if(t===Ai)return e;const n=Cl(e);if(!iN(n,t))return Dge(e,n,t);const r=n[t];return e.finalized_||!ic(r)?r:r===uj(e.base_,t)?(dj(e),e.copy_[t]=cN(r,e)):r},has(e,t){return t in Cl(e)},ownKeys(e){return Reflect.ownKeys(Cl(e))},set(e,t,n){const r=SU(Cl(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=uj(Cl(e),t),a=i?.[Ai];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Oge(n,i)&&(n!==void 0||iN(e.base_,t)))return!0;dj(e),lN(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 uj(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,dj(e),lN(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Cl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){fa(11)},getPrototypeOf(e){return Dh(e.base_)},setPrototypeOf(){fa(12)}},Mh={};My(FC,(e,t)=>{Mh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Mh.deleteProperty=function(e,t){return Mh.set.call(this,e,t,void 0)};Mh.set=function(e,t,n){return FC.set.call(this,e[0],t,n,e[0])};function uj(e,t){const n=e[Ai];return(n?Cl(n):e)[t]}function Dge(e,t,n){const r=SU(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function SU(e,t){if(!(t in e))return;let n=Dh(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Dh(n)}}function lN(e){e.modified_||(e.modified_=!0,e.parent_&&lN(e.parent_))}function dj(e){e.copy_||(e.copy_=aN(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ige=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const l=this;return function(d=a,...f){return l.produce(d,p=>n.call(this,p,...f))}}typeof n!="function"&&fa(6),r!==void 0&&typeof r!="function"&&fa(7);let i;if(ic(t)){const a=zD(this),l=cN(t,void 0);let c=!0;try{i=n(l),c=!1}finally{c?sN(a):oN(a)}return _D(a,r),TD(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===vU&&(i=void 0),this.autoFreeze_&&qC(i,!0),r){const a=[],l=[];ac("Patches").generateReplacementPatches_(t,i,a,l),r(a,l)}return i}else fa(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...c)=>this.produceWithPatches(l,d=>t(d,...c));let r,i;return[this.produce(t,n,(l,c)=>{r=l,i=c}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ic(e)||fa(8),od(e)&&(e=Mge(e));const t=zD(this),n=cN(e,void 0);return n[Ai].isManual_=!0,oN(t),n}finishDraft(e,t){const n=e&&e[Ai];(!n||!n.isManual_)&&fa(9);const{scope_:r}=n;return _D(r,t),TD(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=ac("Patches").applyPatches_;return od(e)?r(e,t):this.produce(e,i=>r(i,t))}};function cN(e,t){const n=up(e)?ac("MapSet").proxyMap_(e,t):_0(e)?ac("MapSet").proxySet_(e,t):Rge(e,t);return(t?t.scope_:wU()).drafts_.push(n),n}function Mge(e){return od(e)||fa(10,e),jU(e)}function jU(e){if(!ic(e)||z0(e))return e;const t=e[Ai];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=aN(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=aN(e,!0);return My(n,(i,a)=>{bU(n,i,jU(a))},r),t&&(t.finalized_=!1),n}var Lge=new Ige;Lge.produce;var $ge={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},NU=Dr({name:"legend",initialState:$ge,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=Ki(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:rn()},removeLegendPayload:{reducer(e,t){var n=Ki(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:rn()}}}),{setLegendSize:RD,setLegendSettings:Bge,addLegendPayload:Uge,replaceLegendPayload:qge,removeLegendPayload:Fge}=NU.actions,Hge=NU.reducer,fj={exports:{}},hj={};var DD;function Kge(){if(DD)return hj;DD=1;var e=gd();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,l=e.useMemo,c=e.useDebugValue;return hj.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=l(function(){function j(z){if(!k){if(k=!0,E=z,z=m(z),y!==void 0&&w.hasValue){var A=w.value;if(y(A,z))return O=A}return O=z}if(A=O,n(E,z))return A;var _=m(z);return y!==void 0&&y(A,_)?(E=z,A):(E=z,O=_)}var k=!1,E,O,C=p===void 0?null:p;return[function(){return j(f())},C===null?void 0:function(){return j(C())}]},[f,p,m,y]);var b=r(d,v[0],v[1]);return a(function(){w.hasValue=!0,w.value=b},[b]),c(b),b},hj}var ID;function Gge(){return ID||(ID=1,fj.exports=Kge()),fj.exports}Gge();function Vge(e){e()}function Qge(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Vge(()=>{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 Wge(e,t){let n,r=MD,i=0,a=!1;function l(b){p();const j=r.subscribe(b);let k=!1;return()=>{k||(k=!0,j(),m())}}function c(){r.notify()}function d(){w.onStateChange&&w.onStateChange()}function f(){return a}function p(){i++,n||(n=e.subscribe(d),r=Qge())}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:l,notifyNestedSubs:c,handleChangeWrapper:d,isSubscribed:f,trySubscribe:y,tryUnsubscribe:v,getListeners:()=>r};return w}var Yge=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zge=Yge(),Xge=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Jge=Xge(),eye=()=>Zge||Jge?x.useLayoutEffect:x.useEffect,tye=eye();function LD(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function nye(e,t){if(LD(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])||!LD(e[n[i]],t[n[i]]))return!1;return!0}var rye=Symbol.for("react-redux-context"),iye=typeof globalThis<"u"?globalThis:{};function aye(){if(!x.createContext)return{};const e=iye[rye]??=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var sye=aye();function oye(e){const{children:t,context:n,serverState:r,store:i}=e,a=x.useMemo(()=>{const d=Wge(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),l=x.useMemo(()=>i.getState(),[i]);tye(()=>{const{subscription:d}=a;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),l!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[a,l]);const c=n||sye;return x.createElement(c.Provider,{value:a},t)}var lye=oye,cye=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function uye(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Ad(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(cye.has(r)){if(e[r]==null&&t[r]==null)continue;if(!nye(e[r],t[r]))return!1}else if(!uye(e[r],t[r]))return!1;return!0}var dye=["contextPayload"];function uN(){return uN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uN.apply(null,arguments)}function $D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ld(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$D(Object(n),!0).forEach(function(r){fye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$D(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fye(e,t,n){return(t=hye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hye(e){var t=pye(e,"string");return typeof t=="symbol"?t:t+""}function pye(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 mye(e,t){if(e==null)return{};var n,r,i=gye(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 gye(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 yye(e){return e.value}function vye(e){var{contextPayload:t}=e,n=mye(e,dye),r=A6(t,e.payloadUniqBy,yye),i=ld(ld({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content=="function"?x.createElement(e.content,i):x.createElement(Fhe,i)}function xye(e,t,n,r,i,a){var{layout:l,align:c,verticalAlign:d}=t,f,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(c==="center"&&l==="vertical"?f={left:((r||0)-a.width)/2}:f=c==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(d==="middle"?p={top:((i||0)-a.height)/2}:p=d==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),ld(ld({},f),p)}function bye(e){var t=sn();return x.useEffect(()=>{t(Bge(e))},[t,e]),null}function wye(e){var t=sn();return x.useEffect(()=>(t(RD(e)),()=>{t(RD({width:0,height:0}))}),[t,e]),null}function Sye(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var jye={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Nye(e){var t=Rr(e,jye),n=Ppe(),r=Dfe(),i=Cge(),{width:a,height:l,wrapperStyle:c,portal:d}=t,[f,p]=T6([n]),m=$C(),y=BC();if(m==null||y==null)return null;var v=m-(i?.left||0)-(i?.right||0),w=Sye(t.layout,l,a,v),b=d?c:ld(ld({position:"absolute",width:w?.width||a||"auto",height:w?.height||l||"auto"},xye(c,t,i,m,y,f)),c),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(bye,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&x.createElement(wye,{width:f.width,height:f.height}),x.createElement(vye,uN({},t,w,{margin:i,chartWidth:m,chartHeight:y,contextPayload:n})));return dc.createPortal(k,j)}var kU=x.memo(Nye,Ad);kU.displayName="Legend";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 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 Bf(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){kye(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 kye(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=Aye(e,"string");return typeof t=="symbol"?t:t+""}function Aye(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 Eye(e){return Array.isArray(e)&&Fa(e[0])&&Fa(e[1])?e.join(" ~ "):e}var yu={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 Oye(e,t){return t==null?e:h0(e,t)}var _ye=e=>{var{separator:t=yu.separator,contentStyle:n,itemStyle:r,labelStyle:i=yu.labelStyle,payload:a,formatter:l,itemSorter:c,wrapperClassName:d,labelClassName:f,label:p,labelFormatter:m,accessibilityLayer:y=yu.accessibilityLayer}=e,v=()=>{if(a&&a.length){var z={padding:0,margin:0},A=Oye(a,c),_=A.map((R,$)=>{if(!R||R.type==="none")return null;var F=R.formatter||l||Eye,{value:q,name:B}=R,K=q,X=B;if(F){var Q=F(q,B,R,$,a);if(Array.isArray(Q))[K,X]=Q;else if(Q!=null)K=Q;else return null}var H=Bf(Bf({},yu.itemStyle),{},{color:R.color||yu.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat($),style:H},Fa(X)?x.createElement("span",{className:"recharts-tooltip-item-name"},X):null,Fa(X)?x.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,x.createElement("span",{className:"recharts-tooltip-item-value"},K),x.createElement("span",{className:"recharts-tooltip-item-unit"},R.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:z},_)}return null},w=Bf(Bf({},yu.contentStyle),n),b=Bf({margin:0},i),j=!pn(p),k=j?p:"",E=Rt("recharts-default-tooltip",d),O=Rt("recharts-tooltip-label",f);j&&m&&a!==void 0&&a!==null&&(k=m(p,a));var C=y?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",dN({className:E,style:w},C),x.createElement("p",{className:O,style:b},x.isValidElement(k)?k:"".concat(k)),v())},Uf="recharts-tooltip-wrapper",zye={visibility:"hidden"};function Tye(e){var{coordinate:t,translateX:n,translateY:r}=e;return Rt(Uf,{["".concat(Uf,"-right")]:Re(n)&&t&&Re(t.x)&&n>=t.x,["".concat(Uf,"-left")]:Re(n)&&t&&Re(t.x)&&n<t.x,["".concat(Uf,"-bottom")]:Re(r)&&t&&Re(t.y)&&r>=t.y,["".concat(Uf,"-top")]:Re(r)&&t&&Re(t.y)&&r<t.y})}function UD(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:l,tooltipDimension:c,viewBox:d,viewBoxDimension:f}=e;if(a&&Re(a[r]))return a[r];var p=n[r]-c-(i>0?i:0),m=n[r]+i;if(t[r])return l[r]?p:m;var y=d[r];if(y==null)return 0;if(l[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+c,j=y+f;return b>j?Math.max(p,y):Math.max(m,y)}function Pye(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 Rye(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:l,tooltipBox:c,useTranslate3d:d,viewBox:f}=e,p,m,y;return c.height>0&&c.width>0&&n?(m=UD({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:l,tooltipDimension:c.width,viewBox:f,viewBoxDimension:f.width}),y=UD({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:l,tooltipDimension:c.height,viewBox:f,viewBoxDimension:f.height}),p=Pye({translateX:m,translateY:y,useTranslate3d:d})):p=zye,{cssProperties:p,cssClasses:Tye({translateX:m,translateY:y,coordinate:n})}}var Dye=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),dp={isSsr:Dye()};function CU(){var[e,t]=x.useState(()=>dp.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 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 vu(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){Iye(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 Iye(e,t,n){return(t=Mye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mye(e){var t=Lye(e,"string");return typeof t=="symbol"?t:t+""}function Lye(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 $ye(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function Bye(e){var t,n,r,i,a,l,c=CU(),[d,f]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var w=b=>{if(b.key==="Escape"){var j,k,E,O;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=(O=e.coordinate)===null||O===void 0?void 0:O.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=(l=e.coordinate)===null||l===void 0?void 0:l.y)!==null&&a!==void 0?a:0)!==d.dismissedAtCoordinate.y)&&f(vu(vu({},d),{},{dismissed:!1}));var{cssClasses:p,cssProperties:m}=Rye({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?{}:vu(vu({transition:$ye({prefersReducedMotion:c,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},m),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=vu(vu({},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 Uye=x.memo(Bye),AU=()=>{var e;return(e=Fe(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function fN(){return fN=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},fN.apply(null,arguments)}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){qye(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 qye(e,t,n){return(t=Fye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fye(e){var t=Hye(e,"string");return typeof t=="symbol"?t:t+""}function Hye(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 KD={curveBasisClosed:ehe,curveBasisOpen:the,curveBasis:Jfe,curveBumpX:$fe,curveBumpY:Bfe,curveLinearClosed:nhe,curveLinear:u0,curveMonotoneX:rhe,curveMonotoneY:ihe,curveNatural:ahe,curveStep:she,curveStepAfter:lhe,curveStepBefore:ohe},By=e=>gt(e.x)&>(e.y),GD=e=>e.base!=null&&By(e.base)&&By(e),qf=e=>e.x,Ff=e=>e.y,Kye=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(ap(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=KD["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return KD[n]||u0},VD={connectNulls:!1,type:"linear"},Gye=e=>{var{type:t=VD.type,points:n=[],baseLine:r,layout:i,connectNulls:a=VD.connectNulls}=e,l=Kye(t,i),c=a?n.filter(By):n;if(Array.isArray(r)){var d,f=n.map((w,b)=>HD(HD({},w),{},{base:r[b]}));i==="vertical"?d=sg().y(Ff).x1(qf).x0(w=>w.base.x):d=sg().x(qf).y1(Ff).y0(w=>w.base.y);var p=d.defined(GD).curve(l),m=a?f.filter(GD):f;return p(m)}var y;i==="vertical"&&Re(r)?y=sg().y(Ff).x1(qf).x0(r):Re(r)?y=sg().x(qf).y1(Ff).y0(r):y=t6().x(qf).y(Ff);var v=y.defined(By).curve(l);return v(c)},hh=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=xc();if((!n||!n.length)&&!r)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},c=n&&n.length?Gye(l):r;return x.createElement("path",fN({},Wi(e),AC(e),{className:Rt("recharts-curve",t),d:c===null?void 0:c,ref:i}))},Vye=["x","y","top","left","width","height","className"];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 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 Qye(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){Wye(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 Wye(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=Zye(e,"string");return typeof t=="symbol"?t:t+""}function Zye(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 Xye(e,t){if(e==null)return{};var n,r,i=Jye(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 Jye(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 eve=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),tve=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:l=0,className:c}=e,d=Xye(e,Vye),f=Qye({x:t,y:n,top:r,left:i,width:a,height:l},d);return!Re(t)||!Re(n)||!Re(a)||!Re(l)||!Re(r)||!Re(i)?null:x.createElement("path",hN({},Gr(f),{className:Rt("recharts-cross",c),d:eve(t,n,a,l,r,i)}))};function nve(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 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 YD(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){rve(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 rve(e,t,n){return(t=ive(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ive(e){var t=ave(e,"string");return typeof t=="symbol"?t:t+""}function ave(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 sve=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),EU=(e,t,n)=>e.map(r=>"".concat(sve(r)," ").concat(t,"ms ").concat(n)).join(","),ove=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Lh=(e,t)=>Object.keys(t).reduce((n,r)=>YD(YD({},n),{},{[r]:e(r,t[r])}),{});function ZD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZD(Object(n),!0).forEach(function(r){lve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lve(e,t,n){return(t=cve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cve(e){var t=uve(e,"string");return typeof t=="symbol"?t:t+""}function uve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Uy=(e,t,n)=>e+(t-e)*n,pN=e=>{var{from:t,to:n}=e;return t!==n},OU=(e,t,n)=>{var r=Lh((i,a)=>{if(pN(a)){var[l,c]=e(a.from,a.to,a.velocity);return Gn(Gn({},a),{},{from:l,velocity:c})}return a},t);return n<1?Lh((i,a)=>pN(a)&&r[i]!=null?Gn(Gn({},a),{},{velocity:Uy(a.velocity,r[i].velocity,n),from:Uy(a.from,r[i].from,n)}):a,t):OU(e,r,n-1)};function dve(e,t,n,r,i,a){var l,c=r.reduce((y,v)=>Gn(Gn({},y),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),d=()=>Lh((y,v)=>v.from,c),f=()=>!Object.values(c).filter(pN).length,p=null,m=y=>{l||(l=y);var v=y-l,w=v/n.dt;c=OU(n,c,w),i(Gn(Gn(Gn({},e),t),d())),l=y,f()||(p=a.setTimeout(m))};return()=>(p=a.setTimeout(m),()=>{var y;(y=p)===null||y===void 0||y()})}function fve(e,t,n,r,i,a,l){var c=null,d=i.reduce((m,y)=>{var v=e[y],w=t[y];return v==null||w==null?m:Gn(Gn({},m),{},{[y]:[v,w]})},{}),f,p=m=>{f||(f=m);var y=(m-f)/r,v=Lh((b,j)=>Uy(...j,n(y)),d);if(a(Gn(Gn(Gn({},e),t),v)),y<1)c=l.setTimeout(p);else{var w=Lh((b,j)=>Uy(...j,n(1)),d);a(Gn(Gn(Gn({},e),t),w))}};return()=>(c=l.setTimeout(p),()=>{var m;(m=c)===null||m===void 0||m()})}const hve=(e,t,n,r,i,a)=>{var l=ove(e,t);return n==null?()=>(i(Gn(Gn({},e),t)),()=>{}):n.isStepper===!0?dve(e,t,n,l,i,a):fve(e,t,n,r,l,i,a)};var qy=1e-4,_U=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],zU=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),XD=(e,t)=>n=>{var r=_U(e,t);return zU(r,n)},pve=(e,t)=>n=>{var r=_U(e,t),i=[...r.map((a,l)=>a*l).slice(1),0];return zU(i,n)},mve=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]]},gve=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=mve(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},yve=(e,t,n,r)=>{var i=XD(e,n),a=XD(t,r),l=pve(e,n),c=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=l(m);if(Math.abs(v-p)<qy||w<qy)return a(m);m=c(m-v/w)}return a(m)};return d.isStepper=!1,d},JD=function(){return yve(...gve(...arguments))},vve=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(l,c,d)=>{var f=-(l-c)*n,p=d*r,m=d+(f-p)*i/1e3,y=d*i/1e3+l;return Math.abs(y-c)<qy&&Math.abs(m)<qy?[c,0]:[y,m]};return a.isStepper=!0,a.dt=i,a},xve=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return JD(e);case"spring":return vve();default:if(e.split("(")[0]==="cubic-bezier")return JD(e)}return typeof e=="function"?e:null};function bve(e){var t,n=()=>null,r=!1,i=null,a=l=>{if(!r){if(Array.isArray(l)){if(!l.length)return;var c=l,[d,...f]=c;if(typeof d=="number"){i=e.setTimeout(a.bind(null,f),d);return}a(d),i=e.setTimeout(a.bind(null,f));return}typeof l=="string"&&(t=l,n(t)),typeof l=="object"&&(t=l,n(t)),typeof l=="function"&&l()}};return{stop:()=>{r=!0},start:l=>{r=!1,i&&(i(),i=null),a(l)},subscribe:l=>(n=l,()=>{n=()=>null}),getTimeoutController:()=>e}}class wve{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=l=>{l-r>=n?t(l):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function Sve(){return bve(new wve)}var jve=x.createContext(Sve);function Nve(e,t){var n=x.useContext(jve);return x.useMemo(()=>t??n(e),[e,t,n])}var kve={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},eI={t:0},pj={t:1};function T0(e){var t=Rr(e,kve),{isActive:n,canBegin:r,duration:i,easing:a,begin:l,onAnimationEnd:c,onAnimationStart:d,children:f}=t,p=CU(),m=n==="auto"?!dp.isSsr&&!p:n,y=Nve(t.animationId,t.animationManager),[v,w]=x.useState(m?eI:pj),b=x.useRef(null);return x.useEffect(()=>{m||w(pj)},[m]),x.useEffect(()=>{if(!m||!r)return vc;var j=hve(eI,pj,xve(a),i,w,y.getTimeoutController()),k=()=>{b.current=j()};return y.start([d,l,k,i,c]),()=>{y.stop(),b.current&&b.current(),c()}},[m,r,i,a,l,d,c,y]),f(v.t)}function P0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(zh(t)),r=x.useRef(e);return r.current!==e&&(n.current=zh(t),r.current=e),n.current}var Cve=["radius"],Ave=["radius"],tI,nI,rI,iI,aI,sI,oI,lI,cI,uI;function dI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dI(Object(n),!0).forEach(function(r){Eve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eve(e,t,n){return(t=Ove(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ove(e){var t=_ve(e,"string");return typeof t=="symbol"?t:t+""}function _ve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fy(){return Fy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fy.apply(null,arguments)}function hI(e,t){if(e==null)return{};var n,r,i=zve(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 zve(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 Ea(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var pI=(e,t,n,r,i)=>{var a=Oo(n),l=Oo(r),c=Math.min(Math.abs(a)/2,Math.abs(l)/2),d=l>=0?1:-1,f=a>=0?1:-1,p=l>=0&&a>=0||l<0&&a<0?1:0,m;if(c>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>c?c:j}m=wn(tI||(tI=Ea(["M",",",""])),e,t+d*y[0]),y[0]>0&&(m+=wn(nI||(nI=Ea(["A ",",",",0,0,",",",",",""])),y[0],y[0],p,e+f*y[0],t)),m+=wn(rI||(rI=Ea(["L ",",",""])),e+n-f*y[1],t),y[1]>0&&(m+=wn(iI||(iI=Ea(["A ",",",",0,0,",`,
|
|
261
|
-
`,",",""])),y[1],y[1],p,e+n,t+d*y[1])),m+=wn(aI||(aI=Ea(["L ",",",""])),e+n,t+r-d*y[2]),y[2]>0&&(m+=wn(sI||(sI=Ea(["A ",",",",0,0,",`,
|
|
262
|
-
`,",",""])),y[2],y[2],p,e+n-f*y[2],t+r)),m+=wn(oI||(oI=Ea(["L ",",",""])),e+f*y[3],t+r),y[3]>0&&(m+=wn(lI||(lI=Ea(["A ",",",",0,0,",`,
|
|
263
|
-
`,",",""])),y[3],y[3],p,e,t+r-d*y[3])),m+="Z"}else if(c>0&&i===+i&&i>0){var k=Math.min(c,i);m=wn(cI||(cI=Ea(["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=wn(uI||(uI=Ea(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},mI={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},TU=e=>{var t=Rr(e,mI),n=x.useRef(null),[r,i]=x.useState(-1);x.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var J=n.current.getTotalLength();J&&i(J)}catch{}},[]);var{x:a,y:l,width:c,height:d,radius:f,className:p}=t,{animationEasing:m,animationDuration:y,animationBegin:v,isAnimationActive:w,isUpdateAnimationActive:b}=t,j=x.useRef(c),k=x.useRef(d),E=x.useRef(a),O=x.useRef(l),C=x.useMemo(()=>({x:a,y:l,width:c,height:d,radius:f}),[a,l,c,d,f]),z=P0(C,"rectangle-");if(a!==+a||l!==+l||c!==+c||d!==+d||c===0||d===0)return null;var A=Rt("recharts-rectangle",p);if(!b){var _=Gr(t),{radius:R}=_,$=hI(_,Cve);return x.createElement("path",Fy({},$,{x:Oo(a),y:Oo(l),width:Oo(c),height:Oo(d),radius:typeof f=="number"?f:void 0,className:A,d:pI(a,l,c,d,f)}))}var F=j.current,q=k.current,B=E.current,K=O.current,X="0px ".concat(r===-1?1:r,"px"),Q="".concat(r,"px ").concat(r,"px"),H=EU(["strokeDasharray"],y,typeof m=="string"?m:mI.animationEasing);return x.createElement(T0,{animationId:z,key:z,canBegin:r>0,duration:y,easing:m,isActive:b,begin:v},J=>{var de=hn(F,c,J),be=hn(q,d,J),M=hn(B,a,J),D=hn(K,l,J);n.current&&(j.current=de,k.current=be,E.current=M,O.current=D);var U;w?J>0?U={transition:H,strokeDasharray:Q}:U={strokeDasharray:X}:U={strokeDasharray:Q};var I=Gr(t),{radius:V}=I,ce=hI(I,Ave);return x.createElement("path",Fy({},ce,{radius:typeof f=="number"?f:void 0,className:A,d:pI(M,D,de,be,f),ref:n,style:fI(fI({},U),t.style)}))})};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 yI(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){Tve(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 Tve(e,t,n){return(t=Pve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pve(e){var t=Rve(e,"string");return typeof t=="symbol"?t:t+""}function Rve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hy=Math.PI/180,Dve=e=>e*180/Math.PI,gr=(e,t,n,r)=>({x:e+Math.cos(-Hy*r)*n,y:t+Math.sin(-Hy*r)*n}),Ive=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},Mve=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},Lve=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,l=Mve({x:n,y:r},{x:i,y:a});if(l<=0)return{radius:l,angle:0};var c=(n-i)/l,d=Math.acos(c);return r>a&&(d=2*Math.PI-d),{radius:l,angle:Dve(d),angleInRadian:d}},$ve=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}},Bve=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),l=Math.min(i,a);return e+l*360},Uve=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=Lve({x:n,y:r},t),{innerRadius:l,outerRadius:c}=t;if(i<l||i>c||i===0)return null;var{startAngle:d,endAngle:f}=$ve(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?yI(yI({},t),{},{radius:i,angle:Bve(p,t)}):null};function PU(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,l=gr(t,n,r,i),c=gr(t,n,r,a);return{points:[l,c],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var vI,xI,bI,wI,SI,jI,NI;function mN(){return mN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mN.apply(null,arguments)}function Rl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var qve=(e,t)=>{var n=ai(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},pg=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:l,cornerRadius:c,cornerIsExternal:d}=e,f=c*(l?1:-1)+r,p=Math.asin(c/f)/Hy,m=d?i:i+a*p,y=gr(t,n,f,m),v=gr(t,n,r,m),w=d?i-a*p:i,b=gr(t,n,f*Math.cos(p*Hy),w);return{center:y,circleTangency:v,lineTangency:b,theta:p}},RU=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:l}=e,c=qve(a,l),d=a+c,f=gr(t,n,i,a),p=gr(t,n,i,d),m=wn(vI||(vI=Rl(["M ",",",`
|
|
271
|
-
A `,",",`,0,
|
|
272
|
-
`,",",`,
|
|
273
|
-
`,",",`
|
|
274
|
-
`])),f.x,f.y,i,i,+(Math.abs(c)>180),+(a>d),p.x,p.y);if(r>0){var y=gr(t,n,r,a),v=gr(t,n,r,d);m+=wn(xI||(xI=Rl(["L ",",",`
|
|
275
|
-
A `,",",`,0,
|
|
276
|
-
`,",",`,
|
|
277
|
-
`,","," Z"])),v.x,v.y,r,r,+(Math.abs(c)>180),+(a<=d),y.x,y.y)}else m+=wn(bI||(bI=Rl(["L ",","," Z"])),t,n);return m},Fve=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:f}=e,p=ai(f-d),{circleTangency:m,lineTangency:y,theta:v}=pg({cx:t,cy:n,radius:i,angle:d,sign:p,cornerRadius:a,cornerIsExternal:c}),{circleTangency:w,lineTangency:b,theta:j}=pg({cx:t,cy:n,radius:i,angle:f,sign:-p,cornerRadius:a,cornerIsExternal:c}),k=c?Math.abs(d-f):Math.abs(d-f)-v-j;if(k<0)return l?wn(wI||(wI=Rl(["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):RU({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:f});var E=wn(SI||(SI=Rl(["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:O,lineTangency:C,theta:z}=pg({cx:t,cy:n,radius:r,angle:d,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),{circleTangency:A,lineTangency:_,theta:R}=pg({cx:t,cy:n,radius:r,angle:f,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),$=c?Math.abs(d-f):Math.abs(d-f)-z-R;if($<0&&a===0)return"".concat(E,"L").concat(t,",").concat(n,"Z");E+=wn(jI||(jI=Rl(["L",",",`
|
|
285
|
-
A`,",",",0,0,",",",",",`
|
|
286
|
-
A`,",",",0,",",",",",",",`
|
|
287
|
-
A`,",",",0,0,",",",",","Z"])),_.x,_.y,a,a,+(p<0),A.x,A.y,r,r,+($>180),+(p>0),O.x,O.y,a,a,+(p<0),C.x,C.y)}else E+=wn(NI||(NI=Rl(["L",",","Z"])),t,n);return E},Hve={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},DU=e=>{var t=Rr(e,Hve),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:l,forceCornerRadius:c,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=ma(l,v,0,!0),b;return w>0&&Math.abs(f-p)<360?b=Fve({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(w,v/2),forceCornerRadius:c,cornerIsExternal:d,startAngle:f,endAngle:p}):b=RU({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:p}),x.createElement("path",mN({},Gr(t),{className:y,d:b}))};function Kve(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(g6(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:l,angle:c}=t,d=gr(r,i,a,c),f=gr(r,i,l,c);return[{x:d.x,y:d.y},{x:f.x,y:f.y}]}return PU(t)}}var mj={},gj={},yj={},kI;function Gve(){return kI||(kI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=O6();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(yj)),yj}var CI;function Vve(){return CI||(CI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Gve();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})(gj)),gj}var AI;function Qve(){return AI||(AI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_6(),n=Vve();function r(i,a,l){l&&typeof l!="number"&&t.isIterateeCall(i,a,l)&&(a=l=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),l=l===void 0?i<a?1:-1:n.toFinite(l);const c=Math.max(Math.ceil((a-i)/(l||1)),0),d=new Array(c);for(let f=0;f<c;f++)d[f]=i,i+=l;return d}e.range=r})(mj)),mj}var vj,EI;function Wve(){return EI||(EI=1,vj=Qve().range),vj}var Yve=Wve();const IU=ya(Yve);var wa=e=>e.chartData,HC=le([wa],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),R0=(e,t,n,r)=>r?HC(e):wa(e),MU=(e,t,n)=>n?HC(e):wa(e),Zve=le([R0],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});le([HC],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var Xve=le([wa],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function La(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(gt(t)&>(n))return!0}return!1}function OI(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function LU(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 l=[i,a];if(La(l))return l}}function Jve(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(La(r))return OI(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,l,c;if(i==="auto")t!=null&&(l=Math.min(...t));else if(Re(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t?.[0]))}catch{}else if(typeof i=="string"&&vD.test(i)){var d=vD.exec(i);if(d==null||d[1]==null||t==null)l=void 0;else{var f=+d[1];l=t[0]-f}}else l=t?.[0];if(a==="auto")t!=null&&(c=Math.max(...t));else if(Re(a))c=a;else if(typeof a=="function")try{t!=null&&(c=a(t?.[1]))}catch{}else if(typeof a=="string"&&xD.test(a)){var p=xD.exec(a);if(p==null||p[1]==null||t==null)c=void 0;else{var m=+p[1];c=t[1]+m}}else c=t?.[1];var y=[l,c];if(La(y))return t==null?y:OI(y,t,n)}}}var Ed=1e9,e0e={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},GC,un=!0,Yi="[DecimalError] ",Fl=Yi+"Invalid argument: ",KC=Yi+"Exponent out of range: ",Od=Math.floor,Al=Math.pow,t0e=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Si,Zn=1e7,an=7,$U=9007199254740991,Ky=Od($U/an),Ie={};Ie.absoluteValue=Ie.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ie.comparedTo=Ie.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};Ie.decimalPlaces=Ie.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};Ie.dividedBy=Ie.div=function(e){return Cs(this,new this.constructor(e))};Ie.dividedToIntegerBy=Ie.idiv=function(e){var t=this,n=t.constructor;return Qt(Cs(t,new n(e),0,1),n.precision)};Ie.equals=Ie.eq=function(e){return!this.cmp(e)};Ie.exponent=function(){return $n(this)};Ie.greaterThan=Ie.gt=function(e){return this.cmp(e)>0};Ie.greaterThanOrEqualTo=Ie.gte=function(e){return this.cmp(e)>=0};Ie.isInteger=Ie.isint=function(){return this.e>this.d.length-2};Ie.isNegative=Ie.isneg=function(){return this.s<0};Ie.isPositive=Ie.ispos=function(){return this.s>0};Ie.isZero=function(){return this.s===0};Ie.lessThan=Ie.lt=function(e){return this.cmp(e)<0};Ie.lessThanOrEqualTo=Ie.lte=function(e){return this.cmp(e)<1};Ie.logarithm=Ie.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(Si))throw Error(Yi+"NaN");if(n.s<1)throw Error(Yi+(n.s?"NaN":"-Infinity"));return n.eq(Si)?new r(0):(un=!1,t=Cs($h(n,a),$h(e,a),a),un=!0,Qt(t,i))};Ie.minus=Ie.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?qU(t,e):BU(t,(e.s=-e.s,e))};Ie.modulo=Ie.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Yi+"NaN");return n.s?(un=!1,t=Cs(n,e,0,1).times(e),un=!0,n.minus(t)):Qt(new r(n),i)};Ie.naturalExponential=Ie.exp=function(){return UU(this)};Ie.naturalLogarithm=Ie.ln=function(){return $h(this)};Ie.negated=Ie.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ie.plus=Ie.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?BU(t,e):qU(t,(e.s=-e.s,e))};Ie.precision=Ie.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Fl+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};Ie.squareRoot=Ie.sqrt=function(){var e,t,n,r,i,a,l,c=this,d=c.constructor;if(c.s<1){if(!c.s)return new d(0);throw Error(Yi+"NaN")}for(e=$n(c),un=!1,i=Math.sqrt(+c),i==0||i==1/0?(t=Ma(c.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Od((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(i.toString()),n=d.precision,i=l=n+3;;)if(a=r,r=a.plus(Cs(c,a,l+2)).times(.5),Ma(a.d).slice(0,l)===(t=Ma(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(Qt(a,n+1,0),a.times(a).eq(c)){r=a;break}}else if(t!="9999")break;l+=4}return un=!0,Qt(r,n)};Ie.times=Ie.mul=function(e){var t,n,r,i,a,l,c,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,l=d,d=f,f=l),a=[],l=d+f,r=l;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=d+r;i>r;)c=a[i]+v[r]*y[i-r-1]+t,a[i--]=c%Zn|0,t=c/Zn|0;a[i]=(a[i]+t)%Zn|0}for(;!a[--l];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,un?Qt(e,m.precision):e};Ie.toDecimalPlaces=Ie.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ka(e,0,Ed),t===void 0?t=r.rounding:Ka(t,0,8),Qt(n,e+$n(n)+1,t))};Ie.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=sc(r,!0):(Ka(e,0,Ed),t===void 0?t=i.rounding:Ka(t,0,8),r=Qt(new i(r),e+1,t),n=sc(r,!0,e+1)),n};Ie.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?sc(i):(Ka(e,0,Ed),t===void 0?t=a.rounding:Ka(t,0,8),r=Qt(new a(i),e+$n(i)+1,t),n=sc(r.abs(),!1,e+$n(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Ie.toInteger=Ie.toint=function(){var e=this,t=e.constructor;return Qt(new t(e),$n(e)+1,t.rounding)};Ie.toNumber=function(){return+this};Ie.toPower=Ie.pow=function(e){var t,n,r,i,a,l,c=this,d=c.constructor,f=12,p=+(e=new d(e));if(!e.s)return new d(Si);if(c=new d(c),!c.s){if(e.s<1)throw Error(Yi+"Infinity");return c}if(c.eq(Si))return c;if(r=d.precision,e.eq(Si))return Qt(c,r);if(t=e.e,n=e.d.length-1,l=t>=n,a=c.s,l){if((n=p<0?-p:p)<=$U){for(i=new d(Si),t=Math.ceil(r/an+4),un=!1;n%2&&(i=i.times(c),zI(i.d,t)),n=Od(n/2),n!==0;)c=c.times(c),zI(c.d,t);return un=!0,e.s<0?new d(Si).div(i):Qt(i,r)}}else if(a<0)throw Error(Yi+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,un=!1,i=e.times($h(c,r+f)),un=!0,i=UU(i),i.s=a,i};Ie.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=$n(i),r=sc(i,n<=a.toExpNeg||n>=a.toExpPos)):(Ka(e,1,Ed),t===void 0?t=a.rounding:Ka(t,0,8),i=Qt(new a(i),e,t),n=$n(i),r=sc(i,e<=n||n<=a.toExpNeg,e)),r};Ie.toSignificantDigits=Ie.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ka(e,1,Ed),t===void 0?t=r.rounding:Ka(t,0,8)),Qt(new r(n),e,t)};Ie.toString=Ie.valueOf=Ie.val=Ie.toJSON=Ie[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=$n(e),n=e.constructor;return sc(e,t<=n.toExpNeg||t>=n.toExpPos)};function BU(e,t){var n,r,i,a,l,c,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,l=e.e,i=t.e,d=d.slice(),a=l-i,a){for(a<0?(r=d,a=-a,c=f.length):(r=f,i=l,c=d.length),l=Math.ceil(m/an),c=l>c?l+1:c+1,a>c&&(a=c,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(c=d.length,a=f.length,c-a<0&&(a=c,r=f,f=d,d=r),n=0;a;)n=(d[--a]=d[a]+f[a]+n)/Zn|0,d[a]%=Zn;for(n&&(d.unshift(n),++i),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=i,un?Qt(t,m):t}function Ka(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Fl+e)}function Ma(e){var t,n,r,i=e.length-1,a="",l=e[0];if(i>0){for(a+=l,t=1;t<i;t++)r=e[t]+"",n=an-r.length,n&&(a+=So(n)),a+=r;l=e[t],r=l+"",n=an-r.length,n&&(a+=So(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return a+l}var Cs=(function(){function e(r,i){var a,l=0,c=r.length;for(r=r.slice();c--;)a=r[c]*i+l,r[c]=a%Zn|0,l=a/Zn|0;return l&&r.unshift(l),r}function t(r,i,a,l){var c,d;if(a!=l)d=a>l?1:-1;else for(c=d=0;c<a;c++)if(r[c]!=i[c]){d=r[c]>i[c]?1:-1;break}return d}function n(r,i,a){for(var l=0;a--;)r[a]-=l,l=r[a]<i[a]?1:0,r[a]=l*Zn+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,l){var c,d,f,p,m,y,v,w,b,j,k,E,O,C,z,A,_,R,$=r.constructor,F=r.s==i.s?1:-1,q=r.d,B=i.d;if(!r.s)return new $(r);if(!i.s)throw Error(Yi+"Division by zero");for(d=r.e-i.e,_=B.length,z=q.length,v=new $(F),w=v.d=[],f=0;B[f]==(q[f]||0);)++f;if(B[f]>(q[f]||0)&&--d,a==null?E=a=$.precision:l?E=a+($n(r)-$n(i))+1:E=a,E<0)return new $(0);if(E=E/an+2|0,f=0,_==1)for(p=0,B=B[0],E++;(f<z||p)&&E--;f++)O=p*Zn+(q[f]||0),w[f]=O/B|0,p=O%B|0;else{for(p=Zn/(B[0]+1)|0,p>1&&(B=e(B,p),q=e(q,p),_=B.length,z=q.length),C=_,b=q.slice(0,_),j=b.length;j<_;)b[j++]=0;R=B.slice(),R.unshift(0),A=B[0],B[1]>=Zn/2&&++A;do p=0,c=t(B,b,_,j),c<0?(k=b[0],_!=j&&(k=k*Zn+(b[1]||0)),p=k/A|0,p>1?(p>=Zn&&(p=Zn-1),m=e(B,p),y=m.length,j=b.length,c=t(m,b,y,j),c==1&&(p--,n(m,_<y?R:B,y))):(p==0&&(c=p=1),m=B.slice()),y=m.length,y<j&&m.unshift(0),n(b,m,j),c==-1&&(j=b.length,c=t(B,b,_,j),c<1&&(p++,n(b,_<j?R:B,j))),j=b.length):c===0&&(p++,b=[0]),w[f++]=p,c&&b[0]?b[j++]=q[C]||0:(b=[q[C]],j=1);while((C++<z||b[0]!==void 0)&&E--)}return w[0]||w.shift(),v.e=d,Qt(v,l?a+$n(v)+1:a)}})();function UU(e,t){var n,r,i,a,l,c,d=0,f=0,p=e.constructor,m=p.precision;if($n(e)>16)throw Error(KC+$n(e));if(!e.s)return new p(Si);for(un=!1,c=m,l=new p(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(r=Math.log(Al(2,f))/Math.LN10*2+5|0,c+=r,n=i=a=new p(Si),p.precision=c;;){if(i=Qt(i.times(e),c),n=n.times(++d),l=a.plus(Cs(i,n,c)),Ma(l.d).slice(0,c)===Ma(a.d).slice(0,c)){for(;f--;)a=Qt(a.times(a),c);return p.precision=m,t==null?(un=!0,Qt(a,m)):a}a=l}}function $n(e){for(var t=e.e*an,n=e.d[0];n>=10;n/=10)t++;return t}function xj(e,t,n){if(t>e.LN10.sd())throw un=!0,n&&(e.precision=n),Error(Yi+"LN10 precision limit exceeded");return Qt(new e(e.LN10),t)}function So(e){for(var t="";e--;)t+="0";return t}function $h(e,t){var n,r,i,a,l,c,d,f,p,m=1,y=10,v=e,w=v.d,b=v.constructor,j=b.precision;if(v.s<1)throw Error(Yi+(v.s?"NaN":"-Infinity"));if(v.eq(Si))return new b(0);if(t==null?(un=!1,f=j):f=t,v.eq(10))return t==null&&(un=!0),xj(b,f);if(f+=y,b.precision=f,n=Ma(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=Ma(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=xj(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(c=l=v=Cs(v.minus(Si),v.plus(Si),f),p=Qt(v.times(v),f),i=3;;){if(l=Qt(l.times(p),f),d=c.plus(Cs(l,new b(i),f)),Ma(d.d).slice(0,f)===Ma(c.d).slice(0,f))return c=c.times(2),a!==0&&(c=c.plus(xj(b,f+2,j).times(a+""))),c=Cs(c,new b(m),f),b.precision=j,t==null?(un=!0,Qt(c,j)):c;c=d,i+=2}}function _I(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Od(n/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>Ky||e.e<-Ky))throw Error(KC+n)}else e.s=0,e.e=0,e.d=[0];return e}function Qt(e,t,n){var r,i,a,l,c,d,f,p,m=e.d;for(l=1,a=m[0];a>=10;a/=10)l++;if(r=t-l,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],l=1;a>=10;a/=10)l++;r%=an,i=r-an+l}if(n!==void 0&&(a=Al(10,l-i-1),c=f/a%10|0,d=t<0||m[p+1]!==void 0||f%a,d=n<4?(c||d)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||d||n==6&&(r>0?i>0?f/Al(10,l-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]=Al(10,(an-t%an)%an),e.e=Od(-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=Al(10,an-r),m[p]=i>0?(f/Al(10,l-i)%Al(10,i)|0)*a:0),d)for(;;)if(p==0){(m[0]+=a)==Zn&&(m[0]=1,++e.e);break}else{if(m[p]+=a,m[p]!=Zn)break;m[p--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(un&&(e.e>Ky||e.e<-Ky))throw Error(KC+$n(e));return e}function qU(e,t){var n,r,i,a,l,c,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(),l=f-r,l){for(p=l<0,p?(n=d,l=-l,c=m.length):(n=m,r=f,c=d.length),i=Math.max(Math.ceil(v/an),c)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=d.length,c=m.length,p=i<c,p&&(c=i),i=0;i<c;i++)if(d[i]!=m[i]){p=d[i]<m[i];break}l=0}for(p&&(n=d,d=m,m=n,t.s=-t.s),c=d.length,i=m.length-c;i>0;--i)d[c++]=0;for(i=m.length;i>l;){if(d[--i]<m[i]){for(a=i;a&&d[--a]===0;)d[a]=Zn-1;--d[a],d[i]+=Zn}d[i]-=m[i]}for(;d[--c]===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 sc(e,t,n){var r,i=$n(e),a=Ma(e.d),l=a.length;return t?(n&&(r=n-l)>0?a=a.charAt(0)+"."+a.slice(1)+So(r):l>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+So(-i-1)+a,n&&(r=n-l)>0&&(a+=So(r))):i>=l?(a+=So(i+1-l),n&&(r=n-i-1)>0&&(a=a+"."+So(r))):((r=i+1)<l&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(a+="."),a+=So(r))),e.s<0?"-"+a:a}function zI(e,t){if(e.length>t)return e.length=t,!0}function FU(e){var t,n,r;function i(a){var l=this;if(!(l instanceof i))return new i(a);if(l.constructor=i,a instanceof i){l.s=a.s,l.e=a.e,l.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Fl+a);if(a>0)l.s=1;else if(a<0)a=-a,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(a===~~a&&a<1e7){l.e=0,l.d=[a];return}return _I(l,a.toString())}else if(typeof a!="string")throw Error(Fl+a);if(a.charCodeAt(0)===45?(a=a.slice(1),l.s=-1):l.s=1,t0e.test(a))_I(l,a);else throw Error(Fl+a)}if(i.prototype=Ie,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=FU,i.config=i.set=n0e,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 n0e(e){if(!e||typeof e!="object")throw Error(Yi+"Object expected");var t,n,r,i=["precision",1,Ed,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(Od(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Fl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Fl+n+": "+r);return this}var GC=FU(e0e);Si=new GC(1);const At=GC;function HU(e){var t;return e===0?t=1:t=Math.floor(new At(e).abs().log(10).toNumber())+1,t}function KU(e,t,n){for(var r=new At(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var GU=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},VC=(e,t,n)=>{if(e.lte(0))return new At(0);var r=HU(e.toNumber()),i=new At(10).pow(r),a=e.div(i),l=r!==1?.05:.1,c=new At(Math.ceil(a.div(l).toNumber())).add(n).mul(l),d=c.mul(i);return t?new At(d.toNumber()):new At(Math.ceil(d.toNumber()))},VU=(e,t,n)=>{var r;if(e.lte(0))return new At(0);var i=[1,2,2.5,5],a=e.toNumber(),l=Math.floor(new At(a).abs().log(10).toNumber()),c=new At(10).pow(l),d=e.div(c).toNumber(),f=i.findIndex(v=>v>=d-1e-10);if(f===-1&&(c=c.mul(10),f=0),f+=n,f>=i.length){var p=Math.floor(f/i.length);f%=i.length,c=c.mul(new At(10).pow(p))}var m=(r=i[f])!==null&&r!==void 0?r:1,y=new At(m).mul(c);return t?y:new At(Math.ceil(y.toNumber()))},r0e=(e,t,n)=>{var r=new At(1),i=new At(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new At(10).pow(HU(e)-1),i=new At(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new At(Math.floor(e)))}else e===0?i=new At(Math.floor((t-1)/2)):n||(i=new At(Math.floor(e)));for(var l=Math.floor((t-1)/2),c=[],d=0;d<t;d++)c.push(i.add(new At(d-l).mul(r)).toNumber());return c},QU=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:VC;if(!Number.isFinite((n-t)/(r-1)))return{step:new At(0),tickMin:new At(0),tickMax:new At(0)};var c=l(new At(n).sub(t).div(r-1),i,a),d;t<=0&&n>=0?d=new At(0):(d=new At(t).add(n).div(2),d=d.sub(new At(d).mod(c)));var f=Math.ceil(d.sub(t).div(c).toNumber()),p=Math.ceil(new At(n).sub(d).div(c).toNumber()),m=f+p+1;return m>r?QU(t,n,r,i,a+1,l):(m<r&&(p=n>0?p+(r-m):p,f=n>0?f:f+(r-m)),{step:c,tickMin:d.sub(new At(f).mul(c)),tickMax:d.add(new At(p).mul(c))})},TI=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(i,2),[d,f]=GU([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 r0e(d,i,a);var m=l==="snap125"?VU:VC,{step:y,tickMin:v,tickMax:w}=QU(d,f,c,a,0,m),b=KU(v,w.add(new At(.1).mul(y)),y);return n>r?b.reverse():b},PI=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[c,d]=GU([r,i]);if(c===-1/0||d===1/0)return[r,i];if(c===d)return[c];var f=l==="snap125"?VU:VC,p=Math.max(n,2),m=f(new At(d).sub(c).div(p-1),a,0),y=[...KU(new At(c),new At(d),m),d];return a===!1&&(y=y.map(v=>Math.round(v))),r>i?y.reverse():y},WU=e=>e.rootProps.maxBarSize,i0e=e=>e.rootProps.barGap,YU=e=>e.rootProps.barCategoryGap,a0e=e=>e.rootProps.barSize,D0=e=>e.rootProps.stackOffset,ZU=e=>e.rootProps.reverseStackOrder,QC=e=>e.options.chartName,WC=e=>e.rootProps.syncId,XU=e=>e.rootProps.syncMethod,YC=e=>e.options.eventEmitter,s0e=e=>e.rootProps.baseValue,Xn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},xl={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"},I0=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function M0(e,t,n){if(n!=="auto")return n;if(e!=null)return Qa(e,t)?"category":"number"}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 Gy(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){o0e(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 o0e(e,t,n){return(t=l0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l0e(e){var t=c0e(e,"string");return typeof t=="symbol"?t:t+""}function c0e(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={allowDataOverflow:xl.allowDataOverflow,allowDecimals:xl.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:xl.angleAxisId,includeHidden:!1,name:void 0,reversed:xl.reversed,scale:xl.scale,tick:xl.tick,tickCount:void 0,ticks:void 0,type:xl.type,unit:void 0,niceTicks:"auto"},II={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"},u0e=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},ZC=le([u0e,yU],(e,t)=>{var n;if(e!=null)return e;var r=(n=M0(t,"angleAxis",DI.type))!==null&&n!==void 0?n:"category";return Gy(Gy({},DI),{},{type:r})}),d0e=(e,t)=>e.polarAxis.radiusAxis[t],XC=le([d0e,yU],(e,t)=>{var n;if(e!=null)return e;var r=(n=M0(t,"radiusAxis",II.type))!==null&&n!==void 0?n:"category";return Gy(Gy({},II),{},{type:r})}),L0=e=>e.polarOptions,JC=le([Ds,Is,Jn],Ive),JU=le([L0,JC],(e,t)=>{if(e!=null)return ma(e.innerRadius,t,0)}),eq=le([L0,JC],(e,t)=>{if(e!=null)return ma(e.outerRadius,t,t*.8)}),f0e=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},tq=le([L0],f0e);le([ZC,tq],I0);var nq=le([JC,JU,eq],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});le([XC,nq],I0);var rq=le([It,L0,JU,eq,Ds,Is],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:l,cy:c,startAngle:d,endAngle:f}=t;return{cx:ma(l,i,i/2),cy:ma(c,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:f,clockWise:!1}}}),er=(e,t)=>t,$0=(e,t,n)=>n;function B0(e){return e?.id}function iq(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,l=new Map;return e.forEach(c=>{var d,f=(d=c.data)!==null&&d!==void 0?d:r;if(!(f==null||f.length===0)){var p=B0(c);f.forEach((m,y)=>{var v=a==null||i?y:String(En(m,a,null)),w=En(m,c.dataKey,0),b;l.has(v)?b=l.get(v):b={},Object.assign(b,{[p]:w}),l.set(v,b)})}}),Array.from(l.values())}function U0(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var q0=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function F0(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function h0e(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 tr=e=>{var t=It(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},_d=e=>e.tooltip.settings.axisId;function eA(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(a){function l(){return a.apply(this,arguments)}return l.toString=function(){return a.toString()},l})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var l=i[0],c=i[1];return l<=c?a>=l&&a<=c:a>=c&&a<=l},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,l)=>{var c=e(a);if(c!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var d=e.bandwidth();switch(l.position){case"middle":c+=d/2;break;case"end":c+=d;break}}return c}}}}}var p0e=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!La(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];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 Io(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function m0e(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function tA(e){let t,n,r;e.length!==2?(t=Io,n=(c,d)=>Io(e(c),d),r=(c,d)=>e(c)-d):(t=e===Io||e===m0e?e:g0e,n=e,r=e);function i(c,d,f=0,p=c.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(c[m],d)<0?f=m+1:p=m}while(f<p)}return f}function a(c,d,f=0,p=c.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(c[m],d)<=0?f=m+1:p=m}while(f<p)}return f}function l(c,d,f=0,p=c.length){const m=i(c,d,f,p-1);return m>f&&r(c[m-1],d)>-r(c[m],d)?m-1:m}return{left:i,center:l,right:a}}function g0e(){return 0}function aq(e){return e===null?NaN:+e}function*y0e(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const v0e=tA(Io),fp=v0e.right;tA(aq).center;class MI extends Map{constructor(t,n=w0e){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(LI(this,t))}has(t){return super.has(LI(this,t))}set(t,n){return super.set(x0e(this,t),n)}delete(t){return super.delete(b0e(this,t))}}function LI({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function x0e({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function b0e({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function w0e(e){return e!==null&&typeof e=="object"?e.valueOf():e}function S0e(e=Io){if(e===Io)return sq;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 sq(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const j0e=Math.sqrt(50),N0e=Math.sqrt(10),k0e=Math.sqrt(2);function Vy(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),l=a>=j0e?10:a>=N0e?5:a>=k0e?2:1;let c,d,f;return i<0?(f=Math.pow(10,-i)/l,c=Math.round(e*f),d=Math.round(t*f),c/f<e&&++c,d/f>t&&--d,f=-f):(f=Math.pow(10,i)*l,c=Math.round(e/f),d=Math.round(t/f),c*f<e&&++c,d*f>t&&--d),d<c&&.5<=n&&n<2?Vy(e,t,n*2):[c,d,f]}function gN(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,l]=r?Vy(t,e,n):Vy(e,t,n);if(!(a>=i))return[];const c=a-i+1,d=new Array(c);if(r)if(l<0)for(let f=0;f<c;++f)d[f]=(a-f)/-l;else for(let f=0;f<c;++f)d[f]=(a-f)*l;else if(l<0)for(let f=0;f<c;++f)d[f]=(i+f)/-l;else for(let f=0;f<c;++f)d[f]=(i+f)*l;return d}function yN(e,t,n){return t=+t,e=+e,n=+n,Vy(e,t,n)[2]}function vN(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?yN(t,e,n):yN(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function $I(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function BI(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function oq(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?sq:S0e(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));oq(e,t,v,w,i)}const a=e[t];let l=n,c=r;for(Hf(e,n,t),i(e[r],a)>0&&Hf(e,n,r);l<c;){for(Hf(e,l,c),++l,--c;i(e[l],a)<0;)++l;for(;i(e[c],a)>0;)--c}i(e[n],a)===0?Hf(e,n,c):(++c,Hf(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function Hf(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function C0e(e,t,n){if(e=Float64Array.from(y0e(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return BI(e);if(t>=1)return $I(e);var r,i=(r-1)*t,a=Math.floor(i),l=$I(oq(e,a).subarray(0,a+1)),c=BI(e.subarray(a+1));return l+(c-l)*(i-a)}}function A0e(e,t,n=aq){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),l=+n(e[a],a,e),c=+n(e[a+1],a+1,e);return l+(c-l)*(i-a)}}function E0e(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 ea(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ms(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 xN=Symbol("implicit");function nA(){var e=new MI,t=[],n=[],r=xN;function i(a){let l=e.get(a);if(l===void 0){if(r!==xN)return r;e.set(a,l=t.push(a)-1)}return n[l%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new MI;for(const l of a)e.has(l)||e.set(l,t.push(l)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return nA(t,n).unknown(r)},ea.apply(i,arguments),i}function rA(){var e=nA().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,l,c=!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),c&&(a=Math.floor(a)),w+=(b-w-a*(y-d))*p,l=a*(1-d),c&&(w=Math.round(w),l=Math.round(l));var j=E0e(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,c=!0,m()},e.bandwidth=function(){return l},e.step=function(){return a},e.round=function(y){return arguments.length?(c=!!y,m()):c},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 rA(t(),[r,i]).round(c).paddingInner(d).paddingOuter(f).align(p)},ea.apply(m(),arguments)}function lq(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return lq(t())},e}function O0e(){return lq(rA.apply(null,arguments).paddingInner(1))}function iA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function cq(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function hp(){}var Bh=.7,Qy=1/Bh,Vu="\\s*([+-]?\\d+)\\s*",Uh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$a="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",_0e=/^#([0-9a-f]{3,8})$/,z0e=new RegExp(`^rgb\\(${Vu},${Vu},${Vu}\\)$`),T0e=new RegExp(`^rgb\\(${$a},${$a},${$a}\\)$`),P0e=new RegExp(`^rgba\\(${Vu},${Vu},${Vu},${Uh}\\)$`),R0e=new RegExp(`^rgba\\(${$a},${$a},${$a},${Uh}\\)$`),D0e=new RegExp(`^hsl\\(${Uh},${$a},${$a}\\)$`),I0e=new RegExp(`^hsla\\(${Uh},${$a},${$a},${Uh}\\)$`),UI={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};iA(hp,qh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qI,formatHex:qI,formatHex8:M0e,formatHsl:L0e,formatRgb:FI,toString:FI});function qI(){return this.rgb().formatHex()}function M0e(){return this.rgb().formatHex8()}function L0e(){return uq(this).formatHsl()}function FI(){return this.rgb().formatRgb()}function qh(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=_0e.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?HI(t):n===3?new oi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?mg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?mg(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=z0e.exec(e))?new oi(t[1],t[2],t[3],1):(t=T0e.exec(e))?new oi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=P0e.exec(e))?mg(t[1],t[2],t[3],t[4]):(t=R0e.exec(e))?mg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=D0e.exec(e))?VI(t[1],t[2]/100,t[3]/100,1):(t=I0e.exec(e))?VI(t[1],t[2]/100,t[3]/100,t[4]):UI.hasOwnProperty(e)?HI(UI[e]):e==="transparent"?new oi(NaN,NaN,NaN,0):null}function HI(e){return new oi(e>>16&255,e>>8&255,e&255,1)}function mg(e,t,n,r){return r<=0&&(e=t=n=NaN),new oi(e,t,n,r)}function $0e(e){return e instanceof hp||(e=qh(e)),e?(e=e.rgb(),new oi(e.r,e.g,e.b,e.opacity)):new oi}function bN(e,t,n,r){return arguments.length===1?$0e(e):new oi(e,t,n,r??1)}function oi(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}iA(oi,bN,cq(hp,{brighter(e){return e=e==null?Qy:Math.pow(Qy,e),new oi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Bh:Math.pow(Bh,e),new oi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new oi(Hl(this.r),Hl(this.g),Hl(this.b),Wy(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:KI,formatHex:KI,formatHex8:B0e,formatRgb:GI,toString:GI}));function KI(){return`#${Dl(this.r)}${Dl(this.g)}${Dl(this.b)}`}function B0e(){return`#${Dl(this.r)}${Dl(this.g)}${Dl(this.b)}${Dl((isNaN(this.opacity)?1:this.opacity)*255)}`}function GI(){const e=Wy(this.opacity);return`${e===1?"rgb(":"rgba("}${Hl(this.r)}, ${Hl(this.g)}, ${Hl(this.b)}${e===1?")":`, ${e})`}`}function Wy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Hl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Dl(e){return e=Hl(e),(e<16?"0":"")+e.toString(16)}function VI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ha(e,t,n,r)}function uq(e){if(e instanceof ha)return new ha(e.h,e.s,e.l,e.opacity);if(e instanceof hp||(e=qh(e)),!e)return new ha;if(e instanceof ha)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),l=NaN,c=a-i,d=(a+i)/2;return c?(t===a?l=(n-r)/c+(n<r)*6:n===a?l=(r-t)/c+2:l=(t-n)/c+4,c/=d<.5?a+i:2-a-i,l*=60):c=d>0&&d<1?0:l,new ha(l,c,d,e.opacity)}function U0e(e,t,n,r){return arguments.length===1?uq(e):new ha(e,t,n,r??1)}function ha(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}iA(ha,U0e,cq(hp,{brighter(e){return e=e==null?Qy:Math.pow(Qy,e),new ha(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Bh:Math.pow(Bh,e),new ha(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 oi(bj(e>=240?e-240:e+120,i,r),bj(e,i,r),bj(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ha(QI(this.h),gg(this.s),gg(this.l),Wy(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=Wy(this.opacity);return`${e===1?"hsl(":"hsla("}${QI(this.h)}, ${gg(this.s)*100}%, ${gg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function QI(e){return e=(e||0)%360,e<0?e+360:e}function gg(e){return Math.max(0,Math.min(1,e||0))}function bj(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 aA=e=>()=>e;function q0e(e,t){return function(n){return e+n*t}}function F0e(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 H0e(e){return(e=+e)==1?dq:function(t,n){return n-t?F0e(t,n,e):aA(isNaN(t)?n:t)}}function dq(e,t){var n=t-e;return n?q0e(e,n):aA(isNaN(e)?t:e)}const WI=(function e(t){var n=H0e(t);function r(i,a){var l=n((i=bN(i)).r,(a=bN(a)).r),c=n(i.g,a.g),d=n(i.b,a.b),f=dq(i.opacity,a.opacity);return function(p){return i.r=l(p),i.g=c(p),i.b=d(p),i.opacity=f(p),i+""}}return r.gamma=e,r})(1);function K0e(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 G0e(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function V0e(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),l;for(l=0;l<r;++l)i[l]=zd(e[l],t[l]);for(;l<n;++l)a[l]=t[l];return function(c){for(l=0;l<r;++l)a[l]=i[l](c);return a}}function Q0e(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Yy(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function W0e(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]=zd(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var wN=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wj=new RegExp(wN.source,"g");function Y0e(e){return function(){return e}}function Z0e(e){return function(t){return e(t)+""}}function X0e(e,t){var n=wN.lastIndex=wj.lastIndex=0,r,i,a,l=-1,c=[],d=[];for(e=e+"",t=t+"";(r=wN.exec(e))&&(i=wj.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),c[l]?c[l]+=a:c[++l]=a),(r=r[0])===(i=i[0])?c[l]?c[l]+=i:c[++l]=i:(c[++l]=null,d.push({i:l,x:Yy(r,i)})),n=wj.lastIndex;return n<t.length&&(a=t.slice(n),c[l]?c[l]+=a:c[++l]=a),c.length<2?d[0]?Z0e(d[0].x):Y0e(t):(t=d.length,function(f){for(var p=0,m;p<t;++p)c[(m=d[p]).i]=m.x(f);return c.join("")})}function zd(e,t){var n=typeof t,r;return t==null||n==="boolean"?aA(t):(n==="number"?Yy:n==="string"?(r=qh(t))?(t=r,WI):X0e:t instanceof qh?WI:t instanceof Date?Q0e:G0e(t)?K0e:Array.isArray(t)?V0e:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?W0e:Yy)(e,t)}function sA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function J0e(e,t){t===void 0&&(t=e,e=zd);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(l){var c=Math.max(0,Math.min(r-1,Math.floor(l*=r)));return a[c](l-c)}}function exe(e){return function(){return e}}function Zy(e){return+e}var YI=[0,1];function qr(e){return e}function SN(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:exe(isNaN(t)?NaN:.5)}function txe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function nxe(e,t,n){var r=e[0],i=e[1],a=t[0],l=t[1];return i<r?(r=SN(i,r),a=n(l,a)):(r=SN(r,i),a=n(a,l)),function(c){return a(r(c))}}function rxe(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),l=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<r;)i[l]=SN(e[l],e[l+1]),a[l]=n(t[l],t[l+1]);return function(c){var d=fp(e,c,1,r)-1;return a[d](i[d](c))}}function pp(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function H0(){var e=YI,t=YI,n=zd,r,i,a,l=qr,c,d,f;function p(){var y=Math.min(e.length,t.length);return l!==qr&&(l=txe(e[0],e[y-1])),c=y>2?rxe:nxe,d=f=null,m}function m(y){return y==null||isNaN(y=+y)?a:(d||(d=c(e.map(r),t,n)))(r(l(y)))}return m.invert=function(y){return l(i((f||(f=c(t,e.map(r),Yy)))(y)))},m.domain=function(y){return arguments.length?(e=Array.from(y,Zy),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=sA,p()},m.clamp=function(y){return arguments.length?(l=y?!0:qr,p()):l!==qr},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 oA(){return H0()(qr,qr)}function ixe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Xy(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function cd(e){return e=Xy(Math.abs(e)),e?e[1]:NaN}function axe(e,t){return function(n,r){for(var i=n.length,a=[],l=0,c=e[0],d=0;i>0&&c>0&&(d+c+1>r&&(c=Math.max(1,r-d)),a.push(n.substring(i-=c,i+c)),!((d+=c+1)>r));)c=e[l=(l+1)%e.length];return a.reverse().join(t)}}function sxe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var oxe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Fh(e){if(!(t=oxe.exec(e)))throw new Error("invalid format: "+e);var t;return new lA({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]})}Fh.prototype=lA.prototype;function lA(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+""}lA.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 lxe(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Jy;function cxe(e,t){var n=Xy(e,t);if(!n)return Jy=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Jy=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return a===l?r:a>l?r+new Array(a-l+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Xy(e,Math.max(0,t+a-1))[0]}function ZI(e,t){var n=Xy(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const XI={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:ixe,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)=>ZI(e*100,t),r:ZI,s:cxe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function JI(e){return e}var eM=Array.prototype.map,tM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function uxe(e){var t=e.grouping===void 0||e.thousands===void 0?JI:axe(eM.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?JI:sxe(eM.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(m,y){m=Fh(m);var v=m.fill,w=m.align,b=m.sign,j=m.symbol,k=m.zero,E=m.width,O=m.comma,C=m.precision,z=m.trim,A=m.type;A==="n"?(O=!0,A="g"):XI[A]||(C===void 0&&(C=12),z=!0,A="g"),(k||v==="0"&&w==="=")&&(k=!0,v="0",w="=");var _=(y&&y.prefix!==void 0?y.prefix:"")+(j==="$"?n:j==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),R=(j==="$"?r:/[%p]/.test(A)?l:"")+(y&&y.suffix!==void 0?y.suffix:""),$=XI[A],F=/[defgprs%]/.test(A);C=C===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function q(B){var K=_,X=R,Q,H,J;if(A==="c")X=$(B)+X,B="";else{B=+B;var de=B<0||1/B<0;if(B=isNaN(B)?d:$(Math.abs(B),C),z&&(B=lxe(B)),de&&+B==0&&b!=="+"&&(de=!1),K=(de?b==="("?b:c:b==="-"||b==="("?"":b)+K,X=(A==="s"&&!isNaN(B)&&Jy!==void 0?tM[8+Jy/3]:"")+X+(de&&b==="("?")":""),F){for(Q=-1,H=B.length;++Q<H;)if(J=B.charCodeAt(Q),48>J||J>57){X=(J===46?i+B.slice(Q+1):B.slice(Q))+X,B=B.slice(0,Q);break}}}O&&!k&&(B=t(B,1/0));var be=K.length+B.length+X.length,M=be<E?new Array(E-be+1).join(v):"";switch(O&&k&&(B=t(M+B,M.length?E-X.length:1/0),M=""),w){case"<":B=K+B+X+M;break;case"=":B=K+M+B+X;break;case"^":B=M.slice(0,be=M.length>>1)+K+B+X+M.slice(be);break;default:B=M+K+B+X;break}return a(B)}return q.toString=function(){return m+""},q}function p(m,y){var v=Math.max(-8,Math.min(8,Math.floor(cd(y)/3)))*3,w=Math.pow(10,-v),b=f((m=Fh(m),m.type="f",m),{suffix:tM[8+v/3]});return function(j){return b(w*j)}}return{format:f,formatPrefix:p}}var yg,cA,fq;dxe({thousands:",",grouping:[3],currency:["$",""]});function dxe(e){return yg=uxe(e),cA=yg.format,fq=yg.formatPrefix,yg}function fxe(e){return Math.max(0,-cd(Math.abs(e)))}function hxe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(cd(t)/3)))*3-cd(Math.abs(e)))}function pxe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,cd(t)-cd(e))+1}function hq(e,t,n,r){var i=vN(e,t,n),a;switch(r=Fh(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=hxe(i,l))&&(r.precision=a),fq(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=pxe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=fxe(i))&&(r.precision=a-(r.type==="%")*2);break}}return cA(r)}function Yo(e){var t=e.domain;return e.ticks=function(n){var r=t();return gN(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return hq(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,l=r[i],c=r[a],d,f,p=10;for(c<l&&(f=l,l=c,c=f,f=i,i=a,a=f);p-- >0;){if(f=yN(l,c,n),f===d)return r[i]=l,r[a]=c,t(r);if(f>0)l=Math.floor(l/f)*f,c=Math.ceil(c/f)*f;else if(f<0)l=Math.ceil(l*f)/f,c=Math.floor(c*f)/f;else break;d=f}return e},e}function pq(){var e=oA();return e.copy=function(){return pp(e,pq())},ea.apply(e,arguments),Yo(e)}function mq(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Zy),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return mq(e).unknown(t)},e=arguments.length?Array.from(e,Zy):[0,1],Yo(n)}function gq(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],l;return a<i&&(l=n,n=r,r=l,l=i,i=a,a=l),e[n]=t.floor(i),e[r]=t.ceil(a),e}function nM(e){return Math.log(e)}function rM(e){return Math.exp(e)}function mxe(e){return-Math.log(-e)}function gxe(e){return-Math.exp(-e)}function yxe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function vxe(e){return e===10?yxe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function xxe(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 iM(e){return(t,n)=>-e(-t,n)}function uA(e){const t=e(nM,rM),n=t.domain;let r=10,i,a;function l(){return i=xxe(r),a=vxe(r),n()[0]<0?(i=iM(i),a=iM(a),e(mxe,gxe)):e(nM,rM),t}return t.base=function(c){return arguments.length?(r=+c,l()):r},t.domain=function(c){return arguments.length?(n(c),l()):n()},t.ticks=c=>{const 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=c==null?10:+c;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=gN(f,p,j))}else k=gN(y,v,Math.min(v-y,j)).map(a);return m?k.reverse():k},t.tickFormat=(c,d)=>{if(c==null&&(c=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=Fh(d)).precision==null&&(d.trim=!0),d=cA(d)),c===1/0)return d;const f=Math.max(1,r*c/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(gq(n(),{floor:c=>a(Math.floor(i(c))),ceil:c=>a(Math.ceil(i(c)))})),t}function yq(){const e=uA(H0()).domain([1,10]);return e.copy=()=>pp(e,yq()).base(e.base()),ea.apply(e,arguments),e}function aM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function sM(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function dA(e){var t=1,n=e(aM(t),sM(t));return n.constant=function(r){return arguments.length?e(aM(t=+r),sM(t)):t},Yo(n)}function vq(){var e=dA(H0());return e.copy=function(){return pp(e,vq()).constant(e.constant())},ea.apply(e,arguments)}function oM(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function bxe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function wxe(e){return e<0?-e*e:e*e}function fA(e){var t=e(qr,qr),n=1;function r(){return n===1?e(qr,qr):n===.5?e(bxe,wxe):e(oM(n),oM(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Yo(t)}function hA(){var e=fA(H0());return e.copy=function(){return pp(e,hA()).exponent(e.exponent())},ea.apply(e,arguments),e}function Sxe(){return hA.apply(null,arguments).exponent(.5)}function lM(e){return Math.sign(e)*e*e}function jxe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function xq(){var e=oA(),t=[0,1],n=!1,r;function i(a){var l=jxe(e(a));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(a){return e.invert(lM(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Zy)).map(lM)),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 xq(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},ea.apply(i,arguments),Yo(i)}function bq(){var e=[],t=[],n=[],r;function i(){var l=0,c=Math.max(1,t.length);for(n=new Array(c-1);++l<c;)n[l-1]=A0e(e,l/c);return a}function a(l){return l==null||isNaN(l=+l)?r:t[fp(n,l)]}return a.invertExtent=function(l){var c=t.indexOf(l);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},a.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let c of l)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(Io),i()},a.range=function(l){return arguments.length?(t=Array.from(l),i()):t.slice()},a.unknown=function(l){return arguments.length?(r=l,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return bq().domain(e).range(t).unknown(r)},ea.apply(a,arguments)}function wq(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function l(d){return d!=null&&d<=d?i[fp(r,d,0,n)]:a}function c(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return l}return l.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,c()):[e,t]},l.range=function(d){return arguments.length?(n=(i=Array.from(d)).length-1,c()):i.slice()},l.invertExtent=function(d){var f=i.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},l.unknown=function(d){return arguments.length&&(a=d),l},l.thresholds=function(){return r.slice()},l.copy=function(){return wq().domain([e,t]).range(i).unknown(a)},ea.apply(Yo(l),arguments)}function Sq(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[fp(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var l=t.indexOf(a);return[e[l-1],e[l]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Sq().domain(e).range(t).unknown(n)},ea.apply(i,arguments)}const Sj=new Date,jj=new Date;function Qn(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const l=i(a),c=i.ceil(a);return a-l<c-a?l:c},i.offset=(a,l)=>(t(a=new Date(+a),l==null?1:Math.floor(l)),a),i.range=(a,l,c)=>{const d=[];if(a=i.ceil(a),c=c==null?1:Math.floor(c),!(a<l)||!(c>0))return d;let f;do d.push(f=new Date(+a)),t(a,c),e(a);while(f<a&&a<l);return d},i.filter=a=>Qn(l=>{if(l>=l)for(;e(l),!a(l);)l.setTime(l-1)},(l,c)=>{if(l>=l)if(c<0)for(;++c<=0;)for(;t(l,-1),!a(l););else for(;--c>=0;)for(;t(l,1),!a(l););}),n&&(i.count=(a,l)=>(Sj.setTime(+a),jj.setTime(+l),e(Sj),e(jj),Math.floor(n(Sj,jj))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?l=>r(l)%a===0:l=>i.count(0,l)%a===0):i)),i}const ev=Qn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ev.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Qn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ev);ev.range;const js=1e3,Gi=js*60,Ns=Gi*60,_s=Ns*24,pA=_s*7,cM=_s*30,Nj=_s*365,Il=Qn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*js)},(e,t)=>(t-e)/js,e=>e.getUTCSeconds());Il.range;const mA=Qn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*js)},(e,t)=>{e.setTime(+e+t*Gi)},(e,t)=>(t-e)/Gi,e=>e.getMinutes());mA.range;const gA=Qn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Gi)},(e,t)=>(t-e)/Gi,e=>e.getUTCMinutes());gA.range;const yA=Qn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*js-e.getMinutes()*Gi)},(e,t)=>{e.setTime(+e+t*Ns)},(e,t)=>(t-e)/Ns,e=>e.getHours());yA.range;const vA=Qn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ns)},(e,t)=>(t-e)/Ns,e=>e.getUTCHours());vA.range;const mp=Qn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Gi)/_s,e=>e.getDate()-1);mp.range;const K0=Qn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/_s,e=>e.getUTCDate()-1);K0.range;const jq=Qn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/_s,e=>Math.floor(e/_s));jq.range;function bc(e){return Qn(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())*Gi)/pA)}const G0=bc(0),tv=bc(1),Nxe=bc(2),kxe=bc(3),ud=bc(4),Cxe=bc(5),Axe=bc(6);G0.range;tv.range;Nxe.range;kxe.range;ud.range;Cxe.range;Axe.range;function wc(e){return Qn(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)/pA)}const V0=wc(0),nv=wc(1),Exe=wc(2),Oxe=wc(3),dd=wc(4),_xe=wc(5),zxe=wc(6);V0.range;nv.range;Exe.range;Oxe.range;dd.range;_xe.range;zxe.range;const xA=Qn(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());xA.range;const bA=Qn(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());bA.range;const zs=Qn(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());zs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Qn(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)});zs.range;const Ts=Qn(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());Ts.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Qn(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)});Ts.range;function Nq(e,t,n,r,i,a){const l=[[Il,1,js],[Il,5,5*js],[Il,15,15*js],[Il,30,30*js],[a,1,Gi],[a,5,5*Gi],[a,15,15*Gi],[a,30,30*Gi],[i,1,Ns],[i,3,3*Ns],[i,6,6*Ns],[i,12,12*Ns],[r,1,_s],[r,2,2*_s],[n,1,pA],[t,1,cM],[t,3,3*cM],[e,1,Nj]];function c(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=tA(([,,j])=>j).right(l,y);if(v===l.length)return e.every(vN(f/Nj,p/Nj,m));if(v===0)return ev.every(Math.max(vN(f,p,m),1));const[w,b]=l[y/l[v-1][2]<l[v][2]/y?v-1:v];return w.every(b)}return[c,d]}const[Txe,Pxe]=Nq(Ts,bA,V0,jq,vA,gA),[Rxe,Dxe]=Nq(zs,xA,G0,mp,yA,mA);function kj(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 Cj(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 Kf(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Ixe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,l=e.shortDays,c=e.months,d=e.shortMonths,f=Gf(i),p=Vf(i),m=Gf(a),y=Vf(a),v=Gf(l),w=Vf(l),b=Gf(c),j=Vf(c),k=Gf(d),E=Vf(d),O={a:J,A:de,b:be,B:M,c:null,d:mM,e:mM,f:abe,g:mbe,G:ybe,H:nbe,I:rbe,j:ibe,L:kq,m:sbe,M:obe,p:D,q:U,Q:vM,s:xM,S:lbe,u:cbe,U:ube,V:dbe,w:fbe,W:hbe,x:null,X:null,y:pbe,Y:gbe,Z:vbe,"%":yM},C={a:I,A:V,b:ce,B:re,c:null,d:gM,e:gM,f:Sbe,g:Tbe,G:Rbe,H:xbe,I:bbe,j:wbe,L:Aq,m:jbe,M:Nbe,p:ke,q:ze,Q:vM,s:xM,S:kbe,u:Cbe,U:Abe,V:Ebe,w:Obe,W:_be,x:null,X:null,y:zbe,Y:Pbe,Z:Dbe,"%":yM},z={a:F,A:q,b:B,B:K,c:X,d:hM,e:hM,f:Xxe,g:fM,G:dM,H:pM,I:pM,j:Qxe,L:Zxe,m:Vxe,M:Wxe,p:$,q:Gxe,Q:ebe,s:tbe,S:Yxe,u:Uxe,U:qxe,V:Fxe,w:Bxe,W:Hxe,x:Q,X:H,y:fM,Y:dM,Z:Kxe,"%":Jxe};O.x=A(n,O),O.X=A(r,O),O.c=A(t,O),C.x=A(n,C),C.X=A(r,C),C.c=A(t,C);function A(te,fe){return function(Ee){var Z=[],Ge=-1,Me=0,lt=te.length,Te,Wt,Ht;for(Ee instanceof Date||(Ee=new Date(+Ee));++Ge<lt;)te.charCodeAt(Ge)===37&&(Z.push(te.slice(Me,Ge)),(Wt=uM[Te=te.charAt(++Ge)])!=null?Te=te.charAt(++Ge):Wt=Te==="e"?" ":"0",(Ht=fe[Te])&&(Te=Ht(Ee,Wt)),Z.push(Te),Me=Ge+1);return Z.push(te.slice(Me,Ge)),Z.join("")}}function _(te,fe){return function(Ee){var Z=Kf(1900,void 0,1),Ge=R(Z,te,Ee+="",0),Me,lt;if(Ge!=Ee.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(fe&&!("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?(Me=Cj(Kf(Z.y,0,1)),lt=Me.getUTCDay(),Me=lt>4||lt===0?nv.ceil(Me):nv(Me),Me=K0.offset(Me,(Z.V-1)*7),Z.y=Me.getUTCFullYear(),Z.m=Me.getUTCMonth(),Z.d=Me.getUTCDate()+(Z.w+6)%7):(Me=kj(Kf(Z.y,0,1)),lt=Me.getDay(),Me=lt>4||lt===0?tv.ceil(Me):tv(Me),Me=mp.offset(Me,(Z.V-1)*7),Z.y=Me.getFullYear(),Z.m=Me.getMonth(),Z.d=Me.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),lt="Z"in Z?Cj(Kf(Z.y,0,1)).getUTCDay():kj(Kf(Z.y,0,1)).getDay(),Z.m=0,Z.d="W"in Z?(Z.w+6)%7+Z.W*7-(lt+5)%7:Z.w+Z.U*7-(lt+6)%7);return"Z"in Z?(Z.H+=Z.Z/100|0,Z.M+=Z.Z%100,Cj(Z)):kj(Z)}}function R(te,fe,Ee,Z){for(var Ge=0,Me=fe.length,lt=Ee.length,Te,Wt;Ge<Me;){if(Z>=lt)return-1;if(Te=fe.charCodeAt(Ge++),Te===37){if(Te=fe.charAt(Ge++),Wt=z[Te in uM?fe.charAt(Ge++):Te],!Wt||(Z=Wt(te,Ee,Z))<0)return-1}else if(Te!=Ee.charCodeAt(Z++))return-1}return Z}function $(te,fe,Ee){var Z=f.exec(fe.slice(Ee));return Z?(te.p=p.get(Z[0].toLowerCase()),Ee+Z[0].length):-1}function F(te,fe,Ee){var Z=v.exec(fe.slice(Ee));return Z?(te.w=w.get(Z[0].toLowerCase()),Ee+Z[0].length):-1}function q(te,fe,Ee){var Z=m.exec(fe.slice(Ee));return Z?(te.w=y.get(Z[0].toLowerCase()),Ee+Z[0].length):-1}function B(te,fe,Ee){var Z=k.exec(fe.slice(Ee));return Z?(te.m=E.get(Z[0].toLowerCase()),Ee+Z[0].length):-1}function K(te,fe,Ee){var Z=b.exec(fe.slice(Ee));return Z?(te.m=j.get(Z[0].toLowerCase()),Ee+Z[0].length):-1}function X(te,fe,Ee){return R(te,t,fe,Ee)}function Q(te,fe,Ee){return R(te,n,fe,Ee)}function H(te,fe,Ee){return R(te,r,fe,Ee)}function J(te){return l[te.getDay()]}function de(te){return a[te.getDay()]}function be(te){return d[te.getMonth()]}function M(te){return c[te.getMonth()]}function D(te){return i[+(te.getHours()>=12)]}function U(te){return 1+~~(te.getMonth()/3)}function I(te){return l[te.getUTCDay()]}function V(te){return a[te.getUTCDay()]}function ce(te){return d[te.getUTCMonth()]}function re(te){return c[te.getUTCMonth()]}function ke(te){return i[+(te.getUTCHours()>=12)]}function ze(te){return 1+~~(te.getUTCMonth()/3)}return{format:function(te){var fe=A(te+="",O);return fe.toString=function(){return te},fe},parse:function(te){var fe=_(te+="",!1);return fe.toString=function(){return te},fe},utcFormat:function(te){var fe=A(te+="",C);return fe.toString=function(){return te},fe},utcParse:function(te){var fe=_(te+="",!0);return fe.toString=function(){return te},fe}}}var uM={"-":"",_:" ",0:"0"},nr=/^\s*\d+/,Mxe=/^%/,Lxe=/[\\^$*+?|[\]().{}]/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 $xe(e){return e.replace(Lxe,"\\$&")}function Gf(e){return new RegExp("^(?:"+e.map($xe).join("|")+")","i")}function Vf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Bxe(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Uxe(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function qxe(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Fxe(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Hxe(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function dM(e,t,n){var r=nr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function fM(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Kxe(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 Gxe(e,t,n){var r=nr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Vxe(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function hM(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Qxe(e,t,n){var r=nr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function pM(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Wxe(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Yxe(e,t,n){var r=nr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Zxe(e,t,n){var r=nr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Xxe(e,t,n){var r=nr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Jxe(e,t,n){var r=Mxe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function ebe(e,t,n){var r=nr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function tbe(e,t,n){var r=nr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function mM(e,t){return zt(e.getDate(),t,2)}function nbe(e,t){return zt(e.getHours(),t,2)}function rbe(e,t){return zt(e.getHours()%12||12,t,2)}function ibe(e,t){return zt(1+mp.count(zs(e),e),t,3)}function kq(e,t){return zt(e.getMilliseconds(),t,3)}function abe(e,t){return kq(e,t)+"000"}function sbe(e,t){return zt(e.getMonth()+1,t,2)}function obe(e,t){return zt(e.getMinutes(),t,2)}function lbe(e,t){return zt(e.getSeconds(),t,2)}function cbe(e){var t=e.getDay();return t===0?7:t}function ube(e,t){return zt(G0.count(zs(e)-1,e),t,2)}function Cq(e){var t=e.getDay();return t>=4||t===0?ud(e):ud.ceil(e)}function dbe(e,t){return e=Cq(e),zt(ud.count(zs(e),e)+(zs(e).getDay()===4),t,2)}function fbe(e){return e.getDay()}function hbe(e,t){return zt(tv.count(zs(e)-1,e),t,2)}function pbe(e,t){return zt(e.getFullYear()%100,t,2)}function mbe(e,t){return e=Cq(e),zt(e.getFullYear()%100,t,2)}function gbe(e,t){return zt(e.getFullYear()%1e4,t,4)}function ybe(e,t){var n=e.getDay();return e=n>=4||n===0?ud(e):ud.ceil(e),zt(e.getFullYear()%1e4,t,4)}function vbe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+zt(t/60|0,"0",2)+zt(t%60,"0",2)}function gM(e,t){return zt(e.getUTCDate(),t,2)}function xbe(e,t){return zt(e.getUTCHours(),t,2)}function bbe(e,t){return zt(e.getUTCHours()%12||12,t,2)}function wbe(e,t){return zt(1+K0.count(Ts(e),e),t,3)}function Aq(e,t){return zt(e.getUTCMilliseconds(),t,3)}function Sbe(e,t){return Aq(e,t)+"000"}function jbe(e,t){return zt(e.getUTCMonth()+1,t,2)}function Nbe(e,t){return zt(e.getUTCMinutes(),t,2)}function kbe(e,t){return zt(e.getUTCSeconds(),t,2)}function Cbe(e){var t=e.getUTCDay();return t===0?7:t}function Abe(e,t){return zt(V0.count(Ts(e)-1,e),t,2)}function Eq(e){var t=e.getUTCDay();return t>=4||t===0?dd(e):dd.ceil(e)}function Ebe(e,t){return e=Eq(e),zt(dd.count(Ts(e),e)+(Ts(e).getUTCDay()===4),t,2)}function Obe(e){return e.getUTCDay()}function _be(e,t){return zt(nv.count(Ts(e)-1,e),t,2)}function zbe(e,t){return zt(e.getUTCFullYear()%100,t,2)}function Tbe(e,t){return e=Eq(e),zt(e.getUTCFullYear()%100,t,2)}function Pbe(e,t){return zt(e.getUTCFullYear()%1e4,t,4)}function Rbe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?dd(e):dd.ceil(e),zt(e.getUTCFullYear()%1e4,t,4)}function Dbe(){return"+0000"}function yM(){return"%"}function vM(e){return+e}function xM(e){return Math.floor(+e/1e3)}var xu,Oq,_q;Ibe({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 Ibe(e){return xu=Ixe(e),Oq=xu.format,xu.parse,_q=xu.utcFormat,xu.utcParse,xu}function Mbe(e){return new Date(e)}function Lbe(e){return e instanceof Date?+e:+new Date(+e)}function wA(e,t,n,r,i,a,l,c,d,f){var p=oA(),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"),O=f("%B"),C=f("%Y");function z(A){return(d(A)<A?v:c(A)<A?w:l(A)<A?b:a(A)<A?j:r(A)<A?i(A)<A?k:E:n(A)<A?O:C)(A)}return p.invert=function(A){return new Date(m(A))},p.domain=function(A){return arguments.length?y(Array.from(A,Lbe)):y().map(Mbe)},p.ticks=function(A){var _=y();return e(_[0],_[_.length-1],A??10)},p.tickFormat=function(A,_){return _==null?z:f(_)},p.nice=function(A){var _=y();return(!A||typeof A.range!="function")&&(A=t(_[0],_[_.length-1],A??10)),A?y(gq(_,A)):p},p.copy=function(){return pp(p,wA(e,t,n,r,i,a,l,c,d,f))},p}function $be(){return ea.apply(wA(Rxe,Dxe,zs,xA,G0,mp,yA,mA,Il,Oq).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Bbe(){return ea.apply(wA(Txe,Pxe,Ts,bA,V0,K0,vA,gA,Il,_q).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Q0(){var e=0,t=1,n,r,i,a,l=qr,c=!1,d;function f(m){return m==null||isNaN(m=+m)?d:l(i===0?.5:(m=(a(m)-n)*i,c?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?(c=!!m,f):c},f.interpolator=function(m){return arguments.length?(l=m,f):l};function p(m){return function(y){var v,w;return arguments.length?([v,w]=y,l=m(v,w),f):[l(0),l(1)]}}return f.range=p(zd),f.rangeRound=p(sA),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 Zo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function zq(){var e=Yo(Q0()(qr));return e.copy=function(){return Zo(e,zq())},Ms.apply(e,arguments)}function Tq(){var e=uA(Q0()).domain([1,10]);return e.copy=function(){return Zo(e,Tq()).base(e.base())},Ms.apply(e,arguments)}function Pq(){var e=dA(Q0());return e.copy=function(){return Zo(e,Pq()).constant(e.constant())},Ms.apply(e,arguments)}function SA(){var e=fA(Q0());return e.copy=function(){return Zo(e,SA()).exponent(e.exponent())},Ms.apply(e,arguments)}function Ube(){return SA.apply(null,arguments).exponent(.5)}function Rq(){var e=[],t=qr;function n(r){if(r!=null&&!isNaN(r=+r))return t((fp(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(Io),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)=>C0e(e,a/r))},n.copy=function(){return Rq(t).domain(e)},Ms.apply(n,arguments)}function W0(){var e=0,t=.5,n=1,r=1,i,a,l,c,d,f=qr,p,m=!1,y;function v(b){return isNaN(b=+b)?y:(b=.5+((b=+p(b))-a)*(r*b<r*a?c:d),f(m?Math.max(0,Math.min(1,b)):b))}v.domain=function(b){return arguments.length?([e,t,n]=b,i=p(e=+e),a=p(t=+t),l=p(n=+n),c=i===a?0:.5/(a-i),d=a===l?0:.5/(l-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(b){return arguments.length?(m=!!b,v):m},v.interpolator=function(b){return arguments.length?(f=b,v):f};function w(b){return function(j){var k,E,O;return arguments.length?([k,E,O]=j,f=J0e(b,[k,E,O]),v):[f(0),f(.5),f(1)]}}return v.range=w(zd),v.rangeRound=w(sA),v.unknown=function(b){return arguments.length?(y=b,v):y},function(b){return p=b,i=b(e),a=b(t),l=b(n),c=i===a?0:.5/(a-i),d=a===l?0:.5/(l-a),r=a<i?-1:1,v}}function Dq(){var e=Yo(W0()(qr));return e.copy=function(){return Zo(e,Dq())},Ms.apply(e,arguments)}function Iq(){var e=uA(W0()).domain([.1,1,10]);return e.copy=function(){return Zo(e,Iq()).base(e.base())},Ms.apply(e,arguments)}function Mq(){var e=dA(W0());return e.copy=function(){return Zo(e,Mq()).constant(e.constant())},Ms.apply(e,arguments)}function jA(){var e=fA(W0());return e.copy=function(){return Zo(e,jA()).exponent(e.exponent())},Ms.apply(e,arguments)}function qbe(){return jA.apply(null,arguments).exponent(.5)}const Lq=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:rA,scaleDiverging:Dq,scaleDivergingLog:Iq,scaleDivergingPow:jA,scaleDivergingSqrt:qbe,scaleDivergingSymlog:Mq,scaleIdentity:mq,scaleImplicit:xN,scaleLinear:pq,scaleLog:yq,scaleOrdinal:nA,scalePoint:O0e,scalePow:hA,scaleQuantile:bq,scaleQuantize:wq,scaleRadial:xq,scaleSequential:zq,scaleSequentialLog:Tq,scaleSequentialPow:SA,scaleSequentialQuantile:Rq,scaleSequentialSqrt:Ube,scaleSequentialSymlog:Pq,scaleSqrt:Sxe,scaleSymlog:vq,scaleThreshold:Sq,scaleTime:$be,scaleUtc:Bbe,tickFormat:hq},Symbol.toStringTag,{value:"Module"}));function Fbe(e){var t=Lq;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(ap(e));if(n in t&&typeof t[n]=="function")return t[n]()}function bM(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=Fbe(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"?bM(e.scale,n,r):bM(t,n,r)}function Hbe(e){return"scale".concat(ap(e))}function Kbe(e){return Hbe(e)in Lq}var $q=(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 Kbe(r)?r:"point"}};function Gbe(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 Bq(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var l;return(l=e(a))!==null&&l!==void 0?l:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var l,c,d=Gbe(r,a);if(d<=0)return n[0];if(d>=n.length)return n[n.length-1];var f=(l=r[d-1])!==null&&l!==void 0?l:0,p=(c=r[d])!==null&&c!==void 0?c:0;return Math.abs(a-f)<=Math.abs(a-p)?n[d-1]:n[d]}}}function Vbe(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):Bq(e,void 0)}function wM(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?wM(Object(n),!0).forEach(function(r){Qbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qbe(e,t,n){return(t=Wbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wbe(e){var t=Ybe(e,"string");return typeof t=="symbol"?t:t+""}function Ybe(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 jN=[0,"auto"],Hn={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"},Uq=(e,t)=>e.cartesianAxis.xAxis[t],Ls=(e,t)=>{var n=Uq(e,t);return n??Hn},Kn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:jN,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:lp},qq=(e,t)=>e.cartesianAxis.yAxis[t],$s=(e,t)=>{var n=qq(e,t);return n??Kn},Zbe={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:""},kA=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??Zbe},Qr=(e,t,n)=>{switch(t){case"xAxis":return Ls(e,n);case"yAxis":return $s(e,n);case"zAxis":return kA(e,n);case"angleAxis":return ZC(e,n);case"radiusAxis":return XC(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Xbe=(e,t,n)=>{switch(t){case"xAxis":return Ls(e,n);case"yAxis":return $s(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},gp=(e,t,n)=>{switch(t){case"xAxis":return Ls(e,n);case"yAxis":return $s(e,n);case"angleAxis":return ZC(e,n);case"radiusAxis":return XC(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Fq=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function Hq(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 Y0=e=>e.graphicalItems.cartesianItems,Jbe=le([er,$0],Hq),Kq=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),Td=le([Y0,Qr,Jbe],Kq,{memoizeOptions:{resultEqualityCheck:F0}}),Gq=le([Td],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(U0)),Vq=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),ewe=le([Td],Vq),Qq=e=>e.map(t=>t.data).filter(Boolean).flat(1),twe=le([Td],e=>e.some(t=>!t.data)),Wq=le([Td],Qq,{memoizeOptions:{resultEqualityCheck:F0}}),Yq=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},CA=le([Wq,R0],Yq),nwe=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:En(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:En(i,r)}))):e.map(r=>({value:r})),Zq=(e,t,n,r,i,a)=>{var{chartData:l=[],dataStartIndex:c,dataEndIndex:d}=r,f=nwe(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=l.slice(c,d+1),m=p.map(y=>({value:En(y,t.dataKey)})).filter(y=>y.value!=null);return[...m,...f]}return f},yp=le([CA,Qr,Td,R0,twe,Wq],Zq);function Qu(e){if(Fa(e)||e instanceof Date){var t=Number(e);if(gt(t))return t}}function SM(e){if(Array.isArray(e)){var t=[Qu(e[0]),Qu(e[1])];return La(t)?t:void 0}var n=Qu(e);if(n!=null)return[n,n]}function Ga(e){return e.map(Qu).filter(si)}function rwe(e,t){var n=Qu(e),r=Qu(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var iwe=le([yp],e=>e?.map(t=>t.value).sort(rwe));function Xq(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function awe(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!pa(t))r=t;else if(Array.isArray(t)){var i=Ga(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Ga(n.flatMap(a=>{var l=En(e,a.dataKey),c,d;if(Array.isArray(l)?[c,d]=l:c=d=l,!(!gt(c)||!gt(d)))return[r-c,r+d]}))}var Wn=e=>{var t=tr(e),n=_d(e);return gp(e,t,n)},fd=le([Wn],e=>e?.dataKey),swe=le([Gq,R0,Wn],iq),Jq=(e,t,n,r)=>{var i={},a=t.reduce((l,c)=>{if(c.stackId==null)return l;var d=l[c.stackId];return d==null&&(d=[]),d.push(c),l[c.stackId]=d,l},i);return Object.fromEntries(Object.entries(a).map(l=>{var[c,d]=l,f=r?[...d].reverse():d,p=f.map(B0);return[c,{stackedData:qme(e,p,n),graphicalItems:f}]}))},iv=le([swe,Gq,D0,ZU],Jq),eF=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var l=Gme(e,i,a);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},owe=le([Qr],e=>e.allowDataOverflow),AA=e=>{var t;if(e==null||!("domain"in e))return jN;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Ga(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:jN},tF=le([Qr],AA),nF=le([tF,owe],LU),lwe=le([iv,wa,er,nF],eF,{memoizeOptions:{resultEqualityCheck:q0}}),EA=e=>e.errorBars,cwe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>Xq(n,r)),av=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),l=Math.min(...a),c=Math.max(...a);return[l,c]}},rF=function(t,n,r,i,a){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],c,d;if(r.length>0&&r.forEach(f=>{var p,m=f.data!=null?[...f.data]:l,y=(p=i[f.id])===null||p===void 0?void 0:p.filter(v=>Xq(a,v));m.forEach(v=>{var w,b=En(v,(w=n.dataKey)!==null&&w!==void 0?w:f.dataKey),j=awe(v,b,y);if(j.length>=2){var k=Math.min(...j),E=Math.max(...j);(c==null||k<c)&&(c=k),(d==null||E>d)&&(d=E)}var O=SM(b);O!=null&&(c=c==null?O[0]:Math.min(c,O[0]),d=d==null?O[1]:Math.max(d,O[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(f=>{var p=SM(En(f,n.dataKey));p!=null&&(c=c==null?p[0]:Math.min(c,p[0]),d=d==null?p[1]:Math.max(d,p[1]))}),gt(c)&>(d))return[c,d]},uwe=le([CA,Qr,ewe,EA,er,Zve],rF,{memoizeOptions:{resultEqualityCheck:q0}});function dwe(e){var{value:t}=e;if(Fa(t)||t instanceof Date)return t}var fwe=(e,t,n)=>{var r=e.map(dwe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&h6(r))?IU(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},iF=e=>e.referenceElements.dots,Pd=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),hwe=le([iF,er,$0],Pd),aF=e=>e.referenceElements.areas,pwe=le([aF,er,$0],Pd),sF=e=>e.referenceElements.lines,mwe=le([sF,er,$0],Pd),oF=(e,t)=>{if(e!=null){var n=Ga(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},gwe=le(hwe,er,oF),lF=(e,t)=>{if(e!=null){var n=Ga(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},ywe=le([pwe,er],lF);function vwe(e){var t;if(e.x!=null)return Ga([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Ga(n)}function xwe(e){var t;if(e.y!=null)return Ga([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Ga(n)}var cF=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?vwe(r):xwe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},bwe=le([mwe,er],cF),wwe=le(gwe,bwe,ywe,(e,t,n)=>av(e,n,t)),uF=(e,t,n,r,i,a,l,c)=>{if(n!=null)return n;var d=l==="vertical"&&c==="xAxis"||l==="horizontal"&&c==="yAxis",f=d?av(r,a,i):av(a,i);return Jve(t,f,e.allowDataOverflow)},Swe=le([Qr,tF,nF,lwe,uwe,wwe,It,er],uF,{memoizeOptions:{resultEqualityCheck:q0}}),jwe=[0,1],dF=(e,t,n,r,i,a,l)=>{if(!((e==null||n==null||n.length===0)&&l===void 0)){var{dataKey:c,type:d}=e,f=Qa(t,a);if(f&&c==null){var p;return IU(0,(p=n?.length)!==null&&p!==void 0?p:0)}return d==="category"?fwe(r,e,f):i==="expand"&&!f?jwe:l}},OA=le([Qr,It,CA,yp,D0,er,Swe],dF),Rd=le([Qr,Fq,QC],$q),fF=(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&&La(e)){if(a)return TI(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return PI(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&La(e))return TI(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&La(e))return PI(e,t.tickCount,t.allowDecimals,"adaptive")}}},_A=le([OA,gp,Rd],fF),hF=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&La(t)&&Array.isArray(n)&&n.length>0){var i,a,l=t[0],c=(i=n[0])!==null&&i!==void 0?i:0,d=t[1],f=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(l,c),Math.max(d,f)]}return t},Nwe=le([Qr,OA,_A,er],hF),kwe=le(yp,Qr,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Ga(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 l=a-i;if(l===0)return 1/0;for(var c=0;c<r.length-1;c++){var d=r[c],f=r[c+1];if(!(d==null||f==null)){var p=f-d;n=Math.min(n,p)}}return n/l}}),pF=le(kwe,It,YU,Jn,(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 l=ma(n,e*a),c=e*a/2;return c-l-(c-l)/a*l}return 0}),Cwe=(e,t,n)=>{var r=Ls(e,t);return r==null||typeof r.padding!="string"?0:pF(e,"xAxis",t,n,r.padding)},Awe=(e,t,n)=>{var r=$s(e,t);return r==null||typeof r.padding!="string"?0:pF(e,"yAxis",t,n,r.padding)},Ewe=le(Ls,Cwe,(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}}),Owe=le($s,Awe,(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}}),_we=le([Jn,Ewe,A0,C0,(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]}),zwe=le([Jn,It,Owe,A0,C0,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:l}=i;return a?[r.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),vp=(e,t,n,r)=>{var i;switch(t){case"xAxis":return _we(e,n,r);case"yAxis":return zwe(e,n,r);case"zAxis":return(i=kA(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return tq(e);case"radiusAxis":return nq(e,n);default:return}},mF=le([Qr,vp],I0),Twe=le([Rd,Nwe],p0e),zA=le([Qr,Rd,Twe,mF],NA),gF=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,l=Qa(e,r);if(l&&(i==="number"||a!=="auto"))return t.map(c=>c.value)}},TA=le([It,yp,gp,er],gF),Z0=le([zA],eA);le([zA],Vbe);le([zA,iwe],Bq);le([Td,EA,er],cwe);function yF(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var X0=(e,t)=>t,J0=(e,t,n)=>n,Pwe=le(N0,X0,J0,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(yF)),Rwe=le(k0,X0,J0,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(yF)),vF=(e,t)=>({width:e.width,height:t.height}),Dwe=(e,t)=>{var n=typeof t.width=="number"?t.width:lp;return{width:n,height:e.height}},xF=le(Jn,Ls,vF),Iwe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},Mwe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},Lwe=le(Is,Jn,Pwe,X0,J0,(e,t,n,r,i)=>{var a={},l;return n.forEach(c=>{var d=vF(t,c);l==null&&(l=Iwe(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[c.id]=l-Number(f)*d.height,l+=(f?-1:1)*d.height}),a}),$we=le(Ds,Jn,Rwe,X0,J0,(e,t,n,r,i)=>{var a={},l;return n.forEach(c=>{var d=Dwe(t,c);l==null&&(l=Mwe(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[c.id]=l-Number(f)*d.width,l+=(f?-1:1)*d.width}),a}),Bwe=(e,t)=>{var n=Ls(e,t);if(n!=null)return Lwe(e,n.orientation,n.mirror)},Uwe=le([Jn,Ls,Bwe,(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}}}),qwe=(e,t)=>{var n=$s(e,t);if(n!=null)return $we(e,n.orientation,n.mirror)},Fwe=le([Jn,$s,qwe,(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}}}),bF=le(Jn,$s,(e,t)=>{var n=typeof t.width=="number"?t.width:lp;return{width:n,height:e.height}}),jM=(e,t,n)=>{switch(t){case"xAxis":return xF(e,n).width;case"yAxis":return bF(e,n).height;default:return}},wF=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:l}=n,c=Qa(e,r),d=t.map(p=>p.value),f=d.filter(p=>p!=null);if(l&&c&&a==="category"&&i&&h6(f))return d}},PA=le([It,yp,Qr,er],wF),NM=le([It,Xbe,Rd,Z0,PA,TA,vp,_A,er],(e,t,n,r,i,a,l,c,d)=>{if(t!=null){var f=Qa(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:c,range:l,realScaleType:n,scale:r}}}),Hwe=(e,t,n,r,i,a,l,c,d)=>{if(!(t==null||r==null)){var f=Qa(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?ai(a[0]-a[1])*2*w:w;var b=m||i;return b?b.map((j,k)=>{var E=l?l.indexOf(j):j,O=r.map(E);return gt(O)?{index:k,coordinate:O+w,value:j,offset:w}:null}).filter(si):f&&c?c.map((j,k)=>{var E=r.map(j);return gt(E)?{coordinate:E+w,value:j,index:k,offset:w}:null}).filter(si):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(si):r.domain().map((j,k)=>{var E=r.map(j);return gt(E)?{coordinate:E+w,value:l?l[j]:j,index:k,offset:w}:null}).filter(si)}},SF=le([It,gp,Rd,Z0,_A,vp,PA,TA,er],Hwe),Kwe=(e,t,n,r,i,a,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var c=Qa(e,l),{tickCount:d}=t,f=0;return f=l==="angleAxis"&&r?.length>=2?ai(r[0]-r[1])*2*f:f,c&&a?a.map((p,m)=>{var y=n.map(p);return gt(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(si):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(si):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(si)}},Uo=le([It,gp,Z0,vp,PA,TA,er],Kwe),qo=le(Qr,Z0,(e,t)=>{if(!(e==null||t==null))return rv(rv({},e),{},{scale:t})}),Gwe=le([Qr,Rd,OA,mF],NA),Vwe=le([Gwe],eA);le((e,t,n)=>kA(e,n),Vwe,(e,t)=>{if(!(e==null||t==null))return rv(rv({},e),{},{scale:t})});var Qwe=le([It,N0,k0],(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}}),Wwe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};le([Wwe],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var l=Math.abs(a.coordinate-t);l<r&&(r=l,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var jF=e=>e.options.defaultTooltipEventType,NF=e=>e.options.validateTooltipEventTypes;function kF(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function xp(e,t){var n=jF(e),r=NF(e);return kF(t,n,r)}function Ywe(e){return Fe(t=>xp(t,e))}var CF=(e,t)=>{var n,r=Number(t);if(!(pa(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},Zwe=e=>e.tooltip.settings,ko={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},Xwe={itemInteraction:{click:ko,hover:ko},axisInteraction:{click:ko,hover:ko},keyboardInteraction:ko,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}},AF=Dr({name:"tooltip",initialState:Xwe,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:rn()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Ki(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:rn()},removeTooltipEntrySettings:{reducer(e,t){var n=Ki(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:Jwe,replaceTooltipEntrySettings:eSe,removeTooltipEntrySettings:tSe,setTooltipSettingsState:nSe,setActiveMouseOverItemIndex:EF,mouseLeaveItem:rSe,mouseLeaveChart:OF,setActiveClickItemIndex:iSe,setMouseOverAxisIndex:_F,setMouseClickAxisIndex:aSe,setSyncInteraction:rh,setKeyboardInteraction:sv}=AF.actions,sSe=AF.reducer;function kM(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 vg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kM(Object(n),!0).forEach(function(r){oSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oSe(e,t,n){return(t=lSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lSe(e){var t=cSe(e,"string");return typeof t=="symbol"?t:t+""}function cSe(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 uSe(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function dSe(e){return e.index!=null}var zF=(e,t,n,r)=>{if(t==null)return ko;var i=uSe(e,t,n);if(i==null)return ko;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(dSe(i)){if(a)return vg(vg({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return vg(vg({},ko),{},{coordinate:i.coordinate})};function fSe(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 hSe(e,t){var n=fSe(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),l=Math.max(r,i);return n>=a&&n<=l}function pSe(e,t,n){if(n==null||t==null)return!0;var r=En(e,t);return r==null||!La(n)?!0:hSe(r,n)}var ph=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!gt(a))return i;var l=0,c=1/0;t.length>0&&(c=t.length-1);var d=Math.max(l,Math.min(a,c)),f=t[d];return f==null||pSe(f,n,r)?String(d):null},TF=(e,t,n,r,i,a,l)=>{if(a!=null){var c=l[0],d=c?.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}}},PF=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(l=>{var c;return((c=l.settings)===null||c===void 0?void 0:c.graphicalItemId)===i})},RF=e=>e.options.tooltipPayloadSearcher,Dd=e=>e.tooltip;function CM(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 AM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CM(Object(n),!0).forEach(function(r){mSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mSe(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=ySe(e,"string");return typeof t=="symbol"?t:t+""}function ySe(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 vSe(e){if(typeof e=="string"||typeof e=="number")return e}function xSe(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function bSe(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function EM(e){if(typeof e=="string")return e}function wSe(e){if(!(e==null||typeof e!="object")){var t="name"in e?vSe(e.name):void 0,n="unit"in e?xSe(e.unit):void 0,r="dataKey"in e?bSe(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?EM(e.color):void 0,l="fill"in e?EM(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:l}}}function SSe(e,t){return e??t}var DF=(e,t,n,r,i,a,l)=>{if(!(t==null||a==null)){var{chartData:c,computedData:d,dataStartIndex:f,dataEndIndex:p}=n,m=[];return e.reduce((y,v)=>{var w,{dataDefinedOnItem:b,settings:j}=v,k=SSe(b,c),E=Array.isArray(k)?lU(k,f,p):k,O=(w=j?.dataKey)!==null&&w!==void 0?w:r,C=j?.nameKey,z;if(r&&Array.isArray(E)&&!Array.isArray(E[0])&&l==="axis"?z=p6(E,r,i):z=a(E,t,d,C),Array.isArray(z))z.forEach(_=>{var R,$,F=wSe(_),q=F?.name,B=F?.dataKey,K=F?.payload,X=AM(AM({},j),{},{name:q,unit:F?.unit,color:(R=F?.color)!==null&&R!==void 0?R:j?.color,fill:($=F?.fill)!==null&&$!==void 0?$:j?.fill});y.push(bD({tooltipEntrySettings:X,dataKey:B,payload:K,value:En(K,B),name:q==null?void 0:String(q)}))});else{var A;y.push(bD({tooltipEntrySettings:j,dataKey:O,payload:z,value:En(z,O),name:(A=En(z,C))!==null&&A!==void 0?A:j?.name}))}return y},m)}},RA=le([Wn,Fq,QC],$q),jSe=le([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),NSe=le([tr,_d],Hq),Sc=le([jSe,Wn,NSe],Kq,{memoizeOptions:{resultEqualityCheck:F0}}),kSe=le([Sc],e=>e.filter(U0)),IF=le([Sc],Qq,{memoizeOptions:{resultEqualityCheck:F0}}),CSe=le([Sc],e=>e.some(t=>!t.data)),oc=le([IF,wa],Yq),ASe=le([kSe,wa,Wn],iq),DA=le([oc,Wn,Sc,wa,CSe,IF],Zq),MF=le([Wn],AA),ESe=le([Wn],e=>e.allowDataOverflow),LF=le([MF,ESe],LU),OSe=le([Sc],e=>e.filter(U0)),_Se=le([ASe,OSe,D0,ZU],Jq),zSe=le([_Se,wa,tr,LF],eF),TSe=le([Sc],Vq),PSe=le([oc,Wn,TSe,EA,tr,Xve],rF,{memoizeOptions:{resultEqualityCheck:q0}}),RSe=le([iF,tr,_d],Pd),DSe=le([RSe,tr],oF),ISe=le([aF,tr,_d],Pd),MSe=le([ISe,tr],lF),LSe=le([sF,tr,_d],Pd),$Se=le([LSe,tr],cF),BSe=le([DSe,$Se,MSe],av),USe=le([Wn,MF,LF,zSe,PSe,BSe,It,tr],uF),hd=le([Wn,It,oc,DA,D0,tr,USe],dF),qSe=le([hd,Wn,RA],fF),FSe=le([Wn,hd,qSe,tr],hF),$F=e=>{var t=tr(e),n=_d(e),r=!1;return vp(e,t,n,r)},BF=le([Wn,$F],I0),HSe=le([Wn,RA,FSe,BF],NA),UF=le([HSe],eA),KSe=le([It,DA,Wn,tr],wF),GSe=le([It,DA,Wn,tr],gF),VSe=(e,t,n,r,i,a,l,c)=>{if(t){var{type:d}=t,f=Qa(e,c);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,m=d==="category"&&r.bandwidth?r.bandwidth()/p:0;return m=c==="angleAxis"&&i!=null&&i?.length>=2?ai(i[0]-i[1])*2*m:m,f&&l?l.map((y,v)=>{var w=r.map(y);return gt(w)?{coordinate:w+m,value:y,index:v,offset:m}:null}).filter(si):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(si)}}},Bs=le([It,Wn,RA,UF,$F,KSe,GSe,tr],VSe),IA=le([jF,NF,Zwe],(e,t,n)=>kF(n.shared,e,t)),qF=e=>e.tooltip.settings.trigger,MA=e=>e.tooltip.settings.defaultIndex,bp=le([Dd,IA,qF,MA],zF),lc=le([bp,oc,fd,hd],ph),FF=le([Bs,lc],CF),HF=le([bp],e=>{if(e)return e.dataKey}),QSe=le([bp],e=>{if(e)return e.graphicalItemId}),KF=le([Dd,IA,qF,MA],PF),WSe=le([Ds,Is,It,Jn,Bs,MA,KF],TF),YSe=le([bp,WSe],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),ZSe=le([bp],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),XSe=le([KF,lc,wa,fd,FF,RF,IA],DF),JSe=le([XSe],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function OM(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 _M(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OM(Object(n),!0).forEach(function(r){eje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eje(e,t,n){return(t=tje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tje(e){var t=nje(e,"string");return typeof t=="symbol"?t:t+""}function nje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rje=()=>Fe(Wn),ije=()=>{var e=rje(),t=Fe(Bs),n=Fe(UF);return sd(!e||!n?void 0:_M(_M({},e),{},{scale:n}),t)};function zM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zM(Object(n),!0).forEach(function(r){aje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aje(e,t,n){return(t=sje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sje(e){var t=oje(e,"string");return typeof t=="symbol"?t:t+""}function oje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lje=(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}},cje=(e,t,n,r)=>{var i=t.find(f=>f&&f.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:l}=r;return bu(bu(bu({},r),gr(r.cx,r.cy,l,a)),{},{angle:a,radius:l})}var c=i.coordinate,{angle:d}=r;return bu(bu(bu({},r),gr(r.cx,r.cy,c,d)),{},{angle:d,radius:c})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function uje(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 GF=(e,t,n,r,i)=>{var a,l=(a=t?.length)!==null&&a!==void 0?a:0;if(l<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var c=0;c<l;c++){var d,f,p,m,y,v=c>0?(d=n[c-1])===null||d===void 0?void 0:d.coordinate:(f=n[l-1])===null||f===void 0?void 0:f.coordinate,w=(p=n[c])===null||p===void 0?void 0:p.coordinate,b=c>=l-1?(m=n[0])===null||m===void 0?void 0:m.coordinate:(y=n[c+1])===null||y===void 0?void 0:y.coordinate,j=void 0;if(!(v==null||w==null||b==null))if(ai(w-v)!==ai(b-w)){var k=[];if(ai(b-w)===ai(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 O=b+i[1]-i[0];k[0]=Math.min(w,(O+w)/2),k[1]=Math.max(w,(O+w)/2)}var C=[Math.min(w,(j+w)/2),Math.max(w,(j+w)/2)];if(e>C[0]&&e<=C[1]||e>=k[0]&&e<=k[1]){var z;return(z=n[c])===null||z===void 0?void 0:z.index}}else{var A=Math.min(v,b),_=Math.max(v,b);if(e>(A+w)/2&&e<=(_+w)/2){var R;return(R=n[c])===null||R===void 0?void 0:R.index}}}else if(t)for(var $=0;$<l;$++){var F=t[$];if(F!=null){var q=t[$+1],B=t[$-1];if($===0&&q!=null&&e<=(F.coordinate+q.coordinate)/2||$===l-1&&B!=null&&e>(F.coordinate+B.coordinate)/2||$>0&&$<l-1&&B!=null&&q!=null&&e>(F.coordinate+B.coordinate)/2&&e<=(F.coordinate+q.coordinate)/2)return F.index}}return-1},VF=()=>Fe(QC),LA=(e,t)=>t,QF=(e,t,n)=>n,$A=(e,t,n,r)=>r,dje=le(Bs,e=>h0(e,t=>t.coordinate)),BA=le([Dd,LA,QF,$A],zF),UA=le([BA,oc,fd,hd],ph),fje=(e,t,n)=>{if(t!=null){var r=Dd(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},WF=le([Dd,LA,QF,$A],PF),ov=le([Ds,Is,It,Jn,Bs,$A,WF],TF),hje=le([BA,ov],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),YF=le([Bs,UA],CF),pje=le([WF,UA,wa,fd,YF,RF,LA],DF),mje=le([BA,UA],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),gje=(e,t,n,r,i,a,l)=>{if(!(!e||!n||!r||!i)&&uje(e,l)){var c=Vme(e,t),d=GF(c,a,i,n,r),f=lje(t,i,d,e);return{activeIndex:String(d),activeCoordinate:f}}},yje=(e,t,n,r,i,a,l)=>{if(!(!e||!r||!i||!a||!n)){var c=Uve(e,n);if(c){var d=Qme(c,t),f=GF(d,l,a,r,i),p=cje(t,a,f,c);return{activeIndex:String(f),activeCoordinate:p}}}},vje=(e,t,n,r,i,a,l,c)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?gje(e,t,r,i,a,l,c):yje(e,t,n,r,i,a,l)},xje=le(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}}),bje=le(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Xn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:h0e}});function TM(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 PM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TM(Object(n),!0).forEach(function(r){wje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wje(e,t,n){return(t=Sje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sje(e){var t=jje(e,"string");return typeof t=="symbol"?t:t+""}function jje(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 Nje={},kje={zIndexMap:Object.values(Xn).reduce((e,t)=>PM(PM({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Nje)},Cje=new Set(Object.values(Xn));function Aje(e){return Cje.has(e)}var ZF=Dr({name:"zIndex",initialState:kje,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&&!Aje(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:Eje,unregisterZIndexPortal:Aj,registerZIndexPortalElement:Oje,unregisterZIndexPortalElement:_je}=ZF.actions,zje=ZF.reducer;function ta(e){var{zIndex:t,children:n}=e,r=Age(),i=r&&t!==void 0&&t!==0,a=Ir(),l=x.useRef(void 0),c=x.useRef(new Set),d=sn(),f=Fe(m=>xje(m,t,a));if(x.useLayoutEffect(()=>{if(!i){var m=c.current;m.forEach(v=>{d(Aj({zIndex:v}))}),m.clear(),l.current=void 0;return}if(c.current.has(t)||(d(Eje({zIndex:t})),c.current.add(t)),f){l.current=f;var y=c.current;y.forEach(v=>{v!==t&&(d(Aj({zIndex:v})),y.delete(v))})}},[d,t,i,f]),x.useLayoutEffect(()=>{var m=c.current;return()=>{m.forEach(y=>{d(Aj({zIndex:y}))}),m.clear()}},[d]),!i)return n;var p=f??l.current;return p?dc.createPortal(n,p):null}function NN(){return NN=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},NN.apply(null,arguments)}function RM(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 xg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RM(Object(n),!0).forEach(function(r){Tje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tje(e,t,n){return(t=Pje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pje(e){var t=Rje(e,"string");return typeof t=="symbol"?t:t+""}function Rje(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 Dje(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function Ije(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:l,layout:c,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=tve,j=Xn.cursorLine;else if(p==="BarChart")w=nve(c,m,a,l),b=TU,j=Xn.cursorRectangle;else if(c==="radial"&&g6(m)){var{cx:k,cy:E,radius:O,startAngle:C,endAngle:z}=PU(m);w={cx:k,cy:E,startAngle:C,endAngle:z,innerRadius:O,outerRadius:O},b=DU,j=Xn.cursorLine}else w={points:Kve(c,m,a)},b=hh,j=Xn.cursorLine;var A=typeof d=="object"&&"className"in d?d.className:void 0,_=xg(xg(xg(xg({stroke:"#ccc",pointerEvents:"none"},a),w),ip(d)),{},{payload:y,payloadIndex:v,className:Rt("recharts-tooltip-cursor",A)});return x.createElement(ta,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:j},x.createElement(Dje,{cursor:d,cursorComp:b,cursorProps:_}))}function Mje(e){var t=ije(),n=gU(),r=xc(),i=VF();return t==null||n==null||r==null||i==null?null:x.createElement(Ije,NN({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var XF=x.createContext(null),Lje=()=>x.useContext(XF),Ej={exports:{}},DM;function $je(){return DM||(DM=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 l(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function c(){this._events=new r,this._eventsCount=0}c.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},c.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},c.prototype.listenerCount=function(f){var p=n?n+f:f,m=this._events[p];return m?m.fn?1:m.length:0},c.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,O;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(O=1,E=new Array(k-1);O<k;O++)E[O-1]=arguments[O];j.fn.apply(j.context,E)}else{var C=j.length,z;for(O=0;O<C;O++)switch(j[O].once&&this.removeListener(f,j[O].fn,void 0,!0),k){case 1:j[O].fn.call(j[O].context);break;case 2:j[O].fn.call(j[O].context,p);break;case 3:j[O].fn.call(j[O].context,p,m);break;case 4:j[O].fn.call(j[O].context,p,m,y);break;default:if(!E)for(z=1,E=new Array(k-1);z<k;z++)E[z-1]=arguments[z];j[O].fn.apply(j[O].context,E)}}return!0},c.prototype.on=function(f,p,m){return a(this,f,p,m,!1)},c.prototype.once=function(f,p,m){return a(this,f,p,m,!0)},c.prototype.removeListener=function(f,p,m,y){var v=n?n+f:f;if(!this._events[v])return this;if(!p)return l(this,v),this;var w=this._events[v];if(w.fn)w.fn===p&&(!y||w.once)&&(!m||w.context===m)&&l(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:l(this,v)}return this},c.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&l(this,p)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(Ej)),Ej.exports}var Bje=$je();const Uje=ya(Bje);var Hh=new Uje,kN="recharts.syncEvent.tooltip",IM="recharts.syncEvent.brush",JF=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!pa(n))return e[n]}},qje={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},e8=Dr({name:"options",initialState:qje,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Fje=e8.reducer,{createEventEmitter:Hje}=e8.actions;function Kje(e){return e.tooltip.syncInteraction}var Gje={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},t8=Dr({name:"chartData",initialState:Gje,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:MM,setDataStartEndIndexes:Vje,setComputedData:Vze}=t8.actions,Qje=t8.reducer,Wje=["x","y"];function LM(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 wu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LM(Object(n),!0).forEach(function(r){Yje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yje(e,t,n){return(t=Zje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zje(e){var t=Xje(e,"string");return typeof t=="symbol"?t:t+""}function Xje(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 Jje(e,t){if(e==null)return{};var n,r,i=e1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function e1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function t1e(){var e=Fe(WC),t=Fe(YC),n=sn(),r=Fe(XU),i=Fe(Bs),a=xc(),l=E0(),c=Fe(d=>d.rootProps.className);x.useEffect(()=>{if(e==null)return vc;var d=(f,p,m)=>{if(t!==m&&e===f){if(p.payload.active===!1){n(rh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var y;if(l&&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=Jje(v,Wje),{x:k,y:E,width:O,height:C}=p.payload.sourceViewBox,z=wu(wu({},j),{},{x:l.x+(O?(w-k)/O:0)*l.width,y:l.y+(C?(b-E)/C:0)*l.height});n(wu(wu({},p),{},{payload:wu(wu({},p.payload),{},{coordinate:z})}))}else n(p);return}if(i!=null){var A;if(typeof r=="function"){var _={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},R=r(i,_);A=i[R]}else r==="value"&&(A=i.find(H=>String(H.value)===p.payload.label));var{coordinate:$}=p.payload;if($==null||l==null){n(rh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(A==null){n(rh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:F,y:q}=$,B=Math.min(F,l.x+l.width),K=Math.min(q,l.y+l.height),X={x:a==="horizontal"?A.coordinate:B,y:a==="horizontal"?K:A.coordinate},Q=rh({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(Q)}}};return Hh.on(kN,d),()=>{Hh.off(kN,d)}},[c,n,t,e,r,i,a,l])}function n1e(){var e=Fe(WC),t=Fe(YC),n=sn();x.useEffect(()=>{if(e==null)return vc;var r=(i,a,l)=>{t!==l&&e===i&&n(Vje(a))};return Hh.on(IM,r),()=>{Hh.off(IM,r)}},[n,t,e])}function r1e(){var e=sn();x.useEffect(()=>{e(Hje())},[e]),t1e(),n1e()}function i1e(e,t,n,r,i,a){var l=Fe(w=>fje(w,e,t)),c=Fe(QSe),d=Fe(YC),f=Fe(WC),p=Fe(XU),m=Fe(Kje),y=m?.sourceViewBox!=null,v=E0();x.useEffect(()=>{if(!y&&f!=null&&d!=null){var w=rh({active:a,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:c});Hh.emit(kN,f,w,d)}},[y,n,l,c,i,r,d,f,p,a,v])}function $M(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 BM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$M(Object(n),!0).forEach(function(r){a1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$M(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function a1e(e,t,n){return(t=s1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s1e(e){var t=o1e(e,"string");return typeof t=="symbol"?t:t+""}function o1e(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 l1e(e){return e.dataKey}function c1e(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(_ye,t)}var UM=[],u1e={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 lv(e){var t,n,r=Rr(e,u1e),{active:i,allowEscapeViewBox:a,animationDuration:l,animationEasing:c,content:d,filterNull:f,isAnimationActive:p,offset:m,payloadUniqBy:y,position:v,reverseDirection:w,useTranslate3d:b,wrapperStyle:j,cursor:k,shared:E,trigger:O,defaultIndex:C,portal:z,axisId:A}=r,_=sn(),R=typeof C=="number"?String(C):C;x.useEffect(()=>{_(nSe({shared:E,trigger:O,axisId:A,active:i,defaultIndex:R}))},[_,E,O,A,i,R]);var $=E0(),F=AU(),q=Ywe(E),{activeIndex:B,isActive:K}=(t=Fe(ze=>mje(ze,q,O,R)))!==null&&t!==void 0?t:{},X=Fe(ze=>pje(ze,q,O,R)),Q=Fe(ze=>YF(ze,q,O,R)),H=Fe(ze=>hje(ze,q,O,R)),J=X,de=Lje(),be=(n=i??K)!==null&&n!==void 0?n:!1,[M,D]=T6([J,be]),U=q==="axis"?Q:void 0;i1e(q,O,H,U,B,be);var I=z??de;if(I==null||$==null||q==null)return null;var V=J??UM;be||(V=UM),f&&V.length&&(V=A6(V.filter(ze=>ze.value!=null&&(ze.hide!==!0||r.includeHidden)),y,l1e));var ce=V.length>0,re=BM(BM({},r),{},{payload:V,label:U,active:be,activeIndex:B,coordinate:H,accessibilityLayer:F}),ke=x.createElement(Uye,{allowEscapeViewBox:a,animationDuration:l,animationEasing:c,isAnimationActive:p,active:be,coordinate:H,hasPayload:ce,offset:m,position:v,reverseDirection:w,useTranslate3d:b,viewBox:$,wrapperStyle:j,lastBoundingBox:M,innerRef:D,hasPortalFromProps:!!z},c1e(d,re));return x.createElement(x.Fragment,null,dc.createPortal(ke,I),be&&x.createElement(Mje,{cursor:k,tooltipEventType:q,coordinate:H,payload:V,index:B}))}var cv=e=>null;cv.displayName="Cell";function d1e(e,t,n){return(t=f1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f1e(e){var t=h1e(e,"string");return typeof t=="symbol"?t:t+""}function h1e(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 p1e{constructor(t){d1e(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 qM(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 m1e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qM(Object(n),!0).forEach(function(r){g1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function g1e(e,t,n){return(t=y1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y1e(e){var t=v1e(e,"string");return typeof t=="symbol"?t:t+""}function v1e(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 x1e={cacheSize:2e3,enableCache:!0},n8=m1e({},x1e),FM=new p1e(n8.cacheSize),b1e={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},HM="recharts_measurement_span";function w1e(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",l=t.letterSpacing||"",c=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(l,"|").concat(c)}var KM=(e,t)=>{try{var n=document.getElementById(HM);n||(n=document.createElement("span"),n.setAttribute("id",HM),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,b1e,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},mh=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||dp.isSsr)return{width:0,height:0};if(!n8.enableCache)return KM(t,n);var r=w1e(t,n),i=FM.get(r);if(i)return i;var a=KM(t,n);return FM.set(r,a),a},r8;function S1e(e,t,n){return(t=j1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j1e(e){var t=N1e(e,"string");return typeof t=="symbol"?t:t+""}function N1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var GM=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,VM=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,k1e=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,C1e=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,A1e={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},E1e=["cm","mm","pt","pc","in","Q","px"];function O1e(e){return E1e.includes(e)}var Iu="NaN";function _1e(e,t){return e*A1e[t]}class fr{static parse(t){var n,[,r,i]=(n=C1e.exec(t))!==null&&n!==void 0?n:[];return r==null?fr.NaN:new fr(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,pa(t)&&(this.unit=""),n!==""&&!k1e.test(n)&&(this.num=NaN,this.unit=""),O1e(n)&&(this.num=_1e(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new fr(NaN,""):new fr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new fr(NaN,""):new fr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new fr(NaN,""):new fr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new fr(NaN,""):new fr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return pa(this.num)}}r8=fr;S1e(fr,"NaN",new r8(NaN,""));function i8(e){if(e==null||e.includes(Iu))return Iu;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=GM.exec(t))!==null&&n!==void 0?n:[],l=fr.parse(r??""),c=fr.parse(a??""),d=i==="*"?l.multiply(c):l.divide(c);if(d.isNaN())return Iu;t=t.replace(GM,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,p,m,y]=(f=VM.exec(t))!==null&&f!==void 0?f:[],v=fr.parse(p??""),w=fr.parse(y??""),b=m==="+"?v.add(w):v.subtract(w);if(b.isNaN())return Iu;t=t.replace(VM,b.toString())}return t}var QM=/\(([^()]*)\)/;function z1e(e){for(var t=e,n;(n=QM.exec(t))!=null;){var[,r]=n;t=t.replace(QM,i8(r))}return t}function T1e(e){var t=e.replace(/\s+/g,"");return t=z1e(t),t=i8(t),t}function P1e(e){try{return T1e(e)}catch{return Iu}}function Oj(e){var t=P1e(e.slice(5,-1));return t===Iu?"":t}var R1e=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],D1e=["dx","dy","angle","className","breakAll"];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 WM(e,t){if(e==null)return{};var n,r,i=I1e(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 I1e(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]+/,s8=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];pn(t)||(n?i=t.toString().split(""):i=t.toString().split(a8));var a=i.map(c=>({word:c,width:mh(c,r).width})),l=n?0:mh(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:l}}catch{return null}};function o8(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function M1e(e){return pn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var l8=(e,t,n,r)=>e.reduce((i,a)=>{var{word:l,width:c}=a,d=i[i.length-1];if(d&&c!=null&&(t==null||r||d.width+c+n<Number(t)))d.words.push(l),d.width+=c+n;else{var f={words:[l],width:c};i.push(f)}return i},[]),c8=e=>e.reduce((t,n)=>t.width>n.width?t:n),L1e="…",YM=(e,t,n,r,i,a,l,c)=>{var d=e.slice(0,t),f=s8({breakAll:n,style:r,children:d+L1e});if(!f)return[!1,[]];var p=l8(f.wordsWithComputedWidth,a,l,c),m=p.length>i||c8(p).width>Number(a);return[m,p]},$1e=(e,t,n,r,i)=>{var{maxLines:a,children:l,style:c,breakAll:d}=e,f=Re(a),p=String(l),m=l8(t,r,n,i);if(!f||i)return m;var y=m.length>a||c8(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,[O,C]=YM(p,E,d,c,a,r,n,i),[z]=YM(p,k,d,c,a,r,n,i);if(!O&&!z&&(v=k+1),O&&z&&(w=k-1),!O&&z){j=C;break}b++}return j||m},ZM=e=>{var t=pn(e)?[]:e.toString().split(a8);return[{words:t,width:void 0}]},B1e=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:l}=e;if((t||n)&&!dp.isSsr){var c,d,f=s8({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:p,spaceWidth:m}=f;c=p,d=m}else return ZM(r);return $1e({breakAll:a,children:r,maxLines:l,style:i},c,d,t,!!n)}return ZM(r)},u8="#808080",U1e={angle:0,breakAll:!1,capHeight:"0.71em",fill:u8,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},qA=x.forwardRef((e,t)=>{var n=Rr(e,U1e),{x:r,y:i,lineHeight:a,capHeight:l,fill:c,scaleToFit:d,textAnchor:f,verticalAnchor:p}=n,m=WM(n,R1e),y=x.useMemo(()=>B1e({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=WM(m,D1e);if(!Fa(r)||!Fa(i)||y.length===0)return null;var O=Number(r)+(Re(v)?v:0),C=Number(i)+(Re(w)?w:0);if(!gt(O)||!gt(C))return null;var z;switch(p){case"start":z=Oj("calc(".concat(l,")"));break;case"middle":z=Oj("calc(".concat((y.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:z=Oj("calc(".concat(y.length-1," * -").concat(a,")"));break}var A=[],_=y[0];if(d&&_!=null){var R=_.width,{width:$}=m;A.push("scale(".concat(Re($)&&Re(R)?$/R:1,")"))}return b&&A.push("rotate(".concat(b,", ").concat(O,", ").concat(C,")")),A.length&&(E.transform=A.join(" ")),x.createElement("text",CN({},Gr(E),{ref:t,x:O,y:C,className:Rt("recharts-text",j),textAnchor:f,fill:c.includes("url")?u8:c}),y.map((F,q)=>{var B=F.words.join(k?"":" ");return x.createElement("tspan",{x:O,dy:q===0?z:a,key:"".concat(B,"-").concat(q)},B)}))});qA.displayName="Text";function XM(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 _a(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XM(Object(n),!0).forEach(function(r){q1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function q1e(e,t,n){return(t=F1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F1e(e){var t=H1e(e,"string");return typeof t=="symbol"?t:t+""}function H1e(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 K1e=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:l,height:c,upperWidth:d,lowerWidth:f}=LC(t),p=a,m=a+(d-f)/2,y=(p+m)/2,v=(d+f)/2,w=p+d/2,b=c>=0?1:-1,j=b*r,k=b>0?"end":"start",E=b>0?"start":"end",O=d>=0?1:-1,C=O*r,z=O>0?"end":"start",A=O>0?"start":"end",_=i;if(n==="top"){var R={x:p+d/2,y:l-j,horizontalAnchor:"middle",verticalAnchor:k};return _&&(R.height=Math.max(l-_.y,0),R.width=d),R}if(n==="bottom"){var $={x:m+f/2,y:l+c+j,horizontalAnchor:"middle",verticalAnchor:E};return _&&($.height=Math.max(_.y+_.height-(l+c),0),$.width=f),$}if(n==="left"){var F={x:y-C,y:l+c/2,horizontalAnchor:z,verticalAnchor:"middle"};return _&&(F.width=Math.max(F.x-_.x,0),F.height=c),F}if(n==="right"){var q={x:y+v+C,y:l+c/2,horizontalAnchor:A,verticalAnchor:"middle"};return _&&(q.width=Math.max(_.x+_.width-q.x,0),q.height=c),q}var B=_?{width:v,height:c}:{};return n==="insideLeft"?_a({x:y+C,y:l+c/2,horizontalAnchor:A,verticalAnchor:"middle"},B):n==="insideRight"?_a({x:y+v-C,y:l+c/2,horizontalAnchor:z,verticalAnchor:"middle"},B):n==="insideTop"?_a({x:p+d/2,y:l+j,horizontalAnchor:"middle",verticalAnchor:E},B):n==="insideBottom"?_a({x:m+f/2,y:l+c-j,horizontalAnchor:"middle",verticalAnchor:k},B):n==="insideTopLeft"?_a({x:p+C,y:l+j,horizontalAnchor:A,verticalAnchor:E},B):n==="insideTopRight"?_a({x:p+d-C,y:l+j,horizontalAnchor:z,verticalAnchor:E},B):n==="insideBottomLeft"?_a({x:m+C,y:l+c-j,horizontalAnchor:A,verticalAnchor:k},B):n==="insideBottomRight"?_a({x:m+f-C,y:l+c-j,horizontalAnchor:z,verticalAnchor:k},B):n&&typeof n=="object"&&(Re(n.x)||nc(n.x))&&(Re(n.y)||nc(n.y))?_a({x:a+ma(n.x,v),y:l+ma(n.y,c),horizontalAnchor:"end",verticalAnchor:"end"},B):_a({x:w,y:l+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},B)},G1e=["labelRef"],V1e=["content"];function JM(e,t){if(e==null)return{};var n,r,i=Q1e(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 Q1e(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 eL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ih(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eL(Object(n),!0).forEach(function(r){W1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function W1e(e,t,n){return(t=Y1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y1e(e){var t=Z1e(e,"string");return typeof t=="symbol"?t:t+""}function Z1e(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 ws(){return ws=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},ws.apply(null,arguments)}var d8=x.createContext(null),X1e=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l,children:c}=e,d=x.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l}),[t,n,r,i,a,l]);return x.createElement(d8.Provider,{value:d},c)},f8=()=>{var e=x.useContext(d8),t=E0();return e||(t?LC(t):void 0)},J1e=x.createContext(null),eNe=()=>{var e=x.useContext(J1e),t=Fe(rq);return e||t},tNe=e=>{var{value:t,formatter:n}=e,r=pn(e.children)?t:e.children;return typeof n=="function"?n(r):r},FA=e=>e!=null&&typeof e=="function",nNe=(e,t)=>{var n=ai(t-e),r=Math.min(Math.abs(t-e),360);return n*r},rNe=(e,t,n,r,i)=>{var{offset:a,className:l}=e,{cx:c,cy:d,innerRadius:f,outerRadius:p,startAngle:m,endAngle:y,clockWise:v}=i,w=(f+p)/2,b=nNe(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 O=gr(c,d,w,k),C=gr(c,d,w,k+(E?1:-1)*359),z="M".concat(O.x,",").concat(O.y,`
|
|
288
|
-
A`).concat(w,",").concat(w,",0,1,").concat(E?0:1,`,
|
|
289
|
-
`).concat(C.x,",").concat(C.y),A=pn(e.id)?zh("recharts-radial-line-"):e.id;return x.createElement("text",ws({},r,{dominantBaseline:"central",className:Rt("recharts-radial-bar-label",l)}),x.createElement("defs",null,x.createElement("path",{id:A,d:z})),x.createElement("textPath",{xlinkHref:"#".concat(A)},n))},iNe=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:l,startAngle:c,endAngle:d}=e,f=(c+d)/2;if(n==="outside"){var{x:p,y:m}=gr(r,i,l+t,f);return{x:p,y:m,textAnchor:p>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var y=(a+l)/2,{x:v,y:w}=gr(r,i,y,f);return{x:v,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Kg=e=>e!=null&&"cx"in e&&Re(e.cx),aNe={angle:0,offset:5,zIndex:Xn.label,position:"middle",textBreakAll:!1};function sNe(e){if(!Kg(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function jo(e){var t=Rr(e,aNe),{viewBox:n,parentViewBox:r,position:i,value:a,children:l,content:c,className:d="",textBreakAll:f,labelRef:p}=t,m=eNe(),y=f8(),v=i==="center"?y:m??y,w,b,j;n==null?w=v:Kg(n)?w=n:w=LC(n);var k=sNe(w);if(!w||pn(a)&&pn(l)&&!x.isValidElement(c)&&typeof c!="function")return null;var E=ih(ih({},t),{},{viewBox:w});if(x.isValidElement(c)){var{labelRef:O}=E,C=JM(E,G1e);return x.cloneElement(c,C)}if(typeof c=="function"){var{content:z}=E,A=JM(E,V1e);if(b=x.createElement(c,A),x.isValidElement(b))return b}else b=tNe(t);var _=Gr(t);if(Kg(w)){if(i==="insideStart"||i==="insideEnd"||i==="end")return rNe(t,i,b,_,w);j=iNe(w,t.offset,t.position)}else{if(!k)return null;var R=K1e({viewBox:k,position:i,offset:t.offset,parentViewBox:Kg(r)?void 0:r});j=ih(ih({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(ta,{zIndex:t.zIndex},x.createElement(qA,ws({ref:p,className:Rt("recharts-label",d)},_,j,{textAnchor:o8(_.textAnchor)?_.textAnchor:j.textAnchor,breakAll:f}),b))}jo.displayName="Label";var oNe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(jo,ws({key:"label-implicit"},r)):Fa(e)?x.createElement(jo,ws({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===jo?x.cloneElement(e,ih({key:"label-implicit"},r)):x.createElement(jo,ws({key:"label-implicit",content:e},r)):FA(e)?x.createElement(jo,ws({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(jo,ws({},e,{key:"label-implicit"},r)):null};function lNe(e){var{label:t,labelRef:n}=e,r=f8();return oNe(t,r,n)||null}var cNe=["valueAccessor"],uNe=["dataKey","clockWise","id","textBreakAll","zIndex"];function uv(){return uv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uv.apply(null,arguments)}function tL(e,t){if(e==null)return{};var n,r,i=dNe(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 dNe(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 fNe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(M1e(t))return t},h8=x.createContext(void 0),p8=h8.Provider,m8=x.createContext(void 0);m8.Provider;function hNe(){return x.useContext(h8)}function pNe(){return x.useContext(m8)}function Gg(e){var{valueAccessor:t=fNe}=e,n=tL(e,cNe),{dataKey:r,clockWise:i,id:a,textBreakAll:l,zIndex:c}=n,d=tL(n,uNe),f=hNe(),p=pNe(),m=f||p;return!m||!m.length?null:x.createElement(ta,{zIndex:c??Xn.label},x.createElement(Tr,{className:"recharts-label-list"},m.map((y,v)=>{var w,b=pn(r)?t(y,v):En(y.payload,r),j=pn(a)?{}:{id:"".concat(a,"-").concat(v)};return x.createElement(jo,uv({key:"label-".concat(v)},Gr(y),d,j,{fill:(w=n.fill)!==null&&w!==void 0?w:y.fill,parentViewBox:y.parentViewBox,value:b,textBreakAll:l,viewBox:y.viewBox,index:v,zIndex:0}))})))}Gg.displayName="LabelList";function g8(e){var{label:t}=e;return t?t===!0?x.createElement(Gg,{key:"labelList-implicit"}):x.isValidElement(t)||FA(t)?x.createElement(Gg,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(Gg,uv({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function AN(){return AN=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},AN.apply(null,arguments)}var y8=e=>{var{cx:t,cy:n,r,className:i}=e,a=Rt("recharts-dot",i);return Re(t)&&Re(n)&&Re(r)?x.createElement("circle",AN({},Wi(e),AC(e),{className:a,cx:t,cy:n,r})):null},mNe={radiusAxis:{},angleAxis:{}},v8=Dr({name:"polarAxis",initialState:mNe,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:Qze,removeRadiusAxis:Wze,addAngleAxis:Yze,removeAngleAxis:Zze}=v8.actions,gNe=v8.reducer;function yNe(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var _j={exports:{}},Ft={};var nL;function vNe(){if(nL)return Ft;nL=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=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 l:case c:case m:case p:return b;case a:return b;default:return j}}case t:return j}}}return Ft.ContextConsumer=a,Ft.ContextProvider=l,Ft.Element=e,Ft.ForwardRef=c,Ft.Fragment=n,Ft.Lazy=m,Ft.Memo=p,Ft.Portal=t,Ft.Profiler=i,Ft.StrictMode=r,Ft.Suspense=d,Ft.SuspenseList=f,Ft.isContextConsumer=function(b){return w(b)===a},Ft.isContextProvider=function(b){return w(b)===l},Ft.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Ft.isForwardRef=function(b){return w(b)===c},Ft.isFragment=function(b){return w(b)===n},Ft.isLazy=function(b){return w(b)===m},Ft.isMemo=function(b){return w(b)===p},Ft.isPortal=function(b){return w(b)===t},Ft.isProfiler=function(b){return w(b)===i},Ft.isStrictMode=function(b){return w(b)===r},Ft.isSuspense=function(b){return w(b)===d},Ft.isSuspenseList=function(b){return w(b)===f},Ft.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===i||b===r||b===d||b===f||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===p||b.$$typeof===l||b.$$typeof===a||b.$$typeof===c||b.$$typeof===v||b.getModuleId!==void 0)},Ft.typeOf=w,Ft}var rL;function xNe(){return rL||(rL=1,_j.exports=vNe()),_j.exports}var bNe=xNe(),iL=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",aL=null,zj=null,x8=e=>{if(e===aL&&Array.isArray(zj))return zj;var t=[];return x.Children.forEach(e,n=>{pn(n)||(bNe.isFragment(n)?t=t.concat(x8(n.props.children)):t.push(n))}),zj=t,aL=e,t};function wNe(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>iL(i)):r=[iL(t)],x8(e).forEach(i=>{var a=id(i,"type.displayName")||id(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var b8=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,Tj={},sL;function SNe(){return sL||(sL=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})(Tj)),Tj}var Pj,oL;function jNe(){return oL||(oL=1,Pj=SNe().isPlainObject),Pj}var NNe=jNe();const kNe=ya(NNe);var lL,cL,uL,dL,fL;function hL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hL(Object(n),!0).forEach(function(r){CNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CNe(e,t,n){return(t=ANe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ANe(e){var t=ENe(e,"string");return typeof t=="symbol"?t:t+""}function ENe(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 dv(){return dv=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},dv.apply(null,arguments)}function Qf(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var mL=(e,t,n,r,i)=>{var a=n-r,l;return l=wn(lL||(lL=Qf(["M ",",",""])),e,t),l+=wn(cL||(cL=Qf(["L ",",",""])),e+n,t),l+=wn(uL||(uL=Qf(["L ",",",""])),e+n-a/2,t+i),l+=wn(dL||(dL=Qf(["L ",",",""])),e+n-a/2-r,t+i),l+=wn(fL||(fL=Qf(["L ",","," Z"])),e,t),l},ONe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},_Ne=e=>{var t=Rr(e,ONe),{x:n,y:r,upperWidth:i,lowerWidth:a,height:l,className:c}=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(l),E=x.useRef(n),O=x.useRef(r),C=P0(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||l!==+l||i===0&&a===0||l===0)return null;var z=Rt("recharts-trapezoid",c);if(!m)return x.createElement("g",null,x.createElement("path",dv({},Gr(t),{className:z,d:mL(n,r,i,a,l)})));var A=b.current,_=j.current,R=k.current,$=E.current,F=O.current,q="0px ".concat(v===-1?1:v,"px"),B="".concat(v,"px ").concat(v,"px"),K=EU(["strokeDasharray"],f,d);return x.createElement(T0,{animationId:C,key:C,canBegin:v>0,duration:f,easing:d,isActive:m,begin:p},X=>{var Q=hn(A,i,X),H=hn(_,a,X),J=hn(R,l,X),de=hn($,n,X),be=hn(F,r,X);y.current&&(b.current=Q,j.current=H,k.current=J,E.current=de,O.current=be);var M=X>0?{transition:K,strokeDasharray:B}:{strokeDasharray:q};return x.createElement("path",dv({},Gr(t),{className:z,d:mL(de,be,Q,H,J),ref:y,style:pL(pL({},M),t.style)}))})},zNe=["option","shapeType","activeClassName","inActiveClassName"];function TNe(e,t){if(e==null)return{};var n,r,i=PNe(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 PNe(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 gL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gL(Object(n),!0).forEach(function(r){RNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function 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=INe(e,"string");return typeof t=="symbol"?t:t+""}function INe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function MNe(e,t){return fv(fv({},t),e)}function LNe(e,t){return e==="symbols"}function yL(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return x.createElement(TU,n);case"trapezoid":return x.createElement(_Ne,n);case"sector":return x.createElement(DU,n);case"symbols":if(LNe(t))return x.createElement(CC,n);break;case"curve":return x.createElement(hh,n);default:return null}}function $Ne(e){return x.isValidElement(e)?e.props:e}function BNe(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=TNe(e,zNe),l;if(x.isValidElement(t))l=x.cloneElement(t,fv(fv({},a),$Ne(t)));else if(typeof t=="function")l=t(a,a.index);else if(kNe(t)&&typeof t!="boolean"){var c=MNe(t,a);l=x.createElement(yL,{shapeType:n,elementProps:c})}else{var d=a;l=x.createElement(yL,{shapeType:n,elementProps:d})}return a.isActive?x.createElement(Tr,{className:r},l):x.createElement(Tr,{className:i},l)}var w8=(e,t,n)=>{var r=sn();return(i,a)=>l=>{e?.(i,a,l),r(EF({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},S8=e=>{var t=sn();return(n,r)=>i=>{e?.(n,r,i),t(rSe())}},j8=(e,t,n)=>{var r=sn();return(i,a)=>l=>{e?.(i,a,l),r(iSe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function N8(e){var{tooltipEntrySettings:t}=e,n=sn(),r=Ir(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(Jwe(t)):i.current!==t&&n(eSe({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(tSe(i.current)),i.current=null)},[n]),null}function k8(e){var{legendPayload:t}=e,n=sn(),r=Ir(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(Uge(t)):i.current!==t&&n(qge({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(Fge(i.current)),i.current=null)},[n]),null}var Rj,UNe=()=>{var[e]=x.useState(()=>zh("uid-"));return e},qNe=(Rj=wv.useId)!==null&&Rj!==void 0?Rj:UNe;function FNe(e,t){var n=qNe();return t||(e?"".concat(e,"-").concat(n):n)}var HNe=x.createContext(void 0),C8=e=>{var{id:t,type:n,children:r}=e,i=FNe("recharts-".concat(n),t);return x.createElement(HNe.Provider,{value:i},r(i))},KNe={cartesianItems:[],polarItems:[]},A8=Dr({name:"graphicalItems",initialState:KNe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:rn()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Ki(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:rn()},removeCartesianGraphicalItem:{reducer(e,t){var n=Ki(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=Ki(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=Ki(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:rn()}}}),{addCartesianGraphicalItem:GNe,replaceCartesianGraphicalItem:VNe,removeCartesianGraphicalItem:QNe,addPolarGraphicalItem:Xze,removePolarGraphicalItem:Jze,replacePolarGraphicalItem:e2e}=A8.actions,WNe=A8.reducer,YNe=e=>{var t=sn(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(GNe(e)):n.current!==e&&t(VNe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(QNe(n.current)),n.current=null)},[t]),null},E8=x.memo(YNe),ZNe=["points"];function vL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vL(Object(n),!0).forEach(function(r){XNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XNe(e,t,n){return(t=JNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JNe(e){var t=eke(e,"string");return typeof t=="symbol"?t:t+""}function eke(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 hv(){return hv=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},hv.apply(null,arguments)}function tke(e,t){if(e==null)return{};var n,r,i=nke(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function nke(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function rke(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:l}=a,c=tke(a,ZNe);return x.createElement(y8,hv({},c,{className:i}))}function ike(e,t){return e==null?!1:t?!0:e.length===1}function ake(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:l,needClip:c,clipPathId:d,zIndex:f=Xn.scatter}=e;if(!ike(t,n))return null;var p=b8(n),m=Efe(n),y=t.map((w,b)=>{var j,k,E=Dj(Dj(Dj({r:3},l),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(rke,{key:"dot-".concat(b),option:n,dotProps:E,className:i})}),v={};return c&&d!=null&&(v.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(d,")")),x.createElement(ta,{zIndex:f},x.createElement(Tr,hv({className:r},v),y))}function xL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xL(Object(n),!0).forEach(function(r){ske(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xL(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)}var O8=0,cke={xAxis:{},yAxis:{},zAxis:{}},_8=Dr({name:"cartesianAxis",initialState:cke,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,l=i.widthHistory||[];if(l.length===3&&l[0]===l[2]&&r===l[1]&&r!==i.width&&Math.abs(r-((a=l[0])!==null&&a!==void 0?a:0))<=1)return;var c=[...l,r].slice(-3);e.yAxis[n]=bL(bL({},i),{},{width:r,widthHistory:c})}}}}),{addXAxis:uke,replaceXAxis:dke,removeXAxis:fke,addYAxis:hke,replaceYAxis:pke,removeYAxis:mke,addZAxis:t2e,replaceZAxis:n2e,removeZAxis:r2e,updateYAxisWidth:gke}=_8.actions,yke=_8.reducer,vke=le([Jn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),xke=le([vke,Ds,Is],(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)}}),HA=()=>Fe(xke),bke=()=>Fe(JSe);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 Ij(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){wke(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 wke(e,t,n){return(t=Ske(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ske(e){var t=jke(e,"string");return typeof t=="symbol"?t:t+""}function jke(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 Nke=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:l}=e;if(i===!1||t.x==null||t.y==null)return null;var c={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=Ij(Ij(Ij({},c),ip(i)),AC(i)),f;return x.isValidElement(i)?f=x.cloneElement(i,d):typeof i=="function"?f=i(d):f=x.createElement(y8,d),x.createElement(Tr,{className:"recharts-active-dot",clipPath:l},f)};function SL(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:l=Xn.activeDot}=e,c=Fe(lc),d=bke();if(t==null||d==null)return null;var f=t.find(p=>d.includes(p.payload));return pn(f)?null:x.createElement(ta,{zIndex:l},x.createElement(Nke,{point:f,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var jL=(e,t,n)=>{var r=n??e;if(!pn(r))return ma(r,t,0)},kke=(e,t,n)=>{var r={},i=e.filter(U0),a=e.filter(f=>f.stackId==null),l=i.reduce((f,p)=>{var m=f[p.stackId];return m==null&&(m=[]),m.push(p),f[p.stackId]=m,f},r),c=Object.entries(l).map(f=>{var p,[m,y]=f,v=y.map(b=>b.dataKey),w=jL(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=jL(t,n,f.barSize);return{stackId:void 0,dataKeys:p,barSize:m}});return[...c,...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 bg(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){Cke(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 Cke(e,t,n){return(t=Ake(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ake(e){var t=Eke(e,"string");return typeof t=="symbol"?t:t+""}function Eke(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 Oke(e,t,n,r,i){var a,l=r.length;if(!(l<1)){var c=ma(e,n,0,!0),d,f=[];if(gt((a=r[0])===null||a===void 0?void 0:a.barSize)){var p=!1,m=n/l,y=r.reduce((E,O)=>E+(O.barSize||0),0);y+=(l-1)*c,y>=n&&(y-=(l-1)*c,c=0),y>=n&&m>0&&(p=!0,m*=.9,y=l*m);var v=(n-y)/2>>0,w={offset:v-c,size:0};d=r.reduce((E,O)=>{var C,z={stackId:O.stackId,dataKeys:O.dataKeys,position:{offset:w.offset+w.size+c,size:p?m:(C=O.barSize)!==null&&C!==void 0?C:0}},A=[...E,z];return w=z.position,A},f)}else{var b=ma(t,n,0,!0);n-2*b-(l-1)*c<=0&&(c=0);var j=(n-2*b-(l-1)*c)/l;j>1&&(j>>=0);var k=gt(i)?Math.min(j,i):j;d=r.reduce((E,O,C)=>[...E,{stackId:O.stackId,dataKeys:O.dataKeys,position:{offset:b+(j+c)*C+(j-k)/2,size:k}}],f)}return d}}var _ke=(e,t,n,r,i,a,l)=>{var c=pn(l)?t:l,d=Oke(n,r,i!==a?i:a,e,c);return i!==a&&d!=null&&(d=d.map(f=>bg(bg({},f),{},{position:bg(bg({},f.position),{},{offset:f.position.offset-i/2})}))),d},zke=(e,t)=>{var n=B0(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(l=>l.key===n)}}}},Tke=(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 Pke(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&>(e.zIndex)?e.zIndex:t}var Rke=e=>{var{chartData:t}=e,n=sn(),r=Ir();return x.useEffect(()=>r?()=>{}:(n(MM(t)),()=>{n(MM(void 0))}),[t,n,r]),null},kL={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},z8=Dr({name:"brush",initialState:kL,reducers:{setBrushSettings(e,t){return t.payload==null?kL:t.payload}}}),{setBrushSettings:i2e}=z8.actions,Dke=z8.reducer;function Ike(e){return(e%180+180)%180}var Mke=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Ike(i),l=a*Math.PI/180,c=Math.atan(r/n),d=l>c&&l<Math.PI-c?r/Math.sin(l):n/Math.cos(l);return Math.abs(d)},Lke={dots:[],areas:[],lines:[]},T8=Dr({name:"referenceElements",initialState:Lke,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Ki(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=Ki(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=Ki(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:a2e,removeDot:s2e,addArea:o2e,removeArea:l2e,addLine:c2e,removeLine:u2e}=T8.actions,$ke=T8.reducer,Bke=x.createContext(void 0),Uke=e=>{var{children:t}=e,[n]=x.useState("".concat(zh("recharts"),"-clip")),r=HA();if(r==null)return null;var{x:i,y:a,width:l,height:c}=r;return x.createElement(Bke.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:i,y:a,height:c,width:l}))),t)};function P8(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 qke(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Mke(r,n)}function Fke(e,t,n){var r=n==="width",{x:i,y:a,width:l,height:c}=e;return t===1?{start:r?i:a,end:r?i+l:a+c}:{start:r?i+l:a+c,end:r?i:a}}function Kh(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 Hke(e,t){return P8(e,t+1)}function Kke(e,t,n,r,i){for(var a=(r||[]).slice(),{start:l,end:c}=t,d=0,f=1,p=l,m=function(){var w=r?.[d];if(w===void 0)return{v:P8(r,f)};var b=d,j,k=()=>(j===void 0&&(j=n(w,b)),j),E=w.coordinate,O=d===0||Kh(e,E,k,p,c);O||(d=0,p=l,f+=1),O&&(p=E+e*(k()/2+i),d+=f)},y;f<=a.length;)if(y=m(),y)return y.v;return[]}function Gke(e,t,n,r,i){var a=(r||[]).slice(),l=a.length;if(l===0)return[];for(var{start:c,end:d}=t,f=1;f<=l;f++){for(var p=(l-1)%f,m=c,y=!0,v=function(){var C=r[b];if(C==null)return 0;var z=b,A,_=()=>(A===void 0&&(A=n(C,z)),A),R=C.coordinate,$=b===p||Kh(e,R,_,m,d);if(!$)return y=!1,1;$&&(m=R+e*(_()/2+i))},w,b=p;b<l&&(w=v(),!(w!==0&&w===1));b+=f);if(y){for(var j=[],k=p;k<l;k+=f){var E=r[k];E!=null&&j.push(E)}return j}}return[]}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 Ar(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){Vke(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 Vke(e,t,n){return(t=Qke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qke(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)}function Yke(e,t,n,r,i){for(var a=(r||[]).slice(),l=a.length,{start:c}=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===l-1){var k=e*(w.coordinate+e*j()/2-d);a[y]=w=Ar(Ar({},w),{},{tickCoord:k>0?w.coordinate-k*e:w.coordinate})}else a[y]=w=Ar(Ar({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var E=Kh(e,w.tickCoord,j,c,d);E&&(d=w.tickCoord-e*(j()/2+i),a[y]=Ar(Ar({},w),{},{isShow:!0}))}},p=l-1;p>=0;p--)f(p);return a}function Zke(e,t,n,r,i,a){var l=(r||[]).slice(),c=l.length,{start:d,end:f}=t;if(a){var p=r[c-1];if(p!=null){var m=n(p,c-1),y=e*(p.coordinate+e*m/2-f);if(l[c-1]=p=Ar(Ar({},p),{},{tickCoord:y>0?p.coordinate-y*e:p.coordinate}),p.tickCoord!=null){var v=Kh(e,p.tickCoord,()=>m,d,f);v&&(f=p.tickCoord-e*(m/2+i),l[c-1]=Ar(Ar({},p),{},{isShow:!0}))}}}for(var w=a?c-1:c,b=function(E){var O=l[E];if(O==null)return 1;var C=O,z,A=()=>(z===void 0&&(z=n(O,E)),z);if(E===0){var _=e*(C.coordinate-e*A()/2-d);l[E]=C=Ar(Ar({},C),{},{tickCoord:_<0?C.coordinate-_*e:C.coordinate})}else l[E]=C=Ar(Ar({},C),{},{tickCoord:C.coordinate});if(C.tickCoord!=null){var R=Kh(e,C.tickCoord,A,d,f);R&&(d=C.tickCoord+e*(A()/2+i),l[E]=Ar(Ar({},C),{},{isShow:!0}))}},j=0;j<w;j++)b(j);return l}function KA(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:l,orientation:c,interval:d,tickFormatter:f,unit:p,angle:m}=e;if(!i||!i.length||!r)return[];if(Re(d)||dp.isSsr){var y;return(y=Hke(i,Re(d)?d:0))!==null&&y!==void 0?y:[]}var v=[],w=c==="top"||c==="bottom"?"width":"height",b=p&&w==="width"?mh(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=(z,A)=>{var _=typeof f=="function"?f(z.value,A):z.value;return w==="width"?qke(mh(_,{fontSize:t,letterSpacing:n}),b,m):mh(_,{fontSize:t,letterSpacing:n})[w]},k=i[0],E=i[1],O=i.length>=2&&k!=null&&E!=null?ai(E.coordinate-k.coordinate):1,C=Fke(a,O,w);return d==="equidistantPreserveStart"?Kke(O,C,j,i,l):d==="equidistantPreserveEnd"?Gke(O,C,j,i,l):(d==="preserveStart"||d==="preserveStartEnd"?v=Zke(O,C,j,i,l,d==="preserveStartEnd"):v=Yke(O,C,j,i,l),v.filter(z=>z.isShow))}var Xke=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,l=0;if(t){Array.from(t).forEach(p=>{if(p){var m=p.getBoundingClientRect();m.width>l&&(l=m.width)}});var c=n?n.getBoundingClientRect().width:0,d=i+a,f=l+d+c+(n?r:0);return Math.round(f)}return 0},Jke={xAxis:{},yAxis:{}},R8=Dr({name:"renderedTicks",initialState:Jke,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:eCe,removeRenderedTicks:tCe}=R8.actions,nCe=R8.reducer,rCe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function iCe(e,t){if(e==null)return{};var n,r,i=aCe(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 aCe(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 cc(){return cc=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},cc.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 bn(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){sCe(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 sCe(e,t,n){return(t=oCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oCe(e){var t=lCe(e,"string");return typeof t=="symbol"?t:t+""}function lCe(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 As={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:Xn.axis};function cCe(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:l,axisLine:c,otherSvgProps:d}=e;if(!c)return null;var f=bn(bn(bn({},d),Wi(c)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!l||a==="bottom"&&l);f=bn(bn({},f),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var m=+(a==="left"&&!l||a==="right"&&l);f=bn(bn({},f),{},{x1:t+m*r,y1:n,x2:t+m*r,y2:n+i})}return x.createElement("line",cc({},f,{className:Rt("recharts-cartesian-axis-line",id(c,"className"))}))}function uCe(e,t,n,r,i,a,l,c,d){var f,p,m,y,v,w,b=c?-1:1,j=e.tickSize||l,k=Re(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=p=e.coordinate,y=n+ +!c*i,m=y-b*j,w=m-b*d,v=k;break;case"left":m=y=e.coordinate,p=t+ +!c*r,f=p-b*j,v=f-b*d,w=k;break;case"right":m=y=e.coordinate,p=t+ +c*r,f=p+b*j,v=f+b*d,w=k;break;default:f=p=e.coordinate,y=n+ +c*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 dCe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function fCe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function hCe(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,bn(bn({},n),{},{className:a}));else if(typeof t=="function")i=t(bn(bn({},n),{},{className:a}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=Rt(l,yNe(t))),i=x.createElement(qA,cc({},n,{className:l}),r)}return i}function pCe(e){var{ticks:t,axisType:n,axisId:r}=e,i=sn();return x.useEffect(()=>{if(r==null||n==null)return vc;var a=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(eCe({ticks:a,axisId:r,axisType:n})),()=>{i(tCe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var mCe=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:l,unit:c,padding:d,tickTextProps:f,orientation:p,mirror:m,x:y,y:v,width:w,height:b,tickSize:j,tickMargin:k,fontSize:E,letterSpacing:O,getTicksConfig:C,events:z,axisType:A,axisId:_}=e,R=KA(bn(bn({},C),{},{ticks:n}),E,O),$=Wi(C),F=ip(r),q=o8($.textAnchor)?$.textAnchor:dCe(p,m),B=fCe(p,m),K={};typeof i=="object"&&(K=i);var X=bn(bn({},$),{},{fill:"none"},K),Q=R.map(de=>bn({entry:de},uCe(de,y,v,w,b,p,j,m,k))),H=Q.map(de=>{var{entry:be,line:M}=de;return x.createElement(Tr,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(be.value,"-").concat(be.coordinate,"-").concat(be.tickCoord)},i&&x.createElement("line",cc({},X,M,{className:Rt("recharts-cartesian-axis-tick-line",id(i,"className"))})))}),J=Q.map((de,be)=>{var M,D,{entry:U,tick:I}=de,V=bn(bn(bn(bn({verticalAnchor:B},$),{},{textAnchor:q,stroke:"none",fill:a},I),{},{index:be,payload:U,visibleTicksCount:R.length,tickFormatter:l,padding:d},f),{},{angle:(M=(D=f?.angle)!==null&&D!==void 0?D:$.angle)!==null&&M!==void 0?M:0}),ce=bn(bn({},V),F);return x.createElement(Tr,cc({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(U.value,"-").concat(U.coordinate,"-").concat(U.tickCoord)},f0(z,U,be)),r&&x.createElement(hCe,{option:r,tickProps:ce,value:"".concat(typeof l=="function"?l(U.value,be):U.value).concat(c||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(A,"-ticks")},x.createElement(pCe,{ticks:R,axisId:_,axisType:A}),J.length>0&&x.createElement(ta,{zIndex:Xn.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))}),gCe=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:l,ticks:c,axisType:d,axisId:f}=e,p=iCe(e,rCe),[m,y]=x.useState(""),[v,w]=x.useState(""),b=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return Xke({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 O=E[0];if(O){var C=window.getComputedStyle(O),z=C.fontSize,A=C.letterSpacing;(z!==m||A!==v)&&(y(z),w(A))}}},[m,v]);return l||r!=null&&r<=0||i!=null&&i<=0?null:x.createElement(ta,{zIndex:e.zIndex},x.createElement(Tr,{className:Rt("recharts-cartesian-axis",a)},x.createElement(cCe,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Wi(e)}),x.createElement(mCe,{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:c,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:f}),x.createElement(X1e,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(lNe,{label:e.label,labelRef:e.labelRef}),e.children)))}),GA=x.forwardRef((e,t)=>{var n=Rr(e,As);return x.createElement(gCe,cc({},n,{ref:t}))});GA.displayName="CartesianAxis";var yCe=["x1","y1","x2","y2","key"],vCe=["offset"],xCe=["xAxisId","yAxisId"],bCe=["xAxisId","yAxisId"];function EL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EL(Object(n),!0).forEach(function(r){wCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wCe(e,t,n){return(t=SCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SCe(e){var t=jCe(e,"string");return typeof t=="symbol"?t:t+""}function jCe(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 pv(e,t){if(e==null)return{};var n,r,i=NCe(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 NCe(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 kCe=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:l,ry:c}=e;return x.createElement("rect",{x:r,y:i,ry:c,width:a,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function D8(e){var{option:t,lineItemProps:n}=e,r;if(x.isValidElement(t))r=x.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:l,x2:c,y2:d,key:f}=n,p=pv(n,yCe),m=(i=Wi(p))!==null&&i!==void 0?i:{},{offset:y}=m,v=pv(m,vCe);r=x.createElement("line",Ml({},v,{x1:a,y1:l,x2:c,y2:d,fill:"none",key:f}))}return r}function CCe(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:l}=e,c=pv(e,xCe),d=i.map((f,p)=>{var m=zr(zr({},c),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(p),index:p});return x.createElement(D8,{key:"line-".concat(p),option:r,lineItemProps:m})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function ACe(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:l}=e,c=pv(e,bCe),d=i.map((f,p)=>{var m=zr(zr({},c),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(p),index:p});return x.createElement(D8,{option:r,lineItemProps:m,key:"line-".concat(p)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function ECe(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:l,horizontalPoints:c,horizontal:d=!0}=e;if(!d||!t||!t.length||c==null)return null;var f=c.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+l-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 OCe(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:l,height:c,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+l-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:c,stroke:"none",fill:n[j],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var _Ce=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return cU(KA(zr(zr(zr({},As),n),{},{ticks:uU(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},zCe=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return cU(KA(zr(zr(zr({},As),n),{},{ticks:uU(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},TCe={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Xn.grid};function I8(e){var t=$C(),n=BC(),r=gU(),i=zr(zr({},Rr(e,TCe)),{},{x:Re(e.x)?e.x:r.left,y:Re(e.y)?e.y:r.top,width:Re(e.width)?e.width:r.width,height:Re(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:l,x:c,y:d,width:f,height:p,syncWithTicks:m,horizontalValues:y,verticalValues:v}=i,w=Ir(),b=Fe($=>NM($,"xAxis",a,w)),j=Fe($=>NM($,"yAxis",l,w));if(!Ha(f)||!Ha(p)||!Re(c)||!Re(d))return null;var k=i.verticalCoordinatesGenerator||_Ce,E=i.horizontalCoordinatesGenerator||zCe,{horizontalPoints:O,verticalPoints:C}=i;if((!O||!O.length)&&typeof E=="function"){var z=y&&y.length,A=E({yAxis:j?zr(zr({},j),{},{ticks:z?y:j.ticks}):void 0,width:t??f,height:n??p,offset:r},z?!0:m);Dy(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof A,"]")),Array.isArray(A)&&(O=A)}if((!C||!C.length)&&typeof k=="function"){var _=v&&v.length,R=k({xAxis:b?zr(zr({},b),{},{ticks:_?v:b.ticks}):void 0,width:t??f,height:n??p,offset:r},_?!0:m);Dy(Array.isArray(R),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof R,"]")),Array.isArray(R)&&(C=R)}return x.createElement(ta,{zIndex:i.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(kCe,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(ECe,Ml({},i,{horizontalPoints:O})),x.createElement(OCe,Ml({},i,{verticalPoints:C})),x.createElement(CCe,Ml({},i,{offset:r,horizontalPoints:O,xAxis:b,yAxis:j})),x.createElement(ACe,Ml({},i,{offset:r,verticalPoints:C,xAxis:b,yAxis:j}))))}I8.displayName="CartesianGrid";var PCe={},M8=Dr({name:"errorBars",initialState:PCe,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:d2e,replaceErrorBar:f2e,removeErrorBar:h2e}=M8.actions,RCe=M8.reducer,DCe=["children"];function ICe(e,t){if(e==null)return{};var n,r,i=MCe(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 MCe(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 LCe={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},$Ce=x.createContext(LCe);function BCe(e){var{children:t}=e,n=ICe(e,DCe);return x.createElement($Ce.Provider,{value:n},t)}function VA(e,t){var n,r,i=Fe(f=>Ls(f,e)),a=Fe(f=>$s(f,t)),l=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:Hn.allowDataOverflow,c=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Kn.allowDataOverflow,d=l||c;return{needClip:d,needClipX:l,needClipY:c}}function L8(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=HA(),{needClipX:a,needClipY:l,needClip:c}=VA(t,n);if(!c||!i)return null;var{x:d,y:f,width:p,height:m}=i;return x.createElement("clipPath",{id:"clipPath-".concat(r)},x.createElement("rect",{x:a?d:d-p/2,y:l?f:f-m/2,width:a?p:p*2,height:l?m:m*2}))}function UCe(e){var t=ip(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,l=Number(i),c=Number(a);return(Number.isNaN(l)||l<0)&&(l=n),(Number.isNaN(c)||c<0)&&(c=r),{r:l,strokeWidth:c}}return{r:n,strokeWidth:r}}function Wa(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:O8}function Ya(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:O8}var $8=(e,t,n)=>qo(e,"xAxis",Wa(e,t),n),B8=(e,t,n)=>Uo(e,"xAxis",Wa(e,t),n),U8=(e,t,n)=>qo(e,"yAxis",Ya(e,t),n),q8=(e,t,n)=>Uo(e,"yAxis",Ya(e,t),n),qCe=le([It,$8,U8,B8,q8],(e,t,n,r,i)=>Qa(e,"xAxis")?sd(t,r,!1):sd(n,i,!1)),FCe=(e,t)=>t,F8=le([Y0,FCe],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),H8=e=>{var t=It(e),n=Qa(t,"xAxis");return n?"yAxis":"xAxis"},HCe=(e,t)=>{var n=H8(e);return n==="yAxis"?Ya(e,t):Wa(e,t)},KCe=(e,t,n)=>iv(e,H8(e),HCe(e,t),n),GCe=le([F8,KCe],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=B0(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,l=a?.find(c=>c.key===i);if(l!=null)return l.map(c=>[c[0],c[1]])}}}),VCe=le([It,$8,U8,B8,q8,GCe,MU,qCe,F8,s0e],(e,t,n,r,i,a,l,c,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:y}=l;if(!(d==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||c==null)){var{data:v}=d,w;if(v&&v.length>0?w=v:w=p?.slice(m,y+1),w!=null)return hAe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:m,areaSettings:d,stackedData:a,displayedData:w,chartBaseValue:f,bandSize:c})}}),QCe=["id"],WCe=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Kl(){return Kl=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},Kl.apply(null,arguments)}function K8(e,t){if(e==null)return{};var n,r,i=YCe(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 YCe(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 Mu(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){ZCe(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 ZCe(e,t,n){return(t=XCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XCe(e){var t=JCe(e,"string");return typeof t=="symbol"?t:t+""}function JCe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mv(e,t){return e&&e!=="none"?e:t}var eAe=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:l}=e;return[{inactive:l,dataKey:t,type:a,color:mv(r,i),value:j0(n,t),payload:e}]},tAe=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:l,hide:c,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:vc,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:j0(l,t),hide:c,type:f,color:mv(r,a),unit:d,graphicalItemId:p}};return x.createElement(N8,{tooltipEntrySettings:m})});function nAe(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:l}=r,c=Wi(r);return x.createElement(ake,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:c,needClip:i,clipPathId:t})}function rAe(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var l,c,d={x:(l=a.x)!==null&&l!==void 0?l:0,y:(c=a.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Mu(Mu({},d),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return x.createElement(p8,{value:t?i:void 0},n)}function _L(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:l,type:c,stroke:d,connectNulls:f,isRange:p}=a,{id:m}=a,y=K8(a,QCe),v=Wi(y),w=Gr(y);return x.createElement(x.Fragment,null,t?.length>1&&x.createElement(Tr,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},x.createElement(hh,Kl({},w,{id:m,points:t,connectNulls:f,type:c,baseLine:n,layout:l,stroke:"none",className:"recharts-area-area"})),d!=="none"&&x.createElement(hh,Kl({},v,{className:"recharts-area-curve",layout:l,type:c,connectNulls:f,fill:"none",points:t})),d!=="none"&&p&&Array.isArray(n)&&x.createElement(hh,Kl({},v,{className:"recharts-area-curve",layout:l,type:c,connectNulls:f,fill:"none",points:n}))),x.createElement(nAe,{points:t,props:y,clipPathId:i}))}function iAe(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:l}=e,c=(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(c)||!gt(d))return null;var f=r*Math.abs(c-d),p=Math.max(...a.map(m=>m.x||0));return Re(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.x||0),p)),Re(p)?x.createElement("rect",{x:0,y:c<d?c:c-f,width:p+(l?parseInt("".concat(l),10):1),height:Math.floor(f)}):null}function aAe(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:l}=e,c=(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(c)||!gt(d))return null;var f=r*Math.abs(c-d),p=Math.max(...a.map(m=>m.y||0));return Re(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.y||0),p)),Re(p)?x.createElement("rect",{x:c<d?c:c-f,y:0,width:f,height:Math.floor(p+(l?parseInt("".concat(l),10):1))}):null}function sAe(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?x.createElement(iAe,{alpha:t,points:r,baseLine:i,strokeWidth:a}):x.createElement(aAe,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function oAe(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:l,baseLine:c,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,onAnimationStart:y,onAnimationEnd:v}=r,w=x.useMemo(()=>({points:l,baseLine:c}),[l,c]),b=P0(w,"recharts-area-"),j=UC(),[k,E]=x.useState(!1),O=!k,C=x.useCallback(()=>{typeof v=="function"&&v(),E(!1)},[v]),z=x.useCallback(()=>{typeof y=="function"&&y(),E(!0)},[y]);if(j==null)return null;var A=i.current,_=a.current;return x.createElement(rAe,{showLabels:O,points:l},r.children,x.createElement(T0,{animationId:b,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:C,onAnimationStart:z,key:b},R=>{if(A){var $=A.length/l.length,F=R===1?l:l.map((B,K)=>{var X=Math.floor(K*$);if(A[X]){var Q=A[X];return Mu(Mu({},B),{},{x:hn(Q.x,B.x,R),y:hn(Q.y,B.y,R)})}return B}),q;return Re(c)?q=hn(_,c,R):pn(c)||pa(c)?q=hn(_,0,R):q=c.map((B,K)=>{var X=Math.floor(K*$);if(Array.isArray(_)&&_[X]){var Q=_[X];return Mu(Mu({},B),{},{x:hn(Q.x,B.x,R),y:hn(Q.y,B.y,R)})}return B}),R>0&&(i.current=F,a.current=q),x.createElement(_L,{points:F,baseLine:q,needClip:t,clipPathId:n,props:r})}return R>0&&(i.current=l,a.current=c),x.createElement(Tr,null,d&&x.createElement("defs",null,x.createElement("clipPath",{id:"animationClipPath-".concat(n)},x.createElement(sAe,{alpha:R,points:l,baseLine:c,layout:j,strokeWidth:r.strokeWidth}))),x.createElement(Tr,{clipPath:"url(#animationClipPath-".concat(n,")")},x.createElement(_L,{points:l,baseLine:c,needClip:t,clipPathId:n,props:r})))}),x.createElement(g8,{label:r.label}))}function lAe(e){var{needClip:t,clipPathId:n,props:r}=e,i=x.useRef(null),a=x.useRef();return x.createElement(oAe,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class cAe extends x.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:l,needClip:c,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}=UCe(n),O=b8(n),C=k*2+E,z=c?"url(#clipPath-".concat(O?"":"dots-").concat(j,")"):void 0;return x.createElement(ta,{zIndex:w},x.createElement(Tr,{className:b},c&&x.createElement("defs",null,x.createElement(L8,{clipPathId:j,xAxisId:d,yAxisId:f}),!O&&x.createElement("clipPath",{id:"clipPath-dots-".concat(j)},x.createElement("rect",{x:l-C/2,y:a-C/2,width:p+C,height:m+C}))),x.createElement(lAe,{needClip:c,clipPathId:j,props:this.props})),x.createElement(SL,{points:r,mainColor:mv(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:z}),this.props.isRange&&Array.isArray(v)&&x.createElement(SL,{points:v,mainColor:mv(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:z}))}}var uAe={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:Xn.area};function dAe(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:l,dot:c,fill:d,fillOpacity:f,hide:p,isAnimationActive:m,legendType:y,stroke:v,xAxisId:w,yAxisId:b}=e,j=K8(e,WCe),k=xc(),E=VF(),{needClip:O}=VA(w,b),C=Ir(),{points:z,isRange:A,baseLine:_}=(t=Fe(K=>VCe(K,e.id,C)))!==null&&t!==void 0?t:{},R=HA();if(k!=="horizontal"&&k!=="vertical"||R==null||E!=="AreaChart"&&E!=="ComposedChart")return null;var{height:$,width:F,x:q,y:B}=R;return!z||!z.length?null:x.createElement(cAe,Kl({},j,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:_,connectNulls:l,dot:c,fill:d,fillOpacity:f,height:$,hide:p,layout:k,isAnimationActive:m,isRange:A,legendType:y,needClip:O,points:z,stroke:v,width:F,left:q,top:B,xAxisId:w,yAxisId:b}))}var fAe=(e,t,n,r,i)=>{var a=n??t;if(Re(a))return a;var l=e==="horizontal"?i:r,c=l.scale.domain();if(l.type==="number"){var d=Math.max(c[0],c[1]),f=Math.min(c[0],c[1]);return a==="dataMin"?f:a==="dataMax"||d<0?d:Math.max(Math.min(c[0],c[1]),0)}return a==="dataMin"?c[0]:a==="dataMax"?c[1]:c[0]};function hAe(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:l,xAxis:c,yAxis:d,displayedData:f,dataStartIndex:p,xAxisTicks:m,yAxisTicks:y,bandSize:v}=e,w=i&&i.length,b=fAe(a,l,n,c,d),j=a==="horizontal",k=!1,E=f.map((C,z)=>{var A,_,R,$;if(w)$=i[p+z];else{var F=En(C,r);Array.isArray(F)?($=F,k=!0):$=[b,F]}var q=(A=(_=$)===null||_===void 0?void 0:_[1])!==null&&A!==void 0?A:null,B=q==null||w&&!t&&En(C,r)==null;if(j){var K;return{x:gD({axis:c,ticks:m,bandSize:v,entry:C,index:z}),y:B?null:(K=d.scale.map(q))!==null&&K!==void 0?K:null,value:$,payload:C}}return{x:B?null:(R=c.scale.map(q))!==null&&R!==void 0?R:null,y:gD({axis:d,ticks:y,bandSize:v,entry:C,index:z}),value:$,payload:C}}),O;return w||k?O=E.map(C=>{var z,A=Array.isArray(C.value)?C.value[0]:null;if(j){var _;return{x:C.x,y:A!=null&&C.y!=null&&(_=d.scale.map(A))!==null&&_!==void 0?_:null,payload:C.payload}}return{x:A!=null&&(z=c.scale.map(A))!==null&&z!==void 0?z:null,y:C.y,payload:C.payload}}):O=j?d.scale.map(b):c.scale.map(b),{points:E,baseLine:O??0,isRange:k}}function pAe(e){var t=Rr(e,uAe),n=Ir();return x.createElement(C8,{id:t.id,type:"area"},r=>x.createElement(x.Fragment,null,x.createElement(k8,{legendPayload:eAe(t)}),x.createElement(tAe,{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(E8,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:dU(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),x.createElement(dAe,Kl({},t,{id:r}))))}var Lu=x.memo(pAe,Ad);Lu.displayName="Area";function EN(){return EN=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},EN.apply(null,arguments)}function QA(e){return x.createElement(BNe,EN({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var mAe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Re(t))return t;var a=Re(r)||pn(r);return a?t(r,i):(a||Es(!1),n)}},gAe=(e,t,n)=>n,yAe=(e,t)=>t,wp=le([Y0,yAe],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),vAe=le([wp],e=>e?.maxBarSize),xAe=(e,t,n,r)=>r,bAe=le([It,Y0,Wa,Ya,gAe],(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")),wAe=(e,t,n)=>{var r=It(e),i=Wa(e,t),a=Ya(e,t);if(!(i==null||a==null))return r==="horizontal"?iv(e,"yAxis",a,n):iv(e,"xAxis",i,n)},SAe=(e,t)=>{var n=It(e),r=Wa(e,t),i=Ya(e,t);if(!(r==null||i==null))return n==="horizontal"?jM(e,"xAxis",r):jM(e,"yAxis",i)},jAe=le([bAe,a0e,SAe],kke),NAe=(e,t,n)=>{var r,i,a=wp(e,t);if(a==null)return 0;var l=Wa(e,t),c=Ya(e,t);if(l==null||c==null)return 0;var d=It(e),f=WU(e),{maxBarSize:p}=a,m=pn(p)?f:p,y,v;return d==="horizontal"?(y=qo(e,"xAxis",l,n),v=Uo(e,"xAxis",l,n)):(y=qo(e,"yAxis",c,n),v=Uo(e,"yAxis",c,n)),(r=(i=sd(y,v,!0))!==null&&i!==void 0?i:m)!==null&&r!==void 0?r:0},G8=(e,t,n)=>{var r=It(e),i=Wa(e,t),a=Ya(e,t);if(!(i==null||a==null)){var l,c;return r==="horizontal"?(l=qo(e,"xAxis",i,n),c=Uo(e,"xAxis",i,n)):(l=qo(e,"yAxis",a,n),c=Uo(e,"yAxis",a,n)),sd(l,c)}},kAe=le([jAe,WU,i0e,YU,NAe,G8,vAe],_ke),CAe=(e,t,n)=>{var r=Wa(e,t);if(r!=null)return qo(e,"xAxis",r,n)},AAe=(e,t,n)=>{var r=Ya(e,t);if(r!=null)return qo(e,"yAxis",r,n)},EAe=(e,t,n)=>{var r=Wa(e,t);if(r!=null)return Uo(e,"xAxis",r,n)},OAe=(e,t,n)=>{var r=Ya(e,t);if(r!=null)return Uo(e,"yAxis",r,n)},_Ae=le([kAe,wp],Tke),zAe=le([wAe,wp],zke),TAe=le([Jn,IC,CAe,AAe,EAe,OAe,_Ae,It,MU,G8,zAe,wp,xAe],(e,t,n,r,i,a,l,c,d,f,p,m,y)=>{var{chartData:v,dataStartIndex:w,dataEndIndex:b}=d;if(!(m==null||l==null||t==null||c!=="horizontal"&&c!=="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 sEe({layout:c,barSettings:m,pos:l,parentViewBox:t,bandSize:f,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:p,displayedData:k,offset:e,cells:y,dataStartIndex:w})}}),PAe=["index"];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)}function RAe(e,t){if(e==null)return{};var n,r,i=DAe(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 DAe(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 V8=x.createContext(void 0),IAe=e=>{var t=x.useContext(V8);if(t!=null)return t.stackId;if(e!=null)return dU(e)},MAe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),LAe=e=>{var t=x.useContext(V8);if(t!=null){var{stackId:n}=t;return"url(#".concat(MAe(n,e),")")}},Q8=e=>{var{index:t}=e,n=RAe(e,PAe),r=LAe(t);return x.createElement(Tr,ON({className:"recharts-bar-stack-layer",clipPath:r},n))},$Ae=["onMouseEnter","onMouseLeave","onClick"],BAe=["value","background","tooltipPosition"],UAe=["id"],qAe=["onMouseEnter","onClick","onMouseLeave"];function Fo(){return Fo=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},Fo.apply(null,arguments)}function zL(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 Ur(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zL(Object(n),!0).forEach(function(r){FAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FAe(e,t,n){return(t=HAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HAe(e){var t=KAe(e,"string");return typeof t=="symbol"?t:t+""}function KAe(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 gv(e,t){if(e==null)return{};var n,r,i=GAe(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 GAe(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 VAe=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:j0(n,t),payload:e}]},QAe=x.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:l,unit:c,tooltipType:d,id:f}=e,p={dataDefinedOnItem:void 0,getPosition:vc,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:j0(a,t),hide:l,type:d,color:i,unit:c,graphicalItemId:f}};return x.createElement(N8,{tooltipEntrySettings:p})});function WAe(e){var t=Fe(lc),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:l,onMouseLeave:c,onClick:d}=a,f=gv(a,$Ae),p=w8(l,r,a.id),m=S8(c),y=j8(d,r,a.id);if(!i||n==null)return null;var v=ip(i);return x.createElement(ta,{zIndex:Pke(i,Xn.barBackground)},n.map((w,b)=>{var{value:j,background:k,tooltipPosition:E}=w,O=gv(w,BAe);if(!k)return null;var C=p(w,b),z=m(w,b),A=y(w,b),_=Ur(Ur(Ur(Ur(Ur({option:i,isActive:String(b)===t},O),{},{fill:"#eee"},k),v),f0(f,w,b)),{},{onMouseEnter:C,onMouseLeave:z,onClick:A,dataKey:r,index:b,className:"recharts-bar-background-rectangle"});return x.createElement(QA,Fo({key:"background-bar-".concat(b)},_))}))}function YAe(e){var{showLabels:t,children:n,rects:r}=e,i=r?.map(a=>{var l={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return Ur(Ur({},l),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:l,fill:a.fill})});return x.createElement(p8,{value:t?i:void 0},n)}function ZAe(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:l}=e,c=Fe(lc),d=Fe(HF),f=n&&String(i.originalDataIndex)===c&&(d==null||l===d),[p,m]=x.useState(!1),[y,v]=x.useState(!1);x.useEffect(()=>{var O;return f?(m(!0),O=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(O)}},[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(QA,Fo({},r,{name:String(r.name)},i,{isActive:b,option:k,index:a,dataKey:l,onTransitionEnd:w}));return j?x.createElement(ta,{zIndex:Xn.activeBar},x.createElement(Q8,{index:i.originalDataIndex},E)):E}function XAe(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return x.createElement(QA,Fo({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function JAe(e){var t,{data:n,props:r}=e,i=(t=Wi(r))!==null&&t!==void 0?t:{},{id:a}=i,l=gv(i,UAe),{shape:c,dataKey:d,activeBar:f}=r,{onMouseEnter:p,onClick:m,onMouseLeave:y}=r,v=gv(r,qAe),w=w8(p,d,a),b=S8(y),j=j8(m,d,a);return n?x.createElement(x.Fragment,null,n.map((k,E)=>x.createElement(Q8,Fo({index:k.originalDataIndex,key:"rectangle-".concat(k?.x,"-").concat(k?.y,"-").concat(k?.value,"-").concat(E),className:"recharts-bar-rectangle"},f0(v,k,E),{onMouseEnter:w(k,E),onMouseLeave:b(k,E),onClick:j(k,E)}),f?x.createElement(ZAe,{shape:c,activeBar:f,baseProps:l,entry:k,index:E,dataKey:d}):x.createElement(XAe,{shape:c,baseProps:l,entry:k,index:E,dataKey:d})))):null}function eEe(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:l,animationDuration:c,animationEasing:d,onAnimationEnd:f,onAnimationStart:p}=t,m=n.current,y=P0(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(YAe,{showLabels:b,rects:r},x.createElement(T0,{animationId:y,begin:l,duration:c,isActive:a,easing:d,onAnimationEnd:j,onAnimationStart:k,key:y},E=>{var O=E===1?r:r?.map((C,z)=>{var A=m&&m[z];if(A)return Ur(Ur({},C),{},{x:hn(A.x,C.x,E),y:hn(A.y,C.y,E),width:hn(A.width,C.width,E),height:hn(A.height,C.height,E)});if(i==="horizontal"){var _=hn(0,C.height,E),R=hn(C.stackedBarStart,C.y,E);return Ur(Ur({},C),{},{y:R,height:_})}var $=hn(0,C.width,E),F=hn(C.stackedBarStart,C.x,E);return Ur(Ur({},C),{},{width:$,x:F})});return E>0&&(n.current=O??null),O==null?null:x.createElement(Tr,null,x.createElement(JAe,{props:t,data:O}))}),x.createElement(g8,{label:t.label}),t.children)}function tEe(e){var t=x.useRef(null);return x.createElement(eEe,{previousRectanglesRef:t,props:e})}var W8=0,nEe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:En(e,t)}};class rEe extends x.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:l,needClip:c,background:d,id:f}=this.props;if(t||n==null)return null;var p=Rt("recharts-bar",i),m=f;return x.createElement(Tr,{className:p,id:f},c&&x.createElement("defs",null,x.createElement(L8,{clipPathId:m,xAxisId:a,yAxisId:l})),x.createElement(Tr,{className:"recharts-bar-rectangles",clipPath:c?"url(#clipPath-".concat(m,")"):void 0},x.createElement(WAe,{data:n,dataKey:r,background:d,allOtherBarProps:this.props}),x.createElement(tEe,this.props)))}}var iEe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:W8,xAxisId:0,yAxisId:0,zIndex:Xn.bar};function aEe(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:c,animationDuration:d,animationEasing:f,isAnimationActive:p}=e,{needClip:m}=VA(t,n),y=xc(),v=Ir(),w=wNe(e.children,cv),b=Fe(E=>TAe(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(BCe,{xAxisId:t,yAxisId:n,data:b,dataPointFormatter:nEe,errorBarOffset:j},x.createElement(rEe,Fo({},e,{layout:y,needClip:m,data:b,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:c,animationDuration:d,animationEasing:f,isAnimationActive:p})))}function sEe(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:l,xAxis:c,yAxis:d,xAxisTicks:f,yAxisTicks:p,stackedData:m,displayedData:y,offset:v,cells:w,parentViewBox:b,dataStartIndex:j}=e,k=t==="horizontal"?d:c,E=m?k.scale.domain():null,O=Fme({numericAxis:k}),C=k.scale.map(O);return y.map((z,A)=>{var _,R,$,F,q,B;if(m){var K=m[A+j];if(K==null)return null;_=Lme(K,E)}else _=En(z,n),Array.isArray(_)||(_=[O,_]);var X=mAe(r,W8)(_[1],A);if(t==="horizontal"){var Q,H=d.scale.map(_[0]),J=d.scale.map(_[1]);if(H==null||J==null)return null;R=yD({axis:c,ticks:f,bandSize:l,offset:a.offset,entry:z,index:A}),$=(Q=J??H)!==null&&Q!==void 0?Q:void 0,F=a.size;var de=H-J;if(q=pa(de)?0:de,B={x:R,y:v.top,width:F,height:v.height},Math.abs(X)>0&&Math.abs(q)<Math.abs(X)){var be=ai(q||X)*(Math.abs(X)-Math.abs(q));$-=be,q+=be}}else{var M=c.scale.map(_[0]),D=c.scale.map(_[1]);if(M==null||D==null)return null;if(R=M,$=yD({axis:d,ticks:p,bandSize:l,offset:a.offset,entry:z,index:A}),F=D-M,q=a.size,B={x:v.left,y:$,width:v.width,height:q},Math.abs(X)>0&&Math.abs(F)<Math.abs(X)){var U=ai(F||X)*(Math.abs(X)-Math.abs(F));F+=U}}if(R==null||$==null||F==null||q==null||!i&&(F===0||q===0))return null;var I=Ur(Ur({},z),{},{stackedBarStart:C,x:R,y:$,width:F,height:q,value:m?_:_[1],payload:z,background:B,tooltipPosition:{x:R+F/2,y:$+q/2},parentViewBox:b,originalDataIndex:A},w&&w[A]&&w[A].props);return I}).filter(Boolean)}function oEe(e){var t=Rr(e,iEe),n=IAe(t.stackId),r=Ir();return x.createElement(C8,{id:t.id,type:"bar"},i=>x.createElement(x.Fragment,null,x.createElement(k8,{legendPayload:VAe(t)}),x.createElement(QAe,{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(E8,{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(ta,{zIndex:t.zIndex},x.createElement(aEe,Fo({},t,{id:i})))))}var _N=x.memo(oEe,Ad);_N.displayName="Bar";var lEe=["domain","range"],cEe=["domain","range"];function TL(e,t){if(e==null)return{};var n,r,i=uEe(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 uEe(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 PL(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 Y8(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=TL(e,lEe),{domain:a,range:l}=t,c=TL(t,cEe);return!PL(n,a)||!PL(r,l)?!1:Ad(i,c)}var dEe=["type"],fEe=["dangerouslySetInnerHTML","ticks","scale"],hEe=["id","scale"];function zN(){return zN=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},zN.apply(null,arguments)}function RL(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 DL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RL(Object(n),!0).forEach(function(r){pEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pEe(e,t,n){return(t=mEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mEe(e){var t=gEe(e,"string");return typeof t=="symbol"?t:t+""}function gEe(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 TN(e,t){if(e==null)return{};var n,r,i=yEe(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 yEe(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 vEe(e){var t=sn(),n=x.useRef(null),r=UC(),{type:i}=e,a=TN(e,dEe),l=M0(r,"xAxis",i),c=x.useMemo(()=>{if(l!=null)return DL(DL({},a),{},{type:l})},[a,l]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(uke(c)):n.current!==c&&t(dke({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(fke(n.current)),n.current=null)},[t]),null}var xEe=e=>{var{xAxisId:t,className:n}=e,r=Fe(IC),i=Ir(),a="xAxis",l=Fe(k=>SF(k,a,t,i)),c=Fe(k=>xF(k,t)),d=Fe(k=>Uwe(k,t)),f=Fe(k=>Uq(k,t));if(c==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:p,ticks:m,scale:y}=e,v=TN(e,fEe),{id:w,scale:b}=f,j=TN(f,hEe);return x.createElement(GA,zN({},v,j,{x:d.x,y:d.y,width:c.width,height:c.height,className:Rt("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:l,axisType:a,axisId:t}))},bEe={allowDataOverflow:Hn.allowDataOverflow,allowDecimals:Hn.allowDecimals,allowDuplicatedCategory:Hn.allowDuplicatedCategory,angle:Hn.angle,axisLine:As.axisLine,height:Hn.height,hide:!1,includeHidden:Hn.includeHidden,interval:Hn.interval,label:!1,minTickGap:Hn.minTickGap,mirror:Hn.mirror,orientation:Hn.orientation,padding:Hn.padding,reversed:Hn.reversed,scale:Hn.scale,tick:Hn.tick,tickCount:Hn.tickCount,tickLine:As.tickLine,tickSize:As.tickSize,type:Hn.type,niceTicks:Hn.niceTicks,xAxisId:0},wEe=e=>{var t=Rr(e,bEe);return x.createElement(x.Fragment,null,x.createElement(vEe,{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(xEe,t))},Gh=x.memo(wEe,Y8);Gh.displayName="XAxis";var SEe=["type"],jEe=["dangerouslySetInnerHTML","ticks","scale"],NEe=["id","scale"];function PN(){return PN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PN.apply(null,arguments)}function 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 ML(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){kEe(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 kEe(e,t,n){return(t=CEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CEe(e){var t=AEe(e,"string");return typeof t=="symbol"?t:t+""}function AEe(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 RN(e,t){if(e==null)return{};var n,r,i=EEe(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 EEe(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 OEe(e){var t=sn(),n=x.useRef(null),r=UC(),{type:i}=e,a=RN(e,SEe),l=M0(r,"yAxis",i),c=x.useMemo(()=>{if(l!=null)return ML(ML({},a),{},{type:l})},[l,a]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(hke(c)):n.current!==c&&t(pke({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(mke(n.current)),n.current=null)},[t]),null}function _Ee(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=x.useRef(null),l=x.useRef(null),c=Fe(IC),d=Ir(),f=sn(),p="yAxis",m=Fe(A=>bF(A,t)),y=Fe(A=>Fwe(A,t)),v=Fe(A=>SF(A,p,t,d)),w=Fe(A=>qq(A,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!m||FA(i)||x.isValidElement(i)||w==null)){var A=a.current;if(A){var _=A.getCalculatedWidth();Math.round(m.width)!==Math.round(_)&&f(gke({id:t,width:_}))}}},[v,m,f,i,t,r,w]),m==null||y==null||w==null)return null;var{dangerouslySetInnerHTML:b,ticks:j,scale:k}=e,E=RN(e,jEe),{id:O,scale:C}=w,z=RN(w,NEe);return x.createElement(GA,PN({},E,z,{ref:a,labelRef:l,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:c,ticks:v,axisType:p,axisId:t}))}var zEe={allowDataOverflow:Kn.allowDataOverflow,allowDecimals:Kn.allowDecimals,allowDuplicatedCategory:Kn.allowDuplicatedCategory,angle:Kn.angle,axisLine:As.axisLine,hide:!1,includeHidden:Kn.includeHidden,interval:Kn.interval,label:!1,minTickGap:Kn.minTickGap,mirror:Kn.mirror,orientation:Kn.orientation,padding:Kn.padding,reversed:Kn.reversed,scale:Kn.scale,tick:Kn.tick,tickCount:Kn.tickCount,tickLine:As.tickLine,tickSize:As.tickSize,type:Kn.type,niceTicks:Kn.niceTicks,width:Kn.width,yAxisId:0},TEe=e=>{var t=Rr(e,zEe);return x.createElement(x.Fragment,null,x.createElement(OEe,{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(_Ee,t))},Vh=x.memo(TEe,Y8);Vh.displayName="YAxis";var PEe=(e,t)=>t,WA=le([PEe,It,rq,tr,BF,Bs,dje,Jn],vje);function REe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function YA(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(REe(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var l=(c,d)=>({relativeX:Math.round((c-t.left)/n),relativeY:Math.round((d-t.top)/r)});return"touches"in e?Array.from(e.touches).map(c=>l(c.clientX,c.clientY)):l(e.clientX,e.clientY)}var Z8=Ci("mouseClick"),X8=op();X8.startListening({actionCreator:Z8,effect:(e,t)=>{var n=e.payload,r=WA(t.getState(),YA(n));r?.activeIndex!=null&&t.dispatch(aSe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var DN=Ci("mouseMove"),J8=op(),Su=null,bl=null,Mj=null;J8.startListening({actionCreator:DN,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,l=a==="all"||a?.includes("mousemove");Su!==null&&(cancelAnimationFrame(Su),Su=null),bl!==null&&(typeof i!="number"||!l)&&(clearTimeout(bl),bl=null),Mj=YA(n);var c=()=>{var d=t.getState(),f=xp(d,d.tooltip.settings.shared);if(!Mj){Su=null,bl=null;return}if(f==="axis"){var p=WA(d,Mj);p?.activeIndex!=null?t.dispatch(_F({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(OF())}Su=null,bl=null};if(!l){c();return}i==="raf"?Su=requestAnimationFrame(c):typeof i=="number"&&bl===null&&(bl=setTimeout(c,i))}});function DEe(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 LL={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},e9=Dr({name:"rootProps",initialState:LL,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:LL.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}}}),IEe=e9.reducer,{updateOptions:MEe}=e9.actions,LEe=null,$Ee={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)},t9=Dr({name:"polarOptions",initialState:LEe,reducers:$Ee}),{updatePolarOptions:p2e}=t9.actions,BEe=t9.reducer,n9=Ci("keyDown"),r9=Ci("focus"),i9=Ci("blur"),ex=op(),ju=null,wl=null,wg=null;ex.startListening({actionCreator:n9,effect:(e,t)=>{wg=e.payload,ju!==null&&(cancelAnimationFrame(ju),ju=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");wl!==null&&(typeof r!="number"||!a)&&(clearTimeout(wl),wl=null);var l=()=>{try{var c=t.getState(),d=c.rootProps.accessibilityLayer!==!1;if(!d)return;var{keyboardInteraction:f}=c.tooltip,p=wg;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var m=ph(f,oc(c),fd(c),hd(c)),y=m==null?-1:Number(m),v=!Number.isFinite(y)||y<0,w=Bs(c),b=oc(c),j=xp(c,c.tooltip.settings.shared);if(p==="Enter"){if(v)return;var k=ov(c,j,"hover",String(f.index));t.dispatch(sv({active:!f.active,activeIndex:f.index,activeCoordinate:k}));return}var E=Qwe(c),O=E==="left-to-right"?1:-1,C=p==="ArrowRight"?1:-1,z;if(v){var A=fd(c),_=hd(c),R=C*O,$=X=>({active:!1,index:String(X),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(z=-1,R>0){for(var F=0;F<b.length;F++)if(ph($(F),b,A,_)!=null){z=F;break}}else for(var q=b.length-1;q>=0;q--)if(ph($(q),b,A,_)!=null){z=q;break}if(z<0)return}else{z=y+C*O;var B=w?.length||b.length;if(B===0||z>=B||z<0)return}var K=ov(c,j,"hover",String(z));t.dispatch(sv({active:!0,activeIndex:z.toString(),activeCoordinate:K}))}finally{ju=null,wl=null}};if(!a){l();return}r==="raf"?ju=requestAnimationFrame(l):typeof r=="number"&&wl===null&&(l(),wg=null,wl=setTimeout(()=>{wg?l():(wl=null,ju=null)},r))}});ex.startListening({actionCreator:r9,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var a="0",l=xp(n,n.tooltip.settings.shared),c=ov(n,l,"hover",String(a));t.dispatch(sv({active:!0,activeIndex:a,activeCoordinate:c}))}}}});ex.startListening({actionCreator:i9,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(sv({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function a9(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 $i=Ci("externalEvent"),s9=op(),Sg=new Map,Wf=new Map,Lj=new Map;s9.startListening({actionCreator:$i,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=a9(r);Lj.set(i,{handler:n,reactEvent:a});var l=Sg.get(i);l!==void 0&&(cancelAnimationFrame(l),Sg.delete(i));var c=t.getState(),{throttleDelay:d,throttledEvents:f}=c.eventSettings,p=f,m=p==="all"||p?.includes(i),y=Wf.get(i);y!==void 0&&(typeof d!="number"||!m)&&(clearTimeout(y),Wf.delete(i));var v=()=>{var j=Lj.get(i);try{if(!j)return;var{handler:k,reactEvent:E}=j,O=t.getState(),C={activeCoordinate:YSe(O),activeDataKey:HF(O),activeIndex:lc(O),activeLabel:FF(O),activeTooltipIndex:lc(O),isTooltipActive:ZSe(O)};k&&k(C,E)}finally{Sg.delete(i),Wf.delete(i),Lj.delete(i)}};if(!m){v();return}if(d==="raf"){var w=requestAnimationFrame(v);Sg.set(i,w)}else if(typeof d=="number"){if(!Wf.has(i)){v();var b=setTimeout(v,d);Wf.set(i,b)}}else v()}}});var UEe=le([Dd],e=>e.tooltipItemPayloads),qEe=le([UEe,(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)}}}),o9=Ci("touchMove"),l9=op(),Sl=null,yo=null,$L=null,Yf=null;l9.startListening({actionCreator:o9,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Yf=a9(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,l=a==="all"||a.includes("touchmove");Sl!==null&&(cancelAnimationFrame(Sl),Sl=null),yo!==null&&(typeof i!="number"||!l)&&(clearTimeout(yo),yo=null),$L=Array.from(n.touches).map(d=>YA({clientX:d.clientX,clientY:d.clientY,currentTarget:n.currentTarget}));var c=()=>{if(Yf!=null){var d=t.getState(),f=xp(d,d.tooltip.settings.shared);if(f==="axis"){var p,m=(p=$L)===null||p===void 0?void 0:p[0];if(m==null){Sl=null,yo=null;return}var y=WA(d,m);y?.activeIndex!=null&&t.dispatch(_F({activeIndex:y.activeIndex,activeDataKey:void 0,activeCoordinate:y.activeCoordinate}))}else if(f==="item"){var v,w=Yf.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(Yme),k=(v=b.getAttribute(Zme))!==null&&v!==void 0?v:void 0,E=Sc(d).find(z=>z.id===k);if(j==null||E==null||k==null)return;var{dataKey:O}=E,C=qEe(d,j,k);t.dispatch(EF({activeDataKey:O,activeIndex:j,activeCoordinate:C,activeGraphicalItemId:k}))}Sl=null,yo=null}};if(!l){c();return}i==="raf"?Sl=requestAnimationFrame(c):typeof i=="number"&&yo===null&&(c(),Yf=null,yo=setTimeout(()=>{Yf?c():(yo=null,Sl=null)},i))}}});var c9={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},u9=Dr({name:"eventSettings",initialState:c9,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:FEe}=u9.actions,HEe=u9.reducer,KEe=R6({brush:Dke,cartesianAxis:yke,chartData:Qje,errorBars:RCe,eventSettings:HEe,graphicalItems:WNe,layout:Pme,legend:Hge,options:Fje,polarAxis:gNe,polarOptions:BEe,referenceElements:$ke,renderedTicks:nCe,rootProps:IEe,tooltip:sSe,zIndex:zje}),GEe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return ime({reducer:KEe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([X8.middleware,J8.middleware,ex.middleware,s9.middleware,l9.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(W6({type:"raf"}))},devTools:{serialize:{replacer:DEe},name:"recharts-".concat(n)}})};function VEe(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Ir(),a=x.useRef(null);if(i)return n;a.current==null&&(a.current=GEe(t,r));var l=OC;return x.createElement(lye,{context:l,store:a.current},n)}function QEe(e){var{layout:t,margin:n}=e,r=sn(),i=Ir();return x.useEffect(()=>{i||(r(_me(t)),r(Ome(n)))},[r,i,t,n]),null}var WEe=x.memo(QEe,Ad);function YEe(e){var t=sn();return x.useEffect(()=>{t(MEe(e))},[t,e]),null}var ZEe=e=>{var t=sn();return x.useEffect(()=>{t(FEe(e))},[t,e]),null},XEe=x.memo(ZEe,Ad);function BL(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=sn();return x.useLayoutEffect(()=>(r.current&&i(Oje({zIndex:t,element:r.current,isPanorama:n})),()=>{i(_je({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function UL(e){var{children:t,isPanorama:n}=e,r=Fe(bje);if(!r||r.length===0)return t;var i=r.filter(l=>l<0),a=r.filter(l=>l>0);return x.createElement(x.Fragment,null,i.map(l=>x.createElement(BL,{key:l,zIndex:l,isPanorama:n})),t,a.map(l=>x.createElement(BL,{key:l,zIndex:l,isPanorama:n})))}var JEe=["children"];function eOe(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}function yv(){return yv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yv.apply(null,arguments)}var nOe={width:"100%",height:"100%",display:"block"},rOe=x.forwardRef((e,t)=>{var n=$C(),r=BC(),i=AU();if(!Ha(n)||!Ha(r))return null;var{children:a,otherAttributes:l,title:c,desc:d}=e,f,p;return l!=null&&(typeof l.tabIndex=="number"?f=l.tabIndex:f=i?0:void 0,typeof l.role=="string"?p=l.role:p=i?"application":void 0),x.createElement(xC,yv({},l,{title:c,desc:d,role:p,tabIndex:f,width:n,height:r,style:nOe,ref:t}),a)}),iOe=e=>{var{children:t}=e,n=Fe(A0);if(!n)return null;var{width:r,height:i,y:a,x:l}=n;return x.createElement(xC,{width:r,height:i,x:l,y:a},t)},qL=x.forwardRef((e,t)=>{var{children:n}=e,r=eOe(e,JEe),i=Ir();return i?x.createElement(iOe,null,x.createElement(UL,{isPanorama:!0},n)):x.createElement(rOe,yv({ref:t},r),x.createElement(UL,{isPanorama:!1},n))});function aOe(){var e=sn(),[t,n]=x.useState(null),r=Fe(Wme);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;gt(a)&&a!==r&&e(Tme(a))}},[t,e,r]),n}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 sOe(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){oOe(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 oOe(e,t,n){return(t=lOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lOe(e){var t=cOe(e,"string");return typeof t=="symbol"?t:t+""}function cOe(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 Mo(){return Mo=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},Mo.apply(null,arguments)}var uOe=()=>(r1e(),null);function vv(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var dOe=x.forwardRef((e,t)=>{var n,r,i=x.useRef(null),[a,l]=x.useState({containerWidth:vv((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:vv((r=e.style)===null||r===void 0?void 0:r.height)}),c=x.useCallback((f,p)=>{l(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();c(p,m);var y=w=>{var b=w[0];if(b!=null){var{width:j,height:k}=b.contentRect;c(j,k)}},v=new ResizeObserver(y);v.observe(f),i.current=v}},[t,c]);return x.useEffect(()=>()=>{var f=i.current;f?.disconnect()},[c]),x.createElement(x.Fragment,null,x.createElement(cp,{width:a.containerWidth,height:a.containerHeight}),x.createElement("div",Mo({ref:d},e)))}),fOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=x.useState({containerWidth:vv(n),containerHeight:vv(r)}),l=x.useCallback((d,f)=>{a(p=>{var m=Math.round(d),y=Math.round(f);return p.containerWidth===m&&p.containerHeight===y?p:{containerWidth:m,containerHeight:y}})},[]),c=x.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:f,height:p}=d.getBoundingClientRect();l(f,p)}},[t,l]);return x.createElement(x.Fragment,null,x.createElement(cp,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",Mo({ref:c},e)))}),hOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(cp,{width:n,height:r}),x.createElement("div",Mo({ref:t},e)))}),pOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(fOe,Mo({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(hOe,Mo({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(cp,{width:n,height:r}),x.createElement("div",Mo({ref:t},e)))});function mOe(e){return e?dOe:pOe}var gOe=x.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:l,onDoubleClick:c,onMouseDown:d,onMouseEnter:f,onMouseLeave:p,onMouseMove:m,onMouseUp:y,onTouchEnd:v,onTouchMove:w,onTouchStart:b,style:j,width:k,responsive:E,dispatchTouchEvents:O=!0}=e,C=x.useRef(null),z=sn(),[A,_]=x.useState(null),[R,$]=x.useState(null),F=aOe(),q=MC(),B=q?.width>0?q.width:k,K=q?.height>0?q.height:i,X=x.useCallback(fe=>{F(fe),typeof t=="function"&&t(fe),_(fe),$(fe),fe!=null&&(C.current=fe)},[F,t,_,$]),Q=x.useCallback(fe=>{z(Z8(fe)),z($i({handler:a,reactEvent:fe}))},[z,a]),H=x.useCallback(fe=>{z(DN(fe)),z($i({handler:f,reactEvent:fe}))},[z,f]),J=x.useCallback(fe=>{z(OF()),z($i({handler:p,reactEvent:fe}))},[z,p]),de=x.useCallback(fe=>{z(DN(fe)),z($i({handler:m,reactEvent:fe}))},[z,m]),be=x.useCallback(()=>{z(r9())},[z]),M=x.useCallback(()=>{z(i9())},[z]),D=x.useCallback(fe=>{z(n9(fe.key))},[z]),U=x.useCallback(fe=>{z($i({handler:l,reactEvent:fe}))},[z,l]),I=x.useCallback(fe=>{z($i({handler:c,reactEvent:fe}))},[z,c]),V=x.useCallback(fe=>{z($i({handler:d,reactEvent:fe}))},[z,d]),ce=x.useCallback(fe=>{z($i({handler:y,reactEvent:fe}))},[z,y]),re=x.useCallback(fe=>{z($i({handler:b,reactEvent:fe}))},[z,b]),ke=x.useCallback(fe=>{O&&z(o9(fe)),z($i({handler:w,reactEvent:fe}))},[z,O,w]),ze=x.useCallback(fe=>{z($i({handler:v,reactEvent:fe}))},[z,v]),te=mOe(E);return x.createElement(XF.Provider,{value:A},x.createElement(WB.Provider,{value:R},x.createElement(te,{width:B??j?.width,height:K??j?.height,className:Rt("recharts-wrapper",r),style:sOe({position:"relative",cursor:"default",width:B,height:K},j),onClick:Q,onContextMenu:U,onDoubleClick:I,onFocus:be,onBlur:M,onKeyDown:D,onMouseDown:V,onMouseEnter:H,onMouseLeave:J,onMouseMove:de,onMouseUp:ce,onTouchEnd:ze,onTouchMove:ke,onTouchStart:re,ref:X},x.createElement(uOe,null),n)))}),yOe=["width","height","responsive","children","className","style","compact","title","desc"];function vOe(e,t){if(e==null)return{};var n,r,i=xOe(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 xOe(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 bOe=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:l,style:c,compact:d,title:f,desc:p}=e,m=vOe(e,yOe),y=Wi(m);return d?x.createElement(x.Fragment,null,x.createElement(cp,{width:n,height:r}),x.createElement(qL,{otherAttributes:y,title:f,desc:p},a)):x.createElement(gOe,{className:l,style:c,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},x.createElement(qL,{otherAttributes:y,title:f,desc:p,ref:t},x.createElement(Uke,null,a)))});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 HL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wOe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HL(Object(n),!0).forEach(function(r){SOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SOe(e,t,n){return(t=jOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jOe(e){var t=NOe(e,"string");return typeof t=="symbol"?t:t+""}function NOe(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 kOe={top:5,right:5,bottom:5,left:5},COe=wOe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:kOe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},c9),d9=x.forwardRef(function(t,n){var r,i=Rr(t.categoricalChartProps,COe),{chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:d,categoricalChartProps:f}=t,p={chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:d,eventEmitter:void 0};return x.createElement(VEe,{preloadedState:{options:p},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},x.createElement(Rke,{chartData:f.data}),x.createElement(WEe,{layout:i.layout,margin:i.margin}),x.createElement(XEe,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(YEe,{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(bOe,IN({},i,{ref:n})))}),AOe=["axis","item"],EOe=x.forwardRef((e,t)=>x.createElement(d9,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:AOe,tooltipPayloadSearcher:JF,categoricalChartProps:e,ref:t})),OOe=["axis"],MN=x.forwardRef((e,t)=>x.createElement(d9,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:OOe,tooltipPayloadSearcher:JF,categoricalChartProps:e,ref:t}));const Wu={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},_o={fill:"#71717a",fontSize:11},_Oe="#27272a",pd="#27272a",Yu=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function f9(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function LN(e){return f9(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function $N(e){const t=f9(e);return`${t.getMonth()+1}/${t.getDate()}`}function ZA(e){switch(e){case eh.connected:return"positive";case eh.paused:return"caution";case eh.error:return"negative";case eh.archived:return"neutral"}}function zOe(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 TOe(e){return Vn({queryKey:e?_e.serverTraffic.sources(e):["server-traffic","disabled"],queryFn:()=>AQ(e),enabled:!!e,staleTime:bs})}function POe(e){return Vn({queryKey:e?_e.serverTraffic.status(e):["server-traffic","status-disabled"],queryFn:()=>EQ(e),enabled:!!e,staleTime:bs})}function ROe(e,t){return Vn({queryKey:e&&t?_e.serverTraffic.sourceDetail(e,t):["server-traffic","detail-disabled"],queryFn:()=>i4(e,t),enabled:!!(e&&t),staleTime:bs})}function DOe(e,t){return Vn({queryKey:e?_e.serverTraffic.events(e,t):["server-traffic","events-disabled"],queryFn:()=>OQ(e,zOe(t)),enabled:!!e,staleTime:bs})}function IOe(e){const t=vr();return Ba({mutationFn:n=>{if(!e)throw new Error("Project is required to connect a Cloud Run source");return _Q(e,n)},onSuccess:()=>{e&&t.invalidateQueries({queryKey:_e.serverTraffic.project(e)})}})}function MOe(e){const t=vr();return Ba({mutationFn:n=>{if(!e)throw new Error("Project is required to connect a WordPress source");return zQ(e,n)},onSuccess:()=>{e&&t.invalidateQueries({queryKey:_e.serverTraffic.project(e)})}})}function LOe(e,t){const n=vr();return Ba({mutationFn:r=>{if(!e||!t)throw new Error("Project and sourceId are required to sync");return TQ(e,t,r??void 0)},onSuccess:()=>{e&&(n.invalidateQueries({queryKey:_e.serverTraffic.project(e)}),n.invalidateQueries({queryKey:_e.runs.all}))}})}const $Oe=6,md="__other__",Zu="_socialTotal";function BOe(e,t=$Oe){const n=new Map;for(const p of e)n.set(p.source,(n.get(p.source)??0)+p.sessions);const r=[...n.entries()].sort((p,m)=>m[1]!==p[1]?m[1]-p[1]:p[0].localeCompare(m[0])),i=r.slice(0,t),a=new Set(i.map(([p])=>p)),l=Math.max(0,r.length-t),c=new Map;for(const p of e){let m=c.get(p.date);m||(m={date:p.date,[Zu]:0},c.set(p.date,m));const y=a.has(p.source)?p.source:md;m[y]=(m[y]??0)+p.sessions,m[Zu]=(m[Zu]??0)+p.sessions}const d=[...c.values()].sort((p,m)=>String(p.date).localeCompare(String(m.date))),f=i.map(([p])=>p);return l>0&&f.push(md),{data:d,sources:f,otherCount:l}}function Xu(e){return e.replace(/\+/g," ")}function h9(e,t=30){return e.length<=t?e:e.slice(0,Math.max(1,t-1))+"…"}const UOe=["7d","30d","90d","all"],No=Yu,BN="#71717a",p9="#52525b",Zf=25;function jg(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function m9(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 qOe({projectName:e}){const{data:t,isLoading:n,isError:r}=POe(e);if(n)return s.jsx(Pe,{className:"p-5",children:s.jsx("div",{className:"text-sm text-zinc-500",children:"Loading server activity…"})});if(r)return s.jsx(Pe,{className:"p-5",children:s.jsx("div",{className:"text-sm text-rose-400",children:"Failed to load server activity."})});const i=t?.sources??[];return s.jsxs("section",{children:[s.jsx("div",{className:"flex items-baseline justify-between mb-3",children:s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Server activity (last 24h)"}),s.jsx("h2",{className:"text-lg font-semibold text-zinc-50",children:"Engine crawler hits & AI-referral sessions"}),s.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Server-side log evidence of bots crawling the site and AI-referral sessions — orthogonal to GA4 click-through traffic below. "," ",s.jsx(Et,{to:"/traffic",className:"text-blue-400 hover:underline",children:"Manage sources →"})]})]})}),i.length===0?s.jsx(Pe,{className:"p-5",children:s.jsxs("div",{className:"text-sm text-zinc-400",children:["No server traffic source connected yet."," ",s.jsx(Et,{to:"/traffic",className:"text-blue-400 hover:underline",children:"Connect a WordPress or Cloud Run source"})," ","to surface bot crawls and AI referrals straight from server logs."]})}):s.jsx(Pe,{className:"overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{className:"bg-zinc-900/50 text-[10px] uppercase tracking-wide text-zinc-500",children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Source"}),s.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Status"}),s.jsx("th",{className:"text-right px-4 py-2 font-medium",children:"Crawler hits 24h"}),s.jsx("th",{className:"text-right px-4 py-2 font-medium",children:"AI sessions 24h"}),s.jsx("th",{className:"text-right px-4 py-2 font-medium",children:"Last sync"}),s.jsx("th",{className:"text-left px-4 py-2 font-medium","aria-label":"open"})]})}),s.jsx("tbody",{children:i.map(a=>s.jsxs("tr",{className:"border-t border-zinc-800/60",children:[s.jsx("td",{className:"px-4 py-3 text-zinc-100",children:a.displayName}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(tt,{tone:ZA(a.status),children:a.status})}),s.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-100",children:a.totals24h.crawlerHits.toLocaleString("en-US")}),s.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-100",children:a.totals24h.aiReferralHits.toLocaleString("en-US")}),s.jsx("td",{className:"px-4 py-3 text-right text-zinc-400 text-xs",children:a.lastSyncedAt?m9(a.lastSyncedAt):"never"}),s.jsx("td",{className:"px-4 py-3 text-right",children:s.jsx(Et,{to:"/traffic/$projectName/$sourceId",params:{projectName:e,sourceId:a.id},className:"text-blue-400 hover:underline text-xs",children:"Detail →"})})]},a.id))})]})})]})}function FOe({projectName:e}){return s.jsxs("div",{className:"space-y-10",children:[s.jsx(qOe,{projectName:e}),s.jsx(HOe,{projectName:e})]})}function HOe({projectName:e}){const t=vr(),[n,r]=x.useState(null),[i,a]=x.useState(null),[l,c]=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,O]=x.useState("desc"),[C,z]=x.useState("sessions"),[A,_]=x.useState("desc"),[R,$]=x.useState("sessions"),[F,q]=x.useState("desc"),[B,K]=x.useState("sessions"),[X,Q]=x.useState("desc"),[H,J]=x.useState([]),[de,be]=x.useState([]),[M,D]=x.useState([]),[U,I]=x.useState(!1),[V,ce]=x.useState("30d");async function re(je){c(!0),v(null);try{const De=await t.fetchQuery({queryKey:_e.traffic.status(e),queryFn:()=>bQ(e),staleTime:bs});if(je.current)return;if(r(De),!De.connected){a(null),J([]),be([]),D([]),c(!1);return}const[Je,Qe,yt,Za]=await Promise.all([t.fetchQuery({queryKey:_e.traffic.summary(e,V),queryFn:()=>wQ(e,void 0,V),staleTime:bs}),t.fetchQuery({queryKey:_e.traffic.aiHistory(e,V),queryFn:()=>jQ(e,V).catch(()=>[]),staleTime:bs}),t.fetchQuery({queryKey:_e.traffic.sessionHistory(e,V),queryFn:()=>kQ(e,V).catch(()=>[]),staleTime:bs}),t.fetchQuery({queryKey:_e.traffic.socialHistory(e,V),queryFn:()=>NQ(e,V).catch(()=>[]),staleTime:bs})]);if(je.current)return;a(Je),J(Qe),be(yt),D(Za),c(!1)}catch(De){if(je.current)return;v(De instanceof Error?De.message:"Failed to load GA4 data"),c(!1)}}x.useEffect(()=>{const je={current:!1};return re(je),()=>{je.current=!0}},[e,V,t]);async function ke(){f(!0),v(null),b(null);try{const je=await r4(e);b(`Synced ${je.rowCount.toLocaleString()} page rows, ${je.aiReferralCount.toLocaleString()} AI and ${je.socialReferralCount.toLocaleString()} social referral rows (${je.days} days)`),await t.invalidateQueries({queryKey:_e.traffic.project(e)}),await re({current:!1})}catch(je){v(je instanceof Error?je.message:"Sync failed")}finally{f(!1)}}async function ze(){m(!0),v(null),b(null);try{await CQ(e),await t.invalidateQueries({queryKey:_e.traffic.project(e)}),r({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),a(null),b("GA4 disconnected")}catch(je){v(je instanceof Error?je.message:"Disconnect failed")}finally{m(!1)}}function te(je){j===je?O(De=>De==="desc"?"asc":"desc"):(k(je),O("desc"))}function fe(je){C===je?_(De=>De==="desc"?"asc":"desc"):(z(je),_("desc"))}function Ee(je){R===je?q(De=>De==="desc"?"asc":"desc"):($(je),q("desc"))}function Z(je){B===je?Q(De=>De==="desc"?"asc":"desc"):(K(je),Q("desc"))}const Ge=x.useMemo(()=>i?.topPages?[...i.topPages].sort((je,De)=>{const Je=je[j],Qe=De[j];return typeof Je=="string"&&typeof Qe=="string"?E==="asc"?Je.localeCompare(Qe):Qe.localeCompare(Je):E==="asc"?Je-Qe:Qe-Je}):[],[i?.topPages,j,E]),Me=x.useMemo(()=>i?.aiReferrals?[...i.aiReferrals].sort((je,De)=>{const Je=je[C],Qe=De[C];return typeof Je=="string"&&typeof Qe=="string"?A==="asc"?Je.localeCompare(Qe):Qe.localeCompare(Je):A==="asc"?Je-Qe:Qe-Je}):[],[i?.aiReferrals,C,A]),lt=x.useMemo(()=>i?.aiReferralLandingPages?[...i.aiReferralLandingPages].sort((je,De)=>{const Je=je[B],Qe=De[B];return typeof Je=="string"&&typeof Qe=="string"?X==="asc"?Je.localeCompare(Qe):Qe.localeCompare(Je):X==="asc"?Je-Qe:Qe-Je}):[],[i?.aiReferralLandingPages,B,X]),Te=x.useMemo(()=>i?.socialReferrals?[...i.socialReferrals].sort((je,De)=>{const Je=je[R],Qe=De[R];return typeof Je=="string"&&typeof Qe=="string"?F==="asc"?Je.localeCompare(Qe):Qe.localeCompare(Je):F==="asc"?Je-Qe:Qe-Je}):[],[i?.socialReferrals,R,F]),{socialChartData:Wt,socialChartSources:Ht,socialOtherCount:on}=x.useMemo(()=>{const je=BOe(M);return{socialChartData:je.data,socialChartSources:je.sources,socialOtherCount:je.otherCount}},[M]),{chartData:en,chartSources:_n,dateRange:ve}=x.useMemo(()=>{const je=[...new Set(H.map(Gt=>Gt.source))],De=new Map;for(const Gt of de)De.set(Gt.date,{_totalSessions:Gt.sessions,_organicSessions:Gt.organicSessions});const Je=new Map;for(const Gt of H){const wr=`${Gt.date}::${Gt.source}`,na=Je.get(wr)??0;Je.set(wr,Math.max(na,Gt.sessions))}for(const[Gt,wr]of Je){const[na,Us]=Gt.split("::");let Sr=De.get(na);Sr||(Sr={_totalSessions:0,_organicSessions:0},De.set(na,Sr)),Sr[Us]=(Sr[Us]??0)+wr}const Qe=[...De.entries()].sort(([Gt],[wr])=>Gt.localeCompare(wr)).map(([Gt,wr])=>({date:Gt,...wr})),yt=Qe.map(Gt=>Gt.date),Za=yt.length>0?{start:yt[0],end:yt[yt.length-1]}:null;return{chartData:Qe,chartSources:je,dateRange:Za}},[H,de]);if(l&&!n)return s.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!n?.connected)return s.jsx(KOe,{projectName:e,onConnected:()=>{(async()=>(await t.invalidateQueries({queryKey:_e.traffic.project(e)}),await re({current:!1})))()}});const ft=i?.organicSharePctDisplay??"0%",Ye=i?.channelBreakdown?.organic.sharePctDisplay??ft,rt=i?.channelBreakdown?.organic.sessions??i?.totalOrganicSessions??0,ae=i?.aiSessionsDeduped??0,Se=i?.channelBreakdown?.ai.sessions??i?.aiSessionsBySession??0,$e=i?.channelBreakdown?.ai.sharePctDisplay??i?.aiSharePctBySessionDisplay??"0%",Ze=i?new Set(i.aiReferrals.map(je=>je.source.toLowerCase())).size:0,Xe=Me[0]??null,Bn=i?.totalDirectSessions??0,fn=i?.directSharePctDisplay??"0%",jn=i?.channelBreakdown?.direct.sessions??Bn,Kt=i?.channelBreakdown?.direct.sharePctDisplay??fn,zn=i?.channelBreakdown?.other.sessions??i?.otherSessions??0,pt=i?.channelBreakdown?.other.sharePctDisplay??i?.otherSharePctDisplay??"0%",br=i?.socialSessions??0,Ce=i?.socialSharePctDisplay??"0%",rr=i?.channelBreakdown?.social.sessions??br,Sa=i?.channelBreakdown?.social.sharePctDisplay??Ce,Ei=i?new Set(i.socialReferrals.map(je=>je.source.toLowerCase())).size:0,ir=Te[0]??null;return s.jsxs(s.Fragment,{children:[y&&s.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&&s.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}),s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),s.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",s.jsx("span",{className:"text-zinc-300",children:n.propertyId}),n.clientEmail&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("span",{className:"text-zinc-500",children:n.clientEmail})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(pe,{variant:"outline",size:"sm",disabled:d,onClick:ke,children:[s.jsx(Sh,{className:`w-3.5 h-3.5 mr-1.5 ${d?"animate-spin":""}`}),d?"Syncing…":"Sync"]}),s.jsxs(pe,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:p,onClick:ze,children:[s.jsx(nY,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),s.jsxs("section",{children:[s.jsxs("div",{className:"mb-4 flex items-start justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),s.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",s.jsx(mr,{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.`})]})]}),s.jsx("div",{className:"flex gap-1",children:UOe.map(je=>s.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${V===je?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>ce(je),children:je==="all"?"All":je},je))})]}),i?s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsx($j,{value:jg(i.totalSessions),label:"Total Sessions",subtitle:i.totalSessions.toLocaleString(),tone:"neutral"}),s.jsx($j,{value:jg(i.totalOrganicSessions),label:"Organic Sessions",subtitle:`${ft} of total`,tone:"positive"}),s.jsx($j,{value:jg(i.totalUsers),label:"Total Users",subtitle:i.totalUsers.toLocaleString(),tone:"neutral"})]}):s.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[s.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),s.jsxs(pe,{variant:"outline",size:"sm",disabled:d,onClick:ke,children:[s.jsx(Sh,{className:`w-3.5 h-3.5 mr-1.5 ${d?"animate-spin":""}`}),"Sync from GA4"]})]})]}),i&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"page-section-divider"}),s.jsxs("section",{children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Attribution"}),s.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Traffic by channel",s.jsx(mr,{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."})]})]}),ve&&s.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(ve.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(ve.end+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),en.length>0&&s.jsxs(Pe,{className:"surface-card p-5 mb-4",children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:_n.length>0?"AI vs. total sessions":"All sessions (baseline)"}),_n.length===0&&s.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),_n.length===0&&s.jsx("p",{className:"text-xs text-zinc-500",children:"No AI referrals detected yet"})]}),s.jsx("div",{className:"h-64",children:s.jsx(Iy,{width:"100%",height:"100%",children:s.jsxs(MN,{data:en,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx(Gh,{dataKey:"date",tick:_o,tickLine:!1,axisLine:{stroke:pd},tickFormatter:$N}),s.jsx(Vh,{tick:_o,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),s.jsx(lv,{...Wu,labelFormatter:LN,formatter:(je,De)=>{const Je=typeof je=="number"?je.toLocaleString():String(je??0),Qe=String(De??"");return Qe==="_totalSessions"?[Je,"Total Sessions"]:Qe==="_organicSessions"?[Je,"Organic Sessions"]:[Je,Qe]}}),s.jsx(kU,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:je=>je==="_totalSessions"?"Total Sessions":je==="_organicSessions"?"Organic Sessions":je}),s.jsx(Lu,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),_n.map((je,De)=>s.jsx(Lu,{type:"monotone",dataKey:je,stackId:"ai",stroke:No[De%No.length],fill:No[De%No.length],fillOpacity:.4,strokeWidth:1.5},je))]})})})]}),s.jsxs(Pe,{className:"surface-card p-5 mb-4",children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Channel breakdown"})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-5",children:[s.jsx(la,{label:"Organic",value:Ye,hint:`${rt.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions from Google organic search (sessionDefaultChannelGrouping = 'Organic Search'), after known AI referrers are removed for a disjoint channel breakdown."}),s.jsx(la,{label:"Social",value:Sa,hint:`${rr.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."}),s.jsx(la,{label:"Direct",value:Kt,hint:`${jn.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."}),s.jsx(la,{label:"Known AI referrers (lower bound)",value:$e,hint:`${Se.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."}),s.jsx(la,{label:"Other channels",value:pt,hint:`${zn.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."})]}),Xe&&s.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: ",s.jsx("span",{className:"font-medium",children:Xe.source})," via ",Xe.medium,", accounting for ",Xe.sessions.toLocaleString()," sessions."]})]}),s.jsxs(Pe,{className:"surface-card p-5 mb-4",children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Detail"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Known AI referrers — sources detected"})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:i.aiReferrals.length>0?`${Ze} unique sources, ${i.aiReferrals.length} rows`:"No source rows"})]}),i.aiReferrals.length>0?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[s.jsx(Cr,{label:"Source",sortKey:"source",current:C,dir:A,onSort:fe,align:"left"}),s.jsx(Cr,{label:"Medium",sortKey:"medium",current:C,dir:A,onSort:fe,align:"left"}),s.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),s.jsx(Cr,{label:"Sessions",sortKey:"sessions",current:C,dir:A,onSort:fe,align:"right"}),s.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),s.jsx(Cr,{label:"Users",sortKey:"users",current:C,dir:A,onSort:fe,align:"right"})]})}),s.jsx("tbody",{children:Me.map(je=>s.jsx(VOe,{referral:je,totalSessions:ae},`${je.source}:${je.medium}:${je.sourceDimension}`))})]})}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[s.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI referrer sessions detected yet"}),s.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."})]})]}),s.jsxs(Pe,{className:"surface-card p-5",children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Detail"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Known AI referrers — landing pages"})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:lt.length>0?`${lt.length} rows`:"No landing-page rows"})]}),lt.length>0?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[s.jsx(Cr,{label:"Landing Page",sortKey:"landingPage",current:B,dir:X,onSort:Z,align:"left"}),s.jsx(Cr,{label:"Source",sortKey:"source",current:B,dir:X,onSort:Z,align:"left"}),s.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),s.jsx(Cr,{label:"Sessions",sortKey:"sessions",current:B,dir:X,onSort:Z,align:"right"}),s.jsx(Cr,{label:"Users",sortKey:"users",current:B,dir:X,onSort:Z,align:"right"})]})}),s.jsx("tbody",{children:lt.map(je=>s.jsx(QOe,{row:je},`${je.landingPage}:${je.source}:${je.medium}:${je.sourceDimension}`))})]})}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[s.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI landing pages detected yet"}),s.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&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"page-section-divider"}),s.jsxs("section",{children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Social Attribution"}),s.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Social Media Traffic",s.jsx(mr,{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."})]})]}),Wt.length>0&&s.jsxs(Pe,{className:"surface-card p-5 mb-4",children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social sessions over time"})]}),on>0&&s.jsxs("p",{className:"text-xs text-zinc-500",children:["Showing top ",Ht.length-1," sources · ",on," more grouped as Other"]})]}),s.jsx("div",{className:"h-64",children:s.jsx(Iy,{width:"100%",height:"100%",children:s.jsxs(MN,{data:Wt,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx(Gh,{dataKey:"date",tick:_o,tickLine:!1,axisLine:{stroke:pd},tickFormatter:$N}),s.jsx(Vh,{tick:_o,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),s.jsx(lv,{...Wu,labelFormatter:LN,formatter:(je,De)=>{const Je=typeof je=="number"?je.toLocaleString():String(je??0),Qe=String(De??"");if(Qe===Zu)return[Je,"Total Social"];if(Qe===md){const yt=`Other (${on} source${on===1?"":"s"})`;return[Je,yt]}return[Je,Xu(Qe)]}}),s.jsx(Lu,{type:"monotone",dataKey:Zu,stroke:p9,fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Ht.map((je,De)=>{const Qe=je===md?BN:No[De%No.length];return s.jsx(Lu,{type:"monotone",dataKey:je,stackId:"social",stroke:Qe,fill:Qe,fillOpacity:.4,strokeWidth:1.5},je)})]})})}),s.jsx(YOe,{sources:Ht,otherCount:on})]}),s.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[s.jsxs(Pe,{className:"surface-card p-5",children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social media visits"})]}),i.socialReferrals.length>0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[s.jsx(la,{label:"Social Sessions",value:jg(br),hint:`${br.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions classified as Organic Social or Paid Social by GA4's default channel grouping."}),s.jsx(la,{label:"Share of Traffic",value:Ce,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from social media platforms."}),s.jsx(la,{label:"Platforms",value:String(Ei),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."})]}),ir&&s.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:[s.jsx("p",{className:"text-xs uppercase tracking-wider text-sky-300/70 mb-1",children:"Top social source"}),s.jsx("p",{className:"font-medium truncate",title:`${ir.source} via ${ir.medium}`,children:h9(Xu(ir.source),64)}),s.jsxs("p",{className:"text-xs text-sky-200/70 mt-0.5 truncate",title:ir.medium,children:["via ",Xu(ir.medium)," · ",ir.sessions.toLocaleString()," sessions"]})]})]}):s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[s.jsx(la,{label:"Social Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to social media platforms."}),s.jsx(la,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions from social media."}),s.jsx(la,{label:"Platforms",value:"0",hint:"known platforms",tone:"neutral",tooltip:"Number of distinct social media platforms detected."})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3 text-sm text-zinc-400",children:[s.jsx("p",{className:"mb-1.5 text-zinc-300",children:"Monitoring social media traffic via GA4 channel grouping"}),s.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."})]})]})]}),s.jsxs(Pe,{className:"surface-card p-5",children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Breakdown"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Source / medium"})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:i.socialReferrals.length>0?Te.length>Zf&&!U?`Top ${Zf} of ${Te.length}`:`${Te.length} rows`:"No source rows"})]}),i.socialReferrals.length>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm table-fixed",children:[s.jsxs("colgroup",{children:[s.jsx("col",{className:"w-[32%]"}),s.jsx("col",{className:"w-[22%]"}),s.jsx("col",{className:"w-[12%]"}),s.jsx("col",{className:"w-[11%]"}),s.jsx("col",{className:"w-[11%]"}),s.jsx("col",{className:"w-[12%]"})]}),s.jsx("thead",{children:s.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[s.jsx(Cr,{label:"Source",sortKey:"source",current:R,dir:F,onSort:Ee,align:"left"}),s.jsx(Cr,{label:"Medium",sortKey:"medium",current:R,dir:F,onSort:Ee,align:"left"}),s.jsx("th",{className:"py-1 font-medium text-left",children:"Channel"}),s.jsx(Cr,{label:"Sessions",sortKey:"sessions",current:R,dir:F,onSort:Ee,align:"right"}),s.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),s.jsx(Cr,{label:"Users",sortKey:"users",current:R,dir:F,onSort:Ee,align:"right"})]})}),s.jsx("tbody",{children:(U?Te:Te.slice(0,Zf)).map(je=>s.jsx(WOe,{referral:je,totalSessions:br},`${je.source}:${je.medium}:${je.channelGroup}`))})]})}),Te.length>Zf&&s.jsx("div",{className:"mt-3 flex justify-center",children:s.jsx("button",{type:"button",onClick:()=>I(je=>!je),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:U?`Show top ${Zf}`:`Show all ${Te.length} sources`})})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[s.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No social media sessions detected yet"}),s.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&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"page-section-divider"}),s.jsxs("section",{children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),s.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",s.jsx(mr,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[s.jsx(Cr,{label:"Landing Page",sortKey:"landingPage",current:j,dir:E,onSort:te,align:"left"}),s.jsx(Cr,{label:"Sessions",sortKey:"sessions",current:j,dir:E,onSort:te,align:"right"}),s.jsx(Cr,{label:"Organic",sortKey:"organicSessions",current:j,dir:E,onSort:te,align:"right"}),s.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),s.jsx(Cr,{label:"Users",sortKey:"users",current:j,dir:E,onSort:te,align:"right"})]})}),s.jsx("tbody",{children:Ge.map(je=>s.jsx(GOe,{page:je},je.landingPage))})]})})]})]}),s.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[s.jsx("span",{children:i?.lastSyncedAt?`Last synced ${m9(i.lastSyncedAt)}`:"Never synced"}),s.jsx("span",{children:i?`${i.topPages.length} pages · ${i.aiReferrals.length} AI rows · ${i.socialReferrals.length} social rows`:""})]})]})}function KOe({projectName:e,onConnected:t}){const[n,r]=x.useState(""),[i,a]=x.useState(null),[l,c]=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 O=JSON.parse(E);if(!O.client_email||!O.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)."),c(null);return}c(E)}catch{m("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),c(null)}},k.onerror=()=>{m("Failed to read file."),c(null)},k.readAsText(j)},[]);async function w(){if(m(null),!n.trim()){m("Property ID is required.");return}if(!l){m("Please upload a service account key file.");return}f(!0);try{await SQ(e,{propertyId:n.trim(),keyJson:l});try{await r4(e)}catch{}t()}catch(b){m(b instanceof Error?b.message:"Failed to connect GA4")}finally{f(!1)}}return s.jsxs(Pe,{className:"surface-card p-6",children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-1",children:"Connect Google Analytics 4"}),s.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&&s.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}),s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{htmlFor:"ga4-property-id",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"GA4 Property ID"}),s.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"}),s.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)."})]}),s.jsxs("div",{className:"mb-5",children:[s.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Service Account Key File"}),s.jsx("input",{ref:y,type:"file",accept:".json,application/json",onChange:v,className:"hidden"}),s.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:[s.jsx(iY,{className:"w-4 h-4 shrink-0"}),i?s.jsx("span",{className:"text-zinc-200 truncate",children:i}):s.jsx("span",{children:"Upload .json key file"})]}),s.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 ",s.jsx("span",{className:"text-zinc-400",children:"Viewer"})," access on the GA4 property."]})]}),s.jsx(pe,{variant:"default",size:"sm",disabled:d||!n.trim()||!l,onClick:w,children:d?"Connecting & syncing…":"Connect GA4"})]})}function Cr({label:e,sortKey:t,current:n,dir:r,onSort:i,align:a}){const l=n===t;return s.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${a==="right"?"text-right":"text-left"}`,onClick:()=>i(t),children:[e,l&&s.jsx("span",{className:"ml-0.5",children:r==="asc"?"↑":"↓"})]})}const g9={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function $j({value:e,label:t,subtitle:n,tone:r}){return s.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),s.jsx("p",{className:`text-2xl font-bold tabular-nums ${g9[r]}`,children:e}),s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function la({value:e,label:t,hint:n,tone:r,tooltip:i}){return s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-4 py-3 flex flex-col",children:[s.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1 flex items-center gap-1",children:[t,i&&s.jsx(mr,{text:i})]}),s.jsx("p",{className:`text-xl font-semibold tabular-nums ${g9[r]}`,children:e}),s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function GOe({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return s.jsxs("tr",{className:"border-t border-zinc-800/40",children:[s.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),s.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),s.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),s.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),s.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}const y9={session:"Session",first_user:"First Visit",manual_utm:"UTM"},v9={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 VOe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=y9[e.sourceDimension]??e.sourceDimension,i=v9[e.sourceDimension]??"";return s.jsxs("tr",{className:"border-t border-zinc-800/40",children:[s.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),s.jsx("td",{className:"py-1.5 text-zinc-500 max-w-[180px] truncate",title:e.medium,children:e.medium}),s.jsx("td",{className:"py-1.5",children:s.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})}),s.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),s.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),s.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function QOe({row:e}){const t=y9[e.sourceDimension]??e.sourceDimension,n=v9[e.sourceDimension]??"";return s.jsxs("tr",{className:"border-t border-zinc-800/40",children:[s.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[360px] truncate",title:e.landingPage,children:e.landingPage}),s.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),s.jsx("td",{className:"py-1.5",children:s.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})}),s.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),s.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function WOe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=e.channelGroup==="Paid Social"?"Paid":"Organic",i=Xu(e.source),a=Xu(e.medium);return s.jsxs("tr",{className:"border-t border-zinc-800/40",children:[s.jsx("td",{className:"py-1.5 pr-3 text-zinc-200 truncate",title:e.source,children:i}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-500 truncate",title:e.medium,children:a}),s.jsx("td",{className:"py-1.5 pr-3",children:s.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})}),s.jsx("td",{className:"py-1.5 text-right text-sky-400 tabular-nums",children:e.sessions.toLocaleString()}),s.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),s.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function YOe({sources:e,otherCount:t}){const n=[{key:Zu,color:p9,label:"Total",tooltip:"All social sessions across every source."}];for(let r=0;r<e.length;r++){const i=e[r];if(i===md)n.push({key:md,color:BN,label:`Other (${t})`,tooltip:`${t} smaller source${t===1?"":"s"} grouped together`});else{const a=Xu(i);n.push({key:i,color:No[r%No.length]??BN,label:h9(a,32),tooltip:a})}}return s.jsx("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1.5 text-[11px] text-zinc-400",children:n.map(r=>s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 max-w-[260px]",title:r.tooltip,children:[s.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-sm shrink-0",style:{backgroundColor:r.color},"aria-hidden":"true"}),s.jsx("span",{className:"truncate",children:r.label})]},r.key))})}function x9(e){e.invalidateQueries({queryKey:_e.runs.all}),e.invalidateQueries({queryKey:_e.projects.all})}function ZOe(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function XOe(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 tx(e,t){w3({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),dt({title:ZOe(e.kind),detail:XOe(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function JOe(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){dt({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)w3({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=Une({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});dt({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 nx(e,t){if(e instanceof yr&&e.code==="RUN_IN_PROGRESS"){dt({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}dt({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function b9(){const e=vr();return Ba({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>CV(t,n),onSuccess:(t,n)=>{x9(e),tx(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{nx(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function e_e(){const e=vr();return Ba({meta:{skipGlobalErrorToast:!0},mutationFn:t=>HV(t),onSuccess:t=>{x9(e),JOe(t)},onError:t=>{dt({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function t_e(){const e=vr();return Ba({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>J5(t,n),onSuccess:(t,n)=>{Xv(e,ht["gsc-sync"],n.projectName),tx(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{nx(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function n_e(){const e=vr();return Ba({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>rQ(t),onSuccess:(t,n)=>{Xv(e,t.run.kind,n.projectName),tx(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{nx(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function r_e(){const e=vr();return Ba({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>tQ(t,n),onSuccess:(t,n)=>{Xv(e,ht["inspect-sitemap"],n.projectName),tx(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{nx(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}const i_e=["7d","30d","90d","all"],Ng=500;function a_e({projectName:e}){const t=vr(),[n,r]=x.useState(!1),[i,a]=x.useState([]),[l,c]=x.useState([]),[d,f]=x.useState([]),[p,m]=x.useState([]),[y,v]=x.useState([]),[w,b]=x.useState(null),[j,k]=x.useState(""),[E,O]=x.useState(""),[C,z]=x.useState("30"),[A,_]=x.useState(!1),[R,$]=x.useState("30d"),[F,q]=x.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[B,K]=x.useState(0),[X,Q]=x.useState(!1),[H,J]=x.useState(0),[de,be]=x.useState(!1),[M,D]=x.useState(""),[U,I]=x.useState(!0),[V,ce]=x.useState(!1),[re,ke]=x.useState(!1),[ze,te]=x.useState(!1),[fe,Ee]=x.useState(!1),[Z,Ge]=x.useState(!1),[Me,lt]=x.useState(!1),[Te,Wt]=x.useState(null),[Ht,on]=x.useState(!1),[en,_n]=x.useState(!1),[ve,ft]=x.useState(null),[Ye,rt]=x.useState(""),[ae,Se]=x.useState(!1),[$e,Ze]=x.useState(!1),[Xe,Bn]=x.useState("indexed"),[fn,jn]=x.useState(null),Kt=!!(F.query.trim()||F.page.trim()||fn),zn=fn!==null,pt=x.useMemo(()=>{if(!fn)return d;const{key:W,dir:Ae}=fn;return[...d].sort((at,kt)=>{const wt=W===Eo.CTR?Number.isFinite(at.ctr)?at.ctr:0:at[W],ra=W===Eo.CTR?Number.isFinite(kt.ctr)?kt.ctr:0:kt[W];return Ae==="asc"?wt-ra:ra-wt})},[d,fn]),[br,Ce]=x.useState([]),[rr,Sa]=x.useState(null),[Ei,ir]=x.useState(!1),[je,De]=x.useState(null),[Je,Qe]=x.useState(null),yt=i.find(W=>W.connectionType==="gsc"),Za=d.length>0||p.length>0||y.length>0,Gt=t_e(),wr=n_e(),na=r_e();async function Us(W){if(!W){c([]),k("");return}ke(!0);try{const{sites:Ae}=await t.fetchQuery({queryKey:_e.gsc.properties(e),queryFn:()=>VV(e),staleTime:_r});c(Ae),k(W.propertyId??Ae[0]?.siteUrl??"")}catch(Ae){c([]),De(Ae instanceof Error?Ae.message:"Failed to load Search Console properties")}finally{ke(!1)}}async function Sr(W){Ee(!0);const Ae=W??B;try{const at=parseInt(F.limit,10)||20,kt=Kt?Ng:at+1,wt=Kt?0:Ae,ra={startDate:F.startDate,endDate:F.endDate,query:F.query,page:F.page,limit:String(kt),offset:String(wt),window:R},Mr=await t.fetchQuery({queryKey:_e.gsc.performance(e,ra),queryFn:()=>YV(e,{startDate:F.startDate||void 0,endDate:F.endDate||void 0,query:F.query||void 0,page:F.page||void 0,limit:kt,offset:wt,window:R}),staleTime:_r});Kt?(Q(!1),f(Mr),J(Mr.length),be(!0)):(Q(Mr.length>at),f(Mr.slice(0,at)),J(0),be(!1))}catch(at){f([]),Q(!1),J(0),De(at instanceof Error?at.message:"Failed to load GSC performance data")}finally{Ee(!1)}}async function qs(){Ge(!0);try{const W=M.trim()||void 0,[Ae,at]=await Promise.all([t.fetchQuery({queryKey:_e.gsc.inspections(e,W),queryFn:()=>XV(e,{url:W,limit:20}),staleTime:_r}),t.fetchQuery({queryKey:_e.gsc.deindexed(e),queryFn:()=>JV(e),staleTime:_r})]);m(Ae),v(at)}catch(W){m([]),v([]),De(W instanceof Error?W.message:"Failed to load GSC inspection history")}finally{Ge(!1)}}async function Nc(){on(!0);try{const[W,Ae]=await Promise.all([t.fetchQuery({queryKey:_e.gsc.coverage(e),queryFn:()=>ck(e),staleTime:_r}),t.fetchQuery({queryKey:_e.gsc.coverageHistory(e),queryFn:()=>eQ(e).catch(()=>[]),staleTime:_r})]);Wt(W),Ce(Ae)}catch(W){Wt(null),Ce([]),De(W instanceof Error?W.message:"Failed to load coverage data")}finally{on(!1)}}async function Md(W){ir(!0),De(null);try{const Ae=await M2(e,{urls:W}),{succeeded:at,failed:kt,total:wt}=Ae.summary;dt({title:"Indexing requested",detail:kt===0?`${at} URL${at!==1?"s":""} submitted for indexing.`:`${at}/${wt} submitted successfully, ${kt} failed.`,tone:kt===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(Ae){De(Ae instanceof Error?Ae.message:"Failed to request indexing")}finally{ir(!1)}}async function Sp(){ir(!0),De(null);try{const W=await M2(e,{urls:[],allUnindexed:!0}),{succeeded:Ae,failed:at,total:kt}=W.summary;dt({title:"Indexing requested",detail:at===0?`${Ae} unindexed URL${Ae!==1?"s":""} submitted for indexing.`:`${Ae}/${kt} submitted successfully, ${at} failed.`,tone:at===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(W){De(W instanceof Error?W.message:"Failed to request indexing")}finally{ir(!1)}}async function hi(){if(Ye.trim()){Se(!0),De(null);try{await WV(e,"gsc",Ye.trim()),await t.invalidateQueries({queryKey:_e.gsc.project(e)}),a(W=>W.map(Ae=>Ae.connectionType==="gsc"?{...Ae,sitemapUrl:Ye.trim()}:Ae)),dt({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),rt("")}catch(W){De(W instanceof Error?W.message:"Failed to save sitemap URL")}finally{Se(!1)}}}async function Tn(){De(null);try{const W=await wr.mutateAsync({projectName:e,projectLabel:e});ft(W.sitemaps),a(Ae=>Ae.map(at=>at.connectionType==="gsc"?{...at,sitemapUrl:W.primarySitemapUrl}:at))}catch{}}async function jr(){_n(!0),De(null);try{const W=await nQ(e);t.setQueryData(_e.gsc.sitemaps(e),W),ft(W.sitemaps),W.sitemaps.length===0&&Qe("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(W){De(W instanceof Error?W.message:"Failed to list sitemaps")}finally{_n(!1)}}async function Xa(){I(!0),De(null);try{const[W,Ae]=await Promise.all([lk().catch(()=>null),t.fetchQuery({queryKey:_e.gsc.connections(e),queryFn:()=>X5(e).catch(()=>[]),staleTime:_r})]);r(!!W?.google?.configured),a(Ae);const at=Ae.find(kt=>kt.connectionType==="gsc");await Promise.all([Us(at),Sr(),qs(),Nc()])}finally{I(!1)}}x.useEffect(()=>{Xa()},[e]),x.useEffect(()=>{K(0),Sr(0)},[R]);const kc=x.useRef(!1);x.useEffect(()=>{if(!kc.current){kc.current=!0;return}K(0),Sr(0)},[zn]);async function rx(){if(!n){De("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}ce(!0),De(null),Qe(null);try{const{authUrl:W}=await KV(e,"gsc");if(!W.startsWith("https://accounts.google.com/")){De("Unexpected OAuth redirect URL. Please try again.");return}const Ae=window.open(W,"_blank","width=600,height=700");if(!Ae){window.location.assign(W);return}Qe("Finish the Google consent flow in the popup, then close it to refresh this project.");const at=window.setInterval(()=>{Ae.closed&&(window.clearInterval(at),Qe(null),t.invalidateQueries({queryKey:_e.gsc.project(e)}),Xa())},1e3)}catch(W){De(W instanceof Error?W.message:"Failed to start OAuth flow")}finally{ce(!1)}}async function ix(){De(null),Qe(null);try{await GV(e,"gsc"),await t.invalidateQueries({queryKey:_e.gsc.project(e)}),a(W=>W.filter(Ae=>Ae.connectionType!=="gsc")),c([]),k("")}catch(W){De(W instanceof Error?W.message:"Failed to disconnect")}}async function jp(){if(j){te(!0),De(null);try{await QV(e,"gsc",j),await t.invalidateQueries({queryKey:_e.gsc.project(e)}),a(W=>W.map(Ae=>Ae.connectionType==="gsc"?{...Ae,propertyId:j}:Ae)),dt({title:"GSC property updated",detail:`${e} is now linked to ${j}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(W){De(W instanceof Error?W.message:"Failed to save GSC property")}finally{te(!1)}}}async function Xo(){De(null),Qe(null);try{await Gt.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(C,10)||void 0,full:A||void 0}}),await t.invalidateQueries({queryKey:_e.gsc.project(e)})}catch{}}async function Cc(){if(E.trim()){lt(!0),De(null),Qe(null);try{const W=await ZV(e,E.trim());await t.invalidateQueries({queryKey:_e.gsc.project(e)}),b(W),O(""),await qs()}catch(W){De(W instanceof Error?W.message:"Failed to inspect URL")}finally{lt(!1)}}}return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),s.jsx("h2",{children:"Google Search Console"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex gap-1",children:i_e.map(W=>s.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${R===W?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>$(W),children:W==="all"?"All":W},W))}),yt&&s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:fe,onClick:()=>{K(0),Sr(0)},children:fe?"Refreshing…":"Refresh data"})]})]}),je&&s.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:[je,s.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>De(null),children:"×"})]}),Je&&s.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:[Je,s.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>Qe(null),children:"×"})]}),U?s.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):s.jsxs("div",{className:"space-y-3",children:[s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),s.jsx("h3",{children:"Domain authorization"})]}),s.jsx(tt,{tone:yt?"positive":n?"caution":"negative",children:yt?"Connected":n?"Ready to connect":"App credentials missing"})]}),yt?s.jsxs("div",{className:"mt-3 space-y-3",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),s.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),s.jsx("span",{className:"text-xs text-zinc-500",children:yt.domain}),s.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:ix,children:"Disconnect"})]}),s.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",s.jsx("code",{children:yt.domain}),"."]})]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:yt.propertyId??"No property selected yet"})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ua(yt.updatedAt)})]})]})]}):s.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[s.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."}),s.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[n?s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:V,onClick:rx,children:V?"Opening…":"Connect Google Search Console"}):s.jsx(pe,{type:"button",variant:"outline",size:"sm",asChild:!0,children:s.jsx(Et,{to:"/settings",children:"Open Settings"})}),!n&&s.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),yt&&!yt.sitemapUrl&&s.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"mt-0.5 text-amber-400",children:s.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:s.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"})})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),s.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."}),s.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[s.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[s.jsx(pe,{type:"button",size:"sm",disabled:wr.isPending||!yt.propertyId,onClick:Tn,children:wr.isPending?"Discovering…":"Auto-discover from GSC"}),s.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),s.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[s.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:Ye,onChange:W=>rt(W.target.value),onKeyDown:W=>W.key==="Enter"&&void hi()}),s.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:ae||!Ye.trim(),onClick:hi,children:ae?"Saving…":"Save sitemap URL"})]})]})]})]})}),(yt||Za)&&s.jsxs(s.Fragment,{children:[s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),s.jsx("h3",{children:"Index coverage"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[Te&&Te.notIndexed.length>0&&s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:Ei,onClick:()=>{Sp()},children:Ei?"Requesting…":`Request indexing (${Te.notIndexed.length})`}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:Ht,onClick:()=>{Nc()},children:Ht?"Loading…":"Refresh coverage"})]})]}),Te&&Te.summary.total>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const W=Te.summary.indexed+Te.summary.notIndexed,Ae=W>0?Te.summary.indexed/W:0,at=W>0?Te.summary.notIndexed/W:0,kt=54,wt=2*Math.PI*kt,ra=wt*(1-Ae),Mr=wt*at,Wr=wt*Ae;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative h-48 w-48",children:[s.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[s.jsx("circle",{cx:"64",cy:"64",r:kt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),s.jsx("circle",{cx:"64",cy:"64",r:kt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:wt,strokeDashoffset:ra,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),Te.summary.notIndexed>0&&s.jsx("circle",{cx:"64",cy:"64",r:kt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Mr} ${wt-Mr}`,strokeDashoffset:-Wr,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),s.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[s.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(Ae*100).toFixed(0),"%"]}),s.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),s.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:Te.summary.indexed.toLocaleString()}),s.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),s.jsx("div",{className:"h-8 w-px bg-zinc-800"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:Te.summary.notIndexed.toLocaleString()}),s.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(Te.reasonGroups??[]).length>0&&s.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(Te.reasonGroups??[]).length," ",(Te.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),Te.summary.deindexed>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"h-8 w-px bg-zinc-800"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:Te.summary.deindexed.toLocaleString()}),s.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),s.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(W=>{const Ae=W==="indexed"?Te.indexed.length:W==="notIndexed"?Te.notIndexed.length:Te.deindexed.length,at=W==="indexed"?"Indexed":W==="notIndexed"?"Not Indexed":"Deindexed";return s.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${Xe===W?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Bn(W),Sa(null)},children:[at," (",Ae,")"]},W)})}),s.jsxs("div",{className:"mt-3 overflow-x-auto",children:[Xe==="indexed"&&Te.indexed.length>0&&s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Verdict"}),s.jsx("th",{className:"text-left",children:"Last Crawl"}),s.jsx("th",{className:"text-left",children:"Mobile"})]})}),s.jsx("tbody",{children:Te.indexed.map(W=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:W.url}),s.jsx("td",{className:"text-zinc-400",children:W.verdict??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:W.crawlTime?W.crawlTime.split("T")[0]:"—"}),s.jsx("td",{className:"text-zinc-400",children:W.isMobileFriendly===!0?"Yes":W.isMobileFriendly===!1?"No":"—"})]},W.id))})]}),Xe==="notIndexed"&&!rr&&(Te.reasonGroups??[]).length>0&&s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"Reason"}),s.jsx("th",{className:"text-right",children:"Pages"})]})}),s.jsx("tbody",{children:(Te.reasonGroups??[]).map(W=>s.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Sa(W.reason),children:[s.jsx("td",{className:"text-zinc-200",children:W.reason}),s.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:W.count})]},W.reason))})]}),Xe==="notIndexed"&&!rr&&(Te.reasonGroups??[]).length===0&&Te.notIndexed.length>0&&s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Indexing State"}),s.jsx("th",{className:"text-left",children:"Coverage"})]})}),s.jsx("tbody",{children:Te.notIndexed.map(W=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:W.url}),s.jsx("td",{className:"text-zinc-400",children:W.indexingState??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:W.coverageState??"Unknown"})]},W.id))})]}),Xe==="notIndexed"&&rr&&(()=>{const W=(Te.reasonGroups??[]).find(Ae=>Ae.reason===rr);return W?s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center gap-2 mb-3",children:s.jsxs("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Sa(null),children:["←"," Back to reasons"]})}),s.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-zinc-200",children:W.reason}),s.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[W.count," affected page",W.count!==1?"s":""]})]}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:Ei,onClick:()=>{Md(W.urls.map(Ae=>Ae.url))},children:Ei?"Requesting…":`Request indexing (${W.count})`})]}),s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Last Crawl"}),s.jsx("th",{className:"w-8"})]})}),s.jsx("tbody",{children:W.urls.map(Ae=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Ae.url}),s.jsx("td",{className:"text-zinc-400",children:Ae.crawlTime?Ae.crawlTime.split("T")[0]:"—"}),s.jsx("td",{children:s.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:Ei,onClick:()=>{Md([Ae.url])},title:"Request indexing",children:"Index"})})]},Ae.id))})]})]}):null})(),Xe==="deindexed"&&Te.deindexed.length>0&&s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Previous"}),s.jsx("th",{className:"text-left",children:"Current"}),s.jsx("th",{className:"text-left",children:"Detected"})]})}),s.jsx("tbody",{children:Te.deindexed.map((W,Ae)=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:W.url}),s.jsx("td",{className:"text-zinc-400",children:W.previousState}),s.jsx("td",{className:"text-zinc-400",children:W.currentState}),s.jsx("td",{className:"text-zinc-400",children:W.transitionDate.split("T")[0]})]},`${W.url}-${Ae}`))})]}),(Xe==="indexed"&&Te.indexed.length===0||Xe==="notIndexed"&&!rr&&Te.notIndexed.length===0||Xe==="deindexed"&&Te.deindexed.length===0)&&s.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):s.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:Ht?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),s.jsx("h3",{children:"Search performance"})]}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:fe,onClick:()=>{K(0),Sr(0)},children:fe?"Loading…":"Apply filters"})]}),d.length>0&&(()=>{const W=new Map;for(const vt of d){const $t=W.get(vt.date);$t?($t.clicks+=vt.clicks,$t.impressions+=vt.impressions):W.set(vt.date,{clicks:vt.clicks,impressions:vt.impressions})}const Ae=[...W.entries()].sort(([vt],[$t])=>vt.localeCompare($t));if(Ae.length===0)return null;const at=Math.max(...Ae.map(([,vt])=>vt.impressions),1),kt=Ae.reduce((vt,[,$t])=>vt+$t.clicks,0),wt=Ae.reduce((vt,[,$t])=>vt+$t.impressions,0),ra=wt>0?(kt/wt*100).toFixed(1):"0.0",Mr=700,Wr=220,Un={top:12,bottom:36,left:48,right:12},ax=Mr-Un.left-Un.right,Ja=Wr-Un.top-Un.bottom,Fs=ax/Ae.length,Ac=Math.max(Math.min(Fs*.35,24),4),Jo=Math.max(Ac*.15,1),Ec=vt=>{if(vt<=0)return 1;const $t=Math.pow(10,Math.floor(Math.log10(vt))),Nr=vt/$t,ja=Nr<=1.5?1.5:Nr<=3?3:Nr<=5?5:10;return Math.ceil(ja*$t)},Yr=4,ar=Math.ceil(Ec(at)/Yr)*Yr,Np=Array.from({length:Yr+1},(vt,$t)=>ar/Yr*$t),sx=vt=>vt>=1e3?`${(vt/1e3).toFixed(vt>=1e4?0:1)}k`:String(vt);return s.jsxs("div",{className:"mt-3",children:[s.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),s.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",s.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:kt.toLocaleString()})]})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),s.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",s.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:wt.toLocaleString()})]})]}),s.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",s.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[ra,"%"]})]})]}),s.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Mr} / ${Wr}`},children:s.jsxs("svg",{viewBox:`0 0 ${Mr} ${Wr}`,className:"h-full w-full",children:[Np.map((vt,$t)=>{const Nr=Un.top+Ja-vt/ar*Ja;return s.jsxs("g",{children:[s.jsx("line",{x1:Un.left,y1:Nr,x2:Mr-Un.right,y2:Nr,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),s.jsx("text",{x:Un.left-6,y:Nr+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:sx(vt)})]},`t-${$t}`)}),Ae.map(([vt,$t],Nr)=>{const ja=Un.left+Fs*Nr+Fs/2,sr=$t.impressions/ar*Ja,Oc=$t.clicks/ar*Ja;return s.jsxs("g",{children:[s.jsx("title",{children:`${vt}
|
|
290
|
-
Clicks: ${$t.clicks}
|
|
291
|
-
Impressions: ${$t.impressions}
|
|
292
|
-
CTR: ${$t.impressions>0?($t.clicks/$t.impressions*100).toFixed(1):0}%`}),s.jsx("rect",{x:ja-Ac-Jo/2,y:Un.top+Ja-sr,width:Ac,height:Math.max(sr,1),rx:2,fill:"#3b82f6",opacity:.85}),s.jsx("rect",{x:ja+Jo/2,y:Un.top+Ja-Oc,width:Ac,height:Math.max(Oc,1),rx:2,fill:"#10b981",opacity:.85})]},vt)}),(()=>{const vt=Math.min(Ae.length,7);return Array.from({length:vt},($t,Nr)=>{const ja=Ae.length===1?0:Math.round(Nr/(vt-1)*(Ae.length-1)),sr=Un.left+Fs*ja+Fs/2;return s.jsx("text",{x:sr,y:Wr-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:Ae[ja][0].slice(5)},`xl-${ja}`)})})()]})})]})})(),s.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[s.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","aria-label":"Start date",title:"Start date (inclusive). Leave blank to use the window above.",value:F.startDate,onChange:W=>q(Ae=>({...Ae,startDate:W.target.value}))}),s.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","aria-label":"End date",title:"End date (inclusive).",value:F.endDate,onChange:W=>q(Ae=>({...Ae,endDate:W.target.value}))}),s.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:"Contains query…","aria-label":"Filter query (substring match)",title:"Case-insensitive substring match on the query column.",value:F.query,onChange:W=>q(Ae=>({...Ae,query:W.target.value}))}),s.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:"Contains page URL…","aria-label":"Filter page (substring match)",title:"Case-insensitive substring match on the page URL.",value:F.page,onChange:W=>q(Ae=>({...Ae,page:W.target.value}))}),s.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:"Rows per page (20)","aria-label":"Rows per page",title:"Rows per page. Ignored while a filter or column sort is active — then up to 500 matches are loaded.",value:F.limit,onChange:W=>q(Ae=>({...Ae,limit:W.target.value}))})]}),s.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Query and page filters match case-insensitive substrings. Click Apply filters to run. When a filter or column sort is active, up to ",Ng.toLocaleString()," matching rows load so sorting covers the full set."]}),d.length>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mt-3 overflow-x-auto",children:s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"Date"}),s.jsx("th",{className:"text-left",children:"Query"}),s.jsx("th",{className:"text-left",children:"Page"}),Object.values(Eo).map(W=>s.jsx("th",{className:"text-right","aria-sort":fn?.key===W?fn.dir==="asc"?"ascending":"descending":"none",children:s.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:()=>jn(Ae=>Ae?.key===W?Ae.dir==="desc"?{key:W,dir:"asc"}:null:{key:W,dir:"desc"}),children:[kne[W],fn?.key===W?fn.dir==="desc"?" ↓":" ↑":""]})},W))]})}),s.jsx("tbody",{children:pt.map((W,Ae)=>s.jsxs("tr",{children:[s.jsx("td",{className:"text-zinc-400",children:W.date}),s.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:W.query}),s.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:W.page}),s.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:W.clicks.toLocaleString()}),s.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:W.impressions.toLocaleString()}),s.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(W.ctr)?W.ctr*100:0).toFixed(1),"%"]}),s.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:W.position.toFixed(1)})]},`${W.date}:${W.query}:${W.page}:${Ae}`))})]})}),de?s.jsx("div",{className:"mt-3 text-xs text-zinc-500",children:s.jsxs("span",{className:"tabular-nums",children:["Showing ",H.toLocaleString()," matching row",H===1?"":"s",H>=Ng?` (capped at ${Ng.toLocaleString()} — narrow the filter to see more)`:""]})}):(B>0||X)&&(()=>{const W=parseInt(F.limit,10)||20,Ae=B+1,at=B+d.length;return s.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs text-zinc-500",children:[s.jsxs("span",{className:"tabular-nums",children:["Showing ",Ae.toLocaleString()," – ",at.toLocaleString(),X?"+":""]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:fe||B===0,onClick:()=>{const kt=Math.max(0,B-W);K(kt),Sr(kt)},children:"Previous"}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:fe||!X,onClick:()=>{const kt=B+W;K(kt),Sr(kt)},children:"Next"})]})]})})()]}):s.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),s.jsxs(Pe,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),s.jsx("h3",{children:"Inspect a URL"})]})}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[s.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:W=>O(W.target.value),onKeyDown:W=>W.key==="Enter"&&void Cc()}),s.jsx(pe,{type:"button",size:"sm",disabled:Me||!yt?.propertyId||!E.trim(),onClick:Cc,children:Me?"Inspecting…":"Inspect URL"})]}),w&&s.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:w.indexingState??"Unknown"})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:w.verdict??"Unknown"})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:yT(w.isMobileFriendly)})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ua(w.crawlTime)})]})]})]}),s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),s.jsx("h3",{children:"Inspection log"})]}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:Z,onClick:()=>{qs()},children:Z?"Loading…":"Refresh history"})]}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[s.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:M,onChange:W=>D(W.target.value)}),s.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:Z,onClick:()=>{qs()},children:"Apply filter"})]}),p.length>0?s.jsx("div",{className:"mt-3 overflow-x-auto",children:s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Indexing"}),s.jsx("th",{className:"text-left",children:"Verdict"}),s.jsx("th",{className:"text-left",children:"Coverage"}),s.jsx("th",{className:"text-left",children:"Mobile"}),s.jsx("th",{className:"text-left",children:"Inspected"})]})}),s.jsx("tbody",{children:p.map(W=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:W.url}),s.jsx("td",{className:"text-zinc-300",children:W.indexingState??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:W.verdict??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:W.coverageState??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:yT(W.isMobileFriendly)}),s.jsx("td",{className:"text-zinc-400",children:ua(W.inspectedAt)})]},W.id))})]})}):s.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),s.jsxs(Pe,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),s.jsx("h3",{children:"Recent indexing losses"})]})}),y.length>0?s.jsx("div",{className:"mt-3 overflow-x-auto",children:s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Previous"}),s.jsx("th",{className:"text-left",children:"Current"}),s.jsx("th",{className:"text-left",children:"Changed at"})]})}),s.jsx("tbody",{children:y.map(W=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:W.url}),s.jsx("td",{className:"text-zinc-400",children:W.previousState??"Unknown"}),s.jsx("td",{className:"text-zinc-300",children:W.currentState??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:ua(W.transitionDate)})]},`${W.url}:${W.transitionDate}`))})]})}):s.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),yt&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:s.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>Ze(W=>!W),children:[s.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 ${$e?"rotate-90":""}`,"aria-hidden":"true",children:s.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"})}),s.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),$e&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[s.jsxs(Pe,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),s.jsx("h3",{children:"Pick the Search Console property"})]})}),s.jsxs("div",{className:"mt-3 space-y-2",children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),s.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:re||l.length===0,onChange:W=>k(W.target.value),children:l.length===0?s.jsx("option",{value:"",children:re?"Loading properties…":"No properties available"}):l.map(W=>s.jsxs("option",{value:W.siteUrl,children:[W.siteUrl," · ",W.permissionLevel]},W.siteUrl))}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:re,onClick:()=>{Us(yt)},children:re?"Refreshing…":"Refresh properties"}),s.jsx(pe,{type:"button",size:"sm",disabled:!j||ze,onClick:jp,children:ze?"Saving…":"Save property"})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),s.jsxs(Pe,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),s.jsx("h3",{children:"Import GSC performance data"})]})}),s.jsxs("div",{className:"mt-3 space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),s.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:C,onChange:W=>z(W.target.value)})]}),s.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:[s.jsx("input",{type:"checkbox",checked:A,onChange:W=>_(W.target.checked)}),"Replace existing imported rows for the requested range"]})]}),s.jsx(pe,{type:"button",size:"sm",disabled:Gt.isPending||!yt.propertyId,onClick:Xo,children:Gt.isPending?"Queueing…":"Queue sync"}),!yt.propertyId&&s.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),s.jsxs(Pe,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),s.jsx("h3",{children:"Sitemap configuration"})]})}),s.jsxs("div",{className:"mt-3 space-y-3",children:[yt.sitemapUrl&&s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:yt.sitemapUrl})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:en||!yt.propertyId,onClick:()=>{jr()},children:en?"Loading…":"Browse sitemaps from GSC"}),s.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:wr.isPending||!yt.propertyId,onClick:Tn,children:wr.isPending?"Discovering…":"Auto-discover and queue inspection"})]}),s.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."}),ve&&ve.length>0&&s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[s.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",ve.length,")"]}),ve.map(W=>{const Ae=W.contents?.[0];return s.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-zinc-200 break-all",children:W.path}),W.lastSubmitted&&s.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",W.lastSubmitted.split("T")[0]]})]}),s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[Ae&&s.jsxs("div",{className:"text-right",children:[s.jsxs("p",{className:"text-zinc-300",children:[Ae.indexed," / ",Ae.submitted]}),s.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),s.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>rt(W.path),children:"Use"})]})]},W.path)})]}),s.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[s.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:yt.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Ye,onChange:W=>rt(W.target.value),onKeyDown:W=>W.key==="Enter"&&Ye.trim()&&void hi()}),s.jsx(pe,{type:"button",size:"sm",disabled:ae||!Ye.trim(),onClick:hi,children:ae?"Saving…":yt.sitemapUrl?"Update":"Save"})]}),s.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[s.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}`}),s.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:na.isPending||!yt.propertyId,onClick:async()=>{const Ae=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||yt.sitemapUrl||void 0;De(null),Qe(null);try{await na.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:Ae}})}catch{}},children:na.isPending?"Queueing…":"Inspect sitemap"})]}),!yt.propertyId&&s.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function Bj({children:e,label:t="More info",placement:n="top",className:r}){const i=x.useId(),[a,l]=x.useState(!1);return s.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[s.jsx("button",{type:"button","aria-label":t,"aria-describedby":a?i:void 0,className:"inline-flex h-4 w-4 items-center justify-center rounded-full text-zinc-500 hover:text-zinc-200 focus:text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onFocus:()=>l(!0),onBlur:()=>l(!1),children:s.jsx(u4,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&s.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 jl=50;function Nu(e){return typeof window>"u"?e:`${window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??""}${e}`}function kg(e){return e.toLocaleString()}function s_e(e){const t=Number(e);return Number.isFinite(t)?`${(t*100).toFixed(1)}%`:"—"}function o_e(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 l_e(e){const t=e.filter(n=>n.kind===ht["backlink-extract"]&&!_k(n.status));return t.length===0?null:t.reduce((n,r)=>n.createdAt>r.createdAt?n:r)}function c_e(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 u_e({projectName:e}){const[t,n]=x.useState(null),[r,i]=x.useState(null),[a,l]=x.useState([]),[c,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),[O,C]=x.useState(!1),[z,A]=x.useState(null),_=x.useRef(null),R=x.useCallback(async()=>{E(!0),A(null);try{const[de,be,M,D,U]=await Promise.all([a4().catch(()=>null),FQ(e,{excludeCrawlers:!0}).catch(()=>null),HQ(e,{limit:jl,offset:b,excludeCrawlers:!0}).catch(V=>{if(V instanceof yr&&V.code==="NOT_FOUND")return null;throw V}),KQ(e).catch(()=>[]),bV(e).catch(()=>[])]);d(de),n(be),i(M),l(D);const I=l_e(U);p(I),_.current=I?.id??null}catch(de){A(de instanceof Error?de.message:"Failed to load backlinks")}finally{E(!1)}},[e,b]);x.useEffect(()=>{R()},[R]),x.useEffect(()=>{if(!f)return;const de=f.id;let be=!1;const M=async()=>{try{const U=await Ql(de);if(be)return;_k(U.status)?(p(null),y(U),await R()):p(I=>I?.id===U.id?{...I,...U}:I)}catch{}},D=window.setInterval(()=>{M()},3e3);return()=>{be=!0,window.clearInterval(D)}},[f,R]),x.useEffect(()=>{if(!f)return;const de=window.setInterval(()=>w(Date.now()),1e3);return()=>window.clearInterval(de)},[f]),x.useEffect(()=>{if(!m||m.status==="failed")return;const de=window.setTimeout(()=>y(null),1e4);return()=>window.clearTimeout(de)},[m]);async function $(){C(!0),A(null);try{const de=await GQ(e);p(de),_.current=de.id}catch(de){de instanceof yr&&de.code==="MISSING_DEPENDENCY"?A("DuckDB is not installed. Visit the Backlinks admin page to install it."):A(de instanceof Error?de.message:"Failed to trigger extract")}finally{C(!1)}}const F=x.useMemo(()=>a.slice().sort((de,be)=>de.queriedAt.localeCompare(be.queriedAt)).map(de=>({date:de.queriedAt,linkingDomains:de.totalLinkingDomains})),[a]),q=r?.rows??[],B=r?.total??0,K=t?.excludedLinkingDomains??0,X=B>jl,Q=Math.floor(b/jl)+1,H=Math.max(1,Math.ceil(B/jl));return x.useEffect(()=>{b>0&&b>=B&&j(0)},[b,B]),s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Backlinks"}),s.jsx("h2",{children:"Referring domains"}),s.jsxs("p",{className:"text-sm text-zinc-500 mt-1 max-w-2xl",children:["Domains linking to "," ",s.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."]})]})}),z&&s.jsx(Pe,{className:"surface-card p-4 mb-4 border-rose-800/60",children:s.jsx("p",{className:"text-sm text-rose-300",children:z})}),f&&s.jsx(Pe,{className:"surface-card p-4 mb-4 border-sky-800/60",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(f4,{className:"h-5 w-5 text-sky-400 animate-spin shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("p",{className:"text-sm font-medium text-zinc-100",children:"Extract running"}),s.jsx(tt,{tone:"neutral",children:f.status}),s.jsxs("span",{className:"text-xs text-zinc-500 tabular-nums",children:[c_e(f.startedAt,f.createdAt)," elapsed · refreshing every 3s"]}),s.jsxs("span",{className:"sr-only",children:["now=",v]})]}),s.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Re-querying the cached Common Crawl release for"," ",s.jsx("span",{className:"text-zinc-300",children:e}),". No re-download — the ~16 GB dump already lives at"," ",s.jsx("code",{className:"text-zinc-400",children:"~/.canonry/cache/commoncrawl/"}),". Typically takes ~5 minutes."]})]})]})}),m&&!f&&s.jsx(Pe,{className:`surface-card p-4 mb-4 ${m.status==="failed"?"border-rose-800/60":"border-emerald-800/60"}`,children:s.jsxs("div",{className:"flex items-start gap-3",children:[m.status==="failed"?s.jsx("span",{className:"h-5 w-5 shrink-0 mt-0.5 text-rose-400 text-lg leading-none","aria-hidden":!0,children:"!"}):s.jsx(fk,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{className:"flex-1",children:[s.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?s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:Cne(m.error)}):m.status!=="failed"?s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Backlinks refreshed from the cached release."}):null]})]})}),J()]});function J(){if(k)return s.jsx(Pe,{className:"surface-card p-6",children:s.jsx("p",{className:"text-sm text-zinc-500",children:"Loading backlinks…"})});const de=t!==null&&t.totalLinkingDomains>0,be=m?.status==="failed",M=t!==null&&t.totalLinkingDomains===0&&!be,D=c?.status==="ready",U=c?.status==="failed",I=c&&(c.status==="downloading"||c.status==="querying"||c.status==="queued");return de?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"gauge-row",children:[s.jsxs("div",{className:"metric-card",children:[s.jsx("p",{className:"metric-card-eyebrow",children:"Referring domains"}),s.jsx("p",{className:"metric-card-big-value",children:s.jsx("span",{className:"text-zinc-50",children:kg(t.totalLinkingDomains)})}),s.jsxs("p",{className:"metric-card-sub",children:["unique domains linking to ",t.targetDomain]})]}),s.jsxs("div",{className:"metric-card",children:[s.jsx("p",{className:"metric-card-eyebrow",children:"Total linking hosts"}),s.jsx("p",{className:"metric-card-big-value",children:s.jsx("span",{className:"text-zinc-50",children:kg(t.totalHosts)})}),s.jsx("p",{className:"metric-card-sub",children:"aggregate host count across referring domains"})]}),s.jsxs("div",{className:"metric-card",children:[s.jsx("p",{className:"metric-card-eyebrow",children:"Top-10 concentration"}),s.jsx("p",{className:"metric-card-big-value",children:s.jsx("span",{className:"text-zinc-50",children:s_e(t.top10HostsShare)})}),s.jsx("p",{className:"metric-card-sub",children:"share of hosts from the 10 largest linking domains"})]})]}),s.jsxs("p",{className:"text-xs text-zinc-600 mt-2",children:["Release ",s.jsx("code",{className:"text-zinc-400",children:t.release})," · queried ",o_e(t.queriedAt),K>0&&s.jsxs(s.Fragment,{children:[" · ",s.jsxs("span",{className:"text-zinc-500",children:[K," crawler/proxy domain",K===1?"":"s"," hidden"]})]})]}),F.length>=2&&s.jsxs(Pe,{className:"surface-card p-4 mt-4",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Referring domains over releases"}),s.jsx("div",{className:"h-40 mt-2",children:s.jsx(Iy,{width:"100%",height:"100%",children:s.jsxs(MN,{data:F,margin:{top:8,right:12,bottom:0,left:12},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"bl-gradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"0%",stopColor:Yu[0],stopOpacity:.4}),s.jsx("stop",{offset:"100%",stopColor:Yu[0],stopOpacity:0})]})}),s.jsx(Gh,{dataKey:"date",tick:_o,stroke:pd,tickFormatter:$N}),s.jsx(Vh,{tick:_o,stroke:pd,allowDecimals:!1}),s.jsx(lv,{contentStyle:Wu.contentStyle,labelStyle:Wu.labelStyle,itemStyle:Wu.itemStyle,labelFormatter:LN}),s.jsx(Lu,{type:"monotone",dataKey:"linkingDomains",name:"Referring domains",stroke:Yu[0],fill:"url(#bl-gradient)",strokeWidth:2})]})})})]}),s.jsxs("div",{className:"mt-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Top referring domains"}),X&&s.jsxs("p",{className:"text-xs text-zinc-600",children:["Page ",Q," of ",H," · ",kg(B)," total"]})]}),s.jsx(Pe,{className:"surface-card overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[s.jsx("th",{className:"px-4 py-2 font-medium",children:"Domain"}),s.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Linking hosts"})]})}),s.jsxs("tbody",{children:[q.map(V=>s.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[s.jsx("td",{className:"px-4 py-2 text-zinc-200",children:V.linkingDomain}),s.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:kg(V.numHosts)})]},V.linkingDomain)),q.length===0&&s.jsx("tr",{children:s.jsx("td",{className:"px-4 py-4 text-sm text-zinc-500",colSpan:2,children:K>0&&B===0?`Every referring domain in this release was a crawler/proxy host (${K} hidden).`:"No referring domains in this release."})})]})]})}),X&&s.jsxs("div",{className:"flex items-center justify-end gap-2 mt-2",children:[s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:b===0,onClick:()=>j(V=>Math.max(0,V-jl)),children:"Previous"}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:b+jl>=B,onClick:()=>j(V=>V+jl),children:"Next"})]})]}),s.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[s.jsxs(pe,{type:"button",variant:"outline",size:"sm",disabled:O||f!==null,onClick:$,children:[s.jsx(Ov,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":O?"Queuing…":"Re-run extract"]}),s.jsxs(Bj,{label:"What does Re-run extract do?",children:[s.jsxs("span",{className:"block",children:["Re-queries the ",s.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," for ",s.jsx("span",{className:"text-zinc-200",children:e}),". Replaces existing backlink rows for this project under the current release."]}),s.jsxs("span",{className:"mt-2 block text-zinc-400",children:[s.jsx("span",{className:"text-zinc-200",children:"No re-download"})," of the ~16 GB dump. Typically ",s.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]}),s.jsx(pe,{asChild:!0,type:"button",variant:"outline",size:"sm",children:s.jsx("a",{href:Nu("/backlinks"),children:"Open admin"})})]})]}):s.jsx(Pe,{className:"surface-card p-6",children:s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-zinc-900 text-zinc-400",children:s.jsx(d4,{className:"h-5 w-5","aria-hidden":!0})}),s.jsxs("div",{className:"flex-1",children:[!c&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No release sync yet"}),s.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."}),s.jsx("div",{className:"mt-4",children:s.jsx(pe,{asChild:!0,type:"button",size:"sm",children:s.jsx("a",{href:Nu("/backlinks"),children:"Set up backlinks"})})})]}),I&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Sync in progress"}),s.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["A workspace release sync is running (",c.status,c.phaseDetail?` — ${c.phaseDetail}`:"","). Backlinks will appear here once it finishes."]}),s.jsx("div",{className:"mt-4",children:s.jsx(pe,{asChild:!0,type:"button",variant:"outline",size:"sm",children:s.jsx("a",{href:Nu("/backlinks"),children:"View sync status"})})})]}),U&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last sync failed"}),s.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:c.error??"The workspace release sync failed. Retry from the Backlinks admin page."}),s.jsx("div",{className:"mt-4",children:s.jsx(pe,{asChild:!0,type:"button",size:"sm",children:s.jsx("a",{href:Nu("/backlinks"),children:"Go to Backlinks admin"})})})]}),D&&!I&&!M&&!be&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No backlinks yet for this project"}),s.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["Release ",s.jsx("code",{className:"text-zinc-300",children:c.release})," is ready but no backlinks have been extracted for"," ",s.jsx("code",{className:"text-zinc-300",children:e}),". Run an extract to populate data using the cached release."]}),s.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[s.jsxs(pe,{type:"button",size:"sm",disabled:O||f!==null,onClick:$,children:[s.jsx(wh,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":O?"Queuing…":"Run extract"]}),s.jsxs(Bj,{label:"What does Run extract do?",children:[s.jsxs("span",{className:"block",children:["Runs a DuckDB query against the ",s.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," to find referring domains for ",s.jsx("span",{className:"text-zinc-200",children:e}),"."]}),s.jsxs("span",{className:"mt-2 block text-zinc-400",children:["No re-download. Typically takes ",s.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]})]})]}),be&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last extract failed"}),s.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["See the error above for details. If the cache files for release"," ",s.jsx("code",{className:"text-zinc-300",children:c?.release})," are missing, re-sync the release from the Backlinks admin to restore the ~16 GB dump, then re-run the extract."]}),s.jsx("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:s.jsx(pe,{asChild:!0,type:"button",size:"sm",children:s.jsx("a",{href:Nu("/backlinks"),children:"Go to Backlinks admin"})})})]}),M&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No referring domains found"}),s.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["The last extract against release ",s.jsx("code",{className:"text-zinc-300",children:t.release})," found"," ",s.jsx("span",{className:"text-zinc-300",children:"0 referring domains"})," for"," ",s.jsx("code",{className:"text-zinc-300",children:t.targetDomain}),". This can happen when:"]}),s.jsxs("ul",{className:"mt-2 space-y-1 text-xs text-zinc-500 list-disc list-inside",children:[s.jsx("li",{children:"the domain is newer than the release’s crawl window"}),s.jsx("li",{children:"the Common Crawl snapshot didn’t capture pages that link to it"}),s.jsx("li",{children:"the extract ran against a cache that was missing or incomplete"})]}),s.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."}),s.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[s.jsx(pe,{asChild:!0,type:"button",size:"sm",children:s.jsx("a",{href:Nu("/backlinks"),children:"Go to Backlinks admin"})}),s.jsxs(pe,{type:"button",variant:"outline",size:"sm",disabled:O||f!==null,onClick:$,children:[s.jsx(wh,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":O?"Queuing…":"Re-run extract"]}),s.jsxs(Bj,{label:"What does Re-run extract do?",children:[s.jsxs("span",{className:"block",children:["Re-queries the cached release for ",s.jsx("span",{className:"text-zinc-200",children:t.targetDomain}),". Only useful if the cache files were incomplete last time."]}),s.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 d_e({projectName:e}){const t=Vn({queryKey:_e.citationVisibility(e),queryFn:()=>RQ(e),staleTime:o4}),n=t.data??null,r=t.error;if(t.isLoading&&!n)return null;if(r)return s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),s.jsx("h2",{children:"Citation + answer-mention coverage"})]})}),s.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 s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),s.jsx("h2",{children:"Citation + answer-mention coverage"})]})}),s.jsx("p",{className:"text-sm text-zinc-500",children:n.reason==="no-queries"?"Add queries to start tracking AI citations.":"Run a sweep to see which engines cite this project."})]});const{providersCiting:i,providersMentioning:a,providersConfigured:l}=n.summary;return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),s.jsxs("h2",{className:"flex items-center gap-2",children:["Cited by ",i," of ",l," engines",s.jsx(mr,{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)."})]}),s.jsxs("p",{className:"text-base text-zinc-300 flex items-center gap-2",children:["Mentioned in ",a," of ",l," engine answers",s.jsx(mr,{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&&s.jsxs("p",{className:"supporting-copy",children:["Latest run ",new Date(n.summary.latestRunAt).toLocaleString()]})]}),s.jsx(f_e,{data:n}),s.jsx(h_e,{data:n}),n.competitorGaps.length>0&&s.jsx(y_e,{data:n})]})}function f_e({data:e}){const{totalQueries:t,queriesCitedAndMentioned:n,queriesCitedOnly:r,queriesMentionedOnly:i,queriesInvisible:a}=e.summary;return s.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4 mb-4",children:[s.jsx(Cg,{label:"Cited + mentioned",value:`${n} / ${t}`,helper:"In sources AND named in answer",tone:n>0?"positive":"neutral"}),s.jsx(Cg,{label:"Cited only",value:`${r} / ${t}`,helper:"In sources, not named in answer",tone:r>0?"positive-dim":"neutral"}),s.jsx(Cg,{label:"Mentioned only",value:`${i} / ${t}`,helper:"Named in answer, no source link",tone:i>0?"caution":"neutral"}),s.jsx(Cg,{label:"Invisible",value:`${a} / ${t}`,helper:"No engine cites or mentions",tone:a>0?"negative":"neutral"})]})}function Cg({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 s.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:e}),s.jsx("p",{className:`mt-1 text-2xl font-semibold tabular-nums ${i}`,children:t}),s.jsx("p",{className:"text-[11px] text-zinc-500",children:n})]})}function h_e({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?s.jsx("p",{className:"text-sm text-zinc-500",children:"No query coverage rows."}):s.jsxs("div",{children:[s.jsx(p_e,{}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Query"}),t.map(n=>s.jsx("th",{className:"text-center",children:s.jsx(Xl,{provider:n})},n)),s.jsx("th",{className:"text-right",children:"Cite"}),s.jsx("th",{className:"text-right",children:"Ment"})]})}),s.jsx("tbody",{children:e.byQuery.map(n=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-medium text-zinc-100",children:n.query}),t.map(r=>{const i=n.providers.find(a=>a.provider===r);return s.jsx("td",{className:"text-center",children:i==null?s.jsx(UW,{className:"inline h-3.5 w-3.5 text-zinc-700","aria-label":"no data"}):s.jsx(m_e,{provider:i})},r)}),s.jsx("td",{className:"text-right tabular-nums",children:s.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]})}),s.jsx("td",{className:"text-right tabular-nums",children:s.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 p_e(){return s.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-3 text-[11px] text-zinc-500",children:[s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx($u,{active:!0,tone:"cited"}),s.jsx("span",{children:"cited (in sources)"})]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx($u,{active:!0,tone:"mentioned"}),s.jsx("span",{children:"mentioned (in answer)"})]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx($u,{active:!1,tone:"cited"}),s.jsx($u,{active:!1,tone:"mentioned"}),s.jsx("span",{children:"neither"})]})]})}function m_e({provider:e}){const t=g_e(e);return s.jsxs("span",{className:"inline-flex items-center justify-center gap-1",title:t,children:[s.jsx($u,{active:e.cited,tone:"cited"}),s.jsx($u,{active:e.mentioned,tone:"mentioned"})]})}function g_e(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 $u({active:e,tone:t}){if(!e)return s.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 s.jsx("span",{className:n,"aria-hidden":"true"})}function y_e({data:e}){return s.jsxs("div",{className:"mt-4",children:[s.jsxs("h3",{className:"text-sm font-semibold text-zinc-200 mb-2 flex items-center gap-2",children:["Competitor gaps",s.jsx(mr,{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."}),s.jsxs("span",{className:"text-[10px] font-normal uppercase tracking-wide text-zinc-500",children:[e.competitorGaps.length," ",e.competitorGaps.length===1?"gap":"gaps"]})]}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Engine"}),s.jsx("th",{children:"Competitors cited"})]})}),s.jsx("tbody",{children:e.competitorGaps.map(t=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-medium text-zinc-100",children:t.query}),s.jsx("td",{children:s.jsx(Xl,{provider:t.provider})}),s.jsx("td",{className:"text-zinc-300",children:t.citingCompetitors.join(", ")})]},`${t.queryId}::${t.provider}`))})]})})]})}const UN=new Set(["queued","seeding","probing"]);function v_e({projectName:e}){const t=vr(),[n,r]=x.useState(null),[i,a]=x.useState(""),[l,c]=x.useState("100"),d=Vn({queryKey:_e.discovery.sessions(e),queryFn:()=>aQ(e,{limit:10}),refetchInterval:C=>C.state.data?.some(A=>UN.has(A.status))?3e3:!1}),f=d.data??[];x.useEffect(()=>{!n&&f[0]&&r(f[0].id)},[n,f]);const p=f.find(C=>C.id===n)??null,m=Vn({queryKey:n?_e.discovery.session(e,n):_e.discovery.session(e,"none"),queryFn:()=>sQ(e,n??""),enabled:!!n,refetchInterval:p&&UN.has(p.status)?3e3:!1}),y=m.data??null,v=Vn({queryKey:n?_e.discovery.promotePreview(e,n):_e.discovery.promotePreview(e,"none"),queryFn:()=>oQ(e,n??""),enabled:!!(n&&p?.status==="completed")}),w=Ba({mutationFn:()=>{const C={},z=i.trim();z&&(C.icpDescription=z);const A=Number.parseInt(l,10);return Number.isFinite(A)&&A>0&&(C.maxProbes=A),iQ(e,C)},onSuccess:async C=>{r(C.sessionId),a(""),await GL(t,e,C.sessionId),dt({title:"Discovery queued",detail:`Session ${Uj(C.sessionId)} is probing representative queries.`,tone:"neutral",dedupeKey:`discovery:start:${C.sessionId}`,dedupeMode:"replace"})},onError:C=>{dt({title:"Discovery failed to start",detail:C instanceof Error?C.message:"Could not queue discovery.",tone:"negative"})}}),b=Ba({mutationFn:C=>{if(!n)throw new Error("Select a completed discovery session first.");return lQ(e,n,C)},onSuccess:async C=>{await GL(t,e,C.sessionId),t.invalidateQueries({queryKey:_e.projects.all}),dt({title:"Discovery promoted",detail:b_e(C),tone:"positive",dedupeKey:`discovery:promote:${C.sessionId}`,dedupeMode:"replace"})},onError:C=>{dt({title:"Promotion failed",detail:C instanceof Error?C.message:"Could not promote this session.",tone:"negative"})}}),j=y??p,k=v.data??null,E=(k?.queriesByBucket.cited.length??0)+(k?.queriesByBucket.aspirational.length??0),O=x.useMemo(()=>(y?.probes??[]).slice(0,30),[y?.probes]);return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Discovery"}),s.jsx("h2",{children:"Grounded query discovery"}),s.jsx("p",{className:"mt-1 max-w-3xl text-sm leading-6 text-zinc-500",children:"Seed representative ICP queries, probe grounding citations, then promote the safe default basket when the results make sense."})]}),s.jsxs(pe,{type:"button",variant:"outline",size:"sm",disabled:d.isFetching,onClick:()=>{d.refetch()},children:[s.jsx(Sh,{size:14}),"Refresh"]})]}),s.jsxs("div",{className:"grid gap-4 xl:grid-cols-[360px_minmax(0,1fr)]",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run"}),s.jsx("h3",{children:"Start discovery"})]}),s.jsx(tt,{tone:"neutral",children:"Gemini"})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("label",{className:"block",children:[s.jsx("span",{className:"text-xs text-zinc-500",children:"ICP description"}),s.jsx("textarea",{className:"mt-1 min-h-24 w-full rounded border border-zinc-700 bg-transparent px-3 py-2 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Leave blank to use the ICP stored on the project.",value:i,onChange:C=>a(C.target.value)})]}),s.jsxs("label",{className:"block",children:[s.jsx("span",{className:"text-xs text-zinc-500",children:"Probe budget"}),s.jsx("input",{className:"mt-1 w-full rounded border border-zinc-700 bg-transparent px-3 py-2 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",inputMode:"numeric",value:l,onChange:C=>c(C.target.value)})]}),s.jsxs(pe,{type:"button",size:"sm",disabled:w.isPending,onClick:()=>w.mutate(),children:[s.jsx(wh,{size:14}),w.isPending?"Queueing...":"Start discovery"]})]})]}),s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sessions"}),s.jsx("h3",{children:"Recent runs"})]}),d.isFetching&&s.jsx(tt,{tone:"neutral",children:"Loading"})]}),f.length===0?s.jsx("p",{className:"text-sm text-zinc-500",children:"No discovery sessions yet."}):s.jsx("div",{className:"space-y-2",children:f.map(C=>s.jsxs("button",{type:"button",className:`w-full rounded-md border px-3 py-2 text-left transition-colors ${n===C.id?"border-zinc-600 bg-zinc-900/70":"border-zinc-800/60 bg-zinc-950/40 hover:border-zinc-700 hover:bg-zinc-900/40"}`,onClick:()=>r(C.id),children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx("span",{className:"text-sm font-medium text-zinc-100",children:Uj(C.id)}),s.jsx(tt,{tone:KL(C.status),children:C.status})]}),s.jsxs("div",{className:"mt-2 grid grid-cols-3 gap-2 text-[11px] text-zinc-500",children:[s.jsxs("span",{children:["Cited ",C.citedCount??0]}),s.jsxs("span",{children:["Aspir. ",C.aspirationalCount??0]}),s.jsxs("span",{children:["Waste ",C.wastedCount??0]})]})]},C.id))})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Selected session"}),s.jsx("h3",{children:j?Uj(j.id):"No session selected"})]}),j&&s.jsx(tt,{tone:KL(j.status),children:j.status})]}),j?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[s.jsx(vo,{label:"Probes",value:j.probeCount??0}),s.jsx(vo,{label:"Cited",value:j.citedCount??0,tone:"positive"}),s.jsx(vo,{label:"Aspirational",value:j.aspirationalCount??0,tone:"caution"}),s.jsx(vo,{label:"Wasted",value:j.wastedCount??0,tone:"negative"})]}),j.error&&s.jsx("div",{className:"rounded-md border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:j.error}),j.icpDescription&&s.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 px-3 py-2",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"ICP"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-300",children:j.icpDescription})]}),j.competitorMap.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"mb-2 text-xs font-medium text-zinc-400",children:"Recurring citation domains"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:j.competitorMap.slice(0,8).map(C=>s.jsxs("span",{className:"rounded-md border border-zinc-800/60 bg-zinc-950 px-2 py-1 text-xs text-zinc-300",children:[C.domain," ",s.jsx("span",{className:"text-zinc-500",children:C.hits})]},C.domain))})]})]}):s.jsx("p",{className:"text-sm text-zinc-500",children:"Start or select a session to inspect discovery progress."})]}),j?.status==="completed"&&s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Promotion"}),s.jsx("h3",{children:"Preview candidates"})]}),s.jsxs(pe,{type:"button",size:"sm",disabled:b.isPending||E===0,onClick:()=>b.mutate(void 0),children:[s.jsx(fk,{size:14}),b.isPending?"Promoting...":"Promote safe default"]})]}),v.isLoading?s.jsx("p",{className:"text-sm text-zinc-500",children:"Loading promotion preview..."}):k?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[s.jsx(vo,{label:"Default query add",value:E,tone:"positive"}),s.jsx(vo,{label:"Cited",value:k.queriesByBucket.cited.length,tone:"positive"}),s.jsx(vo,{label:"Aspirational",value:k.queriesByBucket.aspirational.length,tone:"caution"}),s.jsx(vo,{label:"Wasted opt-in",value:k.queriesByBucket["wasted-surface"].length,tone:"negative"})]}),s.jsx("p",{className:"text-xs leading-5 text-zinc-500",children:"The button promotes cited + aspirational queries and recurring competitors. Wasted-surface remains visible here as planning evidence and is not added unless an operator opts in through CLI or MCP."}),k.suggestedCompetitors.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"mb-2 text-xs font-medium text-zinc-400",children:"Competitors promoted by default"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:k.suggestedCompetitors.map(C=>s.jsxs("span",{className:"rounded-md border border-zinc-800/60 bg-zinc-950 px-2 py-1 text-xs text-zinc-300",children:[C.domain," ",s.jsx("span",{className:"text-zinc-500",children:C.hits})]},C.domain))})]})]}):s.jsx("p",{className:"text-sm text-zinc-500",children:"No promotion preview available."})]}),s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Probe detail"}),s.jsx("h3",{children:"Bucketed queries"})]}),m.isFetching&&s.jsx(tt,{tone:"neutral",children:"Loading"})]}),O.length===0?s.jsx("p",{className:"text-sm text-zinc-500",children:"Probe rows appear once the session reaches the probing phase."}):s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Bucket"}),s.jsx("th",{children:"Cited domains"})]})}),s.jsx("tbody",{children:O.map(C=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-medium text-zinc-100",children:C.query}),s.jsx("td",{children:s.jsx(tt,{tone:x_e(C.bucket),children:C.bucket??"unbucketed"})}),s.jsx("td",{className:"text-zinc-400",children:C.citedDomains.length>0?C.citedDomains.slice(0,3).join(", "):"-"})]},C.id))})]})})]})]})]})]})}function vo({label:e,value:t,tone:n="neutral"}){const r=n==="positive"?"text-emerald-300":n==="caution"?"text-amber-300":n==="negative"?"text-rose-300":"text-zinc-100";return s.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:e}),s.jsx("p",{className:`mt-1 text-2xl font-semibold tabular-nums ${r}`,children:t})]})}function KL(e){return e==="completed"?"positive":e==="failed"?"negative":UN.has(e)?"caution":"neutral"}function x_e(e){return e==="cited"?"positive":e==="aspirational"?"caution":e==="wasted-surface"?"negative":"neutral"}function Uj(e){return e.length>8?e.slice(0,8):e}function b_e(e){const t=e.promoted.queries.length,n=e.promoted.competitors.length,r=e.skipped.queries.length+e.skipped.competitors.length;return`${t} quer${t===1?"y":"ies"} and ${n} competitor${n===1?"":"s"} added${r>0?`; ${r} already tracked`:""}.`}async function GL(e,t,n){await Promise.all([e.invalidateQueries({queryKey:_e.discovery.project(t)}),e.invalidateQueries({queryKey:_e.discovery.sessions(t)}),e.invalidateQueries({queryKey:_e.discovery.session(t,n)}),e.invalidateQueries({queryKey:_e.discovery.promotePreview(t,n)}),e.invalidateQueries({queryKey:_e.runs.all})])}const w_e={critical:"negative",high:"negative",medium:"caution",low:"neutral"};function hr(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 S_e(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 j_e(e){const t=[e.city,e.region,e.country].filter(Boolean).join(", ");return t?`${e.label} (${t})`:e.label}function N_e({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(null),a=Vn({queryKey:_e.report(e),queryFn:()=>yQ(e)});async function l(){n(!0),i(null);try{await xQ(e,"client")}catch(d){const f=d instanceof yr||d instanceof Error?d.message:"Download failed";i(f)}finally{n(!1)}}if(a.isLoading)return s.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 s.jsx("div",{className:"py-8 text-center",children:s.jsx("p",{className:"text-sm text-rose-400",children:d})})}const c=a.data;return c?s.jsxs("div",{children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsx("p",{className:"eyebrow",children:"AI Visibility Report"}),s.jsx("h1",{className:"page-title",children:c.meta.project.displayName}),s.jsxs("p",{className:"page-subtitle",children:[c.meta.project.canonicalDomain," · ",c.meta.project.country," / ",c.meta.project.language.toUpperCase(),c.meta.location?` · Location: ${j_e(c.meta.location)}`:" · No location set"," · ","Generated ",S_e(c.meta.generatedAt)]}),r&&s.jsx("p",{className:"mt-2 text-xs text-rose-400",children:r})]}),s.jsx("div",{className:"page-header-right",children:s.jsxs(pe,{variant:"secondary",size:"sm",onClick:l,disabled:t,children:[s.jsx(Ov,{className:"size-4"}),t?"Preparing…":"Download report HTML"]})})]}),s.jsx(z_e,{report:c}),s.jsx(L_e,{report:c,audience:"client"}),s.jsx(A_e,{report:c}),s.jsx(R_e,{report:c,audience:"client"}),s.jsx(D_e,{report:c})]}):null}const VL="AI Visibility — Server-Side",QL="AI engine attention",k_e="What AI engines actually do in your server logs over the last 7 days — the other half of citations.",C_e="Live telemetry from your server logs.";function A_e({report:e}){const t=e.serverActivity;if(!t)return null;if(!t.hasData)return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Qh,{eyebrow:QL,title:VL,subtitle:C_e}),s.jsx("p",{className:"text-sm text-zinc-500",children:"Your server-side traffic source is connected. Numbers will appear after the next sync."})]});const n={current:t.verifiedCrawlerHits.current+t.unverifiedCrawlerHits.current,prior:t.verifiedCrawlerHits.prior+t.unverifiedCrawlerHits.prior,deltaPct:Nne(t.verifiedCrawlerHits.current+t.unverifiedCrawlerHits.current,t.verifiedCrawlerHits.prior+t.unverifiedCrawlerHits.prior)},r=gT(n,"requests"),i=`${hr(t.verifiedCrawlerHits.current)} verified · ${hr(t.unverifiedCrawlerHits.current)} unverified${r?` · ${r}`:""}`,a=gT(t.referralArrivals,"sessions"),l=t.byOperator.filter(c=>c.verifiedHits>0||c.unverifiedHits>0||c.referralArrivals>0).slice(0,5);return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Qh,{eyebrow:QL,title:VL,subtitle:k_e}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsx(XL,{label:"AI bot requests observed",value:hr(n.current),subtitle:i}),s.jsx(XL,{label:"AI referral sessions",value:hr(t.referralArrivals.current),subtitle:a})]}),l.length>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"By AI tool"}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"AI tool"}),s.jsx("th",{children:"Bot requests (7d)"}),s.jsx("th",{children:"Referral sessions"})]})}),s.jsx("tbody",{children:l.map(c=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:c.operator}),s.jsx("td",{children:hr(c.verifiedHits+c.unverifiedHits)}),s.jsx("td",{children:hr(c.referralArrivals)})]},c.operator))})]})}),s.jsx("p",{className:"mt-2 text-[11px] text-zinc-500",children:"Verified requests are reverse-DNS confirmed. Unverified requests are user-agent claims shown separately in agency diagnostics."})]})]})}function E_e(e,t){return e.audience==="both"||e.audience===t}const O_e={gemini:"Gemini",openai:"ChatGPT",claude:"Claude",perplexity:"Perplexity",local:"Local model","cdp:chatgpt":"ChatGPT (browser)"};function xv(e){return O_e[e]??e.charAt(0).toUpperCase()+e.slice(1)}function __e(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 z_e({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.",l=__e(e.whatsChanged.citationRate),c=n.providers.length>0?n.providers.map(xv).join(", "):`${hr(t.queryCount)} ${t.queryCount===1?"question":"questions"} tested`;return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"rounded-2xl border border-zinc-800/60 bg-zinc-900/40 p-6 sm:p-8",children:[s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-zinc-500",children:"Overview"}),s.jsx("p",{className:"mt-3 text-6xl font-bold tracking-tight text-zinc-50 sm:text-7xl",children:i}),s.jsx("p",{className:"mt-3 max-w-2xl text-base text-zinc-300 sm:text-lg",children:a}),l&&s.jsxs("p",{className:`mt-3 text-sm font-medium ${l.tone==="positive"?"text-emerald-400":l.tone==="negative"?"text-rose-400":"text-zinc-400"}`,children:[s.jsx("span",{className:"mr-1",children:l.arrow}),l.text]})]}),s.jsxs("div",{className:"mt-5 grid gap-4 sm:grid-cols-3",children:[s.jsx(qj,{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"}),s.jsx(qj,{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"}),s.jsx(qj,{label:"AI tools tested",value:hr(t.providerCount),subtitle:c})]}),s.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:[s.jsx("span",{className:"font-semibold text-zinc-200",children:"Mentions and links are different."})," ","A ",s.jsx("span",{className:"font-medium text-zinc-200",children:"mention"})," is when AI says your name out loud in its answer. A ",s.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&&s.jsxs("div",{className:"mt-5 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[s.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Customer questions we tested"}),s.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."]}),s.jsx("ol",{className:"mt-4 grid gap-2 sm:grid-cols-2",children:n.queries.map((d,f)=>s.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:[s.jsx("span",{className:"shrink-0 text-xs font-semibold tabular-nums text-zinc-500",children:String(f+1).padStart(2,"0")}),s.jsxs("span",{children:['"',d,'"']})]},f))})]}),n.providerRates.length>0&&s.jsxs("div",{className:"mt-5 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[s.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"How often each AI tool links to your website"}),s.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."}),s.jsx("div",{className:"mt-4 space-y-3",children:n.providerRates.map(d=>s.jsxs("div",{className:"grid grid-cols-[120px_1fr_120px] items-center gap-3",children:[s.jsx("span",{className:"text-sm text-zinc-300",children:xv(d.provider)}),s.jsx("div",{className:"h-3 overflow-hidden rounded-full bg-zinc-800/80",children:s.jsx("div",{className:"h-full rounded-full bg-emerald-500/70",style:{width:`${Math.max(d.citationRate,1.5)}%`}})}),s.jsxs("span",{className:"text-right text-sm font-semibold text-zinc-100",children:[d.citationRate,"% ",s.jsxs("span",{className:"font-normal text-zinc-500",children:["(",d.citedCount,"/",d.totalCount,")"]})]})]},d.provider))})]}),e.clientSummary.confidenceNotes.length>0&&s.jsx("div",{className:"mt-4 grid gap-2",children:e.clientSummary.confidenceNotes.map((d,f)=>s.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 qj({label:e,value:t,subtitle:n}){return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-zinc-500",children:e}),s.jsx("p",{className:"mt-3 text-4xl font-bold tracking-tight text-zinc-50 sm:text-5xl",children:t}),s.jsx("p",{className:"mt-2 text-xs text-zinc-500",children:n})]})}function T_e(e){switch(e){case"immediate":return"Do now";case"short-term":return"This month";case"medium-term":return"Next quarter"}}function P_e(e){switch(e){case"high":return"Strong evidence";case"medium":return"Some evidence";case"low":return"Worth trying"}}function R_e({report:e,audience:t}){const n=t==="client"?e.clientSummary.actionItems:e.agencyDiagnostics.priorities.length>0?e.agencyDiagnostics.priorities:e.actionPlan.filter(a=>E_e(a,t)),r=rne(e,n),i=t==="client";return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Qh,{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?s.jsx(eE,{message:"No recommendations yet — run an AI check to populate this."}):s.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:r.map((a,l)=>{const c=a.evidence.length>0?a.evidence:a.why,d=a.why.length>0||a.evidence.length>0;return s.jsxs("article",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.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:l+1}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"mb-2 flex flex-wrap gap-2",children:[s.jsx(tt,{tone:Yte(a),children:i?T_e(a.horizon):Xte(a.horizon)}),!i&&s.jsx(tt,{tone:"neutral",children:Jte(a.category)}),s.jsx(tt,{tone:"neutral",children:i?P_e(a.confidence):`${ene(a.confidence)} confidence`})]}),s.jsx("p",{className:"text-sm font-medium text-zinc-100",children:a.title})]})]}),s.jsx("p",{className:"mt-3 text-sm text-zinc-400",children:a.action}),s.jsx($_e,{items:c,limit:3,className:"mt-3"}),d&&s.jsxs("details",{className:"mt-3 text-xs text-zinc-400",children:[s.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&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"eyebrow-soft mb-1",children:i?"Why this matters":"Why"}),s.jsx("ul",{className:"list-disc space-y-1 pl-4",children:a.why.map((f,p)=>s.jsx("li",{children:f},p))})]}),a.evidence.length>0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"eyebrow-soft mb-1",children:i?"What we saw":"Evidence"}),s.jsx("ul",{className:"list-disc space-y-1 pl-4",children:a.evidence.map((f,p)=>s.jsx("li",{children:f},p))})]})]}),s.jsxs("p",{className:"mt-3 border-t border-zinc-800/60 pt-3 text-xs text-zinc-300",children:[s.jsx("span",{className:"font-medium",children:i?"What success looks like:":"Win condition:"})," ",a.successMetric]})]},`${a.priority}-${a.title}`)})})]})}function WL({label:e,value:t,displayValue:n,max:r,barClass:i}){const a=r>0?Math.max(t/r*100,1.5):0;return s.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-3 text-sm",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"truncate text-zinc-300",title:e,children:e}),s.jsx("div",{className:"mt-1 h-2 overflow-hidden rounded-full bg-zinc-800/80",children:s.jsx("div",{className:`h-full rounded-full ${i}`,style:{width:`${a}%`}})})]}),s.jsx("span",{className:"whitespace-nowrap text-sm font-semibold text-zinc-100",children:n})]})}function D_e({report:e}){const t=e.aiSourceOrigin.topDomains.slice(0,5),n=e.gsc,r=e.indexingHealth,i=ine(e).slice(0,5),a=t.length>0?Math.max(...t.map(d=>d.count)):0,l=n?Math.max(...n.topQueries.slice(0,5).map(d=>d.impressions),1):0,c=t.length>0||n!==null||r!==null||i.length>0;return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Qh,{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."}),c?s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[t.length>0&&s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[s.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Where AI gets its answers"}),s.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."}),s.jsx("div",{className:"mt-4 space-y-3",children:t.map(d=>s.jsx(WL,{label:d.domain+(d.isCompetitor?" (competitor)":""),value:d.count,displayValue:`${hr(d.count)}×`,max:a,barClass:"bg-zinc-400/70"},d.domain))})]}),r&&s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[s.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Pages Google can find on your site"}),s.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)."}),s.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,"%"]}),s.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[hr(r.indexed)," of ",hr(r.total)," pages indexed"]}),s.jsx("div",{className:"mt-3 h-3 overflow-hidden rounded-full bg-zinc-800/80",children:s.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)}%`}})}),s.jsxs("p",{className:"mt-3 text-xs text-zinc-400",children:[s.jsx("span",{className:"font-medium text-zinc-200",children:hr(r.notIndexed)})," ",r.notIndexed===1?"page is":"pages are"," not indexed yet."]})]}),n&&s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[s.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"What people search Google for"}),s.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:["You appeared in ",s.jsx("span",{className:"font-semibold text-zinc-200",children:hr(n.totalImpressions)})," Google searches and got ",s.jsx("span",{className:"font-semibold text-zinc-200",children:hr(n.totalClicks)})," ",n.totalClicks===1?"click":"clicks"," this period."]}),n.topQueries.length>0&&s.jsx("div",{className:"mt-4 space-y-3",children:n.topQueries.slice(0,5).map(d=>s.jsx(WL,{label:d.query,value:d.impressions,displayValue:`${hr(d.impressions)} ${d.impressions===1?"search":"searches"}`,max:l,barClass:"bg-sky-500/70"},d.query))})]}),i.length>0&&s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[s.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Topics where you could improve"}),s.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Customer questions where better content on your site would help AI cite you."}),s.jsx("ul",{className:"mt-4 space-y-2 text-sm text-zinc-300",children:i.map((d,f)=>s.jsxs("li",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-3 py-2",children:[s.jsx("p",{className:"font-medium text-zinc-100",children:d.query}),s.jsx("p",{className:"mt-0.5 text-xs text-zinc-400",children:Dte(d.action)})]},f))})]})]}):s.jsx(eE,{message:"No supporting evidence yet — this fills in after the first AI check."})]})}const I_e=14;function XA(e){return e==="up"?"positive":e==="down"?"negative":"neutral"}function JA(e){return e==="up"?"↑":e==="down"?"↓":"→"}function Fj({label:e,delta:t,unit:n}){if(!t)return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsx("p",{className:"text-2xl font-semibold tracking-tight text-zinc-500",children:"—"}),s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"No prior data"})]});const r=n==="%"?"%":"",i=t.deltaAbs>0?"+":"",a=XA(t.direction),l=a==="positive"?"text-emerald-400":a==="negative"?"text-rose-400":"text-zinc-100";return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsxs("p",{className:`text-2xl font-semibold tracking-tight ${l}`,children:[t.current,r," ",s.jsx("span",{className:"text-sm font-medium",children:JA(t.direction)})]}),s.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 YL({label:e,delta:t,countLabel:n}){if(!t)return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsx("p",{className:"text-2xl font-semibold tracking-tight text-zinc-500",children:"—"}),s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Not enough trend data"})]});const r=t.deltaAbs>0?"+":"",i=XA(t.direction),a=i==="positive"?"text-emerald-400":i==="negative"?"text-rose-400":"text-zinc-100";return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsxs("p",{className:`text-2xl font-semibold tracking-tight ${a}`,children:[hr(t.current)," ",s.jsx("span",{className:"text-sm font-medium",children:JA(t.direction)})]}),s.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:[r,hr(t.deltaAbs)," ",n," vs prior ",I_e," days"]})]})}function M_e({movements:e,audience:t}){const n=e.filter(i=>i.direction!=="flat");if(n.length===0)return null;const r=t==="client";return s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:r?"How each AI tool changed":"AI engine movements"}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:r?"AI tool":"Engine"}),s.jsx("th",{children:r?"Was":"Prior"}),s.jsx("th",{children:r?"Now":"Current"}),s.jsx("th",{children:"Change"})]})}),s.jsx("tbody",{children:n.map(i=>{const a=i.deltaAbs>0?"+":"",l=XA(i.direction),c=l==="positive"?"text-emerald-400":l==="negative"?"text-rose-400":"text-zinc-300";return s.jsxs("tr",{children:[s.jsx("td",{children:r?xv(i.provider):i.provider}),s.jsxs("td",{children:[i.prior,"%"]}),s.jsxs("td",{children:[i.current,"%"]}),s.jsxs("td",{className:c,children:[a,i.deltaAbs.toFixed(1),"% ",JA(i.direction)]})]},i.provider)})})]})})]})}function ZL({insights:e,heading:t,emptyMessage:n,audience:r}){if(e.length===0)return s.jsxs("div",{className:"mt-4 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsx("p",{className:"eyebrow mb-1",children:t}),s.jsx("p",{className:"text-xs text-zinc-500",children:n})]});const i=r==="client";return s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:t}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[!i&&s.jsx("th",{children:"Severity"}),s.jsx("th",{children:i?"What changed":"Title"}),s.jsx("th",{children:i?"Customer question":"Query"}),s.jsx("th",{children:i?"AI tool":"Provider"})]})}),s.jsx("tbody",{children:e.map(a=>s.jsxs("tr",{children:[!i&&s.jsxs("td",{children:[s.jsx(tt,{tone:w_e[a.severity],children:Zte(a.severity)}),a.instanceCount>1&&s.jsxs("span",{className:"ml-2 text-[11px] text-zinc-500",children:["×",a.instanceCount]})]}),s.jsxs("td",{className:"evidence-query-cell",children:[a.title,i&&a.instanceCount>1&&s.jsxs("span",{className:"ml-2 text-[11px] text-zinc-500",children:["×",a.instanceCount]})]}),s.jsx("td",{className:"text-xs text-zinc-400",children:a.query}),s.jsx("td",{className:"text-xs text-zinc-400",children:i?xv(a.provider):a.provider})]},a.id))})]})})]})}function L_e({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=s.jsx(Qh,{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?s.jsxs("section",{className:"page-section-divider",children:[a,s.jsx(eE,{message:r?"No comparison yet — trends will appear after a few more checks.":"Trends will appear after a few more checks."})]}):s.jsxs("section",{className:"page-section-divider",children:[a,s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-5",children:[s.jsx(Fj,{label:r?"AI links to your website":"Citation rate",delta:n.citationRate,unit:"%"}),s.jsx(Fj,{label:r?"AI mentions your name":"Mention rate",delta:n.mentionRate,unit:"%"}),s.jsx(Fj,{label:r?"Questions AI answered with you":"Cited queries",delta:n.citedQueryCount,unit:"count"}),s.jsx(YL,{label:r?"Visitors from Google":"GSC clicks",delta:n.gscClicksDelta,countLabel:r?"visits":"clicks"}),s.jsx(YL,{label:r?"Visitors from AI tools":"AI referral sessions",delta:n.aiReferralsDelta,countLabel:r?"visits":"sessions"})]}),s.jsx(M_e,{movements:n.providerMovements,audience:t}),s.jsx(ZL,{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}),s.jsx(ZL,{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 XL({label:e,value:t,tone:n,subtitle:r}){const i=n==="positive"?"text-emerald-400":n==="caution"?"text-amber-400":n==="negative"?"text-rose-400":"text-zinc-100";return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsx("p",{className:`text-2xl font-semibold tracking-tight ${i}`,children:t}),r&&s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:r})]})}function Qh({eyebrow:e,title:t,subtitle:n}){return s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsx("h2",{className:"page-title",children:t}),n&&s.jsx("p",{className:"page-subtitle mt-1",children:n})]})}function $_e({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 s.jsxs("div",{className:`flex flex-wrap gap-1.5 ${n??""}`,children:[r.map((a,l)=>s.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},l)),i>0&&s.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 eE({message:e}){return s.jsx("p",{className:"text-sm text-zinc-500 py-4 text-center",children:e})}function B_e({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=x.useState(!1),[a,l]=x.useState(!1),[c,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??[]),[O,C]=x.useState(""),[z,A]=x.useState(null),[_,R]=x.useState(!1),[$,F]=x.useState(!1),[q,B]=x.useState(""),[K,X]=x.useState(""),[Q,H]=x.useState(""),[J,de]=x.useState(""),[be,M]=x.useState("");x.useEffect(()=>{r||(p(e.displayName),y(e.canonicalDomain),w(e.country),j(e.language),E(e.ownedDomains??[]))},[e,r]);function D(){i(!1),d(null),p(e.displayName),y(e.canonicalDomain),w(e.country),j(e.language),E(e.ownedDomains??[]),C("")}function U(){const Z=O.trim();Z&&(k.includes(Z)||E([...k,Z]),C(""))}function I(Z){E(k.filter(Ge=>Ge!==Z))}async function V(){if(!(!f.trim()||!m.trim()||!v.trim()||!b.trim())){l(!0),d(null);try{await t(e.name,{displayName:f.trim(),canonicalDomain:m.trim(),ownedDomains:k,country:v.trim(),language:b.trim()}),i(!1),dt({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{l(!1)}}}async function ce(){const Z=q.trim(),Ge=K.trim(),Me=Q.trim(),lt=J.trim();if(!(!Z||!Ge||!Me||!lt)){R(!0),A(null);try{const Te={label:Z,city:Ge,region:Me,country:lt};be.trim()&&(Te.timezone=be.trim()),await AV(e.name,Te),n(),B(""),X(""),H(""),de(""),M(""),F(!1),dt({title:"Location added",detail:`${Z} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${Z}`,dedupeMode:"drop"})}catch(Te){A(Te instanceof Error?Te.message:"Failed to add location")}finally{R(!1)}}}async function re(Z){R(!0),A(null);try{await EV(e.name,Z),n(),dt({title:"Location removed",detail:`${Z} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${Z}`,dedupeMode:"drop"})}catch(Ge){A(Ge instanceof Error?Ge.message:"Failed to remove location")}finally{R(!1)}}async function ke(Z){R(!0),A(null);try{await OV(e.name,Z),n(),dt({title:"Default location updated",detail:`${Z} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Ge){A(Ge instanceof Error?Ge.message:"Failed to set default location")}finally{R(!1)}}const ze=f!==e.displayName||m!==e.canonicalDomain||v!==e.country||b!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),te="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",fe="block text-xs font-medium text-zinc-400 mb-1",Ee=q.trim()&&K.trim()&&Q.trim()&&J.trim();return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),s.jsx("h2",{children:"Project settings"})]}),!r&&s.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!0),children:"Edit settings"})]}),c&&s.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[c,s.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>d(null),children:"×"})]}),r?s.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:fe,children:"Display name"}),s.jsx("input",{className:te,type:"text",value:f,onChange:Z=>p(Z.target.value),placeholder:"My Project"})]}),s.jsxs("div",{children:[s.jsx("label",{className:fe,children:"Canonical domain"}),s.jsx("input",{className:te,type:"text",value:m,onChange:Z=>y(Z.target.value),placeholder:"example.com"})]}),s.jsxs("div",{children:[s.jsx("label",{className:fe,children:"Country"}),s.jsx("input",{className:te,type:"text",value:v,onChange:Z=>w(Z.target.value),placeholder:"US",maxLength:2})]}),s.jsxs("div",{children:[s.jsx("label",{className:fe,children:"Language"}),s.jsx("input",{className:te,type:"text",value:b,onChange:Z=>j(Z.target.value),placeholder:"en"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:fe,children:"Owned domains"}),s.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(Z=>s.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,s.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>I(Z),"aria-label":`Remove ${Z}`,children:"×"})]},Z))}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{className:`${te} flex-1`,type:"text",placeholder:"docs.example.com",value:O,onChange:Z=>C(Z.target.value),onKeyDown:Z=>Z.key==="Enter"&&(Z.preventDefault(),U())}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:!O.trim(),onClick:U,children:"Add"})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[s.jsx(pe,{type:"button",disabled:a||!ze||!f.trim()||!m.trim(),onClick:V,children:a?"Saving...":"Save changes"}),s.jsx(pe,{type:"button",variant:"outline",disabled:a,onClick:D,children:"Cancel"})]})]}):s.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:s.jsx("table",{className:"w-full text-sm",children:s.jsxs("tbody",{children:[s.jsxs("tr",{className:"border-b border-zinc-800/40",children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),s.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),s.jsxs("tr",{className:"border-b border-zinc-800/40",children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),s.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),s.jsxs("tr",{className:"border-b border-zinc-800/40",children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),s.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?s.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(Z=>s.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))}):s.jsx("span",{className:"text-zinc-500",children:"—"})})]}),s.jsxs("tr",{className:"border-b border-zinc-800/40",children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),s.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),s.jsxs("tr",{className:"border-b border-zinc-800/40",children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),s.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),s.jsxs("td",{className:"px-4 py-2.5",children:[z&&s.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:[z,s.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>A(null),children:"×"})]}),(e.locations??[]).length>0?s.jsxs("table",{className:"w-full text-xs mb-2",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"text-zinc-600",children:[s.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),s.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),s.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),s.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),s.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),s.jsx("th",{className:"pb-1"})]})}),s.jsx("tbody",{children:e.locations.map(Z=>s.jsxs("tr",{className:"border-t border-zinc-800/30",children:[s.jsx("td",{className:"py-1.5 pr-3",children:s.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?" ★":""]})}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Z.city}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Z.region}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Z.country}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:Z.timezone??"—"}),s.jsx("td",{className:"py-1.5",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[Z.label!==e.defaultLocation&&s.jsx("button",{type:"button",disabled:_,onClick:()=>ke(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"}),s.jsx("button",{type:"button",disabled:_,onClick:()=>re(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))})]}):s.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),$?s.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[s.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),s.jsx("input",{className:te,type:"text",value:q,onChange:Z=>B(Z.target.value),placeholder:"nyc"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),s.jsx("input",{className:te,type:"text",value:K,onChange:Z=>X(Z.target.value),placeholder:"New York"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),s.jsx("input",{className:te,type:"text",value:Q,onChange:Z=>H(Z.target.value),placeholder:"NY"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),s.jsx("input",{className:te,type:"text",value:J,onChange:Z=>de(Z.target.value),placeholder:"US",maxLength:2})]}),s.jsxs("div",{className:"col-span-2",children:[s.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),s.jsx("input",{className:te,type:"text",value:be,onChange:Z=>M(Z.target.value),placeholder:"America/New_York"})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[s.jsx(pe,{type:"button",size:"sm",disabled:_||!Ee,onClick:ce,children:_?"Adding...":"Add location"}),s.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:_,onClick:()=>{F(!1),A(null)},children:"Cancel"})]})]}):s.jsx(pe,{type:"button",size:"sm",variant:"outline",onClick:()=>F(!0),children:"+ Add location"})]})]})]})})})]})}const U_e=[{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"}],JL=["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 q_e({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[a,l]=x.useState("daily"),[c,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),[O,C]=x.useState(!1),[z,A]=x.useState(null);x.useEffect(()=>{IV(e).then(n).catch(()=>n(null))},[e]);const _=()=>{if(t&&t!=="loading"){const q=One(t.preset??null,t.cronExpr);l(q.freq),d(q.hour),p(q.customCron);const B=JL.includes(t.timezone);y(B?t.timezone:"Other"),w(!B),j(B?"":t.timezone)}else l("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=Ene(a,c);const K=await D2(e,B);n(K),i(!1),dt({title:"Schedule saved",detail:Rw(K.preset??null,K.cronExpr,K.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(q){A(q instanceof Error?q.message:"Failed to save schedule")}finally{E(!1)}},$=async()=>{if(!(!t||t==="loading")){E(!0),A(null);try{const q={timezone:t.timezone,enabled:!t.enabled};t.preset?q.preset=t.preset:q.cron=t.cronExpr;const B=await D2(e,q);n(B),dt({title:B.enabled?"Schedule resumed":"Schedule paused",detail:Rw(B.preset??null,B.cronExpr,B.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(q){A(q instanceof Error?q.message:"Failed to update schedule")}finally{E(!1)}}},F=async()=>{C(!0),A(null);try{await MV(e),n(null),i(!1),dt({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch(q){A(q instanceof Error?q.message:"Failed to remove schedule")}finally{C(!1)}};return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),s.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!r&&s.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:_,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&s.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&s.jsx(Pe,{className:"surface-card compact-card",children:s.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!r&&t!==null&&s.jsxs(Pe,{className:"surface-card compact-card",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Rw(t.preset??null,t.cronExpr,t.timezone)}),s.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",s.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&s.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&s.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsx(tt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:$,children:t.enabled?"Pause":"Resume"}),s.jsx(pe,{type:"button",variant:"ghost",size:"sm",disabled:O,onClick:F,children:O?"Removing...":"Remove"})]})]}),z&&s.jsx("p",{className:"text-rose-400 text-sm mt-2",children:z})]}),r&&s.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),s.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:q=>l(q.target.value),children:U_e.map(q=>s.jsx("option",{value:q.value,children:q.label},q.value))})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),s.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none disabled:opacity-40",value:c,disabled:a==="twice-daily"||a==="custom",onChange:q=>d(parseInt(q.target.value)),children:Array.from({length:24},(q,B)=>s.jsx("option",{value:B,children:m1(B)},B))})]})]}),a==="custom"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),s.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:q=>p(q.target.value)})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),s.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:q=>{q.target.value==="Other"?(w(!0),y("Other")):(w(!1),y(q.target.value))},children:[JL.map(q=>s.jsx("option",{value:q,children:q},q)),s.jsxs("option",{value:"Other",children:["Other (enter manually)","…"]})]}),v&&s.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:q=>j(q.target.value)})]}),z&&s.jsx("p",{className:"text-rose-400 text-sm",children:z}),s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),A(null)},children:"Cancel"}),s.jsx(pe,{type:"button",size:"sm",disabled:k||a==="custom"&&!f.trim(),onClick:R,children:k?"Saving...":"Save schedule"})]})]})]})}const F_e=[{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 H_e({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[a,l]=x.useState(""),[c,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=z=>{d(A=>A.includes(z)?A.filter(_=>_!==z):[...A,z])},E=async()=>{if(!(!a.trim()||c.length===0)){p(!0),y(null);try{const z=await $V(e,{channel:"webhook",url:a.trim(),events:c});n(A=>A==="loading"?[z]:[...A,z]),l(""),d(["citation.lost","citation.gained"]),i(!1),dt({title:"Webhook added",detail:`Notifications will be sent to ${z.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(z){y(z instanceof Error?z.message:"Failed to add webhook")}finally{p(!1)}}},O=async z=>{if(!b.has(z)){j(A=>new Set(A).add(z));try{await BV(e,z),n(A=>A==="loading"?A:A.filter(_=>_.id!==z)),dt({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${z}`,dedupeMode:"drop"})}catch(A){y(A instanceof Error?A.message:"Failed to remove webhook")}finally{j(A=>{const _=new Set(A);return _.delete(z),_})}}},C=async z=>{w(A=>({...A,[z]:{state:"testing"}}));try{const A=await UV(e,z);w(_=>({..._,[z]:{state:A.ok?"ok":"fail",status:A.status}})),A.ok&&dt({title:"Test notification sent",detail:`Webhook returned status ${A.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${z}`,dedupeMode:"replace"})}catch{w(A=>({...A,[z]:{state:"fail"}}))}};return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),s.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&s.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),y(null)},children:r?"Cancel":"+ Add webhook"})]}),r&&s.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),s.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:z=>l(z.target.value)})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),s.jsx("div",{className:"flex flex-wrap gap-3",children:F_e.map(z=>s.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:c.includes(z.value),onChange:()=>k(z.value)}),s.jsx("span",{className:"text-sm text-zinc-300",children:z.label})]},z.value))})]}),m&&s.jsx("p",{className:"text-rose-400 text-sm",children:m}),s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),y(null)},children:"Cancel"}),s.jsx(pe,{type:"button",size:"sm",disabled:f||!a.trim()||c.length===0,onClick:E,children:f?"Adding...":"Add webhook"})]})]}),t==="loading"&&s.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&s.jsx(Pe,{className:"surface-card compact-card",children:s.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&&s.jsxs("div",{className:"evidence-table-wrap",children:[s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Endpoint"}),s.jsx("th",{children:"Events"}),s.jsx("th",{children:"Status"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:t.map(z=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:s.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:z.urlHost,children:z.urlDisplay??z.url})}),s.jsx("td",{children:s.jsx("div",{className:"flex flex-wrap gap-1",children:z.events.map(A=>s.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))})}),s.jsx("td",{children:s.jsx(tt,{tone:z.enabled?"positive":"neutral",children:z.enabled?"Active":"Paused"})}),s.jsx("td",{children:s.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[v[z.id]&&(()=>{const A=v[z.id],_=A.state==="testing"?"Sending…":A.state==="ok"?`Delivered${A.status?` (${A.status})`:""}`:`Failed${A.status?` (${A.status})`:""}`;return s.jsx(tt,{tone:A.state==="ok"?"positive":A.state==="fail"?"negative":"neutral",children:_})})(),s.jsx(pe,{variant:"ghost",size:"sm",type:"button",disabled:v[z.id]?.state==="testing",onClick:()=>C(z.id),children:"Test"}),s.jsx(pe,{variant:"ghost",size:"sm",type:"button",disabled:b.has(z.id),onClick:()=>O(z.id),children:b.has(z.id)?"Removing…":"Remove"})]})})]},z.id))})]}),m&&s.jsx("p",{className:"text-rose-400 text-sm mt-2",children:m})]})]})}function K_e({projectName:e,refreshNonce:t}){const n=vr(),[r,i]=x.useState(null),[a,l]=x.useState([]),[c,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(""),[O,C]=x.useState(""),[z,A]=x.useState(!0),[_,R]=x.useState(!1),[$,F]=x.useState(null),[q,B]=x.useState("coverage");x.useEffect(()=>{K()},[e,t]);async function K(){A(!0),F(null);try{const D=await n.fetchQuery({queryKey:_e.bing.status(e),queryFn:()=>e4(e),staleTime:_r});if(i(D),D.connected){const[U,I,V,ce]=await Promise.all([n.fetchQuery({queryKey:_e.bing.coverage(e),queryFn:()=>uk(e).catch(()=>null),staleTime:_r}),n.fetchQuery({queryKey:_e.bing.inspections(e),queryFn:()=>t4(e).catch(()=>[]),staleTime:_r}),n.fetchQuery({queryKey:_e.bing.performance(e),queryFn:()=>mQ(e).catch(()=>[]),staleTime:_r}),D.siteUrl?Promise.resolve([]):n.fetchQuery({queryKey:_e.bing.sites(e),queryFn:()=>fQ(e).then(re=>re.sites).catch(()=>[]),staleTime:_r})]);d(U),p(I),y(V),l(ce)}else d(null),p([]),y([]),l([])}catch(D){F(D instanceof Error?D.message:"Failed to load Bing data")}finally{A(!1)}}async function X(){if(k.trim()){F(null);try{const D=await uQ(e,k.trim());await n.invalidateQueries({queryKey:_e.bing.project(e)}),E(""),D.availableSites.length>0&&l(D.availableSites),await K()}catch(D){F(D instanceof Error?D.message:"Failed to connect")}}}async function Q(){try{await dQ(e),await n.invalidateQueries({queryKey:_e.bing.project(e)}),i(null),l([]),d(null),p([]),y([]),w(null),C(""),F(null)}catch(D){F(D instanceof Error?D.message:"Failed to disconnect")}}async function H(){if(O)try{await hQ(e,O),await n.invalidateQueries({queryKey:_e.bing.project(e)}),await K()}catch(D){F(D instanceof Error?D.message:"Failed to set site")}}async function J(){if(b.trim())try{const D=await n4(e,b.trim());await n.invalidateQueries({queryKey:_e.bing.project(e)}),w(D),p(U=>[D,...U])}catch(D){F(D instanceof Error?D.message:"Inspection failed")}}async function de(D){R(!0),F(null);try{const U=await L2(e,{urls:[D]}),{succeeded:I,failed:V,total:ce}=U.summary;dt({title:"Bing submission requested",detail:V===0?`${I} URL submitted to Bing.`:`${I}/${ce} submitted successfully, ${V} failed.`,tone:V===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${D}`,dedupeMode:"replace"})}catch(U){const I=U instanceof Error?U.message:"Submission failed";F(I),dt({title:"Bing submission failed",detail:I,tone:"negative",dedupeKey:`bing:indexing:${e}:${D}`,dedupeMode:"replace"})}finally{R(!1)}}async function be(){R(!0),F(null),dt({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const D=await L2(e,{allUnindexed:!0}),{succeeded:U,failed:I,total:V}=D.summary;dt({title:"Bing submissions requested",detail:I===0?`${U}/${V} URL${V!==1?"s":""} submitted to Bing.`:`${U}/${V} submitted successfully, ${I} failed.`,tone:I===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(D){const U=D instanceof Error?D.message:"Batch submission failed";F(U),dt({title:"Bing submissions failed",detail:U,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{R(!1)}}if(z)return s.jsx(Pe,{className:"surface-card",children:s.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!r?.connected)return s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),s.jsx("h3",{children:"Domain authorization"})]}),s.jsx(tt,{tone:"caution",children:"Not connected"})]}),s.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),s.jsxs("div",{className:"mt-3",children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[s.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:D=>E(D.target.value),onKeyDown:D=>D.key==="Enter"&&X()}),s.jsx(pe,{size:"sm",disabled:!k.trim(),onClick:X,children:"Connect"})]}),s.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",s.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"})]})]}),$&&s.jsx("p",{className:"mt-3 text-xs text-rose-400",children:$})]});if(!r.siteUrl)return s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),s.jsx("h3",{children:"Domain authorization"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(tt,{tone:"positive",children:"Connected"}),s.jsx(pe,{size:"sm",variant:"ghost",onClick:Q,children:"Disconnect"})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),s.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),s.jsx("span",{className:"text-xs text-zinc-500",children:r.domain})]}),s.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."})]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.domain})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.updatedAt?ua(r.updatedAt):"—"})]})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),a.length>0?s.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[s.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:O,onChange:D=>C(D.target.value),children:[s.jsx("option",{value:"",children:"Select a site..."}),a.map(D=>s.jsxs("option",{value:D.url,children:[D.url,D.verified?" (verified)":""]},D.url))]}),s.jsx(pe,{size:"sm",disabled:!O,onClick:H,children:"Set Site"})]}):s.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."})]})]}),$&&s.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 s.jsxs("div",{className:"space-y-3",children:[s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),s.jsx("h3",{children:"Domain authorization"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(tt,{tone:"positive",children:"Connected"}),s.jsx(pe,{size:"sm",variant:"ghost",onClick:Q,children:"Disconnect"})]})]}),$&&s.jsx("p",{className:"mb-3 text-xs text-rose-400",children:$}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),s.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),s.jsx("span",{className:"text-xs text-zinc-500",children:r.domain})]}),s.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",s.jsx("code",{children:r.siteUrl}),"."]})]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.siteUrl})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.updatedAt?ua(r.updatedAt):"—"})]})]})]})]}),s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),s.jsx("h3",{children:"Index monitoring"})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:c?.lastInspectedAt?`Last inspected ${ua(c.lastInspectedAt)}`:"No inspection history yet"})]}),s.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:M.map(D=>s.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${q===D.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>B(D.key),children:D.label},D.key))}),q==="coverage"&&c&&s.jsxs("div",{className:"mt-4 space-y-4",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[s.jsx(ag,{label:"Indexed",value:c.summary.indexed,tone:"positive"}),s.jsx(ag,{label:"Not in index",value:c.summary.notIndexed+(c.summary.unknown??0),tone:"negative"}),s.jsx(ag,{label:"Status unknown",value:c.summary.unknown??0,tone:"neutral"}),s.jsx(ag,{label:"Coverage",value:`${c.summary.percentage}%`,tone:"neutral"})]}),c.notIndexed.length>0&&s.jsxs("div",{children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[s.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",c.notIndexed.length,")"]}),s.jsx(pe,{size:"sm",variant:"ghost",disabled:_,onClick:be,children:_?"Submitting…":"Submit all to Bing"})]}),s.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800",children:[s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),s.jsx("tbody",{children:c.notIndexed.map(D=>s.jsxs("tr",{className:"border-b border-zinc-800/50",children:[s.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:D.url}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:D.httpCode??"—"}),s.jsx("td",{className:"py-1.5 px-3 text-right",children:s.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:_,onClick:()=>de(D.url),children:"Submit"})})]},D.id))})]})})]}),(c.unknown??[]).length>0&&s.jsxs("div",{children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[s.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(c.unknown??[]).length,")"]}),s.jsx(pe,{size:"sm",variant:"ghost",disabled:_,onClick:be,children:_?"Submitting…":"Submit all to Bing"})]}),s.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800",children:[s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),s.jsx("tbody",{children:(c.unknown??[]).map(D=>s.jsxs("tr",{className:"border-b border-zinc-800/50",children:[s.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:D.url}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:D.lastCrawledDate?ua(D.lastCrawledDate):"—"}),s.jsx("td",{className:"py-1.5 px-3 text-right",children:s.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:_,onClick:()=>de(D.url),children:"Submit"})})]},D.id))})]})})]}),c.indexed.length>0&&s.jsxs("div",{children:[s.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",c.indexed.length,")"]}),s.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800",children:[s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),s.jsx("tbody",{children:c.indexed.map(D=>s.jsxs("tr",{className:"border-b border-zinc-800/50",children:[s.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:D.url}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:D.lastCrawledDate?ua(D.lastCrawledDate):"—"})]},D.id))})]})})]})]}),q==="coverage"&&!c&&s.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),q==="inspections"&&s.jsxs("div",{className:"mt-4 space-y-3",children:[s.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[s.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:D=>j(D.target.value),onKeyDown:D=>D.key==="Enter"&&J()}),s.jsx(pe,{size:"sm",disabled:!b.trim(),onClick:J,children:"Inspect"})]}),v&&s.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[s.jsx("div",{className:"font-medium text-zinc-200",children:v.url}),s.jsxs("div",{className:"text-zinc-400",children:["In Index: ",s.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&&s.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800",children:[s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),s.jsx("tbody",{children:f.map(D=>s.jsxs("tr",{className:"border-b border-zinc-800/50",children:[s.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:D.url}),s.jsx("td",{className:"py-1.5 px-3",children:s.jsx(tt,{tone:D.inIndex?"positive":"negative",children:D.inIndex?"Yes":"No"})}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:D.httpCode??"—"}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:ua(D.inspectedAt)})]},D.id))})]})})]}),q==="performance"&&s.jsx("div",{className:"mt-4",children:m.length===0?s.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):s.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800",children:[s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Um[Eo.Clicks]}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Um[Eo.Impressions]}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Um[Eo.CTR]}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Um[Eo.Position]})]})}),s.jsx("tbody",{children:m.map((D,U)=>s.jsxs("tr",{className:"border-b border-zinc-800/50",children:[s.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:D.query}),s.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:D.clicks}),s.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:D.impressions}),s.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(D.ctr)?D.ctr*100:0).toFixed(1),"%"]}),s.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:D.averagePosition.toFixed(1)})]},U))})]})})})]})]})}function G_e({projectName:e}){const t=vr(),[n,r]=x.useState("google"),[i,a]=x.useState(!0),[l,c]=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),[O,C]=x.useState(null),[z,A]=x.useState(null),[_,R]=x.useState(0);async function $(U=!1){U||a(!0),f(null);try{const[I,V,ce]=await Promise.all([lk().catch(()=>null),t.fetchQuery({queryKey:_e.gsc.connections(e),queryFn:()=>X5(e).catch(()=>[]),staleTime:_r}),t.fetchQuery({queryKey:_e.bing.status(e),queryFn:()=>e4(e).catch(()=>null),staleTime:_r})]),re=V.find(te=>te.connectionType==="gsc")??null;y(!!I?.google?.configured),E(!!I?.bing?.configured),w(re),C(ce);const[ke,ze]=await Promise.all([re?t.fetchQuery({queryKey:_e.gsc.coverage(e),queryFn:()=>ck(e).catch(()=>null),staleTime:_r}):Promise.resolve(null),ce?.connected?t.fetchQuery({queryKey:_e.bing.coverage(e),queryFn:()=>uk(e).catch(()=>null),staleTime:_r}):Promise.resolve(null)]);j(ke),A(ze)}catch(I){f(I instanceof Error?I.message:"Failed to load search console overview")}finally{a(!1)}}async function F(){if(l!=="idle")return;p.current?.abort();const U=new AbortController;p.current=U;const I=U.signal;c("syncing"),f(null);const V=[];try{async function ce(){if(!v)return;const te=await J5(e);if(!te?.id)return;const fe=2e3,Z=Date.now()+12e4;for(;Date.now()<Z;){if(I.aborted||(await new Promise(Me=>setTimeout(Me,fe)),I.aborted))return;const Ge=await Ql(te.id).catch(()=>null);if(!Ge)break;if(["completed","failed","cancelled"].includes(Ge.status)){Ge.status!=="completed"&&V.push(`Google sync ${Ge.status}`);break}}}const re=10;async function ke(){if(!O?.connected)return;const te=await t4(e).catch(()=>[]),fe=[...new Set(te.map(Ee=>Ee.url))];if(fe.length===0){await pQ(e).catch(()=>null);return}for(let Ee=0;Ee<fe.length;Ee+=re){if(I.aborted)return;const Z=fe.slice(Ee,Ee+re),Me=(await Promise.allSettled(Z.map(lt=>n4(e,lt)))).filter(lt=>lt.status==="rejected").length;Me>0&&V.push(`${Me} Bing inspection(s) failed`)}}const ze=await Promise.allSettled([ce(),ke()]);for(const te of ze)te.status==="rejected"&&V.push(te.reason instanceof Error?te.reason.message:"Sync failed");if(I.aborted)return;c("reloading"),await Promise.all([t.invalidateQueries({queryKey:_e.gsc.project(e)}),t.invalidateQueries({queryKey:_e.bing.project(e)})]),await $(!0),R(te=>te+1),V.length>0&&f(`Partial refresh: ${V.join("; ")}`)}catch(ce){I.aborted||f(ce instanceof Error?ce.message:"Refresh failed")}finally{I.aborted||c("idle")}}x.useEffect(()=>($(),()=>{p.current?.abort()}),[e]);const q=v?"positive":m?"caution":"negative",B=v?"Connected":m?"Ready to connect":"Needs setup",K=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",Q=b?.lastSyncedAt??b?.lastInspectedAt??v?.updatedAt??null,H=O?.connected?"positive":k?"caution":"negative",J=O?.connected?"Connected":k?"Ready to connect":"Needs setup",de=z?`${z.summary.percentage}% indexed`:O?.connected?"Awaiting coverage":"No coverage data",be=z?z.summary.notIndexed+(z.summary.unknown??0):0,M=z?`${be} not in index`:O?.connected?"Inspect URLs to populate coverage":k?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",D=z?.lastInspectedAt??O?.updatedAt??null;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),s.jsx("h2",{children:"Search Engine Intelligence"}),s.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."})]}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:i||l!=="idle",onClick:()=>{F()},children:i?"Loading…":l==="syncing"?"Refreshing Google & Bing…":l==="reloading"?"Reloading workspaces…":"Refresh all"})]}),d&&s.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}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsx(XP,{eyebrow:"Google",title:"Google Search Console",status:i?"Loading…":B,tone:i?"neutral":q,targetLabel:"Selected property",targetValue:v?.propertyId??"No property selected",coverageValue:i?"Loading…":K,note:i?"Loading overview…":X,updatedAt:Q,active:n==="google",onClick:()=>r("google")}),s.jsx(XP,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:i?"Loading…":J,tone:i?"neutral":H,targetLabel:"Selected site",targetValue:O?.siteUrl??"No site selected",coverageValue:i?"Loading…":de,note:i?"Loading overview…":M,updatedAt:D,active:n==="bing",onClick:()=>r("bing")})]})]}),s.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([U,I])=>s.jsx("button",{type:"button",role:"tab","aria-selected":n===U,className:`project-subnav-link ${n===U?"project-subnav-link-active":""}`,onClick:()=>r(U),children:I},U))}),n==="google"&&s.jsx(a_e,{projectName:e}),n==="bing"&&s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),s.jsx("h2",{children:"Bing Webmaster Tools"})]})}),s.jsx(K_e,{projectName:e,refreshNonce:_})]})]})}function V_e({insights:e}){const{openEvidence:t}=bd(),[n,r]=x.useState(null);return s.jsx("div",{className:"insight-list",children:e.map(i=>{const a=n===i.id,l=i.affectedPhrases.length>0;return s.jsxs("div",{children:[s.jsxs("div",{className:`insight-row insight-row-${i.tone} ${l?"cursor-pointer":""}`,onClick:l?()=>r(a?null:i.id):void 0,children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l&&s.jsx(Yh,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${a?"rotate-90":""}`}),s.jsx(tt,{tone:i.tone,children:i.actionLabel}),s.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:i.title}),s.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:i.detail})]}),l&&s.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[i.affectedPhrases.length," phrase",i.affectedPhrases.length>1?"s":""]})]}),a&&s.jsx("div",{className:"divide-y divide-zinc-800/20",children:i.affectedPhrases.map((c,d)=>s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx($1,{state:c.citationState}),s.jsx("span",{className:"text-sm text-zinc-200 truncate",children:c.query}),s.jsx("div",{className:"hidden sm:flex gap-1",children:c.provider&&s.jsx(Xl,{provider:c.provider})})]}),c.evidenceId&&s.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:f=>{f.stopPropagation(),t(c.evidenceId)},children:"View →"})]},c.evidenceId||`${i.id}-${d}`))})]},i.id)})})}function Id({tab:e}){const{projectId:t}=Wh({from:"/projects/$projectId"}),n=Ko(),{dashboard:r,isLoading:i,refetch:a}=mc();if(!r||i)return s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-48"}),s.jsx("div",{className:"skeleton-text-sm w-32"})]}),s.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(ve=>s.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[s.jsx("div",{className:"skeleton-circle size-20"}),s.jsx("div",{className:"skeleton-text w-16 mt-3"})]},ve))}),s.jsxs("div",{className:"page-skeleton-card",children:[s.jsx("div",{className:"skeleton-text w-28"}),s.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(ve=>s.jsx("div",{className:"skeleton-text-sm w-full"},ve))})]})]});const l=Iae(r,t),[c,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),[O,C]=x.useState(""),[z,A]=x.useState(!1),[_,R]=x.useState(!1),[$,F]=x.useState(""),[q,B]=x.useState(!1),[K,X]=x.useState(void 0),[Q,H]=x.useState(!1),[J,de]=x.useState(null),[be,M]=x.useState(!1),D=l?.visibilityEvidence??[],U=l?.project.name??"",I=l?.project.displayName||l?.project.name||U,V=b9(),ce=(l?.recentRuns??[]).some(ve=>ve.kind===ht["answer-visibility"]&&(ve.status===pr.running||ve.status===pr.queued)),re=x.useMemo(()=>(l?.project.locations??[]).map(ve=>ve.label),[l?.project.locations]),ke=x.useMemo(()=>new Set(D.map(ve=>ve.location??"")),[D]),ze=ke.has(""),te=x.useMemo(()=>{const ve=[...ke].filter(Boolean);return ve.length>1?ve:re},[ke,re]);x.useEffect(()=>{if(K===void 0||K===""||!U){de(null),M(!1);return}M(!0),Y5(U,K).then(ve=>{de(ve),M(!1)}).catch(()=>{de(null),M(!1)})},[K,U]);const fe=x.useMemo(()=>{if(!J)return null;const ve=new Map;for(const ft of J){for(const[Ye,rt]of Object.entries(ft.providerRuns??{}))ve.set(`${ft.query}::${Ye}`,rt.map(ae=>({runId:ae.runId,citationState:ae.citationState,createdAt:ae.createdAt,answerMentioned:ae.answerMentioned,visibilityState:ae.visibilityState,visibilityTransition:ae.visibilityTransition})));(!ft.providerRuns||Object.keys(ft.providerRuns).length===0)&&ve.set(`${ft.query}::`,ft.runs.map(Ye=>({runId:Ye.runId,citationState:Ye.citationState,createdAt:Ye.createdAt,answerMentioned:Ye.answerMentioned,visibilityState:Ye.visibilityState,visibilityTransition:Ye.visibilityTransition})))}return ve},[J]),Ee=x.useMemo(()=>{const ve=K!==void 0?D.filter(ft=>K===""?!ft.location:ft.location===K):D;return fe?ve.map(ft=>{const Ye=fe.get(`${ft.query}::${ft.provider}`)??fe.get(`${ft.query}::`);return Ye?{...ft,runHistory:Ye}:ft}):ve},[D,K,fe]);if(!l)return s.jsx("div",{className:"page-container",children:s.jsxs(Pe,{className:"surface-card empty-card",children:[s.jsx("h1",{children:"Project not found"}),s.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),s.jsx(pe,{asChild:!0,children:s.jsx(Et,{to:"/",children:"Return to overview"})})]})});async function Z(){try{await V.mutateAsync({projectName:U,projectLabel:I,sourceAction:"project-run"}),a()}catch{}}async function Ge(){p(!0);try{await _V(U),dt({title:"Project deleted",detail:`${I} was removed.`,tone:"positive",dedupeKey:`project:delete:${U}`,dedupeMode:"drop"}),n({to:"/"}),a()}catch(ve){console.error("Failed to delete project:",ve)}finally{p(!1)}}async function Me(){try{const ve=await zV(U),ft=typeof ve=="string"?ve:JSON.stringify(ve,null,2),Ye=new Blob([ft],{type:"text/yaml"}),rt=URL.createObjectURL(Ye),ae=document.createElement("a");ae.href=rt,ae.download=`${U}.yaml`,ae.click()}catch(ve){dt({title:"Export failed",detail:ve instanceof Error?ve.message:"Could not export project YAML.",tone:"negative"})}}async function lt(){const ve=v.split(`
|
|
293
|
-
`).map(ft=>ft.trim()).filter(Boolean);if(ve.length!==0){j(!0);try{await NV(U,ve),a(),w(""),y(!1)}finally{j(!1)}}}async function Te(){const ve=O.trim();if(ve){A(!0);try{const Ye=(await W5(U)).map(ae=>ae.domain),rt=[...new Set([...Ye,ve])];await Z5(U,rt),a(),C(""),E(!1)}finally{A(!1)}}}async function Wt(){const ve=$.trim();if(ve){B(!0);try{const ft=l?.project.ownedDomains??[];await P2(U,[...ft,ve]),a(),F(""),R(!1)}finally{B(!1)}}}async function Ht(ve){B(!0);try{const ft=l?.project.ownedDomains??[];await P2(U,ft.filter(Ye=>Ye!==ve)),a()}finally{B(!1)}}async function on(ve,ft){await kV(ve,ft),a()}const en=ve=>!Number.isNaN(Number.parseInt(ve,10)),_n=[{key:"overview",label:"Overview",href:`/projects/${l.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${l.project.id}/search-console`},{key:"discovery",label:"Discovery",href:`/projects/${l.project.id}/discovery`},{key:"activity",label:"Activity",href:`/projects/${l.project.id}/activity`},{key:"report",label:"Report",href:`/projects/${l.project.id}/report`},{key:"inbound",label:"Inbound",href:`/projects/${l.project.id}/inbound`}];return s.jsxs("div",{className:"page-container",children:[c?s.jsxs(Pe,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[s.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),s.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",s.jsx("strong",{className:"text-zinc-200",children:l.project.displayName||l.project.name})," and all its queries, competitors, runs, and snapshots. This cannot be undone."]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(pe,{type:"button",variant:"destructive",disabled:f,onClick:Ge,children:f?"Deleting...":"Yes, delete project"}),s.jsx(pe,{type:"button",variant:"outline",disabled:f,onClick:()=>d(!1),children:"Cancel"})]})]}):null,s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:l.project.displayName||l.project.name}),s.jsxs("p",{className:"page-subtitle",children:[l.project.canonicalDomain,(l.project.ownedDomains??[]).length===0&&!_&&s.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"})," "," · ",l.contextLabel]}),s.jsxs("div",{className:"tag-row",children:[s.jsx("span",{className:"tag",children:l.project.country}),s.jsx("span",{className:"tag",children:l.project.language.toUpperCase()}),l.project.tags.map(ve=>s.jsx("span",{className:"tag",children:ve},ve))]}),((l.project.ownedDomains??[]).length>0||_)&&s.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[s.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(l.project.ownedDomains??[]).map(ve=>s.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:[ve,s.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:q,onClick:()=>Ht(ve),"aria-label":`Remove ${ve}`,children:"×"})]},ve)),_?s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.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:ve=>F(ve.target.value),onKeyDown:ve=>ve.key==="Enter"&&Wt(),autoFocus:!0}),s.jsx(pe,{type:"button",size:"sm",disabled:!$.trim()||q,onClick:Wt,children:q?"...":"Add"}),s.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{R(!1),F("")},children:"Cancel"})]}):s.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"})]})]}),s.jsxs("div",{className:"page-header-right",children:[s.jsx("p",{className:"text-sm text-zinc-500",children:l.dateRangeLabel}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(pe,{type:"button",variant:"outline",size:"icon",onClick:Me,"aria-label":"Export project as YAML",children:s.jsx(Ov,{className:"h-4 w-4 text-zinc-400"})}),s.jsx(pe,{type:"button",variant:"outline",size:"icon",onClick:()=>d(!0),"aria-label":"Delete project",children:s.jsx(p4,{className:"h-4 w-4 text-zinc-400"})}),s.jsx(pe,{type:"button",disabled:V.isPending||ce,onClick:Z,children:V.isPending?"Starting…":ce?"Sweep running…":"Run now"})]})]})]}),s.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:_n.map(ve=>s.jsx(Et,{to:ve.href,className:`project-subnav-link ${ve.key===e?"project-subnav-link-active":""}`,"aria-current":ve.key===e?"page":void 0,children:ve.label},ve.key))}),e==="overview"?s.jsxs(s.Fragment,{children:[s.jsxs("section",{className:"gauge-row",children:[s.jsx(Ug,{value:l.visibilitySummary.value,label:l.visibilitySummary.label,delta:l.visibilitySummary.delta,tone:l.visibilitySummary.tone,description:l.visibilitySummary.description,tooltip:l.visibilitySummary.tooltip,isNumeric:en(l.visibilitySummary.value),progress:l.visibilitySummary.progress,providerCoverage:l.visibilitySummary.providerCoverage}),s.jsxs("div",{className:"metric-card",children:[s.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Queries",s.jsx(mr,{text:"Tracked queries where competitors are cited in the latest completed visibility run but your domain is not."})]}),s.jsxs("p",{className:"metric-card-big-value",children:[s.jsx("span",{className:"text-zinc-50",children:l.gapQueries.value}),s.jsxs("span",{className:"text-zinc-600",children:[" / ",l.queryCounts.total]})]}),s.jsx("div",{className:"metric-card-bar",children:s.jsx("div",{className:`metric-card-bar-fill progress-fill-${l.gapQueries.tone}`,style:{width:l.gapQueries.progress!==void 0?`${Math.min(Math.max(l.gapQueries.progress,0),100)}%`:"0%"}})}),s.jsx("p",{className:"metric-card-detail",children:l.gapQueries.delta}),s.jsx("p",{className:"metric-card-sub",children:l.gapQueries.description})]}),s.jsxs("div",{className:"metric-card",children:[s.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",s.jsx(mr,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),s.jsxs("p",{className:"metric-card-big-value",children:[s.jsx("span",{className:"text-zinc-50",children:l.indexCoverage.value}),s.jsx("span",{className:"text-zinc-600",children:"%"})]}),s.jsx("div",{className:"metric-card-bar",children:s.jsx("div",{className:`metric-card-bar-fill progress-fill-${l.indexCoverage.tone}`,style:{width:`${Number.parseInt(l.indexCoverage.value,10)||0}%`}})}),s.jsx("p",{className:"metric-card-detail",children:l.indexCoverage.delta}),s.jsx("p",{className:"metric-card-sub",children:l.indexCoverage.description})]}),s.jsxs("div",{className:"metric-card",children:[s.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",s.jsx(mr,{text:"Query-level citation changes compared to the previous completed run."})]}),l.movementSummary.hasPreviousRun?s.jsxs("div",{className:"metric-card-movement",children:[s.jsxs("span",{className:l.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",l.movementSummary.gained," gained"]}),s.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),s.jsxs("span",{className:l.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",l.movementSummary.lost," lost"]})]}):s.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),s.jsx("p",{className:"metric-card-sub mt-auto",children:l.movementSummary.gained===0&&l.movementSummary.lost===0&&l.movementSummary.hasPreviousRun?"No changes since last run":l.movementSummary.gained>l.movementSummary.lost?"Visibility improving":l.movementSummary.lost>l.movementSummary.gained?"Visibility declining":""})]})]}),s.jsx(d_e,{projectName:l.project.name}),l.providerScores.length>1&&s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),s.jsxs("h2",{children:["Visibility by model ",s.jsx(mr,{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."})]})]})}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Model"}),s.jsx("th",{children:"Score"}),s.jsx("th",{children:"Cited queries"})]})}),s.jsx("tbody",{children:l.providerScores.map(ve=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[s.jsx(Xl,{provider:ve.provider}),ve.model&&s.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:ve.model})]})}),s.jsx("td",{children:s.jsxs("span",{className:`font-semibold ${ve.score>=70?"text-emerald-400":ve.score>=40?"text-amber-400":"text-rose-400"}`,children:[ve.score,"%"]})}),s.jsxs("td",{className:"text-zinc-500",children:[ve.cited," of ",ve.total]})]},`${ve.provider}::${ve.model??"unknown"}`))})]})})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),s.jsx("h2",{children:"Citation signals"})]})}),s.jsx(V_e,{insights:l.insights})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),s.jsx("h2",{children:"Query citation tracking"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("p",{className:"supporting-copy",children:[new Set(l.visibilityEvidence.map(ve=>ve.query)).size," queries tracked"]}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!m),children:m?"Cancel":"+ Add queries"})]})]}),m&&s.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[s.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:ve=>w(ve.target.value)}),s.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[s.jsxs("p",{className:"text-xs text-zinc-500",children:[v.split(`
|
|
294
|
-
`).filter(ve=>ve.trim()).length," queries"]}),s.jsx(pe,{type:"button",size:"sm",disabled:!v.trim()||b,onClick:lt,children:b?"Adding...":"Add queries"})]})]}),l.project.locations&&l.project.locations.length>0&&s.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[s.jsx("button",{className:`filter-chip ${K===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":K===void 0,onClick:()=>{X(void 0)},children:"All locations"}),l.project.locations.map(ve=>s.jsx("button",{className:`filter-chip ${K===ve.label?"filter-chip-active":""}`,type:"button","aria-pressed":K===ve.label,onClick:()=>{X(ve.label),H(!1)},children:ve.label},ve.label)),ze&&s.jsx("button",{className:`filter-chip ${K===""?"filter-chip-active":""}`,type:"button","aria-pressed":K==="",onClick:()=>{X(""),H(!1)},children:"No location"}),te.length>1&&K===void 0&&s.jsx("button",{className:`filter-chip filter-chip-compare ${Q?"filter-chip-active":""}`,type:"button","aria-pressed":Q,onClick:()=>H(ve=>!ve),title:"Side-by-side location comparison",children:"Compare"})]}),s.jsx(jfe,{evidence:Ee,compareLocations:Q})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),s.jsx("h2",{children:"Competitive landscape"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("p",{className:"supporting-copy",children:[l.competitors.length," tracked"]}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>E(!k),children:k?"Cancel":"+ Add competitor"})]})]}),k&&s.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[s.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:O,onChange:ve=>C(ve.target.value),onKeyDown:ve=>ve.key==="Enter"&&Te()}),s.jsx(pe,{type:"button",size:"sm",disabled:!O.trim()||z,onClick:Te,children:z?"Adding...":"Add"})]}),s.jsx(Nfe,{competitors:l.competitors})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),s.jsx("h2",{children:"Recent execution history"})]})}),s.jsx("div",{className:"run-list",children:l.recentRuns.map(ve=>s.jsx(GB,{run:ve},ve.id))})]}),s.jsx(B_e,{project:{...l.project,displayName:l.project.displayName??l.project.name,defaultLocation:l.project.defaultLocation??null},onUpdateProject:on,onRefresh:()=>{a()}}),s.jsx(q_e,{projectName:l.project.name}),s.jsx(H_e,{projectName:l.project.name})]}):e==="report"?s.jsx(N_e,{projectName:l.project.name}):e==="discovery"?s.jsx(v_e,{projectName:U}):e==="activity"?s.jsx(FOe,{projectName:l.project.name}):e==="inbound"?s.jsx(u_e,{projectName:l.project.name}):s.jsx(G_e,{projectName:l.project.name})]})}function Q_e(){const{dashboard:e,isLoading:t}=mc(),n=e_e();if(!e||t)return s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-20"}),s.jsx("div",{className:"skeleton-text-sm w-72"})]}),s.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(d=>s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1 space-y-1.5",children:[s.jsx("div",{className:"skeleton-text w-40"}),s.jsx("div",{className:"skeleton-text-sm w-56"})]}),s.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},d))})]});const r=e.runs,[i,a]=x.useState("all"),l=i==="all"?r:r.filter(d=>d.status===i),c=async()=>{try{await n.mutateAsync(void 0)}catch{}};return s.jsxs("div",{className:"page-container",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Runs"}),s.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{c()},children:n.isPending?"Queueing…":"Run all projects"})]}),s.jsxs("section",{children:[s.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(d=>s.jsx("button",{className:`filter-chip ${i===d?"filter-chip-active":""}`,type:"button","aria-pressed":i===d,onClick:()=>a(d),children:d==="all"?"All runs":Dv(d)},d))}),s.jsx("div",{className:"run-list",children:l.length>0?l.map(d=>s.jsx(GB,{run:d},d.id)):s.jsxs(Pe,{className:"surface-card empty-card",children:[s.jsx("h2",{children:"No runs match this filter"}),s.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function W_e({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[a,l]=x.useState(""),[c,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,w]=x.useState(""),[b,j]=x.useState(""),[k,E]=x.useState(!1),[O,C]=x.useState(null),[z,A]=x.useState(!1),_=i?c.trim().length>0:a.trim().length>0;async function R(){if(_){E(!0),C(null),A(!1);try{const F=Q=>{const H=parseInt(Q.trim(),10);return Number.isFinite(H)&&H>0?H:void 0},q={},B=F(m);B!==void 0&&(q.maxConcurrency=B);const K=F(v);K!==void 0&&(q.maxRequestsPerMinute=K);const X=F(b);X!==void 0&&(q.maxRequestsPerDay=X),await RV(e.toLowerCase(),{...a.trim()?{apiKey:a.trim()}:{},...c.trim()?{baseUrl:c.trim()}:{},...f.trim()?{model:f.trim()}:{},...Object.keys(q).length>0?{quota:q}:{}}),l(""),d(""),p(""),y(""),w(""),j(""),A(!0),dt({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(F){C(F instanceof Error?F.message:"Failed to update provider")}finally{E(!1)}}}const $=n??"Use default model";return s.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[i&&s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),s.jsx("input",{id:`base-url-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"http://localhost:11434/v1",value:c,onChange:F=>d(F.target.value)}),s.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",i?" (optional)":""]}),t&&s.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 ","↗"]})]}),s.jsx("input",{id:`api-key-${e}`,type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:i?"Optional — most local servers don't need one":`Enter ${e} API key`,value:a,onChange:F=>l(F.target.value)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),s.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)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),s.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[s.jsxs("div",{children:[s.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)}),s.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),s.jsxs("div",{children:[s.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)}),s.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),s.jsxs("div",{children:[s.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)}),s.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),O&&s.jsx("p",{className:"text-xs text-rose-400",children:O}),z&&s.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),s.jsx(pe,{type:"button",size:"sm",disabled:!_||k,onClick:R,children:k?"Saving...":"Save"})]})}function Y_e({onSaved:e}){const[t,n]=x.useState(""),[r,i]=x.useState(""),[a,l]=x.useState(!1),[c,d]=x.useState(null),[f,p]=x.useState(!1),m=t.trim().length>0&&r.trim().length>0;async function y(){if(m){l(!0),d(null),p(!1);try{await DV({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),p(!0),dt({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),e()}catch(v){d(v instanceof Error?v.message:"Failed to update Google OAuth credentials")}finally{l(!1)}}}return s.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),s.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 ","↗"]})]}),s.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)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),s.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)})]}),s.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",s.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),c&&s.jsx("p",{className:"text-xs text-rose-400",children:c}),f&&s.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),s.jsx(pe,{type:"button",size:"sm",disabled:!m||a,onClick:y,children:a?"Saving...":"Save Google OAuth app"})]})}function Z_e(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState(!1),[l,c]=x.useState("localhost"),[d,f]=x.useState("9222"),[p,m]=x.useState(!1);return x.useEffect(()=>{I2().then(t).catch(y=>{const v=y instanceof Error?y.message:String(y);v.includes("501")||r(v)})},[]),s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),s.jsx("h2",{children:"ChatGPT (CDP)"})]}),s.jsx(tt,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),s.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&s.jsxs("div",{children:[s.jsx("dt",{children:"Endpoint"}),s.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&s.jsxs("div",{children:[s.jsx("dt",{children:"Browser"}),s.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&s.jsxs("div",{children:[s.jsx("dt",{children:"Tabs"}),s.jsx("dd",{children:e.targets.map(y=>s.jsxs("span",{className:"mr-2",children:[y.name,": ",y.alive?"● alive":"○ idle"]},y.name))})]})]}),s.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"}),s.jsx("div",{className:"mt-2",children:s.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!i),children:i?"Cancel":e?.connected?"Update endpoint":"Configure"})}),i&&s.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async y=>{y.preventDefault(),m(!0);try{await cQ(l,parseInt(d,10)||9222);const v=await I2().catch(()=>null);v&&t(v),a(!1),dt({title:"CDP endpoint saved",detail:`${l}:${parseInt(d,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}catch(v){r(v instanceof Error?v.message:String(v))}finally{m(!1)}},children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"localhost",value:l,onChange:y=>c(y.target.value),"aria-label":"CDP host"}),s.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"})]}),s.jsx("div",{children:s.jsx(pe,{type:"submit",size:"sm",disabled:p,children:p?"Saving…":"Save endpoint"})})]})]})}const X_e={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function J_e(){const e=Zh(),{dashboard:t}=mc(),n=t?.settings??e?.dashboard?.settings,a=Gv(!e,e?.health).data??e?.health??X_e,[l,c]=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,O]=x.useState(!1);return n?s.jsxs("div",{className:"page-container",children:[s.jsx("div",{className:"page-header",children:s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Settings"}),s.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),s.jsxs("section",{className:"settings-grid",children:[n.providerStatuses.map(C=>s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),s.jsx("h2",{children:C.displayName??C.name})]}),s.jsx(tt,{tone:C.state==="ready"?"positive":"caution",children:C.state==="ready"?"Ready":"Needs config"})]}),s.jsxs("dl",{className:"definition-list mt-3",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Model"}),s.jsx("dd",{className:"font-mono text-xs",children:C.model})]}),C.quota&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Concurrency"}),s.jsx("dd",{children:C.quota.maxConcurrency})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Rate limit"}),s.jsxs("dd",{children:[C.quota.maxRequestsPerMinute,"/min · ",C.quota.maxRequestsPerDay,"/day"]})]})]})]}),s.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:C.detail}),s.jsx("div",{className:"mt-2",children:s.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>c(l===C.name?null:C.name),children:l===C.name?"Cancel":C.state==="ready"?C.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),l===C.name&&s.jsx(W_e,{providerName:C.name,keyUrl:C.keyUrl,modelHint:C.modelHint,onSaved:()=>{c(null)}})]},C.name)),s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),s.jsx("h2",{children:"Search Console OAuth"})]}),s.jsx(tt,{tone:n.google.state==="ready"?"positive":"caution",children:n.google.state==="ready"?"Ready":"Needs config"})]}),s.jsxs("dl",{className:"definition-list mt-3",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Auth model"}),s.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Storage"}),s.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),s.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.google.detail}),s.jsx("div",{className:"mt-2",children:s.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>f(!d),children:d?"Cancel":n.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),d&&s.jsx(Y_e,{onSaved:()=>{f(!1)}})]}),s.jsxs(Pe,{className:"surface-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),s.jsx("h2",{children:"Webmaster Tools"})]}),s.jsx(tt,{tone:n.bing.state==="ready"?"positive":"caution",children:n.bing.state==="ready"?"Ready":"Needs config"})]}),s.jsxs("dl",{className:"definition-list mt-3",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Auth model"}),s.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Storage"}),s.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),s.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.bing.detail}),s.jsx("div",{className:"mt-2",children:s.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":n.bing.state==="ready"?"Update API key":"Configure Bing"})}),p&&s.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),s.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"})]}),s.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:C=>v(C.target.value)})]}),s.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",s.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),j&&s.jsx("p",{className:"text-xs text-rose-400",children:j}),E&&s.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),s.jsx(pe,{type:"button",size:"sm",disabled:!y.trim()||w,onClick:async()=>{if(y.trim()){b(!0),k(null),O(!1);try{await gQ(y.trim()),v(""),O(!0),m(!1),dt({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(C){k(C instanceof Error?C.message:"Failed to update Bing API key")}finally{b(!1)}}},children:w?"Saving...":"Save Bing API key"})]})]}),s.jsx(Z_e,{}),s.jsxs(Pe,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),s.jsx("h2",{children:"API and worker"})]})}),s.jsxs("div",{className:"compact-stack",children:[s.jsxs("div",{className:"health-row",children:[s.jsxs("div",{children:[s.jsx("p",{className:"run-row-title",children:"API"}),s.jsx("p",{className:"supporting-copy",children:a.apiStatus.detail})]}),s.jsx(tt,{tone:dy(a.apiStatus),title:Bo(a.apiStatus),children:a.apiStatus.state==="ok"?"Healthy":"Attention"})]}),s.jsxs("div",{className:"health-row",children:[s.jsxs("div",{children:[s.jsx("p",{className:"run-row-title",children:"Worker"}),s.jsx("p",{className:"supporting-copy",children:a.workerStatus.detail})]}),s.jsx(tt,{tone:dy(a.workerStatus),title:Bo(a.workerStatus),children:a.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),s.jsx("section",{className:"page-section",children:s.jsxs(Pe,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),s.jsx("h2",{children:"Operational guidance"})]})}),s.jsx("ul",{className:"detail-list",children:n.selfHostNotes.map(C=>s.jsx("li",{children:C},C))}),s.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const eze=[{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 tze({current:e,labels:t}){return s.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((n,r)=>{const i=r<e,a=r===e;return s.jsxs("div",{className:`setup-step ${i?"setup-step-done":""} ${a?"setup-step-active":""}`,role:"listitem","aria-current":a?"step":void 0,children:[s.jsx("span",{className:"setup-step-number",children:i?"✓":r+1}),s.jsx("span",{className:"setup-step-label",children:n.label})]},n.label)})})}function nze(){const e=Zh(),{dashboard:t,isLoading:n,refetch:r}=mc(),i=t??e?.dashboard;if(!i||n)return s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-24"}),s.jsx("div",{className:"skeleton-text-sm w-80"})]}),s.jsxs("div",{className:"page-skeleton-card",children:[s.jsx("div",{className:"skeleton-text w-32"}),s.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(Ce=>s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-1 flex-1",children:[s.jsx("div",{className:"skeleton-text w-24"}),s.jsx("div",{className:"skeleton-text-sm w-48"})]}),s.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},Ce))})]})]});const a=i.settings,d=Gv(!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=Dne(i.setup,d,a),p=Ko(),[m,y]=x.useState(0),[v,w]=x.useState(""),[b,j]=x.useState(""),[k,E]=x.useState(""),[O,C]=x.useState("US"),[z,A]=x.useState("en"),[_,R]=x.useState(!1),[$,F]=x.useState(null),[q,B]=x.useState(null),[K,X]=x.useState(null),[Q,H]=x.useState(!1),[J,de]=x.useState(""),[be,M]=x.useState(!1),[D,U]=x.useState(null),[I,V]=x.useState(!1),ce=a.providerStatuses.filter(Ce=>Ce.state==="ready"),[re,ke]=x.useState(ce[0]?.name??""),[ze,te]=x.useState(5),[fe,Ee]=x.useState(!1),[Z,Ge]=x.useState(null),[Me,lt]=x.useState(""),[Te,Wt]=x.useState(!1),[Ht,on]=x.useState(null),[en,_n]=x.useState(!1),[ve,ft]=x.useState(!1),[Ye,rt]=x.useState(!1),ae=b9(),Se=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),$e=J.split(`
|
|
295
|
-
`).map(Ce=>Ce.trim()).filter(Boolean),Ze=Me.split(`
|
|
296
|
-
`).map(Ce=>Ce.trim()).filter(Boolean),Xe=f.healthChecks.some(Ce=>Ce.id==="api"&&Ce.state==="ready"),Bn=async()=>{if(!(!Se||!k)){H(!0),X(null);try{const Ce=await Ev(Se,{displayName:b||v,canonicalDomain:k,country:O,language:z,autoExtractBacklinks:_});F(Se),B(Ce.id),dt({title:"Project created",detail:`${Ce.displayName||Ce.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${Ce.name}`,dedupeMode:"drop"}),r(),y(2)}catch(Ce){X(Ce instanceof Error?Ce.message:"Failed to create project")}finally{H(!1)}}},fn=async()=>{if(!$)return;const Ce=$e;if(Ce.length!==0){V(!0),U(null);try{await jV($,Ce),M(!0),r(),y(3)}catch(rr){U(rr instanceof Error?rr.message:"Failed to save queries")}finally{V(!1)}}},jn=async()=>{if(!(!$||!re)){Ee(!0),Ge(null);try{const Ce=await qV($,re,ze);if(Ce.queries.length>0){const rr=J?J.trimEnd()+`
|
|
297
|
-
`+Ce.queries.join(`
|
|
298
|
-
`):Ce.queries.join(`
|
|
299
|
-
`);de(rr)}}catch(Ce){Ge(Ce instanceof Error?Ce.message:"Failed to generate queries")}finally{Ee(!1)}}},Kt=async()=>{if(!$)return;const Ce=Ze;if(Ce.length!==0){_n(!0),on(null);try{await Z5($,Ce),Wt(!0),r(),y(4)}catch(rr){on(rr instanceof Error?rr.message:"Failed to save competitors")}finally{_n(!1)}}},zn=async()=>{if($){rt(!0);try{await ae.mutateAsync({projectName:$,projectLabel:b||v||$,sourceAction:"setup-launch"}),ft(!0),r()}catch{}finally{rt(!1)}}},pt=()=>y(Ce=>Math.max(0,Ce-1)),br=(()=>{switch(m){case 0:return s.jsxs(Pe,{className:"surface-card step-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),s.jsx("h2",{children:"System ready"})]})}),s.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),s.jsx("div",{className:"compact-stack",children:f.healthChecks.map(Ce=>s.jsxs("div",{className:"health-check-row",children:[s.jsxs("div",{children:[s.jsx("p",{className:"run-row-title",children:Ce.label}),s.jsx("p",{className:"supporting-copy",children:Ce.detail}),Ce.id==="provider"&&Ce.state!=="ready"&&s.jsx(Et,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),s.jsx(tt,{tone:Ce.state==="ready"?"positive":"caution",title:Ce.id==="api"?Bo(d.apiStatus):Ce.id==="worker"?Bo(d.workerStatus):Ce.detail,children:Ce.state==="ready"?"Ready":"Attention"})]},Ce.id))}),s.jsxs("div",{className:"setup-nav",children:[s.jsx("span",{}),s.jsx(pe,{type:"button",disabled:!Xe,onClick:()=>y(1),children:"Continue"})]})]});case 1:return s.jsxs(Pe,{className:"surface-card step-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),s.jsx("h2",{children:"Create project"})]}),$?s.jsx(tt,{tone:"positive",children:"Created"}):null]}),$?s.jsxs("div",{className:"compact-stack",children:[s.jsxs("p",{className:"text-zinc-300",children:["Project ",s.jsx("span",{className:"text-zinc-100 font-medium",children:$})," created successfully."]}),s.jsxs("div",{className:"setup-nav",children:[s.jsx(pe,{type:"button",variant:"outline",onClick:pt,children:"Back"}),s.jsx(pe,{type:"button",onClick:()=>y(2),children:"Continue"})]})]}):s.jsxs("div",{className:"compact-stack",children:[s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),s.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:v,onChange:Ce=>w(Ce.target.value)}),Se&&Se!==v?s.jsxs("p",{className:"supporting-copy",children:["Slug: ",Se]}):null]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),s.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:b,onChange:Ce=>j(Ce.target.value)})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),s.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:k,onChange:Ce=>E(Ce.target.value)})]}),s.jsxs("div",{className:"setup-field-row",children:[s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),s.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:O,onChange:Ce=>C(Ce.target.value.toUpperCase())})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),s.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:z,onChange:Ce=>A(Ce.target.value.toLowerCase())})]})]}),s.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:[s.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-zinc-700 bg-zinc-950",checked:_,onChange:Ce=>R(Ce.target.checked)}),s.jsxs("span",{className:"flex-1",children:[s.jsx("span",{className:"block text-sm text-zinc-100",children:"Auto-extract backlinks"}),s.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."," ",s.jsx(Et,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),K?s.jsx("p",{className:"text-rose-400 text-sm",children:K}):null,s.jsxs("div",{className:"setup-nav",children:[s.jsx(pe,{type:"button",variant:"outline",onClick:pt,children:"Back"}),s.jsx(pe,{type:"button",disabled:!Se||!k||Q,onClick:Bn,children:Q?"Creating...":"Create project"})]})]})]});case 2:return s.jsxs(Pe,{className:"surface-card step-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),s.jsx("h2",{children:"Add queries"})]}),be?s.jsxs(tt,{tone:"positive",children:[$e.length," saved"]}):s.jsxs(tt,{tone:"neutral",children:[$e.length," quer",$e.length!==1?"ies":"y"]})]}),s.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),be?s.jsxs("div",{className:"compact-stack",children:[s.jsx("ul",{className:"detail-list",children:$e.map(Ce=>s.jsx("li",{children:Ce},Ce))}),s.jsxs("div",{className:"setup-nav",children:[s.jsx(pe,{type:"button",variant:"outline",onClick:pt,children:"Back"}),s.jsx(pe,{type:"button",onClick:()=>y(3),children:"Continue"})]})]}):s.jsxs("div",{className:"compact-stack",children:[ce.length>0?s.jsxs("div",{className:"compact-stack",children:[s.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[s.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",s.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"setup-field flex-1",children:[s.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),s.jsx("select",{id:"gen-provider",className:"setup-input",value:re,onChange:Ce=>ke(Ce.target.value),children:ce.map(Ce=>s.jsxs("option",{value:Ce.name,children:[Ce.displayName??Ce.name,Ce.model?` (${Ce.model})`:""]},Ce.name))})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),s.jsx("select",{id:"gen-count",className:"setup-input",value:ze,onChange:Ce=>te(Number(Ce.target.value)),children:[3,5,10,15,20].map(Ce=>s.jsx("option",{value:Ce,children:Ce},Ce))})]}),s.jsx(pe,{type:"button",variant:"outline",disabled:fe||!re,onClick:jn,children:fe?"Analyzing site...":"Generate"})]}),Z?s.jsx("p",{className:"text-rose-400 text-sm",children:Z}):null]}):null,s.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[s.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",s.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),s.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:Ce=>de(Ce.target.value)})]}),D?s.jsx("p",{className:"text-rose-400 text-sm",children:D}):null,s.jsxs("div",{className:"setup-nav",children:[s.jsx(pe,{type:"button",variant:"outline",onClick:pt,children:"Back"}),s.jsx(pe,{type:"button",disabled:$e.length===0||I,onClick:fn,children:I?"Saving...":`Save ${$e.length} quer${$e.length!==1?"ies":"y"}`})]})]})]});case 3:return s.jsxs(Pe,{className:"surface-card step-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),s.jsx("h2",{children:"Add competitors"})]}),Te?s.jsx(tt,{tone:"positive",children:"Saved"}):null]}),s.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),Te?s.jsxs("div",{className:"compact-stack",children:[s.jsx("ul",{className:"detail-list",children:Ze.map(Ce=>s.jsx("li",{children:Ce},Ce))}),s.jsxs("div",{className:"setup-nav",children:[s.jsx(pe,{type:"button",variant:"outline",onClick:pt,children:"Back"}),s.jsx(pe,{type:"button",onClick:()=>y(4),children:"Continue"})]})]}):s.jsxs("div",{className:"compact-stack",children:[s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),s.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
|
|
302
|
-
competitor2.com`,value:Me,onChange:Ce=>lt(Ce.target.value)})]}),Ht?s.jsx("p",{className:"text-rose-400 text-sm",children:Ht}):null,s.jsxs("div",{className:"setup-nav",children:[s.jsx(pe,{type:"button",variant:"outline",onClick:pt,children:"Back"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(pe,{type:"button",variant:"outline",onClick:()=>y(4),children:"Skip"}),s.jsx(pe,{type:"button",disabled:Ze.length===0||en,onClick:Kt,children:en?"Saving...":`Save ${Ze.length} competitor${Ze.length!==1?"s":""}`})]})]})]})]});case 4:return s.jsxs(Pe,{className:"surface-card step-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),s.jsx("h2",{children:"Launch first run"})]}),ve?s.jsx(tt,{tone:"positive",children:"Queued"}):null]}),ve?s.jsxs("div",{className:"compact-stack",children:[s.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),s.jsxs("div",{className:"setup-nav",children:[s.jsx("span",{}),s.jsx(pe,{type:"button",onClick:()=>p({to:q?`/projects/${q}`:"/"}),children:"Open project"})]})]}):s.jsxs("div",{className:"compact-stack",children:[s.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",s.jsx("span",{className:"text-zinc-100 font-medium",children:$}),"."]}),s.jsxs("div",{className:"setup-nav",children:[s.jsx(pe,{type:"button",variant:"outline",onClick:pt,children:"Back"}),s.jsx(pe,{type:"button",disabled:Ye,onClick:zn,children:Ye?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return s.jsxs("div",{className:"page-container",children:[s.jsx("div",{className:"page-header",children:s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Setup"}),s.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),s.jsx(tze,{current:m,labels:eze}),s.jsx("section",{className:"setup-wizard",children:br})]})}function ku({children:e,label:t="More info",placement:n="top",className:r}){const i=x.useId(),[a,l]=x.useState(!1);return s.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[s.jsx("button",{type:"button","aria-label":t,"aria-describedby":a?i:void 0,className:"inline-flex h-4 w-4 items-center justify-center rounded-full text-zinc-500 hover:text-zinc-200 focus:text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onFocus:()=>l(!0),onBlur:()=>l(!1),children:s.jsx(u4,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&s.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 rze="https://commoncrawl.org/web-graphs";function Hj(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 Ag(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 ize(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState([]),[l,c]=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,O]=x.useState(!1),[C,z]=x.useState(null),[A,_]=x.useState(null),R=x.useCallback(async()=>{m(!0),z(null);try{const[K,X,Q,H,J]=await Promise.all([IQ(),a4().catch(()=>null),LQ().catch(()=>[]),BQ().catch(()=>[]),UQ().catch(()=>null)]);t(K),r(X),a(Q),c(H),f(J)}catch(K){z(K instanceof Error?K.message:"Failed to load backlinks status")}finally{m(!1)}},[]);x.useEffect(()=>{R()},[R]);async function $(){v(!0),z(null),_(null);try{const K=await MQ();_(K.alreadyPresent?`DuckDB already installed (${K.version}).`:`Installed DuckDB ${K.version}.`),await R()}catch(K){z(K instanceof Error?K.message:"Failed to install DuckDB")}finally{v(!1)}}async function F(){const K=j.trim()||void 0;b(!0),z(null),_(null);try{const X=await $Q(K);_(K?`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(""),O(!1),await R()}catch(X){X instanceof yr&&X.code==="MISSING_DEPENDENCY"?z("DuckDB is not installed. Install it first."):z(X instanceof Error?X.message:"Failed to trigger sync")}finally{b(!1)}}async function q(K){z(null),_(null);try{await qQ(K),_(`Pruned cached release ${K}.`),await R()}catch(X){z(X instanceof Error?X.message:"Failed to prune release")}}const B=n?.status==="ready"&&l.every(K=>K.release!==n.release);return s.jsxs("div",{className:"page-container",children:[s.jsx("div",{className:"page-header",children:s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Backlinks"}),s.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."})]})}),s.jsx(Pe,{className:"surface-card p-4 mb-6 border-amber-800/60",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(iy,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{className:"text-sm text-zinc-300 leading-relaxed",children:[s.jsx("p",{className:"font-medium text-amber-200",children:"Heads up — a release sync is a large download."}),s.jsxs("ul",{className:"mt-1.5 space-y-1 text-zinc-400",children:[s.jsxs("li",{children:[s.jsx("span",{className:"text-zinc-200",children:"~16 GB"})," of gzipped vertex + edge files per release, stored at"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),"."]}),s.jsxs("li",{children:[s.jsx("span",{className:"text-zinc-200",children:"10–20 min on a fast connection"})," for the download, then ~5 min for the DuckDB query."]}),s.jsx("li",{children:"One sync covers every project in this workspace. Releases are immutable, so the download only happens once per release."})]})]})]})}),s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"About"}),s.jsx("h2",{children:"How it works"})]})}),s.jsxs(Pe,{className:"surface-card p-5",children:[s.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"," ",s.jsx("span",{className:"text-zinc-200",children:"release"})," at a time and extracts backlinks for every project in this workspace in a single pass."]}),s.jsxs("ol",{className:"space-y-3 text-sm text-zinc-400 max-w-3xl",children:[s.jsxs("li",{className:"flex gap-3",children:[s.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"}),s.jsxs("span",{children:[s.jsx("span",{className:"text-zinc-200 font-medium",children:"Download (one-time, ~16 GB)"})," — vertex + edge files cached to"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),". Runs once per release; subsequent operations reuse the cache."]})]}),s.jsxs("li",{className:"flex gap-3",children:[s.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"}),s.jsxs("span",{children:[s.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 ",s.jsx("span",{className:"text-zinc-200",children:"read"})," these dumps; it doesn’t store any canonry state."]})]}),s.jsxs("li",{className:"flex gap-3",children:[s.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"}),s.jsxs("span",{children:[s.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."]})]})]})]})]}),C&&s.jsx(Pe,{className:"surface-card p-4 mb-4 border-rose-800/60",children:s.jsx("p",{className:"text-sm text-rose-300",children:C})}),A&&s.jsx(Pe,{className:"surface-card p-4 mb-4 border-emerald-800/60",children:s.jsx("p",{className:"text-sm text-emerald-300",children:A})}),s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dependency"}),s.jsxs("h2",{className:"flex items-center gap-2",children:["DuckDB install status",s.jsxs(ku,{label:"Why DuckDB?",children:[s.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."}),s.jsxs("span",{className:"mt-2 block text-zinc-400",children:["It does ",s.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."]}),s.jsxs("span",{className:"mt-2 block text-zinc-500",children:["Installed on demand (not bundled) into ",s.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?s.jsx(tt,{tone:"positive",children:"Installed"}):s.jsx(tt,{tone:"caution",children:"Not installed"})]}),s.jsx(Pe,{className:"surface-card p-5",children:p?s.jsx("p",{className:"text-sm text-zinc-500",children:"Checking…"}):e?.duckdbInstalled?s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(fk,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-sm text-zinc-200",children:["Version ",e.duckdbVersion??"unknown"," installed at"," ",s.jsx("code",{className:"text-zinc-300",children:e.pluginDir})]}),s.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Required spec: ",e.duckdbSpec]})]})]}):s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(gW,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{className:"flex-1",children:[s.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."}),s.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&&s.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Will be installed into ",s.jsx("code",{className:"text-zinc-300",children:e.pluginDir})," (~40 MB)."]}),s.jsx("div",{className:"mt-3",children:s.jsxs(pe,{type:"button",size:"sm",disabled:y,onClick:$,children:[s.jsx(Ov,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),y?"Installing…":"Install DuckDB"]})})]})]})})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Latest sync"}),s.jsxs("h2",{className:"flex items-center gap-2",children:["Release sync",s.jsx(ku,{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&&s.jsx(tt,{tone:Kj(n.status),children:n.status})]}),s.jsxs(Pe,{className:"surface-card p-5",children:[s.jsxs("p",{className:"text-xs text-zinc-500 max-w-3xl mb-4",children:["A release is one Common Crawl dump (e.g. ",s.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?s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("p",{className:"text-zinc-200",children:["Release ",s.jsx("code",{className:"text-zinc-300",children:n.release})]}),n.phaseDetail&&s.jsx("p",{className:"text-zinc-500",children:n.phaseDetail}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-xs text-zinc-500 pt-2",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Projects"}),s.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.projectsProcessed??"—"})]}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-zinc-600 uppercase tracking-wide flex items-center gap-1",children:["Rows",s.jsx(ku,{label:"What are rows?",children:"Total number of (project, referring domain) pairs persisted in SQLite from this sync, across every project in the workspace."})]}),s.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.domainsDiscovered??"—"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Started"}),s.jsx("p",{className:"text-zinc-300 mt-0.5",children:Ag(n.downloadStartedAt??n.createdAt)})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Finished"}),s.jsx("p",{className:"text-zinc-300 mt-0.5",children:Ag(n.queryFinishedAt)})]})]}),n.error&&s.jsx("p",{className:"text-sm text-rose-400 pt-2",children:n.error})]}):s.jsx("p",{className:"text-sm text-zinc-500",children:"No release sync has run in this workspace yet."}),B&&s.jsx("div",{className:"mt-4 rounded border border-amber-800/60 bg-amber-950/20 p-3",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(iy,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{className:"text-xs text-zinc-300 leading-relaxed",children:[s.jsx("p",{className:"font-medium text-amber-200",children:"Cached files for this release are missing."}),s.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"," ",s.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."]})]})]})}),s.jsxs("div",{className:"mt-4 rounded border border-zinc-800 bg-zinc-900/40 p-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Auto-detected release"}),d?s.jsxs("p",{className:"text-sm text-zinc-200 mt-0.5",children:[s.jsx("code",{className:"text-zinc-100",children:d.release}),s.jsxs("span",{className:"ml-2 text-xs text-zinc-500",children:["— vertex ",Hj(d.vertexBytes),", edges ",Hj(d.edgesBytes)]})]}):s.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."}),s.jsxs("a",{href:rze,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",s.jsx(jW,{className:"h-3 w-3","aria-hidden":!0})]})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(pe,{type:"button",size:"sm",disabled:w||!e?.duckdbInstalled||!d&&!j.trim(),onClick:F,children:[s.jsx(wh,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),w?"Queuing…":"Run sync"]}),s.jsxs(ku,{label:"What does Run sync do?",children:[s.jsxs("span",{className:"block",children:["Downloads the auto-detected (or chosen) Common Crawl release (~16 GB) to"," ",s.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."]}),s.jsxs("span",{className:"mt-2 block text-zinc-400",children:["First time for a release: ",s.jsx("span",{className:"text-zinc-200",children:"~10–20 min download + ~5 min query"}),". Re-running the same release later: ",s.jsx("span",{className:"text-zinc-200",children:"skips download, just re-queries"})," (~5 min)."]})]})]})]}),E?s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.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:K=>k(K.target.value),disabled:w,autoFocus:!0}),s.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(""),O(!1)},disabled:w,children:"Cancel"})]}):s.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:()=>O(!0),disabled:w,children:"Use a different release →"})]}),!e?.duckdbInstalled&&s.jsx("p",{className:"text-xs text-zinc-600 mt-2",children:"Install DuckDB first to enable sync."})]})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Cached releases"}),s.jsxs("h2",{className:"flex items-center gap-2",children:["Local disk cache",s.jsxs(ku,{label:"What is this?",children:[s.jsxs("span",{className:"block",children:["Raw Common Crawl dumps stored at"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/<release>/"}),". Each release takes ~16 GB."]}),s.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 ",s.jsx("span",{className:"text-zinc-200",children:"does not delete your backlink data"})," — that lives in SQLite."]})]})]})]})}),s.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."}),s.jsx(Pe,{className:"surface-card overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[s.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"Sync status"}),s.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Size"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"Last used"}),s.jsx("th",{className:"px-4 py-2 font-medium sr-only",children:"Actions"})]})}),s.jsxs("tbody",{children:[l.map(K=>s.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[s.jsx("td",{className:"px-4 py-2 text-zinc-200",children:s.jsx("code",{children:K.release})}),s.jsx("td",{className:"px-4 py-2",children:K.syncStatus?s.jsx(tt,{tone:Kj(K.syncStatus),children:K.syncStatus}):s.jsx("span",{className:"text-zinc-600",children:"—"})}),s.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:Hj(K.bytes)}),s.jsx("td",{className:"px-4 py-2 text-zinc-400",children:Ag(K.lastUsedAt)}),s.jsx("td",{className:"px-4 py-2 text-right",children:s.jsxs("div",{className:"inline-flex items-center gap-1",children:[s.jsxs(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>q(K.release),children:[s.jsx(p4,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),"Prune"]}),s.jsx(ku,{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)."})]})})]},K.release)),l.length===0&&s.jsx("tr",{children:s.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&&s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),s.jsx("h2",{children:"Past release syncs"})]})}),s.jsx(Pe,{className:"surface-card overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[s.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"Status"}),s.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Projects"}),s.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Rows"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"Finished"})]})}),s.jsx("tbody",{children:i.map(K=>s.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[s.jsx("td",{className:"px-4 py-2 text-zinc-200",children:s.jsx("code",{children:K.release})}),s.jsx("td",{className:"px-4 py-2",children:s.jsx(tt,{tone:Kj(K.status),children:K.status})}),s.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:K.projectsProcessed??"—"}),s.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:K.domainsDiscovered??"—"}),s.jsx("td",{className:"px-4 py-2 text-zinc-400",children:Ag(K.queryFinishedAt??K.updatedAt)})]},K.id))})]})})]})]})}function aze({open:e,onOpenChange:t,projectName:n}){const[r,i]=x.useState(""),[a,l]=x.useState(""),[c,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,w]=x.useState(null),[b,j]=x.useState(null),k=IOe(n||null),E=()=>{i(""),l(""),d(""),p(""),y(""),w(null),j(null)},O=async z=>{if(z.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:c.trim()||void 0,displayName:f.trim()||void 0,keyJson:m.trim()});y(""),j(`Connected ${A.displayName}.`)}catch(A){const _=A instanceof yr||A instanceof Error?A.message:String(A);w(_)}},C=async z=>{if(!z)return;const A=await z.text();y(A)};return s.jsx(Bk,{open:e,onOpenChange:z=>{t(z),z||E()},children:s.jsxs(qv,{children:[s.jsxs(Uk,{children:[s.jsx(Fv,{children:"Connect Cloud Run traffic source"}),s.jsxs(Hv,{children:["v1 supports service-account JSON only. The private key is stored in ",s.jsx("code",{children:"~/.canonry/config.yaml"})," on the server and never echoed back to the dashboard."]})]}),s.jsxs("form",{onSubmit:O,className:"mt-6 flex flex-col gap-5 overflow-y-auto pr-1",children:[s.jsx(Cu,{label:"Project",description:"Canonry project this source attaches to.",children:s.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"})}),s.jsx(Cu,{label:"GCP project ID",description:"The Google Cloud project hosting the Cloud Run service (e.g. my-prod-foo).",required:!0,children:s.jsx("input",{type:"text",value:r,onChange:z=>i(z.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"})}),s.jsx(Cu,{label:"Service name (optional)",description:"Restrict log pulls to a specific Cloud Run service. Omit to pull all services in the project.",children:s.jsx("input",{type:"text",value:a,onChange:z=>l(z.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"})}),s.jsx(Cu,{label:"Location (optional)",description:"Region of the Cloud Run service (e.g. us-central1). Helpful when multiple regions emit logs.",children:s.jsx("input",{type:"text",value:c,onChange:z=>d(z.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"})}),s.jsx(Cu,{label:"Display name (optional)",description:"Friendly label shown in the dashboard. Defaults to the project + service combo.",children:s.jsx("input",{type:"text",value:f,onChange:z=>p(z.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"})}),s.jsxs(Cu,{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:[s.jsx("textarea",{value:m,onChange:z=>y(z.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}),s.jsxs("label",{className:"mt-2 inline-flex cursor-pointer items-center gap-2 text-xs text-zinc-400 hover:text-zinc-200",children:[s.jsx("input",{type:"file",accept:"application/json,.json",className:"hidden",onChange:z=>{C(z.target.files?.[0]??null)}}),s.jsx("span",{className:"rounded-md border border-zinc-800 px-2 py-1",children:"Or upload a key file"})]})]}),v?s.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?s.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,s.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2 border-t border-zinc-800/60 pt-4",children:[s.jsx(pe,{type:"button",variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Close"}),s.jsx(pe,{type:"submit",disabled:k.isPending,size:"sm",children:k.isPending?"Connecting…":"Connect"})]})]})]})})}function Cu({label:e,description:t,required:n,children:r}){return s.jsxs("label",{className:"flex flex-col gap-1",children:[s.jsxs("span",{className:"text-xs font-medium text-zinc-200",children:[e,n?s.jsx("span",{className:"ml-1 text-rose-400",children:"*"}):null]}),r,s.jsx("span",{className:"text-[11px] text-zinc-500",children:t})]})}function sze({open:e,onOpenChange:t,projectName:n}){const[r,i]=x.useState(""),[a,l]=x.useState(""),[c,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(null),[v,w]=x.useState(null),b=MOe(n||null),j=()=>{i(""),l(""),d(""),p(""),y(null),w(null)},k=async E=>{if(E.preventDefault(),y(null),w(null),!r.trim()){y("WordPress site URL is required.");return}if(!a.trim()){y("Username is required.");return}if(!c.trim()){y("Application Password is required.");return}try{const O=await b.mutateAsync({baseUrl:r.trim(),username:a.trim(),applicationPassword:c.trim(),displayName:f.trim()||void 0});d(""),w(`Connected ${O.displayName}.`)}catch(O){const C=O instanceof yr||O instanceof Error?O.message:String(O);y(C)}};return s.jsx(Bk,{open:e,onOpenChange:E=>{t(E),E||j()},children:s.jsxs(qv,{children:[s.jsxs(Uk,{children:[s.jsx(Fv,{children:"Connect WordPress traffic source"}),s.jsxs(Hv,{children:["Pulls request events from the Canonry Traffic Logger plugin. The Application Password is stored in ",s.jsx("code",{children:"~/.canonry/config.yaml"})," on the server and never echoed back to the dashboard."]})]}),s.jsxs("form",{onSubmit:k,className:"mt-6 flex flex-col gap-5 overflow-y-auto pr-1",children:[s.jsx(Xf,{label:"Project",description:"Canonry project this source attaches to.",children:s.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"})}),s.jsx(Xf,{label:"WordPress site URL",description:"Base URL of the site running the Canonry Traffic Logger plugin.",required:!0,children:s.jsx("input",{type:"url",value:r,onChange:E=>i(E.target.value),required:!0,autoComplete:"url",placeholder:"https://example.com",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"})}),s.jsx(Xf,{label:"Username",description:"WordPress user that owns the Application Password.",required:!0,children:s.jsx("input",{type:"text",value:a,onChange:E=>l(E.target.value),required:!0,autoComplete:"username",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"})}),s.jsx(Xf,{label:"Application Password",description:"Create one in wp-admin under Users -> Profile -> Application Passwords.",required:!0,children:s.jsx("input",{type:"password",value:c,onChange:E=>d(E.target.value),required:!0,autoComplete:"new-password",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"})}),s.jsx(Xf,{label:"Display name (optional)",description:"Friendly label shown in the dashboard. Defaults to the WordPress host.",children:s.jsx("input",{type:"text",value:f,onChange:E=>p(E.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"})}),m?s.jsx("p",{className:"rounded-md border border-rose-800/50 bg-rose-950/30 px-3 py-2 text-xs text-rose-200",children:m}):null,v?s.jsx("p",{className:"rounded-md border border-emerald-800/50 bg-emerald-950/30 px-3 py-2 text-xs text-emerald-200",children:v}):null,s.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2 border-t border-zinc-800/60 pt-4",children:[s.jsx(pe,{type:"button",variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Close"}),s.jsx(pe,{type:"submit",disabled:b.isPending,size:"sm",children:b.isPending?"Connecting...":"Connect"})]})]})]})})}function Xf({label:e,description:t,required:n,children:r}){return s.jsxs("label",{className:"flex flex-col gap-1",children:[s.jsxs("span",{className:"text-xs font-medium text-zinc-200",children:[e,n?s.jsx("span",{className:"ml-1 text-rose-400",children:"*"}):null]}),r,s.jsx("span",{className:"text-[11px] text-zinc-500",children:t})]})}function oze(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 Gj(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function lze(){const[e,t]=x.useState(""),[n,r]=x.useState(!1),[i,a]=x.useState(!1),c=Vn({queryKey:_e.projects.all,queryFn:Av}).data??[],d=x.useMemo(()=>e||(c[0]?.name??""),[e,c]),f=TOe(d||null),p=f.data?.sources??[];return s.jsxs("div",{className:"page-container",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Server traffic"}),s.jsx("p",{className:"page-subtitle",children:"Crawler hits and AI-referral sessions pulled directly from Cloud Run logs or the WordPress Traffic Logger plugin. Independent of GA — useful when you need server-side evidence that GPTBot or ChatGPT-User actually hit a page."})]}),s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s.jsxs(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!0),disabled:!d,children:[s.jsx(Ou,{className:"size-3.5"}),"Connect WordPress"]}),s.jsxs(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),disabled:!d,children:[s.jsx(Ou,{className:"size-3.5"}),"Connect Cloud Run"]})]})]}),s.jsxs("section",{children:[s.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Project picker",children:c.map(m=>s.jsx("button",{type:"button",className:`filter-chip ${d===m.name?"filter-chip-active":""}`,"aria-pressed":d===m.name,onClick:()=>t(m.name),children:m.displayName??m.name},m.id))}),d?f.isLoading?s.jsx(Pe,{className:"p-6 text-center text-sm text-zinc-500",children:"Loading sources…"}):p.length===0?s.jsxs(Pe,{className:"p-8 text-center",children:[s.jsxs("p",{className:"text-sm text-zinc-300",children:["No traffic sources connected for ",d,"."]}),s.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Connect a WordPress site or Cloud Run service to start ingesting crawler hits and AI-referral sessions from server logs."}),s.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-center gap-2",children:[s.jsxs(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!0),children:[s.jsx(Ou,{className:"size-3.5"}),"Connect WordPress"]}),s.jsxs(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),children:[s.jsx(Ou,{className:"size-3.5"}),"Connect Cloud Run"]})]})]}):s.jsx(cze,{projectName:d,sources:p}):s.jsx(Pe,{className:"p-6 text-center text-sm text-zinc-500",children:"No projects yet."})]}),s.jsx(aze,{open:n,onOpenChange:r,projectName:d}),s.jsx(sze,{open:i,onOpenChange:a,projectName:d})]})}function cze({projectName:e,sources:t}){const n=S5({queries:t.map(i=>({queryKey:_e.serverTraffic.sourceDetail(e,i.id),queryFn:()=>i4(e,i.id),staleTime:3e4}))}),r=t.map((i,a)=>({source:i,detail:n[a]?.data,isLoading:n[a]?.isLoading??!1}));return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{className:"bg-zinc-900/50 text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-4 py-2 text-left",children:"Source"}),s.jsx("th",{className:"px-4 py-2 text-left",children:"Status"}),s.jsx("th",{className:"px-4 py-2 text-left",children:"Last sync"}),s.jsx("th",{className:"px-4 py-2 text-right",children:"24h crawler"}),s.jsx("th",{className:"px-4 py-2 text-right",children:"24h AI sessions"}),s.jsx("th",{className:"px-4 py-2 text-right",children:"24h samples"}),s.jsx("th",{className:"px-4 py-2 text-right"})]})}),s.jsx("tbody",{className:"divide-y divide-zinc-800/60",children:r.map(({source:i,detail:a,isLoading:l})=>s.jsxs("tr",{className:"hover:bg-zinc-900/40 transition-colors",children:[s.jsxs("td",{className:"px-4 py-3",children:[s.jsx("div",{className:"font-medium text-zinc-100",children:i.displayName}),s.jsxs("div",{className:"text-[11px] text-zinc-500 font-mono",children:[i.sourceType," · ",i.id.slice(0,8)]})]}),s.jsxs("td",{className:"px-4 py-3",children:[s.jsx(tt,{tone:ZA(i.status),children:i.status}),i.lastError?s.jsx("p",{className:"mt-1 max-w-[18rem] truncate text-[11px] text-rose-400/80",title:i.lastError,children:i.lastError}):null]}),s.jsx("td",{className:"px-4 py-3 text-zinc-300",children:oze(i.lastSyncedAt)}),s.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-100",children:l?"—":Gj(a?.totals24h.crawlerHits??0)}),s.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-100",children:l?"—":Gj(a?.totals24h.aiReferralHits??0)}),s.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-300",children:l?"—":Gj(a?.totals24h.sampleCount??0)}),s.jsx("td",{className:"px-4 py-3 text-right",children:s.jsxs(Et,{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:[s.jsx(Sh,{className:"size-3"}),"View"]})})]},i.id))})]}),s.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!==eh.archived).length," active source",t.length===1?"":"s"," for ",e,". Same shape as ",s.jsxs("code",{className:"text-zinc-400",children:["canonry traffic status ",e," --format json"]}),"."]})]})}function w9(e){return e.kind===Da.crawler?e.botId:e.product}function uze(e){return e.kind===Da.crawler?e.pathNormalized:e.landingPathNormalized}function S9(e,t){if(t==="hour")return e;const n=new Date(e),r=n.getFullYear(),i=String(n.getMonth()+1).padStart(2,"0"),a=String(n.getDate()).padStart(2,"0");return`${r}-${i}-${a}`}function dze(e,t,n){const r=t.pathQuery.trim().toLowerCase();return e.filter(i=>!(t.selectedBucket&&S9(i.tsHour,n)!==t.selectedBucket||t.identity&&w9(i)!==t.identity||t.operator&&i.operator!==t.operator||r&&!uze(i).toLowerCase().includes(r)))}function fze(e,t){if(!e||typeof e!="object")return null;const n=e.activeTooltipIndex;let r;if(typeof n=="number")r=n;else if(typeof n=="string"&&n!=="")r=Number(n);else return null;return!Number.isInteger(r)||r<0||r>=t.length?null:t[r]?.bucket??null}const bv=[{value:60,label:"1h",granularity:"hour",fetchLimit:500},{value:360,label:"6h",granularity:"hour",fetchLimit:500},{value:1440,label:"24h",granularity:"hour",fetchLimit:500},{value:10080,label:"7d",granularity:"hour",fetchLimit:1e3},{value:720*60,label:"30d",granularity:"day",fetchLimit:2e3},{value:2160*60,label:"90d",granularity:"day",fetchLimit:5e3}],e5=bv.find(e=>e.label==="7d")??bv[2],t5=Yu[0],n5=Yu[1];function j9(e){const t=new Date(e);return`${t.getMonth()+1}/${t.getDate()} ${String(t.getHours()).padStart(2,"0")}:00`}function hze(e){const t=new Date(`${e}T00:00:00`);return`${t.getMonth()+1}/${t.getDate()}`}function Eg(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 pze(){const e=Wh({strict:!1}),t=e.projectName??"",n=e.sourceId??"",[r,i]=x.useState(e5.value),[a,l]=x.useState(()=>new Set(["crawler","ai-referral"])),[c,d]=x.useState(null),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,w]=x.useState(""),[b,j]=x.useState(null),[k,E]=x.useState(null),O=x.useMemo(()=>bv.find(D=>D.value===r)??e5,[r]),C=ROe(t||null,n||null),z=DOe(t||null,{kind:"all",sourceId:n||void 0,sinceMinutes:r,limit:O.fetchLimit}),A=LOe(t||null,n||null),_=C.data,R=z.data?.events??[],$=z.data?.totals,F=x.useMemo(()=>R.filter(D=>D.kind===Da.crawler?a.has("crawler"):a.has("ai-referral")),[R,a]),q=x.useMemo(()=>{const D=new Set;for(const U of R)D.add(w9(U));return f&&D.add(f),[...D].sort((U,I)=>U.localeCompare(I))},[R,f]),B=x.useMemo(()=>{const D=new Set;for(const U of R)D.add(U.operator);return m&&D.add(m),[...D].sort((U,I)=>U.localeCompare(I))},[R,m]),K=x.useMemo(()=>dze(F,{selectedBucket:c,identity:f,operator:m,pathQuery:v},O.granularity),[F,c,f,m,v,O.granularity]),X=x.useMemo(()=>c?Vg(c,O.granularity):null,[c,O.granularity]),Q=x.useMemo(()=>mze(R,O.granularity,z.data?.windowStart,z.data?.windowEnd),[R,O.granularity,z.data?.windowStart,z.data?.windowEnd]),H=D=>{l(U=>{const I=new Set(U);return I.has(D)?I.size>1&&I.delete(D):I.add(D),I})},J=D=>{const U=fze(D,Q);U&&d(I=>I===U?null:U)},de=()=>{d(null),p(""),y(""),w("")},be=!!(c||f||m||v.trim()),M=async()=>{j(null),E(null);try{const D=await A.mutateAsync({sinceMinutes:60});E(`Pulled ${D.pulledEvents} entries · ${D.crawlerHits} crawler · ${D.aiReferralHits} AI referral · ${D.unknownHits} unknown`)}catch(D){const U=D instanceof yr||D instanceof Error?D.message:String(D);j(U)}};return!t||!n?s.jsx("div",{className:"page-container",children:s.jsx("p",{className:"text-sm text-zinc-500",children:"Missing project name or source id in URL."})}):C.isLoading?s.jsx("div",{className:"page-container",children:s.jsx("p",{className:"text-sm text-zinc-500",children:"Loading source…"})}):C.isError||!_?s.jsxs("div",{className:"page-container",children:[s.jsx("p",{className:"text-sm text-rose-300",children:"Could not load this source."}),s.jsxs(Et,{to:"/traffic",className:"mt-2 inline-flex items-center gap-1 text-xs text-zinc-400 hover:text-zinc-200",children:[s.jsx(q2,{className:"size-3"})," Back to sources"]})]}):s.jsxs("div",{className:"page-container space-y-8",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsxs(Et,{to:"/traffic",className:"inline-flex items-center gap-1 text-xs text-zinc-500 hover:text-zinc-200",children:[s.jsx(q2,{className:"size-3"})," All sources"]}),s.jsx("h1",{className:"page-title mt-2",children:_.displayName}),s.jsxs("p",{className:"page-subtitle",children:[_.sourceType," · project ",s.jsx("span",{className:"text-zinc-300",children:t})," ·",s.jsx("span",{className:"ml-1 font-mono text-zinc-400",children:_.id})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(tt,{tone:ZA(_.status),children:_.status}),s.jsxs(pe,{type:"button",variant:"outline",size:"sm",disabled:A.isPending,onClick:()=>{M()},children:[s.jsx(Sh,{className:`size-3.5 ${A.isPending?"animate-spin":""}`}),A.isPending?"Syncing…":"Sync now"]})]})]}),b?s.jsx("div",{className:"rounded-md border border-rose-800/50 bg-rose-950/30 px-3 py-2 text-xs text-rose-200",children:b}):null,k?s.jsx("div",{className:"rounded-md border border-emerald-800/50 bg-emerald-950/30 px-3 py-2 text-xs text-emerald-200",children:k}):null,s.jsxs("section",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[s.jsx(Ug,{label:"24h crawler hits",value:String(_.totals24h.crawlerHits),delta:_.lastSyncedAt?`last sync ${Eg(_.lastSyncedAt)}`:"never synced",tone:_.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(_.totals24h.crawlerHits/1e3*100))}),s.jsx(Ug,{label:"24h AI referral sessions",value:String(_.totals24h.aiReferralHits),delta:_.lastSyncedAt?`last sync ${Eg(_.lastSyncedAt)}`:"never synced",tone:_.totals24h.aiReferralHits>0?"positive":"neutral",description:"Sessionized visits arriving from chat.openai.com, perplexity.ai, etc. (Referer header evidence).",isNumeric:!0,progress:Math.min(100,Math.round(_.totals24h.aiReferralHits/1e3*100))}),s.jsx(Ug,{label:"24h sample rows",value:String(_.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(_.totals24h.sampleCount/100*100))})]}),s.jsxs("section",{children:[s.jsx("p",{className:"mb-4 text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:"Latest sync run"}),_.latestRun?s.jsxs(Pe,{className:"p-4 text-sm",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-1.5",children:[s.jsxs("span",{className:"text-zinc-100",children:["Status: ",s.jsx("span",{className:"font-medium",children:_.latestRun.status})]}),s.jsxs("span",{className:"text-zinc-500",children:["Started: ",Eg(_.latestRun.startedAt)]}),_.latestRun.finishedAt?s.jsxs("span",{className:"text-zinc-500",children:["Finished: ",Eg(_.latestRun.finishedAt)]}):null,s.jsx("span",{className:"font-mono text-[11px] text-zinc-600",children:_.latestRun.runId})]}),_.latestRun.error?s.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:_.latestRun.error}):null]}):s.jsx(Pe,{className:"px-4 py-3 text-sm text-zinc-500",children:'No traffic-sync runs recorded yet. Hit "Sync now" above to create one.'})]}),s.jsxs("section",{children:[s.jsxs("div",{className:"mb-4 flex flex-wrap items-end justify-between gap-x-4 gap-y-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:"Events"}),s.jsx("h2",{className:"mt-1 text-base font-semibold text-zinc-50",children:O.granularity==="day"?"Daily rollups":"Hourly rollups"}),$?s.jsxs("p",{className:"mt-1.5 text-xs text-zinc-500",children:[$.crawlerHits.toLocaleString("en-US")," crawler ·"," ",$.aiReferralHits.toLocaleString("en-US")," AI referral sessions · last ",O.label]}):null]}),s.jsx("div",{className:"filter-row mb-0",role:"toolbar","aria-label":"Window",children:bv.map(D=>s.jsx("button",{type:"button",className:`filter-chip ${r===D.value?"filter-chip-active":""}`,"aria-pressed":r===D.value,onClick:()=>{i(D.value),d(null)},children:D.label},D.value))})]}),s.jsxs(Pe,{className:"p-4",children:[s.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",role:"toolbar","aria-label":"Series",children:[s.jsx(r5,{label:"Crawler",color:t5,count:$?.crawlerHits??0,active:a.has("crawler"),onToggle:()=>H("crawler")}),s.jsx(r5,{label:"AI referral sessions",color:n5,count:$?.aiReferralHits??0,active:a.has("ai-referral"),onToggle:()=>H("ai-referral")})]}),Q.length===0?s.jsx("p",{className:"py-12 text-center text-xs text-zinc-500",children:"No events in this window."}):s.jsx("div",{className:"h-72",children:s.jsx(Iy,{children:s.jsxs(EOe,{data:Q,margin:{top:4,right:4,bottom:0,left:0},onClick:J,style:{cursor:"pointer"},children:[s.jsx(I8,{stroke:_Oe,strokeDasharray:"3 3"}),s.jsx(Gh,{dataKey:"label",tick:_o,stroke:pd,interval:"preserveStartEnd",minTickGap:O.granularity==="day"?24:32}),s.jsx(Vh,{tick:_o,stroke:pd,allowDecimals:!1}),s.jsx(lv,{...Wu}),a.has("crawler")?s.jsx(_N,{dataKey:"crawler",name:"Crawler",fill:t5,stackId:"a",children:Q.map(D=>s.jsx(cv,{fillOpacity:c&&c!==D.bucket?.25:1},D.bucket))}):null,a.has("ai-referral")?s.jsx(_N,{dataKey:"aiReferral",name:"AI referral",fill:n5,stackId:"a",children:Q.map(D=>s.jsx(cv,{fillOpacity:c&&c!==D.bucket?.25:1},D.bucket))}):null]})})})]})]}),s.jsxs("section",{children:[s.jsxs("div",{className:"mb-4 flex flex-wrap items-end justify-between gap-x-4 gap-y-2",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:"Event rows"}),s.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:["Showing ",s.jsx("span",{className:"tabular-nums text-zinc-300",children:K.length.toLocaleString("en-US")})," of"," ",s.jsx("span",{className:"tabular-nums text-zinc-500",children:F.length.toLocaleString("en-US")})," events"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("select",{"aria-label":"Filter by identity",value:f,onChange:D=>p(D.target.value),className:"rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-xs text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-600",children:[s.jsx("option",{value:"",children:"All identities"}),q.map(D=>s.jsx("option",{value:D,children:D},D))]}),s.jsxs("select",{"aria-label":"Filter by operator",value:m,onChange:D=>y(D.target.value),className:"rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-xs text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-600",children:[s.jsx("option",{value:"",children:"All operators"}),B.map(D=>s.jsx("option",{value:D,children:D},D))]}),s.jsx("input",{type:"search","aria-label":"Filter by path",placeholder:"path contains…",value:v,onChange:D=>w(D.target.value),className:"w-44 rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-xs text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-600"})]})]}),be?s.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[X?s.jsx(Og,{label:`Bucket: ${X}`,onClear:()=>d(null)}):null,f?s.jsx(Og,{label:`Identity: ${f}`,onClear:()=>p("")}):null,m?s.jsx(Og,{label:`Operator: ${m}`,onClear:()=>y("")}):null,v.trim()?s.jsx(Og,{label:`Path: ${v.trim()}`,onClear:()=>w("")}):null,s.jsx("button",{type:"button",onClick:de,className:"text-xs text-zinc-500 underline-offset-4 hover:text-zinc-200 hover:underline",children:"Clear all"})]}):null,s.jsx(gze,{events:K})]})]})}function Vg(e,t){return t==="day"?hze(e):j9(e)}function mze(e,t,n,r){const i=new Map;for(const a of e){const l=S9(a.tsHour,t);let c=i.get(l);c||(c={bucket:l,label:Vg(l,t),crawler:0,aiReferral:0},i.set(l,c)),a.kind===Da.crawler?c.crawler+=a.hits:c.aiReferral+=a.hits}if(n&&r){const a=new Date(n),l=new Date(r);if(t==="day"){const c=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate())),d=new Date(Date.UTC(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()));for(;c<=d;){const f=c.getUTCFullYear(),p=String(c.getUTCMonth()+1).padStart(2,"0"),m=String(c.getUTCDate()).padStart(2,"0"),y=`${f}-${p}-${m}`;i.has(y)||i.set(y,{bucket:y,label:Vg(y,t),crawler:0,aiReferral:0}),c.setUTCDate(c.getUTCDate()+1)}}else{const c=new Date(a);for(c.setUTCMinutes(0,0,0);c<=l;){const d=c.toISOString();i.has(d)||i.set(d,{bucket:d,label:Vg(d,t),crawler:0,aiReferral:0}),c.setUTCHours(c.getUTCHours()+1)}}}return[...i.values()].sort((a,l)=>a.bucket<l.bucket?-1:a.bucket>l.bucket?1:0)}function Og({label:e,onClear:t}){return s.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-zinc-700 bg-zinc-800/60 px-2.5 py-1 text-[11px] text-zinc-200",children:[e,s.jsx("button",{type:"button",onClick:t,"aria-label":`Clear ${e}`,className:"rounded-full p-0.5 text-zinc-400 hover:bg-zinc-700/60 hover:text-zinc-100",children:s.jsx(yd,{className:"size-3"})})]})}function r5({label:e,color:t,count:n,active:r,onToggle:i}){return s.jsxs("button",{type:"button",onClick:i,"aria-pressed":r,className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 text-xs font-medium transition ${r?"border-zinc-700 bg-zinc-800/60 text-zinc-100":"border-zinc-800 bg-transparent text-zinc-500 hover:text-zinc-300"}`,children:[s.jsx("span",{"aria-hidden":"true",className:`size-2 rounded-full transition-opacity ${r?"opacity-100":"opacity-30"}`,style:{backgroundColor:t}}),s.jsx("span",{children:e}),s.jsx("span",{className:`tabular-nums ${r?"text-zinc-400":"text-zinc-600"}`,children:n.toLocaleString("en-US")})]})}function gze({events:e}){return e.length===0?s.jsx(Pe,{className:"p-6 text-center text-sm text-zinc-500",children:"No event rows match the current filters."}):s.jsx("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{className:"bg-zinc-900/50 text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-4 py-2 text-left",children:"Hour"}),s.jsx("th",{className:"px-4 py-2 text-left",children:"Kind"}),s.jsx("th",{className:"px-4 py-2 text-left",children:"Identity"}),s.jsx("th",{className:"px-4 py-2 text-left",children:"Evidence / status"}),s.jsx("th",{className:"px-4 py-2 text-left",children:"Path"}),s.jsx("th",{className:"px-4 py-2 text-right",children:"Hits"})]})}),s.jsx("tbody",{className:"divide-y divide-zinc-800/60",children:e.map((t,n)=>s.jsxs("tr",{className:"hover:bg-zinc-900/40 transition-colors",children:[s.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zinc-300",children:j9(t.tsHour)}),s.jsx("td",{className:"px-4 py-2 text-zinc-300",children:t.kind===Da.crawler?"Crawler":"AI referral"}),s.jsxs("td",{className:"px-4 py-2 text-zinc-100",children:[t.kind===Da.crawler?t.botId:t.product,s.jsx("span",{className:"ml-2 text-[11px] text-zinc-500",children:t.operator})]}),s.jsx("td",{className:"px-4 py-2 text-zinc-300",children:t.kind===Da.crawler?`${t.verificationStatus} · HTTP ${t.status}`:`${t.evidenceType} · ${t.sourceDomain}`}),s.jsx("td",{className:"px-4 py-2 truncate font-mono text-xs text-zinc-300",children:t.kind===Da.crawler?t.pathNormalized:t.landingPathNormalized}),s.jsx("td",{className:"px-4 py-2 text-right tabular-nums text-zinc-100",children:t.hits})]},`${t.kind}:${t.tsHour}:${n}`))})]})})}function yze(){return s.jsx("div",{className:"page-container",children:s.jsx("section",{className:"page-section",children:s.jsxs(Pe,{className:"surface-card empty-card",children:[s.jsx("h1",{children:"Route not found"}),s.jsx("p",{children:"The current path does not map to a dashboard view."}),s.jsx(pe,{asChild:!0,children:s.jsx(Et,{to:"/",children:"Return to overview"})})]})})})}function vze(){return s.jsx(ade,{children:s.jsx(ide,{})})}const ui=tV()({component:vze,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),xze=xr({getParentRoute:()=>ui,path:"/",component:lde,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(_e.projects.all);if(t&&t.length===0)throw XN({to:"/setup"})}}),bze=xr({getParentRoute:()=>ui,path:"/projects",component:bfe}),jc=xr({getParentRoute:()=>ui,path:"/projects/$projectId",component:()=>s.jsx(ok,{})}),wze=xr({getParentRoute:()=>jc,path:"/",component:()=>s.jsx(Id,{tab:"overview"})}),Sze=xr({getParentRoute:()=>jc,path:"/search-console",component:()=>s.jsx(Id,{tab:"search-console"})}),jze=xr({getParentRoute:()=>jc,path:"/discovery",component:()=>s.jsx(Id,{tab:"discovery"})}),Nze=xr({getParentRoute:()=>jc,path:"/report",component:()=>s.jsx(Id,{tab:"report"})}),kze=xr({getParentRoute:()=>jc,path:"/activity",component:()=>s.jsx(Id,{tab:"activity"})}),Cze=xr({getParentRoute:()=>jc,path:"/inbound",component:()=>s.jsx(Id,{tab:"inbound"})}),Aze=xr({getParentRoute:()=>ui,path:"/runs",component:Q_e}),Eze=xr({getParentRoute:()=>ui,path:"/settings",component:J_e,beforeLoad:({context:e})=>{}}),Oze=xr({getParentRoute:()=>ui,path:"/setup",component:nze,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(_e.projects.all);if(t&&t.length>0)throw XN({to:"/"})}}),_ze=xr({getParentRoute:()=>ui,path:"/backlinks",component:ize}),zze=xr({getParentRoute:()=>ui,path:"/traffic",component:lze}),Tze=xr({getParentRoute:()=>ui,path:"/traffic/$projectName/$sourceId",component:pze}),Pze=xr({getParentRoute:()=>ui,path:"*",component:yze}),Rze=ui.addChildren([xze,bze,jc.addChildren([wze,Sze,jze,Nze,kze,Cze]),Aze,Eze,Oze,_ze,zze,Tze,Pze]);function Dze(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const i5=Dze(),Ize=i5==="/"?"":i5.replace(/\/$/,"");function Mze(e,t){return dV({routeTree:Rze,basepath:Ize||"/",context:{queryClient:e},...t?.initialEntries})}const Lze=6e4;function $ze(){const[e,t]=x.useState(Ow()?"ready":"checking"),[n,r]=x.useState(""),[i,a]=x.useState(""),[l,c]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(!1),y=x.useRef(null),v=x.useRef(null),w=()=>{if(!y.current){const k=eW();v.current=k,y.current=Mze(k)}return{queryClient:v.current,router:y.current}};x.useEffect(()=>{if(Ow())return;let k=!1;return R2().then(E=>{k||(E.authenticated?t("ready"):t(E.setupRequired?"setup":"login"))}).catch(E=>{k||(c(E instanceof Error?E.message:"Failed to reach the Canonry API"),t("login"))}),()=>{k=!0}},[]),x.useEffect(()=>{if(e!=="ready"||Ow())return;const k=setInterval(()=>{R2().then(E=>{E.authenticated||(m(!0),t(E.setupRequired?"setup":"login"))}).catch(()=>{})},Lze);return T2(()=>{m(!0),t("login")}),()=>{clearInterval(k),T2(null)}},[e]);const b=async k=>{if(k.preventDefault(),!n.trim()||n.trim().length<8){c("Password must be at least 8 characters");return}if(n!==i){c("Passwords do not match");return}f(!0),c(null);try{if(!(await TV(n.trim())).authenticated){c("Setup failed");return}r(""),a(""),m(!1),t("ready")}catch(E){c(E instanceof yr||E instanceof Error?E.message:"Setup failed")}finally{f(!1)}},j=async k=>{if(k.preventDefault(),!!n.trim()){f(!0),c(null);try{if(!(await PV(n.trim())).authenticated){c("Incorrect password");return}r(""),m(!1),t("ready")}catch(E){c(E instanceof yr||E instanceof Error?E.message:"Authentication failed")}finally{f(!1)}}};if(e==="ready"){const{queryClient:k,router:E}=w();return s.jsx(u7,{client:k,children:s.jsx(pV,{router:E})})}return s.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:s.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:s.jsx(Pe,{className:"surface-card w-full",children:e==="checking"?s.jsx(Mg,{className:"py-8",children:s.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?s.jsxs(s.Fragment,{children:[s.jsxs(_1,{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),s.jsx(z1,{children:"Create a dashboard password"}),s.jsx(T1,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),s.jsx(Mg,{children:s.jsxs("form",{className:"space-y-4",onSubmit:b,children:[s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),s.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:k=>r(k.target.value),placeholder:"At least 8 characters"})]}),s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),s.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:k=>a(k.target.value),placeholder:"Re-enter password"})]}),l?s.jsx("p",{className:"text-sm text-rose-400",children:l}):null,s.jsx(pe,{type:"submit",disabled:d||!n.trim()||!i.trim(),children:d?"Setting up…":"Create password & open dashboard"})]})})]}):s.jsxs(s.Fragment,{children:[s.jsxs(_1,{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),s.jsx(z1,{children:"Sign in to Canonry"}),s.jsx(T1,{children:"Enter your dashboard password to continue."})]}),s.jsxs(Mg,{children:[p?s.jsx("p",{className:"mb-4 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-300",children:"Your session expired — please sign in again."}):null,s.jsxs("form",{className:"space-y-4",onSubmit:j,children:[s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),s.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:k=>r(k.target.value),placeholder:"Dashboard password"})]}),l?s.jsx("p",{className:"text-sm text-rose-400",children:l}):null,s.jsx(pe,{type:"submit",disabled:d||!n.trim(),children:d?"Signing in…":"Open dashboard"})]})]})]})})})})}const N9=document.getElementById("root");if(!N9)throw new Error("Expected #root element for web app bootstrap.");$K.createRoot(N9).render(s.jsx(x.StrictMode,{children:s.jsx($ze,{})}));
|