@ainyc/canonry 2.3.1 → 2.4.2
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 +1 -0
- package/assets/agent-workspace/skills/canonry-setup/references/canonry-cli.md +20 -0
- package/assets/assets/index-CAewPdsZ.css +1 -0
- package/assets/assets/index-Nrl3ecFY.js +301 -0
- package/assets/index.html +2 -2
- package/dist/{chunk-CW6CAPBQ.js → chunk-GZF3YIHY.js} +6 -1
- package/dist/{chunk-JXOUZ6JH.js → chunk-Y7GCG4GD.js} +74 -21
- package/dist/cli.js +14 -5
- package/dist/index.js +2 -2
- package/dist/{intelligence-service-232P7625.js → intelligence-service-KM64AW7J.js} +1 -1
- package/package.json +5 -5
- package/assets/assets/index-C_pxQt0X.js +0 -301
- package/assets/assets/index-yF1fs-OW.css +0 -1
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
function _9(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function wa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vb={exports:{}},zd={};var QO;function A9(){if(QO)return zd;QO=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var c in i)c!=="key"&&(a[c]=i[c])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:a}}return zd.Fragment=t,zd.jsx=n,zd.jsxs=n,zd}var XO;function O9(){return XO||(XO=1,Vb.exports=A9()),Vb.exports}var u=O9(),Zb={exports:{}},Xe={};var JO;function E9(){if(JO)return Xe;JO=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),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(F){return F===null||typeof F!="object"?null:(F=y&&F[y]||F["@@iterator"],typeof F=="function"?F:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,j={};function k(F,B,M){this.props=F,this.context=B,this.refs=j,this.updater=M||x}k.prototype.isReactComponent={},k.prototype.setState=function(F,B){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,B,"setState")},k.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function O(){}O.prototype=k.prototype;function _(F,B,M){this.props=F,this.context=B,this.refs=j,this.updater=M||x}var C=_.prototype=new O;C.constructor=_,w(C,k.prototype),C.isPureReactComponent=!0;var P=Array.isArray;function T(){}var A={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function I(F,B,M){var V=M.ref;return{$$typeof:e,type:F,key:B,ref:V!==void 0?V:null,props:M}}function q(F,B){return I(F.type,B,F.props)}function U(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function L(F){var B={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(M){return B[M]})}var J=/\/+/g;function ae(F,B){return typeof F=="object"&&F!==null&&F.key!=null?L(""+F.key):B.toString(36)}function Q(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(T,T):(F.status="pending",F.then(function(B){F.status==="pending"&&(F.status="fulfilled",F.value=B)},function(B){F.status==="pending"&&(F.status="rejected",F.reason=B)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function K(F,B,M,V,se){var ie=typeof F;(ie==="undefined"||ie==="boolean")&&(F=null);var he=!1;if(F===null)he=!0;else switch(ie){case"bigint":case"string":case"number":he=!0;break;case"object":switch(F.$$typeof){case e:case t:he=!0;break;case p:return he=F._init,K(he(F._payload),B,M,V,se)}}if(he)return se=se(F),he=V===""?"."+ae(F,0):V,P(se)?(M="",he!=null&&(M=he.replace(J,"$&/")+"/"),K(se,B,M,"",function(de){return de})):se!=null&&(U(se)&&(se=q(se,M+(se.key==null||F&&F.key===se.key?"":(""+se.key).replace(J,"$&/")+"/")+he)),B.push(se)),1;he=0;var je=V===""?".":V+":";if(P(F))for(var ee=0;ee<F.length;ee++)V=F[ee],ie=je+ae(V,ee),he+=K(V,B,M,ie,se);else if(ee=v(F),typeof ee=="function")for(F=ee.call(F),ee=0;!(V=F.next()).done;)V=V.value,ie=je+ae(V,ee++),he+=K(V,B,M,ie,se);else if(ie==="object"){if(typeof F.then=="function")return K(Q(F),B,M,V,se);throw B=String(F),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return he}function X(F,B,M){if(F==null)return F;var V=[],se=0;return K(F,V,"","",function(ie){return B.call(M,ie,se++)}),V}function ye(F){if(F._status===-1){var B=F._result;B=B(),B.then(function(M){(F._status===0||F._status===-1)&&(F._status=1,F._result=M)},function(M){(F._status===0||F._status===-1)&&(F._status=2,F._result=M)}),F._status===-1&&(F._status=0,F._result=B)}if(F._status===1)return F._result.default;throw F._result}var Se=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof F=="object"&&F!==null&&typeof F.message=="string"?String(F.message):String(F),error:F});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",F);return}console.error(F)},R={map:X,forEach:function(F,B,M){X(F,function(){B.apply(this,arguments)},M)},count:function(F){var B=0;return X(F,function(){B++}),B},toArray:function(F){return X(F,function(B){return B})||[]},only:function(F){if(!U(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return Xe.Activity=m,Xe.Children=R,Xe.Component=k,Xe.Fragment=n,Xe.Profiler=i,Xe.PureComponent=_,Xe.StrictMode=r,Xe.Suspense=d,Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Xe.__COMPILER_RUNTIME={__proto__:null,c:function(F){return A.H.useMemoCache(F)}},Xe.cache=function(F){return function(){return F.apply(null,arguments)}},Xe.cacheSignal=function(){return null},Xe.cloneElement=function(F,B,M){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var V=w({},F.props),se=F.key;if(B!=null)for(ie in B.key!==void 0&&(se=""+B.key),B)!z.call(B,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&B.ref===void 0||(V[ie]=B[ie]);var ie=arguments.length-2;if(ie===1)V.children=M;else if(1<ie){for(var he=Array(ie),je=0;je<ie;je++)he[je]=arguments[je+2];V.children=he}return I(F.type,se,V)},Xe.createContext=function(F){return F={$$typeof:o,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:a,_context:F},F},Xe.createElement=function(F,B,M){var V,se={},ie=null;if(B!=null)for(V in B.key!==void 0&&(ie=""+B.key),B)z.call(B,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(se[V]=B[V]);var he=arguments.length-2;if(he===1)se.children=M;else if(1<he){for(var je=Array(he),ee=0;ee<he;ee++)je[ee]=arguments[ee+2];se.children=je}if(F&&F.defaultProps)for(V in he=F.defaultProps,he)se[V]===void 0&&(se[V]=he[V]);return I(F,ie,se)},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(F){return{$$typeof:c,render:F}},Xe.isValidElement=U,Xe.lazy=function(F){return{$$typeof:p,_payload:{_status:-1,_result:F},_init:ye}},Xe.memo=function(F,B){return{$$typeof:f,type:F,compare:B===void 0?null:B}},Xe.startTransition=function(F){var B=A.T,M={};A.T=M;try{var V=F(),se=A.S;se!==null&&se(M,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(T,Se)}catch(ie){Se(ie)}finally{B!==null&&M.types!==null&&(B.types=M.types),A.T=B}},Xe.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},Xe.use=function(F){return A.H.use(F)},Xe.useActionState=function(F,B,M){return A.H.useActionState(F,B,M)},Xe.useCallback=function(F,B){return A.H.useCallback(F,B)},Xe.useContext=function(F){return A.H.useContext(F)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(F,B){return A.H.useDeferredValue(F,B)},Xe.useEffect=function(F,B){return A.H.useEffect(F,B)},Xe.useEffectEvent=function(F){return A.H.useEffectEvent(F)},Xe.useId=function(){return A.H.useId()},Xe.useImperativeHandle=function(F,B,M){return A.H.useImperativeHandle(F,B,M)},Xe.useInsertionEffect=function(F,B){return A.H.useInsertionEffect(F,B)},Xe.useLayoutEffect=function(F,B){return A.H.useLayoutEffect(F,B)},Xe.useMemo=function(F,B){return A.H.useMemo(F,B)},Xe.useOptimistic=function(F,B){return A.H.useOptimistic(F,B)},Xe.useReducer=function(F,B,M){return A.H.useReducer(F,B,M)},Xe.useRef=function(F){return A.H.useRef(F)},Xe.useState=function(F){return A.H.useState(F)},Xe.useSyncExternalStore=function(F,B,M){return A.H.useSyncExternalStore(F,B,M)},Xe.useTransition=function(){return A.H.useTransition()},Xe.version="19.2.4",Xe}var eE;function Nu(){return eE||(eE=1,Zb.exports=E9()),Zb.exports}var S=Nu();const Bi=wa(S),yy=_9({__proto__:null,default:Bi},[S]);var Yb={exports:{}},Rd={},Wb={exports:{}},Qb={};var tE;function T9(){return tE||(tE=1,(function(e){function t(K,X){var ye=K.length;K.push(X);e:for(;0<ye;){var Se=ye-1>>>1,R=K[Se];if(0<i(R,X))K[Se]=X,K[ye]=R,ye=Se;else break e}}function n(K){return K.length===0?null:K[0]}function r(K){if(K.length===0)return null;var X=K[0],ye=K.pop();if(ye!==X){K[0]=ye;e:for(var Se=0,R=K.length,F=R>>>1;Se<F;){var B=2*(Se+1)-1,M=K[B],V=B+1,se=K[V];if(0>i(M,ye))V<R&&0>i(se,M)?(K[Se]=se,K[V]=ye,Se=V):(K[Se]=M,K[B]=ye,Se=B);else if(V<R&&0>i(se,ye))K[Se]=se,K[V]=ye,Se=V;else break e}}return X}function i(K,X){var ye=K.sortIndex-X.sortIndex;return ye!==0?ye:K.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var d=[],f=[],p=1,m=null,y=3,v=!1,x=!1,w=!1,j=!1,k=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function C(K){for(var X=n(f);X!==null;){if(X.callback===null)r(f);else if(X.startTime<=K)r(f),X.sortIndex=X.expirationTime,t(d,X);else break;X=n(f)}}function P(K){if(w=!1,C(K),!x)if(n(d)!==null)x=!0,T||(T=!0,L());else{var X=n(f);X!==null&&Q(P,X.startTime-K)}}var T=!1,A=-1,z=5,I=-1;function q(){return j?!0:!(e.unstable_now()-I<z)}function U(){if(j=!1,T){var K=e.unstable_now();I=K;var X=!0;try{e:{x=!1,w&&(w=!1,O(A),A=-1),v=!0;var ye=y;try{t:{for(C(K),m=n(d);m!==null&&!(m.expirationTime>K&&q());){var Se=m.callback;if(typeof Se=="function"){m.callback=null,y=m.priorityLevel;var R=Se(m.expirationTime<=K);if(K=e.unstable_now(),typeof R=="function"){m.callback=R,C(K),X=!0;break t}m===n(d)&&r(d),C(K)}else r(d);m=n(d)}if(m!==null)X=!0;else{var F=n(f);F!==null&&Q(P,F.startTime-K),X=!1}}break e}finally{m=null,y=ye,v=!1}X=void 0}}finally{X?L():T=!1}}}var L;if(typeof _=="function")L=function(){_(U)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,ae=J.port2;J.port1.onmessage=U,L=function(){ae.postMessage(null)}}else L=function(){k(U,0)};function Q(K,X){A=k(function(){K(e.unstable_now())},X)}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(K){K.callback=null},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(K){switch(y){case 1:case 2:case 3:var X=3;break;default:X=y}var ye=y;y=X;try{return K()}finally{y=ye}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(K,X){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var ye=y;y=K;try{return X()}finally{y=ye}},e.unstable_scheduleCallback=function(K,X,ye){var Se=e.unstable_now();switch(typeof ye=="object"&&ye!==null?(ye=ye.delay,ye=typeof ye=="number"&&0<ye?Se+ye:Se):ye=Se,K){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=ye+R,K={id:p++,callback:X,priorityLevel:K,startTime:ye,expirationTime:R,sortIndex:-1},ye>Se?(K.sortIndex=ye,t(f,K),n(d)===null&&K===n(f)&&(w?(O(A),A=-1):w=!0,Q(P,ye-Se))):(K.sortIndex=R,t(d,K),x||v||(x=!0,T||(T=!0,L()))),K},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(K){var X=y;return function(){var ye=y;y=X;try{return K.apply(this,arguments)}finally{y=ye}}}})(Qb)),Qb}var nE;function P9(){return nE||(nE=1,Wb.exports=T9()),Wb.exports}var Xb={exports:{}},er={};var rE;function z9(){if(rE)return er;rE=1;var e=Nu();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(d,f,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:d,containerInfo:f,implementation:p}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return er.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,er.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)},er.flushSync=function(d){var f=o.T,p=r.p;try{if(o.T=null,r.p=2,d)return d()}finally{o.T=f,r.p=p,r.d.f()}},er.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))},er.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},er.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})}},er.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)},er.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})}},er.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)},er.requestFormReset=function(d){r.d.r(d)},er.unstable_batchedUpdates=function(d,f){return d(f)},er.useFormState=function(d,f,p){return o.H.useFormState(d,f,p)},er.useFormStatus=function(){return o.H.useHostTransitionStatus()},er.version="19.2.4",er}var iE;function $D(){if(iE)return Xb.exports;iE=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(),Xb.exports=z9(),Xb.exports}var aE;function R9(){if(aE)return Rd;aE=1;var e=P9(),t=Nu(),n=$D();function r(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var l=s,h=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(h=l.return),s=l.return;while(s)}return l.tag===3?h:null}function o(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function c(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function d(s){if(a(s)!==s)throw Error(r(188))}function f(s){var l=s.alternate;if(!l){if(l=a(s),l===null)throw Error(r(188));return l!==s?null:s}for(var h=s,g=l;;){var b=h.return;if(b===null)break;var N=b.alternate;if(N===null){if(g=b.return,g!==null){h=g;continue}break}if(b.child===N.child){for(N=b.child;N;){if(N===h)return d(b),s;if(N===g)return d(b),l;N=N.sibling}throw Error(r(188))}if(h.return!==g.return)h=b,g=N;else{for(var E=!1,D=b.child;D;){if(D===h){E=!0,h=b,g=N;break}if(D===g){E=!0,g=b,h=N;break}D=D.sibling}if(!E){for(D=N.child;D;){if(D===h){E=!0,h=N,g=b;break}if(D===g){E=!0,g=N,h=b;break}D=D.sibling}if(!E)throw Error(r(189))}}if(h.alternate!==g)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?s:l}function p(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=p(s),l!==null)return l;s=s.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),_=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function L(s){return s===null||typeof s!="object"?null:(s=U&&s[U]||s["@@iterator"],typeof s=="function"?s:null)}var J=Symbol.for("react.client.reference");function ae(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===J?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case k:return"Profiler";case j:return"StrictMode";case P:return"Suspense";case T:return"SuspenseList";case I:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case x:return"Portal";case _:return s.displayName||"Context";case O:return(s._context.displayName||"Context")+".Consumer";case C:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case A:return l=s.displayName||null,l!==null?l:ae(s.type)||"Memo";case z:l=s._payload,s=s._init;try{return ae(s(l))}catch{}}return null}var Q=Array.isArray,K=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},Se=[],R=-1;function F(s){return{current:s}}function B(s){0>R||(s.current=Se[R],Se[R]=null,R--)}function M(s,l){R++,Se[R]=s.current,s.current=l}var V=F(null),se=F(null),ie=F(null),he=F(null);function je(s,l){switch(M(ie,l),M(se,s),M(V,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?xO(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=xO(l),s=wO(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}B(V),M(V,s)}function ee(){B(V),B(se),B(ie)}function de(s){s.memoizedState!==null&&M(he,s);var l=V.current,h=wO(l,s.type);l!==h&&(M(se,s),M(V,h))}function _e(s){se.current===s&&(B(V),B(se)),he.current===s&&(B(he),Od._currentValue=ye)}var Y,Ke;function Me(s){if(Y===void 0)try{throw Error()}catch(h){var l=h.stack.trim().match(/\n( *(at )?)/);Y=l&&l[1]||"",Ke=-1<h.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+Y+s+Ke}var rt=!1;function it(s,l){if(!s||rt)return"";rt=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(l){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(ce){var oe=ce}Reflect.construct(s,[],ge)}else{try{ge.call()}catch(ce){oe=ce}s.call(ge.prototype)}}else{try{throw Error()}catch(ce){oe=ce}(ge=s())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(ce){if(ce&&oe&&typeof ce.stack=="string")return[ce.stack,oe.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=g.DetermineComponentFrameRoot(),E=N[0],D=N[1];if(E&&D){var H=E.split(`
|
|
4
|
-
`),re=D.split(`
|
|
5
|
-
`);for(b=g=0;g<H.length&&!H[g].includes("DetermineComponentFrameRoot");)g++;for(;b<re.length&&!re[b].includes("DetermineComponentFrameRoot");)b++;if(g===H.length||b===re.length)for(g=H.length-1,b=re.length-1;1<=g&&0<=b&&H[g]!==re[b];)b--;for(;1<=g&&0<=b;g--,b--)if(H[g]!==re[b]){if(g!==1||b!==1)do if(g--,b--,0>b||H[g]!==re[b]){var fe=`
|
|
6
|
-
`+H[g].replace(" at new "," at ");return s.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",s.displayName)),fe}while(1<=g&&0<=b);break}}}finally{rt=!1,Error.prepareStackTrace=h}return(h=s?s.displayName||s.name:"")?Me(h):""}function Nt(s,l){switch(s.tag){case 26:case 27:case 5:return Me(s.type);case 16:return Me("Lazy");case 13:return s.child!==l&&l!==null?Me("Suspense Fallback"):Me("Suspense");case 19:return Me("SuspenseList");case 0:case 15:return it(s.type,!1);case 11:return it(s.type.render,!1);case 1:return it(s.type,!0);case 31:return Me("Activity");default:return""}}function Lt(s){try{var l="",h=null;do l+=Nt(s,h),h=s,s=s.return;while(s);return l}catch(g){return`
|
|
7
|
-
Error generating stack: `+g.message+`
|
|
8
|
-
`+g.stack}}var xn=Object.prototype.hasOwnProperty,ve=e.unstable_scheduleCallback,Ve=e.unstable_cancelCallback,be=e.unstable_shouldYield,ze=e.unstable_requestPaint,Re=e.unstable_now,Oe=e.unstable_getCurrentPriorityLevel,te=e.unstable_ImmediatePriority,xe=e.unstable_UserBlockingPriority,Ee=e.unstable_NormalPriority,Ge=e.unstable_LowPriority,Je=e.unstable_IdlePriority,nn=e.log,wn=e.unstable_setDisableYieldValue,Qe=null,kt=null;function $t(s){if(typeof nn=="function"&&wn(s),kt&&typeof kt.setStrictMode=="function")try{kt.setStrictMode(Qe,s)}catch{}}var ue=Math.clz32?Math.clz32:No,Dn=Math.log,lr=Math.LN2;function No(s){return s>>>=0,s===0?32:31-(Dn(s)/lr|0)|0}var ps=256,ko=262144,Ca=4194304;function Xr(s){var l=s&42;if(l!==0)return l;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Co(s,l,h){var g=s.pendingLanes;if(g===0)return 0;var b=0,N=s.suspendedLanes,E=s.pingedLanes;s=s.warmLanes;var D=g&134217727;return D!==0?(g=D&~N,g!==0?b=Xr(g):(E&=D,E!==0?b=Xr(E):h||(h=D&~s,h!==0&&(b=Xr(h))))):(D=g&~N,D!==0?b=Xr(D):E!==0?b=Xr(E):h||(h=g&~s,h!==0&&(b=Xr(h)))),b===0?0:l!==0&&l!==b&&(l&N)===0&&(N=b&-b,h=l&-l,N>=h||N===32&&(h&4194048)!==0)?l:b}function ms(s,l){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&l)===0}function $v(s,l){switch(s){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 _o(){var s=Ca;return Ca<<=1,(Ca&62914560)===0&&(Ca=4194304),s}function Gl(s){for(var l=[],h=0;31>h;h++)l.push(s);return l}function Ao(s,l){s.pendingLanes|=l,l!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function kh(s,l,h,g,b,N){var E=s.pendingLanes;s.pendingLanes=h,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=h,s.entangledLanes&=h,s.errorRecoveryDisabledLanes&=h,s.shellSuspendCounter=0;var D=s.entanglements,H=s.expirationTimes,re=s.hiddenUpdates;for(h=E&~h;0<h;){var fe=31-ue(h),ge=1<<fe;D[fe]=0,H[fe]=-1;var oe=re[fe];if(oe!==null)for(re[fe]=null,fe=0;fe<oe.length;fe++){var ce=oe[fe];ce!==null&&(ce.lane&=-536870913)}h&=~ge}g!==0&&Ch(s,g,0),N!==0&&b===0&&s.tag!==0&&(s.suspendedLanes|=N&~(E&~l))}function Ch(s,l,h){s.pendingLanes|=l,s.suspendedLanes&=~l;var g=31-ue(l);s.entangledLanes|=l,s.entanglements[g]=s.entanglements[g]|1073741824|h&261930}function _h(s,l){var h=s.entangledLanes|=l;for(s=s.entanglements;h;){var g=31-ue(h),b=1<<g;b&l|s[g]&l&&(s[g]|=l),h&=~b}}function Ah(s,l){var h=l&-l;return h=(h&42)!==0?1:Hu(h),(h&(s.suspendedLanes|l))!==0?0:h}function Hu(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Vl(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function G(){var s=X.p;return s!==0?s:(s=window.event,s===void 0?32:KO(s.type))}function Ne(s,l){var h=X.p;try{return X.p=s,l()}finally{X.p=h}}var yt=Math.random().toString(36).slice(2),ct="__reactFiber$"+yt,_t="__reactProps$"+yt,Dr="__reactContainer$"+yt,Ti="__reactEvents$"+yt,gs="__reactListeners$"+yt,br="__reactHandles$"+yt,Oh="__reactResources$"+yt,Jr="__reactMarker$"+yt;function _a(s){delete s[ct],delete s[_t],delete s[Ti],delete s[gs],delete s[br]}function Pi(s){var l=s[ct];if(l)return l;for(var h=s.parentNode;h;){if(l=h[Dr]||h[ct]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(s=AO(s);s!==null;){if(h=s[ct])return h;s=AO(s)}return l}s=h,h=s.parentNode}return null}function Aa(s){if(s=s[ct]||s[Dr]){var l=s.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return s}return null}function Oo(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s.stateNode;throw Error(r(33))}function zi(s){var l=s[Oh];return l||(l=s[Oh]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function rn(s){s[Jr]=!0}var Eh=new Set,Th={};function at(s,l){vt(s,l),vt(s+"Capture",l)}function vt(s,l){for(Th[s]=l,s=0;s<l.length;s++)Eh.add(l[s])}var Ir=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]*$"),Ri={},Eo={};function Ph(s){return xn.call(Eo,s)?!0:xn.call(Ri,s)?!1:Ir.test(s)?Eo[s]=!0:(Ri[s]=!0,!1)}function zh(s,l,h){if(Ph(l))if(h===null)s.removeAttribute(l);else{switch(typeof h){case"undefined":case"function":case"symbol":s.removeAttribute(l);return;case"boolean":var g=l.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(l);return}}s.setAttribute(l,""+h)}}function Rh(s,l,h){if(h===null)s.removeAttribute(l);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(l);return}s.setAttribute(l,""+h)}}function Oa(s,l,h,g){if(g===null)s.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(h);return}s.setAttributeNS(l,h,""+g)}}function ei(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function fC(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function x8(s,l,h){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,l);if(!s.hasOwnProperty(l)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var b=g.get,N=g.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return b.call(this)},set:function(E){h=""+E,N.call(this,E)}}),Object.defineProperty(s,l,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(E){h=""+E},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function Uv(s){if(!s._valueTracker){var l=fC(s)?"checked":"value";s._valueTracker=x8(s,l,""+s[l])}}function hC(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var h=l.getValue(),g="";return s&&(g=fC(s)?s.checked?"true":"false":s.value),s=g,s!==h?(l.setValue(s),!0):!1}function Mh(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var w8=/[\n"\\]/g;function ti(s){return s.replace(w8,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Bv(s,l,h,g,b,N,E,D){s.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?s.type=E:s.removeAttribute("type"),l!=null?E==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+ei(l)):s.value!==""+ei(l)&&(s.value=""+ei(l)):E!=="submit"&&E!=="reset"||s.removeAttribute("value"),l!=null?Fv(s,E,ei(l)):h!=null?Fv(s,E,ei(h)):g!=null&&s.removeAttribute("value"),b==null&&N!=null&&(s.defaultChecked=!!N),b!=null&&(s.checked=b&&typeof b!="function"&&typeof b!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?s.name=""+ei(D):s.removeAttribute("name")}function pC(s,l,h,g,b,N,E,D){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(s.type=N),l!=null||h!=null){if(!(N!=="submit"&&N!=="reset"||l!=null)){Uv(s);return}h=h!=null?""+ei(h):"",l=l!=null?""+ei(l):h,D||l===s.value||(s.value=l),s.defaultValue=l}g=g??b,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=D?s.checked:!!g,s.defaultChecked=!!g,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(s.name=E),Uv(s)}function Fv(s,l,h){l==="number"&&Mh(s.ownerDocument)===s||s.defaultValue===""+h||(s.defaultValue=""+h)}function Zl(s,l,h,g){if(s=s.options,l){l={};for(var b=0;b<h.length;b++)l["$"+h[b]]=!0;for(h=0;h<s.length;h++)b=l.hasOwnProperty("$"+s[h].value),s[h].selected!==b&&(s[h].selected=b),b&&g&&(s[h].defaultSelected=!0)}else{for(h=""+ei(h),l=null,b=0;b<s.length;b++){if(s[b].value===h){s[b].selected=!0,g&&(s[b].defaultSelected=!0);return}l!==null||s[b].disabled||(l=s[b])}l!==null&&(l.selected=!0)}}function mC(s,l,h){if(l!=null&&(l=""+ei(l),l!==s.value&&(s.value=l),h==null)){s.defaultValue!==l&&(s.defaultValue=l);return}s.defaultValue=h!=null?""+ei(h):""}function gC(s,l,h,g){if(l==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=""),l=h}h=ei(l),s.defaultValue=h,g=s.textContent,g===h&&g!==""&&g!==null&&(s.value=g),Uv(s)}function Yl(s,l){if(l){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=l;return}}s.textContent=l}var S8=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 yC(s,l,h){var g=l.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?s.setProperty(l,""):l==="float"?s.cssFloat="":s[l]="":g?s.setProperty(l,h):typeof h!="number"||h===0||S8.has(l)?l==="float"?s.cssFloat=h:s[l]=(""+h).trim():s[l]=h+"px"}function vC(s,l,h){if(l!=null&&typeof l!="object")throw Error(r(62));if(s=s.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||l!=null&&l.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var b in l)g=l[b],l.hasOwnProperty(b)&&h[b]!==g&&yC(s,b,g)}else for(var N in l)l.hasOwnProperty(N)&&yC(s,N,l[N])}function qv(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var j8=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"]]),N8=/^[\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 Dh(s){return N8.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Ea(){}var Kv=null;function Hv(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Wl=null,Ql=null;function bC(s){var l=Aa(s);if(l&&(s=l.stateNode)){var h=s[_t]||null;e:switch(s=l.stateNode,l.type){case"input":if(Bv(s,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),l=h.name,h.type==="radio"&&l!=null){for(h=s;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+ti(""+l)+'"][type="radio"]'),l=0;l<h.length;l++){var g=h[l];if(g!==s&&g.form===s.form){var b=g[_t]||null;if(!b)throw Error(r(90));Bv(g,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(l=0;l<h.length;l++)g=h[l],g.form===s.form&&hC(g)}break e;case"textarea":mC(s,h.value,h.defaultValue);break e;case"select":l=h.value,l!=null&&Zl(s,!!h.multiple,l,!1)}}}var Gv=!1;function xC(s,l,h){if(Gv)return s(l,h);Gv=!0;try{var g=s(l);return g}finally{if(Gv=!1,(Wl!==null||Ql!==null)&&(jp(),Wl&&(l=Wl,s=Ql,Ql=Wl=null,bC(l),s)))for(l=0;l<s.length;l++)bC(s[l])}}function Gu(s,l){var h=s.stateNode;if(h===null)return null;var g=h[_t]||null;if(g===null)return null;h=g[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(h&&typeof h!="function")throw Error(r(231,l,typeof h));return h}var Ta=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vv=!1;if(Ta)try{var Vu={};Object.defineProperty(Vu,"passive",{get:function(){Vv=!0}}),window.addEventListener("test",Vu,Vu),window.removeEventListener("test",Vu,Vu)}catch{Vv=!1}var ys=null,Zv=null,Ih=null;function wC(){if(Ih)return Ih;var s,l=Zv,h=l.length,g,b="value"in ys?ys.value:ys.textContent,N=b.length;for(s=0;s<h&&l[s]===b[s];s++);var E=h-s;for(g=1;g<=E&&l[h-g]===b[N-g];g++);return Ih=b.slice(s,1<g?1-g:void 0)}function Lh(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function $h(){return!0}function SC(){return!1}function xr(s){function l(h,g,b,N,E){this._reactName=h,this._targetInst=b,this.type=g,this.nativeEvent=N,this.target=E,this.currentTarget=null;for(var D in s)s.hasOwnProperty(D)&&(h=s[D],this[D]=h?h(N):N[D]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?$h:SC,this.isPropagationStopped=SC,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=$h)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=$h)},persist:function(){},isPersistent:$h}),l}var To={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Uh=xr(To),Zu=m({},To,{view:0,detail:0}),k8=xr(Zu),Yv,Wv,Yu,Bh=m({},Zu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xv,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Yu&&(Yu&&s.type==="mousemove"?(Yv=s.screenX-Yu.screenX,Wv=s.screenY-Yu.screenY):Wv=Yv=0,Yu=s),Yv)},movementY:function(s){return"movementY"in s?s.movementY:Wv}}),jC=xr(Bh),C8=m({},Bh,{dataTransfer:0}),_8=xr(C8),A8=m({},Zu,{relatedTarget:0}),Qv=xr(A8),O8=m({},To,{animationName:0,elapsedTime:0,pseudoElement:0}),E8=xr(O8),T8=m({},To,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),P8=xr(T8),z8=m({},To,{data:0}),NC=xr(z8),R8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},M8={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"},D8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function I8(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=D8[s])?!!l[s]:!1}function Xv(){return I8}var L8=m({},Zu,{key:function(s){if(s.key){var l=R8[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=Lh(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?M8[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xv,charCode:function(s){return s.type==="keypress"?Lh(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Lh(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),$8=xr(L8),U8=m({},Bh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kC=xr(U8),B8=m({},Zu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xv}),F8=xr(B8),q8=m({},To,{propertyName:0,elapsedTime:0,pseudoElement:0}),K8=xr(q8),H8=m({},Bh,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),G8=xr(H8),V8=m({},To,{newState:0,oldState:0}),Z8=xr(V8),Y8=[9,13,27,32],Jv=Ta&&"CompositionEvent"in window,Wu=null;Ta&&"documentMode"in document&&(Wu=document.documentMode);var W8=Ta&&"TextEvent"in window&&!Wu,CC=Ta&&(!Jv||Wu&&8<Wu&&11>=Wu),_C=" ",AC=!1;function OC(s,l){switch(s){case"keyup":return Y8.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function EC(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Xl=!1;function Q8(s,l){switch(s){case"compositionend":return EC(l);case"keypress":return l.which!==32?null:(AC=!0,_C);case"textInput":return s=l.data,s===_C&&AC?null:s;default:return null}}function X8(s,l){if(Xl)return s==="compositionend"||!Jv&&OC(s,l)?(s=wC(),Ih=Zv=ys=null,Xl=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return CC&&l.locale!=="ko"?null:l.data;default:return null}}var J8={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 TC(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!J8[s.type]:l==="textarea"}function PC(s,l,h,g){Wl?Ql?Ql.push(g):Ql=[g]:Wl=g,l=Ep(l,"onChange"),0<l.length&&(h=new Uh("onChange","change",null,h,g),s.push({event:h,listeners:l}))}var Qu=null,Xu=null;function eF(s){pO(s,0)}function Fh(s){var l=Oo(s);if(hC(l))return s}function zC(s,l){if(s==="change")return l}var RC=!1;if(Ta){var e0;if(Ta){var t0="oninput"in document;if(!t0){var MC=document.createElement("div");MC.setAttribute("oninput","return;"),t0=typeof MC.oninput=="function"}e0=t0}else e0=!1;RC=e0&&(!document.documentMode||9<document.documentMode)}function DC(){Qu&&(Qu.detachEvent("onpropertychange",IC),Xu=Qu=null)}function IC(s){if(s.propertyName==="value"&&Fh(Xu)){var l=[];PC(l,Xu,s,Hv(s)),xC(eF,l)}}function tF(s,l,h){s==="focusin"?(DC(),Qu=l,Xu=h,Qu.attachEvent("onpropertychange",IC)):s==="focusout"&&DC()}function nF(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Fh(Xu)}function rF(s,l){if(s==="click")return Fh(l)}function iF(s,l){if(s==="input"||s==="change")return Fh(l)}function aF(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var Lr=typeof Object.is=="function"?Object.is:aF;function Ju(s,l){if(Lr(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var h=Object.keys(s),g=Object.keys(l);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var b=h[g];if(!xn.call(l,b)||!Lr(s[b],l[b]))return!1}return!0}function LC(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function $C(s,l){var h=LC(s);s=0;for(var g;h;){if(h.nodeType===3){if(g=s+h.textContent.length,s<=l&&g>=l)return{node:h,offset:l-s};s=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=LC(h)}}function UC(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?UC(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function BC(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var l=Mh(s.document);l instanceof s.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)s=l.contentWindow;else break;l=Mh(s.document)}return l}function n0(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}var sF=Ta&&"documentMode"in document&&11>=document.documentMode,Jl=null,r0=null,ed=null,i0=!1;function FC(s,l,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;i0||Jl==null||Jl!==Mh(g)||(g=Jl,"selectionStart"in g&&n0(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}),ed&&Ju(ed,g)||(ed=g,g=Ep(r0,"onSelect"),0<g.length&&(l=new Uh("onSelect","select",null,l,h),s.push({event:l,listeners:g}),l.target=Jl)))}function Po(s,l){var h={};return h[s.toLowerCase()]=l.toLowerCase(),h["Webkit"+s]="webkit"+l,h["Moz"+s]="moz"+l,h}var ec={animationend:Po("Animation","AnimationEnd"),animationiteration:Po("Animation","AnimationIteration"),animationstart:Po("Animation","AnimationStart"),transitionrun:Po("Transition","TransitionRun"),transitionstart:Po("Transition","TransitionStart"),transitioncancel:Po("Transition","TransitionCancel"),transitionend:Po("Transition","TransitionEnd")},a0={},qC={};Ta&&(qC=document.createElement("div").style,"AnimationEvent"in window||(delete ec.animationend.animation,delete ec.animationiteration.animation,delete ec.animationstart.animation),"TransitionEvent"in window||delete ec.transitionend.transition);function zo(s){if(a0[s])return a0[s];if(!ec[s])return s;var l=ec[s],h;for(h in l)if(l.hasOwnProperty(h)&&h in qC)return a0[s]=l[h];return s}var KC=zo("animationend"),HC=zo("animationiteration"),GC=zo("animationstart"),oF=zo("transitionrun"),lF=zo("transitionstart"),cF=zo("transitioncancel"),VC=zo("transitionend"),ZC=new Map,s0="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(" ");s0.push("scrollEnd");function Mi(s,l){ZC.set(s,l),at(l,[s])}var qh=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},ni=[],tc=0,o0=0;function Kh(){for(var s=tc,l=o0=tc=0;l<s;){var h=ni[l];ni[l++]=null;var g=ni[l];ni[l++]=null;var b=ni[l];ni[l++]=null;var N=ni[l];if(ni[l++]=null,g!==null&&b!==null){var E=g.pending;E===null?b.next=b:(b.next=E.next,E.next=b),g.pending=b}N!==0&&YC(h,b,N)}}function Hh(s,l,h,g){ni[tc++]=s,ni[tc++]=l,ni[tc++]=h,ni[tc++]=g,o0|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function l0(s,l,h,g){return Hh(s,l,h,g),Gh(s)}function Ro(s,l){return Hh(s,null,null,l),Gh(s)}function YC(s,l,h){s.lanes|=h;var g=s.alternate;g!==null&&(g.lanes|=h);for(var b=!1,N=s.return;N!==null;)N.childLanes|=h,g=N.alternate,g!==null&&(g.childLanes|=h),N.tag===22&&(s=N.stateNode,s===null||s._visibility&1||(b=!0)),s=N,N=N.return;return s.tag===3?(N=s.stateNode,b&&l!==null&&(b=31-ue(h),s=N.hiddenUpdates,g=s[b],g===null?s[b]=[l]:g.push(l),l.lane=h|536870912),N):null}function Gh(s){if(50<Sd)throw Sd=0,yb=null,Error(r(185));for(var l=s.return;l!==null;)s=l,l=s.return;return s.tag===3?s.stateNode:null}var nc={};function uF(s,l,h,g){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,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 $r(s,l,h,g){return new uF(s,l,h,g)}function c0(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Pa(s,l){var h=s.alternate;return h===null?(h=$r(s.tag,l,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=l,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&65011712,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,l=s.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h.refCleanup=s.refCleanup,h}function WC(s,l){s.flags&=65011714;var h=s.alternate;return h===null?(s.childLanes=0,s.lanes=l,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=h.childLanes,s.lanes=h.lanes,s.child=h.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=h.memoizedProps,s.memoizedState=h.memoizedState,s.updateQueue=h.updateQueue,s.type=h.type,l=h.dependencies,s.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),s}function Vh(s,l,h,g,b,N){var E=0;if(g=s,typeof s=="function")c0(s)&&(E=1);else if(typeof s=="string")E=m9(s,h,V.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case I:return s=$r(31,h,l,b),s.elementType=I,s.lanes=N,s;case w:return Mo(h.children,b,N,l);case j:E=8,b|=24;break;case k:return s=$r(12,h,l,b|2),s.elementType=k,s.lanes=N,s;case P:return s=$r(13,h,l,b),s.elementType=P,s.lanes=N,s;case T:return s=$r(19,h,l,b),s.elementType=T,s.lanes=N,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case _:E=10;break e;case O:E=9;break e;case C:E=11;break e;case A:E=14;break e;case z:E=16,g=null;break e}E=29,h=Error(r(130,s===null?"null":typeof s,"")),g=null}return l=$r(E,h,l,b),l.elementType=s,l.type=g,l.lanes=N,l}function Mo(s,l,h,g){return s=$r(7,s,g,l),s.lanes=h,s}function u0(s,l,h){return s=$r(6,s,null,l),s.lanes=h,s}function QC(s){var l=$r(18,null,null,0);return l.stateNode=s,l}function d0(s,l,h){return l=$r(4,s.children!==null?s.children:[],s.key,l),l.lanes=h,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}var XC=new WeakMap;function ri(s,l){if(typeof s=="object"&&s!==null){var h=XC.get(s);return h!==void 0?h:(l={value:s,source:l,stack:Lt(l)},XC.set(s,l),l)}return{value:s,source:l,stack:Lt(l)}}var rc=[],ic=0,Zh=null,td=0,ii=[],ai=0,vs=null,Ji=1,ea="";function za(s,l){rc[ic++]=td,rc[ic++]=Zh,Zh=s,td=l}function JC(s,l,h){ii[ai++]=Ji,ii[ai++]=ea,ii[ai++]=vs,vs=s;var g=Ji;s=ea;var b=32-ue(g)-1;g&=~(1<<b),h+=1;var N=32-ue(l)+b;if(30<N){var E=b-b%5;N=(g&(1<<E)-1).toString(32),g>>=E,b-=E,Ji=1<<32-ue(l)+b|h<<b|g,ea=N+s}else Ji=1<<N|h<<b|g,ea=s}function f0(s){s.return!==null&&(za(s,1),JC(s,1,0))}function h0(s){for(;s===Zh;)Zh=rc[--ic],rc[ic]=null,td=rc[--ic],rc[ic]=null;for(;s===vs;)vs=ii[--ai],ii[ai]=null,ea=ii[--ai],ii[ai]=null,Ji=ii[--ai],ii[ai]=null}function e_(s,l){ii[ai++]=Ji,ii[ai++]=ea,ii[ai++]=vs,Ji=l.id,ea=l.overflow,vs=s}var qn=null,Gt=null,mt=!1,bs=null,si=!1,p0=Error(r(519));function xs(s){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw nd(ri(l,s)),p0}function t_(s){var l=s.stateNode,h=s.type,g=s.memoizedProps;switch(l[ct]=s,l[_t]=g,h){case"dialog":dt("cancel",l),dt("close",l);break;case"iframe":case"object":case"embed":dt("load",l);break;case"video":case"audio":for(h=0;h<Nd.length;h++)dt(Nd[h],l);break;case"source":dt("error",l);break;case"img":case"image":case"link":dt("error",l),dt("load",l);break;case"details":dt("toggle",l);break;case"input":dt("invalid",l),pC(l,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":dt("invalid",l);break;case"textarea":dt("invalid",l),gC(l,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||l.textContent===""+h||g.suppressHydrationWarning===!0||vO(l.textContent,h)?(g.popover!=null&&(dt("beforetoggle",l),dt("toggle",l)),g.onScroll!=null&&dt("scroll",l),g.onScrollEnd!=null&&dt("scrollend",l),g.onClick!=null&&(l.onclick=Ea),l=!0):l=!1,l||xs(s,!0)}function n_(s){for(qn=s.return;qn;)switch(qn.tag){case 5:case 31:case 13:si=!1;return;case 27:case 3:si=!0;return;default:qn=qn.return}}function ac(s){if(s!==qn)return!1;if(!mt)return n_(s),mt=!0,!1;var l=s.tag,h;if((h=l!==3&&l!==27)&&((h=l===5)&&(h=s.type,h=!(h!=="form"&&h!=="button")||Pb(s.type,s.memoizedProps)),h=!h),h&&Gt&&xs(s),n_(s),l===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Gt=_O(s)}else if(l===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Gt=_O(s)}else l===27?(l=Gt,Rs(s.type)?(s=Ib,Ib=null,Gt=s):Gt=l):Gt=qn?li(s.stateNode.nextSibling):null;return!0}function Do(){Gt=qn=null,mt=!1}function m0(){var s=bs;return s!==null&&(Nr===null?Nr=s:Nr.push.apply(Nr,s),bs=null),s}function nd(s){bs===null?bs=[s]:bs.push(s)}var g0=F(null),Io=null,Ra=null;function ws(s,l,h){M(g0,l._currentValue),l._currentValue=h}function Ma(s){s._currentValue=g0.current,B(g0)}function y0(s,l,h){for(;s!==null;){var g=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,g!==null&&(g.childLanes|=l)):g!==null&&(g.childLanes&l)!==l&&(g.childLanes|=l),s===h)break;s=s.return}}function v0(s,l,h,g){var b=s.child;for(b!==null&&(b.return=s);b!==null;){var N=b.dependencies;if(N!==null){var E=b.child;N=N.firstContext;e:for(;N!==null;){var D=N;N=b;for(var H=0;H<l.length;H++)if(D.context===l[H]){N.lanes|=h,D=N.alternate,D!==null&&(D.lanes|=h),y0(N.return,h,s),g||(E=null);break e}N=D.next}}else if(b.tag===18){if(E=b.return,E===null)throw Error(r(341));E.lanes|=h,N=E.alternate,N!==null&&(N.lanes|=h),y0(E,h,s),E=null}else E=b.child;if(E!==null)E.return=b;else for(E=b;E!==null;){if(E===s){E=null;break}if(b=E.sibling,b!==null){b.return=E.return,E=b;break}E=E.return}b=E}}function sc(s,l,h,g){s=null;for(var b=l,N=!1;b!==null;){if(!N){if((b.flags&524288)!==0)N=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var E=b.alternate;if(E===null)throw Error(r(387));if(E=E.memoizedProps,E!==null){var D=b.type;Lr(b.pendingProps.value,E.value)||(s!==null?s.push(D):s=[D])}}else if(b===he.current){if(E=b.alternate,E===null)throw Error(r(387));E.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(s!==null?s.push(Od):s=[Od])}b=b.return}s!==null&&v0(l,s,h,g),l.flags|=262144}function Yh(s){for(s=s.firstContext;s!==null;){if(!Lr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Lo(s){Io=s,Ra=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Kn(s){return r_(Io,s)}function Wh(s,l){return Io===null&&Lo(s),r_(s,l)}function r_(s,l){var h=l._currentValue;if(l={context:l,memoizedValue:h,next:null},Ra===null){if(s===null)throw Error(r(308));Ra=l,s.dependencies={lanes:0,firstContext:l},s.flags|=524288}else Ra=Ra.next=l;return h}var dF=typeof AbortController<"u"?AbortController:function(){var s=[],l=this.signal={aborted:!1,addEventListener:function(h,g){s.push(g)}};this.abort=function(){l.aborted=!0,s.forEach(function(h){return h()})}},fF=e.unstable_scheduleCallback,hF=e.unstable_NormalPriority,Sn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function b0(){return{controller:new dF,data:new Map,refCount:0}}function rd(s){s.refCount--,s.refCount===0&&fF(hF,function(){s.controller.abort()})}var id=null,x0=0,oc=0,lc=null;function pF(s,l){if(id===null){var h=id=[];x0=0,oc=jb(),lc={status:"pending",value:void 0,then:function(g){h.push(g)}}}return x0++,l.then(i_,i_),l}function i_(){if(--x0===0&&id!==null){lc!==null&&(lc.status="fulfilled");var s=id;id=null,oc=0,lc=null;for(var l=0;l<s.length;l++)(0,s[l])()}}function mF(s,l){var h=[],g={status:"pending",value:null,reason:null,then:function(b){h.push(b)}};return s.then(function(){g.status="fulfilled",g.value=l;for(var b=0;b<h.length;b++)(0,h[b])(l)},function(b){for(g.status="rejected",g.reason=b,b=0;b<h.length;b++)(0,h[b])(void 0)}),g}var a_=K.S;K.S=function(s,l){FA=Re(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&pF(s,l),a_!==null&&a_(s,l)};var $o=F(null);function w0(){var s=$o.current;return s!==null?s:Dt.pooledCache}function Qh(s,l){l===null?M($o,$o.current):M($o,l.pool)}function s_(){var s=w0();return s===null?null:{parent:Sn._currentValue,pool:s}}var cc=Error(r(460)),S0=Error(r(474)),Xh=Error(r(542)),Jh={then:function(){}};function o_(s){return s=s.status,s==="fulfilled"||s==="rejected"}function l_(s,l,h){switch(h=s[h],h===void 0?s.push(l):h!==l&&(l.then(Ea,Ea),l=h),l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,u_(s),s;default:if(typeof l.status=="string")l.then(Ea,Ea);else{if(s=Dt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=l,s.status="pending",s.then(function(g){if(l.status==="pending"){var b=l;b.status="fulfilled",b.value=g}},function(g){if(l.status==="pending"){var b=l;b.status="rejected",b.reason=g}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,u_(s),s}throw Bo=l,cc}}function Uo(s){try{var l=s._init;return l(s._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(Bo=h,cc):h}}var Bo=null;function c_(){if(Bo===null)throw Error(r(459));var s=Bo;return Bo=null,s}function u_(s){if(s===cc||s===Xh)throw Error(r(483))}var uc=null,ad=0;function ep(s){var l=ad;return ad+=1,uc===null&&(uc=[]),l_(uc,s,l)}function sd(s,l){l=l.props.ref,s.ref=l!==void 0?l:null}function tp(s,l){throw l.$$typeof===y?Error(r(525)):(s=Object.prototype.toString.call(l),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s)))}function d_(s){function l(W,Z){if(s){var ne=W.deletions;ne===null?(W.deletions=[Z],W.flags|=16):ne.push(Z)}}function h(W,Z){if(!s)return null;for(;Z!==null;)l(W,Z),Z=Z.sibling;return null}function g(W){for(var Z=new Map;W!==null;)W.key!==null?Z.set(W.key,W):Z.set(W.index,W),W=W.sibling;return Z}function b(W,Z){return W=Pa(W,Z),W.index=0,W.sibling=null,W}function N(W,Z,ne){return W.index=ne,s?(ne=W.alternate,ne!==null?(ne=ne.index,ne<Z?(W.flags|=67108866,Z):ne):(W.flags|=67108866,Z)):(W.flags|=1048576,Z)}function E(W){return s&&W.alternate===null&&(W.flags|=67108866),W}function D(W,Z,ne,pe){return Z===null||Z.tag!==6?(Z=u0(ne,W.mode,pe),Z.return=W,Z):(Z=b(Z,ne),Z.return=W,Z)}function H(W,Z,ne,pe){var He=ne.type;return He===w?fe(W,Z,ne.props.children,pe,ne.key):Z!==null&&(Z.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===z&&Uo(He)===Z.type)?(Z=b(Z,ne.props),sd(Z,ne),Z.return=W,Z):(Z=Vh(ne.type,ne.key,ne.props,null,W.mode,pe),sd(Z,ne),Z.return=W,Z)}function re(W,Z,ne,pe){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ne.containerInfo||Z.stateNode.implementation!==ne.implementation?(Z=d0(ne,W.mode,pe),Z.return=W,Z):(Z=b(Z,ne.children||[]),Z.return=W,Z)}function fe(W,Z,ne,pe,He){return Z===null||Z.tag!==7?(Z=Mo(ne,W.mode,pe,He),Z.return=W,Z):(Z=b(Z,ne),Z.return=W,Z)}function ge(W,Z,ne){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=u0(""+Z,W.mode,ne),Z.return=W,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case v:return ne=Vh(Z.type,Z.key,Z.props,null,W.mode,ne),sd(ne,Z),ne.return=W,ne;case x:return Z=d0(Z,W.mode,ne),Z.return=W,Z;case z:return Z=Uo(Z),ge(W,Z,ne)}if(Q(Z)||L(Z))return Z=Mo(Z,W.mode,ne,null),Z.return=W,Z;if(typeof Z.then=="function")return ge(W,ep(Z),ne);if(Z.$$typeof===_)return ge(W,Wh(W,Z),ne);tp(W,Z)}return null}function oe(W,Z,ne,pe){var He=Z!==null?Z.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return He!==null?null:D(W,Z,""+ne,pe);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return ne.key===He?H(W,Z,ne,pe):null;case x:return ne.key===He?re(W,Z,ne,pe):null;case z:return ne=Uo(ne),oe(W,Z,ne,pe)}if(Q(ne)||L(ne))return He!==null?null:fe(W,Z,ne,pe,null);if(typeof ne.then=="function")return oe(W,Z,ep(ne),pe);if(ne.$$typeof===_)return oe(W,Z,Wh(W,ne),pe);tp(W,ne)}return null}function ce(W,Z,ne,pe,He){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return W=W.get(ne)||null,D(Z,W,""+pe,He);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case v:return W=W.get(pe.key===null?ne:pe.key)||null,H(Z,W,pe,He);case x:return W=W.get(pe.key===null?ne:pe.key)||null,re(Z,W,pe,He);case z:return pe=Uo(pe),ce(W,Z,ne,pe,He)}if(Q(pe)||L(pe))return W=W.get(ne)||null,fe(Z,W,pe,He,null);if(typeof pe.then=="function")return ce(W,Z,ne,ep(pe),He);if(pe.$$typeof===_)return ce(W,Z,ne,Wh(Z,pe),He);tp(Z,pe)}return null}function Ie(W,Z,ne,pe){for(var He=null,bt=null,Be=Z,st=Z=0,pt=null;Be!==null&&st<ne.length;st++){Be.index>st?(pt=Be,Be=null):pt=Be.sibling;var xt=oe(W,Be,ne[st],pe);if(xt===null){Be===null&&(Be=pt);break}s&&Be&&xt.alternate===null&&l(W,Be),Z=N(xt,Z,st),bt===null?He=xt:bt.sibling=xt,bt=xt,Be=pt}if(st===ne.length)return h(W,Be),mt&&za(W,st),He;if(Be===null){for(;st<ne.length;st++)Be=ge(W,ne[st],pe),Be!==null&&(Z=N(Be,Z,st),bt===null?He=Be:bt.sibling=Be,bt=Be);return mt&&za(W,st),He}for(Be=g(Be);st<ne.length;st++)pt=ce(Be,W,st,ne[st],pe),pt!==null&&(s&&pt.alternate!==null&&Be.delete(pt.key===null?st:pt.key),Z=N(pt,Z,st),bt===null?He=pt:bt.sibling=pt,bt=pt);return s&&Be.forEach(function($s){return l(W,$s)}),mt&&za(W,st),He}function Ze(W,Z,ne,pe){if(ne==null)throw Error(r(151));for(var He=null,bt=null,Be=Z,st=Z=0,pt=null,xt=ne.next();Be!==null&&!xt.done;st++,xt=ne.next()){Be.index>st?(pt=Be,Be=null):pt=Be.sibling;var $s=oe(W,Be,xt.value,pe);if($s===null){Be===null&&(Be=pt);break}s&&Be&&$s.alternate===null&&l(W,Be),Z=N($s,Z,st),bt===null?He=$s:bt.sibling=$s,bt=$s,Be=pt}if(xt.done)return h(W,Be),mt&&za(W,st),He;if(Be===null){for(;!xt.done;st++,xt=ne.next())xt=ge(W,xt.value,pe),xt!==null&&(Z=N(xt,Z,st),bt===null?He=xt:bt.sibling=xt,bt=xt);return mt&&za(W,st),He}for(Be=g(Be);!xt.done;st++,xt=ne.next())xt=ce(Be,W,st,xt.value,pe),xt!==null&&(s&&xt.alternate!==null&&Be.delete(xt.key===null?st:xt.key),Z=N(xt,Z,st),bt===null?He=xt:bt.sibling=xt,bt=xt);return s&&Be.forEach(function(C9){return l(W,C9)}),mt&&za(W,st),He}function Rt(W,Z,ne,pe){if(typeof ne=="object"&&ne!==null&&ne.type===w&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:e:{for(var He=ne.key;Z!==null;){if(Z.key===He){if(He=ne.type,He===w){if(Z.tag===7){h(W,Z.sibling),pe=b(Z,ne.props.children),pe.return=W,W=pe;break e}}else if(Z.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===z&&Uo(He)===Z.type){h(W,Z.sibling),pe=b(Z,ne.props),sd(pe,ne),pe.return=W,W=pe;break e}h(W,Z);break}else l(W,Z);Z=Z.sibling}ne.type===w?(pe=Mo(ne.props.children,W.mode,pe,ne.key),pe.return=W,W=pe):(pe=Vh(ne.type,ne.key,ne.props,null,W.mode,pe),sd(pe,ne),pe.return=W,W=pe)}return E(W);case x:e:{for(He=ne.key;Z!==null;){if(Z.key===He)if(Z.tag===4&&Z.stateNode.containerInfo===ne.containerInfo&&Z.stateNode.implementation===ne.implementation){h(W,Z.sibling),pe=b(Z,ne.children||[]),pe.return=W,W=pe;break e}else{h(W,Z);break}else l(W,Z);Z=Z.sibling}pe=d0(ne,W.mode,pe),pe.return=W,W=pe}return E(W);case z:return ne=Uo(ne),Rt(W,Z,ne,pe)}if(Q(ne))return Ie(W,Z,ne,pe);if(L(ne)){if(He=L(ne),typeof He!="function")throw Error(r(150));return ne=He.call(ne),Ze(W,Z,ne,pe)}if(typeof ne.then=="function")return Rt(W,Z,ep(ne),pe);if(ne.$$typeof===_)return Rt(W,Z,Wh(W,ne),pe);tp(W,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,Z!==null&&Z.tag===6?(h(W,Z.sibling),pe=b(Z,ne),pe.return=W,W=pe):(h(W,Z),pe=u0(ne,W.mode,pe),pe.return=W,W=pe),E(W)):h(W,Z)}return function(W,Z,ne,pe){try{ad=0;var He=Rt(W,Z,ne,pe);return uc=null,He}catch(Be){if(Be===cc||Be===Xh)throw Be;var bt=$r(29,Be,null,W.mode);return bt.lanes=pe,bt.return=W,bt}}}var Fo=d_(!0),f_=d_(!1),Ss=!1;function j0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function N0(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function js(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Ns(s,l,h){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(St&2)!==0){var b=g.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),g.pending=l,l=Gh(s),YC(s,null,h),l}return Hh(s,g,l,h),Gh(s)}function od(s,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194048)!==0)){var g=l.lanes;g&=s.pendingLanes,h|=g,l.lanes=h,_h(s,h)}}function k0(s,l){var h=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var b=null,N=null;if(h=h.firstBaseUpdate,h!==null){do{var E={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};N===null?b=N=E:N=N.next=E,h=h.next}while(h!==null);N===null?b=N=l:N=N.next=l}else b=N=l;h={baseState:g.baseState,firstBaseUpdate:b,lastBaseUpdate:N,shared:g.shared,callbacks:g.callbacks},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=l:s.next=l,h.lastBaseUpdate=l}var C0=!1;function ld(){if(C0){var s=lc;if(s!==null)throw s}}function cd(s,l,h,g){C0=!1;var b=s.updateQueue;Ss=!1;var N=b.firstBaseUpdate,E=b.lastBaseUpdate,D=b.shared.pending;if(D!==null){b.shared.pending=null;var H=D,re=H.next;H.next=null,E===null?N=re:E.next=re,E=H;var fe=s.alternate;fe!==null&&(fe=fe.updateQueue,D=fe.lastBaseUpdate,D!==E&&(D===null?fe.firstBaseUpdate=re:D.next=re,fe.lastBaseUpdate=H))}if(N!==null){var ge=b.baseState;E=0,fe=re=H=null,D=N;do{var oe=D.lane&-536870913,ce=oe!==D.lane;if(ce?(ht&oe)===oe:(g&oe)===oe){oe!==0&&oe===oc&&(C0=!0),fe!==null&&(fe=fe.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var Ie=s,Ze=D;oe=l;var Rt=h;switch(Ze.tag){case 1:if(Ie=Ze.payload,typeof Ie=="function"){ge=Ie.call(Rt,ge,oe);break e}ge=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Ze.payload,oe=typeof Ie=="function"?Ie.call(Rt,ge,oe):Ie,oe==null)break e;ge=m({},ge,oe);break e;case 2:Ss=!0}}oe=D.callback,oe!==null&&(s.flags|=64,ce&&(s.flags|=8192),ce=b.callbacks,ce===null?b.callbacks=[oe]:ce.push(oe))}else ce={lane:oe,tag:D.tag,payload:D.payload,callback:D.callback,next:null},fe===null?(re=fe=ce,H=ge):fe=fe.next=ce,E|=oe;if(D=D.next,D===null){if(D=b.shared.pending,D===null)break;ce=D,D=ce.next,ce.next=null,b.lastBaseUpdate=ce,b.shared.pending=null}}while(!0);fe===null&&(H=ge),b.baseState=H,b.firstBaseUpdate=re,b.lastBaseUpdate=fe,N===null&&(b.shared.lanes=0),Os|=E,s.lanes=E,s.memoizedState=ge}}function h_(s,l){if(typeof s!="function")throw Error(r(191,s));s.call(l)}function p_(s,l){var h=s.callbacks;if(h!==null)for(s.callbacks=null,s=0;s<h.length;s++)h_(h[s],l)}var dc=F(null),np=F(0);function m_(s,l){s=Ka,M(np,s),M(dc,l),Ka=s|l.baseLanes}function _0(){M(np,Ka),M(dc,dc.current)}function A0(){Ka=np.current,B(dc),B(np)}var Ur=F(null),oi=null;function ks(s){var l=s.alternate;M(mn,mn.current&1),M(Ur,s),oi===null&&(l===null||dc.current!==null||l.memoizedState!==null)&&(oi=s)}function O0(s){M(mn,mn.current),M(Ur,s),oi===null&&(oi=s)}function g_(s){s.tag===22?(M(mn,mn.current),M(Ur,s),oi===null&&(oi=s)):Cs()}function Cs(){M(mn,mn.current),M(Ur,Ur.current)}function Br(s){B(Ur),oi===s&&(oi=null),B(mn)}var mn=F(0);function rp(s){for(var l=s;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Mb(h)||Db(h)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Da=0,tt=null,Pt=null,jn=null,ip=!1,fc=!1,qo=!1,ap=0,ud=0,hc=null,gF=0;function cn(){throw Error(r(321))}function E0(s,l){if(l===null)return!1;for(var h=0;h<l.length&&h<s.length;h++)if(!Lr(s[h],l[h]))return!1;return!0}function T0(s,l,h,g,b,N){return Da=N,tt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,K.H=s===null||s.memoizedState===null?J_:G0,qo=!1,N=h(g,b),qo=!1,fc&&(N=v_(l,h,g,b)),y_(s),N}function y_(s){K.H=hd;var l=Pt!==null&&Pt.next!==null;if(Da=0,jn=Pt=tt=null,ip=!1,ud=0,hc=null,l)throw Error(r(300));s===null||Nn||(s=s.dependencies,s!==null&&Yh(s)&&(Nn=!0))}function v_(s,l,h,g){tt=s;var b=0;do{if(fc&&(hc=null),ud=0,fc=!1,25<=b)throw Error(r(301));if(b+=1,jn=Pt=null,s.updateQueue!=null){var N=s.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}K.H=eA,N=l(h,g)}while(fc);return N}function yF(){var s=K.H,l=s.useState()[0];return l=typeof l.then=="function"?dd(l):l,s=s.useState()[0],(Pt!==null?Pt.memoizedState:null)!==s&&(tt.flags|=1024),l}function P0(){var s=ap!==0;return ap=0,s}function z0(s,l,h){l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~h}function R0(s){if(ip){for(s=s.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}ip=!1}Da=0,jn=Pt=tt=null,fc=!1,ud=ap=0,hc=null}function cr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?tt.memoizedState=jn=s:jn=jn.next=s,jn}function gn(){if(Pt===null){var s=tt.alternate;s=s!==null?s.memoizedState:null}else s=Pt.next;var l=jn===null?tt.memoizedState:jn.next;if(l!==null)jn=l,Pt=s;else{if(s===null)throw tt.alternate===null?Error(r(467)):Error(r(310));Pt=s,s={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},jn===null?tt.memoizedState=jn=s:jn=jn.next=s}return jn}function sp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function dd(s){var l=ud;return ud+=1,hc===null&&(hc=[]),s=l_(hc,s,l),l=tt,(jn===null?l.memoizedState:jn.next)===null&&(l=l.alternate,K.H=l===null||l.memoizedState===null?J_:G0),s}function op(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return dd(s);if(s.$$typeof===_)return Kn(s)}throw Error(r(438,String(s)))}function M0(s){var l=null,h=tt.updateQueue;if(h!==null&&(l=h.memoCache),l==null){var g=tt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(l={data:g.data.map(function(b){return b.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),h===null&&(h=sp(),tt.updateQueue=h),h.memoCache=l,h=l.data[l.index],h===void 0)for(h=l.data[l.index]=Array(s),g=0;g<s;g++)h[g]=q;return l.index++,h}function Ia(s,l){return typeof l=="function"?l(s):l}function lp(s){var l=gn();return D0(l,Pt,s)}function D0(s,l,h){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var b=s.baseQueue,N=g.pending;if(N!==null){if(b!==null){var E=b.next;b.next=N.next,N.next=E}l.baseQueue=b=N,g.pending=null}if(N=s.baseState,b===null)s.memoizedState=N;else{l=b.next;var D=E=null,H=null,re=l,fe=!1;do{var ge=re.lane&-536870913;if(ge!==re.lane?(ht&ge)===ge:(Da&ge)===ge){var oe=re.revertLane;if(oe===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),ge===oc&&(fe=!0);else if((Da&oe)===oe){re=re.next,oe===oc&&(fe=!0);continue}else ge={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},H===null?(D=H=ge,E=N):H=H.next=ge,tt.lanes|=oe,Os|=oe;ge=re.action,qo&&h(N,ge),N=re.hasEagerState?re.eagerState:h(N,ge)}else oe={lane:ge,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},H===null?(D=H=oe,E=N):H=H.next=oe,tt.lanes|=ge,Os|=ge;re=re.next}while(re!==null&&re!==l);if(H===null?E=N:H.next=D,!Lr(N,s.memoizedState)&&(Nn=!0,fe&&(h=lc,h!==null)))throw h;s.memoizedState=N,s.baseState=E,s.baseQueue=H,g.lastRenderedState=N}return b===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function I0(s){var l=gn(),h=l.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var g=h.dispatch,b=h.pending,N=l.memoizedState;if(b!==null){h.pending=null;var E=b=b.next;do N=s(N,E.action),E=E.next;while(E!==b);Lr(N,l.memoizedState)||(Nn=!0),l.memoizedState=N,l.baseQueue===null&&(l.baseState=N),h.lastRenderedState=N}return[N,g]}function b_(s,l,h){var g=tt,b=gn(),N=mt;if(N){if(h===void 0)throw Error(r(407));h=h()}else h=l();var E=!Lr((Pt||b).memoizedState,h);if(E&&(b.memoizedState=h,Nn=!0),b=b.queue,U0(S_.bind(null,g,b,s),[s]),b.getSnapshot!==l||E||jn!==null&&jn.memoizedState.tag&1){if(g.flags|=2048,pc(9,{destroy:void 0},w_.bind(null,g,b,h,l),null),Dt===null)throw Error(r(349));N||(Da&127)!==0||x_(g,l,h)}return h}function x_(s,l,h){s.flags|=16384,s={getSnapshot:l,value:h},l=tt.updateQueue,l===null?(l=sp(),tt.updateQueue=l,l.stores=[s]):(h=l.stores,h===null?l.stores=[s]:h.push(s))}function w_(s,l,h,g){l.value=h,l.getSnapshot=g,j_(l)&&N_(s)}function S_(s,l,h){return h(function(){j_(l)&&N_(s)})}function j_(s){var l=s.getSnapshot;s=s.value;try{var h=l();return!Lr(s,h)}catch{return!0}}function N_(s){var l=Ro(s,2);l!==null&&kr(l,s,2)}function L0(s){var l=cr();if(typeof s=="function"){var h=s;if(s=h(),qo){$t(!0);try{h()}finally{$t(!1)}}}return l.memoizedState=l.baseState=s,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:s},l}function k_(s,l,h,g){return s.baseState=h,D0(s,Pt,typeof g=="function"?g:Ia)}function vF(s,l,h,g,b){if(dp(s))throw Error(r(485));if(s=l.action,s!==null){var N={payload:b,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){N.listeners.push(E)}};K.T!==null?h(!0):N.isTransition=!1,g(N),h=l.pending,h===null?(N.next=l.pending=N,C_(l,N)):(N.next=h.next,l.pending=h.next=N)}}function C_(s,l){var h=l.action,g=l.payload,b=s.state;if(l.isTransition){var N=K.T,E={};K.T=E;try{var D=h(b,g),H=K.S;H!==null&&H(E,D),__(s,l,D)}catch(re){$0(s,l,re)}finally{N!==null&&E.types!==null&&(N.types=E.types),K.T=N}}else try{N=h(b,g),__(s,l,N)}catch(re){$0(s,l,re)}}function __(s,l,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){A_(s,l,g)},function(g){return $0(s,l,g)}):A_(s,l,h)}function A_(s,l,h){l.status="fulfilled",l.value=h,O_(l),s.state=h,l=s.pending,l!==null&&(h=l.next,h===l?s.pending=null:(h=h.next,l.next=h,C_(s,h)))}function $0(s,l,h){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do l.status="rejected",l.reason=h,O_(l),l=l.next;while(l!==g)}s.action=null}function O_(s){s=s.listeners;for(var l=0;l<s.length;l++)(0,s[l])()}function E_(s,l){return l}function T_(s,l){if(mt){var h=Dt.formState;if(h!==null){e:{var g=tt;if(mt){if(Gt){t:{for(var b=Gt,N=si;b.nodeType!==8;){if(!N){b=null;break t}if(b=li(b.nextSibling),b===null){b=null;break t}}N=b.data,b=N==="F!"||N==="F"?b:null}if(b){Gt=li(b.nextSibling),g=b.data==="F!";break e}}xs(g)}g=!1}g&&(l=h[0])}}return h=cr(),h.memoizedState=h.baseState=l,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:E_,lastRenderedState:l},h.queue=g,h=W_.bind(null,tt,g),g.dispatch=h,g=L0(!1),N=H0.bind(null,tt,!1,g.queue),g=cr(),b={state:l,dispatch:null,action:s,pending:null},g.queue=b,h=vF.bind(null,tt,b,N,h),b.dispatch=h,g.memoizedState=s,[l,h,!1]}function P_(s){var l=gn();return z_(l,Pt,s)}function z_(s,l,h){if(l=D0(s,l,E_)[0],s=lp(Ia)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var g=dd(l)}catch(E){throw E===cc?Xh:E}else g=l;l=gn();var b=l.queue,N=b.dispatch;return h!==l.memoizedState&&(tt.flags|=2048,pc(9,{destroy:void 0},bF.bind(null,b,h),null)),[g,N,s]}function bF(s,l){s.action=l}function R_(s){var l=gn(),h=Pt;if(h!==null)return z_(l,h,s);gn(),l=l.memoizedState,h=gn();var g=h.queue.dispatch;return h.memoizedState=s,[l,g,!1]}function pc(s,l,h,g){return s={tag:s,create:h,deps:g,inst:l,next:null},l=tt.updateQueue,l===null&&(l=sp(),tt.updateQueue=l),h=l.lastEffect,h===null?l.lastEffect=s.next=s:(g=h.next,h.next=s,s.next=g,l.lastEffect=s),s}function M_(){return gn().memoizedState}function cp(s,l,h,g){var b=cr();tt.flags|=s,b.memoizedState=pc(1|l,{destroy:void 0},h,g===void 0?null:g)}function up(s,l,h,g){var b=gn();g=g===void 0?null:g;var N=b.memoizedState.inst;Pt!==null&&g!==null&&E0(g,Pt.memoizedState.deps)?b.memoizedState=pc(l,N,h,g):(tt.flags|=s,b.memoizedState=pc(1|l,N,h,g))}function D_(s,l){cp(8390656,8,s,l)}function U0(s,l){up(2048,8,s,l)}function xF(s){tt.flags|=4;var l=tt.updateQueue;if(l===null)l=sp(),tt.updateQueue=l,l.events=[s];else{var h=l.events;h===null?l.events=[s]:h.push(s)}}function I_(s){var l=gn().memoizedState;return xF({ref:l,nextImpl:s}),function(){if((St&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function L_(s,l){return up(4,2,s,l)}function $_(s,l){return up(4,4,s,l)}function U_(s,l){if(typeof l=="function"){s=s();var h=l(s);return function(){typeof h=="function"?h():l(null)}}if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function B_(s,l,h){h=h!=null?h.concat([s]):null,up(4,4,U_.bind(null,l,s),h)}function B0(){}function F_(s,l){var h=gn();l=l===void 0?null:l;var g=h.memoizedState;return l!==null&&E0(l,g[1])?g[0]:(h.memoizedState=[s,l],s)}function q_(s,l){var h=gn();l=l===void 0?null:l;var g=h.memoizedState;if(l!==null&&E0(l,g[1]))return g[0];if(g=s(),qo){$t(!0);try{s()}finally{$t(!1)}}return h.memoizedState=[g,l],g}function F0(s,l,h){return h===void 0||(Da&1073741824)!==0&&(ht&261930)===0?s.memoizedState=l:(s.memoizedState=h,s=KA(),tt.lanes|=s,Os|=s,h)}function K_(s,l,h,g){return Lr(h,l)?h:dc.current!==null?(s=F0(s,h,g),Lr(s,l)||(Nn=!0),s):(Da&42)===0||(Da&1073741824)!==0&&(ht&261930)===0?(Nn=!0,s.memoizedState=h):(s=KA(),tt.lanes|=s,Os|=s,l)}function H_(s,l,h,g,b){var N=X.p;X.p=N!==0&&8>N?N:8;var E=K.T,D={};K.T=D,H0(s,!1,l,h);try{var H=b(),re=K.S;if(re!==null&&re(D,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var fe=mF(H,g);fd(s,l,fe,Kr(s))}else fd(s,l,g,Kr(s))}catch(ge){fd(s,l,{then:function(){},status:"rejected",reason:ge},Kr())}finally{X.p=N,E!==null&&D.types!==null&&(E.types=D.types),K.T=E}}function wF(){}function q0(s,l,h,g){if(s.tag!==5)throw Error(r(476));var b=G_(s).queue;H_(s,b,l,ye,h===null?wF:function(){return V_(s),h(g)})}function G_(s){var l=s.memoizedState;if(l!==null)return l;l={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:ye},next:null};var h={};return l.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:h},next:null},s.memoizedState=l,s=s.alternate,s!==null&&(s.memoizedState=l),l}function V_(s){var l=G_(s);l.next===null&&(l=s.alternate.memoizedState),fd(s,l.next.queue,{},Kr())}function K0(){return Kn(Od)}function Z_(){return gn().memoizedState}function Y_(){return gn().memoizedState}function SF(s){for(var l=s.return;l!==null;){switch(l.tag){case 24:case 3:var h=Kr();s=js(h);var g=Ns(l,s,h);g!==null&&(kr(g,l,h),od(g,l,h)),l={cache:b0()},s.payload=l;return}l=l.return}}function jF(s,l,h){var g=Kr();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},dp(s)?Q_(l,h):(h=l0(s,l,h,g),h!==null&&(kr(h,s,g),X_(h,l,g)))}function W_(s,l,h){var g=Kr();fd(s,l,h,g)}function fd(s,l,h,g){var b={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(dp(s))Q_(l,b);else{var N=s.alternate;if(s.lanes===0&&(N===null||N.lanes===0)&&(N=l.lastRenderedReducer,N!==null))try{var E=l.lastRenderedState,D=N(E,h);if(b.hasEagerState=!0,b.eagerState=D,Lr(D,E))return Hh(s,l,b,0),Dt===null&&Kh(),!1}catch{}if(h=l0(s,l,b,g),h!==null)return kr(h,s,g),X_(h,l,g),!0}return!1}function H0(s,l,h,g){if(g={lane:2,revertLane:jb(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},dp(s)){if(l)throw Error(r(479))}else l=l0(s,h,g,2),l!==null&&kr(l,s,2)}function dp(s){var l=s.alternate;return s===tt||l!==null&&l===tt}function Q_(s,l){fc=ip=!0;var h=s.pending;h===null?l.next=l:(l.next=h.next,h.next=l),s.pending=l}function X_(s,l,h){if((h&4194048)!==0){var g=l.lanes;g&=s.pendingLanes,h|=g,l.lanes=h,_h(s,h)}}var hd={readContext:Kn,use:op,useCallback:cn,useContext:cn,useEffect:cn,useImperativeHandle:cn,useLayoutEffect:cn,useInsertionEffect:cn,useMemo:cn,useReducer:cn,useRef:cn,useState:cn,useDebugValue:cn,useDeferredValue:cn,useTransition:cn,useSyncExternalStore:cn,useId:cn,useHostTransitionStatus:cn,useFormState:cn,useActionState:cn,useOptimistic:cn,useMemoCache:cn,useCacheRefresh:cn};hd.useEffectEvent=cn;var J_={readContext:Kn,use:op,useCallback:function(s,l){return cr().memoizedState=[s,l===void 0?null:l],s},useContext:Kn,useEffect:D_,useImperativeHandle:function(s,l,h){h=h!=null?h.concat([s]):null,cp(4194308,4,U_.bind(null,l,s),h)},useLayoutEffect:function(s,l){return cp(4194308,4,s,l)},useInsertionEffect:function(s,l){cp(4,2,s,l)},useMemo:function(s,l){var h=cr();l=l===void 0?null:l;var g=s();if(qo){$t(!0);try{s()}finally{$t(!1)}}return h.memoizedState=[g,l],g},useReducer:function(s,l,h){var g=cr();if(h!==void 0){var b=h(l);if(qo){$t(!0);try{h(l)}finally{$t(!1)}}}else b=l;return g.memoizedState=g.baseState=b,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:b},g.queue=s,s=s.dispatch=jF.bind(null,tt,s),[g.memoizedState,s]},useRef:function(s){var l=cr();return s={current:s},l.memoizedState=s},useState:function(s){s=L0(s);var l=s.queue,h=W_.bind(null,tt,l);return l.dispatch=h,[s.memoizedState,h]},useDebugValue:B0,useDeferredValue:function(s,l){var h=cr();return F0(h,s,l)},useTransition:function(){var s=L0(!1);return s=H_.bind(null,tt,s.queue,!0,!1),cr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,l,h){var g=tt,b=cr();if(mt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=l(),Dt===null)throw Error(r(349));(ht&127)!==0||x_(g,l,h)}b.memoizedState=h;var N={value:h,getSnapshot:l};return b.queue=N,D_(S_.bind(null,g,N,s),[s]),g.flags|=2048,pc(9,{destroy:void 0},w_.bind(null,g,N,h,l),null),h},useId:function(){var s=cr(),l=Dt.identifierPrefix;if(mt){var h=ea,g=Ji;h=(g&~(1<<32-ue(g)-1)).toString(32)+h,l="_"+l+"R_"+h,h=ap++,0<h&&(l+="H"+h.toString(32)),l+="_"}else h=gF++,l="_"+l+"r_"+h.toString(32)+"_";return s.memoizedState=l},useHostTransitionStatus:K0,useFormState:T_,useActionState:T_,useOptimistic:function(s){var l=cr();l.memoizedState=l.baseState=s;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=h,l=H0.bind(null,tt,!0,h),h.dispatch=l,[s,l]},useMemoCache:M0,useCacheRefresh:function(){return cr().memoizedState=SF.bind(null,tt)},useEffectEvent:function(s){var l=cr(),h={impl:s};return l.memoizedState=h,function(){if((St&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},G0={readContext:Kn,use:op,useCallback:F_,useContext:Kn,useEffect:U0,useImperativeHandle:B_,useInsertionEffect:L_,useLayoutEffect:$_,useMemo:q_,useReducer:lp,useRef:M_,useState:function(){return lp(Ia)},useDebugValue:B0,useDeferredValue:function(s,l){var h=gn();return K_(h,Pt.memoizedState,s,l)},useTransition:function(){var s=lp(Ia)[0],l=gn().memoizedState;return[typeof s=="boolean"?s:dd(s),l]},useSyncExternalStore:b_,useId:Z_,useHostTransitionStatus:K0,useFormState:P_,useActionState:P_,useOptimistic:function(s,l){var h=gn();return k_(h,Pt,s,l)},useMemoCache:M0,useCacheRefresh:Y_};G0.useEffectEvent=I_;var eA={readContext:Kn,use:op,useCallback:F_,useContext:Kn,useEffect:U0,useImperativeHandle:B_,useInsertionEffect:L_,useLayoutEffect:$_,useMemo:q_,useReducer:I0,useRef:M_,useState:function(){return I0(Ia)},useDebugValue:B0,useDeferredValue:function(s,l){var h=gn();return Pt===null?F0(h,s,l):K_(h,Pt.memoizedState,s,l)},useTransition:function(){var s=I0(Ia)[0],l=gn().memoizedState;return[typeof s=="boolean"?s:dd(s),l]},useSyncExternalStore:b_,useId:Z_,useHostTransitionStatus:K0,useFormState:R_,useActionState:R_,useOptimistic:function(s,l){var h=gn();return Pt!==null?k_(h,Pt,s,l):(h.baseState=s,[s,h.queue.dispatch])},useMemoCache:M0,useCacheRefresh:Y_};eA.useEffectEvent=I_;function V0(s,l,h,g){l=s.memoizedState,h=h(g,l),h=h==null?l:m({},l,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}var Z0={enqueueSetState:function(s,l,h){s=s._reactInternals;var g=Kr(),b=js(g);b.payload=l,h!=null&&(b.callback=h),l=Ns(s,b,g),l!==null&&(kr(l,s,g),od(l,s,g))},enqueueReplaceState:function(s,l,h){s=s._reactInternals;var g=Kr(),b=js(g);b.tag=1,b.payload=l,h!=null&&(b.callback=h),l=Ns(s,b,g),l!==null&&(kr(l,s,g),od(l,s,g))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var h=Kr(),g=js(h);g.tag=2,l!=null&&(g.callback=l),l=Ns(s,g,h),l!==null&&(kr(l,s,h),od(l,s,h))}};function tA(s,l,h,g,b,N,E){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,N,E):l.prototype&&l.prototype.isPureReactComponent?!Ju(h,g)||!Ju(b,N):!0}function nA(s,l,h,g){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,g),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,g),l.state!==s&&Z0.enqueueReplaceState(l,l.state,null)}function Ko(s,l){var h=l;if("ref"in l){h={};for(var g in l)g!=="ref"&&(h[g]=l[g])}if(s=s.defaultProps){h===l&&(h=m({},h));for(var b in s)h[b]===void 0&&(h[b]=s[b])}return h}function rA(s){qh(s)}function iA(s){console.error(s)}function aA(s){qh(s)}function fp(s,l){try{var h=s.onUncaughtError;h(l.value,{componentStack:l.stack})}catch(g){setTimeout(function(){throw g})}}function sA(s,l,h){try{var g=s.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Y0(s,l,h){return h=js(h),h.tag=3,h.payload={element:null},h.callback=function(){fp(s,l)},h}function oA(s){return s=js(s),s.tag=3,s}function lA(s,l,h,g){var b=h.type.getDerivedStateFromError;if(typeof b=="function"){var N=g.value;s.payload=function(){return b(N)},s.callback=function(){sA(l,h,g)}}var E=h.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(s.callback=function(){sA(l,h,g),typeof b!="function"&&(Es===null?Es=new Set([this]):Es.add(this));var D=g.stack;this.componentDidCatch(g.value,{componentStack:D!==null?D:""})})}function NF(s,l,h,g,b){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(l=h.alternate,l!==null&&sc(l,h,b,!0),h=Ur.current,h!==null){switch(h.tag){case 31:case 13:return oi===null?Np():h.alternate===null&&un===0&&(un=3),h.flags&=-257,h.flags|=65536,h.lanes=b,g===Jh?h.flags|=16384:(l=h.updateQueue,l===null?h.updateQueue=new Set([g]):l.add(g),xb(s,g,b)),!1;case 22:return h.flags|=65536,g===Jh?h.flags|=16384:(l=h.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=l):(h=l.retryQueue,h===null?l.retryQueue=new Set([g]):h.add(g)),xb(s,g,b)),!1}throw Error(r(435,h.tag))}return xb(s,g,b),Np(),!1}if(mt)return l=Ur.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=b,g!==p0&&(s=Error(r(422),{cause:g}),nd(ri(s,h)))):(g!==p0&&(l=Error(r(423),{cause:g}),nd(ri(l,h))),s=s.current.alternate,s.flags|=65536,b&=-b,s.lanes|=b,g=ri(g,h),b=Y0(s.stateNode,g,b),k0(s,b),un!==4&&(un=2)),!1;var N=Error(r(520),{cause:g});if(N=ri(N,h),wd===null?wd=[N]:wd.push(N),un!==4&&(un=2),l===null)return!0;g=ri(g,h),h=l;do{switch(h.tag){case 3:return h.flags|=65536,s=b&-b,h.lanes|=s,s=Y0(h.stateNode,g,s),k0(h,s),!1;case 1:if(l=h.type,N=h.stateNode,(h.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(Es===null||!Es.has(N))))return h.flags|=65536,b&=-b,h.lanes|=b,b=oA(b),lA(b,s,h,g),k0(h,b),!1}h=h.return}while(h!==null);return!1}var W0=Error(r(461)),Nn=!1;function Hn(s,l,h,g){l.child=s===null?f_(l,null,h,g):Fo(l,s.child,h,g)}function cA(s,l,h,g,b){h=h.render;var N=l.ref;if("ref"in g){var E={};for(var D in g)D!=="ref"&&(E[D]=g[D])}else E=g;return Lo(l),g=T0(s,l,h,E,N,b),D=P0(),s!==null&&!Nn?(z0(s,l,b),La(s,l,b)):(mt&&D&&f0(l),l.flags|=1,Hn(s,l,g,b),l.child)}function uA(s,l,h,g,b){if(s===null){var N=h.type;return typeof N=="function"&&!c0(N)&&N.defaultProps===void 0&&h.compare===null?(l.tag=15,l.type=N,dA(s,l,N,g,b)):(s=Vh(h.type,null,g,l,l.mode,b),s.ref=l.ref,s.return=l,l.child=s)}if(N=s.child,!ib(s,b)){var E=N.memoizedProps;if(h=h.compare,h=h!==null?h:Ju,h(E,g)&&s.ref===l.ref)return La(s,l,b)}return l.flags|=1,s=Pa(N,g),s.ref=l.ref,s.return=l,l.child=s}function dA(s,l,h,g,b){if(s!==null){var N=s.memoizedProps;if(Ju(N,g)&&s.ref===l.ref)if(Nn=!1,l.pendingProps=g=N,ib(s,b))(s.flags&131072)!==0&&(Nn=!0);else return l.lanes=s.lanes,La(s,l,b)}return Q0(s,l,h,g,b)}function fA(s,l,h,g){var b=g.children,N=s!==null?s.memoizedState:null;if(s===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((l.flags&128)!==0){if(N=N!==null?N.baseLanes|h:h,s!==null){for(g=l.child=s.child,b=0;g!==null;)b=b|g.lanes|g.childLanes,g=g.sibling;g=b&~N}else g=0,l.child=null;return hA(s,l,N,h,g)}if((h&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},s!==null&&Qh(l,N!==null?N.cachePool:null),N!==null?m_(l,N):_0(),g_(l);else return g=l.lanes=536870912,hA(s,l,N!==null?N.baseLanes|h:h,h,g)}else N!==null?(Qh(l,N.cachePool),m_(l,N),Cs(),l.memoizedState=null):(s!==null&&Qh(l,null),_0(),Cs());return Hn(s,l,b,h),l.child}function pd(s,l){return s!==null&&s.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function hA(s,l,h,g,b){var N=w0();return N=N===null?null:{parent:Sn._currentValue,pool:N},l.memoizedState={baseLanes:h,cachePool:N},s!==null&&Qh(l,null),_0(),g_(l),s!==null&&sc(s,l,g,!0),l.childLanes=b,null}function hp(s,l){return l=mp({mode:l.mode,children:l.children},s.mode),l.ref=s.ref,s.child=l,l.return=s,l}function pA(s,l,h){return Fo(l,s.child,null,h),s=hp(l,l.pendingProps),s.flags|=2,Br(l),l.memoizedState=null,s}function kF(s,l,h){var g=l.pendingProps,b=(l.flags&128)!==0;if(l.flags&=-129,s===null){if(mt){if(g.mode==="hidden")return s=hp(l,g),l.lanes=536870912,pd(null,s);if(O0(l),(s=Gt)?(s=CO(s,si),s=s!==null&&s.data==="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:vs!==null?{id:Ji,overflow:ea}:null,retryLane:536870912,hydrationErrors:null},h=QC(s),h.return=l,l.child=h,qn=l,Gt=null)):s=null,s===null)throw xs(l);return l.lanes=536870912,null}return hp(l,g)}var N=s.memoizedState;if(N!==null){var E=N.dehydrated;if(O0(l),b)if(l.flags&256)l.flags&=-257,l=pA(s,l,h);else if(l.memoizedState!==null)l.child=s.child,l.flags|=128,l=null;else throw Error(r(558));else if(Nn||sc(s,l,h,!1),b=(h&s.childLanes)!==0,Nn||b){if(g=Dt,g!==null&&(E=Ah(g,h),E!==0&&E!==N.retryLane))throw N.retryLane=E,Ro(s,E),kr(g,s,E),W0;Np(),l=pA(s,l,h)}else s=N.treeContext,Gt=li(E.nextSibling),qn=l,mt=!0,bs=null,si=!1,s!==null&&e_(l,s),l=hp(l,g),l.flags|=4096;return l}return s=Pa(s.child,{mode:g.mode,children:g.children}),s.ref=l.ref,l.child=s,s.return=l,s}function pp(s,l){var h=l.ref;if(h===null)s!==null&&s.ref!==null&&(l.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(s===null||s.ref!==h)&&(l.flags|=4194816)}}function Q0(s,l,h,g,b){return Lo(l),h=T0(s,l,h,g,void 0,b),g=P0(),s!==null&&!Nn?(z0(s,l,b),La(s,l,b)):(mt&&g&&f0(l),l.flags|=1,Hn(s,l,h,b),l.child)}function mA(s,l,h,g,b,N){return Lo(l),l.updateQueue=null,h=v_(l,g,h,b),y_(s),g=P0(),s!==null&&!Nn?(z0(s,l,N),La(s,l,N)):(mt&&g&&f0(l),l.flags|=1,Hn(s,l,h,N),l.child)}function gA(s,l,h,g,b){if(Lo(l),l.stateNode===null){var N=nc,E=h.contextType;typeof E=="object"&&E!==null&&(N=Kn(E)),N=new h(g,N),l.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=Z0,l.stateNode=N,N._reactInternals=l,N=l.stateNode,N.props=g,N.state=l.memoizedState,N.refs={},j0(l),E=h.contextType,N.context=typeof E=="object"&&E!==null?Kn(E):nc,N.state=l.memoizedState,E=h.getDerivedStateFromProps,typeof E=="function"&&(V0(l,h,E,g),N.state=l.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(E=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),E!==N.state&&Z0.enqueueReplaceState(N,N.state,null),cd(l,g,N,b),ld(),N.state=l.memoizedState),typeof N.componentDidMount=="function"&&(l.flags|=4194308),g=!0}else if(s===null){N=l.stateNode;var D=l.memoizedProps,H=Ko(h,D);N.props=H;var re=N.context,fe=h.contextType;E=nc,typeof fe=="object"&&fe!==null&&(E=Kn(fe));var ge=h.getDerivedStateFromProps;fe=typeof ge=="function"||typeof N.getSnapshotBeforeUpdate=="function",D=l.pendingProps!==D,fe||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(D||re!==E)&&nA(l,N,g,E),Ss=!1;var oe=l.memoizedState;N.state=oe,cd(l,g,N,b),ld(),re=l.memoizedState,D||oe!==re||Ss?(typeof ge=="function"&&(V0(l,h,ge,g),re=l.memoizedState),(H=Ss||tA(l,h,H,g,oe,re,E))?(fe||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"&&(l.flags|=4194308)):(typeof N.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=g,l.memoizedState=re),N.props=g,N.state=re,N.context=E,g=H):(typeof N.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{N=l.stateNode,N0(s,l),E=l.memoizedProps,fe=Ko(h,E),N.props=fe,ge=l.pendingProps,oe=N.context,re=h.contextType,H=nc,typeof re=="object"&&re!==null&&(H=Kn(re)),D=h.getDerivedStateFromProps,(re=typeof D=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(E!==ge||oe!==H)&&nA(l,N,g,H),Ss=!1,oe=l.memoizedState,N.state=oe,cd(l,g,N,b),ld();var ce=l.memoizedState;E!==ge||oe!==ce||Ss||s!==null&&s.dependencies!==null&&Yh(s.dependencies)?(typeof D=="function"&&(V0(l,h,D,g),ce=l.memoizedState),(fe=Ss||tA(l,h,fe,g,oe,ce,H)||s!==null&&s.dependencies!==null&&Yh(s.dependencies))?(re||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(g,ce,H),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(g,ce,H)),typeof N.componentDidUpdate=="function"&&(l.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof N.componentDidUpdate!="function"||E===s.memoizedProps&&oe===s.memoizedState||(l.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||E===s.memoizedProps&&oe===s.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=ce),N.props=g,N.state=ce,N.context=H,g=fe):(typeof N.componentDidUpdate!="function"||E===s.memoizedProps&&oe===s.memoizedState||(l.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||E===s.memoizedProps&&oe===s.memoizedState||(l.flags|=1024),g=!1)}return N=g,pp(s,l),g=(l.flags&128)!==0,N||g?(N=l.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:N.render(),l.flags|=1,s!==null&&g?(l.child=Fo(l,s.child,null,b),l.child=Fo(l,null,h,b)):Hn(s,l,h,b),l.memoizedState=N.state,s=l.child):s=La(s,l,b),s}function yA(s,l,h,g){return Do(),l.flags|=256,Hn(s,l,h,g),l.child}var X0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function J0(s){return{baseLanes:s,cachePool:s_()}}function eb(s,l,h){return s=s!==null?s.childLanes&~h:0,l&&(s|=qr),s}function vA(s,l,h){var g=l.pendingProps,b=!1,N=(l.flags&128)!==0,E;if((E=N)||(E=s!==null&&s.memoizedState===null?!1:(mn.current&2)!==0),E&&(b=!0,l.flags&=-129),E=(l.flags&32)!==0,l.flags&=-33,s===null){if(mt){if(b?ks(l):Cs(),(s=Gt)?(s=CO(s,si),s=s!==null&&s.data!=="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:vs!==null?{id:Ji,overflow:ea}:null,retryLane:536870912,hydrationErrors:null},h=QC(s),h.return=l,l.child=h,qn=l,Gt=null)):s=null,s===null)throw xs(l);return Db(s)?l.lanes=32:l.lanes=536870912,null}var D=g.children;return g=g.fallback,b?(Cs(),b=l.mode,D=mp({mode:"hidden",children:D},b),g=Mo(g,b,h,null),D.return=l,g.return=l,D.sibling=g,l.child=D,g=l.child,g.memoizedState=J0(h),g.childLanes=eb(s,E,h),l.memoizedState=X0,pd(null,g)):(ks(l),tb(l,D))}var H=s.memoizedState;if(H!==null&&(D=H.dehydrated,D!==null)){if(N)l.flags&256?(ks(l),l.flags&=-257,l=nb(s,l,h)):l.memoizedState!==null?(Cs(),l.child=s.child,l.flags|=128,l=null):(Cs(),D=g.fallback,b=l.mode,g=mp({mode:"visible",children:g.children},b),D=Mo(D,b,h,null),D.flags|=2,g.return=l,D.return=l,g.sibling=D,l.child=g,Fo(l,s.child,null,h),g=l.child,g.memoizedState=J0(h),g.childLanes=eb(s,E,h),l.memoizedState=X0,l=pd(null,g));else if(ks(l),Db(D)){if(E=D.nextSibling&&D.nextSibling.dataset,E)var re=E.dgst;E=re,g=Error(r(419)),g.stack="",g.digest=E,nd({value:g,source:null,stack:null}),l=nb(s,l,h)}else if(Nn||sc(s,l,h,!1),E=(h&s.childLanes)!==0,Nn||E){if(E=Dt,E!==null&&(g=Ah(E,h),g!==0&&g!==H.retryLane))throw H.retryLane=g,Ro(s,g),kr(E,s,g),W0;Mb(D)||Np(),l=nb(s,l,h)}else Mb(D)?(l.flags|=192,l.child=s.child,l=null):(s=H.treeContext,Gt=li(D.nextSibling),qn=l,mt=!0,bs=null,si=!1,s!==null&&e_(l,s),l=tb(l,g.children),l.flags|=4096);return l}return b?(Cs(),D=g.fallback,b=l.mode,H=s.child,re=H.sibling,g=Pa(H,{mode:"hidden",children:g.children}),g.subtreeFlags=H.subtreeFlags&65011712,re!==null?D=Pa(re,D):(D=Mo(D,b,h,null),D.flags|=2),D.return=l,g.return=l,g.sibling=D,l.child=g,pd(null,g),g=l.child,D=s.child.memoizedState,D===null?D=J0(h):(b=D.cachePool,b!==null?(H=Sn._currentValue,b=b.parent!==H?{parent:H,pool:H}:b):b=s_(),D={baseLanes:D.baseLanes|h,cachePool:b}),g.memoizedState=D,g.childLanes=eb(s,E,h),l.memoizedState=X0,pd(s.child,g)):(ks(l),h=s.child,s=h.sibling,h=Pa(h,{mode:"visible",children:g.children}),h.return=l,h.sibling=null,s!==null&&(E=l.deletions,E===null?(l.deletions=[s],l.flags|=16):E.push(s)),l.child=h,l.memoizedState=null,h)}function tb(s,l){return l=mp({mode:"visible",children:l},s.mode),l.return=s,s.child=l}function mp(s,l){return s=$r(22,s,null,l),s.lanes=0,s}function nb(s,l,h){return Fo(l,s.child,null,h),s=tb(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function bA(s,l,h){s.lanes|=l;var g=s.alternate;g!==null&&(g.lanes|=l),y0(s.return,l,h)}function rb(s,l,h,g,b,N){var E=s.memoizedState;E===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:b,treeForkCount:N}:(E.isBackwards=l,E.rendering=null,E.renderingStartTime=0,E.last=g,E.tail=h,E.tailMode=b,E.treeForkCount=N)}function xA(s,l,h){var g=l.pendingProps,b=g.revealOrder,N=g.tail;g=g.children;var E=mn.current,D=(E&2)!==0;if(D?(E=E&1|2,l.flags|=128):E&=1,M(mn,E),Hn(s,l,g,h),g=mt?td:0,!D&&s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&bA(s,h,l);else if(s.tag===19)bA(s,h,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(b){case"forwards":for(h=l.child,b=null;h!==null;)s=h.alternate,s!==null&&rp(s)===null&&(b=h),h=h.sibling;h=b,h===null?(b=l.child,l.child=null):(b=h.sibling,h.sibling=null),rb(l,!1,b,h,N,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,b=l.child,l.child=null;b!==null;){if(s=b.alternate,s!==null&&rp(s)===null){l.child=b;break}s=b.sibling,b.sibling=h,h=b,b=s}rb(l,!0,h,null,N,g);break;case"together":rb(l,!1,null,null,void 0,g);break;default:l.memoizedState=null}return l.child}function La(s,l,h){if(s!==null&&(l.dependencies=s.dependencies),Os|=l.lanes,(h&l.childLanes)===0)if(s!==null){if(sc(s,l,h,!1),(h&l.childLanes)===0)return null}else return null;if(s!==null&&l.child!==s.child)throw Error(r(153));if(l.child!==null){for(s=l.child,h=Pa(s,s.pendingProps),l.child=h,h.return=l;s.sibling!==null;)s=s.sibling,h=h.sibling=Pa(s,s.pendingProps),h.return=l;h.sibling=null}return l.child}function ib(s,l){return(s.lanes&l)!==0?!0:(s=s.dependencies,!!(s!==null&&Yh(s)))}function CF(s,l,h){switch(l.tag){case 3:je(l,l.stateNode.containerInfo),ws(l,Sn,s.memoizedState.cache),Do();break;case 27:case 5:de(l);break;case 4:je(l,l.stateNode.containerInfo);break;case 10:ws(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,O0(l),null;break;case 13:var g=l.memoizedState;if(g!==null)return g.dehydrated!==null?(ks(l),l.flags|=128,null):(h&l.child.childLanes)!==0?vA(s,l,h):(ks(l),s=La(s,l,h),s!==null?s.sibling:null);ks(l);break;case 19:var b=(s.flags&128)!==0;if(g=(h&l.childLanes)!==0,g||(sc(s,l,h,!1),g=(h&l.childLanes)!==0),b){if(g)return xA(s,l,h);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),M(mn,mn.current),g)break;return null;case 22:return l.lanes=0,fA(s,l,h,l.pendingProps);case 24:ws(l,Sn,s.memoizedState.cache)}return La(s,l,h)}function wA(s,l,h){if(s!==null)if(s.memoizedProps!==l.pendingProps)Nn=!0;else{if(!ib(s,h)&&(l.flags&128)===0)return Nn=!1,CF(s,l,h);Nn=(s.flags&131072)!==0}else Nn=!1,mt&&(l.flags&1048576)!==0&&JC(l,td,l.index);switch(l.lanes=0,l.tag){case 16:e:{var g=l.pendingProps;if(s=Uo(l.elementType),l.type=s,typeof s=="function")c0(s)?(g=Ko(s,g),l.tag=1,l=gA(null,l,s,g,h)):(l.tag=0,l=Q0(null,l,s,g,h));else{if(s!=null){var b=s.$$typeof;if(b===C){l.tag=11,l=cA(null,l,s,g,h);break e}else if(b===A){l.tag=14,l=uA(null,l,s,g,h);break e}}throw l=ae(s)||s,Error(r(306,l,""))}}return l;case 0:return Q0(s,l,l.type,l.pendingProps,h);case 1:return g=l.type,b=Ko(g,l.pendingProps),gA(s,l,g,b,h);case 3:e:{if(je(l,l.stateNode.containerInfo),s===null)throw Error(r(387));g=l.pendingProps;var N=l.memoizedState;b=N.element,N0(s,l),cd(l,g,null,h);var E=l.memoizedState;if(g=E.cache,ws(l,Sn,g),g!==N.cache&&v0(l,[Sn],h,!0),ld(),g=E.element,N.isDehydrated)if(N={element:g,isDehydrated:!1,cache:E.cache},l.updateQueue.baseState=N,l.memoizedState=N,l.flags&256){l=yA(s,l,g,h);break e}else if(g!==b){b=ri(Error(r(424)),l),nd(b),l=yA(s,l,g,h);break e}else for(s=l.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,Gt=li(s.firstChild),qn=l,mt=!0,bs=null,si=!0,h=f_(l,null,g,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Do(),g===b){l=La(s,l,h);break e}Hn(s,l,g,h)}l=l.child}return l;case 26:return pp(s,l),s===null?(h=PO(l.type,null,l.pendingProps,null))?l.memoizedState=h:mt||(h=l.type,s=l.pendingProps,g=Tp(ie.current).createElement(h),g[ct]=l,g[_t]=s,Gn(g,h,s),rn(g),l.stateNode=g):l.memoizedState=PO(l.type,s.memoizedProps,l.pendingProps,s.memoizedState),null;case 27:return de(l),s===null&&mt&&(g=l.stateNode=OO(l.type,l.pendingProps,ie.current),qn=l,si=!0,b=Gt,Rs(l.type)?(Ib=b,Gt=li(g.firstChild)):Gt=b),Hn(s,l,l.pendingProps.children,h),pp(s,l),s===null&&(l.flags|=4194304),l.child;case 5:return s===null&&mt&&((b=g=Gt)&&(g=n9(g,l.type,l.pendingProps,si),g!==null?(l.stateNode=g,qn=l,Gt=li(g.firstChild),si=!1,b=!0):b=!1),b||xs(l)),de(l),b=l.type,N=l.pendingProps,E=s!==null?s.memoizedProps:null,g=N.children,Pb(b,N)?g=null:E!==null&&Pb(b,E)&&(l.flags|=32),l.memoizedState!==null&&(b=T0(s,l,yF,null,null,h),Od._currentValue=b),pp(s,l),Hn(s,l,g,h),l.child;case 6:return s===null&&mt&&((s=h=Gt)&&(h=r9(h,l.pendingProps,si),h!==null?(l.stateNode=h,qn=l,Gt=null,s=!0):s=!1),s||xs(l)),null;case 13:return vA(s,l,h);case 4:return je(l,l.stateNode.containerInfo),g=l.pendingProps,s===null?l.child=Fo(l,null,g,h):Hn(s,l,g,h),l.child;case 11:return cA(s,l,l.type,l.pendingProps,h);case 7:return Hn(s,l,l.pendingProps,h),l.child;case 8:return Hn(s,l,l.pendingProps.children,h),l.child;case 12:return Hn(s,l,l.pendingProps.children,h),l.child;case 10:return g=l.pendingProps,ws(l,l.type,g.value),Hn(s,l,g.children,h),l.child;case 9:return b=l.type._context,g=l.pendingProps.children,Lo(l),b=Kn(b),g=g(b),l.flags|=1,Hn(s,l,g,h),l.child;case 14:return uA(s,l,l.type,l.pendingProps,h);case 15:return dA(s,l,l.type,l.pendingProps,h);case 19:return xA(s,l,h);case 31:return kF(s,l,h);case 22:return fA(s,l,h,l.pendingProps);case 24:return Lo(l),g=Kn(Sn),s===null?(b=w0(),b===null&&(b=Dt,N=b0(),b.pooledCache=N,N.refCount++,N!==null&&(b.pooledCacheLanes|=h),b=N),l.memoizedState={parent:g,cache:b},j0(l),ws(l,Sn,b)):((s.lanes&h)!==0&&(N0(s,l),cd(l,null,null,h),ld()),b=s.memoizedState,N=l.memoizedState,b.parent!==g?(b={parent:g,cache:g},l.memoizedState=b,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=b),ws(l,Sn,g)):(g=N.cache,ws(l,Sn,g),g!==b.cache&&v0(l,[Sn],h,!0))),Hn(s,l,l.pendingProps.children,h),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function $a(s){s.flags|=4}function ab(s,l,h,g,b){if((l=(s.mode&32)!==0)&&(l=!1),l){if(s.flags|=16777216,(b&335544128)===b)if(s.stateNode.complete)s.flags|=8192;else if(ZA())s.flags|=8192;else throw Bo=Jh,S0}else s.flags&=-16777217}function SA(s,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!IO(l))if(ZA())s.flags|=8192;else throw Bo=Jh,S0}function gp(s,l){l!==null&&(s.flags|=4),s.flags&16384&&(l=s.tag!==22?_o():536870912,s.lanes|=l,vc|=l)}function md(s,l){if(!mt)switch(s.tailMode){case"hidden":l=s.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?s.tail=null:h.sibling=null;break;case"collapsed":h=s.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function Vt(s){var l=s.alternate!==null&&s.alternate.child===s.child,h=0,g=0;if(l)for(var b=s.child;b!==null;)h|=b.lanes|b.childLanes,g|=b.subtreeFlags&65011712,g|=b.flags&65011712,b.return=s,b=b.sibling;else for(b=s.child;b!==null;)h|=b.lanes|b.childLanes,g|=b.subtreeFlags,g|=b.flags,b.return=s,b=b.sibling;return s.subtreeFlags|=g,s.childLanes=h,l}function _F(s,l,h){var g=l.pendingProps;switch(h0(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(l),null;case 1:return Vt(l),null;case 3:return h=l.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),l.memoizedState.cache!==g&&(l.flags|=2048),Ma(Sn),ee(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(s===null||s.child===null)&&(ac(l)?$a(l):s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,m0())),Vt(l),null;case 26:var b=l.type,N=l.memoizedState;return s===null?($a(l),N!==null?(Vt(l),SA(l,N)):(Vt(l),ab(l,b,null,g,h))):N?N!==s.memoizedState?($a(l),Vt(l),SA(l,N)):(Vt(l),l.flags&=-16777217):(s=s.memoizedProps,s!==g&&$a(l),Vt(l),ab(l,b,s,g,h)),null;case 27:if(_e(l),h=ie.current,b=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==g&&$a(l);else{if(!g){if(l.stateNode===null)throw Error(r(166));return Vt(l),null}s=V.current,ac(l)?t_(l):(s=OO(b,g,h),l.stateNode=s,$a(l))}return Vt(l),null;case 5:if(_e(l),b=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==g&&$a(l);else{if(!g){if(l.stateNode===null)throw Error(r(166));return Vt(l),null}if(N=V.current,ac(l))t_(l);else{var E=Tp(ie.current);switch(N){case 1:N=E.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:N=E.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":N=E.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":N=E.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":N=E.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof g.is=="string"?E.createElement("select",{is:g.is}):E.createElement("select"),g.multiple?N.multiple=!0:g.size&&(N.size=g.size);break;default:N=typeof g.is=="string"?E.createElement(b,{is:g.is}):E.createElement(b)}}N[ct]=l,N[_t]=g;e:for(E=l.child;E!==null;){if(E.tag===5||E.tag===6)N.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===l)break e;for(;E.sibling===null;){if(E.return===null||E.return===l)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}l.stateNode=N;e:switch(Gn(N,b,g),b){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&$a(l)}}return Vt(l),ab(l,l.type,s===null?null:s.memoizedProps,l.pendingProps,h),null;case 6:if(s&&l.stateNode!=null)s.memoizedProps!==g&&$a(l);else{if(typeof g!="string"&&l.stateNode===null)throw Error(r(166));if(s=ie.current,ac(l)){if(s=l.stateNode,h=l.memoizedProps,g=null,b=qn,b!==null)switch(b.tag){case 27:case 5:g=b.memoizedProps}s[ct]=l,s=!!(s.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||vO(s.nodeValue,h)),s||xs(l,!0)}else s=Tp(s).createTextNode(g),s[ct]=l,l.stateNode=s}return Vt(l),null;case 31:if(h=l.memoizedState,s===null||s.memoizedState!==null){if(g=ac(l),h!==null){if(s===null){if(!g)throw Error(r(318));if(s=l.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[ct]=l}else Do(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Vt(l),s=!1}else h=m0(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),s=!0;if(!s)return l.flags&256?(Br(l),l):(Br(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Vt(l),null;case 13:if(g=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(b=ac(l),g!==null&&g.dehydrated!==null){if(s===null){if(!b)throw Error(r(318));if(b=l.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[ct]=l}else Do(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Vt(l),b=!1}else b=m0(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=b),b=!0;if(!b)return l.flags&256?(Br(l),l):(Br(l),null)}return Br(l),(l.flags&128)!==0?(l.lanes=h,l):(h=g!==null,s=s!==null&&s.memoizedState!==null,h&&(g=l.child,b=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(b=g.alternate.memoizedState.cachePool.pool),N=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(N=g.memoizedState.cachePool.pool),N!==b&&(g.flags|=2048)),h!==s&&h&&(l.child.flags|=8192),gp(l,l.updateQueue),Vt(l),null);case 4:return ee(),s===null&&_b(l.stateNode.containerInfo),Vt(l),null;case 10:return Ma(l.type),Vt(l),null;case 19:if(B(mn),g=l.memoizedState,g===null)return Vt(l),null;if(b=(l.flags&128)!==0,N=g.rendering,N===null)if(b)md(g,!1);else{if(un!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(N=rp(s),N!==null){for(l.flags|=128,md(g,!1),s=N.updateQueue,l.updateQueue=s,gp(l,s),l.subtreeFlags=0,s=h,h=l.child;h!==null;)WC(h,s),h=h.sibling;return M(mn,mn.current&1|2),mt&&za(l,g.treeForkCount),l.child}s=s.sibling}g.tail!==null&&Re()>wp&&(l.flags|=128,b=!0,md(g,!1),l.lanes=4194304)}else{if(!b)if(s=rp(N),s!==null){if(l.flags|=128,b=!0,s=s.updateQueue,l.updateQueue=s,gp(l,s),md(g,!0),g.tail===null&&g.tailMode==="hidden"&&!N.alternate&&!mt)return Vt(l),null}else 2*Re()-g.renderingStartTime>wp&&h!==536870912&&(l.flags|=128,b=!0,md(g,!1),l.lanes=4194304);g.isBackwards?(N.sibling=l.child,l.child=N):(s=g.last,s!==null?s.sibling=N:l.child=N,g.last=N)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=Re(),s.sibling=null,h=mn.current,M(mn,b?h&1|2:h&1),mt&&za(l,g.treeForkCount),s):(Vt(l),null);case 22:case 23:return Br(l),A0(),g=l.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(l.flags|=8192):g&&(l.flags|=8192),g?(h&536870912)!==0&&(l.flags&128)===0&&(Vt(l),l.subtreeFlags&6&&(l.flags|=8192)):Vt(l),h=l.updateQueue,h!==null&&gp(l,h.retryQueue),h=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),g=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==h&&(l.flags|=2048),s!==null&&B($o),null;case 24:return h=null,s!==null&&(h=s.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),Ma(Sn),Vt(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function AF(s,l){switch(h0(l),l.tag){case 1:return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return Ma(Sn),ee(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 26:case 27:case 5:return _e(l),null;case 31:if(l.memoizedState!==null){if(Br(l),l.alternate===null)throw Error(r(340));Do()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 13:if(Br(l),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Do()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return B(mn),null;case 4:return ee(),null;case 10:return Ma(l.type),null;case 22:case 23:return Br(l),A0(),s!==null&&B($o),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 24:return Ma(Sn),null;case 25:return null;default:return null}}function jA(s,l){switch(h0(l),l.tag){case 3:Ma(Sn),ee();break;case 26:case 27:case 5:_e(l);break;case 4:ee();break;case 31:l.memoizedState!==null&&Br(l);break;case 13:Br(l);break;case 19:B(mn);break;case 10:Ma(l.type);break;case 22:case 23:Br(l),A0(),s!==null&&B($o);break;case 24:Ma(Sn)}}function gd(s,l){try{var h=l.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var b=g.next;h=b;do{if((h.tag&s)===s){g=void 0;var N=h.create,E=h.inst;g=N(),E.destroy=g}h=h.next}while(h!==b)}}catch(D){Ot(l,l.return,D)}}function _s(s,l,h){try{var g=l.updateQueue,b=g!==null?g.lastEffect:null;if(b!==null){var N=b.next;g=N;do{if((g.tag&s)===s){var E=g.inst,D=E.destroy;if(D!==void 0){E.destroy=void 0,b=l;var H=h,re=D;try{re()}catch(fe){Ot(b,H,fe)}}}g=g.next}while(g!==N)}}catch(fe){Ot(l,l.return,fe)}}function NA(s){var l=s.updateQueue;if(l!==null){var h=s.stateNode;try{p_(l,h)}catch(g){Ot(s,s.return,g)}}}function kA(s,l,h){h.props=Ko(s.type,s.memoizedProps),h.state=s.memoizedState;try{h.componentWillUnmount()}catch(g){Ot(s,l,g)}}function yd(s,l){try{var h=s.ref;if(h!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof h=="function"?s.refCleanup=h(g):h.current=g}}catch(b){Ot(s,l,b)}}function ta(s,l){var h=s.ref,g=s.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(b){Ot(s,l,b)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(b){Ot(s,l,b)}else h.current=null}function CA(s){var l=s.type,h=s.memoizedProps,g=s.stateNode;try{e:switch(l){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(b){Ot(s,s.return,b)}}function sb(s,l,h){try{var g=s.stateNode;WF(g,s.type,h,l),g[_t]=l}catch(b){Ot(s,s.return,b)}}function _A(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Rs(s.type)||s.tag===4}function ob(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||_A(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Rs(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function lb(s,l,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,l?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(s,l):(l=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,l.appendChild(s),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=Ea));else if(g!==4&&(g===27&&Rs(s.type)&&(h=s.stateNode,l=null),s=s.child,s!==null))for(lb(s,l,h),s=s.sibling;s!==null;)lb(s,l,h),s=s.sibling}function yp(s,l,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,l?h.insertBefore(s,l):h.appendChild(s);else if(g!==4&&(g===27&&Rs(s.type)&&(h=s.stateNode),s=s.child,s!==null))for(yp(s,l,h),s=s.sibling;s!==null;)yp(s,l,h),s=s.sibling}function AA(s){var l=s.stateNode,h=s.memoizedProps;try{for(var g=s.type,b=l.attributes;b.length;)l.removeAttributeNode(b[0]);Gn(l,g,h),l[ct]=s,l[_t]=h}catch(N){Ot(s,s.return,N)}}var Ua=!1,kn=!1,cb=!1,OA=typeof WeakSet=="function"?WeakSet:Set,In=null;function OF(s,l){if(s=s.containerInfo,Eb=Lp,s=BC(s),n0(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var b=g.anchorOffset,N=g.focusNode;g=g.focusOffset;try{h.nodeType,N.nodeType}catch{h=null;break e}var E=0,D=-1,H=-1,re=0,fe=0,ge=s,oe=null;t:for(;;){for(var ce;ge!==h||b!==0&&ge.nodeType!==3||(D=E+b),ge!==N||g!==0&&ge.nodeType!==3||(H=E+g),ge.nodeType===3&&(E+=ge.nodeValue.length),(ce=ge.firstChild)!==null;)oe=ge,ge=ce;for(;;){if(ge===s)break t;if(oe===h&&++re===b&&(D=E),oe===N&&++fe===g&&(H=E),(ce=ge.nextSibling)!==null)break;ge=oe,oe=ge.parentNode}ge=ce}h=D===-1||H===-1?null:{start:D,end:H}}else h=null}h=h||{start:0,end:0}}else h=null;for(Tb={focusedElem:s,selectionRange:h},Lp=!1,In=l;In!==null;)if(l=In,s=l.child,(l.subtreeFlags&1028)!==0&&s!==null)s.return=l,In=s;else for(;In!==null;){switch(l=In,N=l.alternate,s=l.flags,l.tag){case 0:if((s&4)!==0&&(s=l.updateQueue,s=s!==null?s.events:null,s!==null))for(h=0;h<s.length;h++)b=s[h],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&N!==null){s=void 0,h=l,b=N.memoizedProps,N=N.memoizedState,g=h.stateNode;try{var Ie=Ko(h.type,b);s=g.getSnapshotBeforeUpdate(Ie,N),g.__reactInternalSnapshotBeforeUpdate=s}catch(Ze){Ot(h,h.return,Ze)}}break;case 3:if((s&1024)!==0){if(s=l.stateNode.containerInfo,h=s.nodeType,h===9)Rb(s);else if(h===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Rb(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=l.sibling,s!==null){s.return=l.return,In=s;break}In=l.return}}function EA(s,l,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Fa(s,h),g&4&&gd(5,h);break;case 1:if(Fa(s,h),g&4)if(s=h.stateNode,l===null)try{s.componentDidMount()}catch(E){Ot(h,h.return,E)}else{var b=Ko(h.type,l.memoizedProps);l=l.memoizedState;try{s.componentDidUpdate(b,l,s.__reactInternalSnapshotBeforeUpdate)}catch(E){Ot(h,h.return,E)}}g&64&&NA(h),g&512&&yd(h,h.return);break;case 3:if(Fa(s,h),g&64&&(s=h.updateQueue,s!==null)){if(l=null,h.child!==null)switch(h.child.tag){case 27:case 5:l=h.child.stateNode;break;case 1:l=h.child.stateNode}try{p_(s,l)}catch(E){Ot(h,h.return,E)}}break;case 27:l===null&&g&4&&AA(h);case 26:case 5:Fa(s,h),l===null&&g&4&&CA(h),g&512&&yd(h,h.return);break;case 12:Fa(s,h);break;case 31:Fa(s,h),g&4&&zA(s,h);break;case 13:Fa(s,h),g&4&&RA(s,h),g&64&&(s=h.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(h=LF.bind(null,h),i9(s,h))));break;case 22:if(g=h.memoizedState!==null||Ua,!g){l=l!==null&&l.memoizedState!==null||kn,b=Ua;var N=kn;Ua=g,(kn=l)&&!N?qa(s,h,(h.subtreeFlags&8772)!==0):Fa(s,h),Ua=b,kn=N}break;case 30:break;default:Fa(s,h)}}function TA(s){var l=s.alternate;l!==null&&(s.alternate=null,TA(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&_a(l)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Wt=null,wr=!1;function Ba(s,l,h){for(h=h.child;h!==null;)PA(s,l,h),h=h.sibling}function PA(s,l,h){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(Qe,h)}catch{}switch(h.tag){case 26:kn||ta(h,l),Ba(s,l,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:kn||ta(h,l);var g=Wt,b=wr;Rs(h.type)&&(Wt=h.stateNode,wr=!1),Ba(s,l,h),Cd(h.stateNode),Wt=g,wr=b;break;case 5:kn||ta(h,l);case 6:if(g=Wt,b=wr,Wt=null,Ba(s,l,h),Wt=g,wr=b,Wt!==null)if(wr)try{(Wt.nodeType===9?Wt.body:Wt.nodeName==="HTML"?Wt.ownerDocument.body:Wt).removeChild(h.stateNode)}catch(N){Ot(h,l,N)}else try{Wt.removeChild(h.stateNode)}catch(N){Ot(h,l,N)}break;case 18:Wt!==null&&(wr?(s=Wt,NO(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,h.stateNode),Cc(s)):NO(Wt,h.stateNode));break;case 4:g=Wt,b=wr,Wt=h.stateNode.containerInfo,wr=!0,Ba(s,l,h),Wt=g,wr=b;break;case 0:case 11:case 14:case 15:_s(2,h,l),kn||_s(4,h,l),Ba(s,l,h);break;case 1:kn||(ta(h,l),g=h.stateNode,typeof g.componentWillUnmount=="function"&&kA(h,l,g)),Ba(s,l,h);break;case 21:Ba(s,l,h);break;case 22:kn=(g=kn)||h.memoizedState!==null,Ba(s,l,h),kn=g;break;default:Ba(s,l,h)}}function zA(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Cc(s)}catch(h){Ot(l,l.return,h)}}}function RA(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Cc(s)}catch(h){Ot(l,l.return,h)}}function EF(s){switch(s.tag){case 31:case 13:case 19:var l=s.stateNode;return l===null&&(l=s.stateNode=new OA),l;case 22:return s=s.stateNode,l=s._retryCache,l===null&&(l=s._retryCache=new OA),l;default:throw Error(r(435,s.tag))}}function vp(s,l){var h=EF(s);l.forEach(function(g){if(!h.has(g)){h.add(g);var b=$F.bind(null,s,g);g.then(b,b)}})}function Sr(s,l){var h=l.deletions;if(h!==null)for(var g=0;g<h.length;g++){var b=h[g],N=s,E=l,D=E;e:for(;D!==null;){switch(D.tag){case 27:if(Rs(D.type)){Wt=D.stateNode,wr=!1;break e}break;case 5:Wt=D.stateNode,wr=!1;break e;case 3:case 4:Wt=D.stateNode.containerInfo,wr=!0;break e}D=D.return}if(Wt===null)throw Error(r(160));PA(N,E,b),Wt=null,wr=!1,N=b.alternate,N!==null&&(N.return=null),b.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)MA(l,s),l=l.sibling}var Di=null;function MA(s,l){var h=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Sr(l,s),jr(s),g&4&&(_s(3,s,s.return),gd(3,s),_s(5,s,s.return));break;case 1:Sr(l,s),jr(s),g&512&&(kn||h===null||ta(h,h.return)),g&64&&Ua&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(h=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var b=Di;if(Sr(l,s),jr(s),g&512&&(kn||h===null||ta(h,h.return)),g&4){var N=h!==null?h.memoizedState:null;if(g=s.memoizedState,h===null)if(g===null)if(s.stateNode===null){e:{g=s.type,h=s.memoizedProps,b=b.ownerDocument||b;t:switch(g){case"title":N=b.getElementsByTagName("title")[0],(!N||N[Jr]||N[ct]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=b.createElement(g),b.head.insertBefore(N,b.querySelector("head > title"))),Gn(N,g,h),N[ct]=s,rn(N),g=N;break e;case"link":var E=MO("link","href",b).get(g+(h.href||""));if(E){for(var D=0;D<E.length;D++)if(N=E[D],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)){E.splice(D,1);break t}}N=b.createElement(g),Gn(N,g,h),b.head.appendChild(N);break;case"meta":if(E=MO("meta","content",b).get(g+(h.content||""))){for(D=0;D<E.length;D++)if(N=E[D],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)){E.splice(D,1);break t}}N=b.createElement(g),Gn(N,g,h),b.head.appendChild(N);break;default:throw Error(r(468,g))}N[ct]=s,rn(N),g=N}s.stateNode=g}else DO(b,s.type,s.stateNode);else s.stateNode=RO(b,g,s.memoizedProps);else N!==g?(N===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):N.count--,g===null?DO(b,s.type,s.stateNode):RO(b,g,s.memoizedProps)):g===null&&s.stateNode!==null&&sb(s,s.memoizedProps,h.memoizedProps)}break;case 27:Sr(l,s),jr(s),g&512&&(kn||h===null||ta(h,h.return)),h!==null&&g&4&&sb(s,s.memoizedProps,h.memoizedProps);break;case 5:if(Sr(l,s),jr(s),g&512&&(kn||h===null||ta(h,h.return)),s.flags&32){b=s.stateNode;try{Yl(b,"")}catch(Ie){Ot(s,s.return,Ie)}}g&4&&s.stateNode!=null&&(b=s.memoizedProps,sb(s,b,h!==null?h.memoizedProps:b)),g&1024&&(cb=!0);break;case 6:if(Sr(l,s),jr(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,h=s.stateNode;try{h.nodeValue=g}catch(Ie){Ot(s,s.return,Ie)}}break;case 3:if(Rp=null,b=Di,Di=Pp(l.containerInfo),Sr(l,s),Di=b,jr(s),g&4&&h!==null&&h.memoizedState.isDehydrated)try{Cc(l.containerInfo)}catch(Ie){Ot(s,s.return,Ie)}cb&&(cb=!1,DA(s));break;case 4:g=Di,Di=Pp(s.stateNode.containerInfo),Sr(l,s),jr(s),Di=g;break;case 12:Sr(l,s),jr(s);break;case 31:Sr(l,s),jr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,vp(s,g)));break;case 13:Sr(l,s),jr(s),s.child.flags&8192&&s.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(xp=Re()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,vp(s,g)));break;case 22:b=s.memoizedState!==null;var H=h!==null&&h.memoizedState!==null,re=Ua,fe=kn;if(Ua=re||b,kn=fe||H,Sr(l,s),kn=fe,Ua=re,jr(s),g&8192)e:for(l=s.stateNode,l._visibility=b?l._visibility&-2:l._visibility|1,b&&(h===null||H||Ua||kn||Ho(s)),h=null,l=s;;){if(l.tag===5||l.tag===26){if(h===null){H=h=l;try{if(N=H.stateNode,b)E=N.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{D=H.stateNode;var ge=H.memoizedProps.style,oe=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;D.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Ie){Ot(H,H.return,Ie)}}}else if(l.tag===6){if(h===null){H=l;try{H.stateNode.nodeValue=b?"":H.memoizedProps}catch(Ie){Ot(H,H.return,Ie)}}}else if(l.tag===18){if(h===null){H=l;try{var ce=H.stateNode;b?kO(ce,!0):kO(H.stateNode,!1)}catch(Ie){Ot(H,H.return,Ie)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===s)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;h===l&&(h=null),l=l.return}h===l&&(h=null),l.sibling.return=l.return,l=l.sibling}g&4&&(g=s.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,vp(s,h))));break;case 19:Sr(l,s),jr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,vp(s,g)));break;case 30:break;case 21:break;default:Sr(l,s),jr(s)}}function jr(s){var l=s.flags;if(l&2){try{for(var h,g=s.return;g!==null;){if(_A(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var b=h.stateNode,N=ob(s);yp(s,N,b);break;case 5:var E=h.stateNode;h.flags&32&&(Yl(E,""),h.flags&=-33);var D=ob(s);yp(s,D,E);break;case 3:case 4:var H=h.stateNode.containerInfo,re=ob(s);lb(s,re,H);break;default:throw Error(r(161))}}catch(fe){Ot(s,s.return,fe)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function DA(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var l=s;DA(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),s=s.sibling}}function Fa(s,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)EA(s,l.alternate,l),l=l.sibling}function Ho(s){for(s=s.child;s!==null;){var l=s;switch(l.tag){case 0:case 11:case 14:case 15:_s(4,l,l.return),Ho(l);break;case 1:ta(l,l.return);var h=l.stateNode;typeof h.componentWillUnmount=="function"&&kA(l,l.return,h),Ho(l);break;case 27:Cd(l.stateNode);case 26:case 5:ta(l,l.return),Ho(l);break;case 22:l.memoizedState===null&&Ho(l);break;case 30:Ho(l);break;default:Ho(l)}s=s.sibling}}function qa(s,l,h){for(h=h&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var g=l.alternate,b=s,N=l,E=N.flags;switch(N.tag){case 0:case 11:case 15:qa(b,N,h),gd(4,N);break;case 1:if(qa(b,N,h),g=N,b=g.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(re){Ot(g,g.return,re)}if(g=N,b=g.updateQueue,b!==null){var D=g.stateNode;try{var H=b.shared.hiddenCallbacks;if(H!==null)for(b.shared.hiddenCallbacks=null,b=0;b<H.length;b++)h_(H[b],D)}catch(re){Ot(g,g.return,re)}}h&&E&64&&NA(N),yd(N,N.return);break;case 27:AA(N);case 26:case 5:qa(b,N,h),h&&g===null&&E&4&&CA(N),yd(N,N.return);break;case 12:qa(b,N,h);break;case 31:qa(b,N,h),h&&E&4&&zA(b,N);break;case 13:qa(b,N,h),h&&E&4&&RA(b,N);break;case 22:N.memoizedState===null&&qa(b,N,h),yd(N,N.return);break;case 30:break;default:qa(b,N,h)}l=l.sibling}}function ub(s,l){var h=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==h&&(s!=null&&s.refCount++,h!=null&&rd(h))}function db(s,l){s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&rd(s))}function Ii(s,l,h,g){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)IA(s,l,h,g),l=l.sibling}function IA(s,l,h,g){var b=l.flags;switch(l.tag){case 0:case 11:case 15:Ii(s,l,h,g),b&2048&&gd(9,l);break;case 1:Ii(s,l,h,g);break;case 3:Ii(s,l,h,g),b&2048&&(s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&rd(s)));break;case 12:if(b&2048){Ii(s,l,h,g),s=l.stateNode;try{var N=l.memoizedProps,E=N.id,D=N.onPostCommit;typeof D=="function"&&D(E,l.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(H){Ot(l,l.return,H)}}else Ii(s,l,h,g);break;case 31:Ii(s,l,h,g);break;case 13:Ii(s,l,h,g);break;case 23:break;case 22:N=l.stateNode,E=l.alternate,l.memoizedState!==null?N._visibility&2?Ii(s,l,h,g):vd(s,l):N._visibility&2?Ii(s,l,h,g):(N._visibility|=2,mc(s,l,h,g,(l.subtreeFlags&10256)!==0||!1)),b&2048&&ub(E,l);break;case 24:Ii(s,l,h,g),b&2048&&db(l.alternate,l);break;default:Ii(s,l,h,g)}}function mc(s,l,h,g,b){for(b=b&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var N=s,E=l,D=h,H=g,re=E.flags;switch(E.tag){case 0:case 11:case 15:mc(N,E,D,H,b),gd(8,E);break;case 23:break;case 22:var fe=E.stateNode;E.memoizedState!==null?fe._visibility&2?mc(N,E,D,H,b):vd(N,E):(fe._visibility|=2,mc(N,E,D,H,b)),b&&re&2048&&ub(E.alternate,E);break;case 24:mc(N,E,D,H,b),b&&re&2048&&db(E.alternate,E);break;default:mc(N,E,D,H,b)}l=l.sibling}}function vd(s,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var h=s,g=l,b=g.flags;switch(g.tag){case 22:vd(h,g),b&2048&&ub(g.alternate,g);break;case 24:vd(h,g),b&2048&&db(g.alternate,g);break;default:vd(h,g)}l=l.sibling}}var bd=8192;function gc(s,l,h){if(s.subtreeFlags&bd)for(s=s.child;s!==null;)LA(s,l,h),s=s.sibling}function LA(s,l,h){switch(s.tag){case 26:gc(s,l,h),s.flags&bd&&s.memoizedState!==null&&g9(h,Di,s.memoizedState,s.memoizedProps);break;case 5:gc(s,l,h);break;case 3:case 4:var g=Di;Di=Pp(s.stateNode.containerInfo),gc(s,l,h),Di=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=bd,bd=16777216,gc(s,l,h),bd=g):gc(s,l,h));break;default:gc(s,l,h)}}function $A(s){var l=s.alternate;if(l!==null&&(s=l.child,s!==null)){l.child=null;do l=s.sibling,s.sibling=null,s=l;while(s!==null)}}function xd(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var h=0;h<l.length;h++){var g=l[h];In=g,BA(g,s)}$A(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)UA(s),s=s.sibling}function UA(s){switch(s.tag){case 0:case 11:case 15:xd(s),s.flags&2048&&_s(9,s,s.return);break;case 3:xd(s);break;case 12:xd(s);break;case 22:var l=s.stateNode;s.memoizedState!==null&&l._visibility&2&&(s.return===null||s.return.tag!==13)?(l._visibility&=-3,bp(s)):xd(s);break;default:xd(s)}}function bp(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var h=0;h<l.length;h++){var g=l[h];In=g,BA(g,s)}$A(s)}for(s=s.child;s!==null;){switch(l=s,l.tag){case 0:case 11:case 15:_s(8,l,l.return),bp(l);break;case 22:h=l.stateNode,h._visibility&2&&(h._visibility&=-3,bp(l));break;default:bp(l)}s=s.sibling}}function BA(s,l){for(;In!==null;){var h=In;switch(h.tag){case 0:case 11:case 15:_s(8,h,l);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:rd(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,In=g;else e:for(h=s;In!==null;){g=In;var b=g.sibling,N=g.return;if(TA(g),g===h){In=null;break e}if(b!==null){b.return=N,In=b;break e}In=N}}}var TF={getCacheForType:function(s){var l=Kn(Sn),h=l.data.get(s);return h===void 0&&(h=s(),l.data.set(s,h)),h},cacheSignal:function(){return Kn(Sn).controller.signal}},PF=typeof WeakMap=="function"?WeakMap:Map,St=0,Dt=null,ut=null,ht=0,At=0,Fr=null,As=!1,yc=!1,fb=!1,Ka=0,un=0,Os=0,Go=0,hb=0,qr=0,vc=0,wd=null,Nr=null,pb=!1,xp=0,FA=0,wp=1/0,Sp=null,Es=null,On=0,Ts=null,bc=null,Ha=0,mb=0,gb=null,qA=null,Sd=0,yb=null;function Kr(){return(St&2)!==0&&ht!==0?ht&-ht:K.T!==null?jb():G()}function KA(){if(qr===0)if((ht&536870912)===0||mt){var s=ko;ko<<=1,(ko&3932160)===0&&(ko=262144),qr=s}else qr=536870912;return s=Ur.current,s!==null&&(s.flags|=32),qr}function kr(s,l,h){(s===Dt&&(At===2||At===9)||s.cancelPendingCommit!==null)&&(xc(s,0),Ps(s,ht,qr,!1)),Ao(s,h),((St&2)===0||s!==Dt)&&(s===Dt&&((St&2)===0&&(Go|=h),un===4&&Ps(s,ht,qr,!1)),na(s))}function HA(s,l,h){if((St&6)!==0)throw Error(r(327));var g=!h&&(l&127)===0&&(l&s.expiredLanes)===0||ms(s,l),b=g?MF(s,l):bb(s,l,!0),N=g;do{if(b===0){yc&&!g&&Ps(s,l,0,!1);break}else{if(h=s.current.alternate,N&&!zF(h)){b=bb(s,l,!1),N=!1;continue}if(b===2){if(N=l,s.errorRecoveryDisabledLanes&N)var E=0;else E=s.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){l=E;e:{var D=s;b=wd;var H=D.current.memoizedState.isDehydrated;if(H&&(xc(D,E).flags|=256),E=bb(D,E,!1),E!==2){if(fb&&!H){D.errorRecoveryDisabledLanes|=N,Go|=N,b=4;break e}N=Nr,Nr=b,N!==null&&(Nr===null?Nr=N:Nr.push.apply(Nr,N))}b=E}if(N=!1,b!==2)continue}}if(b===1){xc(s,0),Ps(s,l,0,!0);break}e:{switch(g=s,N=b,N){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Ps(g,l,qr,!As);break e;case 2:Nr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(b=xp+300-Re(),10<b)){if(Ps(g,l,qr,!As),Co(g,0,!0)!==0)break e;Ha=l,g.timeoutHandle=SO(GA.bind(null,g,h,Nr,Sp,pb,l,qr,Go,vc,As,N,"Throttled",-0,0),b);break e}GA(g,h,Nr,Sp,pb,l,qr,Go,vc,As,N,null,-0,0)}}break}while(!0);na(s)}function GA(s,l,h,g,b,N,E,D,H,re,fe,ge,oe,ce){if(s.timeoutHandle=-1,ge=l.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ea},LA(l,N,ge);var Ie=(N&62914560)===N?xp-Re():(N&4194048)===N?FA-Re():0;if(Ie=y9(ge,Ie),Ie!==null){Ha=N,s.cancelPendingCommit=Ie(eO.bind(null,s,l,N,h,g,b,E,D,H,fe,ge,null,oe,ce)),Ps(s,N,E,!re);return}}eO(s,l,N,h,g,b,E,D,H)}function zF(s){for(var l=s;;){var h=l.tag;if((h===0||h===11||h===15)&&l.flags&16384&&(h=l.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var b=h[g],N=b.getSnapshot;b=b.value;try{if(!Lr(N(),b))return!1}catch{return!1}}if(h=l.child,l.subtreeFlags&16384&&h!==null)h.return=l,l=h;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Ps(s,l,h,g){l&=~hb,l&=~Go,s.suspendedLanes|=l,s.pingedLanes&=~l,g&&(s.warmLanes|=l),g=s.expirationTimes;for(var b=l;0<b;){var N=31-ue(b),E=1<<N;g[N]=-1,b&=~E}h!==0&&Ch(s,h,l)}function jp(){return(St&6)===0?(jd(0),!1):!0}function vb(){if(ut!==null){if(At===0)var s=ut.return;else s=ut,Ra=Io=null,R0(s),uc=null,ad=0,s=ut;for(;s!==null;)jA(s.alternate,s),s=s.return;ut=null}}function xc(s,l){var h=s.timeoutHandle;h!==-1&&(s.timeoutHandle=-1,JF(h)),h=s.cancelPendingCommit,h!==null&&(s.cancelPendingCommit=null,h()),Ha=0,vb(),Dt=s,ut=h=Pa(s.current,null),ht=l,At=0,Fr=null,As=!1,yc=ms(s,l),fb=!1,vc=qr=hb=Go=Os=un=0,Nr=wd=null,pb=!1,(l&8)!==0&&(l|=l&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=l;0<g;){var b=31-ue(g),N=1<<b;l|=s[b],g&=~N}return Ka=l,Kh(),h}function VA(s,l){tt=null,K.H=hd,l===cc||l===Xh?(l=c_(),At=3):l===S0?(l=c_(),At=4):At=l===W0?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Fr=l,ut===null&&(un=1,fp(s,ri(l,s.current)))}function ZA(){var s=Ur.current;return s===null?!0:(ht&4194048)===ht?oi===null:(ht&62914560)===ht||(ht&536870912)!==0?s===oi:!1}function YA(){var s=K.H;return K.H=hd,s===null?hd:s}function WA(){var s=K.A;return K.A=TF,s}function Np(){un=4,As||(ht&4194048)!==ht&&Ur.current!==null||(yc=!0),(Os&134217727)===0&&(Go&134217727)===0||Dt===null||Ps(Dt,ht,qr,!1)}function bb(s,l,h){var g=St;St|=2;var b=YA(),N=WA();(Dt!==s||ht!==l)&&(Sp=null,xc(s,l)),l=!1;var E=un;e:do try{if(At!==0&&ut!==null){var D=ut,H=Fr;switch(At){case 8:vb(),E=6;break e;case 3:case 2:case 9:case 6:Ur.current===null&&(l=!0);var re=At;if(At=0,Fr=null,wc(s,D,H,re),h&&yc){E=0;break e}break;default:re=At,At=0,Fr=null,wc(s,D,H,re)}}RF(),E=un;break}catch(fe){VA(s,fe)}while(!0);return l&&s.shellSuspendCounter++,Ra=Io=null,St=g,K.H=b,K.A=N,ut===null&&(Dt=null,ht=0,Kh()),E}function RF(){for(;ut!==null;)QA(ut)}function MF(s,l){var h=St;St|=2;var g=YA(),b=WA();Dt!==s||ht!==l?(Sp=null,wp=Re()+500,xc(s,l)):yc=ms(s,l);e:do try{if(At!==0&&ut!==null){l=ut;var N=Fr;t:switch(At){case 1:At=0,Fr=null,wc(s,l,N,1);break;case 2:case 9:if(o_(N)){At=0,Fr=null,XA(l);break}l=function(){At!==2&&At!==9||Dt!==s||(At=7),na(s)},N.then(l,l);break e;case 3:At=7;break e;case 4:At=5;break e;case 7:o_(N)?(At=0,Fr=null,XA(l)):(At=0,Fr=null,wc(s,l,N,7));break;case 5:var E=null;switch(ut.tag){case 26:E=ut.memoizedState;case 5:case 27:var D=ut;if(E?IO(E):D.stateNode.complete){At=0,Fr=null;var H=D.sibling;if(H!==null)ut=H;else{var re=D.return;re!==null?(ut=re,kp(re)):ut=null}break t}}At=0,Fr=null,wc(s,l,N,5);break;case 6:At=0,Fr=null,wc(s,l,N,6);break;case 8:vb(),un=6;break e;default:throw Error(r(462))}}DF();break}catch(fe){VA(s,fe)}while(!0);return Ra=Io=null,K.H=g,K.A=b,St=h,ut!==null?0:(Dt=null,ht=0,Kh(),un)}function DF(){for(;ut!==null&&!be();)QA(ut)}function QA(s){var l=wA(s.alternate,s,Ka);s.memoizedProps=s.pendingProps,l===null?kp(s):ut=l}function XA(s){var l=s,h=l.alternate;switch(l.tag){case 15:case 0:l=mA(h,l,l.pendingProps,l.type,void 0,ht);break;case 11:l=mA(h,l,l.pendingProps,l.type.render,l.ref,ht);break;case 5:R0(l);default:jA(h,l),l=ut=WC(l,Ka),l=wA(h,l,Ka)}s.memoizedProps=s.pendingProps,l===null?kp(s):ut=l}function wc(s,l,h,g){Ra=Io=null,R0(l),uc=null,ad=0;var b=l.return;try{if(NF(s,b,l,h,ht)){un=1,fp(s,ri(h,s.current)),ut=null;return}}catch(N){if(b!==null)throw ut=b,N;un=1,fp(s,ri(h,s.current)),ut=null;return}l.flags&32768?(mt||g===1?s=!0:yc||(ht&536870912)!==0?s=!1:(As=s=!0,(g===2||g===9||g===3||g===6)&&(g=Ur.current,g!==null&&g.tag===13&&(g.flags|=16384))),JA(l,s)):kp(l)}function kp(s){var l=s;do{if((l.flags&32768)!==0){JA(l,As);return}s=l.return;var h=_F(l.alternate,l,Ka);if(h!==null){ut=h;return}if(l=l.sibling,l!==null){ut=l;return}ut=l=s}while(l!==null);un===0&&(un=5)}function JA(s,l){do{var h=AF(s.alternate,s);if(h!==null){h.flags&=32767,ut=h;return}if(h=s.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!l&&(s=s.sibling,s!==null)){ut=s;return}ut=s=h}while(s!==null);un=6,ut=null}function eO(s,l,h,g,b,N,E,D,H){s.cancelPendingCommit=null;do Cp();while(On!==0);if((St&6)!==0)throw Error(r(327));if(l!==null){if(l===s.current)throw Error(r(177));if(N=l.lanes|l.childLanes,N|=o0,kh(s,h,N,E,D,H),s===Dt&&(ut=Dt=null,ht=0),bc=l,Ts=s,Ha=h,mb=N,gb=b,qA=g,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,UF(Ee,function(){return aO(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||g){g=K.T,K.T=null,b=X.p,X.p=2,E=St,St|=4;try{OF(s,l,h)}finally{St=E,X.p=b,K.T=g}}On=1,tO(),nO(),rO()}}function tO(){if(On===1){On=0;var s=Ts,l=bc,h=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||h){h=K.T,K.T=null;var g=X.p;X.p=2;var b=St;St|=4;try{MA(l,s);var N=Tb,E=BC(s.containerInfo),D=N.focusedElem,H=N.selectionRange;if(E!==D&&D&&D.ownerDocument&&UC(D.ownerDocument.documentElement,D)){if(H!==null&&n0(D)){var re=H.start,fe=H.end;if(fe===void 0&&(fe=re),"selectionStart"in D)D.selectionStart=re,D.selectionEnd=Math.min(fe,D.value.length);else{var ge=D.ownerDocument||document,oe=ge&&ge.defaultView||window;if(oe.getSelection){var ce=oe.getSelection(),Ie=D.textContent.length,Ze=Math.min(H.start,Ie),Rt=H.end===void 0?Ze:Math.min(H.end,Ie);!ce.extend&&Ze>Rt&&(E=Rt,Rt=Ze,Ze=E);var W=$C(D,Ze),Z=$C(D,Rt);if(W&&Z&&(ce.rangeCount!==1||ce.anchorNode!==W.node||ce.anchorOffset!==W.offset||ce.focusNode!==Z.node||ce.focusOffset!==Z.offset)){var ne=ge.createRange();ne.setStart(W.node,W.offset),ce.removeAllRanges(),Ze>Rt?(ce.addRange(ne),ce.extend(Z.node,Z.offset)):(ne.setEnd(Z.node,Z.offset),ce.addRange(ne))}}}}for(ge=[],ce=D;ce=ce.parentNode;)ce.nodeType===1&&ge.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<ge.length;D++){var pe=ge[D];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}Lp=!!Eb,Tb=Eb=null}finally{St=b,X.p=g,K.T=h}}s.current=l,On=2}}function nO(){if(On===2){On=0;var s=Ts,l=bc,h=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||h){h=K.T,K.T=null;var g=X.p;X.p=2;var b=St;St|=4;try{EA(s,l.alternate,l)}finally{St=b,X.p=g,K.T=h}}On=3}}function rO(){if(On===4||On===3){On=0,ze();var s=Ts,l=bc,h=Ha,g=qA;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?On=5:(On=0,bc=Ts=null,iO(s,s.pendingLanes));var b=s.pendingLanes;if(b===0&&(Es=null),Vl(h),l=l.stateNode,kt&&typeof kt.onCommitFiberRoot=="function")try{kt.onCommitFiberRoot(Qe,l,void 0,(l.current.flags&128)===128)}catch{}if(g!==null){l=K.T,b=X.p,X.p=2,K.T=null;try{for(var N=s.onRecoverableError,E=0;E<g.length;E++){var D=g[E];N(D.value,{componentStack:D.stack})}}finally{K.T=l,X.p=b}}(Ha&3)!==0&&Cp(),na(s),b=s.pendingLanes,(h&261930)!==0&&(b&42)!==0?s===yb?Sd++:(Sd=0,yb=s):Sd=0,jd(0)}}function iO(s,l){(s.pooledCacheLanes&=l)===0&&(l=s.pooledCache,l!=null&&(s.pooledCache=null,rd(l)))}function Cp(){return tO(),nO(),rO(),aO()}function aO(){if(On!==5)return!1;var s=Ts,l=mb;mb=0;var h=Vl(Ha),g=K.T,b=X.p;try{X.p=32>h?32:h,K.T=null,h=gb,gb=null;var N=Ts,E=Ha;if(On=0,bc=Ts=null,Ha=0,(St&6)!==0)throw Error(r(331));var D=St;if(St|=4,UA(N.current),IA(N,N.current,E,h),St=D,jd(0,!1),kt&&typeof kt.onPostCommitFiberRoot=="function")try{kt.onPostCommitFiberRoot(Qe,N)}catch{}return!0}finally{X.p=b,K.T=g,iO(s,l)}}function sO(s,l,h){l=ri(h,l),l=Y0(s.stateNode,l,2),s=Ns(s,l,2),s!==null&&(Ao(s,2),na(s))}function Ot(s,l,h){if(s.tag===3)sO(s,s,h);else for(;l!==null;){if(l.tag===3){sO(l,s,h);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Es===null||!Es.has(g))){s=ri(h,s),h=oA(2),g=Ns(l,h,2),g!==null&&(lA(h,g,l,s),Ao(g,2),na(g));break}}l=l.return}}function xb(s,l,h){var g=s.pingCache;if(g===null){g=s.pingCache=new PF;var b=new Set;g.set(l,b)}else b=g.get(l),b===void 0&&(b=new Set,g.set(l,b));b.has(h)||(fb=!0,b.add(h),s=IF.bind(null,s,l,h),l.then(s,s))}function IF(s,l,h){var g=s.pingCache;g!==null&&g.delete(l),s.pingedLanes|=s.suspendedLanes&h,s.warmLanes&=~h,Dt===s&&(ht&h)===h&&(un===4||un===3&&(ht&62914560)===ht&&300>Re()-xp?(St&2)===0&&xc(s,0):hb|=h,vc===ht&&(vc=0)),na(s)}function oO(s,l){l===0&&(l=_o()),s=Ro(s,l),s!==null&&(Ao(s,l),na(s))}function LF(s){var l=s.memoizedState,h=0;l!==null&&(h=l.retryLane),oO(s,h)}function $F(s,l){var h=0;switch(s.tag){case 31:case 13:var g=s.stateNode,b=s.memoizedState;b!==null&&(h=b.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(l),oO(s,h)}function UF(s,l){return ve(s,l)}var _p=null,Sc=null,wb=!1,Ap=!1,Sb=!1,zs=0;function na(s){s!==Sc&&s.next===null&&(Sc===null?_p=Sc=s:Sc=Sc.next=s),Ap=!0,wb||(wb=!0,FF())}function jd(s,l){if(!Sb&&Ap){Sb=!0;do for(var h=!1,g=_p;g!==null;){if(s!==0){var b=g.pendingLanes;if(b===0)var N=0;else{var E=g.suspendedLanes,D=g.pingedLanes;N=(1<<31-ue(42|s)+1)-1,N&=b&~(E&~D),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(h=!0,dO(g,N))}else N=ht,N=Co(g,g===Dt?N:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(N&3)===0||ms(g,N)||(h=!0,dO(g,N));g=g.next}while(h);Sb=!1}}function BF(){lO()}function lO(){Ap=wb=!1;var s=0;zs!==0&&XF()&&(s=zs);for(var l=Re(),h=null,g=_p;g!==null;){var b=g.next,N=cO(g,l);N===0?(g.next=null,h===null?_p=b:h.next=b,b===null&&(Sc=h)):(h=g,(s!==0||(N&3)!==0)&&(Ap=!0)),g=b}On!==0&&On!==5||jd(s),zs!==0&&(zs=0)}function cO(s,l){for(var h=s.suspendedLanes,g=s.pingedLanes,b=s.expirationTimes,N=s.pendingLanes&-62914561;0<N;){var E=31-ue(N),D=1<<E,H=b[E];H===-1?((D&h)===0||(D&g)!==0)&&(b[E]=$v(D,l)):H<=l&&(s.expiredLanes|=D),N&=~D}if(l=Dt,h=ht,h=Co(s,s===l?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,h===0||s===l&&(At===2||At===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&Ve(g),s.callbackNode=null,s.callbackPriority=0;if((h&3)===0||ms(s,h)){if(l=h&-h,l===s.callbackPriority)return l;switch(g!==null&&Ve(g),Vl(h)){case 2:case 8:h=xe;break;case 32:h=Ee;break;case 268435456:h=Je;break;default:h=Ee}return g=uO.bind(null,s),h=ve(h,g),s.callbackPriority=l,s.callbackNode=h,l}return g!==null&&g!==null&&Ve(g),s.callbackPriority=2,s.callbackNode=null,2}function uO(s,l){if(On!==0&&On!==5)return s.callbackNode=null,s.callbackPriority=0,null;var h=s.callbackNode;if(Cp()&&s.callbackNode!==h)return null;var g=ht;return g=Co(s,s===Dt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(HA(s,g,l),cO(s,Re()),s.callbackNode!=null&&s.callbackNode===h?uO.bind(null,s):null)}function dO(s,l){if(Cp())return null;HA(s,l,!0)}function FF(){e9(function(){(St&6)!==0?ve(te,BF):lO()})}function jb(){if(zs===0){var s=oc;s===0&&(s=ps,ps<<=1,(ps&261888)===0&&(ps=256)),zs=s}return zs}function fO(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Dh(""+s)}function hO(s,l){var h=l.ownerDocument.createElement("input");return h.name=l.name,h.value=l.value,s.id&&h.setAttribute("form",s.id),l.parentNode.insertBefore(h,l),s=new FormData(s),h.parentNode.removeChild(h),s}function qF(s,l,h,g,b){if(l==="submit"&&h&&h.stateNode===b){var N=fO((b[_t]||null).action),E=g.submitter;E&&(l=(l=E[_t]||null)?fO(l.formAction):E.getAttribute("formAction"),l!==null&&(N=l,E=null));var D=new Uh("action","action",null,g,b);s.push({event:D,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(zs!==0){var H=E?hO(b,E):new FormData(b);q0(h,{pending:!0,data:H,method:b.method,action:N},null,H)}}else typeof N=="function"&&(D.preventDefault(),H=E?hO(b,E):new FormData(b),q0(h,{pending:!0,data:H,method:b.method,action:N},N,H))},currentTarget:b}]})}}for(var Nb=0;Nb<s0.length;Nb++){var kb=s0[Nb],KF=kb.toLowerCase(),HF=kb[0].toUpperCase()+kb.slice(1);Mi(KF,"on"+HF)}Mi(KC,"onAnimationEnd"),Mi(HC,"onAnimationIteration"),Mi(GC,"onAnimationStart"),Mi("dblclick","onDoubleClick"),Mi("focusin","onFocus"),Mi("focusout","onBlur"),Mi(oF,"onTransitionRun"),Mi(lF,"onTransitionStart"),Mi(cF,"onTransitionCancel"),Mi(VC,"onTransitionEnd"),vt("onMouseEnter",["mouseout","mouseover"]),vt("onMouseLeave",["mouseout","mouseover"]),vt("onPointerEnter",["pointerout","pointerover"]),vt("onPointerLeave",["pointerout","pointerover"]),at("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),at("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),at("onBeforeInput",["compositionend","keypress","textInput","paste"]),at("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),at("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),at("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nd="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(" "),GF=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nd));function pO(s,l){l=(l&4)!==0;for(var h=0;h<s.length;h++){var g=s[h],b=g.event;g=g.listeners;e:{var N=void 0;if(l)for(var E=g.length-1;0<=E;E--){var D=g[E],H=D.instance,re=D.currentTarget;if(D=D.listener,H!==N&&b.isPropagationStopped())break e;N=D,b.currentTarget=re;try{N(b)}catch(fe){qh(fe)}b.currentTarget=null,N=H}else for(E=0;E<g.length;E++){if(D=g[E],H=D.instance,re=D.currentTarget,D=D.listener,H!==N&&b.isPropagationStopped())break e;N=D,b.currentTarget=re;try{N(b)}catch(fe){qh(fe)}b.currentTarget=null,N=H}}}}function dt(s,l){var h=l[Ti];h===void 0&&(h=l[Ti]=new Set);var g=s+"__bubble";h.has(g)||(mO(l,s,2,!1),h.add(g))}function Cb(s,l,h){var g=0;l&&(g|=4),mO(h,s,g,l)}var Op="_reactListening"+Math.random().toString(36).slice(2);function _b(s){if(!s[Op]){s[Op]=!0,Eh.forEach(function(h){h!=="selectionchange"&&(GF.has(h)||Cb(h,!1,s),Cb(h,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[Op]||(l[Op]=!0,Cb("selectionchange",!1,l))}}function mO(s,l,h,g){switch(KO(l)){case 2:var b=x9;break;case 8:b=w9;break;default:b=Fb}h=b.bind(null,l,h,s),b=void 0,!Vv||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(b=!0),g?b!==void 0?s.addEventListener(l,h,{capture:!0,passive:b}):s.addEventListener(l,h,!0):b!==void 0?s.addEventListener(l,h,{passive:b}):s.addEventListener(l,h,!1)}function Ab(s,l,h,g,b){var N=g;if((l&1)===0&&(l&2)===0&&g!==null)e:for(;;){if(g===null)return;var E=g.tag;if(E===3||E===4){var D=g.stateNode.containerInfo;if(D===b)break;if(E===4)for(E=g.return;E!==null;){var H=E.tag;if((H===3||H===4)&&E.stateNode.containerInfo===b)return;E=E.return}for(;D!==null;){if(E=Pi(D),E===null)return;if(H=E.tag,H===5||H===6||H===26||H===27){g=N=E;continue e}D=D.parentNode}}g=g.return}xC(function(){var re=N,fe=Hv(h),ge=[];e:{var oe=ZC.get(s);if(oe!==void 0){var ce=Uh,Ie=s;switch(s){case"keypress":if(Lh(h)===0)break e;case"keydown":case"keyup":ce=$8;break;case"focusin":Ie="focus",ce=Qv;break;case"focusout":Ie="blur",ce=Qv;break;case"beforeblur":case"afterblur":ce=Qv;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":ce=jC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=_8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=F8;break;case KC:case HC:case GC:ce=E8;break;case VC:ce=K8;break;case"scroll":case"scrollend":ce=k8;break;case"wheel":ce=G8;break;case"copy":case"cut":case"paste":ce=P8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=kC;break;case"toggle":case"beforetoggle":ce=Z8}var Ze=(l&4)!==0,Rt=!Ze&&(s==="scroll"||s==="scrollend"),W=Ze?oe!==null?oe+"Capture":null:oe;Ze=[];for(var Z=re,ne;Z!==null;){var pe=Z;if(ne=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||ne===null||W===null||(pe=Gu(Z,W),pe!=null&&Ze.push(kd(Z,pe,ne))),Rt)break;Z=Z.return}0<Ze.length&&(oe=new ce(oe,Ie,null,h,fe),ge.push({event:oe,listeners:Ze}))}}if((l&7)===0){e:{if(oe=s==="mouseover"||s==="pointerover",ce=s==="mouseout"||s==="pointerout",oe&&h!==Kv&&(Ie=h.relatedTarget||h.fromElement)&&(Pi(Ie)||Ie[Dr]))break e;if((ce||oe)&&(oe=fe.window===fe?fe:(oe=fe.ownerDocument)?oe.defaultView||oe.parentWindow:window,ce?(Ie=h.relatedTarget||h.toElement,ce=re,Ie=Ie?Pi(Ie):null,Ie!==null&&(Rt=a(Ie),Ze=Ie.tag,Ie!==Rt||Ze!==5&&Ze!==27&&Ze!==6)&&(Ie=null)):(ce=null,Ie=re),ce!==Ie)){if(Ze=jC,pe="onMouseLeave",W="onMouseEnter",Z="mouse",(s==="pointerout"||s==="pointerover")&&(Ze=kC,pe="onPointerLeave",W="onPointerEnter",Z="pointer"),Rt=ce==null?oe:Oo(ce),ne=Ie==null?oe:Oo(Ie),oe=new Ze(pe,Z+"leave",ce,h,fe),oe.target=Rt,oe.relatedTarget=ne,pe=null,Pi(fe)===re&&(Ze=new Ze(W,Z+"enter",Ie,h,fe),Ze.target=ne,Ze.relatedTarget=Rt,pe=Ze),Rt=pe,ce&&Ie)t:{for(Ze=VF,W=ce,Z=Ie,ne=0,pe=W;pe;pe=Ze(pe))ne++;pe=0;for(var He=Z;He;He=Ze(He))pe++;for(;0<ne-pe;)W=Ze(W),ne--;for(;0<pe-ne;)Z=Ze(Z),pe--;for(;ne--;){if(W===Z||Z!==null&&W===Z.alternate){Ze=W;break t}W=Ze(W),Z=Ze(Z)}Ze=null}else Ze=null;ce!==null&&gO(ge,oe,ce,Ze,!1),Ie!==null&&Rt!==null&&gO(ge,Rt,Ie,Ze,!0)}}e:{if(oe=re?Oo(re):window,ce=oe.nodeName&&oe.nodeName.toLowerCase(),ce==="select"||ce==="input"&&oe.type==="file")var bt=zC;else if(TC(oe))if(RC)bt=iF;else{bt=nF;var Be=tF}else ce=oe.nodeName,!ce||ce.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?re&&qv(re.elementType)&&(bt=zC):bt=rF;if(bt&&(bt=bt(s,re))){PC(ge,bt,h,fe);break e}Be&&Be(s,oe,re),s==="focusout"&&re&&oe.type==="number"&&re.memoizedProps.value!=null&&Fv(oe,"number",oe.value)}switch(Be=re?Oo(re):window,s){case"focusin":(TC(Be)||Be.contentEditable==="true")&&(Jl=Be,r0=re,ed=null);break;case"focusout":ed=r0=Jl=null;break;case"mousedown":i0=!0;break;case"contextmenu":case"mouseup":case"dragend":i0=!1,FC(ge,h,fe);break;case"selectionchange":if(sF)break;case"keydown":case"keyup":FC(ge,h,fe)}var st;if(Jv)e:{switch(s){case"compositionstart":var pt="onCompositionStart";break e;case"compositionend":pt="onCompositionEnd";break e;case"compositionupdate":pt="onCompositionUpdate";break e}pt=void 0}else Xl?OC(s,h)&&(pt="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(pt="onCompositionStart");pt&&(CC&&h.locale!=="ko"&&(Xl||pt!=="onCompositionStart"?pt==="onCompositionEnd"&&Xl&&(st=wC()):(ys=fe,Zv="value"in ys?ys.value:ys.textContent,Xl=!0)),Be=Ep(re,pt),0<Be.length&&(pt=new NC(pt,s,null,h,fe),ge.push({event:pt,listeners:Be}),st?pt.data=st:(st=EC(h),st!==null&&(pt.data=st)))),(st=W8?Q8(s,h):X8(s,h))&&(pt=Ep(re,"onBeforeInput"),0<pt.length&&(Be=new NC("onBeforeInput","beforeinput",null,h,fe),ge.push({event:Be,listeners:pt}),Be.data=st)),qF(ge,s,re,h,fe)}pO(ge,l)})}function kd(s,l,h){return{instance:s,listener:l,currentTarget:h}}function Ep(s,l){for(var h=l+"Capture",g=[];s!==null;){var b=s,N=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||N===null||(b=Gu(s,h),b!=null&&g.unshift(kd(s,b,N)),b=Gu(s,l),b!=null&&g.push(kd(s,b,N))),s.tag===3)return g;s=s.return}return[]}function VF(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function gO(s,l,h,g,b){for(var N=l._reactName,E=[];h!==null&&h!==g;){var D=h,H=D.alternate,re=D.stateNode;if(D=D.tag,H!==null&&H===g)break;D!==5&&D!==26&&D!==27||re===null||(H=re,b?(re=Gu(h,N),re!=null&&E.unshift(kd(h,re,H))):b||(re=Gu(h,N),re!=null&&E.push(kd(h,re,H)))),h=h.return}E.length!==0&&s.push({event:l,listeners:E})}var ZF=/\r\n?/g,YF=/\u0000|\uFFFD/g;function yO(s){return(typeof s=="string"?s:""+s).replace(ZF,`
|
|
9
|
-
`).replace(YF,"")}function vO(s,l){return l=yO(l),yO(s)===l}function zt(s,l,h,g,b,N){switch(h){case"children":typeof g=="string"?l==="body"||l==="textarea"&&g===""||Yl(s,g):(typeof g=="number"||typeof g=="bigint")&&l!=="body"&&Yl(s,""+g);break;case"className":Rh(s,"class",g);break;case"tabIndex":Rh(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Rh(s,h,g);break;case"style":vC(s,g,N);break;case"data":if(l!=="object"){Rh(s,"data",g);break}case"src":case"href":if(g===""&&(l!=="a"||h!=="href")){s.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=Dh(""+g),s.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof N=="function"&&(h==="formAction"?(l!=="input"&&zt(s,l,"name",b.name,b,null),zt(s,l,"formEncType",b.formEncType,b,null),zt(s,l,"formMethod",b.formMethod,b,null),zt(s,l,"formTarget",b.formTarget,b,null)):(zt(s,l,"encType",b.encType,b,null),zt(s,l,"method",b.method,b,null),zt(s,l,"target",b.target,b,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=Dh(""+g),s.setAttribute(h,g);break;case"onClick":g!=null&&(s.onclick=Ea);break;case"onScroll":g!=null&&dt("scroll",s);break;case"onScrollEnd":g!=null&&dt("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(b.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}h=Dh(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,""+g):s.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,""):s.removeAttribute(h);break;case"capture":case"download":g===!0?s.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,g):s.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(h,g):s.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(h):s.setAttribute(h,g);break;case"popover":dt("beforetoggle",s),dt("toggle",s),zh(s,"popover",g);break;case"xlinkActuate":Oa(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Oa(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Oa(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Oa(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Oa(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Oa(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Oa(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Oa(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Oa(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":zh(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=j8.get(h)||h,zh(s,h,g))}}function Ob(s,l,h,g,b,N){switch(h){case"style":vC(s,g,N);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(b.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"children":typeof g=="string"?Yl(s,g):(typeof g=="number"||typeof g=="bigint")&&Yl(s,""+g);break;case"onScroll":g!=null&&dt("scroll",s);break;case"onScrollEnd":g!=null&&dt("scrollend",s);break;case"onClick":g!=null&&(s.onclick=Ea);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Th.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(b=h.endsWith("Capture"),l=h.slice(2,b?h.length-7:void 0),N=s[_t]||null,N=N!=null?N[h]:null,typeof N=="function"&&s.removeEventListener(l,N,b),typeof g=="function")){typeof N!="function"&&N!==null&&(h in s?s[h]=null:s.hasAttribute(h)&&s.removeAttribute(h)),s.addEventListener(l,g,b);break e}h in s?s[h]=g:g===!0?s.setAttribute(h,""):zh(s,h,g)}}}function Gn(s,l,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":dt("error",s),dt("load",s);var g=!1,b=!1,N;for(N in h)if(h.hasOwnProperty(N)){var E=h[N];if(E!=null)switch(N){case"src":g=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:zt(s,l,N,E,h,null)}}b&&zt(s,l,"srcSet",h.srcSet,h,null),g&&zt(s,l,"src",h.src,h,null);return;case"input":dt("invalid",s);var D=N=E=b=null,H=null,re=null;for(g in h)if(h.hasOwnProperty(g)){var fe=h[g];if(fe!=null)switch(g){case"name":b=fe;break;case"type":E=fe;break;case"checked":H=fe;break;case"defaultChecked":re=fe;break;case"value":N=fe;break;case"defaultValue":D=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,l));break;default:zt(s,l,g,fe,h,null)}}pC(s,N,D,H,re,E,b,!1);return;case"select":dt("invalid",s),g=E=N=null;for(b in h)if(h.hasOwnProperty(b)&&(D=h[b],D!=null))switch(b){case"value":N=D;break;case"defaultValue":E=D;break;case"multiple":g=D;default:zt(s,l,b,D,h,null)}l=N,h=E,s.multiple=!!g,l!=null?Zl(s,!!g,l,!1):h!=null&&Zl(s,!!g,h,!0);return;case"textarea":dt("invalid",s),N=b=g=null;for(E in h)if(h.hasOwnProperty(E)&&(D=h[E],D!=null))switch(E){case"value":g=D;break;case"defaultValue":b=D;break;case"children":N=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(r(91));break;default:zt(s,l,E,D,h,null)}gC(s,g,b,N);return;case"option":for(H in h)h.hasOwnProperty(H)&&(g=h[H],g!=null)&&(H==="selected"?s.selected=g&&typeof g!="function"&&typeof g!="symbol":zt(s,l,H,g,h,null));return;case"dialog":dt("beforetoggle",s),dt("toggle",s),dt("cancel",s),dt("close",s);break;case"iframe":case"object":dt("load",s);break;case"video":case"audio":for(g=0;g<Nd.length;g++)dt(Nd[g],s);break;case"image":dt("error",s),dt("load",s);break;case"details":dt("toggle",s);break;case"embed":case"source":case"link":dt("error",s),dt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in h)if(h.hasOwnProperty(re)&&(g=h[re],g!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:zt(s,l,re,g,h,null)}return;default:if(qv(l)){for(fe in h)h.hasOwnProperty(fe)&&(g=h[fe],g!==void 0&&Ob(s,l,fe,g,h,void 0));return}}for(D in h)h.hasOwnProperty(D)&&(g=h[D],g!=null&&zt(s,l,D,g,h,null))}function WF(s,l,h,g){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,N=null,E=null,D=null,H=null,re=null,fe=null;for(ce in h){var ge=h[ce];if(h.hasOwnProperty(ce)&&ge!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":H=ge;default:g.hasOwnProperty(ce)||zt(s,l,ce,null,g,ge)}}for(var oe in g){var ce=g[oe];if(ge=h[oe],g.hasOwnProperty(oe)&&(ce!=null||ge!=null))switch(oe){case"type":N=ce;break;case"name":b=ce;break;case"checked":re=ce;break;case"defaultChecked":fe=ce;break;case"value":E=ce;break;case"defaultValue":D=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,l));break;default:ce!==ge&&zt(s,l,oe,ce,g,ge)}}Bv(s,E,D,H,re,fe,N,b);return;case"select":ce=E=D=oe=null;for(N in h)if(H=h[N],h.hasOwnProperty(N)&&H!=null)switch(N){case"value":break;case"multiple":ce=H;default:g.hasOwnProperty(N)||zt(s,l,N,null,g,H)}for(b in g)if(N=g[b],H=h[b],g.hasOwnProperty(b)&&(N!=null||H!=null))switch(b){case"value":oe=N;break;case"defaultValue":D=N;break;case"multiple":E=N;default:N!==H&&zt(s,l,b,N,g,H)}l=D,h=E,g=ce,oe!=null?Zl(s,!!h,oe,!1):!!g!=!!h&&(l!=null?Zl(s,!!h,l,!0):Zl(s,!!h,h?[]:"",!1));return;case"textarea":ce=oe=null;for(D in h)if(b=h[D],h.hasOwnProperty(D)&&b!=null&&!g.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:zt(s,l,D,null,g,b)}for(E in g)if(b=g[E],N=h[E],g.hasOwnProperty(E)&&(b!=null||N!=null))switch(E){case"value":oe=b;break;case"defaultValue":ce=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==N&&zt(s,l,E,b,g,N)}mC(s,oe,ce);return;case"option":for(var Ie in h)oe=h[Ie],h.hasOwnProperty(Ie)&&oe!=null&&!g.hasOwnProperty(Ie)&&(Ie==="selected"?s.selected=!1:zt(s,l,Ie,null,g,oe));for(H in g)oe=g[H],ce=h[H],g.hasOwnProperty(H)&&oe!==ce&&(oe!=null||ce!=null)&&(H==="selected"?s.selected=oe&&typeof oe!="function"&&typeof oe!="symbol":zt(s,l,H,oe,g,ce));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 Ze in h)oe=h[Ze],h.hasOwnProperty(Ze)&&oe!=null&&!g.hasOwnProperty(Ze)&&zt(s,l,Ze,null,g,oe);for(re in g)if(oe=g[re],ce=h[re],g.hasOwnProperty(re)&&oe!==ce&&(oe!=null||ce!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,l));break;default:zt(s,l,re,oe,g,ce)}return;default:if(qv(l)){for(var Rt in h)oe=h[Rt],h.hasOwnProperty(Rt)&&oe!==void 0&&!g.hasOwnProperty(Rt)&&Ob(s,l,Rt,void 0,g,oe);for(fe in g)oe=g[fe],ce=h[fe],!g.hasOwnProperty(fe)||oe===ce||oe===void 0&&ce===void 0||Ob(s,l,fe,oe,g,ce);return}}for(var W in h)oe=h[W],h.hasOwnProperty(W)&&oe!=null&&!g.hasOwnProperty(W)&&zt(s,l,W,null,g,oe);for(ge in g)oe=g[ge],ce=h[ge],!g.hasOwnProperty(ge)||oe===ce||oe==null&&ce==null||zt(s,l,ge,oe,g,ce)}function bO(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function QF(){if(typeof performance.getEntriesByType=="function"){for(var s=0,l=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var b=h[g],N=b.transferSize,E=b.initiatorType,D=b.duration;if(N&&D&&bO(E)){for(E=0,D=b.responseEnd,g+=1;g<h.length;g++){var H=h[g],re=H.startTime;if(re>D)break;var fe=H.transferSize,ge=H.initiatorType;fe&&bO(ge)&&(H=H.responseEnd,E+=fe*(H<D?1:(D-re)/(H-re)))}if(--g,l+=8*(N+E)/(b.duration/1e3),s++,10<s)break}}if(0<s)return l/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Eb=null,Tb=null;function Tp(s){return s.nodeType===9?s:s.ownerDocument}function xO(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function wO(s,l){if(s===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&l==="foreignObject"?0:s}function Pb(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var zb=null;function XF(){var s=window.event;return s&&s.type==="popstate"?s===zb?!1:(zb=s,!0):(zb=null,!1)}var SO=typeof setTimeout=="function"?setTimeout:void 0,JF=typeof clearTimeout=="function"?clearTimeout:void 0,jO=typeof Promise=="function"?Promise:void 0,e9=typeof queueMicrotask=="function"?queueMicrotask:typeof jO<"u"?function(s){return jO.resolve(null).then(s).catch(t9)}:SO;function t9(s){setTimeout(function(){throw s})}function Rs(s){return s==="head"}function NO(s,l){var h=l,g=0;do{var b=h.nextSibling;if(s.removeChild(h),b&&b.nodeType===8)if(h=b.data,h==="/$"||h==="/&"){if(g===0){s.removeChild(b),Cc(l);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")Cd(s.ownerDocument.documentElement);else if(h==="head"){h=s.ownerDocument.head,Cd(h);for(var N=h.firstChild;N;){var E=N.nextSibling,D=N.nodeName;N[Jr]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&N.rel.toLowerCase()==="stylesheet"||h.removeChild(N),N=E}}else h==="body"&&Cd(s.ownerDocument.body);h=b}while(h);Cc(l)}function kO(s,l){var h=s;s=0;do{var g=h.nextSibling;if(h.nodeType===1?l?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(l?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(s===0)break;s--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||s++;h=g}while(h)}function Rb(s){var l=s.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var h=l;switch(l=l.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Rb(h),_a(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}s.removeChild(h)}}function n9(s,l,h,g){for(;s.nodeType===1;){var b=h;if(s.nodeName.toLowerCase()!==l.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[Jr])switch(l){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(N=s.getAttribute("rel"),N==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(N!==b.rel||s.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||s.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||s.getAttribute("title")!==(b.title==null?null:b.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(N=s.getAttribute("src"),(N!==(b.src==null?null:b.src)||s.getAttribute("type")!==(b.type==null?null:b.type)||s.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&N&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(l==="input"&&s.type==="hidden"){var N=b.name==null?null:""+b.name;if(b.type==="hidden"&&s.getAttribute("name")===N)return s}else return s;if(s=li(s.nextSibling),s===null)break}return null}function r9(s,l,h){if(l==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!h||(s=li(s.nextSibling),s===null))return null;return s}function CO(s,l){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!l||(s=li(s.nextSibling),s===null))return null;return s}function Mb(s){return s.data==="$?"||s.data==="$~"}function Db(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function i9(s,l){var h=s.ownerDocument;if(s.data==="$~")s._reactRetry=l;else if(s.data!=="$?"||h.readyState!=="loading")l();else{var g=function(){l(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function li(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return s}var Ib=null;function _O(s){s=s.nextSibling;for(var l=0;s;){if(s.nodeType===8){var h=s.data;if(h==="/$"||h==="/&"){if(l===0)return li(s.nextSibling);l--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||l++}s=s.nextSibling}return null}function AO(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var h=s.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(l===0)return s;l--}else h!=="/$"&&h!=="/&"||l++}s=s.previousSibling}return null}function OO(s,l,h){switch(l=Tp(h),s){case"html":if(s=l.documentElement,!s)throw Error(r(452));return s;case"head":if(s=l.head,!s)throw Error(r(453));return s;case"body":if(s=l.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Cd(s){for(var l=s.attributes;l.length;)s.removeAttributeNode(l[0]);_a(s)}var ci=new Map,EO=new Set;function Pp(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Ga=X.d;X.d={f:a9,r:s9,D:o9,C:l9,L:c9,m:u9,X:f9,S:d9,M:h9};function a9(){var s=Ga.f(),l=jp();return s||l}function s9(s){var l=Aa(s);l!==null&&l.tag===5&&l.type==="form"?V_(l):Ga.r(s)}var jc=typeof document>"u"?null:document;function TO(s,l,h){var g=jc;if(g&&typeof l=="string"&&l){var b=ti(l);b='link[rel="'+s+'"][href="'+b+'"]',typeof h=="string"&&(b+='[crossorigin="'+h+'"]'),EO.has(b)||(EO.add(b),s={rel:s,crossOrigin:h,href:l},g.querySelector(b)===null&&(l=g.createElement("link"),Gn(l,"link",s),rn(l),g.head.appendChild(l)))}}function o9(s){Ga.D(s),TO("dns-prefetch",s,null)}function l9(s,l){Ga.C(s,l),TO("preconnect",s,l)}function c9(s,l,h){Ga.L(s,l,h);var g=jc;if(g&&s&&l){var b='link[rel="preload"][as="'+ti(l)+'"]';l==="image"&&h&&h.imageSrcSet?(b+='[imagesrcset="'+ti(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(b+='[imagesizes="'+ti(h.imageSizes)+'"]')):b+='[href="'+ti(s)+'"]';var N=b;switch(l){case"style":N=Nc(s);break;case"script":N=kc(s)}ci.has(N)||(s=m({rel:"preload",href:l==="image"&&h&&h.imageSrcSet?void 0:s,as:l},h),ci.set(N,s),g.querySelector(b)!==null||l==="style"&&g.querySelector(_d(N))||l==="script"&&g.querySelector(Ad(N))||(l=g.createElement("link"),Gn(l,"link",s),rn(l),g.head.appendChild(l)))}}function u9(s,l){Ga.m(s,l);var h=jc;if(h&&s){var g=l&&typeof l.as=="string"?l.as:"script",b='link[rel="modulepreload"][as="'+ti(g)+'"][href="'+ti(s)+'"]',N=b;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=kc(s)}if(!ci.has(N)&&(s=m({rel:"modulepreload",href:s},l),ci.set(N,s),h.querySelector(b)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Ad(N)))return}g=h.createElement("link"),Gn(g,"link",s),rn(g),h.head.appendChild(g)}}}function d9(s,l,h){Ga.S(s,l,h);var g=jc;if(g&&s){var b=zi(g).hoistableStyles,N=Nc(s);l=l||"default";var E=b.get(N);if(!E){var D={loading:0,preload:null};if(E=g.querySelector(_d(N)))D.loading=5;else{s=m({rel:"stylesheet",href:s,"data-precedence":l},h),(h=ci.get(N))&&Lb(s,h);var H=E=g.createElement("link");rn(H),Gn(H,"link",s),H._p=new Promise(function(re,fe){H.onload=re,H.onerror=fe}),H.addEventListener("load",function(){D.loading|=1}),H.addEventListener("error",function(){D.loading|=2}),D.loading|=4,zp(E,l,g)}E={type:"stylesheet",instance:E,count:1,state:D},b.set(N,E)}}}function f9(s,l){Ga.X(s,l);var h=jc;if(h&&s){var g=zi(h).hoistableScripts,b=kc(s),N=g.get(b);N||(N=h.querySelector(Ad(b)),N||(s=m({src:s,async:!0},l),(l=ci.get(b))&&$b(s,l),N=h.createElement("script"),rn(N),Gn(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(b,N))}}function h9(s,l){Ga.M(s,l);var h=jc;if(h&&s){var g=zi(h).hoistableScripts,b=kc(s),N=g.get(b);N||(N=h.querySelector(Ad(b)),N||(s=m({src:s,async:!0,type:"module"},l),(l=ci.get(b))&&$b(s,l),N=h.createElement("script"),rn(N),Gn(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(b,N))}}function PO(s,l,h,g){var b=(b=ie.current)?Pp(b):null;if(!b)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(l=Nc(h.href),h=zi(b).hoistableStyles,g=h.get(l),g||(g={type:"style",instance:null,count:0,state:null},h.set(l,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){s=Nc(h.href);var N=zi(b).hoistableStyles,E=N.get(s);if(E||(b=b.ownerDocument||b,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(s,E),(N=b.querySelector(_d(s)))&&!N._p&&(E.instance=N,E.state.loading=5),ci.has(s)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},ci.set(s,h),N||p9(b,s,h,E.state))),l&&g===null)throw Error(r(528,""));return E}if(l&&g!==null)throw Error(r(529,""));return null;case"script":return l=h.async,h=h.src,typeof h=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=kc(h),h=zi(b).hoistableScripts,g=h.get(l),g||(g={type:"script",instance:null,count:0,state:null},h.set(l,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Nc(s){return'href="'+ti(s)+'"'}function _d(s){return'link[rel="stylesheet"]['+s+"]"}function zO(s){return m({},s,{"data-precedence":s.precedence,precedence:null})}function p9(s,l,h,g){s.querySelector('link[rel="preload"][as="style"]['+l+"]")?g.loading=1:(l=s.createElement("link"),g.preload=l,l.addEventListener("load",function(){return g.loading|=1}),l.addEventListener("error",function(){return g.loading|=2}),Gn(l,"link",h),rn(l),s.head.appendChild(l))}function kc(s){return'[src="'+ti(s)+'"]'}function Ad(s){return"script[async]"+s}function RO(s,l,h){if(l.count++,l.instance===null)switch(l.type){case"style":var g=s.querySelector('style[data-href~="'+ti(h.href)+'"]');if(g)return l.instance=g,rn(g),g;var b=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),rn(g),Gn(g,"style",b),zp(g,h.precedence,s),l.instance=g;case"stylesheet":b=Nc(h.href);var N=s.querySelector(_d(b));if(N)return l.state.loading|=4,l.instance=N,rn(N),N;g=zO(h),(b=ci.get(b))&&Lb(g,b),N=(s.ownerDocument||s).createElement("link"),rn(N);var E=N;return E._p=new Promise(function(D,H){E.onload=D,E.onerror=H}),Gn(N,"link",g),l.state.loading|=4,zp(N,h.precedence,s),l.instance=N;case"script":return N=kc(h.src),(b=s.querySelector(Ad(N)))?(l.instance=b,rn(b),b):(g=h,(b=ci.get(N))&&(g=m({},h),$b(g,b)),s=s.ownerDocument||s,b=s.createElement("script"),rn(b),Gn(b,"link",g),s.head.appendChild(b),l.instance=b);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(g=l.instance,l.state.loading|=4,zp(g,h.precedence,s));return l.instance}function zp(s,l,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=g.length?g[g.length-1]:null,N=b,E=0;E<g.length;E++){var D=g[E];if(D.dataset.precedence===l)N=D;else if(N!==b)break}N?N.parentNode.insertBefore(s,N.nextSibling):(l=h.nodeType===9?h.head:h,l.insertBefore(s,l.firstChild))}function Lb(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.title==null&&(s.title=l.title)}function $b(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.integrity==null&&(s.integrity=l.integrity)}var Rp=null;function MO(s,l,h){if(Rp===null){var g=new Map,b=Rp=new Map;b.set(h,g)}else b=Rp,g=b.get(h),g||(g=new Map,b.set(h,g));if(g.has(s))return g;for(g.set(s,null),h=h.getElementsByTagName(s),b=0;b<h.length;b++){var N=h[b];if(!(N[Jr]||N[ct]||s==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var E=N.getAttribute(l)||"";E=s+E;var D=g.get(E);D?D.push(N):g.set(E,[N])}}return g}function DO(s,l,h){s=s.ownerDocument||s,s.head.insertBefore(h,l==="title"?s.querySelector("head > title"):null)}function m9(s,l,h){if(h===1||l.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(s=l.disabled,typeof l.precedence=="string"&&s==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function IO(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function g9(s,l,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 b=Nc(g.href),N=l.querySelector(_d(b));if(N){l=N._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(s.count++,s=Mp.bind(s),l.then(s,s)),h.state.loading|=4,h.instance=N,rn(N);return}N=l.ownerDocument||l,g=zO(g),(b=ci.get(b))&&Lb(g,b),N=N.createElement("link"),rn(N);var E=N;E._p=new Promise(function(D,H){E.onload=D,E.onerror=H}),Gn(N,"link",g),h.instance=N}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(h,l),(l=h.state.preload)&&(h.state.loading&3)===0&&(s.count++,h=Mp.bind(s),l.addEventListener("load",h),l.addEventListener("error",h))}}var Ub=0;function y9(s,l){return s.stylesheets&&s.count===0&&Ip(s,s.stylesheets),0<s.count||0<s.imgCount?function(h){var g=setTimeout(function(){if(s.stylesheets&&Ip(s,s.stylesheets),s.unsuspend){var N=s.unsuspend;s.unsuspend=null,N()}},6e4+l);0<s.imgBytes&&Ub===0&&(Ub=62500*QF());var b=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Ip(s,s.stylesheets),s.unsuspend)){var N=s.unsuspend;s.unsuspend=null,N()}},(s.imgBytes>Ub?50:800)+l);return s.unsuspend=h,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(b)}}:null}function Mp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ip(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Dp=null;function Ip(s,l){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Dp=new Map,l.forEach(v9,s),Dp=null,Mp.call(s))}function v9(s,l){if(!(l.state.loading&4)){var h=Dp.get(s);if(h)var g=h.get(null);else{h=new Map,Dp.set(s,h);for(var b=s.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<b.length;N++){var E=b[N];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(h.set(E.dataset.precedence,E),g=E)}g&&h.set(null,g)}b=l.instance,E=b.getAttribute("data-precedence"),N=h.get(E)||g,N===g&&h.set(null,b),h.set(E,b),this.count++,g=Mp.bind(this),b.addEventListener("load",g),b.addEventListener("error",g),N?N.parentNode.insertBefore(b,N.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(b,s.firstChild)),l.state.loading|=4}}var Od={$$typeof:_,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function b9(s,l,h,g,b,N,E,D,H){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Gl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gl(0),this.hiddenUpdates=Gl(null),this.identifierPrefix=g,this.onUncaughtError=b,this.onCaughtError=N,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function LO(s,l,h,g,b,N,E,D,H,re,fe,ge){return s=new b9(s,l,h,E,H,re,fe,ge,D),l=1,N===!0&&(l|=24),N=$r(3,null,null,l),s.current=N,N.stateNode=s,l=b0(),l.refCount++,s.pooledCache=l,l.refCount++,N.memoizedState={element:g,isDehydrated:h,cache:l},j0(N),s}function $O(s){return s?(s=nc,s):nc}function UO(s,l,h,g,b,N){b=$O(b),g.context===null?g.context=b:g.pendingContext=b,g=js(l),g.payload={element:h},N=N===void 0?null:N,N!==null&&(g.callback=N),h=Ns(s,g,l),h!==null&&(kr(h,s,l),od(h,s,l))}function BO(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<l?h:l}}function Bb(s,l){BO(s,l),(s=s.alternate)&&BO(s,l)}function FO(s){if(s.tag===13||s.tag===31){var l=Ro(s,67108864);l!==null&&kr(l,s,67108864),Bb(s,67108864)}}function qO(s){if(s.tag===13||s.tag===31){var l=Kr();l=Hu(l);var h=Ro(s,l);h!==null&&kr(h,s,l),Bb(s,l)}}var Lp=!0;function x9(s,l,h,g){var b=K.T;K.T=null;var N=X.p;try{X.p=2,Fb(s,l,h,g)}finally{X.p=N,K.T=b}}function w9(s,l,h,g){var b=K.T;K.T=null;var N=X.p;try{X.p=8,Fb(s,l,h,g)}finally{X.p=N,K.T=b}}function Fb(s,l,h,g){if(Lp){var b=qb(g);if(b===null)Ab(s,l,g,$p,h),HO(s,g);else if(j9(b,s,l,h,g))g.stopPropagation();else if(HO(s,g),l&4&&-1<S9.indexOf(s)){for(;b!==null;){var N=Aa(b);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var E=Xr(N.pendingLanes);if(E!==0){var D=N;for(D.pendingLanes|=2,D.entangledLanes|=2;E;){var H=1<<31-ue(E);D.entanglements[1]|=H,E&=~H}na(N),(St&6)===0&&(wp=Re()+500,jd(0))}}break;case 31:case 13:D=Ro(N,2),D!==null&&kr(D,N,2),jp(),Bb(N,2)}if(N=qb(g),N===null&&Ab(s,l,g,$p,h),N===b)break;b=N}b!==null&&g.stopPropagation()}else Ab(s,l,g,null,h)}}function qb(s){return s=Hv(s),Kb(s)}var $p=null;function Kb(s){if($p=null,s=Pi(s),s!==null){var l=a(s);if(l===null)s=null;else{var h=l.tag;if(h===13){if(s=o(l),s!==null)return s;s=null}else if(h===31){if(s=c(l),s!==null)return s;s=null}else if(h===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null)}}return $p=s,null}function KO(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Oe()){case te:return 2;case xe:return 8;case Ee:case Ge:return 32;case Je:return 268435456;default:return 32}default:return 32}}var Hb=!1,Ms=null,Ds=null,Is=null,Ed=new Map,Td=new Map,Ls=[],S9="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 HO(s,l){switch(s){case"focusin":case"focusout":Ms=null;break;case"dragenter":case"dragleave":Ds=null;break;case"mouseover":case"mouseout":Is=null;break;case"pointerover":case"pointerout":Ed.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Td.delete(l.pointerId)}}function Pd(s,l,h,g,b,N){return s===null||s.nativeEvent!==N?(s={blockedOn:l,domEventName:h,eventSystemFlags:g,nativeEvent:N,targetContainers:[b]},l!==null&&(l=Aa(l),l!==null&&FO(l)),s):(s.eventSystemFlags|=g,l=s.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),s)}function j9(s,l,h,g,b){switch(l){case"focusin":return Ms=Pd(Ms,s,l,h,g,b),!0;case"dragenter":return Ds=Pd(Ds,s,l,h,g,b),!0;case"mouseover":return Is=Pd(Is,s,l,h,g,b),!0;case"pointerover":var N=b.pointerId;return Ed.set(N,Pd(Ed.get(N)||null,s,l,h,g,b)),!0;case"gotpointercapture":return N=b.pointerId,Td.set(N,Pd(Td.get(N)||null,s,l,h,g,b)),!0}return!1}function GO(s){var l=Pi(s.target);if(l!==null){var h=a(l);if(h!==null){if(l=h.tag,l===13){if(l=o(h),l!==null){s.blockedOn=l,Ne(s.priority,function(){qO(h)});return}}else if(l===31){if(l=c(h),l!==null){s.blockedOn=l,Ne(s.priority,function(){qO(h)});return}}else if(l===3&&h.stateNode.current.memoizedState.isDehydrated){s.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Up(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var h=qb(s.nativeEvent);if(h===null){h=s.nativeEvent;var g=new h.constructor(h.type,h);Kv=g,h.target.dispatchEvent(g),Kv=null}else return l=Aa(h),l!==null&&FO(l),s.blockedOn=h,!1;l.shift()}return!0}function VO(s,l,h){Up(s)&&h.delete(l)}function N9(){Hb=!1,Ms!==null&&Up(Ms)&&(Ms=null),Ds!==null&&Up(Ds)&&(Ds=null),Is!==null&&Up(Is)&&(Is=null),Ed.forEach(VO),Td.forEach(VO)}function Bp(s,l){s.blockedOn===l&&(s.blockedOn=null,Hb||(Hb=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,N9)))}var Fp=null;function ZO(s){Fp!==s&&(Fp=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Fp===s&&(Fp=null);for(var l=0;l<s.length;l+=3){var h=s[l],g=s[l+1],b=s[l+2];if(typeof g!="function"){if(Kb(g||h)===null)continue;break}var N=Aa(h);N!==null&&(s.splice(l,3),l-=3,q0(N,{pending:!0,data:b,method:h.method,action:g},g,b))}}))}function Cc(s){function l(H){return Bp(H,s)}Ms!==null&&Bp(Ms,s),Ds!==null&&Bp(Ds,s),Is!==null&&Bp(Is,s),Ed.forEach(l),Td.forEach(l);for(var h=0;h<Ls.length;h++){var g=Ls[h];g.blockedOn===s&&(g.blockedOn=null)}for(;0<Ls.length&&(h=Ls[0],h.blockedOn===null);)GO(h),h.blockedOn===null&&Ls.shift();if(h=(s.ownerDocument||s).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var b=h[g],N=h[g+1],E=b[_t]||null;if(typeof N=="function")E||ZO(h);else if(E){var D=null;if(N&&N.hasAttribute("formAction")){if(b=N,E=N[_t]||null)D=E.formAction;else if(Kb(b)!==null)continue}else D=E.action;typeof D=="function"?h[g+1]=D:(h.splice(g,3),g-=3),ZO(h)}}}function YO(){function s(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(E){return b=E})},focusReset:"manual",scroll:"manual"})}function l(){b!==null&&(b(),b=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,b=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),b!==null&&(b(),b=null)}}}function Gb(s){this._internalRoot=s}qp.prototype.render=Gb.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(r(409));var h=l.current,g=Kr();UO(h,g,s,l,null,null)},qp.prototype.unmount=Gb.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;UO(s.current,2,null,s,null,null),jp(),l[Dr]=null}};function qp(s){this._internalRoot=s}qp.prototype.unstable_scheduleHydration=function(s){if(s){var l=G();s={blockedOn:null,target:s,priority:l};for(var h=0;h<Ls.length&&l!==0&&l<Ls[h].priority;h++);Ls.splice(h,0,s),h===0&&GO(s)}};var WO=t.version;if(WO!=="19.2.4")throw Error(r(527,WO,"19.2.4"));X.findDOMNode=function(s){var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(l),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var k9={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kp.isDisabled&&Kp.supportsFiber)try{Qe=Kp.inject(k9),kt=Kp}catch{}}return Rd.createRoot=function(s,l){if(!i(s))throw Error(r(299));var h=!1,g="",b=rA,N=iA,E=aA;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(N=l.onCaughtError),l.onRecoverableError!==void 0&&(E=l.onRecoverableError)),l=LO(s,1,!1,null,null,h,g,null,b,N,E,YO),s[Dr]=l.current,_b(s),new Gb(l)},Rd.hydrateRoot=function(s,l,h){if(!i(s))throw Error(r(299));var g=!1,b="",N=rA,E=iA,D=aA,H=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(b=h.identifierPrefix),h.onUncaughtError!==void 0&&(N=h.onUncaughtError),h.onCaughtError!==void 0&&(E=h.onCaughtError),h.onRecoverableError!==void 0&&(D=h.onRecoverableError),h.formState!==void 0&&(H=h.formState)),l=LO(s,1,!0,l,h??null,g,b,H,N,E,D,YO),l.context=$O(null),h=l.current,g=Kr(),g=Hu(g),b=js(g),b.callback=null,Ns(h,b,g),h=g,l.current.lanes=h,Ao(l,h),na(l),s[Dr]=l.current,_b(s),new qp(l)},Rd.version="19.2.4",Rd}var sE;function M9(){if(sE)return Yb.exports;sE=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(),Yb.exports=R9(),Yb.exports}var D9=M9(),Ml=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(){}},I9={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},L9=class{#t=I9;#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)}},il=new L9;function $9(e){setTimeout(e,0)}var Sl=typeof window>"u"||"Deno"in globalThis;function nr(){}function U9(e,t){return typeof e=="function"?e(t):e}function gS(e){return typeof e=="number"&&e>=0&&e!==1/0}function UD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function no(e,t){return typeof e=="function"?e(t):e}function gi(e,t){return typeof e=="function"?e(t):e}function oE(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==hj(o,t.options))return!1}else if(!bf(t.queryKey,o))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 lE(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(jl(t.options.mutationKey)!==jl(a))return!1}else if(!bf(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function hj(e,t){return(t?.queryKeyHashFn||jl)(e)}function jl(e){return JSON.stringify(e,(t,n)=>yS(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function bf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>bf(e[n],t[n])):!1}var B9=Object.prototype.hasOwnProperty;function pj(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=cE(e)&&cE(t);if(!r&&!(yS(e)&&yS(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),c=o.length,d=r?new Array(c):{};let f=0;for(let p=0;p<c;p++){const m=r?p:o[p],y=e[m],v=t[m];if(y===v){d[m]=y,(r?p<a:B9.call(e,m))&&f++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){d[m]=v;continue}const x=pj(y,v,n+1);d[m]=x,x===y&&f++}return a===c&&f===a?e:d}function xf(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 cE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function yS(e){if(!uE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!uE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function uE(e){return Object.prototype.toString.call(e)==="[object Object]"}function F9(e){return new Promise(t=>{il.setTimeout(t,e)})}function vS(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?pj(e,t):t}function q9(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function K9(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var mj=Symbol();function BD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===mj?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function gj(e,t){return typeof e=="function"?e(...t):!!e}function H9(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 G9=class extends Ml{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Sl&&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"}},yj=new G9;function bS(){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 V9=$9;function Z9(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=V9;const a=c=>{t?e.push(c):i(()=>{n(c)})},o=()=>{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||o()}return d},batchCalls:c=>(...d)=>{a(()=>{c(...d)})},schedule:a,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var pn=Z9(),Y9=class extends Ml{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Sl&&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}},Qm=new Y9;function W9(e){return Math.min(1e3*2**e,3e4)}function FD(e){return(e??"online")==="online"?Qm.isOnline():!0}var xS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function qD(e){let t=!1,n=0,r;const i=bS(),a=()=>i.status!=="pending",o=w=>{if(!a()){const j=new xS(w);y(j),e.onCancel?.(j)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>yj.isFocused()&&(e.networkMode==="always"||Qm.isOnline())&&e.canRun(),p=()=>FD(e.networkMode)&&e.canRun(),m=w=>{a()||(r?.(),i.resolve(w))},y=w=>{a()||(r?.(),i.reject(w))},v=()=>new Promise(w=>{r=j=>{(a()||f())&&w(j)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),x=()=>{if(a())return;let w;const j=n===0?e.initialPromise:void 0;try{w=j??e.fn()}catch(k){w=Promise.reject(k)}Promise.resolve(w).then(m).catch(k=>{if(a())return;const O=e.retry??(Sl?0:3),_=e.retryDelay??W9,C=typeof _=="function"?_(n,k):_,P=O===!0||typeof O=="number"&&n<O||typeof O=="function"&&O(n,k);if(t||!P){y(k);return}n++,e.onFail?.(n,k),F9(C).then(()=>f()?void 0:v()).then(()=>{t?y(k):x()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:d,canStart:p,start:()=>(p()?x():v().then(x),i)}}var KD=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),gS(this.gcTime)&&(this.#t=il.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Sl?1/0:300*1e3))}clearGcTimeout(){this.#t&&(il.clearTimeout(this.#t),this.#t=void 0)}},Q9=class extends KD{#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=fE(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=fE(this.options);t.data!==void 0&&(this.setState(dE(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=vS(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(nr).catch(nr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>gi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mj||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>no(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:!UD(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=BD(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)},o=(()=>{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(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=qD({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof xS&&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:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.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 xS){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,...HD(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...dE(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),pn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function HD(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:FD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function dE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function fE(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 vj=class extends Ml{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=bS(),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),hE(this.#e,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wS(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wS(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,n=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof gi(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&&!xf(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&pE(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||gi(this.options.enabled,this.#e)!==gi(t.enabled,this.#e)||no(this.options.staleTime,this.#e)!==no(t.staleTime,this.#e))&&this.#g();const i=this.#y();r&&(this.#e!==n||gi(this.options.enabled,this.#e)!==gi(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 J9(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(nr)),t}#g(){this.#x();const e=no(this.options.staleTime,this.#e);if(Sl||this.#i.isStale||!gS(e))return;const n=UD(this.#i.dataUpdatedAt,e)+1;this.#c=il.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,!(Sl||gi(this.options.enabled,this.#e)===!1||!gS(this.#l)||this.#l===0)&&(this.#u=il.setInterval(()=>{(this.options.refetchIntervalInBackground||yj.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(il.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(il.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,i=this.#i,a=this.#r,o=this.#a,d=e!==n?e.state:this.#n,{state:f}=e;let p={...f},m=!1,y;if(t._optimisticResults){const z=this.hasListeners(),I=!z&&hE(e,t),q=z&&pE(e,n,t,r);(I||q)&&(p={...p,...HD(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:x,status:w}=p;y=p.data;let j=!1;if(t.placeholderData!==void 0&&y===void 0&&w==="pending"){let z;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(z=i.data,j=!0):z=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,z!==void 0&&(w="success",y=vS(i?.data,z,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=vS(i?.data,y,t),this.#d=y,this.#s=null}catch(z){this.#s=z}this.#s&&(v=this.#s,y=this.#d,x=Date.now(),w="error");const k=p.fetchStatus==="fetching",O=w==="pending",_=w==="error",C=O&&k,P=y!==void 0,A={status:w,fetchStatus:p.fetchStatus,isPending:O,isSuccess:w==="success",isError:_,isInitialLoading:C,isLoading:C,data:y,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:x,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&&!O,isLoadingError:_&&!P,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:_&&P,isStale:bj(e,t),refetch:this.refetch,promise:this.#o,isEnabled:gi(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const z=A.data!==void 0,I=A.status==="error"&&!z,q=J=>{I?J.reject(A.error):z&&J.resolve(A.data)},U=()=>{const J=this.#o=A.promise=bS();q(J)},L=this.#o;switch(L.status){case"pending":e.queryHash===n.queryHash&&q(L);break;case"fulfilled":(I||A.data!==L.value)&&U();break;case"rejected":(!I||A.error!==L.reason)&&U();break}}return A}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#a=this.options,this.#r.data!==void 0&&(this.#f=this.#e),xf(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#h.size)return!0;const a=new Set(i??this.#h);return this.options.throwOnError&&a.add("error"),Object.keys(this.#i).some(o=>{const c=o;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.#b()}#j(e){pn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function X9(e,t){return gi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function hE(e,t){return X9(e,t)||e.state.data!==void 0&&wS(e,t,t.refetchOnMount)}function wS(e,t,n){if(gi(t.enabled,e)!==!1&&no(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&bj(e,t)}return!1}function pE(e,t,n,r){return(e!==t||gi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&bj(e,n)}function bj(e,t){return gi(t.enabled,e)!==!1&&e.isStaleByTime(no(t.staleTime,e))}function J9(e,t){return!xf(e.getCurrentResult(),t)}function mE(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let p=!1;const m=x=>{H9(x,()=>t.signal,()=>p=!0)},y=BD(t.options,t.fetchOptions),v=async(x,w,j)=>{if(p)return Promise.reject();if(w==null&&x.pages.length)return Promise.resolve(x);const O=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:w,direction:j?"backward":"forward",meta:t.options.meta};return m(T),T})(),_=await y(O),{maxPages:C}=t.options,P=j?K9:q9;return{pages:P(x.pages,_,C),pageParams:P(x.pageParams,w,C)}};if(i&&a.length){const x=i==="backward",w=x?eq:gE,j={pages:a,pageParams:o},k=w(r,j);c=await v(j,k,x)}else{const x=e??a.length;do{const w=d===0?o[0]??r.initialPageParam:gE(r,c);if(d>0&&w==null)break;c=await v(c,w),d++}while(d<x)}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 gE(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 eq(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var tq=class extends KD{#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||GD(),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=qD({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#r({type:"failed",failureCount:a,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:i})}const a=await this.#i.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),pn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function GD(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var VD=class extends Ml{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 tq({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=Hp(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=Hp(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=Hp(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=Hp(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){pn.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=>lE(t,n))}findAll(e={}){return this.getAll().filter(t=>lE(e,t))}notify(e){pn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return pn.batch(()=>Promise.all(e.map(t=>t.continue().catch(nr))))}};function Hp(e){return e.options.scope?.id}var nq=class extends Ml{#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),xf(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&jl(n.mutationKey)!==jl(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(t,n){return this.#i=n,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??GD();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){pn.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 yE(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function rq(e,t,n){const r=e.slice(0);return r[t]=n,r}var iq=class extends Ml{#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,pn.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const i=r.map(p=>p.observer),a=i.map(p=>p.getCurrentResult()),o=n.length!==i.length,c=i.some((p,m)=>p!==n[m]),d=o||c,f=d?!0:a.some((p,m)=>{const y=this.#e[m];return!y||!xf(p,y)});!d&&!f||(d&&(this.#d=r,this.#r=i),this.#e=a,this.hasListeners()&&(d&&(yE(n,i).forEach(p=>{p.destroy()}),yE(i,n).forEach(p=>{p.subscribe(m=>{this.#l(p,m)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,t){const n=this.#u(e),r=n.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=n.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#c(a??r,t,i),()=>this.#f(r,n)]}#f(e,t){return t.map((n,r)=>{const i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,a=>{t.forEach(o=>{o.observer.trackProp(a)})})})}#c(e,t,n){if(t){const r=this.#p,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((a,o)=>a!==r[o]));return(!this.#a||this.#e!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#e,n!==void 0&&(this.#p=n),this.#a=pj(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#r.forEach(r=>{const i=r.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(r):t.set(i,[r])});const n=[];return e.forEach(r=>{const i=this.#t.defaultQueryOptions(r),o=t.get(i.queryHash)?.shift()??new vj(this.#t,i);n.push({defaultedQueryOptions:i,observer:o})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=rq(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&&pn.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},aq=class extends Ml{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??hj(r,t);let a=this.get(i);return a||(a=new Q9({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(){pn.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=>oE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>oE(e,n)):t}notify(e){pn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){pn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){pn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},sq=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new aq,this.#e=e.mutationCache||new VD,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=yj.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=Qm.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(no(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=this.#t.get(r.queryHash)?.state.data,o=U9(t,a);if(o!==void 0)return this.#t.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return pn.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;pn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return pn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=pn.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(nr).catch(nr)}invalidateQueries(e,t={}){return pn.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=pn.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(nr)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(nr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(no(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(nr).catch(nr)}fetchInfiniteQuery(e){return e.behavior=mE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(nr).catch(nr)}ensureInfiniteQueryData(e){return e.behavior=mE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Qm.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(jl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{bf(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(jl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{bf(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=hj(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===mj&&(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()}},ZD=S.createContext(void 0),mo=e=>{const t=S.useContext(ZD);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},oq=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(ZD.Provider,{value:e,children:t})),YD=S.createContext(!1),WD=()=>S.useContext(YD);YD.Provider;function lq(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var cq=S.createContext(lq()),QD=()=>S.useContext(cq),XD=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?gj(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},JD=e=>{S.useEffect(()=>{e.clearReset()},[e])},eI=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||gj(n,[e.error,r])),tI=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))}},uq=(e,t)=>e.isLoading&&e.isFetching&&!t,SS=(e,t)=>e?.suspense&&t.isPending,jS=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function dq({queries:e,...t},n){const r=mo(),i=WD(),a=QD(),o=S.useMemo(()=>e.map(w=>{const j=r.defaultQueryOptions(w);return j._optimisticResults=i?"isRestoring":"optimistic",j}),[e,r,i]);o.forEach(w=>{tI(w);const j=r.getQueryCache().get(w.queryHash);XD(w,a,j)}),JD(a);const[c]=S.useState(()=>new iq(r,o,t)),[d,f,p]=c.getOptimisticResult(o,t.combine),m=!i&&t.subscribed!==!1;S.useSyncExternalStore(S.useCallback(w=>m?c.subscribe(pn.batchCalls(w)):nr,[c,m]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),S.useEffect(()=>{c.setQueries(o,t)},[o,t,c]);const v=d.some((w,j)=>SS(o[j],w))?d.flatMap((w,j)=>{const k=o[j];if(k&&SS(k,w)){const O=new vj(r,k);return jS(k,O,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const x=d.find((w,j)=>{const k=o[j];return k&&eI({result:w,errorResetBoundary:a,throwOnError:k.throwOnError,query:r.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(x?.error)throw x.error;return f(p())}function fq(e,t,n){const r=WD(),i=QD(),a=mo(),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const c=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",tI(o),XD(o,i,c),JD(i);const d=!a.getQueryCache().get(o.queryHash),[f]=S.useState(()=>new t(a,o)),p=f.getOptimisticResult(o),m=!r&&e.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(y=>{const v=m?f.subscribe(pn.batchCalls(y)):nr;return f.updateResult(),v},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),S.useEffect(()=>{f.setOptions(o)},[o,f]),SS(o,p))throw jS(o,f,i);if(eI({result:p,errorResetBoundary:i,throwOnError:o.throwOnError,query:c,suspense:o.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!Sl&&uq(p,r)&&(d?jS(o,f,i):c?.promise)?.catch(nr).finally(()=>{f.updateResult()}),o.notifyOnChangeProps?p:f.trackResult(p)}function es(e,t){return fq(e,vj)}function Zf(e,t){const n=mo(),[r]=S.useState(()=>new nq(n,e));S.useEffect(()=>{r.setOptions(e)},[r,e]);const i=S.useSyncExternalStore(S.useCallback(o=>r.subscribe(pn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=S.useCallback((o,c)=>{r.mutate(o,c).catch(nr)},[r]);if(i.error&&gj(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Gp=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Jb(e){const t=S.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function hq(e,t,n={},r={}){S.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 pq(e){const t=S.useRef(null);return S.useImperativeHandle(e,()=>t.current,[]),t}var mq=!1;function wf(e){return e[e.length-1]}function gq(e){return typeof e=="function"}function Qs(e,t){return gq(e)?e(t):e}var yq=Object.prototype.hasOwnProperty,vE=Object.prototype.propertyIsEnumerable,vq=()=>Object.create(null),Vo=(e,t)=>al(e,t,vq);function al(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=wE(e)&&wE(i);if(!a&&!(Xm(e)&&Xm(i)))return i;const o=a?e:bE(e);if(!o)return i;const c=a?i:bE(i);if(!c)return i;const d=o.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],x=e[v],w=i[v];if(x===w){p[v]=x,(a?y<d:yq.call(e,v))&&m++;continue}if(x===null||w===null||typeof x!="object"||typeof w!="object"){p[v]=w;continue}const j=al(x,w,n,r+1);p[v]=j,j===x&&m++}return d===f&&m===d?e:p}function bE(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!vE.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(!vE.call(e,i))return!1;r.push(i)}return r}function Xm(e){if(!xE(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!xE(n)||!n.hasOwnProperty("isPrototypeOf"))}function xE(e){return Object.prototype.toString.call(e)==="[object Object]"}function wE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function pl(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(!pl(e[r],t[r],n))return!1;return!0}if(Xm(e)&&Xm(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const o in t)if((!r||t[o]!==void 0)&&!pl(e[o],t[o],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const o in e)e[o]!==void 0&&i++;let a=0;for(const o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!pl(e[o],t[o],n)))return!1;return i===a}return!1}function cu(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 Sf(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function bq(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function SE(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 bq(t)}var xq=["http:","https:","mailto:","tel:"];function Jm(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Md(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+=SE(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+SE(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function wq(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function eg(e){const t=new Map;let n,r;const i=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,n=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const o=t.get(a);if(o)return i(o),o.value},set(a,o){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const c=t.get(a);if(c)c.value=o,i(c);else{const d={key:a,value:o,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,r=void 0}}}var Sq="Invariant failed";function co(e,t){if(!e)throw new Error(Sq)}var sl=4,nI=5;function jq(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 xj(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 o=jq(a);if(o){const[c,d]=o,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 vy(e,t,n,r,i,a,o){o?.(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=xj(d,c,t);let x;const w=c,j=v[5];switch(c=j+1,a++,v[0]){case 0:{const k=d.substring(v[2],v[3]);if(p){const O=i.static?.get(k);if(O)x=O;else{i.static??=new Map;const _=ol(n.fullPath??n.from);_.parent=i,_.depth=a,x=_,i.static.set(k,_)}}else{const O=k.toLowerCase(),_=i.staticInsensitive?.get(O);if(_)x=_;else{i.staticInsensitive??=new Map;const C=ol(n.fullPath??n.from);C.parent=i,C.depth=a,x=C,i.staticInsensitive.set(O,C)}}break}case 1:{const k=d.substring(w,v[1]),O=d.substring(v[4],j),_=p&&!!(k||O),C=k?_?k:k.toLowerCase():void 0,P=O?_?O:O.toLowerCase():void 0,T=!m&&i.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===_&&A.prefix===C&&A.suffix===P);if(T)x=T;else{const A=tx(1,n.fullPath??n.from,_,C,P);x=A,A.depth=a,A.parent=i,i.dynamic??=[],i.dynamic.push(A)}break}case 3:{const k=d.substring(w,v[1]),O=d.substring(v[4],j),_=p&&!!(k||O),C=k?_?k:k.toLowerCase():void 0,P=O?_?O:O.toLowerCase():void 0,T=!m&&i.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===_&&A.prefix===C&&A.suffix===P);if(T)x=T;else{const A=tx(3,n.fullPath??n.from,_,C,P);x=A,A.parent=i,A.depth=a,i.optional??=[],i.optional.push(A)}break}case 2:{const k=d.substring(w,v[1]),O=d.substring(v[4],j),_=p&&!!(k||O),C=k?_?k:k.toLowerCase():void 0,P=O?_?O:O.toLowerCase():void 0,T=tx(2,n.fullPath??n.from,_,C,P);x=T,T.parent=i,T.depth=a,i.wildcard??=[],i.wildcard.push(T)}}i=x}if(m&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const v=ol(n.fullPath??n.from);v.kind=nI,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=ol(n.fullPath??n.from);v.kind=sl,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)vy(e,t,d,c,i,a,o)}function ex(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 Gs(e){if(e.pathless)for(const t of e.pathless)Gs(t);if(e.static)for(const t of e.static.values())Gs(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Gs(t);if(e.dynamic?.length){e.dynamic.sort(ex);for(const t of e.dynamic)Gs(t)}if(e.optional?.length){e.optional.sort(ex);for(const t of e.optional)Gs(t)}if(e.wildcard?.length){e.wildcard.sort(ex);for(const t of e.wildcard)Gs(t)}}function ol(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 tx(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 Nq(e,t){const n=ol("/"),r=new Uint16Array(6);for(const i of e)vy(!1,r,i,1,n,0);Gs(n),t.masksTree=n,t.flatCache=eg(1e3)}function kq(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=wj(e,t.masksTree);return t.flatCache.set(e,r),r}function Cq(e,t,n,r,i){e||="/",r||="/";const a=t?`case\0${e}`:e;let o=i.singleCache.get(a);return o||(o=ol("/"),vy(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),wj(r,o,n)}function _q(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=wj(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)a=null;else throw o}return a&&(a.branch=Eq(a.route)),t.matchCache.set(r,a),a}function Aq(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Oq(e,t=!1,n){const r=ol(e.fullPath),i=new Uint16Array(6),a={},o={};let c=0;return vy(t,i,e,1,r,0,d=>{if(n?.(d,c),co(!(d.id in a),`Duplicate routes found with id: ${String(d.id)}`),a[d.id]=d,c!==0&&d.path){const f=Aq(d.fullPath);(!o[f]||d.fullPath.endsWith("/"))&&(o[f]=d)}c++}),Gs(r),{processedTree:{segmentTree:r,singleCache:eg(1e3),matchCache:eg(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function wj(e,t,n=!1){const r=e.split("/"),i=Pq(e,r,t,n);if(!i)return null;const[a]=rI(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function rI(e,t,n){const r=Tq(n.node);let i=null;const a=Object.create(null);let o=n.extract?.part??0,c=n.extract?.node??0,d=n.extract?.path??0,f=n.extract?.segment??0;for(;c<r.length;o++,c++,d++,f++){const p=r[c];if(p.kind===sl)break;if(p.kind===nI){f--,o--,d--;continue}const m=t[o],y=d;if(m&&(d+=m.length),p.kind===1){i??=n.node.fullPath.split("/");const v=i[f],x=p.prefix?.length??0;if(v.charCodeAt(x)===123){const w=p.suffix?.length??0,j=v.substring(x+2,v.length-w-1),k=m.substring(x,m.length-w);a[j]=decodeURIComponent(k)}else{const w=v.substring(1);a[w]=decodeURIComponent(m)}}else if(p.kind===3){if(n.skipped&1<<c){o--,d=y-1;continue}i??=n.node.fullPath.split("/");const v=i[f],x=p.prefix?.length??0,w=p.suffix?.length??0,j=v.substring(x+3,v.length-w-1),k=p.suffix||p.prefix?m.substring(x,m.length-w):m;k&&(a[j]=decodeURIComponent(k))}else if(p.kind===2){const v=p,x=e.substring(y+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),w=decodeURIComponent(x);a["*"]=w,a._splat=w;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:c,path:d,segment:f}]}function Eq(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Tq(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Pq(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!wf(t),a=i&&e!=="/",o=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:x,depth:w,statics:j,dynamics:k,optionals:O}=m;let{extract:_,rawParams:C,parsedParams:P}=m;if(y.skipOnParamError){if(!nx(e,t,m))continue;C=m.rawParams,_=m.extract,P=m.parsedParams}r&&y.route&&y.kind!==sl&&Dd(f,m)&&(f=m);const T=v===o;if(T&&(y.route&&!a&&Dd(p,m)&&(p=m),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const A=T?void 0:t[v];let z;if(T&&y.index){const I={node:y.index,index:v,skipped:x,depth:w+1,statics:j,dynamics:k,optionals:O,extract:_,rawParams:C,parsedParams:P};let q=!0;if(y.index.skipOnParamError&&(nx(e,t,I)||(q=!1)),q){if(j===o&&!k&&!O&&!x)return I;Dd(p,I)&&(p=I)}}if(y.wildcard&&Dd(d,m))for(const I of y.wildcard){const{prefix:q,suffix:U}=I;if(q&&(T||!(I.caseSensitive?A:z??=A.toLowerCase()).startsWith(q)))continue;if(U){if(T)continue;const J=t.slice(v).join("/").slice(-U.length);if((I.caseSensitive?J:J.toLowerCase())!==U)continue}const L={node:I,index:o,skipped:x,depth:w,statics:j,dynamics:k,optionals:O,extract:_,rawParams:C,parsedParams:P};if(!(I.skipOnParamError&&!nx(e,t,L))){d=L;break}}if(y.optional){const I=x|1<<w,q=w+1;for(let U=y.optional.length-1;U>=0;U--){const L=y.optional[U];c.push({node:L,index:v,skipped:I,depth:q,statics:j,dynamics:k,optionals:O,extract:_,rawParams:C,parsedParams:P})}if(!T)for(let U=y.optional.length-1;U>=0;U--){const L=y.optional[U],{prefix:J,suffix:ae}=L;if(J||ae){const Q=L.caseSensitive?A:z??=A.toLowerCase();if(J&&!Q.startsWith(J)||ae&&!Q.endsWith(ae))continue}c.push({node:L,index:v+1,skipped:x,depth:q,statics:j,dynamics:k,optionals:O+1,extract:_,rawParams:C,parsedParams:P})}}if(!T&&y.dynamic&&A)for(let I=y.dynamic.length-1;I>=0;I--){const q=y.dynamic[I],{prefix:U,suffix:L}=q;if(U||L){const J=q.caseSensitive?A:z??=A.toLowerCase();if(U&&!J.startsWith(U)||L&&!J.endsWith(L))continue}c.push({node:q,index:v+1,skipped:x,depth:w+1,statics:j,dynamics:k+1,optionals:O,extract:_,rawParams:C,parsedParams:P})}if(!T&&y.staticInsensitive){const I=y.staticInsensitive.get(z??=A.toLowerCase());I&&c.push({node:I,index:v+1,skipped:x,depth:w+1,statics:j+1,dynamics:k,optionals:O,extract:_,rawParams:C,parsedParams:P})}if(!T&&y.static){const I=y.static.get(A);I&&c.push({node:I,index:v+1,skipped:x,depth:w+1,statics:j+1,dynamics:k,optionals:O,extract:_,rawParams:C,parsedParams:P})}if(y.pathless){const I=w+1;for(let q=y.pathless.length-1;q>=0;q--){const U=y.pathless[q];c.push({node:U,index:v,skipped:x,depth:I,statics:j,dynamics:k,optionals:O,extract:_,rawParams:C,parsedParams:P})}}}if(p&&d)return Dd(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 nx(e,t,n){try{const[r,i]=rI(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 Dd(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===sl)>(e.node.kind===sl)||t.node.kind===sl==(e.node.kind===sl)&&t.depth>e.depth))):!0}function zm(e){return Sj(e.filter(t=>t!==void 0).join("/"))}function Sj(e){return e.replace(/\/{2,}/g,"/")}function iI(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function ro(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function aI(e){return ro(iI(e))}function tg(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function zq(e,t,n){return tg(e,n)===tg(t,n)}function Rq({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),a=!i&&t===".";let o;if(r){o=i?t:a?e:e+"\0"+t;const m=r.get(o);if(m)return m}let c;if(a)c=e.split("/");else if(i)c=t.split("/");else{for(c=e.split("/");c.length>1&&wf(c)==="";)c.pop();const m=t.split("/");for(let y=0,v=m.length;y<v;y++){const x=m[y];x===""?y?y===v-1&&c.push(x):c=[x]:x===".."?c.pop():x==="."||c.push(x)}}c.length>1&&(wf(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=xj(y,0,d);const v=d[0];if(v===0){f+=y;continue}const x=d[5],w=y.substring(0,d[1]),j=y.substring(d[4],x),k=y.substring(d[2],d[3]);v===1?f+=w||j?`${w}{$${k}}${j}`:`$${k}`:v===2?f+=w||j?`${w}{$}${j}`:"$":f+=`${w}{-$${k}}${j}`}f=Sj(f);const p=f||"/";return o&&r&&r.set(o,p),p}function Mq(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 rx(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=>NE(i,n)).join("/"):NE(r,n)}function jE({path:e,params:t,decoder:n,...r}){let i=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:i};const o=e.length;let c=0,d,f="";for(;c<o;){const p=c;d=xj(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 x=e.substring(p,d[1]),w=e.substring(d[4],m);if(!v){i=!0,(x||w)&&(f+="/"+x+w);continue}const j=rx("_splat",t,n);f+="/"+x+j+w;continue}if(y===1){const v=e.substring(d[2],d[3]);!i&&!(v in t)&&(i=!0),a[v]=t[v];const x=e.substring(p,d[1]),w=e.substring(d[4],m),j=rx(v,t,n)??"undefined";f+="/"+x+j+w;continue}if(y===3){const v=e.substring(d[2],d[3]),x=t[v];if(x==null)continue;a[v]=x;const w=e.substring(p,d[1]),j=e.substring(d[4],m),k=rx(v,t,n)??"";f+="/"+w+k+j;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:i}}function NE(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function hr(e){return!!e?.isNotFound}function Dq(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var NS="tsr-scroll-restoration-v1_3",Iq=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function Lq(){const e=Dq();if(!e)return null;const t=e.getItem(NS);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=Qs(r,n)||n;try{e.setItem(NS,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Vp=Lq(),$q=e=>e.state.__TSR_key||e.href;function Uq(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 ng=!1;function Bq({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const c=t||window.history.state?.__TSR_key,d=o[c];ng=!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)}}ng=!1}function Fq(e,t){if(!Vp||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Vp))return;e.isScrollRestorationSetup=!0,ng=!1;const n=e.options.getScrollRestorationKey||$q;window.history.scrollRestoration="manual";const r=i=>{if(ng||!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=Uq(i.target)}const o=n(e.state.location);Vp.set(c=>{const d=c[o]||={},f=d[a]||={};if(a==="window")f.scrollX=window.scrollX||0,f.scrollY=window.scrollY||0;else if(a){const p=document.querySelector(a);p&&(f.scrollX=p.scrollLeft||0,f.scrollY=p.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",Iq(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})||(Bq({storageKey:NS,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Vp.set(o=>(o[a]||={},o)))})}function qq(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 Kq(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 ix(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Hq(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]=ix(i):Array.isArray(a)?a.push(ix(i)):n[r]=[a,ix(i)]}return n}var Gq=Zq(JSON.parse),Vq=Yq(JSON.stringify,JSON.parse);function Zq(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=Hq(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function Yq(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=Kq(i,r);return a?`?${a}`:""}}var ml="__root__";function jj(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 _r(e){return e instanceof Response&&!!e.options}function Wq(e){return{input:({url:t})=>{for(const n of e)t=kS(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=sI(e[n],t);return t}}}function Qq(e){const t=aI(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:o})=>{const c=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return c===i?o.pathname="/":c.startsWith(a)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=zm(["/",t,o.pathname]),o)}}function kS(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 sI(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 Xt=(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))(Xt||{});function oI({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,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 x=f.subsTail;if(x!==void 0&&x.version===m&&x.sub===p)return;const w=p.depsTail=f.subsTail={version:m,dep:f,sub:p,prevDep:y,nextDep:v,prevSub:x,nextSub:void 0};v!==void 0&&(v.prevDep=w),y!==void 0?y.nextDep=w:p.deps=w,x!==void 0?x.nextSub=w:f.subs=w}function i(f,p=f.sub){const m=f.dep,y=f.prevDep,v=f.nextDep,x=f.nextSub,w=f.prevSub;return v!==void 0?v.prevDep=y:p.depsTail=y,y!==void 0?y.nextDep=v:p.deps=v,x!==void 0?x.prevSub=w:m.subsTail=w,w!==void 0?w.nextSub=x:(m.subs=x)===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 x=y.subs;if(x!==void 0){const w=(f=x).nextSub;w!==void 0&&(m={value:p,prev:m},p=w);continue}}if((f=p)!==void 0){p=f.nextSub;continue}for(;m!==void 0;)if(f=m.value,m=m.prev,f!==void 0){p=f.nextSub;continue e}break}while(!0)}function o(f,p){let m,y=0,v=!1;e:do{const x=f.dep,w=x.flags;if(p.flags&16)v=!0;else if((w&17)===17){if(e(x)){const j=x.subs;j.nextSub!==void 0&&c(j),v=!0}}else if((w&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(m={value:f,prev:m}),f=x.deps,p=x,++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 O=f.nextDep;if(O!==void 0){f=O;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 Nj=0,Zo=0,uf=0;const Ya=[],{link:YNe,unlink:lI,propagate:WNe,checkDirty:Xq,shallowPropagate:QNe}=oI({update(e){return e.depsTail!==void 0?nK(e):rK(e)},notify(e){let t=uf,n=t;do if(Ya[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(uf=t;n<--t;){const r=Ya[n];Ya[n++]=Ya[t],Ya[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,by(e)):sK.call(e)}});function Jq(){return Nj}function eK(){++Nj}function tK(){--Nj||aK()}function nK(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,by(e)}}function rK(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function iK(e){const t=e.flags;if(t&16||t&32&&Xq(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,by(e)}}else e.flags=2}function aK(){try{for(;Zo<uf;){const e=Ya[Zo];Ya[Zo++]=void 0,iK(e)}}finally{for(;Zo<uf;){const e=Ya[Zo];Ya[Zo++]=void 0,e.flags|=10}Zo=0,uf=0}}function sK(){this.depsTail=void 0,this.flags=0,by(this);const e=this.subs;e!==void 0&&lI(e)}function by(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=lI(n,e)}function kj(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 CS=[];let Rm=0;const{link:kE,unlink:oK,propagate:lK,checkDirty:cI,shallowPropagate:CE}=oI({update(e){return e._update()},notify(e){CS[_S++]=e,e.flags&=~Xt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Xt.Mutable|Xt.Dirty,rg(e))}});let Zp=0,_S=0,oa;function rg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=oK(n,e)}function uI(){if(!(Jq()>0)){for(;Zp<_S;){const e=CS[Zp];CS[Zp++]=void 0,e.notify()}Zp=0,_S=0}}function dI(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?Xt.None:Xt.Mutable,get(){return oa!==void 0&&kE(i,oa,Rm),i._snapshot},subscribe(a){const o=kj(a),c={current:!1},d=cK(()=>{i.get(),c.current?o.next?.(i._snapshot):c.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const o=oa,c=Object.is;if(n)oa=i,++Rm,i.depsTail=void 0;else if(a===void 0)return!1;n&&(i.flags=Xt.Mutable|Xt.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{oa=o,n&&(i.flags&=~Xt.RecursedCheck),rg(i)}}};return n?(i.flags=Xt.Mutable|Xt.Dirty,i.get=function(){const a=i.flags;if(a&Xt.Dirty||a&Xt.Pending&&cI(i.deps,i)){if(i._update()){const o=i.subs;o!==void 0&&CE(o)}}else a&Xt.Pending&&(i.flags=a&~Xt.Pending);return oa!==void 0&&kE(i,oa,Rm),i._snapshot}):i.set=function(a){if(i._update(a)){const o=i.subs;o!==void 0&&(lK(o),CE(o),uI())}},i}function cK(e){const t=()=>{const r=oa;oa=n,++Rm,n.depsTail=void 0,n.flags=Xt.Watching|Xt.RecursedCheck;try{return e()}finally{oa=r,n.flags&=~Xt.RecursedCheck,rg(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Xt.Watching|Xt.RecursedCheck,notify(){const r=this.flags;r&Xt.Dirty||r&Xt.Pending&&cI(this.deps,this)?t():this.flags=Xt.Watching},stop(){this.flags=Xt.None,this.depsTail=void 0,rg(this)}};return t(),n}class uK{constructor(t){this.atom=dI(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(kj(t))}}class dK{constructor(t){this.atom=dI(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(kj(t))}}function fK(e){return typeof e=="function"?new dK(e):new uK(e)}function hK(e){try{eK(),e()}finally{tK(),uI()}}function df(e){let t;return hK(()=>{t=e()}),t}var AS=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},xy=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),gl=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const o=e.matches[a];if(!o)continue;const c=e.router.getMatch(o.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},_E=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(o=>o.routeId===e.router.routeTree.id),i=r>=0?r:0;let a=n?e.matches.findIndex(o=>o.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let o=a;o>=0;o--){const c=e.matches[o];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return o}return n?a:i},Xs=(e,t,n)=>{if(!(!_r(n)&&!hr(n)))throw _r(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:_r(n)?"redirected":r.status==="pending"?"success":r.status,context:gl(e,t.index),isFetching:!1,error:n})),hr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),_r(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},fI=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},AE=(e,t,n)=>{const r=gl(e,n);e.updateMatch(t,i=>({...i,context:r}))},Id=(e,t,n,r)=>{const{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Xs(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(c){n=c,Xs(e,e.router.getMatch(i),n)}e.updateMatch(i,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!_r(n)&&!hr(n)&&(e.serialError??=n)},hI=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!xy(e,t)&&(n.options.loader||n.options.beforeLoad||mI(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{AS(e)},i);r._nonReactive.pendingTimeout=a}},pK=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;hI(e,t,n,r);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&Xs(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},mK=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=cu(()=>{a?.resolve(),a=void 0});const{paramsError:o,searchError:c}=i;o&&Id(e,n,o,"PARSE_PARAMS"),c&&Id(e,n,c,"VALIDATE_SEARCH"),hI(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){df(()=>{p(),m()});return}i._nonReactive.beforeLoadPromise=cu();const y={...gl(e,n,!1),...i.__routeContext},{search:v,params:x,cause:w}=i,j=xy(e,t),k={search:v,abortController:d,params:x,preload:j,context:y,location:e.location,navigate:C=>e.router.navigate({...C,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":w,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},O=C=>{if(C===void 0){df(()=>{p(),m()});return}(_r(C)||hr(C))&&(p(),Id(e,n,C,"BEFORE_LOAD")),df(()=>{p(),e.updateMatch(t,P=>({...P,__beforeLoadContext:C})),m()})};let _;try{if(_=r.options.beforeLoad(k),Sf(_))return p(),_.catch(C=>{Id(e,n,C,"BEFORE_LOAD")}).then(O)}catch(C){p(),Id(e,n,C,"BEFORE_LOAD")}O(_)},gK=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>c(),o=()=>mK(e,n,t,i),c=()=>{if(fI(e,n))return;const d=pK(e,n,i);return Sf(d)?d.then(o):o()};return a()},yK=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([a,o,c])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:c,scripts:o,styles:a?.styles}))},pI=(e,t,n,r,i)=>{const a=t[r-1],{params:o,loaderDeps:c,abortController:d,cause:f}=e.router.getMatch(n),p=gl(e,r),m=xy(e,n);return{params:o,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}},OE=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(mq??e.router.isServer)||a.ssr===!0)&&jf(i);const o=i.options.loader,c=typeof o=="function"?o:o?.handler,d=c?.(pI(e,t,n,r,i)),f=!!c&&Sf(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;Xs(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:gl(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(o){let c=o;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:gl(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,hr(o)&&await i.options.notFoundComponent?.preload?.(),Xs(e,e.router.getMatch(n),o);try{i.options.onError?.(o)}catch(f){c=f,Xs(e,e.router.getMatch(n),f)}!_r(c)&&!hr(c)&&await jf(i,["errorComponent"]),e.updateMatch(n,f=>({...f,error:c,context:gl(e,r),status:"error",isFetching:!1}))}}catch(a){const o=e.router.getMatch(n);o&&(o._nonReactive.loaderPromise=void 0),Xs(e,o,a)}},vK=async(e,t,n)=>{async function r(v,x,w,j,k){const O=Date.now()-x.updatedAt,_=v?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,C=k.options.shouldReload,P=typeof C=="function"?C(pI(e,t,i,n,k)):C,{status:T,invalid:A}=j,z=O>_&&(!!e.forceStaleReload||j.cause==="enter"||w!==void 0&&w!==j.id);o=T==="success"&&(A||(P??z)),v&&k.options.preload===!1||(o&&!e.sync&&p?(c=!0,(async()=>{try{await OE(e,t,i,n,k);const I=e.router.getMatch(i);I._nonReactive.loaderPromise?.resolve(),I._nonReactive.loadPromise?.resolve(),I._nonReactive.loaderPromise=void 0,I._nonReactive.loadPromise=void 0}catch(I){_r(I)&&await e.router.navigate(I.options)}})()):T!=="success"||o?await OE(e,t,i,n,k):AE(e,i,n))}const{id:i,routeId:a}=e.matches[n];let o=!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(fI(e,i)){if(!e.router.getMatch(i))return e.matches[n];AE(e,i,n)}else{const v=e.router.getMatch(i),x=e.router.state.matches[n]?.routeId===a?e.router.state.matches[n].id:e.router.state.matches.find(j=>j.routeId===a)?.id,w=xy(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&&Xs(e,j,k),j.status==="pending"&&await r(w,v,x,j,d)}else{const j=w&&!e.router.state.matches.some(O=>O.id===i),k=e.router.getMatch(i);k._nonReactive.loaderPromise=cu(),j!==k.preload&&e.updateMatch(i,O=>({...O,preload:j})),await r(w,v,x,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 EE(e){const t=e,n=[];t.router.state.matches.some(y=>y._forcePending)&&AS(t);let r;for(let y=0;y<t.matches.length;y++){try{const v=gK(t,y);Sf(v)&&await v}catch(v){if(_r(v))throw v;if(hr(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?_E(t,r):void 0,o=r&&t.preload?0:a!==void 0?Math.min(a+1,i):i;let c,d;for(let y=0;y<o;y++)n.push(vK(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 x=v.reason;if(_r(x))throw x;hr(x)?c??=x:d??=x}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=_E(t,f);co(y!==void 0);const v=t.matches[y],x=t.router.looseRoutesById[v.routeId],w=t.router.options?.defaultNotFoundComponent;!x.options.notFoundComponent&&w&&(x.options.notFoundComponent=w),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 jf(x,["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 jf(y,["errorComponent"])}for(let y=0;y<=p;y++){const{id:v,routeId:x}=t.matches[y],w=t.router.looseRoutesById[x];try{const j=yK(t,v,w);if(j){const k=await j;t.updateMatch(v,O=>({...O,...k}))}}catch(j){console.error(`Error executing head for route ${x}:`,j)}}const m=AS(t);if(Sf(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function TE(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function jf(e,t=Mm){!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===Mm?(()=>{if(e._componentsPromise===void 0){const r=TE(e,Mm);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():TE(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function mI(e){for(const t of Mm)if(e.options[t]?.preload)return!0;return!1}var Mm=["component","errorComponent","pendingComponent","notFoundComponent"],io="__TSR_index",PE="popstate",zE="beforeunload";function bK(e){let t=e.getLocation();const n=new Set,r=o=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:o}))},i=o=>{e.notifyOnIndexChange??!0?r(o):t=e.getLocation()},a=async({task:o,navigateOpts:c,...d})=>{if(c?.ignoreBlocker??!1){o();return}const f=e.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&f.length&&p)for(const m of f){const y=ig(d.path,d.state);if(await m.blockerFn({currentLocation:t,nextLocation:y,action:d.type})){e.onBlocked?.();return}}o()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,c,d)=>{const f=t.state[io];c=RE(f+1,c),a({task:()=>{e.pushState(o,c),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:o,state:c})},replace:(o,c,d)=>{const f=t.state[io];c=RE(f,c),a({task:()=>{e.replaceState(o,c),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:o,state:c})},go:(o,c)=>{a({task:()=>{e.go(o),i({type:"GO",index:o})},navigateOpts:c,type:"GO"})},back:o=>{a({task:()=>{e.back(o?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{a({task:()=>{e.forward(o?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[io]!==0,createHref:o=>e.createHref(o),block:o=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,o]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==o))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function RE(e,t){t||(t={});const n=Cj();return{...t,key:n,__TSR_key:n,[io]:e}}function xK(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const a=()=>i,o=z=>i=z,c=(z=>z),d=(()=>ig(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const z=Cj();t.history.replaceState({[io]:0,key:z,__TSR_key:z},"")}let f=d(),p,m=!1,y=!1,v=!1,x=!1;const w=()=>f;let j,k;const O=()=>{j&&(A._ignoreSubscribers=!0,(j.isPush?t.history.pushState:t.history.replaceState)(j.state,"",j.href),A._ignoreSubscribers=!1,j=void 0,k=void 0,p=void 0)},_=(z,I,q)=>{const U=c(I);k||(p=f),f=ig(I,q),j={href:U,state:q,isPush:j?.isPush||z==="push"},k||(k=Promise.resolve().then(()=>O()))},C=z=>{f=d(),A.notify({type:z})},P=async()=>{if(y){y=!1;return}const z=d(),I=z.state[io]-f.state[io],q=I===1,U=I===-1,L=!q&&!U||m;m=!1;const J=L?"GO":U?"BACK":"FORWARD",ae=L?{type:"GO",index:I}:{type:U?"BACK":"FORWARD"};if(v)v=!1;else{const Q=a();if(typeof document<"u"&&Q.length){for(const K of Q)if(await K.blockerFn({currentLocation:f,nextLocation:z,action:J})){y=!0,t.history.go(1),A.notify(ae);return}}}f=d(),A.notify(ae)},T=z=>{if(x){x=!1;return}let I=!1;const q=a();if(typeof document<"u"&&q.length)for(const U of q){const L=U.enableBeforeUnload??!0;if(L===!0){I=!0;break}if(typeof L=="function"&&L()===!0){I=!0;break}}if(I)return z.preventDefault(),z.returnValue=""},A=bK({getLocation:w,getLength:()=>t.history.length,pushState:(z,I)=>_("push",z,I),replaceState:(z,I)=>_("replace",z,I),back:z=>(z&&(v=!0),x=!0,t.history.back()),forward:z=>{z&&(v=!0),x=!0,t.history.forward()},go:z=>{m=!0,t.history.go(z)},createHref:z=>c(z),flush:O,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(zE,T,{capture:!0}),t.removeEventListener(PE,P)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(zE,T,{capture:!0}),t.addEventListener(PE,P),t.history.pushState=function(...z){const I=n.apply(t.history,z);return A._ignoreSubscribers||C("PUSH"),I},t.history.replaceState=function(...z){const I=r.apply(t.history,z);return A._ignoreSubscribers||C("REPLACE"),I},A}function wK(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function ig(e,t){const n=wK(e),r=n.indexOf("#"),i=n.indexOf("?"),a=Cj();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):"",search:i>-1?n.slice(i,r===-1?void 0:r):"",state:t||{[io]:0,key:a,__TSR_key:a}}}function Cj(){return(Math.random()+1).toString(36).substring(7)}function yl(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 SK(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var jK=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=Mq(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=xK()),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=eg(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=fK(kK(this.latestLocation)),Fq(this));let o=!1;const c=this.options.basepath??"/",d=this.options.rewrite;if(i||r!==c||a!==d){this.basepath=c;const f=[],p=aI(c);p&&p!=="/"&&f.push(Qq({basepath:c})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:Wq(f),this.history&&this.updateLatestLocation(),o=!0}o&&this.__store&&this.__store.setState(f=>({...f,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=Oq(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&Nq(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:Md(c).path,external:!1,searchStr:k,search:Vo(n?.search,j),hash:Md(f.slice(1)).path,state:al(n?.state,m)}}const y=new URL(p,this.origin),v=kS(this.rewrite,y),x=this.options.parseSearch(v.search),w=this.options.stringifySearch(x);return v.search=w,{href:v.href.replace(v.origin,""),publicHref:p,pathname:Md(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:w,search:Vo(n?.search,x),hash:Md(v.hash.slice(1)).path,state:al(n?.state,m)}},i=r(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===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)=>Rq({base:t,to:Sj(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=>CK({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const n=this.getMatch(t);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(r=>r.status==="pending"),n=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...n]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=t=>{const n=(i={})=>{const a=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const c=i.unsafeRelative==="path"?a.pathname:i.from??o.fullPath,d=this.resolvePathWithBase(c,"."),f=o.search,p=Object.assign(Object.create(null),o.params),m=i.to?this.resolvePathWithBase(d,`${i.to}`):this.resolvePathWithBase(d,"."),y=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?p:Object.assign(p,Qs(i.params,p)),v=this.getMatchedRoutes(m);let x=v.matchedRoutes;if((!v.foundRoute||v.foundRoute.path!=="/"&&v.routeParams["**"])&&this.options.notFoundRoute&&(x=[...x,this.options.notFoundRoute]),Object.keys(y).length>0)for(const I of x){const q=I.options.params?.stringify??I.options.stringifyParams;if(q)try{Object.assign(y,q(y))}catch{}}const w=t.leaveParams?m:Md(jE({path:m,params:y,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let j=f;if(t._includeValidateSearch&&this.options.search?.strict){const I={};x.forEach(q=>{if(q.options.validateSearch)try{Object.assign(I,Dm(q.options.validateSearch,{...I,...j}))}catch{}}),j=I}j=_K({search:j,dest:i,destRoutes:x,_includeValidateSearch:t._includeValidateSearch}),j=Vo(f,j);const k=this.options.stringifySearch(j),O=i.hash===!0?a.hash:i.hash?Qs(i.hash,a.hash):void 0,_=O?`#${O}`:"";let C=i.state===!0?a.state:i.state?Qs(i.state,a.state):{};C=al(a.state,C);const P=`${w}${k}${_}`;let T,A,z=!1;if(this.rewrite){const I=new URL(P,this.origin),q=sI(this.rewrite,I);T=I.href.replace(I.origin,""),q.origin!==this.origin?(A=q.href,z=!0):A=q.pathname+q.search+q.hash}else T=wq(P),A=T;return{publicHref:A,href:T,pathname:w,search:j,searchStr:k,state:C,hash:O??"",external:z,unmaskOnReload:i.unmaskOnReload}},r=(i={},a)=>{const o=n(i);let c=a?n(a):void 0;if(!c){const d=Object.create(null);if(this.options.routeMasks){const f=kq(o.pathname,this.processedTree);if(f){Object.assign(d,f.rawParams);const{from:p,params:m,...y}=f.route,v=m===!1||m===null?Object.create(null):(m??!0)===!0?d:Object.assign(d,Qs(m,d));a={from:t.from,...y,params:v},c=n(a)}}}return c&&(o.maskedLocation=c),o};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=pl(r.state,this.latestLocation.state);return c.forEach(f=>{delete r.state[f]}),d},a=ro(this.latestLocation.href)===ro(r.href);let o=this.commitLocationPromise;if(this.commitLocationPromise=cu(()=>{o?.resolve(),o=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:o,...c}={})=>{if(o){const p=this.history.location.state.__TSR_index,m=ig(o,{__TSR_index:t?p:p+1}),y=new URL(m.pathname,this.origin);c.to=kS(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 o=!1;if(r)try{new URL(`${r}`),o=!0}catch{}if(o&&!n&&(n=!0),n){if(t!==void 0||!r){const d=this.buildLocation({to:t,...a});r=r??d.publicHref,i=i??d.publicHref}const c=!o&&i?i:r;if(Jm(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",...yl({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...yl({resolvedLocation:f,location:d})}),await EE({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=[];df(()=>{this.__store.setState(x=>{const w=x.matches,j=x.pendingMatches||x.matches;return p=w.filter(k=>!j.some(O=>O.id===k.id)),m=w.filter(k=>!j.some(O=>O.routeId===k.routeId)),y=j.filter(k=>!w.some(O=>O.routeId===k.routeId)),v=j.filter(k=>w.some(O=>O.routeId===k.routeId)),{...x,isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...x.cachedMatches,...p.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[y,"onEnter"],[v,"onStay"]].forEach(([x,w])=>{x.forEach(j=>{this.looseRoutesById[j.routeId].options[w]?.(j)})})})})}})}catch(d){_r(d)?(n=d,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):hr(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 o;this.hasNotFoundMatch()?o=404:this.__store.state.matches.some(c=>c.status==="error")&&(o=500),o!==void 0&&this.__store.setState(c=>({...c,statusCode:o}))},this.startViewTransition=t=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,a=this.state.resolvedLocation,o=typeof n.types=="function"?n.types(yl({resolvedLocation:a,location:i})):n.types;if(o===!1){t();return}r={update:t,types:o}}else r=t;document.startViewTransition(r)}else t()},this.updateMatch=(t,n)=>{this.startTransition(()=>{const r=this.state.pendingMatches?.some(i=>i.id===t)?"pendingMatches":this.state.matches.some(i=>i.id===t)?"matches":this.state.cachedMatches.some(i=>i.id===t)?"cachedMatches":"";r&&(r==="cachedMatches"?this.__store.setState(i=>({...i,cachedMatches:SK(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&&Jm(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=jf,this.preloadRoute=async t=>{const n=t._builtLocation??this.buildLocation(t);let r=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:t});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(o=>o.id)),a=new Set([...i,...this.state.cachedMatches.map(o=>o.id)]);df(()=>{r.forEach(o=>{a.has(o.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,o]}))})});try{return r=await EE({router:this,matches:r,location:n,preload:!0,updateMatch:(o,c)=>{i.has(o)?r=r.map(d=>d.id===o?c(d):d):this.updateMatch(o,c)}}),r}catch(o){if(_r(o))return o.options.reloadDocument?void 0:await this.preloadRoute({...o.options,_fromLocation:n});hr(o)||console.error(o);return}},this.matchRoute=(t,n)=>{const r={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(r);if(n?.pending&&this.state.status!=="pending")return!1;const a=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,o=Cq(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,a.pathname,this.processedTree);return!o||t.params&&!pl(o.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?pl(a.search,i.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??Vq,parseSearch:e.parseSearch??Gq,protocolAllowlist:e.protocolAllowlist??xq}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n;let{matchedRoutes:o}=n,c=!1;(r?r.path!=="/"&&i["**"]:ro(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:c=!0);const d=c?OK(this.options.notFoundMode,o):void 0,f=new Array(o.length),p=new Map(this.state.matches.map(m=>[m.routeId,m]));for(let m=0;m<o.length;m++){const y=o[m],v=f[m-1];let x,w,j;{const J=v?.search??e.search,ae=v?._strictSearch??void 0;try{const Q=Dm(y.options.validateSearch,{...J})??void 0;x={...J,...Q},w={...ae,...Q},j=void 0}catch(Q){let K=Q;if(Q instanceof ag||(K=new ag(Q.message,{cause:Q})),t?.throwOnError)throw K;x=J,w={},j=K}}const k=y.options.loaderDeps?.({search:x})??"",O=k?JSON.stringify(k):"",{interpolatedPath:_,usedParams:C}=jE({path:y.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),P=y.id+_+O,T=this.getMatch(P),A=p.get(y.id),z=T?._strictParams??C;let I;if(!T)try{ME(y,C,a,z)}catch(J){if(hr(J)||_r(J)?I=J:I=new NK(J.message,{cause:J}),t?.throwOnError)throw I}Object.assign(i,z);const q=A?"stay":"enter";let U;if(T)U={...T,cause:q,params:A?.params??i,_strictParams:z,search:Vo(A?A.search:T.search,x),_strictSearch:w};else{const J=y.options.loader||y.options.beforeLoad||y.lazyFn||mI(y)?"pending":"success";U={id:P,ssr:y.options.ssr,index:m,routeId:y.id,params:A?.params??i,_strictParams:z,pathname:_,updatedAt:Date.now(),search:A?Vo(A.search,x):x,_strictSearch:w,searchError:void 0,status:J,isFetching:!1,error:void 0,paramsError:I,__routeContext:void 0,_nonReactive:{loadPromise:cu()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:q,loaderDeps:A?al(A.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:y.options.staticData||{},fullPath:y.fullPath}}t?.preload||(U.globalNotFound=d===y.id),U.searchError=j;const L=this.getParentContext(v);U.context={...L,...U.__routeContext,...U.__beforeLoadContext},f[m]=U}for(let m=0;m<f.length;m++){const y=f[m],v=this.looseRoutesById[y.routeId],x=this.getMatch(y.id),w=p.get(y.routeId);if(y.params=w?Vo(w.params,i):i,!x){const j=f[m-1],k=this.getParentContext(j);if(v.options.context){const O={deps:y.loaderDeps,params:y.params,context:k??{},location:e,navigate:_=>this.navigate({..._,_fromLocation:e}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:f,routeId:v.id};y.__routeContext=v.options.context(O)??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=wf(t),a={...e.search};for(const f of t)try{Object.assign(a,Dm(f.options.validateSearch,a))}catch{}const o=wf(this.state.matches),c=o&&o.routeId===i.id&&e.pathname===this.state.location.pathname;let d;if(c)d=o.params;else{const f=Object.assign(Object.create(null),n);for(const p of t)try{ME(p,n,r??{},f)}catch{}d=f}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:d}}},ag=class extends Error{},NK=class extends Error{};function kK(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Dm(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new ag("Async validation not supported");if(n.issues)throw new ag(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 CK({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=ro(e);let a,o;const c=_q(i,n,!0);return c&&(a=c.route,Object.assign(r,c.rawParams),o=Object.assign(Object.create(null),c.parsedParams)),{matchedRoutes:c?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function _K({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return AK(n)(e,t,r??!1)}function AK(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const a=({search:o,next:c})=>{let d=o;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((p,m)=>m(p),o));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:o,next:c})=>{const d=c(o);if(!t._includeValidateSearch)return d;try{return{...d,...Dm(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:Qs(a.search,i):{}};t.middlewares.push(n);const r=(i,a,o)=>{if(i>=o.length)return a;const c=o[i];return c({search:a,next:f=>r(i+1,f,o)})};return function(a,o,c){return t.dest=o,t._includeValidateSearch=c,r(0,a,t.middlewares)}}function OK(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 ml}function ME(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 EK="Error preloading route! ☝️",gI=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=ml:this.parentRoute||co(!1);let i=r?ml:n?.path;i&&i!=="/"&&(i=iI(i));const a=n?.id||i;let o=r?ml:zm([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),o!=="__root__"&&(o=zm(["/",o]));const c=o==="__root__"?"/":zm([this.parentRoute.fullPath,i]);this._path=i,this._id=o,this._fullPath=c,this._to=ro(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=>jj({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.")}},TK=class extends gI{constructor(e){super(e)}};function _j(e){const t=e.errorComponent??Aj;return u.jsx(PK,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?S.createElement(t,{error:n,reset:r}):e.children})}var PK=class extends S.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 Aj({error:e}){const[t,n]=S.useState(!1);return u.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[u.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),u.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),u.jsx("div",{style:{height:".25rem"}}),t?u.jsx("div",{children:u.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?u.jsx("code",{children:e.message}):null})}):null]})}function zK({children:e,fallback:t=null}){return yI()?u.jsx(Bi.Fragment,{children:e}):u.jsx(Bi.Fragment,{children:t})}function yI(){return Bi.useSyncExternalStore(RK,()=>!0,()=>!1)}function RK(){return()=>{}}var vI=S.createContext(null);function Ci(e){const t=S.useContext(vI);return e?.warn,t}var ax={exports:{}},sx={},ox={exports:{}},lx={};var DE;function MK(){if(DE)return lx;DE=1;var e=Nu();function t(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function c(m,y){var v=y(),x=r({inst:{value:v,getSnapshot:y}}),w=x[0].inst,j=x[1];return a(function(){w.value=v,w.getSnapshot=y,d(w)&&j({inst:w})},[m,v,y]),i(function(){return d(w)&&j({inst:w}),m(function(){d(w)&&j({inst:w})})},[m]),o(v),v}function d(m){var y=m.getSnapshot;m=m.value;try{var v=y();return!n(m,v)}catch{return!0}}function f(m,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return lx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,lx}var IE;function DK(){return IE||(IE=1,ox.exports=MK()),ox.exports}var LE;function IK(){if(LE)return sx;LE=1;var e=Nu(),t=DK();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,c=e.useMemo,d=e.useDebugValue;return sx.useSyncExternalStoreWithSelector=function(f,p,m,y,v){var x=a(null);if(x.current===null){var w={hasValue:!1,value:null};x.current=w}else w=x.current;x=c(function(){function k(T){if(!O){if(O=!0,_=T,T=y(T),v!==void 0&&w.hasValue){var A=w.value;if(v(A,T))return C=A}return C=T}if(A=C,r(_,T))return A;var z=y(T);return v!==void 0&&v(A,z)?(_=T,A):(_=T,C=z)}var O=!1,_,C,P=m===void 0?null:m;return[function(){return k(p())},P===null?void 0:function(){return k(P())}]},[p,m,y,v]);var j=i(f,x[0],x[1]);return o(function(){w.hasValue=!0,w.value=j},[j]),d(j),j},sx}var $E;function LK(){return $E||($E=1,ax.exports=IK()),ax.exports}var bI=LK();function $K(e,t){return e===t}function UK(e,t,n=$K){const r=S.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(o);return c},[e]),i=S.useCallback(()=>e?.get(),[e]);return bI.useSyncExternalStoreWithSelector(r,i,i,t,n)}function Tr(e){const t=Ci({warn:e?.router===void 0}),n=e?.router||t,r=S.useRef(void 0);return UK(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=al(r.current,e.select(i));return r.current=a,a}return e.select(i)}return i})}var wy=S.createContext(void 0),BK=S.createContext(void 0);function go(e){const t=S.useContext(e.from?BK:wy);return Tr({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(co(!((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 Oj(e){return go({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Ej(e){const{select:t,...n}=e;return go({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Sy(e){return go({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 jy(e){return go({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function yo(e){const t=Ci();return S.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Tj(e){return go({...e,select:t=>e.select?e.select(t.context):t.context})}var Dl=$D();const FK=wa(Dl);function qK(e,t){const n=Ci(),r=pq(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:c,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:y,resetScroll:v,viewTransition:x,children:w,target:j,disabled:k,style:O,className:_,onClick:C,onBlur:P,onFocus:T,onMouseEnter:A,onMouseLeave:z,onTouchStart:I,ignoreBlocker:q,params:U,search:L,hash:J,state:ae,mask:Q,reloadDocument:K,unsafeRelative:X,from:ye,_fromLocation:Se,...R}=e,F=yI(),B=Tr({select:Oe=>{const te=Oe.matches[Oe.matches.length-1];return{search:te?.search,hash:Oe.location.hash,path:te?.pathname}},structuralSharing:!0}),M=e.from,V=S.useMemo(()=>({...e,from:M}),[n,B,M,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),se=S.useMemo(()=>n.buildLocation({...V}),[n,V]),ie=se.maskedLocation?se.maskedLocation.publicHref:se.publicHref,he=se.maskedLocation?se.maskedLocation.external:se.external,je=S.useMemo(()=>YK(ie,he,n.history,k),[k,he,ie,n.history]),ee=S.useMemo(()=>{if(je?.external)return Jm(je.href,n.protocolAllowlist)?void 0:je.href;if(!WK(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),Jm(c,n.protocolAllowlist)?void 0:c}catch{}},[c,je,n.protocolAllowlist]),de=Tr({select:Oe=>{if(ee)return!1;if(o?.exact){if(!zq(Oe.location.pathname,se.pathname,n.basepath))return!1}else{const te=tg(Oe.location.pathname,n.basepath),xe=tg(se.pathname,n.basepath);if(!(te.startsWith(xe)&&(te.length===xe.length||te[xe.length]==="/")))return!1}return(o?.includeSearch??!0)&&!pl(Oe.location.search,se.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?F&&Oe.location.hash===se.hash:!0}}),_e=de?Qs(i,{})??KK:cx,Y=de?cx:Qs(a,{})??cx,Ke=[_,_e.className,Y.className].filter(Boolean).join(" "),Me=(O||_e.style||Y.style)&&{...O,..._e.style,...Y.style},[rt,it]=S.useState(!1),Nt=S.useRef(!1),Lt=e.reloadDocument||ee?!1:d??n.options.defaultPreload,xn=f??n.options.defaultPreloadDelay??0,ve=S.useCallback(()=>{n.preloadRoute({...V,_builtLocation:se}).catch(Oe=>{console.warn(Oe),console.warn(EK)})},[n,V,se]);hq(r,S.useCallback(Oe=>{Oe?.isIntersecting&&ve()},[ve]),ZK,{disabled:!!k||Lt!=="viewport"}),S.useEffect(()=>{Nt.current||!k&&Lt==="render"&&(ve(),Nt.current=!0)},[k,ve,Lt]);const Ve=Oe=>{const te=Oe.currentTarget.getAttribute("target"),xe=j!==void 0?j:te;if(!k&&!QK(Oe)&&!Oe.defaultPrevented&&(!xe||xe==="_self")&&Oe.button===0){Oe.preventDefault(),Dl.flushSync(()=>{it(!0)});const Ee=n.subscribe("onResolved",()=>{Ee(),it(!1)});n.navigate({...V,replace:m,resetScroll:v,hashScrollIntoView:p,startTransition:y,viewTransition:x,ignoreBlocker:q})}};if(ee)return{...R,ref:r,href:ee,...w&&{children:w},...j&&{target:j},...k&&{disabled:k},...O&&{style:O},..._&&{className:_},...C&&{onClick:C},...P&&{onBlur:P},...T&&{onFocus:T},...A&&{onMouseEnter:A},...z&&{onMouseLeave:z},...I&&{onTouchStart:I}};const be=Oe=>{if(k||Lt!=="intent")return;if(!xn){ve();return}const te=Oe.currentTarget;if(Ld.has(te))return;const xe=setTimeout(()=>{Ld.delete(te),ve()},xn);Ld.set(te,xe)},ze=Oe=>{k||Lt!=="intent"||ve()},Re=Oe=>{if(k||!Lt||!xn)return;const te=Oe.currentTarget,xe=Ld.get(te);xe&&(clearTimeout(xe),Ld.delete(te))};return{...R,..._e,...Y,href:je?.href,ref:r,onClick:_c([C,Ve]),onBlur:_c([P,Re]),onFocus:_c([T,be]),onMouseEnter:_c([A,be]),onMouseLeave:_c([z,Re]),onTouchStart:_c([I,ze]),disabled:!!k,target:j,...Me&&{style:Me},...Ke&&{className:Ke},...k&&HK,...de&&GK,...F&&rt&&VK}}var cx={},KK={className:"active"},HK={role:"link","aria-disabled":!0},GK={"data-status":"active","aria-current":"page"},VK={"data-transitioning":"transitioning"},Ld=new WeakMap,ZK={rootMargin:"100px"},_c=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function YK(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function WK(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Qt=S.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...a}=qK(r,t),o=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:c,...d}=a;return S.createElement("a",d,o)}return S.createElement(n,a,o)});function QK(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var XK=class extends gI{constructor(e){super(e),this.useMatch=t=>go({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Tj({...t,from:this.id}),this.useSearch=t=>jy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Sy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Ej({...t,from:this.id}),this.useLoaderData=t=>Oj({...t,from:this.id}),this.useNavigate=()=>yo({from:this.fullPath}),this.Link=Bi.forwardRef((t,n)=>u.jsx(Qt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function _i(e){return new XK(e)}function JK(){return e=>tH(e)}var eH=class extends TK{constructor(e){super(e),this.useMatch=t=>go({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Tj({...t,from:this.id}),this.useSearch=t=>jy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Sy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Ej({...t,from:this.id}),this.useLoaderData=t=>Oj({...t,from:this.id}),this.useNavigate=()=>yo({from:this.fullPath}),this.Link=Bi.forwardRef((t,n)=>u.jsx(Qt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function tH(e){return new eH(e)}function UE(e){return typeof e=="object"?new BE(e,{silent:!0}).createRoute(e):new BE(e,{silent:!0}).createRoute}var BE=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=_i(n);return r.isRoot=!1,r},this.silent=t?.silent}},FE=class{constructor(e){this.useMatch=t=>go({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Tj({...t,from:this.options.id}),this.useSearch=t=>jy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Sy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>Ej({...t,from:this.options.id}),this.useLoaderData=t=>Oj({...t,from:this.options.id}),this.useNavigate=()=>yo({from:Ci().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function qE(e){return typeof e=="object"?new FE(e):t=>new FE({id:e,...t})}function nH(e){const t=Tr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return u.jsx(_j,{getResetKey:()=>t,onCatch:(n,r)=>{if(hr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(hr(n))return e.fallback?.(n);throw n},children:e.children})}function rH(){return u.jsx("p",{children:"Not Found"})}function Fc(e){return u.jsx(u.Fragment,{children:e.children})}function xI(e,t,n){return t.options.notFoundComponent?u.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?u.jsx(e.options.defaultNotFoundComponent,{...n}):u.jsx(rH,{})}function iH(){return Ci().isScrollRestoring,null}var wI=S.memo(function({matchId:t}){const n=Ci(),r=Tr({select:x=>{const w=x.matches.findIndex(k=>k.id===t),j=x.matches[w];return co(j),{routeId:j.routeId,ssr:j.ssr,_displayPending:j._displayPending,resetKey:x.loadedAt,parentRouteId:x.matches[w-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],a=i.options.pendingComponent??n.options.defaultPendingComponent,o=a?u.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))?S.Suspense:Fc,y=c?_j:Fc,v=f?nH:Fc;return u.jsxs(i.isRoot?i.options.shellComponent??Fc:Fc,{children:[u.jsx(wy.Provider,{value:t,children:u.jsx(m,{fallback:o,children:u.jsx(y,{getResetKey:()=>r.resetKey,errorComponent:c||Aj,onCatch:(x,w)=>{if(hr(x))throw x;d?.(x,w)},children:u.jsx(v,{fallback:x=>{if(!f||x.routeId&&x.routeId!==r.routeId||!x.routeId&&!i.isRoot)throw x;return S.createElement(f,x)},children:p||r._displayPending?u.jsx(zK,{fallback:o,children:u.jsx(KE,{matchId:t})}):u.jsx(KE,{matchId:t})})})})}),r.parentRouteId===ml&&n.options.scrollRestoration?u.jsxs(u.Fragment,{children:[u.jsx(aH,{}),u.jsx(iH,{})]}):null]})});function aH(){const e=Ci(),t=S.useRef(void 0);return u.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...yl(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var KE=S.memo(function({matchId:t}){const n=Ci(),{match:r,key:i,routeId:a}=Tr({select:d=>{const f=d.matches.find(y=>y.id===t),p=f.routeId,m=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:m?JSON.stringify(m):void 0,routeId:p,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),o=n.routesById[a],c=S.useMemo(()=>{const d=o.options.component??n.options.defaultComponent;return d?u.jsx(d,{},i):u.jsx(Pj,{})},[i,o.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const d=o.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const f=n.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise){const p=cu();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 co(hr(r.error)),xI(n,o,r.error);if(r.status==="redirected")throw co(_r(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return c}),Pj=S.memo(function(){const t=Ci(),n=S.useContext(wy),r=Tr({select:f=>f.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],a=Tr({select:f=>{const p=f.matches.find(m=>m.id===n);return co(p),p.globalNotFound}}),o=Tr({select:f=>{const p=f.matches;return p[p.findIndex(m=>m.id===n)+1]?.id}}),c=t.options.defaultPendingComponent?u.jsx(t.options.defaultPendingComponent,{}):null;if(a)return xI(t,i,void 0);if(!o)return null;const d=u.jsx(wI,{matchId:o});return r===ml?u.jsx(S.Suspense,{fallback:c,children:d}):d});function sH(){const e=Ci(),t=S.useRef({router:e,mounted:!1}),[n,r]=S.useState(!1),{hasPendingMatches:i,isLoading:a}=Tr({select:m=>({isLoading:m.isLoading,hasPendingMatches:m.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),o=Jb(a),c=a||n||i,d=Jb(c),f=a||i,p=Jb(f);return e.startTransition=m=>{r(!0),S.startTransition(()=>{m(),r(!1)})},S.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 ro(e.latestLocation.publicHref)!==ro(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{m()}},[e,e.history]),Gp(()=>{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]),Gp(()=>{o&&!a&&e.emit({type:"onLoad",...yl(e.state)})},[o,e,a]),Gp(()=>{p&&!f&&e.emit({type:"onBeforeRouteMount",...yl(e.state)})},[f,p,e]),Gp(()=>{if(d&&!c){const m=yl(e.state);e.emit({type:"onResolved",...m}),e.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),m.hrefChanged&&qq(e)}},[c,d,e]),null}function oH(){const e=Ci(),t=e.routesById[ml].options.pendingComponent??e.options.defaultPendingComponent,n=t?u.jsx(t,{}):null,r=u.jsxs(typeof document<"u"&&e.ssr?Fc:S.Suspense,{fallback:n,children:[u.jsx(sH,{}),u.jsx(lH,{})]});return e.options.InnerWrap?u.jsx(e.options.InnerWrap,{children:r}):r}function lH(){const e=Ci(),t=Tr({select:i=>i.matches[0]?.id}),n=Tr({select:i=>i.loadedAt}),r=t?u.jsx(wI,{matchId:t}):null;return u.jsx(wy.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:u.jsx(_j,{getResetKey:()=>n,errorComponent:Aj,onCatch:void 0,children:r})})}var cH=e=>new uH(e),uH=class extends jK{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=UE,globalThis.createLazyFileRoute=qE):typeof window<"u"&&(window.createFileRoute=UE,window.createLazyFileRoute=qE);function dH({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=u.jsx(vI.Provider,{value:e,children:t});return e.options.Wrap?u.jsx(e.options.Wrap,{children:r}):r}function fH({router:e,...t}){return u.jsx(dH,{router:e,...t,children:u.jsx(oH,{})})}function SI(e){return Tr({select:t=>t.location})}class is extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function hH(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const pH=hH();function mH(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function gH(e){return`${mH()}${e}`}function yH(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 vH(){return""}function HE(){return!!vH()}async function Te(e,t){const n=await fetch(`${pH}${e}`,{...t,credentials:t?.credentials??"same-origin",headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const r=await n.text();let i=`API ${n.status}: ${n.statusText}`,a;if(r)try{const o=JSON.parse(r);typeof o.error=="string"?i=o.error:o.error?.message?(i=o.error.message,a=o.error.code):o.message&&(i=o.message)}catch{i=r}throw new is(i,n.status,a)}if(n.status!==204)return n.json()}function zj(){return Te("/projects")}function jI(e){return Te(`/projects/${encodeURIComponent(e)}`)}function NI(){return Te("/runs")}function uu(e){return Te(`/runs/${encodeURIComponent(e)}`)}function bH(e){return Te(`/projects/${encodeURIComponent(e)}/keywords`)}function kI(e){return Te(`/projects/${encodeURIComponent(e)}/competitors`)}function CI(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const r=n.toString();return Te(`/projects/${encodeURIComponent(e)}/timeline${r?`?${r}`:""}`)}function Ny(e,t){return Te(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function xH(e,t){return Te(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function wH(e,t){return Te(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function _I(e,t){return Te(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function GE(e,t){const n=await jI(e);return Ny(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 SH(e,t){const n=await jI(e);return Ny(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 jH(e,t){const n={};return t?.location&&(n.location=t.location),t?.allLocations&&(n.allLocations=!0),t?.noLocation&&(n.noLocation=!0),Te(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function NH(e,t){return Te(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function kH(e,t){await Te(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function CH(e,t){return Te(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function _H(e){await Te(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function AH(e){return Te(`/projects/${encodeURIComponent(e)}/export`)}function Rj(){return Te("/settings")}function OH(){return Te("/session")}function EH(e){return Te("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function TH(e){return Te("/session",{method:"POST",body:JSON.stringify({password:e})})}function PH(e,t){return Te(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function zH(e){return Te("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function RH(e){try{return await Te(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof is&&t.statusCode===404)return null;throw t}}function VE(e,t){return Te(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function MH(e){await Te(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function DH(e){return Te(`/projects/${encodeURIComponent(e)}/notifications`)}function IH(e,t){return Te(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function LH(e,t){await Te(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function $H(e,t){return Te(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function UH(e,t,n){return Te(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function BH(e){return Te("/apply",{method:"POST",body:JSON.stringify(e)})}function FH(e){return Te("/runs",{method:"POST",body:JSON.stringify(e??{})})}function AI(e){return Te(`/projects/${encodeURIComponent(e)}/google/connections`)}function qH(e,t){return Te(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function KH(e,t){return Te(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function HH(e){return Te(`/projects/${encodeURIComponent(e)}/google/properties`)}function GH(e,t,n){return Te(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function VH(e,t,n){return Te(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function OI(e,t){return Te(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function ZH(e,t){const n=new URLSearchParams;t?.startDate&&n.set("startDate",t.startDate),t?.endDate&&n.set("endDate",t.endDate),t?.window&&t.window!=="all"&&!t.startDate&&n.set("window",t.window),t?.query&&n.set("query",t.query),t?.page&&n.set("page",t.page),t?.limit!==void 0&&n.set("limit",String(t.limit));const r=n.toString()?`?${n.toString()}`:"";return Te(`/projects/${encodeURIComponent(e)}/google/gsc/performance${r}`)}function YH(e,t){return Te(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function WH(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 Te(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${r}`)}function QH(e){return Te(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function Mj(e){return Te(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function XH(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Te(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function JH(e,t){return Te(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function e7(e){return Te(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function t7(e){return Te(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function ZE(){return Te("/cdp/status")}function n7(e,t){return Te("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function YE(e,t){return Te(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function EI(e){return Te(`/projects/${encodeURIComponent(e)}/bing/status`)}function r7(e,t){return Te(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function i7(e){return Te(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function a7(e){return Te(`/projects/${encodeURIComponent(e)}/bing/sites`)}function s7(e,t){return Te(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function Dj(e){return Te(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function TI(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Te(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function PI(e,t){return Te(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function WE(e,t){return Te(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function o7(e){return Te(`/projects/${encodeURIComponent(e)}/bing/performance`)}function l7(e){return Te("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function c7(e,t){const n=t?`?window=${t}`:"";return Te(`/projects/${encodeURIComponent(e)}/analytics/metrics${n}`)}function u7(e,t){const n=t?`?window=${t}`:"";return Te(`/projects/${encodeURIComponent(e)}/analytics/gaps${n}`)}function d7(e,t){const n=t?`?window=${t}`:"";return Te(`/projects/${encodeURIComponent(e)}/analytics/sources${n}`)}function QE(e){return Te(`/projects/${encodeURIComponent(e)}/ga/status`)}function XE(e,t,n){const r=new URLSearchParams;n&&n!=="all"&&r.set("window",n);const i=r.toString()?`?${r}`:"";return Te(`/projects/${encodeURIComponent(e)}/ga/traffic${i}`)}function zI(e,t){return Te(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function f7(e,t){return Te(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function JE(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Te(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history${n}`)}function eT(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Te(`/projects/${encodeURIComponent(e)}/ga/social-referral-history${n}`)}function tT(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Te(`/projects/${encodeURIComponent(e)}/ga/session-history${n}`)}function h7(e){return Te(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function p7(e,t){const n=t?`?runId=${encodeURIComponent(t)}`:"";return Te(`/projects/${encodeURIComponent(e)}/insights${n}`)}async function m7(e,t){const n=gH(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:yH(e,r.status)};const i=await r.json(),a=typeof i.version=="string"?i.version:"unknown",o=typeof i.databaseUrlConfigured=="boolean"?i.databaseUrlConfigured:void 0,c=typeof i.lastHeartbeatAt=="string"?i.lastHeartbeatAt:void 0,d=[a,o===!1?"database not configured":"database configured",c?`heartbeat ${c}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:d,version:a,databaseConfigured:o,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}}}const g7=6e3,y7=5,v7=180;let rr=[],b7=0;const OS=new Set,ES=new Map,TS=new Map;function sg(){const e=[...rr];for(const t of OS)t(e)}function Ij(e){const t=ES.get(e);t&&(clearTimeout(t),ES.delete(e));const n=TS.get(e);n&&(clearTimeout(n),TS.delete(e))}function RI(e){Ij(e);const t=rr.length;rr=rr.filter(n=>n.id!==e),rr.length!==t&&sg()}function nT(e){Ij(e.id),ES.set(e.id,setTimeout(()=>{PS(e.id)},e.durationMs))}function x7(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function ft(e,t="negative",n=g7){const r=x7(e,t,n),i={id:String(++b7),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=rr.find(o=>o.dedupeKey===r.dedupeKey);if(a){if((r.dedupeMode??"drop")==="drop")return a.id;const o={...a,title:i.title,detail:i.detail,tone:i.tone,durationMs:i.durationMs,cta:i.cta,state:"open"};return rr=rr.map(c=>c.id===a.id?o:c),sg(),nT(o),a.id}}return rr.length>=y7&&RI(rr[0].id),rr=[...rr,i],sg(),nT(i),i.id}function PS(e){const t=rr.find(n=>n.id===e);!t||t.state==="closing"||(Ij(e),rr=rr.map(n=>n.id===e?{...n,state:"closing"}:n),sg(),TS.set(e,setTimeout(()=>{RI(e)},v7)))}function w7(e){return OS.add(e),()=>{OS.delete(e)}}function rT(){return rr}function S7(){return new sq({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new VD({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||ft({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const j7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),N7=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),iT=e=>{const t=N7(e);return t.charAt(0).toUpperCase()+t.slice(1)},MI=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),k7=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var C7={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 _7=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...c},d)=>S.createElement("svg",{ref:d,...C7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:MI("lucide",i),...!a&&!k7(c)&&{"aria-hidden":"true"},...c},[...o.map(([f,p])=>S.createElement(f,p)),...Array.isArray(a)?a:[a]]));const Ht=(e,t)=>{const n=S.forwardRef(({className:r,...i},a)=>S.createElement(_7,{ref:a,iconNode:t,className:MI(`lucide-${j7(iT(e))}`,`lucide-${e}`,r),...i}));return n.displayName=iT(e),n};const A7=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],O7=Ht("arrow-up",A7);const E7=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],DI=Ht("check",E7);const T7=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],P7=Ht("chevron-down",T7);const z7=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Yf=Ht("chevron-right",z7);const R7=[["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"}]],M7=Ht("copy",R7);const D7=[["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"}]],I7=Ht("download",D7);const L7=[["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"}]],$7=Ht("github",L7);const U7=[["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"}]],B7=Ht("globe",U7);const F7=[["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"}]],q7=Ht("layout-dashboard",F7);const K7=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],H7=Ht("loader-circle",K7);const G7=[["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"}]],V7=Ht("maximize-2",G7);const Z7=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],Y7=Ht("menu",Z7);const W7=[["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"}]],Q7=Ht("minimize-2",W7);const X7=[["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"}]],J7=Ht("play",X7);const eG=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],aT=Ht("plus",eG);const tG=[["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"}]],sT=Ht("refresh-cw",tG);const nG=[["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"}]],rG=Ht("rocket",nG);const iG=[["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"}]],II=Ht("rotate-ccw",iG);const aG=[["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"}]],sG=Ht("settings",aG);const oG=[["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"}]],oT=Ht("sparkles",oG);const lG=[["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"}]],cG=Ht("trash-2",lG);const uG=[["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"}]],LI=Ht("triangle-alert",uG);const dG=[["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"}]],fG=Ht("unplug",dG);const hG=[["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"}]],pG=Ht("upload",hG);const mG=[["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"}]],gG=Ht("wrench",mG);const yG=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Wf=Ht("x",yG);function me(e,t,n){function r(c,d){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:d,constr:o,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,d);const f=o.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 o(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(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class eu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class $I extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const UI={};function uo(e){return UI}function BI(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 zS(e,t){return typeof t=="bigint"?t.toString():t}function Lj(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function $j(e){return e==null}function Uj(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function vG(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const d=r.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const a=n>i?n:i,o=Number.parseInt(e.toFixed(a).replace(".","")),c=Number.parseInt(t.toFixed(a).replace(".",""));return o%c/10**a}const lT=Symbol("evaluating");function Tt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==lT)return r===void 0&&(r=lT,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Il(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function vo(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function cT(e){return JSON.stringify(e)}function bG(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const FI="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function og(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const xG=Lj(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function du(e){if(og(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(og(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function qI(e){return du(e)?{...e}:Array.isArray(e)?[...e]:e}const wG=new Set(["string","number","symbol"]);function fu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bo(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function qe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function SG(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const jG={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 NG(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=vo(e._zod.def,{get shape(){const o={};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(o[c]=n.shape[c])}return Il(this,"shape",o),o},checks:[]});return bo(e,a)}function kG(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=vo(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete o[c]}return Il(this,"shape",o),o},checks:[]});return bo(e,a)}function CG(e,t){if(!du(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const a=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(a,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=vo(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Il(this,"shape",a),a}});return bo(e,i)}function _G(e,t){if(!du(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=vo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Il(this,"shape",r),r}});return bo(e,n)}function AG(e,t){const n=vo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Il(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return bo(e,n)}function OG(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=vo(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 Il(this,"shape",d),d},checks:[]});return bo(t,o)}function EG(e,t,n){const r=vo(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const o in n){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(a[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)a[o]=new e({type:"nonoptional",innerType:i[o]});return Il(this,"shape",a),a}});return bo(t,r)}function Kc(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 Hc(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Yp(e){return typeof e=="string"?e:e?.message}function fo(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=Yp(e.inst?._zod.def?.error?.(e))??Yp(t?.error?.(e))??Yp(n.customError?.(e))??Yp(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Bj(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Nf(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const KI=(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,zS,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},HI=me("$ZodError",KI),GI=me("$ZodError",KI,{Parent:Error});function TG(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 PG(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>r({issues:o}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let o=n,c=0;for(;c<a.path.length;){const d=a.path[c];c===a.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(a))):o[d]=o[d]||{_errors:[]},o=o[d],c++}}};return r(e),n}const Fj=e=>(t,n,r,i)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new eu;if(o.issues.length){const c=new(i?.Err??e)(o.issues.map(d=>fo(d,a,uo())));throw FI(c,i?.callee),c}return o.value},qj=e=>async(t,n,r,i)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const c=new(i?.Err??e)(o.issues.map(d=>fo(d,a,uo())));throw FI(c,i?.callee),c}return o.value},ky=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 eu;return a.issues.length?{success:!1,error:new(e??HI)(a.issues.map(o=>fo(o,i,uo())))}:{success:!0,data:a.value}},zG=ky(GI),Cy=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(o=>fo(o,i,uo())))}:{success:!0,data:a.value}},RG=Cy(GI),MG=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Fj(e)(t,n,i)},DG=e=>(t,n,r)=>Fj(e)(t,n,r),IG=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return qj(e)(t,n,i)},LG=e=>async(t,n,r)=>qj(e)(t,n,r),$G=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ky(e)(t,n,i)},UG=e=>(t,n,r)=>ky(e)(t,n,r),BG=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Cy(e)(t,n,i)},FG=e=>async(t,n,r)=>Cy(e)(t,n,r),qG=/^[cC][^\s-]{8,}$/,KG=/^[0-9a-z]+$/,HG=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,GG=/^[0-9a-vA-V]{20}$/,VG=/^[A-Za-z0-9]{27}$/,ZG=/^[a-zA-Z0-9_-]{21}$/,YG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,WG=/^([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})$/,uT=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)$/,QG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,XG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function JG(){return new RegExp(XG,"u")}const eV=/^(?:(?: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])$/,tV=/^(([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}|:))$/,nV=/^((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])$/,rV=/^(([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])$/,iV=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,VI=/^[A-Za-z0-9_-]*$/,aV=/^\+[1-9]\d{6,14}$/,ZI="(?:(?:\\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])))",sV=new RegExp(`^${ZI}$`);function YI(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 oV(e){return new RegExp(`^${YI(e)}$`)}function lV(e){const t=YI({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(`^${ZI}T(?:${r})$`)}const cV=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},uV=/^-?\d+$/,WI=/^-?\d+(?:\.\d+)?$/,dV=/^(?:true|false)$/i,fV=/^[^A-Z]*$/,hV=/^[^a-z]*$/,Rr=me("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),QI={number:"number",bigint:"bigint",object:"date"},XI=me("$ZodCheckLessThan",(e,t)=>{Rr.init(e,t);const n=QI[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})}}),JI=me("$ZodCheckGreaterThan",(e,t)=>{Rr.init(e,t);const n=QI[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})}}),pV=me("$ZodCheckMultipleOf",(e,t)=>{Rr.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):vG(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})}}),mV=me("$ZodCheckNumberFormat",(e,t)=>{Rr.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,a]=jG[t.format];e._zod.onattach.push(o=>{const c=o._zod.bag;c.format=t.format,c.minimum=i,c.maximum=a,n&&(c.pattern=uV)}),e._zod.check=o=>{const c=o.value;if(n){if(!Number.isInteger(c)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?o.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}):o.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&&o.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),c>a&&o.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),gV=me("$ZodCheckMaxLength",(e,t)=>{var n;Rr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!$j(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const o=Bj(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),yV=me("$ZodCheckMinLength",(e,t)=>{var n;Rr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!$j(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const o=Bj(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),vV=me("$ZodCheckLengthEquals",(e,t)=>{var n;Rr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!$j(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,a=i.length;if(a===t.length)return;const o=Bj(i),c=a>t.length;r.issues.push({origin:o,...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})}}),_y=me("$ZodCheckStringFormat",(e,t)=>{var n,r;Rr.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=()=>{})}),bV=me("$ZodCheckRegex",(e,t)=>{_y.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})}}),xV=me("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=fV),_y.init(e,t)}),wV=me("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=hV),_y.init(e,t)}),SV=me("$ZodCheckIncludes",(e,t)=>{Rr.init(e,t);const n=fu(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})}}),jV=me("$ZodCheckStartsWith",(e,t)=>{Rr.init(e,t);const n=new RegExp(`^${fu(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})}}),NV=me("$ZodCheckEndsWith",(e,t)=>{Rr.init(e,t);const n=new RegExp(`.*${fu(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})}}),kV=me("$ZodCheckOverwrite",(e,t)=>{Rr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class CV{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
10
|
-
`).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),a=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of a)this.content.push(o)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
|
|
11
|
-
`))}}const _V={major:4,minor:3,patch:6},an=me("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_V;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const a of i._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(o,c,d)=>{let f=Kc(o),p;for(const m of c){if(m._zod.def.when){if(!m._zod.def.when(o))continue}else if(f)continue;const y=o.issues.length,v=m._zod.check(o);if(v instanceof Promise&&d?.async===!1)throw new eu;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,o.issues.length!==y&&(f||(f=Kc(o,y)))});else{if(o.issues.length===y)continue;f||(f=Kc(o,y))}}return p?p.then(()=>o):o},a=(o,c,d)=>{if(Kc(o))return o.aborted=!0,o;const f=i(c,r,d);if(f instanceof Promise){if(d.async===!1)throw new eu;return f.then(p=>e._zod.parse(p,d))}return e._zod.parse(f,d)};e._zod.run=(o,c)=>{if(c.skipChecks)return e._zod.parse(o,c);if(c.direction==="backward"){const f=e._zod.parse({value:o.value,issues:[]},{...c,skipChecks:!0});return f instanceof Promise?f.then(p=>a(p,o,c)):a(f,o,c)}const d=e._zod.parse(o,c);if(d instanceof Promise){if(c.async===!1)throw new eu;return d.then(f=>i(f,r,c))}return i(d,r,c)}}Tt(e,"~standard",()=>({validate:i=>{try{const a=zG(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return RG(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),Kj=me("$ZodString",(e,t)=>{an.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??cV(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}}),en=me("$ZodStringFormat",(e,t)=>{_y.init(e,t),Kj.init(e,t)}),AV=me("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=WG),en.init(e,t)}),OV=me("$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=uT(r))}else t.pattern??(t.pattern=uT());en.init(e,t)}),EV=me("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=QG),en.init(e,t)}),TV=me("$ZodURL",(e,t)=>{en.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})}}}),PV=me("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=JG()),en.init(e,t)}),zV=me("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ZG),en.init(e,t)}),RV=me("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=qG),en.init(e,t)}),MV=me("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=KG),en.init(e,t)}),DV=me("$ZodULID",(e,t)=>{t.pattern??(t.pattern=HG),en.init(e,t)}),IV=me("$ZodXID",(e,t)=>{t.pattern??(t.pattern=GG),en.init(e,t)}),LV=me("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=VG),en.init(e,t)}),$V=me("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=lV(t)),en.init(e,t)}),UV=me("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=sV),en.init(e,t)}),BV=me("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=oV(t)),en.init(e,t)}),FV=me("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=YG),en.init(e,t)}),qV=me("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=eV),en.init(e,t),e._zod.bag.format="ipv4"}),KV=me("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=tV),en.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})}}}),HV=me("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=nV),en.init(e,t)}),GV=me("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=rV),en.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,a]=r;if(!a)throw new Error;const o=Number(a);if(`${o}`!==a)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function eL(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const VV=me("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=iV),en.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{eL(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function ZV(e){if(!VI.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return eL(n)}const YV=me("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=VI),en.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{ZV(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),WV=me("$ZodE164",(e,t)=>{t.pattern??(t.pattern=aV),en.init(e,t)});function QV(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 XV=me("$ZodJWT",(e,t)=>{en.init(e,t),e._zod.check=n=>{QV(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),tL=me("$ZodNumber",(e,t)=>{an.init(e,t),e._zod.pattern=e._zod.bag.pattern??WI,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}}),JV=me("$ZodNumberFormat",(e,t)=>{mV.init(e,t),tL.init(e,t)}),eZ=me("$ZodBoolean",(e,t)=>{an.init(e,t),e._zod.pattern=dV,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}}),tZ=me("$ZodUnknown",(e,t)=>{an.init(e,t),e._zod.parse=n=>n}),nZ=me("$ZodNever",(e,t)=>{an.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function dT(e,t,n){e.issues.length&&t.issues.push(...Hc(n,e.issues)),t.value[n]=e.value}const rZ=me("$ZodArray",(e,t)=>{an.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const a=[];for(let o=0;o<i.length;o++){const c=i[o],d=t.element._zod.run({value:c,issues:[]},r);d instanceof Promise?a.push(d.then(f=>dT(f,n,o))):dT(d,n,o)}return a.length?Promise.all(a).then(()=>n):n}});function lg(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Hc(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function nL(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=SG(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function rL(e,t,n,r,i,a){const o=[],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"){o.push(m);continue}const y=d.run({value:t[m],issues:[]},r);y instanceof Promise?e.push(y.then(v=>lg(v,n,m,t,p))):lg(y,n,m,t,p)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const iZ=me("$ZodObject",(e,t)=>{if(an.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=Lj(()=>nL(t));Tt(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=og,a=t.catchall;let o;e._zod.parse=(c,d)=>{o??(o=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=o.shape;for(const y of o.keys){const v=m[y],x=v._zod.optout==="optional",w=v._zod.run({value:f[y],issues:[]},d);w instanceof Promise?p.push(w.then(j=>lg(j,c,y,f,x))):lg(w,c,y,f,x)}return a?rL(p,f,c,d,r.value,e):p.length?Promise.all(p).then(()=>c):c}}),aZ=me("$ZodObjectJIT",(e,t)=>{iZ.init(e,t);const n=e._zod.parse,r=Lj(()=>nL(t)),i=y=>{const v=new CV(["shape","payload","ctx"]),x=r.value,w=_=>{const C=cT(_);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 _ of x.keys)j[_]=`key_${k++}`;v.write("const newResult = {};");for(const _ of x.keys){const C=j[_],P=cT(_),A=y[_]?._zod?.optout==="optional";v.write(`const ${C} = ${w(_)};`),A?v.write(`
|
|
12
|
-
if (${C}.issues.length) {
|
|
13
|
-
if (${P} in input) {
|
|
14
|
-
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
15
|
-
...iss,
|
|
16
|
-
path: iss.path ? [${P}, ...iss.path] : [${P}]
|
|
17
|
-
})));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (${C}.value === undefined) {
|
|
22
|
-
if (${P} in input) {
|
|
23
|
-
newResult[${P}] = undefined;
|
|
24
|
-
}
|
|
25
|
-
} else {
|
|
26
|
-
newResult[${P}] = ${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 ? [${P}, ...iss.path] : [${P}]
|
|
34
|
-
})));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (${C}.value === undefined) {
|
|
38
|
-
if (${P} in input) {
|
|
39
|
-
newResult[${P}] = undefined;
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
newResult[${P}] = ${C}.value;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
`)}v.write("payload.value = newResult;"),v.write("return payload;");const O=v.compile();return(_,C)=>O(y,_,C)};let a;const o=og,c=!UI.jitless,f=c&&xG.value,p=t.catchall;let m;e._zod.parse=(y,v)=>{m??(m=r.value);const x=y.value;return o(x)?c&&f&&v?.async===!1&&v.jitless!==!0?(a||(a=i(t.shape)),y=a(y,v),p?rL([],x,y,v,m,e):y):n(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),y)}});function fT(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=>!Kc(a));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(o=>fo(o,r,uo())))}),t)}const sZ=me("$ZodUnion",(e,t)=>{an.init(e,t),Tt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Tt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Tt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Tt(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=>Uj(a.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1;const c=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},a);if(f instanceof Promise)c.push(f),o=!0;else{if(f.issues.length===0)return f;c.push(f)}}return o?Promise.all(c).then(d=>fT(d,i,e,a)):fT(c,i,e,a)}}),oZ=me("$ZodIntersection",(e,t)=>{an.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},r),o=t.right._zod.run({value:i,issues:[]},r);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([d,f])=>hT(n,d,f)):hT(n,a,o)}});function RS(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(du(e)&&du(t)){const n=Object.keys(t),r=Object.keys(e).filter(a=>n.indexOf(a)!==-1),i={...e,...t};for(const a of r){const o=RS(e[a],t[a]);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};i[a]=o.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],a=t[r],o=RS(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function hT(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}),Kc(e))return e;const o=RS(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const lZ=me("$ZodRecord",(e,t)=>{an.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!du(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],o=t.keyType._zod.values;if(o){n.value={};const c=new Set;for(const f of o)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(...Hc(f,m.issues)),n.value[f]=m.value})):(p.issues.length&&n.issues.push(...Hc(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"&&WI.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=>fo(m,r,uo())),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(...Hc(c,m.issues)),n.value[d.value]=m.value})):(p.issues.length&&n.issues.push(...Hc(c,p.issues)),n.value[d.value]=p.value)}}return a.length?Promise.all(a).then(()=>n):n}}),cZ=me("$ZodEnum",(e,t)=>{an.init(e,t);const n=BI(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>wG.has(typeof i)).map(i=>typeof i=="string"?fu(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:n,input:o,inst:e}),i}}),uZ=me("$ZodLiteral",(e,t)=>{if(an.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"?fu(r):r?fu(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}}),dZ=me("$ZodTransform",(e,t)=>{an.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new $I(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(n.value=o,n));if(i instanceof Promise)throw new eu;return n.value=i,n}});function pT(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const iL=me("$ZodOptional",(e,t)=>{an.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Tt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Tt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Uj(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=>pT(a,n.value)):pT(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),fZ=me("$ZodExactOptional",(e,t)=>{iL.init(e,t),Tt(e._zod,"values",()=>t.innerType._zod.values),Tt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),hZ=me("$ZodNullable",(e,t)=>{an.init(e,t),Tt(e._zod,"optin",()=>t.innerType._zod.optin),Tt(e._zod,"optout",()=>t.innerType._zod.optout),Tt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Uj(n.source)}|null)$`):void 0}),Tt(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)}),pZ=me("$ZodDefault",(e,t)=>{an.init(e,t),e._zod.optin="optional",Tt(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=>mT(a,t)):mT(i,t)}});function mT(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const mZ=me("$ZodPrefault",(e,t)=>{an.init(e,t),e._zod.optin="optional",Tt(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))}),gZ=me("$ZodNonOptional",(e,t)=>{an.init(e,t),Tt(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=>gT(a,e)):gT(i,e)}});function gT(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 yZ=me("$ZodCatch",(e,t)=>{an.init(e,t),Tt(e._zod,"optin",()=>t.innerType._zod.optin),Tt(e._zod,"optout",()=>t.innerType._zod.optout),Tt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(o=>fo(o,r,uo()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>fo(a,r,uo()))},input:n.value}),n.issues=[]),n)}}),vZ=me("$ZodPipe",(e,t)=>{an.init(e,t),Tt(e._zod,"values",()=>t.in._zod.values),Tt(e._zod,"optin",()=>t.in._zod.optin),Tt(e._zod,"optout",()=>t.out._zod.optout),Tt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const a=t.out._zod.run(n,r);return a instanceof Promise?a.then(o=>Wp(o,t.in,r)):Wp(a,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>Wp(a,t.out,r)):Wp(i,t.out,r)}});function Wp(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const bZ=me("$ZodReadonly",(e,t)=>{an.init(e,t),Tt(e._zod,"propValues",()=>t.innerType._zod.propValues),Tt(e._zod,"values",()=>t.innerType._zod.values),Tt(e._zod,"optin",()=>t.innerType?._zod?.optin),Tt(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(yT):yT(i)}});function yT(e){return e.value=Object.freeze(e.value),e}const xZ=me("$ZodCustom",(e,t)=>{Rr.init(e,t),an.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=>vT(a,n,r,e));vT(i,n,r,e)}});function vT(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(Nf(i))}}var bT;class wZ{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 SZ(){return new wZ}(bT=globalThis).__zod_globalRegistry??(bT.__zod_globalRegistry=SZ());const rf=globalThis.__zod_globalRegistry;function jZ(e,t){return new e({type:"string",...qe(t)})}function NZ(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...qe(t)})}function xT(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...qe(t)})}function kZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...qe(t)})}function CZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...qe(t)})}function _Z(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...qe(t)})}function AZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...qe(t)})}function OZ(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...qe(t)})}function EZ(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...qe(t)})}function TZ(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...qe(t)})}function PZ(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...qe(t)})}function zZ(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...qe(t)})}function RZ(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...qe(t)})}function MZ(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...qe(t)})}function DZ(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...qe(t)})}function IZ(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...qe(t)})}function LZ(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...qe(t)})}function $Z(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...qe(t)})}function UZ(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...qe(t)})}function BZ(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...qe(t)})}function FZ(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...qe(t)})}function qZ(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...qe(t)})}function KZ(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...qe(t)})}function HZ(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...qe(t)})}function GZ(e,t){return new e({type:"string",format:"date",check:"string_format",...qe(t)})}function VZ(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...qe(t)})}function ZZ(e,t){return new e({type:"string",format:"duration",check:"string_format",...qe(t)})}function YZ(e,t){return new e({type:"number",checks:[],...qe(t)})}function WZ(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...qe(t)})}function QZ(e,t){return new e({type:"boolean",...qe(t)})}function XZ(e){return new e({type:"unknown"})}function JZ(e,t){return new e({type:"never",...qe(t)})}function wT(e,t){return new XI({check:"less_than",...qe(t),value:e,inclusive:!1})}function ux(e,t){return new XI({check:"less_than",...qe(t),value:e,inclusive:!0})}function ST(e,t){return new JI({check:"greater_than",...qe(t),value:e,inclusive:!1})}function dx(e,t){return new JI({check:"greater_than",...qe(t),value:e,inclusive:!0})}function jT(e,t){return new pV({check:"multiple_of",...qe(t),value:e})}function aL(e,t){return new gV({check:"max_length",...qe(t),maximum:e})}function cg(e,t){return new yV({check:"min_length",...qe(t),minimum:e})}function sL(e,t){return new vV({check:"length_equals",...qe(t),length:e})}function eY(e,t){return new bV({check:"string_format",format:"regex",...qe(t),pattern:e})}function tY(e){return new xV({check:"string_format",format:"lowercase",...qe(e)})}function nY(e){return new wV({check:"string_format",format:"uppercase",...qe(e)})}function rY(e,t){return new SV({check:"string_format",format:"includes",...qe(t),includes:e})}function iY(e,t){return new jV({check:"string_format",format:"starts_with",...qe(t),prefix:e})}function aY(e,t){return new NV({check:"string_format",format:"ends_with",...qe(t),suffix:e})}function ku(e){return new kV({check:"overwrite",tx:e})}function sY(e){return ku(t=>t.normalize(e))}function oY(){return ku(e=>e.trim())}function lY(){return ku(e=>e.toLowerCase())}function cY(){return ku(e=>e.toUpperCase())}function uY(){return ku(e=>bG(e))}function dY(e,t,n){return new e({type:"array",element:t,...qe(n)})}function fY(e,t,n){return new e({type:"custom",check:"custom",fn:t,...qe(n)})}function hY(e){const t=pY(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Nf(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(Nf(i))}},e(n.value,n)));return t}function pY(e,t){const n=new Rr({check:"custom",...qe(t)});return n._zod.check=e,n}function oL(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??rf,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 _n(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const c=e._zod.toJSONSchema?.();if(c)o.schema=c;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,p);else{const y=o.schema,v=t.processors[i.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);v(e,t,y,p)}const m=e._zod.parent;m&&(o.ref||(o.ref=m),_n(m,t,p),t.seen.get(m).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(o.schema,d),t.io==="input"&&ur(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function lL(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const o of e.seen.entries()){const c=e.metadataRegistry.get(o[0])?.id;if(c){const d=r.get(c);if(d&&d!==o[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,o[0])}}const i=o=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(o[0])?.id,y=e.external.uri??(x=>x);if(m)return{ref:y(m)};const v=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=v,{defId:v,ref:`${y("__shared")}#/${c}/${v}`}}if(o[1]===n)return{ref:"#"};const f=`#/${c}/`,p=o[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},a=o=>{if(o[1].schema.$ref)return;const c=o[1],{ref:d,defId:f}=i(o);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 o of e.seen.entries()){const c=o[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 o of e.seen.entries()){const c=o[1];if(t===o[0]){a(o);continue}if(e.external){const f=e.external.registry.get(o[0])?.id;if(t!==o[0]&&f){a(o);continue}}if(e.metadataRegistry.get(o[0])?.id){a(o);continue}if(c.cycle){a(o);continue}if(c.count>1&&e.reused==="ref"){a(o);continue}}}function cL(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const c=e.seen.get(o);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),o._zod.parent===p)for(const w in d)w==="$ref"||w==="allOf"||w in f||delete d[w];if(v.$ref&&y.def)for(const w in d)w==="$ref"||w==="allOf"||w in y.def&&JSON.stringify(d[w])===JSON.stringify(y.def[w])&&delete d[w]}const m=o._zod.parent;if(m&&m!==p){r(m);const y=e.seen.get(m);if(y?.schema.$ref&&(d.$ref=y.schema.$ref,y.def))for(const v in d)v==="$ref"||v==="allOf"||v in y.def&&JSON.stringify(d[v])===JSON.stringify(y.def[v])&&delete d[v]}e.override({zodSchema:o,jsonSchema:d,path:c.path??[]})};for(const o of[...e.seen.entries()].reverse())r(o[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(o)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const o of e.seen.entries()){const c=o[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 o=JSON.parse(JSON.stringify(i));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:ug(t,"input",e.processors),output:ug(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function ur(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 ur(r.element,n);if(r.type==="set")return ur(r.valueType,n);if(r.type==="lazy")return ur(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 ur(r.innerType,n);if(r.type==="intersection")return ur(r.left,n)||ur(r.right,n);if(r.type==="record"||r.type==="map")return ur(r.keyType,n)||ur(r.valueType,n);if(r.type==="pipe")return ur(r.in,n)||ur(r.out,n);if(r.type==="object"){for(const i in r.shape)if(ur(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(ur(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(ur(i,n))return!0;return!!(r.rest&&ur(r.rest,n))}return!1}const mY=(e,t={})=>n=>{const r=oL({...n,processors:t});return _n(e,r),lL(r,e),cL(r,e)},ug=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},o=oL({...i??{},target:a,io:t,processors:n});return _n(e,o),lL(o,e),cL(o,e)},gY={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},yY=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:a,maximum:o,format:c,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof o=="number"&&(i.maxLength=o),c&&(i.format=gY[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}))])}},vY=(e,t,n,r)=>{const i=n,{minimum:a,maximum:o,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 o=="number"&&(i.maximum=o,typeof f=="number"&&t.target!=="draft-04"&&(f<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},bY=(e,t,n,r)=>{n.type="boolean"},xY=(e,t,n,r)=>{n.not={}},wY=(e,t,n,r)=>{},SY=(e,t,n,r)=>{const i=e._zod.def,a=BI(i.entries);a.every(o=>typeof o=="number")&&(n.type="number"),a.every(o=>typeof o=="string")&&(n.type="string"),n.enum=a},jY=(e,t,n,r)=>{const i=e._zod.def,a=[];for(const o of i.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){const o=a[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else a.every(o=>typeof o=="number")&&(n.type="number"),a.every(o=>typeof o=="string")&&(n.type="string"),a.every(o=>typeof o=="boolean")&&(n.type="boolean"),a.every(o=>o===null)&&(n.type="null"),n.enum=a},NY=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},kY=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},CY=(e,t,n,r)=>{const i=n,a=e._zod.def,{minimum:o,maximum:c}=e._zod.bag;typeof o=="number"&&(i.minItems=o),typeof c=="number"&&(i.maxItems=c),i.type="array",i.items=_n(a.element,t,{...r,path:[...r.path,"items"]})},_Y=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const o=a.shape;for(const f in o)i.properties[f]=_n(o[f],t,{...r,path:[...r.path,"properties",f]});const c=new Set(Object.keys(o)),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=_n(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},AY=(e,t,n,r)=>{const i=e._zod.def,a=i.inclusive===!1,o=i.options.map((c,d)=>_n(c,t,{...r,path:[...r.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=o:n.anyOf=o},OY=(e,t,n,r)=>{const i=e._zod.def,a=_n(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=_n(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(o)?o.allOf:[o]];n.allOf=d},EY=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object";const o=a.keyType,d=o._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){const p=_n(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=_n(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=_n(a.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=o._zod.values;if(f){const p=[...f].filter(m=>typeof m=="string"||typeof m=="number");p.length>0&&(i.required=p)}},TY=(e,t,n,r)=>{const i=e._zod.def,a=_n(i.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},PY=(e,t,n,r)=>{const i=e._zod.def;_n(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},zY=(e,t,n,r)=>{const i=e._zod.def;_n(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},RY=(e,t,n,r)=>{const i=e._zod.def;_n(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)))},MY=(e,t,n,r)=>{const i=e._zod.def;_n(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},DY=(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;_n(a,t,r);const o=t.seen.get(e);o.ref=a},IY=(e,t,n,r)=>{const i=e._zod.def;_n(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},uL=(e,t,n,r)=>{const i=e._zod.def;_n(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},LY=me("ZodISODateTime",(e,t)=>{$V.init(e,t),on.init(e,t)});function $Y(e){return HZ(LY,e)}const UY=me("ZodISODate",(e,t)=>{UV.init(e,t),on.init(e,t)});function BY(e){return GZ(UY,e)}const FY=me("ZodISOTime",(e,t)=>{BV.init(e,t),on.init(e,t)});function qY(e){return VZ(FY,e)}const KY=me("ZodISODuration",(e,t)=>{FV.init(e,t),on.init(e,t)});function HY(e){return ZZ(KY,e)}const GY=(e,t)=>{HI.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>PG(e,n)},flatten:{value:n=>TG(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,zS,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,zS,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ai=me("ZodError",GY,{Parent:Error}),VY=Fj(Ai),ZY=qj(Ai),YY=ky(Ai),WY=Cy(Ai),QY=MG(Ai),XY=DG(Ai),JY=IG(Ai),eW=LG(Ai),tW=$G(Ai),nW=UG(Ai),rW=BG(Ai),iW=FG(Ai),sn=me("ZodType",(e,t)=>(an.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ug(e,"input"),output:ug(e,"output")}}),e.toJSONSchema=mY(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(vo(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)=>bo(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>VY(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>YY(e,n,r),e.parseAsync=async(n,r)=>ZY(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>WY(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>QY(e,n,r),e.decode=(n,r)=>XY(e,n,r),e.encodeAsync=async(n,r)=>JY(e,n,r),e.decodeAsync=async(n,r)=>eW(e,n,r),e.safeEncode=(n,r)=>tW(e,n,r),e.safeDecode=(n,r)=>nW(e,n,r),e.safeEncodeAsync=async(n,r)=>rW(e,n,r),e.safeDecodeAsync=async(n,r)=>iW(e,n,r),e.refine=(n,r)=>e.check(XW(n,r)),e.superRefine=n=>e.check(JW(n)),e.overwrite=n=>e.check(ku(n)),e.optional=()=>CT(e),e.exactOptional=()=>$W(e),e.nullable=()=>_T(e),e.nullish=()=>CT(_T(e)),e.nonoptional=n=>HW(e,n),e.array=()=>Pe(e),e.or=n=>TW([e,n]),e.and=n=>zW(e,n),e.transform=n=>AT(e,IW(n)),e.default=n=>FW(e,n),e.prefault=n=>KW(e,n),e.catch=n=>VW(e,n),e.pipe=n=>AT(e,n),e.readonly=()=>WW(e),e.describe=n=>{const r=e.clone();return rf.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return rf.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return rf.get(e);const r=e.clone();return rf.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),dL=me("_ZodString",(e,t)=>{Kj.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>yY(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(eY(...r)),e.includes=(...r)=>e.check(rY(...r)),e.startsWith=(...r)=>e.check(iY(...r)),e.endsWith=(...r)=>e.check(aY(...r)),e.min=(...r)=>e.check(cg(...r)),e.max=(...r)=>e.check(aL(...r)),e.length=(...r)=>e.check(sL(...r)),e.nonempty=(...r)=>e.check(cg(1,...r)),e.lowercase=r=>e.check(tY(r)),e.uppercase=r=>e.check(nY(r)),e.trim=()=>e.check(oY()),e.normalize=(...r)=>e.check(sY(...r)),e.toLowerCase=()=>e.check(lY()),e.toUpperCase=()=>e.check(cY()),e.slugify=()=>e.check(uY())}),aW=me("ZodString",(e,t)=>{Kj.init(e,t),dL.init(e,t),e.email=n=>e.check(NZ(sW,n)),e.url=n=>e.check(OZ(oW,n)),e.jwt=n=>e.check(KZ(SW,n)),e.emoji=n=>e.check(EZ(lW,n)),e.guid=n=>e.check(xT(NT,n)),e.uuid=n=>e.check(kZ(Qp,n)),e.uuidv4=n=>e.check(CZ(Qp,n)),e.uuidv6=n=>e.check(_Z(Qp,n)),e.uuidv7=n=>e.check(AZ(Qp,n)),e.nanoid=n=>e.check(TZ(cW,n)),e.guid=n=>e.check(xT(NT,n)),e.cuid=n=>e.check(PZ(uW,n)),e.cuid2=n=>e.check(zZ(dW,n)),e.ulid=n=>e.check(RZ(fW,n)),e.base64=n=>e.check(BZ(bW,n)),e.base64url=n=>e.check(FZ(xW,n)),e.xid=n=>e.check(MZ(hW,n)),e.ksuid=n=>e.check(DZ(pW,n)),e.ipv4=n=>e.check(IZ(mW,n)),e.ipv6=n=>e.check(LZ(gW,n)),e.cidrv4=n=>e.check($Z(yW,n)),e.cidrv6=n=>e.check(UZ(vW,n)),e.e164=n=>e.check(qZ(wW,n)),e.datetime=n=>e.check($Y(n)),e.date=n=>e.check(BY(n)),e.time=n=>e.check(qY(n)),e.duration=n=>e.check(HY(n))});function $(e){return jZ(aW,e)}const on=me("ZodStringFormat",(e,t)=>{en.init(e,t),dL.init(e,t)}),sW=me("ZodEmail",(e,t)=>{EV.init(e,t),on.init(e,t)}),NT=me("ZodGUID",(e,t)=>{AV.init(e,t),on.init(e,t)}),Qp=me("ZodUUID",(e,t)=>{OV.init(e,t),on.init(e,t)}),oW=me("ZodURL",(e,t)=>{TV.init(e,t),on.init(e,t)}),lW=me("ZodEmoji",(e,t)=>{PV.init(e,t),on.init(e,t)}),cW=me("ZodNanoID",(e,t)=>{zV.init(e,t),on.init(e,t)}),uW=me("ZodCUID",(e,t)=>{RV.init(e,t),on.init(e,t)}),dW=me("ZodCUID2",(e,t)=>{MV.init(e,t),on.init(e,t)}),fW=me("ZodULID",(e,t)=>{DV.init(e,t),on.init(e,t)}),hW=me("ZodXID",(e,t)=>{IV.init(e,t),on.init(e,t)}),pW=me("ZodKSUID",(e,t)=>{LV.init(e,t),on.init(e,t)}),mW=me("ZodIPv4",(e,t)=>{qV.init(e,t),on.init(e,t)}),gW=me("ZodIPv6",(e,t)=>{KV.init(e,t),on.init(e,t)}),yW=me("ZodCIDRv4",(e,t)=>{HV.init(e,t),on.init(e,t)}),vW=me("ZodCIDRv6",(e,t)=>{GV.init(e,t),on.init(e,t)}),bW=me("ZodBase64",(e,t)=>{VV.init(e,t),on.init(e,t)}),xW=me("ZodBase64URL",(e,t)=>{YV.init(e,t),on.init(e,t)}),wW=me("ZodE164",(e,t)=>{WV.init(e,t),on.init(e,t)}),SW=me("ZodJWT",(e,t)=>{XV.init(e,t),on.init(e,t)}),fL=me("ZodNumber",(e,t)=>{tL.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>vY(e,r,i),e.gt=(r,i)=>e.check(ST(r,i)),e.gte=(r,i)=>e.check(dx(r,i)),e.min=(r,i)=>e.check(dx(r,i)),e.lt=(r,i)=>e.check(wT(r,i)),e.lte=(r,i)=>e.check(ux(r,i)),e.max=(r,i)=>e.check(ux(r,i)),e.int=r=>e.check(kT(r)),e.safe=r=>e.check(kT(r)),e.positive=r=>e.check(ST(0,r)),e.nonnegative=r=>e.check(dx(0,r)),e.negative=r=>e.check(wT(0,r)),e.nonpositive=r=>e.check(ux(0,r)),e.multipleOf=(r,i)=>e.check(jT(r,i)),e.step=(r,i)=>e.check(jT(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 Ae(e){return YZ(fL,e)}const jW=me("ZodNumberFormat",(e,t)=>{JV.init(e,t),fL.init(e,t)});function kT(e){return WZ(jW,e)}const NW=me("ZodBoolean",(e,t)=>{eZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bY(e,n,r)});function Ft(e){return QZ(NW,e)}const kW=me("ZodUnknown",(e,t)=>{tZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wY()});function dg(){return XZ(kW)}const CW=me("ZodNever",(e,t)=>{nZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>xY(e,n,r)});function _W(e){return JZ(CW,e)}const AW=me("ZodArray",(e,t)=>{rZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>CY(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(cg(n,r)),e.nonempty=n=>e.check(cg(1,n)),e.max=(n,r)=>e.check(aL(n,r)),e.length=(n,r)=>e.check(sL(n,r)),e.unwrap=()=>e.element});function Pe(e,t){return dY(AW,e,t)}const OW=me("ZodObject",(e,t)=>{aZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>_Y(e,n,r,i),Tt(e,"shape",()=>t.shape),e.keyof=()=>Mt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:dg()}),e.loose=()=>e.clone({...e._zod.def,catchall:dg()}),e.strict=()=>e.clone({...e._zod.def,catchall:_W()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>CG(e,n),e.safeExtend=n=>_G(e,n),e.merge=n=>AG(e,n),e.pick=n=>NG(e,n),e.omit=n=>kG(e,n),e.partial=(...n)=>OG(hL,e,n[0]),e.required=(...n)=>EG(pL,e,n[0])});function Ce(e,t){const n={type:"object",shape:e??{},...qe(t)};return new OW(n)}const EW=me("ZodUnion",(e,t)=>{sZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>AY(e,n,r,i),e.options=t.options});function TW(e,t){return new EW({type:"union",options:e,...qe(t)})}const PW=me("ZodIntersection",(e,t)=>{oZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>OY(e,n,r,i)});function zW(e,t){return new PW({type:"intersection",left:e,right:t})}const RW=me("ZodRecord",(e,t)=>{lZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>EY(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function Qf(e,t,n){return new RW({type:"record",keyType:e,valueType:t,...qe(n)})}const MS=me("ZodEnum",(e,t)=>{cZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>SY(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const a={};for(const o of r)if(n.has(o))a[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new MS({...t,checks:[],...qe(i),entries:a})},e.exclude=(r,i)=>{const a={...t.entries};for(const o of r)if(n.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new MS({...t,checks:[],...qe(i),entries:a})}});function Mt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new MS({type:"enum",entries:n,...qe(t)})}const MW=me("ZodLiteral",(e,t)=>{uZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>jY(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 kf(e,t){return new MW({type:"literal",values:Array.isArray(e)?e:[e],...qe(t)})}const DW=me("ZodTransform",(e,t)=>{dZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>kY(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new $I(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(Nf(a,n.value,t));else{const o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(Nf(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function IW(e){return new DW({type:"transform",transform:e})}const hL=me("ZodOptional",(e,t)=>{iL.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uL(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function CT(e){return new hL({type:"optional",innerType:e})}const LW=me("ZodExactOptional",(e,t)=>{fZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uL(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function $W(e){return new LW({type:"optional",innerType:e})}const UW=me("ZodNullable",(e,t)=>{hZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>TY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function _T(e){return new UW({type:"nullable",innerType:e})}const BW=me("ZodDefault",(e,t)=>{pZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>zY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function FW(e,t){return new BW({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():qI(t)}})}const qW=me("ZodPrefault",(e,t)=>{mZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>RY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function KW(e,t){return new qW({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():qI(t)}})}const pL=me("ZodNonOptional",(e,t)=>{gZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>PY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function HW(e,t){return new pL({type:"nonoptional",innerType:e,...qe(t)})}const GW=me("ZodCatch",(e,t)=>{yZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>MY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function VW(e,t){return new GW({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ZW=me("ZodPipe",(e,t)=>{vZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>DY(e,n,r,i),e.in=t.in,e.out=t.out});function AT(e,t){return new ZW({type:"pipe",in:e,out:t})}const YW=me("ZodReadonly",(e,t)=>{bZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>IY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function WW(e){return new YW({type:"readonly",innerType:e})}const QW=me("ZodCustom",(e,t)=>{xZ.init(e,t),sn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>NY(e,n)});function XW(e,t={}){return fY(QW,e,t)}function JW(e){return hY(e)}Ce({maxConcurrency:Ae().int().positive(),maxRequestsPerMinute:Ae().int().positive(),maxRequestsPerDay:Ae().int().positive()});const Cu=$().min(1);$().min(1);const Hj=Ce({label:$().min(1),city:$().min(1),region:$().min(1),country:$().length(2),timezone:$().optional()}),mL=Mt(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);Ce({id:$(),projectId:$(),channel:kf("webhook"),url:$().url(),urlDisplay:$(),urlHost:$(),events:Pe(mL),enabled:Ft().default(!0),source:$().optional(),webhookSecret:$().optional(),createdAt:$(),updatedAt:$()});const gL=Mt(["cli","api","config-file"]);function eQ(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 tQ(e,t){return t?e.some(n=>n.label===t):!0}Ce({displayName:$().min(1),canonicalDomain:$().min(1),ownedDomains:Pe($().min(1)).optional(),country:$().length(2),language:$().min(2),tags:Pe($()).optional(),labels:Qf($(),$()).optional(),providers:Pe(Cu).optional(),locations:Pe(Hj).optional(),defaultLocation:$().nullable().optional(),configSource:gL.optional()});Ce({id:$(),name:$(),displayName:$().optional(),canonicalDomain:$(),ownedDomains:Pe($()).default([]),country:$().length(2),language:$().min(2),tags:Pe($()).default([]),labels:Qf($(),$()).default({}),locations:Pe(Hj).default([]),defaultLocation:$().nullable().optional(),configSource:gL.default("cli"),configRevision:Ae().int().positive().default(1),createdAt:$().optional(),updatedAt:$().optional()});function DS(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function nQ(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],n=new Set,r=[];for(const i of t){const a=i.trim();if(!a)continue;const o=DS(a);n.has(o)||(n.add(o),r.push(a))}return r}const rQ=Ce({name:$().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:Qf($(),$()).optional().default({})}),iQ=Ce({preset:$().optional(),cron:$().optional(),timezone:$().optional().default("UTC"),providers:Pe(Cu).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),aQ=Ce({channel:kf("webhook"),url:$().url(),events:Pe(mL).min(1)}),sQ=Ce({gsc:Ce({propertyUrl:$()}).optional(),syncSchedule:Ce({preset:$().optional(),cron:$().optional()}).optional()}).optional(),oQ=Ce({displayName:$().min(1),canonicalDomain:$().min(1),ownedDomains:Pe($().min(1)).optional().default([]),country:$().length(2),language:$().min(2),keywords:Pe($().min(1)).optional().default([]),competitors:Pe($().min(1)).optional().default([]),providers:Pe(Cu).optional().default([]),locations:Pe(Hj).optional().default([]),defaultLocation:$().optional(),schedule:iQ,notifications:Pe(aQ).optional().default([]),google:sQ}).superRefine((e,t)=>{const n=eQ(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),tQ(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});Ce({apiVersion:kf("canonry/v1"),kind:kf("Project"),metadata:rQ,spec:oQ});const lQ=Mt(["gsc","ga4"]);Ce({id:$(),domain:$(),connectionType:lQ,propertyId:$().nullable().optional(),sitemapUrl:$().nullable().optional(),scopes:Pe($()).default([]),createdAt:$(),updatedAt:$()});Ce({date:$(),query:$(),page:$(),country:$().nullable().optional(),device:$().nullable().optional(),clicks:Ae(),impressions:Ae(),ctr:Ae(),position:Ae()});const IS=Ce({id:$(),url:$(),indexingState:$().nullable().optional(),verdict:$().nullable().optional(),coverageState:$().nullable().optional(),pageFetchState:$().nullable().optional(),robotsTxtState:$().nullable().optional(),crawlTime:$().nullable().optional(),lastCrawlResult:$().nullable().optional(),isMobileFriendly:Ft().nullable().optional(),richResults:Pe($()).default([]),inspectedAt:$()});Mt(["stable","reindexed","deindexed","still-missing","new"]);const cQ=Ce({url:$(),previousState:$().nullable(),currentState:$().nullable(),transitionDate:$()}),uQ=Ce({reason:$(),count:Ae(),urls:Pe(IS).default([])});Ce({summary:Ce({total:Ae(),indexed:Ae(),notIndexed:Ae(),deindexed:Ae(),percentage:Ae()}),lastInspectedAt:$().nullable(),indexed:Pe(IS).default([]),notIndexed:Pe(IS).default([]),deindexed:Pe(cQ).default([]),reasonGroups:Pe(uQ).default([])});Ce({url:$(),type:Mt(["URL_UPDATED","URL_DELETED"]),notifiedAt:$()});Ce({url:$(),type:Mt(["URL_UPDATED","URL_DELETED"]),notifiedAt:$(),status:Mt(["success","error"]),error:$().optional()});Ce({date:$(),indexed:Ae(),notIndexed:Ae(),reasonBreakdown:Qf($(),Ae()).default({})});Ce({id:$(),domain:$(),siteUrl:$().nullable().optional(),createdAt:$(),updatedAt:$()});const fx=Ce({id:$(),url:$(),httpCode:Ae().nullable().optional(),inIndex:Ft().nullable().optional(),lastCrawledDate:$().nullable().optional(),inIndexDate:$().nullable().optional(),inspectedAt:$(),documentSize:Ae().nullable().optional(),anchorCount:Ae().nullable().optional(),discoveryDate:$().nullable().optional()});Ce({summary:Ce({total:Ae(),indexed:Ae(),notIndexed:Ae(),unknown:Ae().optional(),percentage:Ae()}),lastInspectedAt:$().nullable(),indexed:Pe(fx).default([]),notIndexed:Pe(fx).default([]),unknown:Pe(fx).default([]).optional()});Ce({query:$(),impressions:Ae(),clicks:Ae(),ctr:Ae(),averagePosition:Ae()});Ce({date:$(),indexed:Ae(),notIndexed:Ae(),unknown:Ae()});Ce({url:$(),status:Mt(["success","error"]),submittedAt:$(),error:$().optional()});const _u=Mt(["live","staging"]);Ce({projectName:$(),url:$(),stagingUrl:$().optional(),username:$(),defaultEnv:_u,createdAt:$(),updatedAt:$()});const OT=Ce({url:$(),reachable:Ft(),pageCount:Ae().nullable().optional(),version:$().nullable().optional(),error:$().nullable().optional(),plugins:Pe($()).optional(),authenticatedUser:Ce({id:Ae(),slug:$()}).nullable().optional()});Ce({connected:Ft(),projectName:$(),defaultEnv:_u,live:OT.nullable(),staging:OT.nullable(),adminUrl:$().nullable().optional()});const dQ=Ce({id:Ae(),slug:$(),title:$(),status:$(),modifiedAt:$().nullable().optional(),link:$().nullable().optional()}),yL=Ce({title:$().nullable(),description:$().nullable(),noindex:Ft().nullable(),writable:Ft().default(!1),writeTargets:Pe($()).default([])}),fQ=Ce({type:$(),json:Qf($(),dg())}),hQ=dQ.extend({env:_u,content:$(),seo:yL,schemaBlocks:Pe(fQ).default([])}),ET=hQ.extend({contentHash:$(),contentSnippet:$()}),vL=Ce({manualRequired:kf(!0),targetUrl:$(),adminUrl:$().nullable().optional(),content:$(),nextSteps:Pe($()).default([])}),pQ=Ce({slug:$(),severity:Mt(["high","medium","low"]),code:Mt(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:$()});Ce({slug:$(),title:$(),status:$(),wordCount:Ae(),seo:yL,schemaPresent:Ft(),issues:Pe(pQ).default([])});const mQ=Ce({slug:$(),status:Mt(["applied","skipped","manual"]),error:$().optional(),manualAssist:vL.optional()});Ce({env:_u,strategy:Mt(["plugin","manual"]),results:Pe(mQ)});const gQ=Ce({slug:$(),status:Mt(["deployed","stripped","skipped","failed"]),schemasInjected:Pe($()).optional(),manualAssist:vL.optional(),error:$().optional()});Ce({env:_u,results:Pe(gQ)});const yQ=Ce({slug:$(),title:$(),canonrySchemas:Pe($()),thirdPartySchemas:Pe($()),hasCanonrySchema:Ft()});Ce({env:_u,pages:Pe(yQ)});const vQ=Ce({name:$(),status:Mt(["completed","skipped","failed"]),summary:$().optional(),error:$().optional()});Ce({projectName:$(),steps:Pe(vQ)});Ce({slug:$(),live:ET,staging:ET,hasDifferences:Ft(),differences:Ce({title:Ft(),slug:Ft(),content:Ft(),seoTitle:Ft(),seoDescription:Ft(),noindex:Ft(),schema:Ft()})});const bL=Mt(["queued","running","completed","partial","failed","cancelled"]),fn=bL.enum,xL=Mt(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","backlink-extract"]),hn=xL.enum,wL=Mt(["manual","scheduled","config-apply"]),Im=wL.enum,SL=Mt(["cited","not-cited"]);SL.enum;const jL=Mt(["visible","not-visible"]);jL.enum;const NL=Mt(["new","cited","lost","emerging","not-cited"]);NL.enum;const bQ=Ce({id:$(),projectId:$(),kind:xL,status:bL,trigger:wL.default("manual"),location:$().nullable().optional(),startedAt:$().nullable().optional(),finishedAt:$().nullable().optional(),error:$().nullable().optional(),createdAt:$()}),kL=Ce({uri:$(),title:$()}),xQ=Ce({id:$(),runId:$(),keywordId:$(),keyword:$().optional(),provider:Cu,citationState:SL,answerMentioned:Ft().optional(),visibilityState:jL.optional(),transition:NL.optional(),answerText:$().nullable().optional(),citedDomains:Pe($()).default([]),competitorOverlap:Pe($()).default([]),recommendedCompetitors:Pe($()).default([]),matchedTerms:Pe($()).default([]),groundingSources:Pe(kL).default([]),searchQueries:Pe($()).default([]),model:$().nullable().optional(),location:$().nullable().optional(),createdAt:$()}),wQ=bQ.extend({snapshots:Pe(xQ).optional()});Ce({totalRuns:Ae().int().nonnegative(),run:wQ.nullable()});Ce({id:$(),projectId:$().nullable().optional(),actor:$(),action:$(),entityType:$(),entityId:$().nullable().optional(),diff:dg().optional(),createdAt:$()});const SQ=Mt(["yes","no","unknown","not-mentioned"]);Ce({companyName:$().min(1),domain:$().min(1),phrases:Pe($().min(1)).optional().default([]),competitors:Pe($().min(1)).optional().default([])});const jQ=Ce({name:$(),count:Ae().int().nonnegative()}),NQ=Ce({id:$(),name:$(),weight:Ae(),score:Ae(),grade:$(),status:Mt(["pass","partial","fail"]),findings:Pe(Ce({type:$(),message:$()})).default([]),recommendations:Pe($()).default([])}),kQ=Ce({url:$(),finalUrl:$(),auditedAt:$(),overallScore:Ae(),overallGrade:$(),summary:$(),factors:Pe(NQ).default([])}),CQ=Ce({industry:$(),summary:$(),services:Pe($()).default([]),categoryTerms:Pe($()).default([])}),_Q=Ce({provider:$(),displayName:$(),model:$().nullable().optional(),mentioned:Ft(),cited:Ft(),describedAccurately:SQ,accuracyNotes:$().nullable().optional(),incorrectClaims:Pe($()).default([]),recommendedCompetitors:Pe($()).default([]),citedDomains:Pe($()).default([]),groundingSources:Pe(kL).default([]),searchQueries:Pe($()).default([]),answerText:$(),error:$().nullable().optional()}),AQ=Ce({phrase:$(),providerResults:Pe(_Q).default([])}),OQ=Ce({totalQueries:Ae().int().nonnegative(),totalProviders:Ae().int().nonnegative(),totalComparisons:Ae().int().nonnegative(),mentionCount:Ae().int().nonnegative(),citationCount:Ae().int().nonnegative(),topCompetitors:Pe(jQ).default([]),visibilityGap:$(),whatThisMeans:Pe($()).default([]),recommendedActions:Pe($()).default([])});Ce({companyName:$(),domain:$(),homepageUrl:$(),generatedAt:$(),phrases:Pe($()).default([]),competitors:Pe($()).default([]),profile:CQ,audit:kQ,queryResults:Pe(AQ).default([]),summary:OQ});Ce({id:$(),projectId:$(),cronExpr:$(),preset:$().nullable().optional(),timezone:$().default("UTC"),enabled:Ft().default(!0),providers:Pe(Cu).default([]),lastRunAt:$().nullable().optional(),nextRunAt:$().nullable().optional(),createdAt:$(),updatedAt:$()});Ce({preset:$().optional(),cron:$().optional(),timezone:$().optional().default("UTC"),enabled:Ft().optional().default(!0),providers:Pe(Cu).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const EQ=Mt(["answer","citation"]),Js=EQ.enum;Ce({id:$(),projectId:$(),propertyId:$(),clientEmail:$(),connected:Ft(),createdAt:$(),updatedAt:$()});Ce({date:$(),landingPage:$(),sessions:Ae(),organicSessions:Ae(),users:Ae()});const CL=Mt(["session","first_user","manual_utm"]),TQ=Ce({source:$(),medium:$(),sessions:Ae(),users:Ae(),sourceDimension:CL}),PQ=Ce({source:$(),medium:$(),sessions:Ae(),users:Ae(),channelGroup:$()});Ce({totalSessions:Ae(),totalOrganicSessions:Ae(),totalUsers:Ae(),topPages:Pe(Ce({landingPage:$(),sessions:Ae(),organicSessions:Ae(),users:Ae()})),aiReferrals:Pe(TQ),aiSessionsDeduped:Ae(),aiUsersDeduped:Ae(),socialReferrals:Pe(PQ),socialSessions:Ae(),socialUsers:Ae(),organicSharePct:Ae(),aiSharePct:Ae(),socialSharePct:Ae(),lastSyncedAt:$().nullable()});Ce({date:$(),source:$(),medium:$(),sessions:Ae(),users:Ae(),sourceDimension:CL});Ce({date:$(),source:$(),medium:$(),sessions:Ae(),users:Ae(),channelGroup:$()});Ce({date:$(),sessions:Ae(),organicSessions:Ae(),users:Ae()});function TT(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const zQ=Mt(["aero","user","compaction"]);zQ.enum;const _L=128;Ce({key:$().min(1).max(_L),value:$().min(1)});Ce({key:$().min(1).max(_L)});const Gj=Mt(["queued","downloading","querying","ready","failed"]);Gj.enum;Ce({id:$(),release:$(),status:Gj,phaseDetail:$().nullable().optional(),vertexPath:$().nullable().optional(),edgesPath:$().nullable().optional(),vertexSha256:$().nullable().optional(),edgesSha256:$().nullable().optional(),vertexBytes:Ae().int().nullable().optional(),edgesBytes:Ae().int().nullable().optional(),projectsProcessed:Ae().int().nullable().optional(),domainsDiscovered:Ae().int().nullable().optional(),downloadStartedAt:$().nullable().optional(),downloadFinishedAt:$().nullable().optional(),queryStartedAt:$().nullable().optional(),queryFinishedAt:$().nullable().optional(),error:$().nullable().optional(),createdAt:$(),updatedAt:$()});const RQ=Ce({linkingDomain:$(),numHosts:Ae().int()}),MQ=Ce({projectId:$(),release:$(),targetDomain:$(),totalLinkingDomains:Ae().int(),totalHosts:Ae().int(),top10HostsShare:$(),queriedAt:$()});Ce({summary:MQ.nullable(),total:Ae().int(),rows:Pe(RQ)});Ce({release:$(),totalLinkingDomains:Ae().int(),totalHosts:Ae().int(),top10HostsShare:$(),queriedAt:$()});Ce({duckdbInstalled:Ft(),duckdbVersion:$().nullable().optional(),duckdbSpec:$(),pluginDir:$()});Ce({installed:Ft(),version:$(),path:$(),alreadyPresent:Ft()});Ce({release:$(),vertexUrl:$(),edgesUrl:$(),vertexBytes:Ae().int().nullable(),edgesBytes:Ae().int().nullable(),lastModified:$().nullable()});Ce({release:$(),syncStatus:Gj.nullable(),bytes:Ae().int(),lastUsedAt:$().nullable()});var eo=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(eo||{});const DQ={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},Xp={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"};function IQ(e){const t=e.match(/^(\[.*?\])\s*(.+)/);if(t){const n=t[1],r=t[2],i=r.indexOf("{");if(i>=0){const a=r.slice(0,i).trim(),o=r.slice(i);try{const c=JSON.parse(o);return`${n} ${a}
|
|
48
|
-
|
|
49
|
-
${JSON.stringify(c,null,2)}`}catch{}}return`${n}
|
|
50
|
-
${r}`}try{const n=JSON.parse(e);return JSON.stringify(n,null,2)}catch{return e}}function Ay(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Ui(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function PT(e){return e===null?"Unknown":e?"Pass":"Fail"}function LS(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function LQ(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function $Q(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 hx(e,t,n){const r=n==="UTC"?"UTC":n.split("/").pop()?.replace(/_/g," ")??n;if(!e)return`Custom: ${t} · ${r}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${r}`;const i=e.match(/^daily(?:@(\d+))?$/);if(i){const o=i[1]?parseInt(i[1]):6;return`Every day at ${LS(o)} · ${r}`}const a=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(a){const o={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},c=a[2]?parseInt(a[2]):6;return`Every ${o[a[1]]} at ${LS(c)} · ${r}`}return`${e} · ${r}`}function fg(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function AL(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 UQ(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 BQ(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function FQ(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function ho(e){const t=[e.detail,e.hint].filter(Boolean);return t.length>0?t.join(`
|
|
51
|
-
`):void 0}function qQ(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:fg(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:fg(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const i=n.providerStatuses.filter(d=>d.state==="ready").length,a=n.providerStatuses.length,o=i>0,c=n.providerStatuses.filter(d=>d.state==="ready").map(d=>FQ(d)).join(" · ");return{...r,label:"Providers",tone:o?"positive":"caution",detail:`${i} of ${a} configured`,meta:c||"None configured"}})}function KQ(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 HQ(e,t,n){const r=KQ(t,n),i=structuredClone(e);return i.healthChecks=i.healthChecks.map(a=>{if(a.id==="api")return{...a,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(a.id==="worker")return{...a,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const o=n.providerStatuses.some(c=>c.state==="ready");return{...a,detail:o?"At least one provider configured.":"No providers configured.",state:o?"ready":"attention"}}),i.launchState.enabled=r===void 0,i.launchState.blockedReason=r,i.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",i}const OL="canonry.run-tracker",$S=new Set;let zT=!1,GQ=0,Oy={runs:{},batches:{}};function VQ(){const e=Nl();for(const t of $S)t(e)}function ZQ(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function YQ(){typeof window>"u"||window.sessionStorage.setItem(OL,JSON.stringify(Oy))}function EL(){zT||(zT=!0,!(typeof window>"u")&&(Oy=ZQ(window.sessionStorage.getItem(OL))))}function Ey(e){Oy=e,YQ(),VQ()}function Nl(){return EL(),Oy}function WQ(e){return EL(),$S.add(e),()=>{$S.delete(e)}}function TL(e){const t=Nl();Ey({...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 RT(e){const t=Nl();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;Ey({...t,runs:r})}function QQ(e){const t=Nl(),n=`batch_${Date.now()}_${++GQ}`;return Ey({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function XQ(e){const t=Nl();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;Ey({...t,batches:r})}function JQ(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function eX(e,t){let n=0,r=0,i=0,a=0,o=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:o+=1}return{completed:n,partial:r,failed:i,cancelled:a,pending:o,finished:o===0}}function MT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Vj(...e){return t=>{let n=!1;const r=e.map(i=>{const a=MT(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():MT(e[i],null)}}}}function Ll(...e){return S.useCallback(Vj(...e),e)}var tX=Symbol.for("react.lazy"),hg=yy[" use ".trim().toString()];function nX(e){return typeof e=="object"&&e!==null&&"then"in e}function PL(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===tX&&"_payload"in e&&nX(e._payload)}function rX(e){const t=aX(e),n=S.forwardRef((r,i)=>{let{children:a,...o}=r;PL(a)&&typeof hg=="function"&&(a=hg(a._payload));const c=S.Children.toArray(a),d=c.find(oX);if(d){const f=d.props.children,p=c.map(m=>m===d?S.Children.count(f)>1?S.Children.only(null):S.isValidElement(f)?f.props.children:null:m);return u.jsx(t,{...o,ref:i,children:S.isValidElement(f)?S.cloneElement(f,void 0,p):null})}return u.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var iX=rX("Slot");function aX(e){const t=S.forwardRef((n,r)=>{let{children:i,...a}=n;if(PL(i)&&typeof hg=="function"&&(i=hg(i._payload)),S.isValidElement(i)){const o=cX(i),c=lX(a,i.props);return i.type!==S.Fragment&&(c.ref=r?Vj(r,o):o),S.cloneElement(i,c)}return S.Children.count(i)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sX=Symbol("radix.slottable");function oX(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sX}function lX(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 cX(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 zL(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=zL(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ct(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=zL(e))&&(r&&(r+=" "),r+=t);return r}const DT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,IT=Ct,RL=(e,t)=>n=>{var r;if(t?.variants==null)return IT(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(f=>{const p=n?.[f],m=a?.[f];if(p===null)return null;const y=DT(p)||DT(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(x=>{let[w,j]=x;return Array.isArray(j)?j.includes({...a,...c}[w]):{...a,...c}[w]===j})?[...f,m,y]:f},[]);return IT(e,o,d,n?.class,n?.className)},uX=(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},dX=(e,t)=>({classGroupId:e,validator:t}),ML=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),pg="-",LT=[],fX="arbitrary..",hX=e=>{const t=mX(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return pX(o);const c=o.split(pg),d=c[0]===""&&c.length>1?1:0;return DL(c,d,t)},getConflictingClassGroupIds:(o,c)=>{if(c){const d=r[o],f=n[o];return d?f?uX(f,d):d:f||LT}return n[o]||LT}}},DL=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=DL(e,t+1,a);if(f)return f}const o=n.validators;if(o===null)return;const c=t===0?e.join(pg):e.slice(t).join(pg),d=o.length;for(let f=0;f<d;f++){const p=o[f];if(p.validator(c))return p.classGroupId}},pX=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?fX+r:void 0})(),mX=e=>{const{theme:t,classGroups:n}=e;return gX(n,t)},gX=(e,t)=>{const n=ML();for(const r in e){const i=e[r];Zj(i,n,r,t)}return n},Zj=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];yX(o,t,n,r)}},yX=(e,t,n,r)=>{if(typeof e=="string"){vX(e,t,n);return}if(typeof e=="function"){bX(e,t,n,r);return}xX(e,t,n,r)},vX=(e,t,n)=>{const r=e===""?t:IL(t,e);r.classGroupId=n},bX=(e,t,n,r)=>{if(wX(e)){Zj(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(dX(n,e))},xX=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[c,d]=i[o];Zj(d,IL(t,c),n,r)}},IL=(e,t)=>{let n=e;const r=t.split(pg),i=r.length;for(let a=0;a<i;a++){const o=r[a];let c=n.nextPart.get(o);c||(c=ML(),n.nextPart.set(o,c)),n=c}return n},wX=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,SX=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let o=n[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return i(a,o),o},set(a,o){a in n?n[a]=o:i(a,o)}}},US="!",$T=":",jX=[],UT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),NX=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let o=0,c=0,d=0,f;const p=i.length;for(let w=0;w<p;w++){const j=i[w];if(o===0&&c===0){if(j===$T){a.push(i.slice(d,w)),d=w+1;continue}if(j==="/"){f=w;continue}}j==="["?o++:j==="]"?o--:j==="("?c++:j===")"&&c--}const m=a.length===0?i:i.slice(d);let y=m,v=!1;m.endsWith(US)?(y=m.slice(0,-1),v=!0):m.startsWith(US)&&(y=m.slice(1),v=!0);const x=f&&f>d?f-d:void 0;return UT(a,v,y,x)};if(t){const i=t+$T,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):UT(jX,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},kX=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const o=n[a],c=o[0]==="[",d=t.has(o);c||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},CX=e=>({cache:SX(e.cacheSize),parseClassName:NX(e),sortModifiers:kX(e),...hX(e)}),_X=/\s+/,AX=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],c=e.trim().split(_X);let d="";for(let f=c.length-1;f>=0;f-=1){const p=c[f],{isExternal:m,modifiers:y,hasImportantModifier:v,baseClassName:x,maybePostfixModifierPosition:w}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let j=!!w,k=r(j?x.substring(0,w):x);if(!k){if(!j){d=p+(d.length>0?" "+d:d);continue}if(k=r(x),!k){d=p+(d.length>0?" "+d:d);continue}j=!1}const O=y.length===0?"":y.length===1?y[0]:a(y).join(":"),_=v?O+US:O,C=_+k;if(o.indexOf(C)>-1)continue;o.push(C);const P=i(k,j);for(let T=0;T<P.length;++T){const A=P[T];o.push(_+A)}d=p+(d.length>0?" "+d:d)}return d},OX=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=LL(n))&&(i&&(i+=" "),i+=r);return i},LL=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=LL(e[r]))&&(n&&(n+=" "),n+=t);return n},EX=(e,...t)=>{let n,r,i,a;const o=d=>{const f=t.reduce((p,m)=>m(p),e());return n=CX(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=AX(d,n);return i(d,p),p};return a=o,(...d)=>a(OX(...d))},TX=[],En=e=>{const t=n=>n[e]||TX;return t.isThemeGetter=!0,t},$L=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,UL=/^\((?:(\w[\w-]*):)?(.+)\)$/i,PX=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,zX=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,RX=/\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$/,MX=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,DX=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,IX=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Us=e=>PX.test(e),lt=e=>!!e&&!Number.isNaN(Number(e)),Bs=e=>!!e&&Number.isInteger(Number(e)),px=e=>e.endsWith("%")&<(e.slice(0,-1)),Va=e=>zX.test(e),BL=()=>!0,LX=e=>RX.test(e)&&!MX.test(e),Yj=()=>!1,$X=e=>DX.test(e),UX=e=>IX.test(e),BX=e=>!Le(e)&&!$e(e),FX=e=>xo(e,KL,Yj),Le=e=>$L.test(e),Yo=e=>xo(e,HL,LX),BT=e=>xo(e,WX,lt),qX=e=>xo(e,VL,BL),KX=e=>xo(e,GL,Yj),FT=e=>xo(e,FL,Yj),HX=e=>xo(e,qL,UX),Jp=e=>xo(e,ZL,$X),$e=e=>UL.test(e),$d=e=>$l(e,HL),GX=e=>$l(e,GL),qT=e=>$l(e,FL),VX=e=>$l(e,KL),ZX=e=>$l(e,qL),em=e=>$l(e,ZL,!0),YX=e=>$l(e,VL,!0),xo=(e,t,n)=>{const r=$L.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},$l=(e,t,n=!1)=>{const r=UL.exec(e);return r?r[1]?t(r[1]):n:!1},FL=e=>e==="position"||e==="percentage",qL=e=>e==="image"||e==="url",KL=e=>e==="length"||e==="size"||e==="bg-size",HL=e=>e==="length",WX=e=>e==="number",GL=e=>e==="family-name",VL=e=>e==="number"||e==="weight",ZL=e=>e==="shadow",QX=()=>{const e=En("color"),t=En("font"),n=En("text"),r=En("font-weight"),i=En("tracking"),a=En("leading"),o=En("breakpoint"),c=En("container"),d=En("spacing"),f=En("radius"),p=En("shadow"),m=En("inset-shadow"),y=En("text-shadow"),v=En("drop-shadow"),x=En("blur"),w=En("perspective"),j=En("aspect"),k=En("ease"),O=En("animate"),_=()=>["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"],P=()=>[...C(),$e,Le],T=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],z=()=>[$e,Le,d],I=()=>[Us,"full","auto",...z()],q=()=>[Bs,"none","subgrid",$e,Le],U=()=>["auto",{span:["full",Bs,$e,Le]},Bs,$e,Le],L=()=>[Bs,"auto",$e,Le],J=()=>["auto","min","max","fr",$e,Le],ae=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],K=()=>["auto",...z()],X=()=>[Us,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],ye=()=>[Us,"screen","full","dvw","lvw","svw","min","max","fit",...z()],Se=()=>[Us,"screen","full","lh","dvh","lvh","svh","min","max","fit",...z()],R=()=>[e,$e,Le],F=()=>[...C(),qT,FT,{position:[$e,Le]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",VX,FX,{size:[$e,Le]}],V=()=>[px,$d,Yo],se=()=>["","none","full",f,$e,Le],ie=()=>["",lt,$d,Yo],he=()=>["solid","dashed","dotted","double"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[lt,px,qT,FT],de=()=>["","none",x,$e,Le],_e=()=>["none",lt,$e,Le],Y=()=>["none",lt,$e,Le],Ke=()=>[lt,$e,Le],Me=()=>[Us,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Va],breakpoint:[Va],color:[BL],container:[Va],"drop-shadow":[Va],ease:["in","out","in-out"],font:[BX],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Va],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Va],shadow:[Va],spacing:["px",lt],text:[Va],"text-shadow":[Va],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Us,Le,$e,j]}],container:["container"],columns:[{columns:[lt,Le,$e,c]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:P()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Bs,"auto",$e,Le]}],basis:[{basis:[Us,"full","auto",c,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[lt,Us,"auto","initial","none",Le]}],grow:[{grow:["",lt,$e,Le]}],shrink:[{shrink:["",lt,$e,Le]}],order:[{order:[Bs,"first","last","none",$e,Le]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...ae(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...ae()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":ae()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pbs:[{pbs:z()}],pbe:[{pbe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mbs:[{mbs:K()}],mbe:[{mbe:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...ye()]}],"min-inline-size":[{"min-inline":["auto",...ye()]}],"max-inline-size":[{"max-inline":["none",...ye()]}],"block-size":[{block:["auto",...Se()]}],"min-block-size":[{"min-block":["auto",...Se()]}],"max-block-size":[{"max-block":["none",...Se()]}],w:[{w:[c,"screen",...X()]}],"min-w":[{"min-w":[c,"screen","none",...X()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,$d,Yo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,YX,qX]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",px,Le]}],"font-family":[{font:[GX,KX,t]}],"font-features":[{"font-features":[Le]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,$e,Le]}],"line-clamp":[{"line-clamp":[lt,"none",$e,BT]}],leading:[{leading:[a,...z()]}],"list-image":[{"list-image":["none",$e,Le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$e,Le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[lt,"from-font","auto",$e,Yo]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[lt,"auto",$e,Le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e,Le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$e,Le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Bs,$e,Le],radial:["",$e,Le],conic:[Bs,$e,Le]},ZX,HX]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[lt,$e,Le]}],"outline-w":[{outline:["",lt,$d,Yo]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",p,em,Jp]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",m,em,Jp]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[lt,Yo]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",y,em,Jp]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[lt,$e,Le]}],"mix-blend":[{"mix-blend":[...je(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":je()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[lt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[$e,Le]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"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":[lt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$e,Le]}],filter:[{filter:["","none",$e,Le]}],blur:[{blur:de()}],brightness:[{brightness:[lt,$e,Le]}],contrast:[{contrast:[lt,$e,Le]}],"drop-shadow":[{"drop-shadow":["","none",v,em,Jp]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",lt,$e,Le]}],"hue-rotate":[{"hue-rotate":[lt,$e,Le]}],invert:[{invert:["",lt,$e,Le]}],saturate:[{saturate:[lt,$e,Le]}],sepia:[{sepia:["",lt,$e,Le]}],"backdrop-filter":[{"backdrop-filter":["","none",$e,Le]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[lt,$e,Le]}],"backdrop-contrast":[{"backdrop-contrast":[lt,$e,Le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",lt,$e,Le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[lt,$e,Le]}],"backdrop-invert":[{"backdrop-invert":["",lt,$e,Le]}],"backdrop-opacity":[{"backdrop-opacity":[lt,$e,Le]}],"backdrop-saturate":[{"backdrop-saturate":[lt,$e,Le]}],"backdrop-sepia":[{"backdrop-sepia":["",lt,$e,Le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",$e,Le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[lt,"initial",$e,Le]}],ease:[{ease:["linear","initial",k,$e,Le]}],delay:[{delay:[lt,$e,Le]}],animate:[{animate:["none",O,$e,Le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,$e,Le]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:Y()}],"scale-x":[{"scale-x":Y()}],"scale-y":[{"scale-y":Y()}],"scale-z":[{"scale-z":Y()}],"scale-3d":["scale-3d"],skew:[{skew:Ke()}],"skew-x":[{"skew-x":Ke()}],"skew-y":[{"skew-y":Ke()}],transform:[{transform:[$e,Le,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"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:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$e,Le]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mbs":[{"scroll-mbs":z()}],"scroll-mbe":[{"scroll-mbe":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pbs":[{"scroll-pbs":z()}],"scroll-pbe":[{"scroll-pbe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$e,Le]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[lt,$d,Yo,BT]}],stroke:[{stroke:["none",...R()]}],"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"]}},XX=EX(QX);function Oi(...e){return XX(Ct(e))}const JX=RL("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"}}),we=S.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const o=r?iX:"button";return u.jsx(o,{ref:a,className:Oi(JX({variant:t,size:n,className:e})),...i})});we.displayName="Button";const eJ=RL("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 YL({className:e,variant:t,...n}){return u.jsx("div",{className:Oi(eJ({variant:t}),e),...n})}function KT({compact:e=!1}){return u.jsxs(Qt,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[u.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),u.jsxs("span",{className:"brand-copy",children:[u.jsx("span",{className:"brand-mark",children:"Canonry"}),e?null:u.jsx("span",{className:"brand-subtitle",children:"AEO Monitor"})]})]})}function Cf({provider:e}){const t={gemini:"border-blue-800/50 bg-blue-950/40 text-blue-300",openai:"border-green-800/50 bg-green-950/40 text-green-300",claude:"border-amber-800/50 bg-amber-950/40 text-amber-300",perplexity:"border-teal-800/50 bg-teal-950/40 text-teal-300",local:"border-purple-800/50 bg-purple-950/40 text-purple-300"};return u.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ${t[e]??"border-zinc-700 bg-zinc-800 text-zinc-300"}`,children:e})}function Et({tone:e,children:t,...n}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return u.jsx(YL,{variant:r,...n,children:t})}function Ty({status:e}){return u.jsx(Et,{tone:AL(e),children:Ay(e)})}function ao(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function tJ(e,t){const n=S.createContext(t),r=a=>{const{children:o,...c}=a,d=S.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:d,children:o})};r.displayName=e+"Provider";function i(a){const o=S.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function nJ(e,t=[]){let n=[];function r(a,o){const c=S.createContext(o),d=n.length;n=[...n,o];const f=m=>{const{scope:y,children:v,...x}=m,w=y?.[e]?.[d]||c,j=S.useMemo(()=>x,Object.values(x));return u.jsx(w.Provider,{value:j,children:v})};f.displayName=a+"Provider";function p(m,y){const v=y?.[e]?.[d]||c,x=S.useContext(v);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[f,p]}const i=()=>{const a=n.map(o=>S.createContext(o));return function(c){const d=c?.[e]||a;return S.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return i.scopeName=e,[r,rJ(i,...t)]}function rJ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const m=d(a)[`__scope${f}`];return{...c,...m}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var _f=globalThis?.document?S.useLayoutEffect:()=>{},iJ=yy[" useId ".trim().toString()]||(()=>{}),aJ=0;function mx(e){const[t,n]=S.useState(iJ());return _f(()=>{n(r=>r??String(aJ++))},[e]),e||(t?`radix-${t}`:"")}var sJ=yy[" useInsertionEffect ".trim().toString()]||_f;function oJ({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=lJ({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:i;{const p=S.useRef(e!==void 0);S.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=S.useCallback(p=>{if(c){const m=cJ(p)?p(e):p;m!==e&&o.current?.(m)}else a(p)},[c,e,a,o]);return[d,f]}function lJ({defaultProp:e,onChange:t}){const[n,r]=S.useState(e),i=S.useRef(n),a=S.useRef(t);return sJ(()=>{a.current=t},[t]),S.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function cJ(e){return typeof e=="function"}function WL(e){const t=uJ(e),n=S.forwardRef((r,i)=>{const{children:a,...o}=r,c=S.Children.toArray(a),d=c.find(fJ);if(d){const f=d.props.children,p=c.map(m=>m===d?S.Children.count(f)>1?S.Children.only(null):S.isValidElement(f)?f.props.children:null:m);return u.jsx(t,{...o,ref:i,children:S.isValidElement(f)?S.cloneElement(f,void 0,p):null})}return u.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function uJ(e){const t=S.forwardRef((n,r)=>{const{children:i,...a}=n;if(S.isValidElement(i)){const o=pJ(i),c=hJ(a,i.props);return i.type!==S.Fragment&&(c.ref=r?Vj(r,o):o),S.cloneElement(i,c)}return S.Children.count(i)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dJ=Symbol("radix.slottable");function fJ(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dJ}function hJ(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 pJ(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 mJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cs=mJ.reduce((e,t)=>{const n=WL(`Primitive.${t}`),r=S.forwardRef((i,a)=>{const{asChild:o,...c}=i,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function gJ(e,t){e&&Dl.flushSync(()=>e.dispatchEvent(t))}function Af(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>t.current?.(...n),[])}function yJ(e,t=globalThis?.document){const n=Af(e);S.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 vJ="DismissableLayer",BS="dismissableLayer.update",bJ="dismissableLayer.pointerDownOutside",xJ="dismissableLayer.focusOutside",HT,QL=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),XL=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:c,...d}=e,f=S.useContext(QL),[p,m]=S.useState(null),y=p?.ownerDocument??globalThis?.document,[,v]=S.useState({}),x=Ll(t,A=>m(A)),w=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(j),O=p?w.indexOf(p):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,C=O>=k,P=jJ(A=>{const z=A.target,I=[...f.branches].some(q=>q.contains(z));!C||I||(i?.(A),o?.(A),A.defaultPrevented||c?.())},y),T=NJ(A=>{const z=A.target;[...f.branches].some(q=>q.contains(z))||(a?.(A),o?.(A),A.defaultPrevented||c?.())},y);return yJ(A=>{O===f.layers.size-1&&(r?.(A),!A.defaultPrevented&&c&&(A.preventDefault(),c()))},y),S.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(HT=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),GT(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=HT)}},[p,y,n,f]),S.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),GT())},[p,f]),S.useEffect(()=>{const A=()=>v({});return document.addEventListener(BS,A),()=>document.removeEventListener(BS,A)},[]),u.jsx(cs.div,{...d,ref:x,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:ao(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ao(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ao(e.onPointerDownCapture,P.onPointerDownCapture)})});XL.displayName=vJ;var wJ="DismissableLayerBranch",SJ=S.forwardRef((e,t)=>{const n=S.useContext(QL),r=S.useRef(null),i=Ll(t,r);return S.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),u.jsx(cs.div,{...e,ref:i})});SJ.displayName=wJ;function jJ(e,t=globalThis?.document){const n=Af(e),r=S.useRef(!1),i=S.useRef(()=>{});return S.useEffect(()=>{const a=c=>{if(c.target&&!r.current){let d=function(){JL(bJ,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},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function NJ(e,t=globalThis?.document){const n=Af(e),r=S.useRef(!1);return S.useEffect(()=>{const i=a=>{a.target&&!r.current&&JL(xJ,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 GT(){const e=new CustomEvent(BS);document.dispatchEvent(e)}function JL(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?gJ(i,a):i.dispatchEvent(a)}var gx="focusScope.autoFocusOnMount",yx="focusScope.autoFocusOnUnmount",VT={bubbles:!1,cancelable:!0},kJ="FocusScope",e5=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,d]=S.useState(null),f=Af(i),p=Af(a),m=S.useRef(null),y=Ll(t,w=>d(w)),v=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let w=function(_){if(v.paused||!c)return;const C=_.target;c.contains(C)?m.current=C:Hs(m.current,{select:!0})},j=function(_){if(v.paused||!c)return;const C=_.relatedTarget;C!==null&&(c.contains(C)||Hs(m.current,{select:!0}))},k=function(_){if(document.activeElement===document.body)for(const P of _)P.removedNodes.length>0&&Hs(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",j);const O=new MutationObserver(k);return c&&O.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",j),O.disconnect()}}},[r,c,v.paused]),S.useEffect(()=>{if(c){YT.add(v);const w=document.activeElement;if(!c.contains(w)){const k=new CustomEvent(gx,VT);c.addEventListener(gx,f),c.dispatchEvent(k),k.defaultPrevented||(CJ(TJ(t5(c)),{select:!0}),document.activeElement===w&&Hs(c))}return()=>{c.removeEventListener(gx,f),setTimeout(()=>{const k=new CustomEvent(yx,VT);c.addEventListener(yx,p),c.dispatchEvent(k),k.defaultPrevented||Hs(w??document.body,{select:!0}),c.removeEventListener(yx,p),YT.remove(v)},0)}}},[c,f,p,v]);const x=S.useCallback(w=>{if(!n&&!r||v.paused)return;const j=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(j&&k){const O=w.currentTarget,[_,C]=_J(O);_&&C?!w.shiftKey&&k===C?(w.preventDefault(),n&&Hs(_,{select:!0})):w.shiftKey&&k===_&&(w.preventDefault(),n&&Hs(C,{select:!0})):k===O&&w.preventDefault()}},[n,r,v.paused]);return u.jsx(cs.div,{tabIndex:-1,...o,ref:y,onKeyDown:x})});e5.displayName=kJ;function CJ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Hs(r,{select:t}),document.activeElement!==n)return}function _J(e){const t=t5(e),n=ZT(t,e),r=ZT(t.reverse(),e);return[n,r]}function t5(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 ZT(e,t){for(const n of e)if(!AJ(n,{upTo:t}))return n}function AJ(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 OJ(e){return e instanceof HTMLInputElement&&"select"in e}function Hs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&OJ(e)&&t&&e.select()}}var YT=EJ();function EJ(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=WT(e,t),e.unshift(t)},remove(t){e=WT(e,t),e[0]?.resume()}}}function WT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function TJ(e){return e.filter(t=>t.tagName!=="A")}var PJ="Portal",n5=S.forwardRef((e,t)=>{const{container:n,...r}=e,[i,a]=S.useState(!1);_f(()=>a(!0),[]);const o=n||i&&globalThis?.document?.body;return o?FK.createPortal(u.jsx(cs.div,{...r,ref:t}),o):null});n5.displayName=PJ;function zJ(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var Py=e=>{const{present:t,children:n}=e,r=RJ(t),i=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),a=Ll(r.ref,MJ(i));return typeof n=="function"||r.isPresent?S.cloneElement(i,{ref:a}):null};Py.displayName="Presence";function RJ(e){const[t,n]=S.useState(),r=S.useRef(null),i=S.useRef(e),a=S.useRef("none"),o=e?"mounted":"unmounted",[c,d]=zJ(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const f=tm(r.current);a.current=c==="mounted"?f:"none"},[c]),_f(()=>{const f=r.current,p=i.current;if(p!==e){const y=a.current,v=tm(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&y!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),_f(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,m=v=>{const w=tm(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(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=tm(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:S.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function tm(e){return e?.animationName||"none"}function MJ(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 vx=0;function DJ(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??QT()),document.body.insertAdjacentElement("beforeend",e[1]??QT()),vx++,()=>{vx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),vx--}},[])}function QT(){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 ca=function(){return ca=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},ca.apply(this,arguments)};function r5(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 IJ(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 Lm="right-scroll-bar-position",$m="width-before-scroll-bar",LJ="with-scroll-bars-hidden",$J="--removed-body-scroll-bar-size";function bx(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function UJ(e,t){var n=S.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 BJ=typeof window<"u"?S.useLayoutEffect:S.useEffect,XT=new WeakMap;function FJ(e,t){var n=UJ(null,function(r){return e.forEach(function(i){return bx(i,r)})});return BJ(function(){var r=XT.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(c){a.has(c)||bx(c,null)}),a.forEach(function(c){i.has(c)||bx(c,o)})}XT.set(n,e)},[e]),n}function qJ(e){return e}function KJ(e,t){t===void 0&&(t=qJ);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(c){return c!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var c=n;n=[],c.forEach(a),o=n}var d=function(){var p=o;o=[],p.forEach(a)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){o.push(p),f()},filter:function(p){return o=o.filter(p),n}}}};return i}function HJ(e){e===void 0&&(e={});var t=KJ(null);return t.options=ca({async:!0,ssr:!1},e),t}var i5=function(e){var t=e.sideCar,n=r5(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 S.createElement(r,ca({},n))};i5.isSideCarExport=!0;function GJ(e,t){return e.useMedium(t),i5}var a5=HJ(),xx=function(){},zy=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:xx,onWheelCapture:xx,onTouchMoveCapture:xx}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,y=e.sideCar,v=e.noRelative,x=e.noIsolation,w=e.inert,j=e.allowPinchZoom,k=e.as,O=k===void 0?"div":k,_=e.gapMode,C=r5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=y,T=FJ([n,t]),A=ca(ca({},C),i);return S.createElement(S.Fragment,null,p&&S.createElement(P,{sideCar:a5,removeScrollBar:f,shards:m,noRelative:v,noIsolation:x,inert:w,setCallbacks:a,allowPinchZoom:!!j,lockRef:n,gapMode:_}),o?S.cloneElement(S.Children.only(c),ca(ca({},A),{ref:T})):S.createElement(O,ca({},A,{className:d,ref:T}),c))});zy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zy.classNames={fullWidth:$m,zeroRight:Lm};var VJ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ZJ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=VJ();return t&&e.setAttribute("nonce",t),e}function YJ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function WJ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var QJ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ZJ())&&(YJ(t,n),WJ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},XJ=function(){var e=QJ();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},s5=function(){var e=XJ(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},JJ={left:0,top:0,right:0,gap:0},wx=function(e){return parseInt(e||"",10)||0},eee=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[wx(n),wx(r),wx(i)]},tee=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return JJ;var t=eee(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])}},nee=s5(),tu="data-scroll-locked",ree=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
52
|
-
.`.concat(LJ,` {
|
|
53
|
-
overflow: hidden `).concat(r,`;
|
|
54
|
-
padding-right: `).concat(c,"px ").concat(r,`;
|
|
55
|
-
}
|
|
56
|
-
body[`).concat(tu,`] {
|
|
57
|
-
overflow: hidden `).concat(r,`;
|
|
58
|
-
overscroll-behavior: contain;
|
|
59
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
60
|
-
padding-left: `.concat(i,`px;
|
|
61
|
-
padding-top: `).concat(a,`px;
|
|
62
|
-
padding-right: `).concat(o,`px;
|
|
63
|
-
margin-left:0;
|
|
64
|
-
margin-top:0;
|
|
65
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
66
|
-
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.`).concat(Lm,` {
|
|
70
|
-
right: `).concat(c,"px ").concat(r,`;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.`).concat($m,` {
|
|
74
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.`).concat(Lm," .").concat(Lm,` {
|
|
78
|
-
right: 0 `).concat(r,`;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.`).concat($m," .").concat($m,` {
|
|
82
|
-
margin-right: 0 `).concat(r,`;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
body[`).concat(tu,`] {
|
|
86
|
-
`).concat($J,": ").concat(c,`px;
|
|
87
|
-
}
|
|
88
|
-
`)},JT=function(){var e=parseInt(document.body.getAttribute(tu)||"0",10);return isFinite(e)?e:0},iee=function(){S.useEffect(function(){return document.body.setAttribute(tu,(JT()+1).toString()),function(){var e=JT()-1;e<=0?document.body.removeAttribute(tu):document.body.setAttribute(tu,e.toString())}},[])},aee=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;iee();var a=S.useMemo(function(){return tee(i)},[i]);return S.createElement(nee,{styles:ree(a,!t,i,n?"":"!important")})},FS=!1;if(typeof window<"u")try{var nm=Object.defineProperty({},"passive",{get:function(){return FS=!0,!0}});window.addEventListener("test",nm,nm),window.removeEventListener("test",nm,nm)}catch{FS=!1}var Ac=FS?{passive:!1}:!1,see=function(e){return e.tagName==="TEXTAREA"},o5=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!see(e)&&n[t]==="visible")},oee=function(e){return o5(e,"overflowY")},lee=function(e){return o5(e,"overflowX")},e2=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=l5(e,r);if(i){var a=c5(e,r),o=a[1],c=a[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},cee=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},uee=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},l5=function(e,t){return e==="v"?oee(t):lee(t)},c5=function(e,t){return e==="v"?cee(t):uee(t)},dee=function(e,t){return e==="h"&&t==="rtl"?-1:1},fee=function(e,t,n,r,i){var a=dee(e,window.getComputedStyle(t).direction),o=a*r,c=n.target,d=t.contains(c),f=!1,p=o>0,m=0,y=0;do{if(!c)break;var v=c5(e,c),x=v[0],w=v[1],j=v[2],k=w-j-a*x;(x||k)&&l5(e,c)&&(m+=k,y+=x);var O=c.parentNode;c=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}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},rm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},t2=function(e){return[e.deltaX,e.deltaY]},n2=function(e){return e&&"current"in e?e.current:e},hee=function(e,t){return e[0]===t[0]&&e[1]===t[1]},pee=function(e){return`
|
|
89
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
90
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
91
|
-
`)},mee=0,Oc=[];function gee(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),i=S.useState(mee++)[0],a=S.useState(s5)[0],o=S.useRef(e);S.useEffect(function(){o.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=IJ([e.lockRef.current],(e.shards||[]).map(n2),!0).filter(Boolean);return w.forEach(function(j){return j.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=S.useCallback(function(w,j){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var k=rm(w),O=n.current,_="deltaX"in w?w.deltaX:O[0]-k[0],C="deltaY"in w?w.deltaY:O[1]-k[1],P,T=w.target,A=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in w&&A==="h"&&T.type==="range")return!1;var z=window.getSelection(),I=z&&z.anchorNode,q=I?I===T||I.contains(T):!1;if(q)return!1;var U=e2(A,T);if(!U)return!0;if(U?P=A:(P=A==="v"?"h":"v",U=e2(A,T)),!U)return!1;if(!r.current&&"changedTouches"in w&&(_||C)&&(r.current=P),!P)return!0;var L=r.current||P;return fee(L,j,w,L==="h"?_:C)},[]),d=S.useCallback(function(w){var j=w;if(!(!Oc.length||Oc[Oc.length-1]!==a)){var k="deltaY"in j?t2(j):rm(j),O=t.current.filter(function(P){return P.name===j.type&&(P.target===j.target||j.target===P.shadowParent)&&hee(P.delta,k)})[0];if(O&&O.should){j.cancelable&&j.preventDefault();return}if(!O){var _=(o.current.shards||[]).map(n2).filter(Boolean).filter(function(P){return P.contains(j.target)}),C=_.length>0?c(j,_[0]):!o.current.noIsolation;C&&j.cancelable&&j.preventDefault()}}},[]),f=S.useCallback(function(w,j,k,O){var _={name:w,delta:j,target:k,should:O,shadowParent:yee(k)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),p=S.useCallback(function(w){n.current=rm(w),r.current=void 0},[]),m=S.useCallback(function(w){f(w.type,t2(w),w.target,c(w,e.lockRef.current))},[]),y=S.useCallback(function(w){f(w.type,rm(w),w.target,c(w,e.lockRef.current))},[]);S.useEffect(function(){return Oc.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:y}),document.addEventListener("wheel",d,Ac),document.addEventListener("touchmove",d,Ac),document.addEventListener("touchstart",p,Ac),function(){Oc=Oc.filter(function(w){return w!==a}),document.removeEventListener("wheel",d,Ac),document.removeEventListener("touchmove",d,Ac),document.removeEventListener("touchstart",p,Ac)}},[]);var v=e.removeScrollBar,x=e.inert;return S.createElement(S.Fragment,null,x?S.createElement(a,{styles:pee(i)}):null,v?S.createElement(aee,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function yee(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const vee=GJ(a5,gee);var u5=S.forwardRef(function(e,t){return S.createElement(zy,ca({},e,{ref:t,sideCar:vee}))});u5.classNames=zy.classNames;var bee=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ec=new WeakMap,im=new WeakMap,am={},Sx=0,d5=function(e){return e&&(e.host||d5(e.parentNode))},xee=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=d5(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})},wee=function(e,t,n,r){var i=xee(t,Array.isArray(e)?e:[e]);am[n]||(am[n]=new WeakMap);var a=am[n],o=[],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),x=v!==null&&v!=="false",w=(Ec.get(y)||0)+1,j=(a.get(y)||0)+1;Ec.set(y,w),a.set(y,j),o.push(y),w===1&&x&&im.set(y,!0),j===1&&y.setAttribute(n,"true"),x||y.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",y,k)}})};return p(t),c.clear(),Sx++,function(){o.forEach(function(m){var y=Ec.get(m)-1,v=a.get(m)-1;Ec.set(m,y),a.set(m,v),y||(im.has(m)||m.removeAttribute(r),im.delete(m)),v||m.removeAttribute(n)}),Sx--,Sx||(Ec=new WeakMap,Ec=new WeakMap,im=new WeakMap,am={})}},See=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=bee(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),wee(r,i,n,"aria-hidden")):function(){return null}},Ry="Dialog",[f5]=nJ(Ry),[jee,Yi]=f5(Ry),h5=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,c=S.useRef(null),d=S.useRef(null),[f,p]=oJ({prop:r,defaultProp:i??!1,onChange:a,caller:Ry});return u.jsx(jee,{scope:t,triggerRef:c,contentRef:d,contentId:mx(),titleId:mx(),descriptionId:mx(),open:f,onOpenChange:p,onOpenToggle:S.useCallback(()=>p(m=>!m),[p]),modal:o,children:n})};h5.displayName=Ry;var p5="DialogTrigger",Nee=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Yi(p5,n),a=Ll(t,i.triggerRef);return u.jsx(cs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Xj(i.open),...r,ref:a,onClick:ao(e.onClick,i.onOpenToggle)})});Nee.displayName=p5;var Wj="DialogPortal",[kee,m5]=f5(Wj,{forceMount:void 0}),g5=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Yi(Wj,t);return u.jsx(kee,{scope:t,forceMount:n,children:S.Children.map(r,o=>u.jsx(Py,{present:n||a.open,children:u.jsx(n5,{asChild:!0,container:i,children:o})}))})};g5.displayName=Wj;var mg="DialogOverlay",y5=S.forwardRef((e,t)=>{const n=m5(mg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Yi(mg,e.__scopeDialog);return a.modal?u.jsx(Py,{present:r||a.open,children:u.jsx(_ee,{...i,ref:t})}):null});y5.displayName=mg;var Cee=WL("DialogOverlay.RemoveScroll"),_ee=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Yi(mg,n);return u.jsx(u5,{as:Cee,allowPinchZoom:!0,shards:[i.contentRef],children:u.jsx(cs.div,{"data-state":Xj(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),kl="DialogContent",v5=S.forwardRef((e,t)=>{const n=m5(kl,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Yi(kl,e.__scopeDialog);return u.jsx(Py,{present:r||a.open,children:a.modal?u.jsx(Aee,{...i,ref:t}):u.jsx(Oee,{...i,ref:t})})});v5.displayName=kl;var Aee=S.forwardRef((e,t)=>{const n=Yi(kl,e.__scopeDialog),r=S.useRef(null),i=Ll(t,n.contentRef,r);return S.useEffect(()=>{const a=r.current;if(a)return See(a)},[]),u.jsx(b5,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ao(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ao(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&a.preventDefault()}),onFocusOutside:ao(e.onFocusOutside,a=>a.preventDefault())})}),Oee=S.forwardRef((e,t)=>{const n=Yi(kl,e.__scopeDialog),r=S.useRef(!1),i=S.useRef(!1);return u.jsx(b5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;n.triggerRef.current?.contains(o)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),b5=S.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,c=Yi(kl,n),d=S.useRef(null),f=Ll(t,d);return DJ(),u.jsxs(u.Fragment,{children:[u.jsx(e5,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:u.jsx(XL,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Xj(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(Eee,{titleId:c.titleId}),u.jsx(Pee,{contentRef:d,descriptionId:c.descriptionId})]})]})}),Qj="DialogTitle",x5=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Yi(Qj,n);return u.jsx(cs.h2,{id:i.titleId,...r,ref:t})});x5.displayName=Qj;var w5="DialogDescription",S5=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Yi(w5,n);return u.jsx(cs.p,{id:i.descriptionId,...r,ref:t})});S5.displayName=w5;var j5="DialogClose",N5=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Yi(j5,n);return u.jsx(cs.button,{type:"button",...r,ref:t,onClick:ao(e.onClick,()=>i.onOpenChange(!1))})});N5.displayName=j5;function Xj(e){return e?"open":"closed"}var k5="DialogTitleWarning",[XNe,C5]=tJ(k5,{contentName:kl,titleName:Qj,docsSlug:"dialog"}),Eee=({titleId:e})=>{const t=C5(k5),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
92
|
-
|
|
93
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
94
|
-
|
|
95
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Tee="DialogDescriptionWarning",Pee=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${C5(Tee).contentName}}.`;return S.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},_5=h5,A5=g5,Jj=y5,eN=v5,tN=x5,O5=S5,E5=N5;const zee=_5,Ree=A5,T5=S.forwardRef(({className:e,...t},n)=>u.jsx(Jj,{ref:n,className:Oi("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));T5.displayName=Jj.displayName;const Mee=400,Dee=1200,Iee=720,P5=S.forwardRef(({className:e,children:t,...n},r)=>{const[i,a]=S.useState(Iee),o=S.useRef(!1),c=S.useRef(0),d=S.useRef(0),f=S.useCallback(y=>{o.current=!0,c.current=y.clientX,d.current=i,y.target.setPointerCapture(y.pointerId),y.preventDefault()},[i]),p=S.useCallback(y=>{if(!o.current)return;const v=c.current-y.clientX,x=Math.min(Dee,Math.max(Mee,d.current+v));a(x)},[]),m=S.useCallback(()=>{o.current=!1},[]);return u.jsxs(Ree,{children:[u.jsx(T5,{}),u.jsxs(eN,{ref:r,className:Oi("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${i}px, 100vw)`},...n,children:[u.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:f,onPointerMove:p,onPointerUp:m}),t,u.jsxs(E5,{className:"absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-900 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400",children:[u.jsx(Wf,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});P5.displayName=eN.displayName;const Lee=({className:e,...t})=>u.jsx("div",{className:Oi("flex flex-col gap-1.5 pr-10",e),...t}),z5=S.forwardRef(({className:e,...t},n)=>u.jsx(tN,{ref:n,className:Oi("text-lg font-medium text-zinc-50",e),...t}));z5.displayName=tN.displayName;const R5=S.forwardRef(({className:e,...t},n)=>u.jsx(O5,{ref:n,className:Oi("text-sm text-zinc-500",e),...t}));R5.displayName=O5.displayName;function $ee({title:e,subtitle:t,children:n,open:r,onClose:i}){return u.jsx(zee,{open:r,onOpenChange:a=>a?void 0:i(),children:u.jsxs(P5,{children:[u.jsxs(Lee,{className:"drawer-head",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),u.jsx(z5,{id:"drawer-title",children:e}),u.jsx(R5,{className:"sr-only",children:t})]}),u.jsx("div",{className:"drawer-body",children:n})]})})}function Wn({text:e}){const[t,n]=S.useState(null),r=S.useRef(null),i=S.useCallback(()=>{if(!r.current)return;const o=r.current.getBoundingClientRect();n({top:o.top,left:o.left+o.width/2})},[]),a=S.useCallback(()=>n(null),[]);return u.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,children:[u.jsxs("svg",{ref:r,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[u.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),t!==null&&Dl.createPortal(u.jsx("span",{role:"tooltip",style:{position:"fixed",top:t.top,left:t.left,transform:"translateX(-50%) translateY(calc(-100% - 8px))",zIndex:9999,pointerEvents:"none",width:"14rem",padding:"0.5rem 0.75rem",fontSize:"11px",fontWeight:400,textTransform:"none",letterSpacing:"normal",lineHeight:"1rem",color:"#d4d4d8",backgroundColor:"#18181b",border:"1px solid rgba(63, 63, 70, 0.6)",borderRadius:"0.5rem",boxShadow:"0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1)"},children:e}),document.body)]})}function r2(e,t){const n=Uee(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"?Bi.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const o=[...i].sort((f,p)=>p.length-f.length).map(f=>f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${o.join("|")})`,"gi"),d=new Map;for(const f of n)for(const p of f.terms){const m=p.toLowerCase();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 w=d.get(y.toLowerCase())??"answer-highlight";return f.type==="bold"?Bi.createElement("mark",{key:`hl-${p}-${v}`,className:w},Bi.createElement("strong",{className:"text-zinc-200 font-semibold"},y)):Bi.createElement("mark",{key:`hl-${p}-${v}`,className:w},y)}return f.type==="bold"?Bi.createElement("strong",{key:`b-${p}-${v}`,className:"text-zinc-200 font-semibold"},y):y})).filter(Boolean)}function Uee(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function jx(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 Bee({evidence:e,project:t,onClose:n}){const[r,i]=S.useState(!1),[a,o]=S.useState("mentions"),[c,d]=S.useState(-1),[f,p]=S.useState(null),[m,y]=S.useState(!1),[v,x]=S.useState({}),w=nQ(t.project),j=new Set(w.map(DS)),k=e.runHistory,O=k.length>1,[_,C]=S.useState(null),P=S.useRef(!1);S.useEffect(()=>{if(P.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const V=k.at(-1);V&&(P.current=!0,uu(V.runId).then(se=>{const ie=se.snapshots.find(he=>he.keyword===e.keyword&&he.provider===e.provider);ie&&C({citationState:ie.citationState,answerMentioned:ie.answerMentioned,visibilityState:ie.visibilityState,visibilityTransition:V.visibilityTransition,provider:ie.provider,model:ie.model??e.model,answerSnippet:ie.answerText??e.answerSnippet,citedDomains:ie.citedDomains??e.citedDomains,competitorDomains:ie.competitorOverlap??e.competitorDomains,recommendedCompetitors:ie.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:ie.matchedTerms??e.matchedTerms??[],groundingSources:ie.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,k]);const T=c>=0&&f!==null,A=T?f:_||{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},z=A.visibilityState==="pending"||A.citationState==="pending",I=z?!1:A.visibilityState!=null?A.visibilityState==="visible":A.answerMentioned!=null?A.answerMentioned:A.citationState==="cited"||A.citationState==="emerging",q=A.answerMentioned!=null||A.visibilityState!=null||A.recommendedCompetitors.length>0,U=A.citedDomains.length>0||A.groundingSources.length>0||A.evidenceUrls.length>0,L=t.project.displayName||t.project.name,J=[...w.map(DS),L,L.split(" ").slice(0,2).join(" "),...A.matchedTerms].filter(V=>V.trim().length>2),ae=[...A.competitorDomains.flatMap(V=>{const se=V.split(".")[0];return se&&se.length>=4?[se]:[]}),...A.recommendedCompetitors].filter(V=>V.trim().length>2),Q=[{terms:J,className:"answer-highlight-brand"},...ae.length>0?[{terms:ae,className:"answer-highlight-competitor"}]:[]],K=z?"pending":A.visibilityTransition==="lost"?"lost":I?"cited":"not-cited",X=S.useRef(0),ye=S.useCallback(async V=>{const se=++X.current;if(V===-1||V===k.length-1){d(-1),p(null),i(!1);return}d(V),i(!1);const ie=k[V],he=`${ie.runId}::${e.keyword}::${e.provider}`;if(v[he]){p(v[he]);return}y(!0);try{const je=await uu(ie.runId);if(se!==X.current)return;const ee=je.snapshots.find(_e=>_e.keyword===e.keyword&&_e.provider===e.provider)??je.snapshots.find(_e=>_e.keyword===e.keyword),de=ee?{citationState:ee.citationState,answerMentioned:ee.answerMentioned,visibilityState:ee.visibilityState,visibilityTransition:ie.visibilityTransition,provider:ee.provider,model:ee.model??null,answerSnippet:ee.answerText??"",citedDomains:ee.citedDomains,competitorDomains:ee.competitorOverlap,recommendedCompetitors:ee.recommendedCompetitors??[],matchedTerms:ee.matchedTerms??[],groundingSources:ee.groundingSources,evidenceUrls:[],changeLabel:jx(ie.visibilityTransition,ie.visibilityState),summary:""}:{citationState:ie.citationState,answerMentioned:ie.answerMentioned,visibilityState:ie.visibilityState,visibilityTransition:ie.visibilityTransition,provider:e.provider,model:ie.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:jx(ie.visibilityTransition,ie.visibilityState),summary:"Snapshot data not available for this run."};x(_e=>({..._e,[he]:de})),p(de)}catch{if(se!==X.current)return;p({citationState:ie.citationState,answerMentioned:ie.answerMentioned,visibilityState:ie.visibilityState,visibilityTransition:ie.visibilityTransition,provider:e.provider,model:ie.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:jx(ie.visibilityTransition,ie.visibilityState),summary:"Failed to load historical run data."})}finally{se===X.current&&y(!1)}},[k,e.keyword,e.provider,v]),R=(T||e.historyScope!=="provider")&&A.model?`${A.provider} (${A.model}) · ${A.changeLabel.toLowerCase()}`:`${A.provider} · ${A.changeLabel.toLowerCase()}`,F=!T&&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(" · "):"",B=I?{label:"Visible in answer",title:"Your brand or domain is mentioned in this answer",meta:R}:A.visibilityTransition==="lost"?{label:"Visibility lost",title:"Your brand no longer appears in this answer",meta:R}:z?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not visible in answer",title:"Your brand or domain was not mentioned in this answer",meta:R},M=()=>{if(!A.answerSnippet)return null;const V=A.answerSnippet.split(`
|
|
96
|
-
`),se=[];let ie=[],he=0;const je=()=>{if(ie.length===0)return;const ee=ie.join(" ").trim();ee&&se.push(u.jsx("p",{className:se.length>0?"mt-2.5":"",children:r2(ee,Q)},he++)),ie=[]};for(const ee of V){const de=ee.trim();if(/^[-\u2013\u2014]{3,}$/.test(de)){je(),se.push(u.jsx("hr",{className:"border-zinc-800/60 my-3"},he++));continue}const _e=de.match(/^(#{1,3})\s+(.+)$/);if(_e){je();const Y=_e[1].length,Ke=_e[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||_e[2],Me=Y===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":Y===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";se.push(u.jsx("p",{className:Me,children:r2(Ke,Q)},he++));continue}if(de===""){je();continue}ie.push(de)}return je(),se};return u.jsx(_5,{open:!0,onOpenChange:V=>{V||n()},children:u.jsxs(A5,{children:[u.jsx(Jj,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),u.jsxs(eN,{className:"evidence-modal","aria-describedby":void 0,children:[u.jsxs("div",{className:"evidence-modal-header",children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," ","·"," ",A.provider||"All providers"]}),u.jsx(tN,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),u.jsxs(E5,{className:"inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-800 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 shrink-0",children:[u.jsx(Wf,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]}),O&&u.jsxs("div",{className:"evidence-modal-timeline",children:[u.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),u.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:k.map((V,se)=>{const ie=c===-1&&se===k.length-1||c===se,he=V.visibilityState??(V.answerMentioned?"visible":"not-visible"),je=V.visibilityTransition??he,ee=he==="visible"?"bg-emerald-400":je==="emerging"?"bg-amber-400":je==="lost"?"bg-rose-400":"bg-zinc-600",_e=new Date(V.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Y=!!(V.model&&se>0&&k[se-1]?.model&&k[se-1].model!==V.model);return u.jsxs("button",{type:"button",className:`evidence-run-dot ${ie?"evidence-run-dot--selected":""}`,onClick:()=>ye(se===k.length-1?-1:se),"aria-label":[`Run ${_e}: ${he}`,V.model?`model ${V.model}`:null,Y?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ie,children:[u.jsx("span",{className:`size-2 rounded-full ${ee} ${Y?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),u.jsx("span",{className:"text-[10px] text-zinc-500",children:_e})]},se)})}),c>=0&&c<k.length&&u.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(k[c].createdAt).toLocaleString()," ","—"," ",u.jsx("span",{className:"capitalize",children:k[c].visibilityState??(k[c].answerMentioned?"visible":"not-visible")}),u.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>ye(-1),children:["←"," Back to latest"]})]}),!T&&(e.modelTransitions?.length??0)>0&&u.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(V=>u.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-400/30 bg-amber-400/10 px-2 py-1 text-[10px] text-amber-100",children:`${V.fromModel??"unknown"} -> ${V.toModel??"unknown"} on ${new Date(V.createdAt).toLocaleDateString()}`},`${V.runId}:${V.toModel??"unknown"}`))})]}),u.jsxs("div",{className:"evidence-modal-body",children:[m&&u.jsxs("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:["Loading historical run data","…"]}),!m&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"evidence-modal-main",children:[u.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${K}`,children:[u.jsx("p",{className:`evidence-position-label evidence-position-label--${K}`,children:B.label}),u.jsx("p",{className:`evidence-position-title evidence-position-title--${K}`,children:B.title}),u.jsx("p",{className:"evidence-position-meta",children:B.meta}),F&&u.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:F})]}),A.answerSnippet&&u.jsxs("div",{children:[u.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),u.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:M()}),A.answerSnippet.length>280&&u.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>i(!r),children:r?"↑ Collapse":"↓ Show full answer"})]}),!A.answerSnippet&&!m&&u.jsx("div",{className:"rounded-lg border border-zinc-800/40 bg-zinc-900/20 px-4 py-8 text-center text-zinc-600 text-sm",children:"No answer text recorded for this run"}),!T&&e.relatedTechnicalSignals.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"drawer-section-label",children:I?"Why you're visible":"What to fix"}),u.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((V,se)=>u.jsxs("div",{className:"action-item",children:[u.jsx("svg",{className:`action-item-icon ${I?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:I?u.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):u.jsxs(u.Fragment,{children:[u.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),u.jsx("span",{className:"action-item-text",children:V})]},se))})]}),A.summary&&u.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:A.summary})]}),u.jsxs("div",{className:"evidence-modal-sidebar",children:[(q||U)&&u.jsxs("div",{className:"sidebar-tabs",children:[u.jsx("button",{className:`sidebar-tab ${a==="mentions"?"sidebar-tab--active":""}`,onClick:()=>o("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),u.jsx("button",{className:`sidebar-tab ${a==="sources"?"sidebar-tab--active":""}`,onClick:()=>o("sources"),type:"button",title:"Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.",children:"Sources"})]}),a==="mentions"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsxs("div",{className:"drawer-section-label flex items-center",children:[u.jsx("span",{children:"Answer visibility"}),u.jsx(Wn,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),u.jsxs("div",{className:`mention-status mention-status--${I?"visible":"not-visible"}`,children:[u.jsx("span",{className:"mention-status-icon",children:z?"…":I?"✓":"—"}),u.jsx("span",{className:"mention-status-label",children:z?"Pending":I?"Visible":"Not visible"})]}),A.matchedTerms.length>0&&u.jsxs("div",{className:"mt-2",children:[u.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:A.matchedTerms.map(V=>u.jsx("span",{className:"mention-chip mention-chip--brand",children:V},V))})]}),!z&&!I&&A.matchedTerms.length===0&&u.jsxs("div",{className:"mt-2",children:[u.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:J.map(V=>u.jsx("span",{className:"mention-chip mention-chip--muted",children:V},V))}),u.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(A.recommendedCompetitors.length>0||A.competitorDomains.length>0)&&u.jsxs("div",{children:[u.jsxs("div",{className:"drawer-section-label flex items-center",children:[u.jsx("span",{children:"Competitors in answer"}),u.jsx(Wn,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const V=A.competitorDomains.map(he=>he.replace(/^www\./,"")),se=new Set(V.map(he=>TT(he.replace(/\.[^.]+$/,""))));return[...A.recommendedCompetitors.filter(he=>!se.has(TT(he))),...V].map(he=>u.jsx("span",{className:"mention-chip mention-chip--competitor",children:he},he))})()})]})]}),a==="sources"&&u.jsxs(u.Fragment,{children:[A.citedDomains.length>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"drawer-section-label flex items-center",children:[u.jsx("span",{children:"Domains from source links"}),u.jsx(Wn,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),u.jsx("div",{className:"citation-leaderboard",children:A.citedDomains.map((V,se)=>{const ie=V.toLowerCase().replace(/^www\./,""),he=j.has(ie),je=!he&&A.competitorDomains.some(de=>de.toLowerCase().replace(/^www\./,"")===ie),ee=he?"you":je?"competitor":"other";return u.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${ee}`,children:[u.jsxs("span",{className:"citation-leaderboard-rank",children:["#",se+1]}),u.jsx("span",{className:"citation-leaderboard-domain",children:V}),he&&u.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),je&&u.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},V)})})]}),A.groundingSources.length>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"drawer-section-label flex items-center",children:[u.jsxs("span",{children:["Grounding source links (",A.groundingSources.length,")"]}),u.jsx(Wn,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),u.jsx("ul",{className:"grid gap-0.5",children:A.groundingSources.map((V,se)=>u.jsx("li",{className:"truncate text-sm",children:u.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})},se))})]}),A.evidenceUrls.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),u.jsx("ul",{className:"grid gap-1",children:A.evidenceUrls.map(V=>u.jsx("li",{className:"truncate text-sm",children:u.jsx("a",{href:V,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:V})},V))})]}),A.citedDomains.length===0&&A.groundingSources.length===0&&A.evidenceUrls.length===0&&u.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",T?"for this run":"yet"]})]}),!q&&!U&&u.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",T?"for this run":"yet"]})]})]})]})]})]})})}function $i(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 Nx=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_harbor",name:"Harbor Legal Group",canonicalDomain:"harborlegal.com",ownedDomains:[],country:"US",language:"en",tags:["lead gen"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_northstar",name:"Northstar Orthopedics",canonicalDomain:"northstarortho.com",ownedDomains:[],country:"US",language:"en",tags:["multi-location"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1}];function My(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 Fee=My({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"}),qee=My({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"}),Kee=My({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"}),Hee=My({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"}),Gee=[{id:"evidence_citypoint_emergency_gemini",keyword:"emergency dentist brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"lost",changeLabel:"Lost since Mar 5",answerSnippet:"For urgent dental care in Brooklyn, Downtown Smiles and Harbor Dental are now cited first for emergency availability and same-day booking.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:["https://downtownsmiles.com/emergency-dentist-brooklyn","https://harbordental.com/same-day-emergency-care"],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing on the emergency service page","llms.txt not found during latest site audit","Location pages link weakly into the emergency care hub"],summary:"AI answers now cite two competitors while your emergency page is no longer grounded.",runHistory:$i(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",keyword:"emergency dentist brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"Cited for 6 runs",answerSnippet:"Citypoint Dental is listed as a top emergency dentist in Brooklyn for same-day appointments and walk-in availability.",citedDomains:["citypointdental.com","downtownsmiles.com"],evidenceUrls:["https://citypointdental.com/emergency-dentist-brooklyn"],competitorDomains:["downtownsmiles.com"],groundingSources:[],relatedTechnicalSignals:["Emergency page indexed with structured data"],summary:"OpenAI cites your emergency page consistently alongside one competitor.",runHistory:$i(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",keyword:"emergency dentist brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"Based on the search results, top-rated emergency dental practices in Brooklyn include Downtown Smiles and Harbor Dental.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:[],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing","llms.txt not found"],summary:"Claude does not cite your domain for this emergency query.",runHistory:$i(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_invisalign_openai",keyword:"best invisalign dentist downtown brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"First citation in 7 days",answerSnippet:"Citypoint Dental appears as an emerging recommendation for Invisalign in Downtown Brooklyn, supported by recent before-and-after case pages.",citedDomains:["citypointdental.com","clearlineortho.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn","https://citypointdental.com/case-studies/invisalign-open-bite"],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["Structured data now present on two case-study pages","Internal links from service pages to case studies improved crawl depth"],summary:"Fresh case-study content is starting to earn citations on Invisalign prompts.",runHistory:$i(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",keyword:"best invisalign dentist downtown brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"cited",changeLabel:"Cited for 8 runs",answerSnippet:"Citypoint Dental in Downtown Brooklyn is highlighted for its Invisalign expertise and patient outcomes.",citedDomains:["citypointdental.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn"],competitorDomains:[],groundingSources:[],relatedTechnicalSignals:["Case study pages well-indexed"],summary:"Gemini consistently cites your Invisalign page with no competitor overlap.",runHistory:$i(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",keyword:"best invisalign dentist downtown brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For Invisalign in Downtown Brooklyn, Clear Line Ortho and Brooklyn Smiles are frequently recommended for their experienced orthodontists.",citedDomains:["clearlineortho.com","brooklynsmiles.com"],evidenceUrls:[],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["No before/after schema on case study pages"],summary:"Claude does not surface your Invisalign content despite strong page quality.",runHistory:$i(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_claude",keyword:"pediatric dentist brooklyn heights",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 4 runs",answerSnippet:"Answers cite neighborhood-specific pediatric practices with stronger family-focused FAQ content and clearer insurance details.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:["https://brightkidsdental.com/pediatric-dentist-brooklyn-heights","https://parkpediatricdental.com/insurance"],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric service page exists for Brooklyn Heights","Insurance content is buried three clicks deep"],summary:"Coverage gap is content-driven, not purely technical.",runHistory:$i(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",keyword:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For pediatric dentistry in Brooklyn Heights, Bright Kids Dental and Park Pediatric Dental are cited for family-friendly care.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:[],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric page for Brooklyn Heights"],summary:"Gemini does not surface your domain for pediatric queries in this area.",runHistory:$i(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_openai",keyword:"pediatric dentist brooklyn heights",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"First citation this month",answerSnippet:"Citypoint Dental is mentioned as offering pediatric services in Brooklyn, though specialized pediatric-only practices are also highlighted.",citedDomains:["citypointdental.com","brightkidsdental.com"],evidenceUrls:["https://citypointdental.com/family-dentistry"],competitorDomains:["brightkidsdental.com"],groundingSources:[],relatedTechnicalSignals:["Family dentistry page recently updated"],summary:"OpenAI recently started citing your family dentistry page for this query.",runHistory:$i(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Nx[0],Nx[1],$i(["cited","cited","cited","cited","cited"]),Nx[2],2/7,$i(["not-cited","not-cited","not-cited","cited"]);function Vee(e,t){return e.projects.find(n=>n.project.id===t)}function Zee(e,t){return e.runs.find(n=>n.id===t)}function Yee(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 Wee={regression:"negative",gain:"positive",opportunity:"caution"},Qee={regression:"lost",gain:"emerging",opportunity:"not-cited"},Xee={regression:"Regression",gain:"Gain",opportunity:"Opportunity"};function Jee(e){return{id:e.id,tone:Wee[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??Xee[e.type],affectedPhrases:[{keyword:e.keyword,evidenceId:"",provider:e.provider,citationState:Qee[e.type]}]}}function ete(e){return e.filter(t=>!t.dismissed).map(Jee)}function M5(e){return{id:e.id,name:e.name,displayName:e.displayName,canonicalDomain:e.canonicalDomain,ownedDomains:e.ownedDomains??[],country:e.country,language:e.language,tags:e.tags,labels:e.labels,locations:e.locations??[],defaultLocation:e.defaultLocation??null,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function qS(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function tte(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 nN(e){switch(e){case hn["answer-visibility"]:return"Answer visibility sweep";case hn["gsc-sync"]:return"GSC sync";case hn["inspect-sitemap"]:return"Sitemap inspection";case hn["ga-sync"]:return"GA sync";case hn["bing-inspect"]:return"Bing URL inspection";case hn["site-audit"]:return"Site audit";case hn["backlink-extract"]:return"Backlink extract"}}function nte(e){return e===Im.manual?"Manual":e===Im.scheduled?"Scheduled":e===Im["config-apply"]?"Config apply":e}function rN(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:nN(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?qS(e.startedAt):qS(e.createdAt),duration:tte(e.startedAt,e.finishedAt),statusDetail:e.error?D5(e.error):rte(e),summary:ite(e),triggerLabel:nte(e.trigger)}}function D5(e){try{const n=JSON.parse(e);if(typeof n=="object"&&n!==null){const r=n.message??n.error?.message??n[0]?.error?.message;if(typeof r=="string"&&r.length>0)return r.length>200?r.slice(0,200)+"…":r}}catch{}const t=e.match(/\[.*?\]\s*(.+)/);if(t){const n=t[1];return n.length>200?n.slice(0,200)+"…":n}return e.length>200?e.slice(0,200)+"…":e}function rte(e){switch(e.status){case fn.queued:return"Waiting for execution slot.";case fn.running:return"Provider queries in progress.";case fn.completed:return"All key phrases checked.";case fn.partial:return"Run completed with some key phrases skipped.";case fn.failed:return e.error?D5(e.error):"Run failed.";case fn.cancelled:return"Run was cancelled.";default:return""}}function ite(e){const t=nN(e.kind);switch(e.status){case fn.queued:return`${t} queued`;case fn.running:return`${t} in progress`;case fn.completed:return`${t} completed`;case fn.partial:return`${t} partially completed`;case fn.failed:return`${t} failed`;case fn.cancelled:return`${t} cancelled`;default:return e.status}}function I5(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const a of e){const o=a.keyword??a.id;t.has(o)||t.set(o,!1),a.citationState==="cited"&&t.set(o,!0)}const n=t.size,r=[...t.values()].filter(Boolean).length;return{score:n>0?Math.round(r/n*100):0,citedCount:r,totalCount:n}}function L5(e){return e>=70?"positive":e>=40?"caution":"negative"}function ate(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function ste(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function ote(e){if(e.length===0)return{label:"Gap Key Phrases",value:"No data",delta:"Run a sweep first",tone:"neutral",description:"Run a visibility sweep to identify key phrases where competitors are cited and your domain is not.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[]};const t=new Map;for(const a of e){const o=a.keywordId,c=t.get(o)??{cited:!1,competitorOverlap:new Set};a.citationState==="cited"&&(c.cited=!0);for(const d of a.competitorOverlap)c.competitorOverlap.add(d);t.set(o,c)}const n=t.size,r=[...t.values()].filter(a=>!a.cited&&a.competitorOverlap.size>0).length,i=r===1?"key phrase":"key phrases";return{label:"Gap Key Phrases",value:`${r}`,delta:`${r} of ${n} key phrases at risk`,tone:ste(r,n),description:r>0?`${r} tracked ${i} currently cite competitors without citing your domain.`:"No competitive key phrase gaps detected in the latest visibility run.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[],progress:n>0?r/n:0}}function lte(e,t){return e&&e.summary.total>0?{provider:"Google",...e.summary}:t&&t.summary.total>0?{provider:"Bing",...t.summary,deindexed:0}:e?{provider:"Google",...e.summary}:t?{provider:"Bing",...t.summary,deindexed:0}:null}function cte(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function ute(e,t){const n=lte(e,t);if(!n||n.total===0)return{label:"Index Coverage",value:"No data",delta:"Connect GSC or Bing",tone:"neutral",description:"Connect Google Search Console or Bing Webmaster Tools and inspect your sitemap to populate coverage.",tooltip:"Percentage of inspected URLs currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used.",trend:[]};const r=n.notIndexed===1?"URL is":"URLs are",i=n.deindexed===1?"URL":"URLs";return{label:"Index Coverage",value:`${Math.round(n.percentage)}`,delta:`${n.provider} · ${n.indexed} of ${n.total} indexed`,tone:cte(n),description:n.provider==="Google"&&n.deindexed>0?`${n.deindexed} deindexed ${i} detected in the latest Google Search Console inspection.`:`${n.notIndexed} ${r} not indexed in ${n.provider==="Google"?"Google Search Console":"Bing Webmaster Tools"}.`,tooltip:"Percentage of inspected URLs currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used.",trend:[]}}function $5(e,t){if(e.length===0||t.length===0)return{label:"None",count:0};const n=new Set(t);let r=0;for(const a of e)a.competitorOverlap.some(o=>n.has(o))&&r++;const i=r/e.length;return i>=.5?{label:"High",count:r}:i>=.2?{label:"Moderate",count:r}:{label:"Low",count:r}}function dte(e,t,n,r){const i=[];let a=0;const o=new Set;if(n){const c=new Map;for(const y of n.snapshots)if(y.keyword){const v=`${y.keyword}::${y.provider}`;c.set(v,y)}const d=new Set(n.snapshots.map(y=>y.provider)),f=new Set(t.flatMap(y=>Object.keys(y.providerRuns??{}))),p=[...new Set([...d,...f])].sort(),m=p.length>0?p:["gemini"];for(const y of t){if(y.runs.length===0)continue;o.add(y.keyword);const v=y.runs.at(-1),x=v?.transition??"not-cited";for(const w of m){const j=c.get(`${y.keyword}::${w}`),k=(y.providerRuns?.[w]?.length??0)>0;if(!j&&!k)continue;const O=j?.model??null,_=O?`${w}:${O}`:null,C=_?y.modelRuns?.[_]:void 0,P=y.providerRuns?.[w],T=(P?.length?P:null)??(C?.length?C:null),A=P?.length?"provider":C?.length?"model":"keyword",z=T?T.at(-1).transition:x,I=T?T.at(-1).visibilityTransition??(T.at(-1).visibilityState==="visible"?"visible":"not-visible"):v?.visibilityTransition??(v?.visibilityState==="visible"?"visible":"not-visible"),q=T?.at(-1)?.citationState,U=T?.at(-1)?.visibilityState,L=j?z==="lost"?"lost":z==="emerging"?"emerging":j.citationState==="cited"?"cited":"not-cited":q==="cited"?"cited":"not-cited",J=j?.visibilityState??(U==="visible"?"visible":U==="pending"?"pending":"not-visible"),ae=KS(T||y.runs),Q=i2(T||y.runs),K=fte(y,w),X=(T??y.runs).map(F=>({runId:F.runId,citationState:F.citationState,createdAt:F.createdAt,model:K.get(F.runId)??null,answerMentioned:F.answerMentioned,visibilityState:F.visibilityState,visibilityTransition:F.visibilityTransition})),ye=hte(X),Se=A==="provider"&&ye.length<=1?"model":A,R=pte(X);i.push({id:`evidence_${e}_${a++}`,keyword:y.keyword,provider:j?.provider??w,model:j?.model??null,location:j?.location??null,citationState:L,answerMentioned:j?.answerMentioned,visibilityState:J,visibilityChangeLabel:a2(I,Q,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:a2(z,ae),answerSnippet:j?.answerText??"",citedDomains:j?.citedDomains??[],evidenceUrls:[],competitorDomains:j?.competitorOverlap??[],recommendedCompetitors:j?.recommendedCompetitors??[],matchedTerms:j?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:j?.groundingSources??[],summary:mte(J,I,y.keyword),runHistory:X,historyScope:Se,modelsSeen:ye,modelTransitions:R})}}}for(const c of r)o.has(c.keyword)||i.push({id:`evidence_${e}_${a++}`,keyword:c.keyword,provider:"",model:null,location:null,citationState:"pending",visibilityState:"pending",visibilityChangeLabel:"Awaiting first run",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${c.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return i}function fte(e,t){const n=new Map,r=`${t}:`;for(const[i,a]of Object.entries(e.modelRuns??{})){if(!i.startsWith(r))continue;const o=i.slice(r.length),c=o==="unknown"?null:o;for(const d of a)n.set(d.runId,c)}return n}function hte(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function pte(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 KS(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 i2(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 a2(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?`${Ud(r.positive)} in latest run`:`${Ud(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return Ud(r.first);case"not-cited":case"not-visible":return t<=1?`${Ud(r.negative)} in latest run`:`${Ud(r.negative)} across ${t} runs`;default:return e}}function Ud(e){return e.charAt(0).toUpperCase()+e.slice(1)}function mte(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 s2(e,t){const n=new Set(t),r=new Map;for(const i of e)if(i.keyword)for(const a of i.competitorOverlap){if(!n.has(a))continue;const o=r.get(a)??new Set;o.add(i.keyword),r.set(a,o)}return r}const kx=3;function gte(e){const{evidence:t,timeline:n,latestSnapshots:r,previousSnapshots:i,trackedCompetitors:a}=e,o=[],c=[],d=new Set;for(const k of t)k.citationState==="lost"&&(d.has(k.keyword)||(d.add(k.keyword),c.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"lost"})));c.length>0&&o.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${c.length} key phrase${c.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:c});const f=s2(r,a),p=s2(i,a);for(const k of a){const O=f.get(k)??new Set,_=p.get(k)??new Set,C=[...O].filter(P=>!_.has(P));C.length>0&&o.push({id:`insight_comp_gained_${k}`,tone:"negative",title:`${k} appeared on ${C.length} key phrase${C.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:C.map(P=>{const T=t.find(A=>A.keyword===P);return{keyword:P,evidenceId:T?.id??"",citationState:"cited"}})})}const m=new Map;for(const k of n){const O=k.runs.at(-1);O&&m.set(k.keyword,{transition:O.transition,citationState:O.citationState})}const y=[],v=[],x=new Set;for(const[k,{transition:O,citationState:_}]of m){if(!(O==="emerging"||O==="new"&&_==="cited"))continue;x.add(k);const P=t.find(T=>T.keyword===k&&(T.citationState==="emerging"||T.citationState==="cited"));y.push({keyword:k,evidenceId:P?.id??"",provider:P?.provider,citationState:"emerging"})}for(const k of t)k.citationState==="emerging"&&(x.has(k.keyword)||v.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"emerging"}));if(v.length>0){const k=new Set(v.map(O=>O.keyword)).size;o.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${k} key phrase${k>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:v})}y.length>0&&o.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${x.size} key phrase${x.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:y});const w=new Set(t.map(k=>k.keyword)),j=[];for(const k of n){if(!w.has(k.keyword)||k.runs.length<kx||k.runs.at(-1)?.citationState!=="not-cited")continue;if(KS(k.runs)>=kx){const C=t.find(P=>P.keyword===k.keyword);j.push({keyword:k.keyword,evidenceId:C?.id??"",citationState:"not-cited"})}}j.length>0&&o.push({id:"insight_persistent_gap",tone:"caution",title:`${j.length} key phrase${j.length>1?"s":""} uncited for ${kx}+ runs`,detail:"These key phrases have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:j});for(const k of a){const O=f.get(k)??new Set,C=[...p.get(k)??new Set].filter(P=>!O.has(P));C.length>0&&o.push({id:`insight_comp_lost_${k}`,tone:"neutral",title:`${k} dropped from ${C.length} key phrase${C.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:C.map(P=>{const T=t.find(A=>A.keyword===P);return{keyword:P,evidenceId:T?.id??"",citationState:"not-cited"}})})}return o.length===0&&o.push({id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}),o}function yte(e,t){const n=e.filter(i=>i.id!=="insight_lost"&&i.id!=="insight_stable"),r=[...t,...n];return r.length===0?[{id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}]:r}function vte(e,t){if(t.length===0){const d=new Set(e.filter(f=>f.citationState==="cited").map(f=>f.keyword)).size;return{gained:d,lost:0,tone:d>0?"positive":"neutral",hasPreviousRun:!1}}const n=d=>{const f=new Set;for(const p of d)p.citationState==="cited"&&p.keyword&&f.add(p.keyword);return f},r=n(e),i=n(t);let a=0,o=0;for(const d of r)i.has(d)||a++;for(const d of i)r.has(d)||o++;const c=o>a?"negative":a>o?"positive":"neutral";return{gained:a,lost:o,tone:c,hasPreviousRun:!0}}function bte(e){if(e.length===0)return{label:"Run Status",value:"None",delta:"No runs yet",tone:"neutral",description:"Trigger a visibility sweep to start tracking.",tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]};const n=e.find(d=>d.kind===hn["answer-visibility"])??e[0],r=n.status===fn.completed?"Healthy":n.status===fn.running?"Running":n.status===fn.queued?"Queued":n.status===fn.partial?"Partial":"Failed",i=n.status===fn.completed?"positive":n.status===fn.failed?"negative":n.status===fn.partial?"caution":"neutral",a=e.filter(d=>d.kind===hn["answer-visibility"]).length,o=e.length-a,c=o>0?`${a} ${a===1?"sweep":"sweeps"} · ${o} ${o===1?"sync":"syncs"}`:`${e.length} total runs`;return{label:"Run Status",value:r,delta:c,tone:i,description:`Latest: ${nN(n.kind)} — ${n.status}`,tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]}}function xte(e){const t=M5(e.project),n=dte(t.name,e.timeline,e.latestRunDetail,e.keywords),r=e.runs.filter(A=>A.kind===hn["answer-visibility"]).sort((A,z)=>z.createdAt.localeCompare(A.createdAt))[0],i=r&&e.latestRunDetail?.id===r.id?e.latestRunDetail.snapshots:[],a=I5(i),o=ote(i),c=ute(e.gscCoverage,e.bingCoverage),d=$5(i,e.competitors.map(A=>A.domain)),f=gte({evidence:n,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(A=>A.domain)}),p=e.dbInsights!=null?ete(e.dbInsights):null,m=p!=null?yte(f,p):f,y=[...e.runs].sort((A,z)=>z.createdAt.localeCompare(A.createdAt)),v=y.find(A=>A.kind===hn["answer-visibility"]),x=y.find(A=>A.kind!==hn["answer-visibility"]);if(v&&x){const A=new Date(x.createdAt).getTime()-new Date(v.createdAt).getTime(),z=1440*60*1e3;A>z&&m.push({id:"insight_stale_visibility",tone:"caution",title:"Stale visibility data",detail:`Last visibility sweep was ${qS(v.createdAt)}, but integration syncs have run since. Run a new sweep for current metrics.`,actionLabel:"Stale",affectedPhrases:[]})}const w=y.map(A=>rN(A,e.project.displayName||e.project.name)),j=new Map;for(const A of i){const z=A.provider||"gemini",I=A.model??null,q=`${z}::${I??"unknown"}`,U=j.get(q)??{provider:z,model:I,cited:0,total:0};U.total++,A.citationState==="cited"&&U.cited++,j.set(q,U)}const k=[...j.values()].sort((A,z)=>A.provider.localeCompare(z.provider)||(A.model??"").localeCompare(z.model??"")).map(({provider:A,model:z,cited:I,total:q})=>({provider:A,model:z,score:q>0?Math.round(I/q*100):0,cited:I,total:q})),O=e.project.providers.filter(A=>!A.startsWith("cdp:")),_=new Set(i.map(A=>A.provider)),C=O.filter(A=>_.has(A)).length,P=i.length>0&&O.length>1&&C<O.length,T=P?`${C} of ${O.length} providers`:void 0;return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:i.length>0?`${a.score}`:"No data",delta:i.length>0?`${a.citedCount} of ${a.totalCount} key phrases visible`:"Run a sweep first",tone:i.length>0?P?"caution":L5(a.score):"neutral",description:i.length>0?`${a.citedCount} of ${a.totalCount} tracked key phrases found your domain in at least one AI answer engine.`:"No visibility data yet. Trigger a run to start tracking.",tooltip:'Percentage of tracked key phrases where your domain is cited by at least one AI answer engine. A key phrase is "visible" if any configured provider includes your site in its response.',trend:[],providerCoverage:T},keywordCounts:{cited:a.citedCount,total:a.totalCount},gapKeyPhrases:o,indexCoverage:c,providerScores:k,competitorPressure:{label:"Competitor Pressure",value:d.label,delta:d.count>0?`${d.count} overlapping citations`:"No overlap detected",tone:ate(d.label),description:e.competitors.length>0?`${e.competitors.length} competitor${e.competitors.length>1?"s":""} tracked.`:"No competitors configured.",tooltip:"How often competitor domains appear alongside yours in AI answers. High pressure means competitors are frequently cited for the same key phrases.",trend:[]},runStatus:bte(y),movementSummary:vte(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:m,visibilityEvidence:n,competitors:e.competitors.map((A,z)=>{const I=new Set;for(const ae of i)(ae.competitorOverlap.includes(A.domain)||ae.citedDomains.includes(A.domain))&&ae.keyword&&I.add(ae.keyword);const q=[...I],U=new Set(i.map(ae=>ae.keyword).filter(Boolean)),L=U.size>0?q.length/U.size:0,J=L>=.5?"High":L>=.2?"Moderate":q.length>0?"Low":"None";return{id:A.id||`comp_${z}`,domain:A.domain,citationCount:q.length,totalKeywords:U.size,pressureLabel:J,citedKeywords:q,movement:"",notes:""}}),recentRuns:w.slice(0,5)}}function wte(e){const t=M5(e.project),n=e.runs.filter(x=>x.kind===hn["answer-visibility"]).sort((x,w)=>w.createdAt.localeCompare(x.createdAt))[0],r=n&&e.latestRunDetail?.id===n.id?e.latestRunDetail.snapshots:[],i=I5(r),a=$5(r,e.competitors.map(x=>x.domain)),o=[...e.runs].sort((x,w)=>w.createdAt.localeCompare(x.createdAt)),c=o.find(x=>x.kind===hn["answer-visibility"])??o[0],d=e.project.displayName||e.project.name,f=c?rN(c,d):{id:"none",projectId:e.project.id,projectName:d,kind:hn["answer-visibility"],kindLabel:"No runs yet",status:fn.queued,trigger:Im.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""},p=e.project.providers.filter(x=>!x.startsWith("cdp:")),m=new Set(r.map(x=>x.provider)),y=p.filter(x=>m.has(x)).length,v=r.length>0&&p.length>1&&y<p.length;return{project:t,visibilityScore:i.score,visibilityDelta:r.length>0?`${i.citedCount} of ${i.totalCount} key phrases`:"No data",visibilityTone:r.length>0?v?"caution":L5(i.score):"neutral",providerCoverage:v?`${y} of ${p.length} providers`:void 0,lastRun:f,insight:r.length>0?`${i.citedCount} of ${i.totalCount} key phrases visible across ${new Set(r.map(x=>x.provider)).size} provider${new Set(r.map(x=>x.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:a.label}}function Ste(e,t){const n=[],r=[],i=[];for(const o of e){r.push(xte(o)),i.push(wte(o));const c=[...o.runs].sort((d,f)=>f.createdAt.localeCompare(d.createdAt));for(const d of c)n.push(rN(d,o.project.displayName||o.project.name))}n.sort((o,c)=>c.createdAt.localeCompare(o.createdAt));const a=e.length>0;return{portfolioOverview:{projects:i,attentionItems:a?jte(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 key phrase set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:r,runs:n,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},keywordImportState:{mode:"paste",keywordCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:a,ctaLabel:a?"Trigger run":"Create a project first",summary:a?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(o=>({name:o.name,displayName:o.displayName,keyUrl:o.keyUrl,modelHint:o.modelHint,model:o.model,state:o.configured?"ready":"needs-config",detail:o.configured?"Provider is configured.":"API key is missing.",quota:o.quota})),google:{state:t?.google?.configured?"ready":"needs-config",detail:t?.google?.configured?"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard.":"Google OAuth client ID and client secret are not configured yet."},bing:{state:t?.bing?.configured?"ready":"needs-config",detail:t?.bing?.configured?"Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.":"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}}}function jte(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} key phrase${r.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${n.project.id}`});const i=n.recentRuns.filter(a=>a.status===fn.running||a.status===fn.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 Ar={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],keywords:e=>["projects",e,"keywords"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"],agent:{providers:e=>["agent",e,"providers"]}},U5=S.createContext(null);U5.Provider;function Xf(){return S.useContext(U5)}function Ul(e){const n=Xf()?.dashboard??null,r=es({queryKey:Ar.projects.all,queryFn:zj,enabled:!n}),i=es({queryKey:Ar.runs.all,queryFn:NI,enabled:!n,refetchInterval:x=>x.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:!1}),a=es({queryKey:Ar.settings,queryFn:()=>Rj().catch(()=>null),enabled:!n}),o=r.data??[],c=i.data??[],d=dq({queries:o.map(x=>{const w=c.filter(k=>k.projectId===x.id),j=w.filter(k=>(k.status==="completed"||k.status==="partial")&&k.kind==="answer-visibility").sort((k,O)=>O.createdAt.localeCompare(k.createdAt));return{queryKey:Ar.projects.detail(x.id,j[0]?.id),queryFn:async()=>{const k=j[0]?.id,[O,_,C,P,T,A,z,I]=await Promise.all([bH(x.name).catch(()=>[]),kI(x.name).catch(()=>[]),CI(x.name).catch(()=>[]),k?uu(k).catch(()=>null):Promise.resolve(null),j[1]?uu(j[1].id).catch(()=>null):Promise.resolve(null),Mj(x.name).catch(()=>null),Dj(x.name).catch(()=>null),k?p7(x.name,k).catch(()=>null):Promise.resolve(null)]);return{project:x,runs:w,keywords:O,competitors:_,timeline:C,latestRunDetail:P,previousRunDetail:T,gscCoverage:A,bingCoverage:z,dbInsights:I}},enabled:!n&&r.isSuccess&&i.isSuccess}})}),f=d.every(x=>x.isSuccess),p=S.useMemo(()=>{if(n)return n;if(!r.data||!i.data||o.length>0&&!f)return null;const x=d.map(w=>w.data).filter(w=>w!=null);return Ste(x,a.data??null)},[n,r.data,i.data,a.data,f,d,o.length]),m=!n&&(r.isError||i.isError),y=!n&&!p&&!m,v=S.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 Nte(){const e=await m7("/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 Dy(e,t){return es({queryKey:Ar.health,queryFn:Nte,enabled:e,refetchInterval:15e3,initialData:t})}function kte(e){return es({queryKey:Ar.runs.detail(e??""),queryFn:()=>uu(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function Au(){const e=yo(),t=jy({strict:!1}),n=Tr({select:d=>d.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:d=>e({to:n,from:Hi.to,search:f=>({...f,runId:d,evidenceId:void 0})}),openEvidence:d=>e({to:n,from:Hi.to,search:f=>({...f,evidenceId:d,runId:void 0})}),closeDrawer:()=>e({to:n,from:Hi.to,search:d=>({...d,runId:void 0,evidenceId:void 0})})}}const Cte={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function _te(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function Ate(){const e=S.useSyncExternalStore(w7,rT,rT),t=yo(),{openRun:n}=Au(),r=S.useCallback(a=>{PS(a)},[]),i=S.useCallback(a=>{a.cta&&(a.cta.intent==="open-run-drawer"?n(a.cta.runId):t({to:"/runs"}),PS(a.id))},[t,n]);return e.length===0?null:u.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(a=>u.jsxs("section",{role:a.tone==="negative"?"alert":"status","aria-live":a.tone==="negative"?"assertive":"polite","data-state":a.state,className:`toast-card ${Cte[a.tone]}`,children:[u.jsxs("div",{className:"toast-copy",children:[u.jsx("p",{className:"toast-title",children:a.title}),a.detail?u.jsx("p",{className:"toast-detail",children:a.detail}):null,a.cta?u.jsx("button",{type:"button",className:"toast-action",onClick:()=>i(a),"aria-label":_te(a),children:a.cta.label}):null]}),u.jsx("button",{type:"button",onClick:()=>r(a.id),className:"toast-dismiss","aria-label":"Dismiss",children:u.jsx(Wf,{className:"size-3.5"})})]},a.id))})}function Ote(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ete=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Tte=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pte={};function o2(e,t){return(Pte.jsx?Tte:Ete).test(e)}const zte=/[ \t\n\f\r]/g;function Rte(e){return typeof e=="object"?e.type==="text"?l2(e.value):!1:l2(e)}function l2(e){return e.replace(zte,"")===""}let Jf=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Jf.prototype.normal={};Jf.prototype.property={};Jf.prototype.space=void 0;function B5(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Jf(n,r,t)}function HS(e){return e.toLowerCase()}class Mr{constructor(t,n){this.attribute=n,this.property=t}}Mr.prototype.attribute="";Mr.prototype.booleanish=!1;Mr.prototype.boolean=!1;Mr.prototype.commaOrSpaceSeparated=!1;Mr.prototype.commaSeparated=!1;Mr.prototype.defined=!1;Mr.prototype.mustUseProperty=!1;Mr.prototype.number=!1;Mr.prototype.overloadedBoolean=!1;Mr.prototype.property="";Mr.prototype.spaceSeparated=!1;Mr.prototype.space=void 0;let Mte=0;const ot=Bl(),Cn=Bl(),GS=Bl(),ke=Bl(),Ut=Bl(),nu=Bl(),Hr=Bl();function Bl(){return 2**++Mte}const VS=Object.freeze(Object.defineProperty({__proto__:null,boolean:ot,booleanish:Cn,commaOrSpaceSeparated:Hr,commaSeparated:nu,number:ke,overloadedBoolean:GS,spaceSeparated:Ut},Symbol.toStringTag,{value:"Module"})),Cx=Object.keys(VS);class iN extends Mr{constructor(t,n,r,i){let a=-1;if(super(t,n),c2(this,"space",i),typeof r=="number")for(;++a<Cx.length;){const o=Cx[a];c2(this,Cx[a],(r&VS[o])===VS[o])}}}iN.prototype.defined=!0;function c2(e,t,n){n&&(e[t]=n)}function Ou(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new iN(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[HS(r)]=r,n[HS(a.attribute)]=r}return new Jf(t,n,e.space)}const F5=Ou({properties:{ariaActiveDescendant:null,ariaAtomic:Cn,ariaAutoComplete:null,ariaBusy:Cn,ariaChecked:Cn,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:Ut,ariaCurrent:null,ariaDescribedBy:Ut,ariaDetails:null,ariaDisabled:Cn,ariaDropEffect:Ut,ariaErrorMessage:null,ariaExpanded:Cn,ariaFlowTo:Ut,ariaGrabbed:Cn,ariaHasPopup:null,ariaHidden:Cn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ut,ariaLevel:ke,ariaLive:null,ariaModal:Cn,ariaMultiLine:Cn,ariaMultiSelectable:Cn,ariaOrientation:null,ariaOwns:Ut,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:Cn,ariaReadOnly:Cn,ariaRelevant:null,ariaRequired:Cn,ariaRoleDescription:Ut,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:Cn,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function q5(e,t){return t in e?e[t]:t}function K5(e,t){return q5(e,t.toLowerCase())}const Dte=Ou({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:nu,acceptCharset:Ut,accessKey:Ut,action:null,allow:null,allowFullScreen:ot,allowPaymentRequest:ot,allowUserMedia:ot,alt:null,as:null,async:ot,autoCapitalize:null,autoComplete:Ut,autoFocus:ot,autoPlay:ot,blocking:Ut,capture:null,charSet:null,checked:ot,cite:null,className:Ut,cols:ke,colSpan:null,content:null,contentEditable:Cn,controls:ot,controlsList:Ut,coords:ke|nu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ot,defer:ot,dir:null,dirName:null,disabled:ot,download:GS,draggable:Cn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ot,formTarget:null,headers:Ut,height:ke,hidden:GS,high:ke,href:null,hrefLang:null,htmlFor:Ut,httpEquiv:Ut,id:null,imageSizes:null,imageSrcSet:null,inert:ot,inputMode:null,integrity:null,is:null,isMap:ot,itemId:null,itemProp:Ut,itemRef:Ut,itemScope:ot,itemType:Ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ot,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:ot,muted:ot,name:null,nonce:null,noModule:ot,noValidate:ot,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:ot,optimum:ke,pattern:null,ping:Ut,placeholder:null,playsInline:ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ot,referrerPolicy:null,rel:Ut,required:ot,reversed:ot,rows:ke,rowSpan:ke,sandbox:Ut,scope:null,scoped:ot,seamless:ot,selected:ot,shadowRootClonable:ot,shadowRootDelegatesFocus:ot,shadowRootMode:null,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:Cn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:ot,useMap:null,value:Cn,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ut,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ot,declare:ot,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:ot,noHref:ot,noShade:ot,noWrap:ot,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:Cn,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ot,disableRemotePlayback:ot,prefix:null,property:null,results:ke,security:null,unselectable:null},space:"html",transform:K5}),Ite=Ou({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:Hr,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:Ut,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:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,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:nu,g2:nu,glyphName:nu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:Hr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,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:ke,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:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Hr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Hr,rev:Hr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Hr,requiredFeatures:Hr,requiredFonts:Hr,requiredFormats:Hr,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:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:Hr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Hr,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Hr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:q5}),H5=Ou({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()}}),G5=Ou({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:K5}),V5=Ou({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Lte={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"},$te=/[A-Z]/g,u2=/-[a-z]/g,Ute=/^data[-\w.:]+$/i;function Bte(e,t){const n=HS(t);let r=t,i=Mr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ute.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(u2,qte);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!u2.test(a)){let o=a.replace($te,Fte);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=iN}return new i(r,t)}function Fte(e){return"-"+e.toLowerCase()}function qte(e){return e.charAt(1).toUpperCase()}const Kte=B5([F5,Dte,H5,G5,V5],"html"),aN=B5([F5,Ite,H5,G5,V5],"svg");function Hte(e){return e.join(" ").trim()}var Tc={},_x,d2;function Gte(){if(d2)return _x;d2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
97
|
-
`,f="/",p="*",m="",y="comment",v="declaration";function x(j,k){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];k=k||{};var O=1,_=1;function C(ae){var Q=ae.match(t);Q&&(O+=Q.length);var K=ae.lastIndexOf(d);_=~K?ae.length-K:_+ae.length}function P(){var ae={line:O,column:_};return function(Q){return Q.position=new T(ae),I(),Q}}function T(ae){this.start=ae,this.end={line:O,column:_},this.source=k.source}T.prototype.content=j;function A(ae){var Q=new Error(k.source+":"+O+":"+_+": "+ae);if(Q.reason=ae,Q.filename=k.source,Q.line=O,Q.column=_,Q.source=j,!k.silent)throw Q}function z(ae){var Q=ae.exec(j);if(Q){var K=Q[0];return C(K),j=j.slice(K.length),Q}}function I(){z(n)}function q(ae){var Q;for(ae=ae||[];Q=U();)Q!==!1&&ae.push(Q);return ae}function U(){var ae=P();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 A("End of comment missing");var K=j.slice(2,Q-2);return _+=2,C(K),j=j.slice(Q),_+=2,ae({type:y,comment:K})}}function L(){var ae=P(),Q=z(r);if(Q){if(U(),!z(i))return A("property missing ':'");var K=z(a),X=ae({type:v,property:w(Q[0].replace(e,m)),value:K?w(K[0].replace(e,m)):m});return z(o),X}}function J(){var ae=[];q(ae);for(var Q;Q=L();)Q!==!1&&(ae.push(Q),q(ae));return ae}return I(),J()}function w(j){return j?j.replace(c,m):m}return _x=x,_x}var f2;function Vte(){if(f2)return Tc;f2=1;var e=Tc&&Tc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.default=n;const t=e(Gte());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),c=typeof i=="function";return o.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 Tc}var Bd={},h2;function Zte(){if(h2)return Bd;h2=1,Object.defineProperty(Bd,"__esModule",{value:!0}),Bd.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},o=function(f,p){return p.toUpperCase()},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,o))};return Bd.camelCase=d,Bd}var Fd,p2;function Yte(){if(p2)return Fd;p2=1;var e=Fd&&Fd.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Vte()),n=Zte();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(c,d){c&&d&&(o[(0,n.camelCase)(c,a)]=d)}),o}return r.default=r,Fd=r,Fd}var Wte=Yte();const Qte=wa(Wte),Z5=Y5("end"),sN=Y5("start");function Y5(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 Xte(e){const t=sN(e),n=Z5(e);if(t&&n)return{start:t,end:n}}function ff(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?m2(e.position):"start"in e||"end"in e?m2(e):"line"in e||"column"in e?ZS(e):""}function ZS(e){return g2(e&&e.line)+":"+g2(e&&e.column)}function m2(e){return ZS(e&&e.start)+"-"+ZS(e&&e.end)}function g2(e){return e&&typeof e=="number"?e:1}class sr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const 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=ff(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}sr.prototype.file="";sr.prototype.name="";sr.prototype.reason="";sr.prototype.message="";sr.prototype.stack="";sr.prototype.column=void 0;sr.prototype.line=void 0;sr.prototype.ancestors=void 0;sr.prototype.cause=void 0;sr.prototype.fatal=void 0;sr.prototype.place=void 0;sr.prototype.ruleId=void 0;sr.prototype.source=void 0;const oN={}.hasOwnProperty,Jte=new Map,ene=/[A-Z]/g,tne=new Set(["table","tbody","thead","tfoot","tr"]),nne=new Set(["td","th"]),W5="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function rne(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=dne(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=une(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"?aN:Kte,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Q5(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Q5(e,t,n){if(t.type==="element")return ine(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ane(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return one(e,t,n);if(t.type==="mdxjsEsm")return sne(e,t);if(t.type==="root")return lne(e,t,n);if(t.type==="text")return cne(e,t)}function ine(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=aN,e.schema=i),e.ancestors.push(t);const a=J5(e,t.tagName,!1),o=fne(e,t);let c=cN(e,t);return tne.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!Rte(d):!0})),X5(e,o,a,t),lN(o,c),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ane(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)}Of(e,t.position)}function sne(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Of(e,t.position)}function one(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=aN,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:J5(e,t.name,!0),o=hne(e,t),c=cN(e,t);return X5(e,o,a,t),lN(o,c),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function lne(e,t,n){const r={};return lN(r,cN(e,t)),e.create(t,e.Fragment,r,n)}function cne(e,t){return t.value}function X5(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function lN(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function une(e,t,n){return r;function r(i,a,o,c){const f=Array.isArray(o.children)?n:t;return c?f(a,o,c):f(a,o)}}function dne(e,t){return n;function n(r,i,a,o){const c=Array.isArray(a.children),d=sN(r);return t(i,a,o,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function fne(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&oN.call(t.properties,i)){const a=pne(e,i,t.properties[i]);if(a){const[o,c]=a;e.tableCellAlignToStyle&&o==="align"&&typeof c=="string"&&nne.has(t.tagName)?r=c:n[o]=c}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function hne(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const c=o.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Of(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 Of(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function cN(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Jte;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=i.get(d)||0;o=d+"-"+f,i.set(d,f+1)}}const c=Q5(e,a,o);c!==void 0&&n.push(c)}return n}function pne(e,t,n){const r=Bte(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ote(n):Hte(n)),r.property==="style"){let i=typeof n=="object"?n:mne(e,String(n));return e.stylePropertyNameCase==="css"&&(i=gne(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Lte[r.property]||r.property:r.attribute,n]}}function mne(e,t){try{return Qte(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new sr("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=W5+"#cannot-parse-style-attribute",i}}function J5(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const c=o2(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}r=o}else r=o2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return oN.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Of(e)}function Of(e,t){const n=new sr("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=W5+"#cannot-handle-mdx-estrees-without-createevaluater",n}function gne(e){const t={};let n;for(n in e)oN.call(e,n)&&(t[yne(n)]=e[n]);return t}function yne(e){let t=e.replace(ene,vne);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function vne(e){return"-"+e.toLowerCase()}const Ax={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"]},bne={};function xne(e,t){const n=bne,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return e$(e,r,i)}function e$(e,t,n){if(wne(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 y2(e.children,t,n)}return Array.isArray(e)?y2(e,t,n):""}function y2(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=e$(e[i],t,n);return r.join("")}function wne(e){return!!(e&&typeof e=="object")}const v2=document.createElement("i");function uN(e){const t="&"+e+";";v2.innerHTML=t;const n=v2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ma(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function yi(e,t){return e.length>0?(ma(e,e.length,0,t),e):t}const b2={}.hasOwnProperty;function Sne(e){const t={};let n=-1;for(;++n<e.length;)jne(t,e[n]);return t}function jne(e,t){let n;for(n in t){const i=(b2.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){b2.call(i,o)||(i[o]=[]);const c=a[o];Nne(i[o],Array.isArray(c)?c:c?[c]:[])}}}function Nne(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ma(e,0,0,r)}function t$(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 ru(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ua=wo(/[A-Za-z]/),Vr=wo(/[\dA-Za-z]/),kne=wo(/[#-'*+\--9=?A-Z^-~]/);function YS(e){return e!==null&&(e<32||e===127)}const WS=wo(/\d/),Cne=wo(/[\dA-Fa-f]/),_ne=wo(/[!-/:-@[-`{-~]/);function Ye(e){return e!==null&&e<-2}function Pr(e){return e!==null&&(e<0||e===32)}function jt(e){return e===-2||e===-1||e===32}const Ane=wo(new RegExp("\\p{P}|\\p{S}","u")),One=wo(/\s/);function wo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Eu(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&Vr(e.charCodeAt(n+1))&&Vr(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(o=String.fromCharCode(a,c),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function qt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(d){return jt(d)?(e.enter(n),c(d)):t(d)}function c(d){return jt(d)&&a++<i?(e.consume(d),c):(e.exit(n),t(d))}}const Ene={tokenize:Tne};function Tne(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"),qt(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,o(c)}function o(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Ye(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),o)}}const Pne={tokenize:zne},x2={tokenize:Rne};function zne(e){const t=this,n=[];let r=0,i,a,o;return c;function c(_){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,d,f)(_)}return f(_)}function d(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&O();const C=t.events.length;let P=C,T;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){T=t.events[P][1].end;break}k(r);let A=C;for(;A<t.events.length;)t.events[A][1].end={...T},A++;return ma(t.events,P+1,0,t.events.slice(C)),t.events.length=A,f(_)}return c(_)}function f(_){if(r===n.length){if(!i)return y(_);if(i.currentConstruct&&i.currentConstruct.concrete)return x(_);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(x2,p,m)(_)}function p(_){return i&&O(),k(r),y(_)}function m(_){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,x(_)}function y(_){return t.containerState={},e.attempt(x2,v,x)(_)}function v(_){return r++,n.push([t.currentConstruct,t.containerState]),y(_)}function x(_){if(_===null){i&&O(),k(0),e.consume(_);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),w(_)}function w(_){if(_===null){j(e.exit("chunkFlow"),!0),k(0),e.consume(_);return}return Ye(_)?(e.consume(_),j(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(_),w)}function j(_,C){const P=t.sliceStream(_);if(C&&P.push(null),_.previous=a,a&&(a.next=_),a=_,i.defineSkip(_.start),i.write(P),t.parser.lazy[_.start.line]){let T=i.events.length;for(;T--;)if(i.events[T][1].start.offset<o&&(!i.events[T][1].end||i.events[T][1].end.offset>o))return;const A=t.events.length;let z=A,I,q;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){if(I){q=t.events[z][1].end;break}I=!0}for(k(r),T=A;T<t.events.length;)t.events[T][1].end={...q},T++;ma(t.events,z+1,0,t.events.slice(A)),t.events.length=T}}function k(_){let C=n.length;for(;C-- >_;){const P=n[C];t.containerState=P[1],P[0].exit.call(t,e)}n.length=_}function O(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Rne(e,t,n){return qt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function w2(e){if(e===null||Pr(e)||One(e))return 1;if(Ane(e))return 2}function dN(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 QS={name:"attention",resolveAll:Mne,tokenize:Dne};function Mne(e,t){let n=-1,r,i,a,o,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};S2(m,-d),S2(y,d),o={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:{...o.start},end:{...c.end}},e[r][1].end={...o.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=yi(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=yi(f,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),f=yi(f,dN(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=yi(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=yi(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,ma(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 Dne(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=w2(r);let a;return o;function o(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=w2(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 S2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ine={name:"autolink",tokenize:Lne};function Lne(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 ua(v)?(e.consume(v),o):v===64?n(v):f(v)}function o(v){return v===43||v===45||v===46||Vr(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||Vr(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||YS(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):kne(v)?(e.consume(v),f):n(v)}function p(v){return Vr(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||Vr(v))&&r++<63){const x=v===45?y:m;return e.consume(v),x}return n(v)}}const Iy={partial:!0,tokenize:$ne};function $ne(e,t,n){return r;function r(a){return jt(a)?qt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Ye(a)?t(a):n(a)}}const n$={continuation:{tokenize:Bne},exit:Fne,name:"blockQuote",tokenize:Une};function Une(e,t,n){const r=this;return i;function i(o){if(o===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return jt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Bne(e,t,n){const r=this;return i;function i(o){return jt(o)?qt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(n$,t,n)(o)}}function Fne(e){e.exit("blockQuote")}const r$={name:"characterEscape",tokenize:qne};function qne(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 _ne(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const i$={name:"characterReference",tokenize:Kne};function Kne(e,t,n){const r=this;let i=0,a,o;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,o=Vr,p(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=Cne,p):(e.enter("characterReferenceValue"),a=7,o=WS,p(m))}function p(m){if(m===59&&i){const y=e.exit("characterReferenceValue");return o===Vr&&!uN(r.sliceSerialize(y))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(m)&&i++<a?(e.consume(m),p):n(m)}}const j2={partial:!0,tokenize:Gne},N2={concrete:!0,name:"codeFenced",tokenize:Hne};function Hne(e,t,n){const r=this,i={partial:!0,tokenize:P};let a=0,o=0,c;return d;function d(T){return f(T)}function f(T){const A=r.events[r.events.length-1];return a=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,c=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(T)}function p(T){return T===c?(o++,e.consume(T),p):o<3?n(T):(e.exit("codeFencedFenceSequence"),jt(T)?qt(e,m,"whitespace")(T):m(T))}function m(T){return T===null||Ye(T)?(e.exit("codeFencedFence"),r.interrupt?t(T):e.check(j2,w,C)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(T))}function y(T){return T===null||Ye(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(T)):jt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qt(e,v,"whitespace")(T)):T===96&&T===c?n(T):(e.consume(T),y)}function v(T){return T===null||Ye(T)?m(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(T))}function x(T){return T===null||Ye(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(T)):T===96&&T===c?n(T):(e.consume(T),x)}function w(T){return e.attempt(i,C,j)(T)}function j(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),k}function k(T){return a>0&&jt(T)?qt(e,O,"linePrefix",a+1)(T):O(T)}function O(T){return T===null||Ye(T)?e.check(j2,w,C)(T):(e.enter("codeFlowValue"),_(T))}function _(T){return T===null||Ye(T)?(e.exit("codeFlowValue"),O(T)):(e.consume(T),_)}function C(T){return e.exit("codeFenced"),t(T)}function P(T,A,z){let I=0;return q;function q(Q){return T.enter("lineEnding"),T.consume(Q),T.exit("lineEnding"),U}function U(Q){return T.enter("codeFencedFence"),jt(Q)?qt(T,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):L(Q)}function L(Q){return Q===c?(T.enter("codeFencedFenceSequence"),J(Q)):z(Q)}function J(Q){return Q===c?(I++,T.consume(Q),J):I>=o?(T.exit("codeFencedFenceSequence"),jt(Q)?qt(T,ae,"whitespace")(Q):ae(Q)):z(Q)}function ae(Q){return Q===null||Ye(Q)?(T.exit("codeFencedFence"),A(Q)):z(Q)}}}function Gne(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Ox={name:"codeIndented",tokenize:Zne},Vne={partial:!0,tokenize:Yne};function Zne(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),qt(e,a,"linePrefix",5)(f)}function a(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(f):n(f)}function o(f){return f===null?d(f):Ye(f)?e.attempt(Vne,o,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||Ye(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function Yne(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Ye(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):qt(e,a,"linePrefix",5)(o)}function a(o){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):Ye(o)?i(o):n(o)}}const Wne={name:"codeText",previous:Xne,resolve:Qne,tokenize:Jne};function Qne(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 Xne(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Jne(e,t,n){let r=0,i,a;return o;function o(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)):Ye(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||Ye(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 ere{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&&qd(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),qd(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),qd(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);qd(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);qd(this.left,n.reverse())}}}function qd(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 a$(e){const t={};let n=-1,r,i,a,o,c,d,f;const p=new ere(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,tre(p,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=p.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},c=p.slice(i,n),c.unshift(r),p.splice(i,n-i+1,c))}}return ma(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function tre(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const c=o.events,d=[],f={};let p,m,y=-1,v=n,x=0,w=0;const j=[w];for(;v;){for(;e.get(++i)[1]!==v;);a.push(i),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),m&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(p),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++y<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&&(w=y+1,j.push(w),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(o.events=[],v?(v._tokenizer=void 0,v.previous=void 0):j.pop(),y=j.length;y--;){const k=c.slice(j[y],j[y+1]),O=a.pop();d.push([O,O+k.length-1]),e.splice(O,2,k)}for(d.reverse(),y=-1;++y<d.length;)f[x+d[y][0]]=x+d[y][1],x+=d[y][1]-d[y][0]-1;return f}const nre={resolve:ire,tokenize:are},rre={partial:!0,tokenize:sre};function ire(e){return a$(e),e}function are(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):Ye(c)?e.check(rre,o,a)(c):(e.consume(c),i)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function o(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function sre(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),qt(e,a,"linePrefix")}function a(o){if(o===null||Ye(o))return n(o);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(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function s$(e,t,n,r,i,a,o,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||YS(k)?n(k):(e.enter(r),e.enter(o),e.enter(c),e.enter("chunkString",{contentType:"string"}),w(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||Ye(k)?n(k):(e.consume(k),k===92?x:v)}function x(k){return k===60||k===62||k===92?(e.consume(k),v):v(k)}function w(k){return!p&&(k===null||k===41||Pr(k))?(e.exit("chunkString"),e.exit(c),e.exit(o),e.exit(r),t(k)):p<f&&k===40?(e.consume(k),p++,w):k===41?(e.consume(k),p--,w):k===null||k===32||k===40||YS(k)?n(k):(e.consume(k),k===92?j:w)}function j(k){return k===40||k===41||k===92?(e.consume(k),w):w(k)}}function o$(e,t,n,r,i,a){const o=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 o.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):Ye(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||Ye(v)||c++>999?(e.exit("chunkString"),p(v)):(e.consume(v),d||(d=!jt(v)),v===92?y:m)}function y(v){return v===91||v===92||v===93?(e.consume(v),c++,m):m(v)}}function l$(e,t,n,r,i,a){let o;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),o=y===40?41:y,d):n(y)}function d(y){return y===o?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(a),f(y))}function f(y){return y===o?(e.exit(a),d(o)):y===null?n(y):Ye(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),qt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===o||y===null||Ye(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?m:p)}function m(y){return y===o||y===92?(e.consume(y),p):p(y)}}function hf(e,t){let n;return r;function r(i){return Ye(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):jt(i)?qt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ore={name:"definition",tokenize:cre},lre={partial:!0,tokenize:ure};function cre(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return o$.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return i=ru(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 Pr(v)?hf(e,f)(v):f(v)}function f(v){return s$(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(lre,m,m)(v)}function m(v){return jt(v)?qt(e,y,"whitespace")(v):y(v)}function y(v){return v===null||Ye(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function ure(e,t,n){return r;function r(c){return Pr(c)?hf(e,i)(c):n(c)}function i(c){return l$(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return jt(c)?qt(e,o,"whitespace")(c):o(c)}function o(c){return c===null||Ye(c)?t(c):n(c)}}const dre={name:"hardBreakEscape",tokenize:fre};function fre(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Ye(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const hre={name:"headingAtx",resolve:pre,tokenize:mre};function pre(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"},ma(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function mre(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):p===null||Pr(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||Ye(p)?(e.exit("atxHeading"),t(p)):jt(p)?qt(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||Pr(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const gre=["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"],k2=["pre","script","style","textarea"],yre={concrete:!0,name:"htmlFlow",resolveTo:xre,tokenize:wre},vre={partial:!0,tokenize:jre},bre={partial:!0,tokenize:Sre};function xre(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 wre(e,t,n){const r=this;let i,a,o,c,d;return f;function f(M){return p(M)}function p(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),m}function m(M){return M===33?(e.consume(M),y):M===47?(e.consume(M),a=!0,w):M===63?(e.consume(M),i=3,r.interrupt?t:R):ua(M)?(e.consume(M),o=String.fromCharCode(M),j):n(M)}function y(M){return M===45?(e.consume(M),i=2,v):M===91?(e.consume(M),i=5,c=0,x):ua(M)?(e.consume(M),i=4,r.interrupt?t:R):n(M)}function v(M){return M===45?(e.consume(M),r.interrupt?t:R):n(M)}function x(M){const V="CDATA[";return M===V.charCodeAt(c++)?(e.consume(M),c===V.length?r.interrupt?t:L:x):n(M)}function w(M){return ua(M)?(e.consume(M),o=String.fromCharCode(M),j):n(M)}function j(M){if(M===null||M===47||M===62||Pr(M)){const V=M===47,se=o.toLowerCase();return!V&&!a&&k2.includes(se)?(i=1,r.interrupt?t(M):L(M)):gre.includes(o.toLowerCase())?(i=6,V?(e.consume(M),k):r.interrupt?t(M):L(M)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):a?O(M):_(M))}return M===45||Vr(M)?(e.consume(M),o+=String.fromCharCode(M),j):n(M)}function k(M){return M===62?(e.consume(M),r.interrupt?t:L):n(M)}function O(M){return jt(M)?(e.consume(M),O):q(M)}function _(M){return M===47?(e.consume(M),q):M===58||M===95||ua(M)?(e.consume(M),C):jt(M)?(e.consume(M),_):q(M)}function C(M){return M===45||M===46||M===58||M===95||Vr(M)?(e.consume(M),C):P(M)}function P(M){return M===61?(e.consume(M),T):jt(M)?(e.consume(M),P):_(M)}function T(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),d=M,A):jt(M)?(e.consume(M),T):z(M)}function A(M){return M===d?(e.consume(M),d=null,I):M===null||Ye(M)?n(M):(e.consume(M),A)}function z(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||Pr(M)?P(M):(e.consume(M),z)}function I(M){return M===47||M===62||jt(M)?_(M):n(M)}function q(M){return M===62?(e.consume(M),U):n(M)}function U(M){return M===null||Ye(M)?L(M):jt(M)?(e.consume(M),U):n(M)}function L(M){return M===45&&i===2?(e.consume(M),K):M===60&&i===1?(e.consume(M),X):M===62&&i===4?(e.consume(M),F):M===63&&i===3?(e.consume(M),R):M===93&&i===5?(e.consume(M),Se):Ye(M)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(vre,B,J)(M)):M===null||Ye(M)?(e.exit("htmlFlowData"),J(M)):(e.consume(M),L)}function J(M){return e.check(bre,ae,B)(M)}function ae(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),Q}function Q(M){return M===null||Ye(M)?J(M):(e.enter("htmlFlowData"),L(M))}function K(M){return M===45?(e.consume(M),R):L(M)}function X(M){return M===47?(e.consume(M),o="",ye):L(M)}function ye(M){if(M===62){const V=o.toLowerCase();return k2.includes(V)?(e.consume(M),F):L(M)}return ua(M)&&o.length<8?(e.consume(M),o+=String.fromCharCode(M),ye):L(M)}function Se(M){return M===93?(e.consume(M),R):L(M)}function R(M){return M===62?(e.consume(M),F):M===45&&i===2?(e.consume(M),R):L(M)}function F(M){return M===null||Ye(M)?(e.exit("htmlFlowData"),B(M)):(e.consume(M),F)}function B(M){return e.exit("htmlFlow"),t(M)}}function Sre(e,t,n){const r=this;return i;function i(o){return Ye(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function jre(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Iy,t,n)}}const Nre={name:"htmlText",tokenize:kre};function kre(e,t,n){const r=this;let i,a,o;return c;function c(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),d}function d(R){return R===33?(e.consume(R),f):R===47?(e.consume(R),P):R===63?(e.consume(R),_):ua(R)?(e.consume(R),z):n(R)}function f(R){return R===45?(e.consume(R),p):R===91?(e.consume(R),a=0,x):ua(R)?(e.consume(R),O):n(R)}function p(R){return R===45?(e.consume(R),v):n(R)}function m(R){return R===null?n(R):R===45?(e.consume(R),y):Ye(R)?(o=m,X(R)):(e.consume(R),m)}function y(R){return R===45?(e.consume(R),v):m(R)}function v(R){return R===62?K(R):R===45?y(R):m(R)}function x(R){const F="CDATA[";return R===F.charCodeAt(a++)?(e.consume(R),a===F.length?w:x):n(R)}function w(R){return R===null?n(R):R===93?(e.consume(R),j):Ye(R)?(o=w,X(R)):(e.consume(R),w)}function j(R){return R===93?(e.consume(R),k):w(R)}function k(R){return R===62?K(R):R===93?(e.consume(R),k):w(R)}function O(R){return R===null||R===62?K(R):Ye(R)?(o=O,X(R)):(e.consume(R),O)}function _(R){return R===null?n(R):R===63?(e.consume(R),C):Ye(R)?(o=_,X(R)):(e.consume(R),_)}function C(R){return R===62?K(R):_(R)}function P(R){return ua(R)?(e.consume(R),T):n(R)}function T(R){return R===45||Vr(R)?(e.consume(R),T):A(R)}function A(R){return Ye(R)?(o=A,X(R)):jt(R)?(e.consume(R),A):K(R)}function z(R){return R===45||Vr(R)?(e.consume(R),z):R===47||R===62||Pr(R)?I(R):n(R)}function I(R){return R===47?(e.consume(R),K):R===58||R===95||ua(R)?(e.consume(R),q):Ye(R)?(o=I,X(R)):jt(R)?(e.consume(R),I):K(R)}function q(R){return R===45||R===46||R===58||R===95||Vr(R)?(e.consume(R),q):U(R)}function U(R){return R===61?(e.consume(R),L):Ye(R)?(o=U,X(R)):jt(R)?(e.consume(R),U):I(R)}function L(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),i=R,J):Ye(R)?(o=L,X(R)):jt(R)?(e.consume(R),L):(e.consume(R),ae)}function J(R){return R===i?(e.consume(R),i=void 0,Q):R===null?n(R):Ye(R)?(o=J,X(R)):(e.consume(R),J)}function ae(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||Pr(R)?I(R):(e.consume(R),ae)}function Q(R){return R===47||R===62||Pr(R)?I(R):n(R)}function K(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function X(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),ye}function ye(R){return jt(R)?qt(e,Se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):Se(R)}function Se(R){return e.enter("htmlTextData"),o(R)}}const fN={name:"labelEnd",resolveAll:Ore,resolveTo:Ere,tokenize:Tre},Cre={tokenize:Pre},_re={tokenize:zre},Are={tokenize:Rre};function Ore(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&&ma(e,0,e.length,n),e}function Ere(e,t){let n=e.length,r=0,i,a,o,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(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=yi(c,e.slice(a+1,a+r+3)),c=yi(c,[["enter",p,t]]),c=yi(c,dN(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),c=yi(c,[["exit",p,t],e[o-2],e[o-1],["exit",f,t]]),c=yi(c,e.slice(o+1)),c=yi(c,[["exit",d,t]]),ma(e,a,e.length,c),e}function Tre(e,t,n){const r=this;let i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return c;function c(y){return a?a._inactive?m(y):(o=r.parser.defined.includes(ru(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(Cre,p,o?p:m)(y):y===91?e.attempt(_re,p,o?f:m)(y):o?p(y):m(y)}function f(y){return e.attempt(Are,p,m)(y)}function p(y){return t(y)}function m(y){return a._balanced=!0,n(y)}}function Pre(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 Pr(m)?hf(e,a)(m):a(m)}function a(m){return m===41?p(m):s$(e,o,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return Pr(m)?hf(e,d)(m):p(m)}function c(m){return n(m)}function d(m){return m===34||m===39||m===40?l$(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return Pr(m)?hf(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 zre(e,t,n){const r=this;return i;function i(c){return o$.call(r,e,a,o,"reference","referenceMarker","referenceString")(c)}function a(c){return r.parser.defined.includes(ru(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function o(c){return n(c)}}function Rre(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 Mre={name:"labelStartImage",resolveAll:fN.resolveAll,tokenize:Dre};function Dre(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"),o):n(c)}function o(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const Ire={name:"labelStartLink",resolveAll:fN.resolveAll,tokenize:Lre};function Lre(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Ex={name:"lineEnding",tokenize:$re};function $re(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),qt(e,t,"linePrefix")}}const Um={name:"thematicBreak",tokenize:Ure};function Ure(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),o(f)}function o(f){return i=f,c(f)}function c(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||Ye(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),jt(f)?qt(e,c,"whitespace")(f):c(f))}}const Cr={continuation:{tokenize:Kre},exit:Gre,name:"list",tokenize:qre},Bre={partial:!0,tokenize:Vre},Fre={partial:!0,tokenize:Hre};function qre(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return c;function c(v){const x=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:WS(v)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Um,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 WS(v)&&++o<10?(e.consume(v),d):(!r.interrupt||o<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(Iy,r.interrupt?n:p,e.attempt(Bre,y,m))}function p(v){return r.containerState.initialBlankLine=!0,a++,y(v)}function m(v){return jt(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 Kre(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Iy,i,a);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,qt(e,t,"listItemIndent",r.containerState.size+1)(c)}function a(c){return r.containerState.furtherBlankLines||!jt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Fre,t,o)(c))}function o(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,qt(e,e.attempt(Cr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function Hre(e,t,n){const r=this;return qt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function Gre(e){e.exit(this.containerState.type)}function Vre(e,t,n){const r=this;return qt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!jt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const C2={name:"setextUnderline",resolveTo:Zre,tokenize:Yre};function Zre(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Yre(e,t,n){const r=this;let i;return a;function a(f){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=f,o(f)):n(f)}function o(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===i?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),jt(f)?qt(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Ye(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const Wre={tokenize:Qre};function Qre(e){const t=this,n=e.attempt(Iy,r,e.attempt(this.parser.constructs.flowInitial,i,qt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(nre,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 Xre={resolveAll:u$()},Jre=c$("string"),eie=c$("text");function c$(e){return{resolveAll:u$(e==="text"?tie:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,c);return o;function o(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 u$(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 tie(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,o=-1,c=0,d;for(;a--;){const f=i[a];if(typeof f=="string"){for(o=f.length;f.charCodeAt(o-1)===32;)c++,o--;if(o)break;o=-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?o:r.start._bufferIndex+o,_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 nie={42:Cr,43:Cr,45:Cr,48:Cr,49:Cr,50:Cr,51:Cr,52:Cr,53:Cr,54:Cr,55:Cr,56:Cr,57:Cr,62:n$},rie={91:ore},iie={[-2]:Ox,[-1]:Ox,32:Ox},aie={35:hre,42:Um,45:[C2,Um],60:yre,61:C2,95:Um,96:N2,126:N2},sie={38:i$,92:r$},oie={[-5]:Ex,[-4]:Ex,[-3]:Ex,33:Mre,38:i$,42:QS,60:[Ine,Nre],91:Ire,92:[dre,r$],93:fN,95:QS,96:Wne},lie={null:[QS,Xre]},cie={null:[42,95]},uie={null:[]},die=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:cie,contentInitial:rie,disable:uie,document:nie,flow:aie,flowInitial:iie,insideSpan:lie,string:sie,text:oie},Symbol.toStringTag,{value:"Module"}));function fie(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let o=[],c=[];const d={attempt:A(P),check:A(T),consume:O,enter:_,exit:C,interrupt:A(T,{interrupt:!0})},f={code:null,containerState:{},defineSkip:w,events:[],now:x,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:m};let p=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function m(U){return o=yi(o,U),j(),o[o.length-1]!==null?[]:(z(t,0),f.events=dN(a,f.events,f),f.events)}function y(U,L){return pie(v(U),L)}function v(U){return hie(o,U)}function x(){const{_bufferIndex:U,_index:L,line:J,column:ae,offset:Q}=r;return{_bufferIndex:U,_index:L,line:J,column:ae,offset:Q}}function w(U){i[U.line]=U.column,q()}function j(){let U;for(;r._index<o.length;){const L=o[r._index];if(typeof L=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<L.length;)k(L.charCodeAt(r._bufferIndex));else k(L)}}function k(U){p=p(U)}function O(U){Ye(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,q()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=U}function _(U,L){const J=L||{};return J.type=U,J.start=x(),f.events.push(["enter",J,f]),c.push(J),J}function C(U){const L=c.pop();return L.end=x(),f.events.push(["exit",L,f]),L}function P(U,L){z(U,L.from)}function T(U,L){L.restore()}function A(U,L){return J;function J(ae,Q,K){let X,ye,Se,R;return Array.isArray(ae)?B(ae):"tokenize"in ae?B([ae]):F(ae);function F(ie){return he;function he(je){const ee=je!==null&&ie[je],de=je!==null&&ie.null,_e=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(de)?de:de?[de]:[]];return B(_e)(je)}}function B(ie){return X=ie,ye=0,ie.length===0?K:M(ie[ye])}function M(ie){return he;function he(je){return R=I(),Se=ie,ie.partial||(f.currentConstruct=ie),ie.name&&f.parser.constructs.disable.null.includes(ie.name)?se():ie.tokenize.call(L?Object.assign(Object.create(f),L):f,d,V,se)(je)}}function V(ie){return U(Se,R),Q}function se(ie){return R.restore(),++ye<X.length?M(X[ye]):K}}}function z(U,L){U.resolveAll&&!a.includes(U)&&a.push(U),U.resolve&&ma(f.events,L,f.events.length-L,U.resolve(f.events.slice(L),f)),U.resolveTo&&(f.events=U.resolveTo(f.events,f))}function I(){const U=x(),L=f.previous,J=f.currentConstruct,ae=f.events.length,Q=Array.from(c);return{from:ae,restore:K};function K(){r=U,f.previous=L,f.currentConstruct=J,f.events.length=ae,c=Q,q()}}function q(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function hie(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const c=o[0];typeof c=="string"?o[0]=c.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function pie(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
|
|
98
|
-
`;break}case-3:{o=`\r
|
|
99
|
-
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}function mie(e){const r={constructs:Sne([die,...(e||{}).extensions||[]]),content:i(Ene),defined:[],document:i(Pne),flow:i(Wre),lazy:{},string:i(Jre),text:i(eie)};return r;function i(a){return o;function o(c){return fie(r,a,c)}}}function gie(e){for(;!a$(e););return e}const _2=/[\0\t\n\r]/g;function yie(){let e=1,t="",n=!0,r;return i;function i(a,o,c){const d=[];let f,p,m,y,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(_2.lastIndex=m,f=_2.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 vie=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bie(e){return e.replace(vie,xie)}function xie(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return t$(n.slice(a?2:1),a?16:10)}return uN(n)||e}const d$={}.hasOwnProperty;function wie(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Sie(n)(gie(mie(n).document().write(yie()(e,t,!0))))}function Sie(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(xn),autolinkProtocol:I,autolinkEmail:I,atxHeading:a(rt),blockQuote:a(de),characterEscape:I,characterReference:I,codeFenced:a(_e),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(_e,o),codeText:a(Y,o),codeTextData:I,data:I,codeFlowValue:I,definition:a(Ke),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Me),hardBreakEscape:a(it),hardBreakTrailing:a(it),htmlFlow:a(Nt,o),htmlFlowData:I,htmlText:a(Nt,o),htmlTextData:I,image:a(Lt),label:o,link:a(xn),listItem:a(Ve),listItemValue:y,listOrdered:a(ve,m),listUnordered:a(ve),paragraph:a(be),reference:M,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(rt),strong:a(ze),thematicBreak:a(Oe)},exit:{atxHeading:d(),atxHeadingSequence:P,autolink:d(),autolinkEmail:ee,autolinkProtocol:je,blockQuote:d(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ie,characterReference:he,codeFenced:d(j),codeFencedFence:w,codeFencedFenceInfo:v,codeFencedFenceMeta:x,codeFlowValue:q,codeIndented:d(k),codeText:d(Q),codeTextData:q,data:q,definition:d(),definitionDestinationString:C,definitionLabelString:O,definitionTitleString:_,emphasis:d(),hardBreakEscape:d(L),hardBreakTrailing:d(L),htmlFlow:d(J),htmlFlowData:q,htmlText:d(ae),htmlTextData:q,image:d(X),label:Se,labelText:ye,lineEnding:U,link:d(K),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:V,resourceDestinationString:R,resourceTitleString:F,resource:B,setextHeading:d(z),setextHeadingLineSequence:A,setextHeadingText:T,strong:d(),thematicBreak:d()}};f$(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(te){let xe={type:"root",children:[]};const Ee={stack:[xe],tokenStack:[],config:t,enter:c,exit:f,buffer:o,resume:p,data:n},Ge=[];let Je=-1;for(;++Je<te.length;)if(te[Je][1].type==="listOrdered"||te[Je][1].type==="listUnordered")if(te[Je][0]==="enter")Ge.push(Je);else{const nn=Ge.pop();Je=i(te,nn,Je)}for(Je=-1;++Je<te.length;){const nn=t[te[Je][0]];d$.call(nn,te[Je][1].type)&&nn[te[Je][1].type].call(Object.assign({sliceSerialize:te[Je][2].sliceSerialize},Ee),te[Je][1])}if(Ee.tokenStack.length>0){const nn=Ee.tokenStack[Ee.tokenStack.length-1];(nn[1]||A2).call(Ee,void 0,nn[0])}for(xe.position={start:Fs(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:Fs(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Je=-1;++Je<t.transforms.length;)xe=t.transforms[Je](xe)||xe;return xe}function i(te,xe,Ee){let Ge=xe-1,Je=-1,nn=!1,wn,Qe,kt,$t;for(;++Ge<=Ee;){const ue=te[Ge];switch(ue[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ue[0]==="enter"?Je++:Je--,$t=void 0;break}case"lineEndingBlank":{ue[0]==="enter"&&(wn&&!$t&&!Je&&!kt&&(kt=Ge),$t=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$t=void 0}if(!Je&&ue[0]==="enter"&&ue[1].type==="listItemPrefix"||Je===-1&&ue[0]==="exit"&&(ue[1].type==="listUnordered"||ue[1].type==="listOrdered")){if(wn){let Dn=Ge;for(Qe=void 0;Dn--;){const lr=te[Dn];if(lr[1].type==="lineEnding"||lr[1].type==="lineEndingBlank"){if(lr[0]==="exit")continue;Qe&&(te[Qe][1].type="lineEndingBlank",nn=!0),lr[1].type="lineEnding",Qe=Dn}else if(!(lr[1].type==="linePrefix"||lr[1].type==="blockQuotePrefix"||lr[1].type==="blockQuotePrefixWhitespace"||lr[1].type==="blockQuoteMarker"||lr[1].type==="listItemIndent"))break}kt&&(!Qe||kt<Qe)&&(wn._spread=!0),wn.end=Object.assign({},Qe?te[Qe][1].start:ue[1].end),te.splice(Qe||Ge,0,["exit",wn,ue[2]]),Ge++,Ee++}if(ue[1].type==="listItemPrefix"){const Dn={type:"listItem",_spread:!1,start:Object.assign({},ue[1].start),end:void 0};wn=Dn,te.splice(Ge,0,["enter",Dn,ue[2]]),Ge++,Ee++,kt=void 0,$t=!0}}}return te[xe][1]._spread=nn,Ee}function a(te,xe){return Ee;function Ee(Ge){c.call(this,te(Ge),Ge),xe&&xe.call(this,Ge)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(te,xe,Ee){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([xe,Ee||void 0]),te.position={start:Fs(xe.start),end:void 0}}function d(te){return xe;function xe(Ee){te&&te.call(this,Ee),f.call(this,Ee)}}function f(te,xe){const Ee=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==te.type&&(xe?xe.call(this,te,Ge[0]):(Ge[1]||A2).call(this,te,Ge[0]));else throw new Error("Cannot close `"+te.type+"` ("+ff({start:te.start,end:te.end})+"): it’s not open");Ee.position.end=Fs(te.end)}function p(){return xne(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(te){if(this.data.expectingFirstListItemValue){const xe=this.stack[this.stack.length-2];xe.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function v(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.lang=te}function x(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.meta=te}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.value=te.replace(/(\r?\n|\r)$/g,"")}function O(te){const xe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=xe,Ee.identifier=ru(this.sliceSerialize(te)).toLowerCase()}function _(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.title=te}function C(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.url=te}function P(te){const xe=this.stack[this.stack.length-1];if(!xe.depth){const Ee=this.sliceSerialize(te).length;xe.depth=Ee}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function A(te){const xe=this.stack[this.stack.length-1];xe.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function z(){this.data.setextHeadingSlurpLineEnding=void 0}function I(te){const Ee=this.stack[this.stack.length-1].children;let Ge=Ee[Ee.length-1];(!Ge||Ge.type!=="text")&&(Ge=Re(),Ge.position={start:Fs(te.start),end:void 0},Ee.push(Ge)),this.stack.push(Ge)}function q(te){const xe=this.stack.pop();xe.value+=this.sliceSerialize(te),xe.position.end=Fs(te.end)}function U(te){const xe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=xe.children[xe.children.length-1];Ee.position.end=Fs(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(xe.type)&&(I.call(this,te),q.call(this,te))}function L(){this.data.atHardBreak=!0}function J(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.value=te}function ae(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.value=te}function Q(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.value=te}function K(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=xe,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function X(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=xe,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function ye(te){const xe=this.sliceSerialize(te),Ee=this.stack[this.stack.length-2];Ee.label=bie(xe),Ee.identifier=ru(xe).toLowerCase()}function Se(){const te=this.stack[this.stack.length-1],xe=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Ge=te.children;Ee.children=Ge}else Ee.alt=xe}function R(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.url=te}function F(){const te=this.resume(),xe=this.stack[this.stack.length-1];xe.title=te}function B(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function V(te){const xe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=xe,Ee.identifier=ru(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function se(te){this.data.characterReferenceType=te.type}function ie(te){const xe=this.sliceSerialize(te),Ee=this.data.characterReferenceType;let Ge;Ee?(Ge=t$(xe,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=uN(xe);const Je=this.stack[this.stack.length-1];Je.value+=Ge}function he(te){const xe=this.stack.pop();xe.position.end=Fs(te.end)}function je(te){q.call(this,te);const xe=this.stack[this.stack.length-1];xe.url=this.sliceSerialize(te)}function ee(te){q.call(this,te);const xe=this.stack[this.stack.length-1];xe.url="mailto:"+this.sliceSerialize(te)}function de(){return{type:"blockquote",children:[]}}function _e(){return{type:"code",lang:null,meta:null,value:""}}function Y(){return{type:"inlineCode",value:""}}function Ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Me(){return{type:"emphasis",children:[]}}function rt(){return{type:"heading",depth:0,children:[]}}function it(){return{type:"break"}}function Nt(){return{type:"html",value:""}}function Lt(){return{type:"image",title:null,url:"",alt:null}}function xn(){return{type:"link",title:null,url:"",children:[]}}function ve(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function Ve(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function be(){return{type:"paragraph",children:[]}}function ze(){return{type:"strong",children:[]}}function Re(){return{type:"text",value:""}}function Oe(){return{type:"thematicBreak"}}}function Fs(e){return{line:e.line,column:e.column,offset:e.offset}}function f$(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?f$(e,r):jie(e,r)}}function jie(e,t){let n;for(n in t)if(d$.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 A2(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ff({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ff({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ff({start:t.start,end:t.end})+") is still open")}function Nie(e){const t=this;t.parser=n;function n(r){return wie(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function kie(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 Cie(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
100
|
-
`}]}function _ie(e,t){const n=t.value?t.value+`
|
|
101
|
-
`:"",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 Aie(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Oie(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Eie(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Eu(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=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(o)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function Tie(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 Pie(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function h$(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function zie(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return h$(e,t);const i={src:Eu(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 Rie(e,t){const n={src:Eu(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 Mie(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 Die(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return h$(e,t);const i={href:Eu(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 Iie(e,t){const n={href:Eu(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 Lie(e,t,n){const r=e.all(t),i=n?$ie(n):p$(t),a={},o=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(i||c!==0||p.type!=="element"||p.tagName!=="p")&&o.push({type:"text",value:`
|
|
102
|
-
`}),p.type==="element"&&p.tagName==="p"&&!i?o.push(...p.children):o.push(p)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
|
|
103
|
-
`});const f={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,f),e.applyData(t,f)}function $ie(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=p$(n[r])}return t}function p$(e){const t=e.spread;return t??e.children.length>1}function Uie(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Bie(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Fie(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function qie(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Kie(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=sN(t.children[1]),d=Z5(t.children[t.children.length-1]);c&&d&&(o.position={start:c,end:d}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Hie(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,c=o?o.length:t.children.length;let d=-1;const f=[];for(;++d<c;){const m=t.children[d],y={},v=o?o[d]:void 0;v&&(y.align=v);let x={type:"element",tagName:a,properties:y,children:[]};m&&(x.children=e.all(m),e.patch(m,x),x=e.applyData(m,x)),f.push(x)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function Gie(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const O2=9,E2=32;function Vie(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(T2(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(T2(t.slice(i),i>0,!1)),a.join("")}function T2(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===O2||a===E2;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===O2||a===E2;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Zie(e,t){const n={type:"text",value:Vie(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Yie(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Wie={blockquote:kie,break:Cie,code:_ie,delete:Aie,emphasis:Oie,footnoteReference:Eie,heading:Tie,html:Pie,imageReference:zie,image:Rie,inlineCode:Mie,linkReference:Die,link:Iie,listItem:Lie,list:Uie,paragraph:Bie,root:Fie,strong:qie,table:Kie,tableCell:Gie,tableRow:Hie,text:Zie,thematicBreak:Yie,toml:sm,yaml:sm,definition:sm,footnoteDefinition:sm};function sm(){}const m$=-1,Ly=0,pf=1,gg=2,hN=3,pN=4,mN=5,gN=6,g$=7,y$=8,P2=typeof self=="object"?self:globalThis,Qie=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case Ly:case m$:return n(o,i);case pf:{const c=n([],i);for(const d of o)c.push(r(d));return c}case gg:{const c=n({},i);for(const[d,f]of o)c[r(d)]=r(f);return c}case hN:return n(new Date(o),i);case pN:{const{source:c,flags:d}=o;return n(new RegExp(c,d),i)}case mN:{const c=n(new Map,i);for(const[d,f]of o)c.set(r(d),r(f));return c}case gN:{const c=n(new Set,i);for(const d of o)c.add(r(d));return c}case g$:{const{name:c,message:d}=o;return n(new P2[c](d),i)}case y$:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:c}=new Uint8Array(o);return n(new DataView(c),o)}}return n(new P2[a](o),i)};return r},z2=e=>Qie(new Map,e)(0),Pc="",{toString:Xie}={},{keys:Jie}=Object,Kd=e=>{const t=typeof e;if(t!=="object"||!e)return[Ly,t];const n=Xie.call(e).slice(8,-1);switch(n){case"Array":return[pf,Pc];case"Object":return[gg,Pc];case"Date":return[hN,Pc];case"RegExp":return[pN,Pc];case"Map":return[mN,Pc];case"Set":return[gN,Pc];case"DataView":return[pf,n]}return n.includes("Array")?[pf,n]:n.includes("Error")?[g$,n]:[gg,n]},om=([e,t])=>e===Ly&&(t==="function"||t==="symbol"),eae=(e,t,n,r)=>{const i=(o,c)=>{const d=r.push(o)-1;return n.set(c,d),d},a=o=>{if(n.has(o))return n.get(o);let[c,d]=Kd(o);switch(c){case Ly:{let p=o;switch(d){case"bigint":c=y$,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([m$],o)}return i([c,p],o)}case pf:{if(d){let y=o;return d==="DataView"?y=new Uint8Array(o.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(o)),i([d,[...y]],o)}const p=[],m=i([c,p],o);for(const y of o)p.push(a(y));return m}case gg:{if(d)switch(d){case"BigInt":return i([d,o.toString()],o);case"Boolean":case"Number":case"String":return i([d,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const p=[],m=i([c,p],o);for(const y of Jie(o))(e||!om(Kd(o[y])))&&p.push([a(y),a(o[y])]);return m}case hN:return i([c,o.toISOString()],o);case pN:{const{source:p,flags:m}=o;return i([c,{source:p,flags:m}],o)}case mN:{const p=[],m=i([c,p],o);for(const[y,v]of o)(e||!(om(Kd(y))||om(Kd(v))))&&p.push([a(y),a(v)]);return m}case gN:{const p=[],m=i([c,p],o);for(const y of o)(e||!om(Kd(y)))&&p.push(a(y));return m}}const{message:f}=o;return i([c,{name:d,message:f}],o)};return a},R2=(e,{json:t,lossy:n}={})=>{const r=[];return eae(!(t||n),!!t,new Map,r)(e),r},yg=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?z2(R2(e,t)):structuredClone(e):(e,t)=>z2(R2(e,t));function tae(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 nae(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function rae(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||tae,r=e.options.footnoteBackLabel||nae,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=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=Eu(m.toLowerCase());let v=0;const x=[],w=e.footnoteCounts.get(m);for(;w!==void 0&&++v<=w;){x.length>0&&x.push({type:"text",value:" "});let O=typeof n=="string"?n:n(d,v);typeof O=="string"&&(O={type:"text",value:O}),x.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(O)?O:[O]})}const j=p[p.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const O=j.children[j.children.length-1];O&&O.type==="text"?O.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...x)}else p.push(...x);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:{...yg(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
104
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
105
|
-
`}]}}const v$=(function(e){if(e==null)return oae;if(typeof e=="function")return $y(e);if(typeof e=="object")return Array.isArray(e)?iae(e):aae(e);if(typeof e=="string")return sae(e);throw new Error("Expected function, string, or object as test")});function iae(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=v$(e[n]);return $y(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function aae(e){const t=e;return $y(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function sae(e){return $y(t);function t(n){return n&&n.type===e}}function $y(e){return t;function t(n,r,i){return!!(lae(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function oae(){return!0}function lae(e){return e!==null&&typeof e=="object"&&"type"in e}const b$=[],cae=!0,M2=!1,uae="skip";function dae(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=v$(i),o=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=b$,x,w,j;if((!t||a(d,f,p[p.length-1]||void 0))&&(v=fae(n(d,p)),v[0]===M2))return v;if("children"in d&&d.children){const k=d;if(k.children&&v[0]!==uae)for(w=(r?k.children.length:-1)+o,j=p.concat(k);w>-1&&w<k.children.length;){const O=k.children[w];if(x=c(O,w,j)(),x[0]===M2)return x;w=typeof x[1]=="number"?x[1]:w+o}}return v}}}function fae(e){return Array.isArray(e)?e:typeof e=="number"?[cae,e]:e==null?b$:[e]}function x$(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),dae(e,a,c,i);function c(d,f){const p=f[f.length-1],m=p?p.children.indexOf(d):void 0;return o(d,m,p)}}const XS={}.hasOwnProperty,hae={};function pae(e,t){const n=t||hae,r=new Map,i=new Map,a=new Map,o={...Wie,...n.handlers},c={all:f,applyData:gae,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:d,options:n,patch:mae,wrap:vae};return x$(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(XS.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:w,...j}=p,k=yg(j);return k.children=c.all(p),k}return yg(p)}return(c.options.unknownHandler||yae)(c,p,m)}function f(p){const m=[];if("children"in p){const y=p.children;let v=-1;for(;++v<y.length;){const x=c.one(y[v],p);if(x){if(v&&y[v-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=D2(x.value)),!Array.isArray(x)&&x.type==="element")){const w=x.children[0];w&&w.type==="text"&&(w.value=D2(w.value))}Array.isArray(x)?m.push(...x):m.push(x)}}}return m}}function mae(e,t){e.position&&(t.position=Xte(e))}function gae(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,yg(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function yae(e,t){const n=t.data||{},r="value"in t&&!(XS.call(n,"hProperties")||XS.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 vae(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
106
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
107
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
108
|
-
`}),n}function D2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function I2(e,t){const n=pae(e,t),r=n.one(e,void 0),i=rae(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
|
|
109
|
-
`},i),a}function bae(e,t){return e&&"run"in e?async function(n,r){const i=I2(n,{file:r,...t});await e.run(i,r)}:function(n,r){return I2(n,{file:r,...e||t})}}function L2(e){if(e)throw e}var Tx,$2;function xae(){if($2)return Tx;$2=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var y;for(y in f);return typeof y>"u"||e.call(f,y)},o=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},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 Tx=function d(){var f,p,m,y,v,x,w=arguments[0],j=1,k=arguments.length,O=!1;for(typeof w=="boolean"&&(O=w,w=arguments[1]||{},j=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});j<k;++j)if(f=arguments[j],f!=null)for(p in f)m=c(w,p),y=c(f,p),w!==y&&(O&&y&&(a(y)||(v=i(y)))?(v?(v=!1,x=m&&i(m)?m:[]):x=m&&a(m)?m:{},o(w,{name:p,newValue:d(O,x,y)})):typeof y<"u"&&o(w,{name:p,newValue:y}));return w},Tx}var wae=xae();const Px=wa(wae);function JS(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 Sae(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);c(null,...i);function c(d,...f){const p=e[++a];let m=-1;if(d){o(d);return}for(;++m<i.length;)(f[m]===null||f[m]===void 0)&&(f[m]=i[m]);i=f,p?jae(p,c)(...f):o(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function jae(e,t){let n;return r;function r(...o){const c=e.length>o.length;let d;c&&o.push(i);try{d=e.apply(this,o)}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(o,...c){n||(n=!0,t(o,...c))}function a(o){i(null,o)}}const sa={basename:Nae,dirname:kae,extname:Cae,join:_ae,sep:"/"};function Nae(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');eh(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function kae(e){if(eh(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 Cae(e){eh(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const c=e.codePointAt(t);if(c===47){if(o){r=t+1;break}continue}n<0&&(o=!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 _ae(...e){let t=-1,n;for(;++t<e.length;)eh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Aae(n)}function Aae(e){eh(e);const t=e.codePointAt(0)===47;let n=Oae(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Oae(e,t){let n="",r=0,i=-1,a=0,o=-1,c,d;for(;++o<=e.length;){if(o<e.length)c=e.codePointAt(o);else{if(c===47)break;c=47}if(c===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else c===46&&a>-1?a++:a=-1}return n}function eh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Eae={cwd:Tae};function Tae(){return"/"}function e1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Pae(e){if(typeof e=="string")e=new URL(e);else if(!e1(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 zae(e)}function zae(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 zx=["history","path","basename","stem","extname","dirname"];class w${constructor(t){let n;t?e1(t)?n={path:t}:typeof t=="string"||Rae(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Eae.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<zx.length;){const a=zx[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)zx.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?sa.basename(this.path):void 0}set basename(t){Mx(t,"basename"),Rx(t,"basename"),this.path=sa.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?sa.dirname(this.path):void 0}set dirname(t){U2(this.basename,"dirname"),this.path=sa.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?sa.extname(this.path):void 0}set extname(t){if(Rx(t,"extname"),U2(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=sa.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){e1(t)&&(t=Pae(t)),Mx(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?sa.basename(this.path,this.extname):void 0}set stem(t){Mx(t,"stem"),Rx(t,"stem"),this.path=sa.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 sr(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 Rx(e,t){if(e&&e.includes(sa.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+sa.sep+"`")}function Mx(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function U2(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Rae(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Mae=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),Dae={}.hasOwnProperty;class yN extends Mae{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=Sae()}copy(){const t=new yN;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Px(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Lx("data",this.frozen),this.namespace[t]=n,this):Dae.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Lx("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=lm(t),r=this.parser||this.Parser;return Dx("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Dx("process",this.parser||this.Parser),Ix("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const c=lm(t),d=r.parse(c);r.run(d,c,function(p,m,y){if(p||!m||!y)return f(p);const v=m,x=r.stringify(v,y);$ae(x)?y.value=x:y.result=x,f(p,y)});function f(p,m){p||!m?o(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),Dx("processSync",this.parser||this.Parser),Ix("processSync",this.compiler||this.Compiler),this.process(t,i),F2("processSync","process",n),r;function i(a,o){n=!0,L2(a),r=o}}run(t,n,r){B2(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,c){const d=lm(n);i.run(t,d,f);function f(p,m,y){const v=m||t;p?c(p):o?o(v):r(void 0,v,y)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),F2("runSync","run",r),i;function a(o,c){L2(o),i=c,r=!0}}stringify(t,n){this.freeze();const r=lm(n),i=this.compiler||this.Compiler;return Ix("stringify",i),B2(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Lx("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,m)}else o(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function o(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(i.settings=Px(!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,...x]=p;const w=r[y][1];JS(w)&&JS(v)&&(v=Px(!0,w,v)),r[y]=[f,v,...x]}}}}const Iae=new yN().freeze();function Dx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ix(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Lx(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 B2(e){if(!JS(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function F2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function lm(e){return Lae(e)?e:new w$(e)}function Lae(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function $ae(e){return typeof e=="string"||Uae(e)}function Uae(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Bae="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",q2=[],K2={allowDangerousHtml:!0},Fae=/^(https?|ircs?|mailto|xmpp)$/i,qae=[{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 Kae(e){const t=Hae(e),n=Gae(e);return Vae(t.runSync(t.parse(n),n),e)}function Hae(e){const t=e.rehypePlugins||q2,n=e.remarkPlugins||q2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...K2}:K2;return Iae().use(Nie).use(n).use(bae,r).use(t)}function Gae(e){const t=e.children||"",n=new w$;return typeof t=="string"&&(n.value=t),n}function Vae(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||Zae;for(const p of qae)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Bae+p.id,void 0);return x$(e,f),rne(e,{Fragment:u.Fragment,components:i,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function f(p,m,y){if(p.type==="raw"&&y&&typeof m=="number")return o?y.children.splice(m,1):y.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in Ax)if(Object.hasOwn(Ax,v)&&Object.hasOwn(p.properties,v)){const x=p.properties[v],w=Ax[v];(w===null||w.includes(p.tagName))&&(p.properties[v]=d(String(x||""),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 Zae(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||Fae.test(e.slice(0,t))?e:""}function Yae(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Uy=Yae();async function H2(e){const t=await fetch(`${Uy}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new is(n?.error?.message??`transcript fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function Wae(e){const t=await fetch(`${Uy}/projects/${encodeURIComponent(e)}/agent/providers`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new is(n?.error?.message??`providers fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function Qae(e){const t=await fetch(`${Uy}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new is(n?.error?.message??`reset failed: ${t.status}`,t.status,n?.error?.code)}}async function Xae({project:e,prompt:t,provider:n,modelId:r,scope:i,signal:a,onEvent:o}){const c={prompt:t};n&&(c.provider=n),r&&(c.modelId=r),i&&(c.scope=i);const d=await fetch(`${Uy}/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){const v=await d.json().catch(()=>({}));throw new is(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:x}=await f.read();if(x)break;m+=p.decode(v,{stream:!0});let w=m.indexOf(`
|
|
110
|
-
|
|
111
|
-
`);for(;w!==-1;){const j=m.slice(0,w);m=m.slice(w+2);for(const k of j.split(`
|
|
112
|
-
`)){if(!k.startsWith("data:"))continue;const O=k.slice(5).trim();if(O)try{o(JSON.parse(O))}catch{}}w=m.indexOf(`
|
|
113
|
-
|
|
114
|
-
`)}}}finally{a?.removeEventListener("abort",y);try{f.releaseLock()}catch{}}}function S$(e){return!e||e.role!=="assistant"?"":e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}const Jae=[{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?"}],ese=[{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:"/keywords",label:"Keywords",hint:"List tracked keywords",prompt:"List the tracked keywords 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."}],cm=e=>`canonry:aero:provider:${e}`,G2=e=>`canonry:aero:scope:${e}`;function tse({projectName:e}){const[t,n]=S.useState(!1),[r,i]=S.useState(!1),[a,o]=S.useState([]),[c,d]=S.useState(""),[f,p]=S.useState(!1),[m,y]=S.useState([]),[v,x]=S.useState(""),[w,j]=S.useState(null),[k,O]=S.useState(()=>typeof window>"u"?null:window.localStorage.getItem(cm(e))??null),[_,C]=S.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(G2(e))==="all"?"all":"read-only"),P=S.useRef(null),T=S.useRef(null),A=S.useRef(null),[z,I]=S.useState(0),q=S.useMemo(()=>{const B=c.trimStart();if(!B.startsWith("/"))return[];if(/\s/.test(B))return[];const M=B.toLowerCase();return ese.filter(V=>V.command.startsWith(M)||V.label.toLowerCase().includes(M.slice(1)))},[c]);S.useEffect(()=>{I(B=>q.length===0?0:Math.min(B,q.length-1))},[q.length]);const U=es({queryKey:Ar.agent.providers(e),queryFn:()=>Wae(e),enabled:t,staleTime:6e4}),L=S.useMemo(()=>{const B=U.data?.providers??[];if(k){const V=B.find(se=>se.id===k&&se.configured);if(V)return V}const M=U.data?.defaultProvider;return M?B.find(V=>V.id===M)??null:null},[k,U.data]);S.useEffect(()=>{if(!U.data||!k)return;U.data.providers.find(M=>M.id===k&&M.configured)||(O(null),window.localStorage.removeItem(cm(e)))},[U.data,k,e]);const J=S.useCallback(B=>{O(B),!(typeof window>"u")&&(B?window.localStorage.setItem(cm(e),B):window.localStorage.removeItem(cm(e)))},[e]),ae=S.useCallback(()=>{C(B=>{const M=B==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(G2(e),M),M})},[e]);S.useEffect(()=>{if(!t)return;const B=M=>{M.key==="Escape"&&(r?i(!1):n(!1))};return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[t,r]),S.useEffect(()=>{if(!t)return;let B=!1;j(null);const M=()=>{B||f||H2(e).then(ie=>{B||o(ie.messages)}).catch(ie=>{B||j(ie instanceof Error?ie.message:"Failed to load transcript")})};M();const se=window.setInterval(M,15e3);return()=>{B=!0,window.clearInterval(se)}},[t,e,f]),S.useEffect(()=>()=>{P.current?.abort()},[e]),S.useEffect(()=>{const B=T.current;B&&(B.scrollTop=B.scrollHeight)},[a,v,m]);async function Q(B){const M=B.trim();if(!M||f)return;j(null),d(""),p(!0),x(""),y([]);const V={role:"user",content:M,timestamp:Date.now()};o(ie=>[...ie,V]);const se=new AbortController;P.current=se;try{await Xae({project:e,prompt:M,provider:k??void 0,scope:_,signal:se.signal,onEvent:K});const ie=await H2(e);o(ie.messages)}catch(ie){ie.name!=="AbortError"&&j(ie instanceof Error?ie.message:"Prompt failed")}finally{p(!1),x(""),P.current=null}}function K(B){switch(B.type){case"message_update":x(S$(B.message));break;case"message_end":B.message.role==="assistant"&&x("");break;case"tool_execution_start":y(M=>[...M,{id:B.toolCallId,name:B.toolName,args:B.args,startedAt:Date.now()}]);break;case"tool_execution_end":y(M=>M.map(V=>V.id===B.toolCallId?{...V,endedAt:Date.now(),isError:B.isError,result:B.result}:V));break;case"error":j(B.message);break}}async function X(){P.current?.abort();try{await Qae(e),o([]),j(null)}catch(B){j(B instanceof Error?B.message:"Reset failed")}}const ye=a.length===0,Se=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",R=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",F=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 u.jsx("div",{className:Se,onClick:B=>{r&&B.target===B.currentTarget&&i(!1)},children:u.jsx("div",{className:R,children:t?u.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:[u.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(oT,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),u.jsx("span",{className:"text-sm font-medium text-zinc-100",children:"Aero"}),u.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:f?"working…":e})]}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(nse,{providers:U.data?.providers??[],active:L,override:k,onPick:J,disabled:f}),u.jsx("button",{type:"button",onClick:X,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:u.jsx(II,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),u.jsx("button",{type:"button",onClick:()=>i(B=>!B),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?u.jsx(Q7,{className:"h-3.5 w-3.5","aria-hidden":"true"}):u.jsx(V7,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),u.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:u.jsx(Wf,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),u.jsxs("div",{ref:T,className:F,children:[w&&u.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:w}),ye&&!f&&u.jsxs("div",{className:"flex flex-col gap-3 py-2",children:[u.jsxs("p",{className:"text-xs text-zinc-500",children:["Ask anything about ",u.jsx("span",{className:"text-zinc-300",children:e}),", or start with:"]}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:Jae.map(B=>u.jsx("button",{type:"button",onClick:()=>Q(B.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:B.label},B.label))})]}),ose(a,e,k,_),m.length>0&&u.jsx("div",{className:"mt-3 space-y-1.5",children:m.map(B=>u.jsx(j$,{trail:B},B.id))}),f&&v&&u.jsxs("div",{className:"mt-3",children:[u.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),u.jsx(N$,{content:v})]}),f&&!v&&m.every(B=>B.endedAt!==void 0)&&u.jsx(dse,{})]}),u.jsx(rse,{projectName:e,activeProvider:L,scope:_,onToggleScope:ae,disabled:f}),u.jsxs("div",{className:"relative",children:[q.length>0&&u.jsx(ise,{matches:q,selectedIndex:z,onHover:I,onPick:B=>{d(""),A.current?.focus(),Q(B.prompt)}}),u.jsxs("form",{className:"flex items-end gap-2 border-t border-zinc-800/70 bg-zinc-950/80 px-3 py-2.5",onSubmit:B=>{if(B.preventDefault(),q.length>0){const M=q[z];d(""),Q(M.prompt);return}Q(c)},children:[u.jsx("textarea",{ref:A,value:c,onChange:B=>d(B.target.value),onKeyDown:B=>{if(q.length>0){if(B.key==="ArrowDown"){B.preventDefault(),I(M=>(M+1)%q.length);return}if(B.key==="ArrowUp"){B.preventDefault(),I(M=>(M-1+q.length)%q.length);return}if(B.key==="Tab"){B.preventDefault();const M=q[z];d(`${M.command} `);return}if(B.key==="Escape"){B.preventDefault(),d("");return}}if(B.key==="Enter"&&!B.shiftKey)if(B.preventDefault(),q.length>0){const M=q[z];d(""),Q(M.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"}),u.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:u.jsx(O7,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}):u.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:[u.jsxs("span",{className:"flex items-center gap-2",children:[u.jsx(oT,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Ask Aero about ",e,"…"]}),u.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-600",children:"Enter"})]})})})}function nse({providers:e,active:t,override:n,onPick:r,disabled:i}){const[a,o]=S.useState(!1),c=S.useRef(null);if(S.useEffect(()=>{if(!a)return;const p=y=>{c.current?.contains(y.target)||o(!1)},m=y=>{y.key==="Escape"&&o(!1)};return window.addEventListener("mousedown",p),window.addEventListener("keydown",m),()=>{window.removeEventListener("mousedown",p),window.removeEventListener("keydown",m)}},[a]),e.length===0)return null;const d=t?.label.replace(/\s+\(.+\)$/,"")??"No provider",f=t?.defaultModel;return u.jsxs("div",{ref:c,className:"relative",children:[u.jsxs("button",{type:"button",onClick:()=>o(p=>!p),disabled:i,className:"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-zinc-400 transition hover:bg-zinc-800/60 hover:text-zinc-200 disabled:opacity-50","aria-label":"Switch agent model","aria-haspopup":"listbox","aria-expanded":a,title:t?`${t.label} · ${t.defaultModel}`:"Pick a provider",children:[u.jsx("span",{className:"font-medium text-zinc-200",children:d}),f&&u.jsx("span",{className:"hidden font-mono text-[10px] text-zinc-500 sm:inline",children:f}),u.jsx(P7,{className:"h-3 w-3","aria-hidden":"true"})]}),a&&u.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:[u.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-2 text-[10px] uppercase tracking-wider text-zinc-500",children:"Aero provider"}),u.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 u.jsx("li",{children:u.jsxs("button",{type:"button",role:"option","aria-selected":m,disabled:!p.configured,onClick:()=>{p.configured&&(r(y?null:p.id),o(!1))},className:"flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition enabled:hover:bg-zinc-900 disabled:cursor-not-allowed disabled:opacity-50",children:[u.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:m?u.jsx(DI,{className:"h-3 w-3 text-emerald-400","aria-hidden":"true"}):null}),u.jsxs("span",{className:"flex-1",children:[u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"font-medium text-zinc-100",children:p.label}),y&&u.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&&u.jsx("span",{className:"rounded-full border border-zinc-800 px-1.5 text-[9px] uppercase tracking-wider text-zinc-500",children:"Key missing"})]}),u.jsx("span",{className:"mt-0.5 block font-mono text-[10px] text-zinc-500",children:p.defaultModel}),p.keySource==="env"&&u.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!p.configured&&u.jsxs("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:["Add key in config.yaml or export"," ",u.jsx("code",{className:"font-mono text-zinc-400",children:ase(p.id)})]})]})]})},p.id)})}),n&&u.jsx("button",{type:"button",onClick:()=>{r(null),o(!1)},className:"w-full border-t border-zinc-800/60 px-3 py-2 text-left text-[11px] text-zinc-400 transition hover:bg-zinc-900 hover:text-zinc-100",children:"Reset to auto-detected default"})]})]})}function rse({projectName:e,activeProvider:t,scope:n,onToggleScope:r,disabled:i}){const a=t?.label.replace(/\s+\(.+\)$/,"")??null,o=n==="all";return u.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:[u.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:[u.jsx("span",{className:"text-zinc-600",children:"project"}),u.jsx("span",{className:"font-medium text-zinc-200",children:e})]}),a&&u.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:[u.jsx("span",{className:"text-zinc-600",children:"model"}),u.jsx("span",{className:"font-medium text-zinc-200",children:a})]}),u.jsxs("button",{type:"button",onClick:r,disabled:i,className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] transition disabled:opacity-50 ${o?"border-amber-800/60 bg-amber-950/40 text-amber-300 hover:border-amber-700 hover:text-amber-200":"border-zinc-800 bg-zinc-900/70 text-zinc-400 hover:border-zinc-700 hover:text-zinc-200"}`,title:o?"Aero can invoke write tools (run sweep, dismiss insight, etc). Click to restrict.":"Aero is restricted to read-only tools. Click to allow writes.",children:[u.jsx("span",{className:o?"text-amber-500":"text-zinc-600",children:"scope"}),u.jsx("span",{className:"font-medium",children:o?"all tools":"read-only"})]})]})}function ise({matches:e,selectedIndex:t,onHover:n,onPick:r}){return u.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:[u.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500",children:"Commands"}),u.jsx("ul",{role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:e.map((i,a)=>{const o=a===t;return u.jsx("li",{children:u.jsxs("button",{type:"button",role:"option","aria-selected":o,onMouseEnter:()=>n(a),onClick:()=>r(i),className:`flex w-full items-center gap-3 px-3 py-1.5 text-left text-xs transition ${o?"bg-zinc-900 text-zinc-100":"text-zinc-300 hover:bg-zinc-900/60"}`,children:[u.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:i.command}),u.jsx("span",{className:"font-medium",children:i.label}),u.jsx("span",{className:"ml-auto text-[10px] text-zinc-500",children:i.hint})]})},i.command)})}),u.jsxs("div",{className:"border-t border-zinc-800/60 px-3 py-1.5 text-[10px] text-zinc-600",children:[u.jsx("span",{className:"mr-3",children:"↑↓ to select"}),u.jsx("span",{className:"mr-3",children:"Enter to run"}),u.jsx("span",{children:"Tab to autocomplete"})]})]})}function ase(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 sse(e,t){const n=e.timestamp??0;return`${e.role}:${n}:${t}`}function ose(e,t,n,r){const i=[];for(let a=0;a<e.length;a++){const o=e[a],c=sse(o,a);if(o.role==="user"){const d=typeof o.content=="string"?o.content:JSON.stringify(o.content);if(d.startsWith("[system]"))continue;i.push(u.jsx(lse,{text:d,projectName:t,providerOverride:n,scope:r},c));continue}if(o.role==="assistant"){const d=new Map;let f=a+1;for(;f<e.length&&e[f].role==="toolResult";){const y=e[f];d.set(y.toolCallId,y),f++}const p=use(o,d,o.timestamp??0),m=S$(o);i.push(u.jsxs(S.Fragment,{children:[p.length>0&&u.jsx("div",{className:"mt-3 space-y-1.5",children:p.map(y=>u.jsx(j$,{trail:y},y.id))}),m.trim()&&u.jsxs("div",{className:"mt-3",children:[u.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),u.jsx(N$,{content:m})]})]},c)),a=f-1;continue}}return i}function lse({text:e,projectName:t,providerOverride:n,scope:r}){const[i,a]=S.useState(!1),o=S.useMemo(()=>cse(t,e,n,r),[t,e,n,r]);async function c(){try{await navigator.clipboard.writeText(o),a(!0),window.setTimeout(()=>a(!1),1500)}catch{}}return u.jsxs("div",{className:"group relative mt-3 rounded-md bg-zinc-900/60 px-3 py-2 text-zinc-200",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("div",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"You"}),u.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:o,children:i?u.jsxs(u.Fragment,{children:[u.jsx(DI,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):u.jsxs(u.Fragment,{children:[u.jsx(M7,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),u.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function cse(e,t,n,r){const i=["canonry","agent","ask",V2(e),V2(t)];return n&&i.push("--provider",n),r==="read-only"&&i.push("--scope","read-only"),i.join(" ")}function V2(e){return`'${e.replace(/'/g,"'\\''")}'`}function use(e,t,n){const r=[];for(const i of e.content){if(i.type!=="toolCall")continue;const a=i,o=t.get(a.id);r.push({id:a.id,name:a.name,args:a.arguments,startedAt:n,endedAt:o?.timestamp,isError:o?.isError,result:o?.content})}return r}function j$({trail:e}){const[t,n]=S.useState(!1),r=e.endedAt===void 0,i=!r&&e.isError===!0,a=e.endedAt!=null?e.endedAt-e.startedAt:null,o=a==null||a<0?null:a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`,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 u.jsxs("div",{className:`rounded-md border ${c} ${d} font-mono`,children:[u.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:[u.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:r?u.jsx(H7,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):i?u.jsx(LI,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):u.jsx(gG,{className:"h-3 w-3 text-zinc-500","aria-hidden":"true"})}),u.jsx("span",{className:"text-[11px] font-semibold text-zinc-100",children:e.name}),u.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px] text-zinc-500",children:[r?u.jsx("span",{className:"text-emerald-400",children:"running…"}):u.jsxs(u.Fragment,{children:[u.jsx("span",{children:i?"failed":"ok"}),o&&u.jsx("span",{children:o})]}),u.jsx(Yf,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`,"aria-hidden":"true"})]})]}),t&&u.jsxs("div",{className:"border-t border-zinc-800/60 px-2.5 py-2 text-[11px] text-zinc-400",children:[u.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:"Args"}),u.jsx("pre",{className:"mb-2 overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:Z2(e.args)}),!r&&e.result!==void 0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:i?"Error":"Result"}),u.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:Z2(e.result)})]})]})]})}function Z2(e){try{const t=typeof e=="string"?e:JSON.stringify(e,null,2);return t.length>2e3?`${t.slice(0,2e3)}
|
|
115
|
-
… (${t.length-2e3} more chars)`:t}catch{return String(e)}}function N$({content:e}){return u.jsx("div",{className:"aero-markdown text-zinc-100",children:u.jsx(Kae,{components:{h1:t=>u.jsx("h1",{...t,className:"mt-3 mb-2 text-base font-semibold text-zinc-50"}),h2:t=>u.jsx("h2",{...t,className:"mt-3 mb-2 text-sm font-semibold text-zinc-50"}),h3:t=>u.jsx("h3",{...t,className:"mt-3 mb-1.5 text-sm font-semibold text-zinc-100"}),h4:t=>u.jsx("h4",{...t,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-300"}),p:t=>u.jsx("p",{...t,className:"mb-2 leading-relaxed"}),ul:t=>u.jsx("ul",{...t,className:"mb-2 ml-4 list-disc space-y-1"}),ol:t=>u.jsx("ol",{...t,className:"mb-2 ml-4 list-decimal space-y-1"}),li:t=>u.jsx("li",{...t,className:"marker:text-zinc-600"}),strong:t=>u.jsx("strong",{...t,className:"font-semibold text-zinc-50"}),em:t=>u.jsx("em",{...t,className:"text-zinc-200"}),code:({children:t,...n})=>u.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=>u.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=>u.jsx("a",{...t,className:"text-emerald-400 underline decoration-emerald-700 hover:decoration-emerald-400",target:"_blank",rel:"noopener noreferrer"}),table:t=>u.jsx("div",{className:"mb-2 overflow-x-auto",children:u.jsx("table",{...t,className:"w-full border-collapse text-xs"})}),thead:t=>u.jsx("thead",{...t,className:"border-b border-zinc-800"}),th:t=>u.jsx("th",{...t,className:"px-2 py-1 text-left font-semibold text-zinc-300"}),tr:t=>u.jsx("tr",{...t,className:"border-b border-zinc-900"}),td:t=>u.jsx("td",{...t,className:"px-2 py-1 text-zinc-200"}),blockquote:t=>u.jsx("blockquote",{...t,className:"mb-2 border-l-2 border-zinc-700 pl-3 italic text-zinc-400"}),hr:()=>u.jsx("hr",{className:"my-3 border-zinc-800"})},children:e})})}function dse(){return u.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[u.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),u.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[u.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-emerald-400/80"}),u.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-emerald-400/60"}),u.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-emerald-400/40"})]})]})}function fse(){const e=SI(),t=/^\/projects\/([^/]+)/.exec(e.pathname),n=t?decodeURIComponent(t[1]):null,r=es({queryKey:Ar.projects.all,queryFn:zj,enabled:n!==null,staleTime:6e4});if(!n)return null;const i=r.data??[],a=i.find(o=>o.id===n)??i.find(o=>o.name===n);return a?u.jsx(tse,{projectName:a.name},a.name):null}const Y2=[{label:"Architecture",href:"https://github.com/AINYC/canonry/blob/main/docs/architecture.md"},{label:"Testing Guide",href:"https://github.com/AINYC/canonry/blob/main/docs/testing.md"}],W2=e=>({label:e,state:"checking",detail:"Checking service health"}),hse={apiStatus:W2("API"),workerStatus:W2("Worker")};function pse(e){switch(e){case hn["answer-visibility"]:return"Visibility sweep";case hn["gsc-sync"]:return"GSC sync";case hn["inspect-sitemap"]:return"Sitemap inspection";case hn["ga-sync"]:return"GA sync";case hn["bing-inspect"]:return"Bing URL inspection";case hn["site-audit"]:return"Site audit";case hn["backlink-extract"]:return"Backlink extract"}}function mse(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function gse(e){const t=pse(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function yse(e,t){return e.error?`${t}: ${e.error}`:e.location?`${t} · ${e.location}`:t}function vse(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function bse(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 xse(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function wse(){const e=S.useSyncExternalStore(WQ,Nl,Nl),t=Object.keys(e.runs).length>0||Object.keys(e.batches).length>0,n=es({queryKey:Ar.runs.all,queryFn:NI,enabled:t}),r=es({queryKey:Ar.projects.all,queryFn:zj,enabled:t}),i=S.useRef({}),a=S.useCallback(()=>{n.refetch()},[n.refetch]);return S.useEffect(()=>{t&&a()},[t,a]),S.useEffect(()=>{if(!t||typeof window>"u")return;const o=()=>{document.visibilityState==="visible"&&a()};return window.addEventListener("focus",a),document.addEventListener("visibilitychange",o),()=>{window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",o)}},[t,a]),S.useEffect(()=>{const o=n.data??[],c=r.data??[],d=Object.fromEntries(o.map(p=>[p.id,p])),f=Object.fromEntries(o.map(p=>[p.id,p.status]));for(const p of Object.values(e.runs)){const m=d[p.runId];if(!m||!JQ(m.status)||(i.current[m.id]??p.lastAnnouncedStatus)===m.status)continue;if(p.sourceAction==="run-all"){RT(m.id);continue}const v=vse(m.projectId,p.projectLabel,c);ft({title:gse(m),detail:yse(m,v),tone:mse(m.status),dedupeKey:`run:${m.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:m.id}}),RT(m.id)}for(const p of Object.values(e.batches)){const m=eX(p.runIds,d);m.finished&&(ft({title:"Run-all batch finished",detail:bse(m,p.skippedCount),tone:xse(m),dedupeKey:`batch:${p.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),XQ(p.batchId))}i.current=f},[r.data,n.data,e]),null}function Sse(){const e=Xf(),{dashboard:t,isLoading:n,refetch:r}=Ul(),o=Dy(!e,e?.health).data??e?.health??hse,c=SI(),{runId:d,evidenceId:f,closeDrawer:p}=Au(),[m,y]=S.useState(!1),v=kte(d),x=v.data??null,w=v.isLoading;S.useEffect(()=>{x&&x.status!=="running"&&x.status!=="queued"&&r()},[x?.status,r]),S.useEffect(()=>{y(!1)},[c.pathname]),S.useEffect(()=>{if(typeof window>"u"||!d&&!f)return;const C=P=>{P.key==="Escape"&&p()};return window.addEventListener("keydown",C),()=>{window.removeEventListener("keydown",C)}},[d,f,p]);const j=t??e?.dashboard??null,k=d&&j?Zee(j,d):void 0,O=f&&j?Yee(j,f):void 0,_=(()=>{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.startsWith("/projects/")){const T=C.split("/").filter(Boolean)[1];if(T&&j){const A=j.projects.find(z=>z.project.id===T);if(A)return A.project.name}return"Project"}return"Not found"})();return u.jsxs("div",{className:"app-shell",children:[u.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),u.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[u.jsx("div",{className:"sidebar-brand",children:u.jsx(KT,{})}),u.jsxs("nav",{className:"sidebar-nav",children:[u.jsxs(Qt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(q7,{className:"sidebar-icon"}),u.jsx("span",{children:"Overview"})]}),u.jsxs(Qt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[u.jsx(B7,{className:"sidebar-icon"}),u.jsx("span",{children:"Projects"})]}),u.jsxs(Qt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(J7,{className:"sidebar-icon"}),u.jsx("span",{children:"Runs"})]}),u.jsxs(Qt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(sG,{className:"sidebar-icon"}),u.jsx("span",{children:"Settings"})]}),n?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(C=>u.jsxs("div",{className:"sidebar-skeleton-item",children:[u.jsx("span",{className:"skeleton-circle size-2"}),u.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+C*15}%`}})]},C))]}):j&&j.projects.length>0?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"sidebar-section-title",children:"Projects"}),j.projects.map(C=>{const P=C.visibilitySummary.tone;return u.jsxs(Qt,{to:"/projects/$projectId",params:{projectId:C.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[u.jsx("span",{className:`sidebar-dot sidebar-dot-${P}`}),u.jsx("span",{children:C.project.name})]},C.project.id)})]}):n?null:u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"sidebar-section-title",children:"Resources"}),u.jsxs(Qt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(rG,{className:"sidebar-icon"}),u.jsx("span",{children:"Setup"})]})]})]}),u.jsx("div",{className:"sidebar-footer",children:Y2.map(C=>u.jsx("a",{className:"sidebar-footer-link",href:C.href,target:"_blank",rel:"noopener noreferrer",children:C.label},C.href))})]}),u.jsxs("div",{className:"main-area",children:[u.jsxs("header",{className:"topbar",children:[u.jsxs("div",{className:"topbar-left",children:[u.jsx("div",{className:"topbar-brand-mobile",children:u.jsx(KT,{compact:!0})}),u.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[u.jsx(Qt,{to:"/",children:"Home"}),u.jsx(Yf,{className:"breadcrumb-sep size-3"}),u.jsx("span",{className:"breadcrumb-current",children:_})]})]}),u.jsxs("div",{className:"topbar-actions",children:[u.jsxs("div",{className:"health-pill-row",children:[u.jsxs("span",{className:`health-pill health-pill-${o.apiStatus.state}`,title:ho(o.apiStatus),children:["API ",o.apiStatus.state==="ok"?"ok":o.apiStatus.state]}),u.jsxs("span",{className:`health-pill health-pill-${o.workerStatus.state}`,title:ho(o.workerStatus),children:["Worker ",o.workerStatus.state==="ok"?"ok":o.workerStatus.state]})]}),u.jsxs(we,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":m,"aria-controls":"mobile-nav",onClick:()=>y(C=>!C),children:[u.jsx(Y7,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),u.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${m?"mobile-nav-open":""}`,children:[u.jsxs(we,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>y(!1),children:[u.jsx(Wf,{className:"size-5"}),u.jsx("span",{className:"sr-only",children:"Close navigation"})]}),u.jsx(Qt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),u.jsx(Qt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),u.jsx(Qt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),u.jsx(Qt,{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?u.jsxs("div",{className:"mobile-nav-section",children:[u.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),j.projects.map(C=>u.jsx(Qt,{to:"/projects/$projectId",params:{projectId:C.project.id},className:"mobile-nav-link",children:C.project.name},C.project.id))]}):null]}),u.jsx("main",{id:"content",className:"page-shell",children:n&&!e?u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-40"}),u.jsx("div",{className:"skeleton-text-sm w-72"})]}),u.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(C=>u.jsxs("div",{className:"page-skeleton-card",children:[u.jsx("div",{className:"skeleton-text w-24"}),u.jsx("div",{className:"skeleton-text w-full"}),u.jsx("div",{className:"skeleton-text-sm w-3/4"})]},C))}),u.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(C=>u.jsxs("div",{className:"page-skeleton-card",children:[u.jsx("div",{className:"skeleton-text w-20"}),u.jsx("div",{className:"space-y-2",children:[1,2,3].map(P=>u.jsx("div",{className:"skeleton-text-sm w-full"},P))})]},C))})]}):u.jsx(Pj,{})}),u.jsxs("footer",{className:"footer",children:[u.jsxs("a",{href:"https://github.com/AINYC/canonry",target:"_blank",rel:"noopener noreferrer",className:"footer-brand",children:[u.jsx($7,{className:"size-3.5"}),u.jsx("span",{children:"Canonry"})]}),u.jsx("div",{className:"footer-links",children:Y2.map(C=>u.jsx("a",{href:C.href,target:"_blank",rel:"noopener noreferrer",children:C.label},C.href))})]})]}),k?u.jsxs($ee,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:p,children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[u.jsx(Ty,{status:k.status}),u.jsx("span",{className:"text-zinc-400",children:k.startedAt}),u.jsx("span",{className:"text-zinc-500",children:k.duration}),u.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&u.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.statusDetail}),u.jsxs("div",{className:"mt-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),w?u.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):x&&x.snapshots.length>0?u.jsxs("div",{className:"space-y-2",children:[x.snapshots.map(C=>u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[u.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:C.keyword??"Unknown key phrase"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(Cf,{provider:C.provider}),u.jsx(YL,{variant:C.citationState==="cited"?"success":"neutral",children:C.citationState})]})]}),C.model&&u.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:C.model}),C.citedDomains.length>0&&u.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[u.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",C.citedDomains.join(", ")]}),C.competitorOverlap.length>0&&u.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",C.competitorOverlap.join(", ")]}),C.groundingSources&&C.groundingSources.length>0&&u.jsxs("details",{className:"mt-2",children:[u.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[C.groundingSources.length," grounding source",C.groundingSources.length!==1?"s":""]}),u.jsx("ul",{className:"mt-1 space-y-0.5",children:C.groundingSources.map((P,T)=>u.jsx("li",{className:"text-xs text-zinc-500 truncate",children:u.jsx("a",{href:P.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:P.title||P.uri})},T))})]}),C.answerText&&u.jsxs("details",{className:"mt-1",children:[u.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),u.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:C.answerText})]})]},C.id)),x.status==="running"&&u.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[u.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Querying remaining key phrases..."]})]}):x&&x.status==="running"?u.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[u.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first key phrase result..."]}):x&&x.status==="queued"?u.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[u.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):x&&x.error?u.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[u.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),u.jsx("pre",{className:"text-xs text-rose-300/80 whitespace-pre-wrap break-words max-h-48 overflow-y-auto font-mono leading-5",children:IQ(x.error)})]}):u.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,O?u.jsx(Bee,{evidence:O.evidence,project:O.project,onClose:p}):null,u.jsx(wse,{}),u.jsx(Ate,{}),u.jsx(fse,{})]})}class jse extends S.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("[ErrorBoundary]",t,n.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?u.jsx("div",{className:"page-container",children:u.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[u.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:u.jsx(LI,{className:"size-6 text-rose-400"})}),u.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),u.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),u.jsxs("div",{className:"flex gap-3 mt-2",children:[u.jsxs(we,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[u.jsx(II,{className:"size-3.5 mr-1.5"}),"Try again"]}),u.jsx(we,{variant:"secondary",size:"sm",onClick:()=>{const t=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=t||"/"},children:"Go home"})]})]})}):this.props.children}}const We=S.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Oi("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}));We.displayName="Card";const t1=S.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Oi("flex flex-col gap-1.5 p-5",e),...t}));t1.displayName="CardHeader";const n1=S.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:Oi("font-medium tracking-tight text-zinc-50",e),...t}));n1.displayName="CardTitle";const r1=S.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:Oi("text-sm text-zinc-500",e),...t}));r1.displayName="CardDescription";const Bm=S.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Oi("p-5 pt-0",e),...t}));Bm.displayName="CardContent";function Nse({points:e,tone:t}){const n=S.useId();if(e.length===0)return null;const r=42,i=132,a=5,o=Math.min(...e),d=Math.max(...e)-o||1,f=i-a*2,p=r-a*2,m=e.map((y,v)=>{const x=a+v/Math.max(e.length-1,1)*f,w=a+(1-(y-o)/d)*p;return`${x},${w}`}).join(" ");return u.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${i} ${r}`,"aria-hidden":"true",children:[u.jsx("defs",{children:u.jsx("clipPath",{id:n,children:u.jsx("rect",{x:a,y:a,width:f,height:p,rx:"8"})})}),u.jsx("line",{className:"sparkline-guide",x1:a,x2:i-a,y1:r-a,y2:r-a}),u.jsx("polyline",{clipPath:`url(#${n})`,points:m,vectorEffect:"non-scaling-stroke"})]})}function kse({project:e}){return u.jsxs(Qt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[u.jsxs("div",{className:"project-row-primary",children:[u.jsxs("div",{children:[u.jsx("p",{className:"project-name",children:e.project.name}),u.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),u.jsx("p",{className:"project-insight",children:e.insight})]}),u.jsx("div",{className:"project-row-stat",children:u.jsxs("div",{className:"metric-inline-block",children:[u.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),u.jsx("p",{className:`metric-inline-value ${e.visibilityTone==="caution"?"text-amber-400":""}`,children:e.visibilityScore}),u.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta}),e.providerCoverage&&u.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),u.jsx("div",{className:"project-row-stat",children:u.jsxs("div",{className:"metric-inline-block",children:[u.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),u.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),u.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Ay(e.lastRun.status)]})]})}),u.jsx("div",{className:"project-row-chart",children:u.jsx(Nse,{points:e.trend,tone:AL(e.lastRun.status)})}),u.jsx("span",{className:"project-row-link",children:u.jsx(Yf,{className:"h-4 w-4 text-zinc-500"})})]})}function Cse(){const e=Xf(),{dashboard:t,isLoading:n}=Ul(),r=t??e?.dashboard;if(!r||n)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-32"}),u.jsx("div",{className:"skeleton-text-sm w-64"})]}),u.jsx("div",{className:"space-y-3",children:[1,2,3].map(p=>u.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[u.jsxs("div",{className:"flex-1 space-y-2",children:[u.jsx("div",{className:"skeleton-text w-36"}),u.jsx("div",{className:"skeleton-text-sm w-48"})]}),u.jsx("div",{className:"skeleton-text w-16"}),u.jsx("div",{className:"skeleton-text w-16"}),u.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},p))})]});const i=r.portfolioOverview,c=Dy(!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=qQ(i.systemHealth,c,r.settings),{openRun:f}=Au();return u.jsxs("div",{className:"page-container",children:[u.jsxs("div",{className:"page-header",children:[u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Portfolio"}),u.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),u.jsx("div",{className:"page-header-right",children:u.jsx("p",{className:"text-[11px] text-zinc-600",children:i.lastUpdatedAt})})]}),i.projects.length>0?u.jsx("div",{className:"project-list project-list-scrollable",children:i.projects.map(p=>u.jsx(kse,{project:p},p.project.id))}):u.jsxs(We,{className:"surface-card empty-card",children:[u.jsx("h3",{children:i.emptyState?.title??"No projects yet"}),u.jsx("p",{className:"supporting-copy",children:i.emptyState?.detail}),u.jsx(we,{size:"sm",asChild:!0,children:u.jsx(Qt,{to:i.emptyState?.ctaHref==="/setup"||!i.emptyState?.ctaHref?"/setup":"/",children:i.emptyState?.ctaLabel??"Launch setup"})})]}),u.jsxs("div",{className:"overview-secondary-grid",children:[i.attentionItems.length>0&&u.jsxs("section",{className:"overview-secondary-section",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),u.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),u.jsx("div",{className:"attention-list attention-list-scrollable",children:i.attentionItems.map(p=>u.jsxs(Qt,{to:p.href,className:`attention-item attention-item-${p.tone}`,children:[u.jsxs("div",{children:[u.jsx("p",{className:"attention-title",children:p.title}),u.jsx("p",{className:"attention-detail",children:p.detail})]}),u.jsx("span",{className:"attention-action",children:p.actionLabel})]},p.id))})]}),u.jsxs("section",{className:"overview-secondary-section",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),u.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),u.jsx("div",{className:"compact-stack compact-stack-scrollable",children:i.recentRuns.length>0?i.recentRuns.map(p=>u.jsxs("button",{className:"compact-run",type:"button",onClick:()=>f(p.id),children:[u.jsxs("div",{children:[u.jsx("p",{className:"compact-run-title",children:p.projectName}),u.jsx("p",{className:"compact-run-detail",children:p.summary})]}),u.jsx(Ty,{status:p.status})]},p.id)):u.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),u.jsxs("section",{className:"page-section",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),u.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),u.jsx("div",{className:"health-grid",children:d.map(p=>u.jsxs(We,{className:"surface-card compact-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:p.label}),u.jsx("h3",{children:p.detail})]}),u.jsx(Et,{tone:p.tone,title:p.id==="api"?ho(c.apiStatus):p.id==="worker"?ho(c.workerStatus):void 0,children:p.label})]}),u.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const vN=Symbol.for("yaml.alias"),i1=Symbol.for("yaml.document"),so=Symbol.for("yaml.map"),k$=Symbol.for("yaml.pair"),ga=Symbol.for("yaml.scalar"),Tu=Symbol.for("yaml.seq"),ji=Symbol.for("yaml.node.type"),Fl=e=>!!e&&typeof e=="object"&&e[ji]===vN,By=e=>!!e&&typeof e=="object"&&e[ji]===i1,th=e=>!!e&&typeof e=="object"&&e[ji]===so,bn=e=>!!e&&typeof e=="object"&&e[ji]===k$,Kt=e=>!!e&&typeof e=="object"&&e[ji]===ga,nh=e=>!!e&&typeof e=="object"&&e[ji]===Tu;function yn(e){if(e&&typeof e=="object")switch(e[ji]){case so:case Tu:return!0}return!1}function vn(e){if(e&&typeof e=="object")switch(e[ji]){case vN:case so:case ga:case Tu:return!0}return!1}const C$=e=>(Kt(e)||yn(e))&&!!e.anchor,el=Symbol("break visit"),_se=Symbol("skip children"),mf=Symbol("remove node");function Pu(e,t){const n=Ase(t);By(e)?Gc(null,e.contents,n,Object.freeze([e]))===mf&&(e.contents=null):Gc(null,e,n,Object.freeze([]))}Pu.BREAK=el;Pu.SKIP=_se;Pu.REMOVE=mf;function Gc(e,t,n,r){const i=Ose(e,t,n,r);if(vn(i)||bn(i))return Ese(e,r,i),Gc(e,i,n,r);if(typeof i!="symbol"){if(yn(t)){r=Object.freeze(r.concat(t));for(let a=0;a<t.items.length;++a){const o=Gc(a,t.items[a],n,r);if(typeof o=="number")a=o-1;else{if(o===el)return el;o===mf&&(t.items.splice(a,1),a-=1)}}}else if(bn(t)){r=Object.freeze(r.concat(t));const a=Gc("key",t.key,n,r);if(a===el)return el;a===mf&&(t.key=null);const o=Gc("value",t.value,n,r);if(o===el)return el;o===mf&&(t.value=null)}}return i}function Ase(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 Ose(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(th(t))return n.Map?.(e,t,r);if(nh(t))return n.Seq?.(e,t,r);if(bn(t))return n.Pair?.(e,t,r);if(Kt(t))return n.Scalar?.(e,t,r);if(Fl(t))return n.Alias?.(e,t,r)}function Ese(e,t,n){const r=t[t.length-1];if(yn(r))r.items[e]=n;else if(bn(r))e==="key"?r.key=n:r.value=n;else if(By(r))r.contents=n;else{const i=Fl(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Tse={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Pse=e=>e.replace(/[!,[\]{}]/g,t=>Tse[t]);class dr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},dr.defaultYaml,t),this.tags=Object.assign({},dr.defaultTags,n)}clone(){const t=new dr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new dr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:dr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},dr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:dr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},dr.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[a,o]=r;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[a]=r;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const o=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const a=this.tags[r];if(a)try{return a+decodeURIComponent(i)}catch(o){return n(String(o)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+Pse(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&&vn(t.contents)){const a={};Pu(t.contents,(o,c)=>{vn(c)&&c.tag&&(a[c.tag]=!0)}),i=Object.keys(a)}else i=[];for(const[a,o]of r)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(c=>c.startsWith(o)))&&n.push(`%TAG ${a} ${o}`);return n.join(`
|
|
116
|
-
`)}}dr.defaultYaml={explicit:!1,version:"1.2"};dr.defaultTags={"!!":"tag:yaml.org,2002:"};function _$(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 A$(e){const t=new Set;return Pu(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function O$(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function zse(e,t){const n=[],r=new Map;let i=null;return{onAnchor:a=>{n.push(a),i??(i=A$(e));const o=O$(t,i);return i.add(o),o},setAnchors:()=>{for(const a of n){const o=r.get(a);if(typeof o=="object"&&o.anchor&&(Kt(o.node)||yn(o.node)))o.node.anchor=o.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=a,c}}},sourceObjects:r}}function Vc(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,a=r.length;i<a;++i){const o=r[i],c=Vc(e,r,String(i),o);c===void 0?delete r[i]:c!==o&&(r[i]=c)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const a=r.get(i),o=Vc(e,r,i,a);o===void 0?r.delete(i):o!==a&&r.set(i,o)}else if(r instanceof Set)for(const i of Array.from(r)){const a=Vc(e,r,i,i);a===void 0?r.delete(i):a!==i&&(r.delete(i),r.add(a))}else for(const[i,a]of Object.entries(r)){const o=Vc(e,r,i,a);o===void 0?delete r[i]:o!==a&&(r[i]=o)}return e.call(t,n,r)}function Si(e,t,n){if(Array.isArray(e))return e.map((r,i)=>Si(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!C$(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 bN{constructor(t){Object.defineProperty(this,ji,{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(!By(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Si(this,"",o);if(typeof i=="function")for(const{count:d,res:f}of o.anchors.values())i(f,d);return typeof a=="function"?Vc(a,{"":c},"",c):c}}class xN extends bN{constructor(t){super(vN),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=[],Pu(t,{Node:(a,o)=>{(Fl(o)||C$(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let i;for(const a of r){if(a===this)break;a.anchor===this.source&&(i=a)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:a}=n,o=this.resolve(i,n);if(!o){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let c=r.get(o);if(c||(Si(o,null,n),c=r.get(o)),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=Fm(i,o,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(_$(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 Fm(e,t,n){if(Fl(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(yn(t)){let r=0;for(const i of t.items){const a=Fm(e,i,n);a>r&&(r=a)}return r}else if(bn(t)){const r=Fm(e,t.key,n),i=Fm(e,t.value,n);return Math.max(r,i)}return 1}const E$=e=>!e||typeof e!="function"&&typeof e!="object";class et extends bN{constructor(t){super(ga),this.value=t}toJSON(t,n){return n?.keep?this.value:Si(this.value,t,n)}toString(){return String(this.value)}}et.BLOCK_FOLDED="BLOCK_FOLDED";et.BLOCK_LITERAL="BLOCK_LITERAL";et.PLAIN="PLAIN";et.QUOTE_DOUBLE="QUOTE_DOUBLE";et.QUOTE_SINGLE="QUOTE_SINGLE";const Rse="tag:yaml.org,2002:";function Mse(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 Ef(e,t,n){if(By(e)&&(e=e.contents),vn(e))return e;if(bn(e)){const m=n.schema[so].createNode?.(n.schema,null,n);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:c}=n;let d;if(r&&e&&typeof e=="object"){if(d=c.get(e),d)return d.anchor??(d.anchor=i(e)),new xN(d.anchor);d={anchor:null,node:null},c.set(e,d)}t?.startsWith("!!")&&(t=Rse+t.slice(2));let f=Mse(e,t,o.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new et(e);return d&&(d.node=m),m}f=e instanceof Map?o[so]:Symbol.iterator in Object(e)?o[Tu]:o[so]}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 et(e);return t?p.tag=t:f.default||(p.tag=f.tag),d&&(d.node=p),p}function vg(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const a=t[i];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const o=[];o[a]=r,r=o}else r=new Map([[a,r]])}return Ef(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 af=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class T$ extends bN{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=>vn(r)||bn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(af(t))this.add(n);else{const[r,...i]=t,a=this.get(r,!0);if(yn(a))a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,vg(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(yn(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&&Kt(a)?a.value:a:yn(a)?a.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!bn(n))return!1;const r=n.value;return r==null||t&&Kt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const i=this.get(n,!0);return yn(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(yn(a))a.setIn(i,n);else if(a===void 0&&this.schema)this.set(r,vg(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const Dse=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Qa(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ll=(e,t,n)=>e.endsWith(`
|
|
117
|
-
`)?Qa(n,t):n.includes(`
|
|
118
|
-
`)?`
|
|
119
|
-
`+Qa(n,t):(e.endsWith(" ")?"":" ")+n,P$="flow",a1="block",qm="quoted";function Fy(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,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,x=!1,w=-1,j=-1,k=-1;n===a1&&(w=Q2(e,w,t.length),w!==-1&&(m=w+d));for(let _;_=e[w+=1];){if(n===qm&&_==="\\"){switch(j=w,e[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}k=w}if(_===`
|
|
120
|
-
`)n===a1&&(w=Q2(e,w,t.length)),m=w+t.length+d,y=void 0;else{if(_===" "&&v&&v!==" "&&v!==`
|
|
121
|
-
`&&v!==" "){const C=e[w+1];C&&C!==" "&&C!==`
|
|
122
|
-
`&&C!==" "&&(y=w)}if(w>=m)if(y)f.push(y),m=y+d,y=void 0;else if(n===qm){for(;v===" "||v===" ";)v=_,_=e[w+=1],x=!0;const C=w>k+1?w-2:j-1;if(p[C])return e;f.push(C),p[C]=!0,m=C+d,y=void 0}else x=!0}v=_}if(x&&c&&c(),f.length===0)return e;o&&o();let O=e.slice(0,f[0]);for(let _=0;_<f.length;++_){const C=f[_],P=f[_+1]||e.length;C===0?O=`
|
|
123
|
-
${t}${e.slice(0,P)}`:(n===qm&&p[C]&&(O+=`${e[C]}\\`),O+=`
|
|
124
|
-
${t}${e.slice(C+1,P)}`)}return O}function Q2(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!==`
|
|
125
|
-
`);r=t,i=t+1,a=e[i]}return r}const qy=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Ky=e=>/^(%|---|\.\.\.)/m.test(e);function Ise(e,t,n){if(!t||t<0)return!1;const r=t-n,i=e.length;if(i<=r)return!1;for(let a=0,o=0;a<i;++a)if(e[a]===`
|
|
126
|
-
`){if(a-o>r)return!0;if(o=a+1,i-o<=r)return!1}return!0}function gf(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Ky(e)?" ":"");let o="",c=0;for(let d=0,f=n[d];f;f=n[++d])if(f===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(o+=n.slice(c,d)+"\\ ",d+=1,c=d,f="\\"),f==="\\")switch(n[d+1]){case"u":{o+=n.slice(c,d);const p=n.substr(d+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=n.substr(d,6)}d+=5,c=d+1}break;case"n":if(r||n[d+2]==='"'||n.length<i)d+=1;else{for(o+=n.slice(c,d)+`
|
|
127
|
-
|
|
128
|
-
`;n[d+2]==="\\"&&n[d+3]==="n"&&n[d+4]!=='"';)o+=`
|
|
129
|
-
`,d+=2;o+=a,n[d+2]===" "&&(o+="\\"),d+=1,c=d+1}break;default:d+=1}return o=c?o+n.slice(c):n,r?o:Fy(o,a,qm,qy(t,!1))}function s1(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
130
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return gf(e,t);const n=t.indent||(Ky(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
131
|
-
${n}`)+"'";return t.implicitKey?r:Fy(r,n,P$,qy(t,!1))}function Zc(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=gf;else{const i=e.includes('"'),a=e.includes("'");i&&!a?r=s1:a&&!i?r=gf:r=n?s1:gf}return r(e,t)}let o1;try{o1=new RegExp(`(^|(?<!
|
|
132
|
-
))
|
|
133
|
-
+(?!
|
|
134
|
-
|$)`,"g")}catch{o1=/\n+(?!\n|$)/g}function Km({comment:e,type:t,value:n},r,i,a){const{blockQuote:o,commentString:c,lineWidth:d}=r.options;if(!o||/\n[\t ]+$/.test(n))return Zc(n,r);const f=r.indent||(r.forceBlockIndent||Ky(n)?" ":""),p=o==="literal"?!0:o==="folded"||t===et.BLOCK_FOLDED?!1:t===et.BLOCK_LITERAL?!0:!Ise(n,d,f.length);if(!n)return p?`|
|
|
135
|
-
`:`>
|
|
136
|
-
`;let m,y;for(y=n.length;y>0;--y){const P=n[y-1];if(P!==`
|
|
137
|
-
`&&P!==" "&&P!==" ")break}let v=n.substring(y);const x=v.indexOf(`
|
|
138
|
-
`);x===-1?m="-":n===v||x!==v.length-1?(m="+",a&&a()):m="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
|
|
139
|
-
`&&(v=v.slice(0,-1)),v=v.replace(o1,`$&${f}`));let w=!1,j,k=-1;for(j=0;j<n.length;++j){const P=n[j];if(P===" ")w=!0;else if(P===`
|
|
140
|
-
`)k=j;else break}let O=n.substring(0,k<j?k+1:j);O&&(n=n.substring(O.length),O=O.replace(/\n+/g,`$&${f}`));let C=(w?f?"2":"1":"")+m;if(e&&(C+=" "+c(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const P=n.replace(/\n+/g,`
|
|
141
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let T=!1;const A=qy(r,!0);o!=="folded"&&t!==et.BLOCK_FOLDED&&(A.onOverflow=()=>{T=!0});const z=Fy(`${O}${P}${v}`,f,a1,A);if(!T)return`>${C}
|
|
142
|
-
${f}${z}`}return n=n.replace(/\n+/g,`$&${f}`),`|${C}
|
|
143
|
-
${f}${O}${n}${v}`}function Lse(e,t,n,r){const{type:i,value:a}=e,{actualString:o,implicitKey:c,indent:d,indentStep:f,inFlow:p}=t;if(c&&a.includes(`
|
|
144
|
-
`)||p&&/[[\]{},]/.test(a))return Zc(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return c||p||!a.includes(`
|
|
145
|
-
`)?Zc(a,t):Km(e,t,n,r);if(!c&&!p&&i!==et.PLAIN&&a.includes(`
|
|
146
|
-
`))return Km(e,t,n,r);if(Ky(a)){if(d==="")return t.forceBlockIndent=!0,Km(e,t,n,r);if(c&&d===f)return Zc(a,t)}const m=a.replace(/\n+/g,`$&
|
|
147
|
-
${d}`);if(o){const y=w=>w.default&&w.tag!=="tag:yaml.org,2002:str"&&w.test?.test(m),{compat:v,tags:x}=t.doc.schema;if(x.some(y)||v?.some(y))return Zc(a,t)}return c?m:Fy(m,d,P$,qy(t,!1))}function wN(e,t,n,r){const{implicitKey:i,inFlow:a}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==et.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(c=et.QUOTE_DOUBLE);const d=p=>{switch(p){case et.BLOCK_FOLDED:case et.BLOCK_LITERAL:return i||a?Zc(o.value,t):Km(o,t,n,r);case et.QUOTE_DOUBLE:return gf(o.value,t);case et.QUOTE_SINGLE:return s1(o.value,t);case et.PLAIN:return Lse(o,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 z$(e,t){const n=Object.assign({blockQuote:!0,commentString:Dse,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 $se(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(Kt(t)){r=t.value;let i=e.filter(a=>a.identify?.(r));if(i.length>1){const a=i.filter(o=>o.test);a.length>0&&(i=a)}n=i.find(a=>a.format===t.format)??i.find(a=>!a.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function Use(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],a=(Kt(e)||yn(e))&&e.anchor;a&&_$(a)&&(n.add(a),i.push(`&${a}`));const o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(" ")}function hu(e,t,n,r){if(bn(e))return e.toString(t,n,r);if(Fl(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const a=vn(e)?e:t.doc.createNode(e,{onTagObj:d=>i=d});i??(i=$se(t.doc.schema.tags,a));const o=Use(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const c=typeof i.stringify=="function"?i.stringify(a,t,n,r):Kt(a)?wN(a,t,n,r):a.toString(t,n,r);return o?Kt(a)||c[0]==="{"||c[0]==="["?`${o} ${c}`:`${o}
|
|
148
|
-
${t.indent}${c}`:c}function Bse({key:e,value:t},n,r,i){const{allNullValues:a,doc:o,indent:c,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:m}}=n;let y=vn(e)&&e.comment||null;if(m){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(yn(e)||!vn(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let v=!m&&(!e||y&&t==null&&!n.inFlow||yn(e)||(Kt(e)?e.type===et.BLOCK_FOLDED||e.type===et.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(m||!a),indent:c+d});let x=!1,w=!1,j=hu(e,n,()=>x=!0,()=>w=!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 x&&r&&r(),j===""?"?":v?`? ${j}`:j}else if(a&&!m||t==null&&v)return j=`? ${j}`,y&&!x?j+=ll(j,n.indent,f(y)):w&&i&&i(),j;x&&(y=null),v?(y&&(j+=ll(j,n.indent,f(y))),j=`? ${j}
|
|
149
|
-
${c}:`):(j=`${j}:`,y&&(j+=ll(j,n.indent,f(y))));let k,O,_;vn(t)?(k=!!t.spaceBefore,O=t.commentBefore,_=t.comment):(k=!1,O=null,_=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!v&&!y&&Kt(t)&&(n.indentAtStart=j.length+1),w=!1,!p&&d.length>=2&&!n.inFlow&&!v&&nh(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let C=!1;const P=hu(t,n,()=>C=!0,()=>w=!0);let T=" ";if(y||k||O){if(T=k?`
|
|
150
|
-
`:"",O){const A=f(O);T+=`
|
|
151
|
-
${Qa(A,n.indent)}`}P===""&&!n.inFlow?T===`
|
|
152
|
-
`&&_&&(T=`
|
|
153
|
-
|
|
154
|
-
`):T+=`
|
|
155
|
-
${n.indent}`}else if(!v&&yn(t)){const A=P[0],z=P.indexOf(`
|
|
156
|
-
`),I=z!==-1,q=n.inFlow??t.flow??t.items.length===0;if(I||!q){let U=!1;if(I&&(A==="&"||A==="!")){let L=P.indexOf(" ");A==="&"&&L!==-1&&L<z&&P[L+1]==="!"&&(L=P.indexOf(" ",L+1)),(L===-1||z<L)&&(U=!0)}U||(T=`
|
|
157
|
-
${n.indent}`)}}else(P===""||P[0]===`
|
|
158
|
-
`)&&(T="");return j+=T+P,n.inFlow?C&&r&&r():_&&!C?j+=ll(j,n.indent,f(_)):w&&i&&i(),j}function Fse(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const um="<<",ts={identify:e=>e===um||typeof e=="symbol"&&e.description===um,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new et(Symbol(um)),{addToJSMap:R$}),stringify:()=>um},qse=(e,t)=>(ts.identify(t)||Kt(t)&&(!t.type||t.type===et.PLAIN)&&ts.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===ts.tag&&n.default);function R$(e,t,n){if(n=e&&Fl(n)?n.resolve(e.doc):n,nh(n))for(const r of n.items)$x(e,t,r);else if(Array.isArray(n))for(const r of n)$x(e,t,r);else $x(e,t,n)}function $x(e,t,n){const r=e&&Fl(n)?n.resolve(e.doc):n;if(!th(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[a,o]of i)t instanceof Map?t.has(a)||t.set(a,o):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function M$(e,t,{key:n,value:r}){if(vn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(qse(e,n))R$(e,t,r);else{const i=Si(n,"",e);if(t instanceof Map)t.set(i,Si(r,i,e));else if(t instanceof Set)t.add(i);else{const a=Kse(n,i,e),o=Si(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Kse(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(vn(e)&&n?.doc){const r=z$(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)+'..."'),Fse(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 SN(e,t,n){const r=Ef(e,void 0,n),i=Ef(t,void 0,n);return new pr(r,i)}class pr{constructor(t,n=null){Object.defineProperty(this,ji,{value:k$}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return vn(n)&&(n=n.clone(t)),vn(r)&&(r=r.clone(t)),new pr(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return M$(n,r,this)}toString(t,n,r){return t?.doc?Bse(this,t,n,r):JSON.stringify(this)}}function D$(e,t,n){return(t.inFlow??e.flow?Gse:Hse)(e,t,n)}function Hse({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:c}){const{indent:d,options:{commentString:f}}=n,p=Object.assign({},n,{indent:a,type:null});let m=!1;const y=[];for(let x=0;x<t.length;++x){const w=t[x];let j=null;if(vn(w))!m&&w.spaceBefore&&y.push(""),bg(n,y,w.commentBefore,m),w.comment&&(j=w.comment);else if(bn(w)){const O=vn(w.key)?w.key:null;O&&(!m&&O.spaceBefore&&y.push(""),bg(n,y,O.commentBefore,m))}m=!1;let k=hu(w,p,()=>j=null,()=>m=!0);j&&(k+=ll(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 x=1;x<y.length;++x){const w=y[x];v+=w?`
|
|
159
|
-
${d}${w}`:`
|
|
160
|
-
`}}return e?(v+=`
|
|
161
|
-
`+Qa(f(e),d),c&&c()):m&&o&&o(),v}function Gse({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:a,flowCollectionPadding:o,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 x=0;x<e.length;++x){const w=e[x];let j=null;if(vn(w))w.spaceBefore&&m.push(""),bg(t,m,w.commentBefore,!1),w.comment&&(j=w.comment);else if(bn(w)){const O=vn(w.key)?w.key:null;O&&(O.spaceBefore&&m.push(""),bg(t,m,O.commentBefore,!1),O.comment&&(f=!0));const _=vn(w.value)?w.value:null;_?(_.comment&&(j=_.comment),_.commentBefore&&(f=!0)):w.value==null&&O?.comment&&(j=O.comment)}j&&(f=!0);let k=hu(w,d,()=>j=null);x<e.length-1&&(k+=","),j&&(k+=ll(k,r,c(j))),!f&&(m.length>p||k.includes(`
|
|
162
|
-
`))&&(f=!0),m.push(k),p=m.length}const{start:y,end:v}=n;if(m.length===0)return y+v;if(!f){const x=m.reduce((w,j)=>w+j.length+2,2);f=t.options.lineWidth>0&&x>t.options.lineWidth}if(f){let x=y;for(const w of m)x+=w?`
|
|
163
|
-
${a}${i}${w}`:`
|
|
164
|
-
`;return`${x}
|
|
165
|
-
${i}${v}`}else return`${y}${o}${m.join(" ")}${o}${v}`}function bg({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=Qa(t(r),e);n.push(a.trimStart())}}function cl(e,t){const n=Kt(t)?t.value:t;for(const r of e)if(bn(r)&&(r.key===t||r.key===n||Kt(r.key)&&r.key.value===n))return r}class vi extends T${static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(so,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:a}=r,o=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)&&o.items.push(SN(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"&&o.items.sort(t.sortMapEntries),o}add(t,n){let r;bn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new pr(t,t?.value):r=new pr(t.key,t.value);const i=cl(this.items,r.key),a=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Kt(i.value)&&E$(r.value)?i.value.value=r.value:i.value=r.value}else if(a){const o=this.items.findIndex(c=>a(r,c)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=cl(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=cl(this.items,t)?.value;return(!n&&Kt(i)?i.value:i)??void 0}has(t){return!!cl(this.items,t)}set(t,n){this.add(new pr(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)M$(n,i,a);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!bn(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})),D$(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const zu={collection:"map",default:!0,nodeClass:vi,tag:"tag:yaml.org,2002:map",resolve(e,t){return th(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>vi.from(e,t,n)};class Cl extends T${static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Tu,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=dm(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=dm(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Kt(i)?i.value:i}has(t){const n=dm(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=dm(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];Kt(i)&&E$(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(Si(a,String(i++),n));return r}toString(t,n,r){return t?D$(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let c of n){if(typeof i=="function"){const d=n instanceof Set?c:String(o++);c=i.call(n,d,c)}a.items.push(Ef(c,void 0,r))}}return a}}function dm(e){let t=Kt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Ru={collection:"seq",default:!0,nodeClass:Cl,tag:"tag:yaml.org,2002:seq",resolve(e,t){return nh(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Cl.from(e,t,n)},Hy={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),wN(e,t,n,r)}},Gy={identify:e=>e==null,createNode:()=>new et(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new et(null),stringify:({source:e},t)=>typeof e=="string"&&Gy.test.test(e)?e:t.options.nullStr},jN={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new et(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&jN.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 Wi({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let a=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(a)){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let c=t-(a.length-o-1);for(;c-- >0;)a+="0"}return a}const I$={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:Wi},L$={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():Wi(e)}},$$={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 et(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Wi},Vy=e=>typeof e=="bigint"||Number.isInteger(e),NN=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function U$(e,t,n){const{value:r}=e;return Vy(r)&&r>=0?n+r.toString(t):Wi(e)}const B$={identify:e=>Vy(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>NN(e,2,8,n),stringify:e=>U$(e,8,"0o")},F$={identify:Vy,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>NN(e,0,10,n),stringify:Wi},q$={identify:e=>Vy(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>NN(e,2,16,n),stringify:e=>U$(e,16,"0x")},Vse=[zu,Ru,Hy,Gy,jN,B$,F$,q$,I$,L$,$$];function X2(e){return typeof e=="bigint"||Number.isInteger(e)}const fm=({value:e})=>JSON.stringify(e),Zse=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:fm},{identify:e=>e==null,createNode:()=>new et(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:fm},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:fm},{identify:X2,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})=>X2(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:fm}],Yse={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Wse=[zu,Ru].concat(Zse,Yse),kN={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return"";const o=n;let c;if(typeof btoa=="function"){let d="";for(let f=0;f<o.length;++f)d+=String.fromCharCode(o[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=et.BLOCK_LITERAL),t!==et.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===et.BLOCK_LITERAL?`
|
|
166
|
-
`:" ")}return wN({comment:e,type:t,value:c},r,i,a)}};function K$(e,t){if(nh(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!bn(r)){if(th(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new pr(new et(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
|
|
167
|
-
${i.key.commentBefore}`:r.commentBefore),r.comment){const a=i.value??i.key;a.comment=a.comment?`${r.comment}
|
|
168
|
-
${a.comment}`:r.comment}r=i}e.items[n]=bn(r)?r:new pr(r)}}else t("Expected a sequence for this tag");return e}function H$(e,t,n){const{replacer:r}=n,i=new Cl(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof r=="function"&&(o=r.call(t,String(a++),o));let c,d;if(Array.isArray(o))if(o.length===2)c=o[0],d=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const f=Object.keys(o);if(f.length===1)c=f[0],d=o[c];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else c=o;i.items.push(SN(c,d,n))}return i}const CN={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:K$,createNode:H$};class iu extends Cl{constructor(){super(),this.add=vi.prototype.add.bind(this),this.delete=vi.prototype.delete.bind(this),this.get=vi.prototype.get.bind(this),this.has=vi.prototype.has.bind(this),this.set=vi.prototype.set.bind(this),this.tag=iu.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n?.onCreate&&n.onCreate(r);for(const i of this.items){let a,o;if(bn(i)?(a=Si(i.key,"",n),o=Si(i.value,a,n)):a=Si(i,"",n),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,o)}return r}static from(t,n,r){const i=H$(t,n,r),a=new this;return a.items=i.items,a}}iu.tag="tag:yaml.org,2002:omap";const _N={collection:"seq",identify:e=>e instanceof Map,nodeClass:iu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=K$(e,t),r=[];for(const{key:i}of n.items)Kt(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new iu,n)},createNode:(e,t,n)=>iu.from(e,t,n)};function G$({value:e,source:t},n){return t&&(e?V$:Z$).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const V$={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 et(!0),stringify:G$},Z$={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 et(!1),stringify:G$},Qse={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:Wi},Xse={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():Wi(e)}},Jse={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 et(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:Wi},rh=e=>typeof e=="bigint"||Number.isInteger(e);function Zy(e,t,n,{intAsBigInt:r}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return i==="-"?BigInt(-1)*o:o}const a=parseInt(e,n);return i==="-"?-1*a:a}function AN(e,t,n){const{value:r}=e;if(rh(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return Wi(e)}const eoe={identify:rh,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Zy(e,2,2,n),stringify:e=>AN(e,2,"0b")},toe={identify:rh,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Zy(e,1,8,n),stringify:e=>AN(e,8,"0")},noe={identify:rh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Zy(e,0,10,n),stringify:Wi},roe={identify:rh,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Zy(e,2,16,n),stringify:e=>AN(e,16,"0x")};class au extends vi{constructor(t){super(t),this.tag=au.tag}add(t){let n;bn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new pr(t.key,null):n=new pr(t,null),cl(this.items,n.key)||this.items.push(n)}get(t,n){const r=cl(this.items,t);return!n&&bn(r)?Kt(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=cl(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new pr(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),a.items.push(SN(o,null,r));return a}}au.tag="tag:yaml.org,2002:set";const ON={collection:"map",identify:e=>e instanceof Set,nodeClass:au,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>au.from(e,t,n),resolve(e,t){if(th(e)){if(e.hasAllNullValues(!0))return Object.assign(new au,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function EN(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=o=>t?BigInt(o):Number(o),a=r.replace(/_/g,"").split(":").reduce((o,c)=>o*i(60)+i(c),i(0));return n==="-"?i(-1)*a:a}function Y$(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return Wi(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const W$={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})=>EN(e,n),stringify:Y$},Q$={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=>EN(e,!1),stringify:Y$},Yy={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(Yy.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,a,o,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,o||0,c||0,d);const p=t[8];if(p&&p!=="Z"){let m=EN(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$/,"")??""},J2=[zu,Ru,Hy,Gy,V$,Z$,eoe,toe,noe,roe,Qse,Xse,Jse,kN,ts,_N,CN,ON,W$,Q$,Yy],eP=new Map([["core",Vse],["failsafe",[zu,Ru,Hy]],["json",Wse],["yaml11",J2],["yaml-1.1",J2]]),tP={binary:kN,bool:jN,float:$$,floatExp:L$,floatNaN:I$,floatTime:Q$,int:F$,intHex:q$,intOct:B$,intTime:W$,map:zu,merge:ts,null:Gy,omap:_N,pairs:CN,seq:Ru,set:ON,timestamp:Yy},ioe={"tag:yaml.org,2002:binary":kN,"tag:yaml.org,2002:merge":ts,"tag:yaml.org,2002:omap":_N,"tag:yaml.org,2002:pairs":CN,"tag:yaml.org,2002:set":ON,"tag:yaml.org,2002:timestamp":Yy};function Ux(e,t,n){const r=eP.get(t);if(r&&!e)return n&&!r.includes(ts)?r.concat(ts):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const a=Array.from(eP.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${a} or define customTags array`)}if(Array.isArray(e))for(const a of e)i=i.concat(a);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(ts)),i.reduce((a,o)=>{const c=typeof o=="string"?tP[o]:o;if(!c){const d=JSON.stringify(o),f=Object.keys(tP).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 aoe=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class TN{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:a,sortMapEntries:o,toStringDefaults:c}){this.compat=Array.isArray(t)?Ux(t,"compat"):t?Ux(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=i?ioe:{},this.tags=Ux(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,so,{value:zu}),Object.defineProperty(this,ga,{value:Hy}),Object.defineProperty(this,Tu,{value:Ru}),this.sortMapEntries=typeof o=="function"?o:o===!0?aoe:null}clone(){const t=Object.create(TN.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function soe(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=z$(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=a(e.commentBefore);n.unshift(Qa(d,""))}let o=!1,c=null;if(e.contents){if(vn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=a(e.contents.commentBefore);n.push(Qa(p,""))}i.forceBlockIndent=!!e.comment,c=e.contents.comment}const d=c?void 0:()=>o=!0;let f=hu(e.contents,i,()=>c=null,d);c&&(f+=ll(f,"",a(c))),(f[0]==="|"||f[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${f}`:n.push(f)}else n.push(hu(e.contents,i));if(e.directives?.docEnd)if(e.comment){const d=a(e.comment);d.includes(`
|
|
169
|
-
`)?(n.push("..."),n.push(Qa(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&o&&(d=d.replace(/^\n+/,"")),d&&((!o||c)&&n[n.length-1]!==""&&n.push(""),n.push(Qa(a(d),"")))}return n.join(`
|
|
170
|
-
`)+`
|
|
171
|
-
`}class Wy{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ji,{value:i1});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);const a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=a;let{version:o}=a;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new dr({version:o}),this.setSchema(o,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(Wy.prototype,{[ji]:{value:i1}});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=vn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){zc(this.contents)&&this.contents.add(t)}addIn(t,n){zc(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=A$(this);t.anchor=!n||r.has(n)?O$(n||"a",r):n}return new xN(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=O=>typeof O=="number"||O instanceof String||O instanceof Number,k=n.filter(j).map(String);k.length>0&&(n=n.concat(k)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:o,flow:c,keepUndefined:d,onTagObj:f,tag:p}=r??{},{onAnchor:m,setAnchors:y,sourceObjects:v}=zse(this,o||"a"),x={aliasDuplicateObjects:a??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:v},w=Ef(t,p,x);return c&&yn(w)&&(w.flow=!0),y(),w}createPair(t,n,r={}){const i=this.createNode(t,null,r),a=this.createNode(n,null,r);return new pr(i,a)}delete(t){return zc(this.contents)?this.contents.delete(t):!1}deleteIn(t){return af(t)?this.contents==null?!1:(this.contents=null,!0):zc(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return yn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return af(t)?!n&&Kt(this.contents)?this.contents.value:this.contents:yn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return yn(this.contents)?this.contents.has(t):!1}hasIn(t){return af(t)?this.contents!==void 0:yn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=vg(this.schema,[t],n):zc(this.contents)&&this.contents.set(t,n)}setIn(t,n){af(t)?this.contents=n:this.contents==null?this.contents=vg(this.schema,Array.from(t),n):zc(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 dr({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 dr({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 TN(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:a,reviver:o}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},d=Si(this.contents,n??"",c);if(typeof a=="function")for(const{count:f,res:p}of c.anchors.values())a(p,f);return typeof o=="function"?Vc(o,{"":d},"",d):d}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return soe(this,t)}}function zc(e){if(yn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class X$ extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class hm extends X${constructor(t,n,r){super("YAMLParseError",t,n,r)}}class ooe extends X${constructor(t,n,r){super("YAMLWarning",t,n,r)}}const nP=(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,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){const c=Math.min(a-39,o.length-79);o="…"+o.substring(c),a-=c-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,a))){let c=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`…
|
|
172
|
-
`),o=c+o}if(/[^ ]/.test(o)){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+=`:
|
|
173
|
-
|
|
174
|
-
${o}
|
|
175
|
-
${f}
|
|
176
|
-
`}};function pu(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:c}){let d=!1,f=c,p=c,m="",y="",v=!1,x=!1,w=null,j=null,k=null,O=null,_=null,C=null,P=null;for(const z of e)switch(x&&(z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&a(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x=!1),w&&(f&&z.type!=="comment"&&z.type!=="newline"&&a(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),z.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&z.source.includes(" ")&&(w=z),p=!0;break;case"comment":{p||a(z,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const I=z.source.substring(1)||" ";m?m+=y+I:m=I,y="",f=!1;break}case"newline":f?m?m+=z.source:(!C||n!=="seq-item-ind")&&(d=!0):y+=z.source,f=!0,v=!0,(j||k)&&(O=z),p=!0;break;case"anchor":j&&a(z,"MULTIPLE_ANCHORS","A node can have at most one anchor"),z.source.endsWith(":")&&a(z.offset+z.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),j=z,P??(P=z.offset),f=!1,p=!1,x=!0;break;case"tag":{k&&a(z,"MULTIPLE_TAGS","A node can have at most one tag"),k=z,P??(P=z.offset),f=!1,p=!1,x=!0;break}case n:(j||k)&&a(z,"BAD_PROP_ORDER",`Anchors and tags must be after the ${z.source} indicator`),C&&a(z,"UNEXPECTED_TOKEN",`Unexpected ${z.source} in ${t??"collection"}`),C=z,f=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){_&&a(z,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),_=z,f=!1,p=!1;break}default:a(z,"UNEXPECTED_TOKEN",`Unexpected ${z.type} token`),f=!1,p=!1}const T=e[e.length-1],A=T?T.offset+T.source.length:i;return x&&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"),w&&(f&&w.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&a(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:C,spaceBefore:d,comment:m,hasNewline:v,anchor:j,tag:k,newlineAfterProp:O,end:A,start:P??A}}function Tf(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
177
|
-
`))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(Tf(t.key)||Tf(t.value))return!0}return!1;default:return!0}}function l1(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Tf(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function J$(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(a,o)=>a===o||Kt(a)&&Kt(o)&&a.value===o.value;return t.some(a=>i(a.key,n))}const rP="All mapping items must start at the same column";function loe({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??vi,c=new o(n.schema);n.atRoot&&(n.atRoot=!1);let d=r.offset,f=null;for(const p of r.items){const{start:m,key:y,sep:v,value:x}=p,w=pu(m,{indicator:"explicit-key-ind",next:y??v?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0}),j=!w.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",rP)),!w.anchor&&!w.tag&&!v){f=w.end,w.comment&&(c.comment?c.comment+=`
|
|
178
|
-
`+w.comment:c.comment=w.comment);continue}(w.newlineAfterProp||Tf(y))&&i(y??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else w.found?.indent!==r.indent&&i(d,"BAD_INDENT",rP);n.atKey=!0;const k=w.end,O=y?e(n,y,w,i):t(n,k,m,null,w,i);n.schema.compat&&l1(r.indent,y,i),n.atKey=!1,J$(n,c.items,O)&&i(k,"DUPLICATE_KEY","Map keys must be unique");const _=pu(v??[],{indicator:"map-value-ind",next:x,offset:O.range[2],onError:i,parentIndent:r.indent,startOnNewline:!y||y.type==="block-scalar"});if(d=_.end,_.found){j&&(x?.type==="block-map"&&!_.hasNewline&&i(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<_.found.offset-1024&&i(O.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const C=x?e(n,x,_,i):t(n,d,v,null,_,i);n.schema.compat&&l1(r.indent,x,i),d=C.range[2];const P=new pr(O,C);n.options.keepSourceTokens&&(P.srcToken=p),c.items.push(P)}else{j&&i(O.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(O.comment?O.comment+=`
|
|
179
|
-
`+_.comment:O.comment=_.comment);const C=new pr(O);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 coe({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??Cl,c=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset,f=null;for(const{start:p,value:m}of r.items){const y=pu(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&&l1(r.indent,m,i),d=v.range[2],c.items.push(v)}return c.range=[r.offset,d,f??d],c}function ih(e,t,n,r){let i="";if(e){let a=!1,o="";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+=o+p:i=p,o="";break}case"newline":i&&(o+=d),a=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=d.length}}return{comment:i,offset:t}}const Bx="Block collections are not allowed within flow collections",Fx=e=>e&&(e.type==="block-map"||e.type==="block-seq");function uoe({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=r.start.source==="{",c=o?"flow map":"flow sequence",d=a?.nodeClass??(o?vi:Cl),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:O,key:_,sep:C,value:P}=k,T=pu(O,{flow:c,indicator:"explicit-key-ind",next:_??C?.[0],offset:m,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!C&&!P){j===0&&T.comma?i(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):j<r.items.length-1&&i(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),T.comment&&(f.comment?f.comment+=`
|
|
180
|
-
`+T.comment:f.comment=T.comment),m=T.end;continue}!o&&n.options.strict&&Tf(_)&&i(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(j===0)T.comma&&i(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(T.comma||i(T.start,"MISSING_CHAR",`Missing , between ${c} items`),T.comment){let A="";e:for(const z of O)switch(z.type){case"comma":case"space":break;case"comment":A=z.source.substring(1);break e;default:break e}if(A){let z=f.items[f.items.length-1];bn(z)&&(z=z.value??z.key),z.comment?z.comment+=`
|
|
181
|
-
`+A:z.comment=A,T.comment=T.comment.substring(A.length+1)}}if(!o&&!C&&!T.found){const A=P?e(n,P,T,i):t(n,T.end,C,null,T,i);f.items.push(A),m=A.range[2],Fx(P)&&i(A.range,"BLOCK_IN_FLOW",Bx)}else{n.atKey=!0;const A=T.end,z=_?e(n,_,T,i):t(n,A,O,null,T,i);Fx(_)&&i(z.range,"BLOCK_IN_FLOW",Bx),n.atKey=!1;const I=pu(C??[],{flow:c,indicator:"map-value-ind",next:P,offset:z.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(I.found){if(!o&&!T.found&&n.options.strict){if(C)for(const L of C){if(L===I.found)break;if(L.type==="newline"){i(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}T.start<I.found.offset-1024&&i(I.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else P&&("source"in P&&P.source?.[0]===":"?i(P,"MISSING_CHAR",`Missing space after : in ${c}`):i(I.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const q=P?e(n,P,I,i):I.found?t(n,I.end,C,null,I,i):null;q?Fx(P)&&i(q.range,"BLOCK_IN_FLOW",Bx):I.comment&&(z.comment?z.comment+=`
|
|
182
|
-
`+I.comment:z.comment=I.comment);const U=new pr(z,q);if(n.options.keepSourceTokens&&(U.srcToken=k),o){const L=f;J$(n,L.items,z)&&i(A,"DUPLICATE_KEY","Map keys must be unique"),L.items.push(U)}else{const L=new vi(n.schema);L.flow=!0,L.items.push(U);const J=(q??z).range;L.range=[z.range[0],J[1],J[2]],f.items.push(L)}m=q?q.range[2]:I.end}}const y=o?"}":"]",[v,...x]=r.end;let w=m;if(v?.source===y)w=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&&x.unshift(v)}if(x.length>0){const j=ih(x,w,n.options.strict,i);j.comment&&(f.comment?f.comment+=`
|
|
183
|
-
`+j.comment:f.comment=j.comment),f.range=[r.offset,w,j.offset]}else f.range=[r.offset,w,w];return f}function qx(e,t,n,r,i,a){const o=n.type==="block-map"?loe(e,t,n,r,a):n.type==="block-seq"?coe(e,t,n,r,a):uoe(e,t,n,r,a),c=o.constructor;return i==="!"||i===c.tagName?(o.tag=c.tagName,o):(i&&(o.tag=i),o)}function doe(e,t,n,r,i){const a=r.tag,o=a?t.directives.tagName(a.source,y=>i(a,"TAG_RESOLVE_FAILED",y)):null;if(n.type==="block-seq"){const{anchor:y,newlineAfterProp:v}=r,x=y&&a?y.offset>a.offset?y:a:y??a;x&&(!v||v.offset<x.offset)&&i(x,"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||!o||o==="!"||o===vi.tagName&&c==="map"||o===Cl.tagName&&c==="seq")return qx(e,t,n,i,o);let d=t.schema.tags.find(y=>y.tag===o&&y.collection===c);if(!d){const y=t.schema.knownTags[o];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: ${o}`,!0),qx(e,t,n,i,o)}const f=qx(e,t,n,i,o,d),p=d.resolve?.(f,y=>i(a,"TAG_RESOLVE_FAILED",y),t.options)??f,m=vn(p)?p:new et(p);return m.range=f.range,m.tag=o,d?.format&&(m.format=d.format),m}function foe(e,t,n){const r=t.offset,i=hoe(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const a=i.mode===">"?et.BLOCK_FOLDED:et.BLOCK_LITERAL,o=t.source?poe(t.source):[];let c=o.length;for(let w=o.length-1;w>=0;--w){const j=o[w][1];if(j===""||j==="\r")c=w;else break}if(c===0){const w=i.chomp==="+"&&o.length>0?`
|
|
184
|
-
`.repeat(Math.max(1,o.length-1)):"";let j=r+i.length;return t.source&&(j+=t.source.length),{value:w,type:a,comment:i.comment,range:[r,j,j]}}let d=t.indent+i.indent,f=t.offset+i.length,p=0;for(let w=0;w<c;++w){const[j,k]=o[w];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=w,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 w=o.length-1;w>=c;--w)o[w][0].length>d&&(c=w+1);let m="",y="",v=!1;for(let w=0;w<p;++w)m+=o[w][0].slice(d)+`
|
|
185
|
-
`;for(let w=p;w<c;++w){let[j,k]=o[w];f+=j.length+k.length+1;const O=k[k.length-1]==="\r";if(O&&(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-(O?2:1),"BAD_INDENT",C),j=""}a===et.BLOCK_LITERAL?(m+=y+j.slice(d)+k,y=`
|
|
186
|
-
`):j.length>d||k[0]===" "?(y===" "?y=`
|
|
187
|
-
`:!v&&y===`
|
|
188
|
-
`&&(y=`
|
|
189
|
-
|
|
190
|
-
`),m+=y+j.slice(d)+k,y=`
|
|
191
|
-
`,v=!0):k===""?y===`
|
|
192
|
-
`?m+=`
|
|
193
|
-
`:y=`
|
|
194
|
-
`:(m+=y+k,y=" ",v=!1)}switch(i.chomp){case"-":break;case"+":for(let w=c;w<o.length;++w)m+=`
|
|
195
|
-
`+o[w][0].slice(d);m[m.length-1]!==`
|
|
196
|
-
`&&(m+=`
|
|
197
|
-
`);break;default:m+=`
|
|
198
|
-
`}const x=r+i.length+t.source.length;return{value:m,type:a,comment:i.comment,range:[r,x,x]}}function hoe({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],a=i[0];let o=0,c="",d=-1;for(let y=1;y<i.length;++y){const v=i[y];if(!c&&(v==="-"||v==="+"))c=v;else{const x=Number(v);!o&&x?o=x: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 x=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",x);const w=v.source;w&&typeof w=="string"&&(m+=w.length)}}}return{mode:a,indent:o,chomp:c,comment:p,length:m}}function poe(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),a=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)a.push([t[o],t[o+1]]);return a}function moe(e,t,n){const{offset:r,type:i,source:a,end:o}=e;let c,d;const f=(y,v,x)=>n(r+y,v,x);switch(i){case"scalar":c=et.PLAIN,d=goe(a,f);break;case"single-quoted-scalar":c=et.QUOTE_SINGLE,d=yoe(a,f);break;case"double-quoted-scalar":c=et.QUOTE_DOUBLE,d=voe(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=ih(o,p,t,n);return{value:d,type:c,comment:m.comment,range:[r,p,m.offset]}}function goe(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}`),e3(e)}function yoe(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),e3(e.slice(1,-1)).replace(/''/g,"'")}function e3(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
199
|
-
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
200
|
-
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=" ",o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===""?a===`
|
|
201
|
-
`?i+=a:a=`
|
|
202
|
-
`:(i+=a+r[1],a=" "),o=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=o,r=c.exec(e),i+a+(r?.[1]??"")}function voe(e,t){let n="";for(let r=1;r<e.length-1;++r){const i=e[r];if(!(i==="\r"&&e[r+1]===`
|
|
203
|
-
`))if(i===`
|
|
204
|
-
`){const{fold:a,offset:o}=boe(e,r);n+=a,r=o}else if(i==="\\"){let a=e[++r];const o=xoe[a];if(o)n+=o;else if(a===`
|
|
205
|
-
`)for(a=e[r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="\r"&&e[r+1]===`
|
|
206
|
-
`)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+=woe(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 o=e[r+1];for(;o===" "||o===" ";)o=e[++r+1];o!==`
|
|
207
|
-
`&&!(o==="\r"&&e[r+2]===`
|
|
208
|
-
`)&&(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 boe(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
|
|
209
|
-
`||r==="\r")&&!(r==="\r"&&e[t+2]!==`
|
|
210
|
-
`);)r===`
|
|
211
|
-
`&&(n+=`
|
|
212
|
-
`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const xoe={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
213
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function woe(e,t,n,r){const i=e.substr(t,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const c=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}return String.fromCodePoint(o)}function t3(e,t,n,r){const{value:i,type:a,comment:o,range:c}=t.type==="block-scalar"?foe(e,t,r):moe(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[ga]:d?f=Soe(e.schema,i,d,n,r):t.type==="scalar"?f=joe(e,i,t,r):f=e.schema[ga];let p;try{const m=f.resolve(i,y=>r(n??t,"TAG_RESOLVE_FAILED",y),e.options);p=Kt(m)?m:new et(m)}catch(m){const y=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",y),p=new et(i)}return p.range=c,p.source=i,a&&(p.type=a),d&&(p.tag=d),f.format&&(p.format=f.format),o&&(p.comment=o),p}function Soe(e,t,n,r,i){if(n==="!")return e[ga];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 o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[ga])}function joe({atKey:e,directives:t,schema:n},r,i,a){const o=n.tags.find(c=>(c.default===!0||e&&c.default==="key")&&c.test?.test(r))||n[ga];if(n.compat){const c=n.compat.find(d=>d.default&&d.test?.test(r))??n[ga];if(o.tag!==c.tag){const d=t.tagString(o.tag),f=t.tagString(c.tag),p=`Value may be parsed as either ${d} or ${f}`;a(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}function Noe(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 koe={composeNode:n3,composeEmptyNode:PN};function n3(e,t,n,r){const i=e.atKey,{spaceBefore:a,comment:o,anchor:c,tag:d}=n;let f,p=!0;switch(t.type){case"alias":f=Coe(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=t3(e,t,d,r),c&&(f.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=doe(koe,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=PN(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&&(!Kt(f)||typeof f.value!="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")&&r(d??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(f.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?f.comment=o:f.commentBefore=o),e.options.keepSourceTokens&&p&&(f.srcToken=t),f}function PN(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:c,end:d},f){const p={type:"scalar",offset:Noe(t,n,r),indent:-1,source:""},m=t3(e,p,c,f);return o&&(m.anchor=o.source.substring(1),m.anchor===""&&f(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(m.spaceBefore=!0),a&&(m.comment=a,m.range[2]=d),m}function Coe({options:e},{offset:t,source:n,end:r},i){const a=new xN(n.substring(1));a.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,c=ih(r,o,e.strict,i);return a.range=[t,o,c.offset],c.comment&&(a.comment=c.comment),a}function _oe(e,t,{offset:n,start:r,value:i,end:a},o){const c=Object.assign({_directives:t},e),d=new Wy(void 0,c),f={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=pu(r,{indicator:"doc-start",next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(d.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=i?n3(f,i,p,o):PN(f,p.end,r,null,p,o);const m=d.contents.range[2],y=ih(a,m,!1,o);return y.comment&&(d.comment=y.comment),d.range=[n,m,y.offset],d}function Hd(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 iP(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?`
|
|
214
|
-
|
|
215
|
-
`:`
|
|
216
|
-
`)+(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 Aoe{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,a)=>{const o=Hd(n);a?this.warnings.push(new ooe(o,r,i)):this.errors.push(new hm(o,r,i))},this.directives=new dr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=iP(this.prelude);if(r){const a=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
217
|
-
${r}`:r;else if(i||t.directives.docStart||!a)t.commentBefore=r;else if(yn(a)&&!a.flow&&a.items.length>0){let o=a.items[0];bn(o)&&(o=o.key);const c=o.commentBefore;o.commentBefore=c?`${r}
|
|
218
|
-
${c}`:r}else{const o=a.commentBefore;a.commentBefore=o?`${r}
|
|
219
|
-
${o}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:iP(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=Hd(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=_oe(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 hm(Hd(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 hm(Hd(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=ih(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}
|
|
220
|
-
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new hm(Hd(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 Wy(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 r3="\uFEFF",i3="",a3="",c1="";function Ooe(e){switch(e){case r3:return"byte-order-mark";case i3:return"doc-mode";case a3:return"flow-error-end";case c1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
221
|
-
`:case`\r
|
|
222
|
-
`: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 Li(e){switch(e){case void 0:case" ":case`
|
|
223
|
-
`:case"\r":case" ":return!0;default:return!1}}const aP=new Set("0123456789ABCDEFabcdef"),Eoe=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),pm=new Set(",[]{}"),Toe=new Set(` ,[]{}
|
|
224
|
-
\r `),Kx=e=>!e||Toe.has(e);class Poe{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===`
|
|
225
|
-
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
226
|
-
`:!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===`
|
|
227
|
-
`||!i&&!this.atEnd)return t+r+1}return n===`
|
|
228
|
-
`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&Li(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(`
|
|
229
|
-
`,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]===r3&&(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 i3,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==="...")&&Li(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&&!Li(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===":")&&Li(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(Kx),"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("..."))&&Li(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield a3,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(Kx),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||Li(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let a=0;for(;this.buffer[n-1-a]==="\\";)a+=1;if(a%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let i=r.indexOf(`
|
|
230
|
-
`,this.pos);if(i!==-1){for(;i!==-1;){const a=this.continueScalar(i+1);if(a===-1)break;i=r.indexOf(`
|
|
231
|
-
`,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=>Li(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`
|
|
232
|
-
`:t=a,n=0;break;case"\r":{const o=this.buffer[a+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
233
|
-
`)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(`
|
|
234
|
-
`,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===`
|
|
235
|
-
`;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let a=t-1,o=this.buffer[a];o==="\r"&&(o=this.buffer[--a]);const c=a;for(;o===" ";)o=this.buffer[--a];if(o===`
|
|
236
|
-
`&&a>=this.pos&&a+1+n>c)t=a;else break}while(!0);return yield c1,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(Li(a)||t&&pm.has(a))break;n=r}else if(Li(i)){let a=this.buffer[r+1];if(i==="\r"&&(a===`
|
|
237
|
-
`?(r+=1,i=`
|
|
238
|
-
`,a=this.buffer[r+1]):n=r),a==="#"||t&&pm.has(a))break;if(i===`
|
|
239
|
-
`){const o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(t&&pm.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield c1,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(Kx))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(Li(n)||t&&pm.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(;!Li(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(Eoe.has(n))n=this.buffer[++t];else if(n==="%"&&aP.has(this.buffer[t+1])&&aP.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===`
|
|
240
|
-
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
241
|
-
`?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 zoe{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 Vs(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function sP(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 s3(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 mm(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 Rc(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 oP(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Vs(t.start,"explicit-key-ind")&&!Vs(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,s3(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 Roe{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 Poe,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=Ooe(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"&&oP(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&&sP(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":{sP(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=mm(this.peek(2)),r=Rc(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(`
|
|
242
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
243
|
-
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(i&&n.sep&&!n.value){const o=[];for(let c=0;c<n.sep.length;++c){const d=n.sep[c];switch(d.type){case"newline":o.push(c);break;case"space":break;case"comment":d.indent>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Vs(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(s3(n.key)&&!Vs(n.sep,"newline")){const o=Rc(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:o,key:c,sep:d}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Vs(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=Rc(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Vs(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Vs(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Vs(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=mm(r),a=Rc(i);oP(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
244
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
245
|
-
`,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=mm(t),r=Rc(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=mm(t),r=Rc(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 Moe(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new zoe||null,prettyErrors:t}}function Doe(e,t={}){const{lineCounter:n,prettyErrors:r}=Moe(t),i=new Roe(n?.addNewLine),a=new Aoe(t),o=Array.from(a.compose(i.parse(e)));if(r&&n)for(const c of o)c.errors.forEach(nP(e,n)),c.warnings.forEach(nP(e,n));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function Ioe({onApplied:e}){const[t,n]=S.useState(""),[r,i]=S.useState(!1),[a,o]=S.useState([]),[c,d]=S.useState([]),f=async()=>{if(!t.trim())return;i(!0),o([]),d([]);const p=Doe(t),m=[],y=[];for(let v=0;v<p.length;v++){const x=p[v];if(x.errors.length>0){m.push(`Document ${v+1}: ${x.errors[0]?.message}`);continue}const w=x.toJSON();if(!(!w||typeof w!="object"))try{const j=await BH(w);y.push(`Applied "${j.displayName||j.name}" (revision ${j.configRevision})`)}catch(j){m.push(`Document ${v+1}: ${j instanceof Error?j.message:String(j)}`)}}o(y),d(m),i(!1),y.length>0&&(ft({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 u.jsxs("section",{className:"mt-8",children:[u.jsx("div",{className:"page-section-divider"}),u.jsx("div",{className:"section-head mt-6",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),u.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),u.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",u.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",u.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),u.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
|
|
246
|
-
kind: Project
|
|
247
|
-
metadata:
|
|
248
|
-
name: my-project
|
|
249
|
-
spec:
|
|
250
|
-
canonicalDomain: example.com
|
|
251
|
-
country: US
|
|
252
|
-
language: en
|
|
253
|
-
keywords: []`,value:t,onChange:p=>n(p.target.value)}),a.length>0&&u.jsx("ul",{className:"mt-2 space-y-1",children:a.map((p,m)=>u.jsx("li",{className:"text-emerald-400 text-sm",children:p},m))}),c.length>0&&u.jsx("ul",{className:"mt-2 space-y-1",children:c.map((p,m)=>u.jsx("li",{className:"text-rose-400 text-sm",children:p},m))}),u.jsx("div",{className:"mt-3",children:u.jsx(we,{type:"button",disabled:!t.trim()||r,onClick:f,children:r?"Applying...":"Apply"})})]})}function Loe(){const{dashboard:e,isLoading:t,refetch:n}=Ul();if(!e||t)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-28"}),u.jsx("div",{className:"skeleton-text-sm w-40"})]}),u.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[u.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(A=>u.jsx("div",{className:"skeleton-text-sm w-16"},A))}),[1,2,3].map(A=>u.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[u.jsxs("div",{className:"flex-1 space-y-1",children:[u.jsx("div",{className:"skeleton-text w-28"}),u.jsx("div",{className:"skeleton-text-sm w-16"})]}),u.jsx("div",{className:"skeleton-text w-24"}),u.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),u.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),u.jsx("div",{className:"skeleton-text-sm w-8"})]},A))]})]});const r=e.projects,i=yo(),[a,o]=S.useState(!1),[c,d]=S.useState(""),[f,p]=S.useState(""),[m,y]=S.useState(""),[v,x]=S.useState("US"),[w,j]=S.useState("en"),[k,O]=S.useState(!1),[_,C]=S.useState(null),P=c.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),T=async()=>{if(!(!P||!m)){O(!0),C(null);try{const A=await Ny(P,{displayName:f||c,canonicalDomain:m,country:v,language:w});ft({title:"Project created",detail:`${A.displayName||A.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${A.name}`,dedupeMode:"drop"}),n(),d(""),p(""),y(""),x("US"),j("en"),o(!1),i({to:"/projects/$projectId",params:{projectId:A.id}})}catch(A){C(A instanceof Error?A.message:"Failed to create project")}finally{O(!1)}}};return u.jsxs("div",{className:"page-container",children:[u.jsxs("div",{className:"page-header",children:[u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Projects"}),u.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),u.jsx("div",{className:"page-header-right",children:u.jsxs(we,{type:"button",onClick:()=>o(A=>!A),children:[u.jsx(aT,{className:"size-4 mr-1.5"}),"Add project"]})})]}),a?u.jsxs(We,{className:"surface-card mb-6",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),u.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),u.jsxs("div",{className:"compact-stack mt-4",children:[u.jsxs("div",{className:"setup-field-row",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),u.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:c,onChange:A=>d(A.target.value)}),P&&P!==c?u.jsxs("p",{className:"supporting-copy",children:["Slug: ",P]}):null]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),u.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:f,onChange:A=>p(A.target.value)})]})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),u.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:m,onChange:A=>y(A.target.value)})]}),u.jsxs("div",{className:"setup-field-row",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),u.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:v,onChange:A=>x(A.target.value.toUpperCase())})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),u.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:w,onChange:A=>j(A.target.value.toLowerCase())})]})]})]}),_?u.jsx("p",{className:"text-rose-400 text-sm mt-3",children:_}):null,u.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[u.jsx(we,{type:"button",disabled:!P||!m||k,onClick:T,children:k?"Creating...":"Create project"}),u.jsx(we,{type:"button",variant:"ghost",onClick:()=>o(!1),children:"Cancel"})]})]}):null,r.length>0?u.jsx("div",{className:"data-table-wrapper",children:u.jsxs("table",{className:"data-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Name"}),u.jsx("th",{children:"Domain"}),u.jsx("th",{children:"Visibility"}),u.jsx("th",{children:"Last run"}),u.jsx("th",{className:"text-right",children:"Country"})]})}),u.jsx("tbody",{children:r.map(A=>{const z=A.recentRuns[0];return u.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:A.project.id}}),children:[u.jsxs("td",{children:[u.jsx(Qt,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:I=>I.stopPropagation(),children:A.project.displayName||A.project.name}),u.jsx("p",{className:"text-[11px] text-zinc-500",children:A.project.name})]}),u.jsx("td",{className:"text-zinc-400",children:A.project.canonicalDomain}),u.jsx("td",{children:u.jsx(Et,{tone:A.visibilitySummary.tone,children:A.visibilitySummary.value})}),u.jsx("td",{className:"text-zinc-500 text-sm",children:z?u.jsx(Ty,{status:z.status}):u.jsx("span",{className:"text-zinc-600",children:"No runs"})}),u.jsx("td",{className:"text-right text-zinc-500",children:A.project.country})]},A.project.id)})})]})}):a?null:u.jsxs(We,{className:"surface-card empty-card",children:[u.jsx("h3",{children:"No projects yet"}),u.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),u.jsxs(we,{type:"button",onClick:()=>o(!0),children:[u.jsx(aT,{className:"size-4 mr-1.5"}),"Add project"]})]}),u.jsx(Ioe,{onApplied:()=>{n()}})]})}function u1({state:e}){return u.jsx(Et,{tone:UQ(e),children:Ay(e)})}function o3({run:e}){const{openRun:t}=Au();return u.jsxs("article",{className:"run-row",children:[u.jsxs("div",{className:"run-row-main",children:[u.jsxs("div",{className:"run-row-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:e.summary}),u.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),u.jsx(Ty,{status:e.status})]}),u.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),u.jsxs("dl",{className:"run-row-meta",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Started"}),u.jsx("dd",{children:e.startedAt})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Duration"}),u.jsx("dd",{children:e.duration})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Trigger"}),u.jsx("dd",{children:e.triggerLabel})]})]}),u.jsx(we,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function l3({value:e,label:t,delta:n,tone:r,description:i,tooltip:a,isNumeric:o=!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),1):o&&!Number.isNaN(y)?Math.min(y/100,1):.5,x=m*(1-v);return u.jsxs("div",{className:"score-gauge",children:[u.jsxs("div",{className:"gauge-ring-wrapper",children:[u.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[u.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),u.jsx("circle",{className:`gauge-fill gauge-fill-${r}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:m,strokeDashoffset:x,transform:"rotate(-90 60 60)"})]}),u.jsx("div",{className:"gauge-center",children:u.jsx("span",{className:o?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),u.jsxs("p",{className:"gauge-label",children:[t,a&&u.jsx(Wn,{text:a})]}),u.jsx("p",{className:"gauge-delta",children:n}),d&&u.jsx("p",{className:"gauge-provider-coverage",children:d}),u.jsx("p",{className:"gauge-description",children:i})]})}function lP({history:e,maxDots:t=12}){const n=e.slice(-t);if(n.length===0)return u.jsx("span",{className:"text-[11px] text-zinc-600",children:"No data"});const r={cited:"bg-emerald-400","not-cited":"bg-zinc-600",lost:"bg-rose-400",emerging:"bg-amber-400 ring-1 ring-amber-300/60"},i=new Date(n[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),a=new Date(n[n.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:i}),u.jsx("div",{className:"flex items-center gap-[3px]",title:`${n.length} runs`,children:n.map((o,c)=>u.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[o.citationState]??"bg-zinc-700"} ${o.model&&c>0&&n[c-1]?.model&&n[c-1].model!==o.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[o.citationState,new Date(o.createdAt).toLocaleDateString(),o.model?`model ${o.model}`:null,o.model&&c>0&&n[c-1]?.model&&n[c-1].model!==o.model?"model changed":null].filter(Boolean).join(" — ")},c))}),u.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:a})]})}function $oe(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 Uoe({evidence:e}){const{openEvidence:t}=Au(),[n,r]=S.useState(new Set),i=S.useMemo(()=>{const o=new Map;for(const c of e){const d=o.get(c.keyword)??[];o.set(c.keyword,[...d,c])}return[...o.entries()].map(([c,d])=>({phrase:c,items:d}))},[e]),a=o=>{r(c=>{const d=new Set(c);return d.has(o)?d.delete(o):d.add(o),d})};return u.jsx("div",{className:"evidence-table-wrap",children:u.jsxs("table",{className:"evidence-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{style:{width:"2rem"}}),u.jsx("th",{children:"Key Phrase"}),u.jsx("th",{children:"Status"}),u.jsx("th",{children:"Citation History"}),u.jsx("th",{children:"Change"}),u.jsx("th",{})]})}),u.jsx("tbody",{children:i.map(({phrase:o,items:c})=>{const d=n.has(o),f=c.map(x=>x.citationState),p=f.includes("cited")?"cited":f.includes("emerging")?"emerging":f.includes("lost")?"lost":f.every(x=>x==="pending")?"pending":"not-cited",m=$oe(c),y=c.filter(x=>x.citationState==="cited"||x.citationState==="emerging").length,v=(()=>{if(m.length===0)return"Awaiting first run";if(m.length===1)return"First observation";const x=m[m.length-1].citationState,w=m[m.length-2].citationState;if(w!=="cited"&&x==="cited")return"Newly cited";if(w==="cited"&&x!=="cited")return"Lost since last run";let j=0;for(let k=m.length-1;k>=0&&m[k].citationState===x;k--)j++;return x==="cited"?j<=1?"Cited in latest run":`Cited for ${j} runs`:j<=1?"Not cited in latest run":`Not cited across ${j} runs`})();return u.jsxs(S.Fragment,{children:[u.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>a(o),"aria-expanded":d,children:[u.jsx("td",{children:u.jsx(Yf,{size:14,className:`transition-transform duration-150 text-zinc-500 ${d?"rotate-90":""}`})}),u.jsx("td",{className:"evidence-keyword-cell",children:u.jsxs("div",{children:[u.jsx("span",{className:"font-medium text-zinc-100",children:o}),u.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:c.map(x=>u.jsx(Cf,{provider:x.provider},x.id))})]})}),u.jsx("td",{children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(u1,{state:p}),u.jsxs("span",{className:"text-[11px] text-zinc-500",children:[y,"/",c.length]})]})}),u.jsx("td",{children:u.jsx(lP,{history:m})}),u.jsx("td",{className:"evidence-change-cell",children:v}),u.jsx("td",{})]}),d&&c.map(x=>u.jsxs("tr",{className:"bg-zinc-900/30",children:[u.jsx("td",{}),u.jsx("td",{className:"evidence-keyword-cell pl-5",children:u.jsx(Cf,{provider:x.provider})}),u.jsx("td",{children:u.jsx(u1,{state:x.citationState})}),u.jsx("td",{children:u.jsx(lP,{history:x.runHistory})}),u.jsx("td",{className:"evidence-change-cell",children:x.changeLabel}),u.jsx("td",{children:u.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:w=>{w.stopPropagation(),t(x.id)},children:"View"})})]},x.id))]},o)})})]})})}function Boe({competitors:e}){return e.length===0?u.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):u.jsx("div",{className:"competitor-table-wrap",children:u.jsxs("table",{className:"competitor-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Domain"}),u.jsx("th",{children:"Pressure"}),u.jsx("th",{children:"Citations"}),u.jsx("th",{children:"Key Phrases"})]})}),u.jsx("tbody",{children:e.map(t=>u.jsxs("tr",{children:[u.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),u.jsx("td",{children:u.jsx(Et,{tone:BQ(t.pressureLabel),children:t.pressureLabel})}),u.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalKeywords>0?`${t.citationCount} / ${t.totalKeywords}`:"—"}),u.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedKeywords.length>0?t.citedKeywords.join(", "):"Not cited"})]},t.id))})]})})}function cP({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:a,coverageValue:o,note:c,updatedAt:d,active:f,onClick:p}){return u.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:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),u.jsx("h3",{children:t})]}),u.jsx(Et,{tone:r,children:n})]}),u.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:i}),u.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:a})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:o})]})]}),u.jsxs("div",{className:"mt-3 flex flex-col gap-1 text-xs text-zinc-500 sm:flex-row sm:items-center sm:justify-between",children:[u.jsx("span",{children:c}),u.jsx("span",{children:d?`Updated ${Ui(d)}`:"No recent sync yet"})]})]})}function gm({label:e,value:t,tone:n}){const r=n==="positive"?"text-emerald-400":n==="negative"?"text-rose-400":"text-zinc-200";return u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),u.jsx("p",{className:`mt-2 text-2xl font-semibold ${r}`,children:t})]})}var Foe=["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 zN(e){if(typeof e!="string")return!1;var t=Foe;return t.includes(e)}var qoe=["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"],Koe=new Set(qoe);function c3(e){return typeof e!="string"?!1:Koe.has(e)}function u3(e){return typeof e=="string"&&e.startsWith("data-")}function Gi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(c3(n)||u3(n))&&(t[n]=e[n]);return t}function Qy(e){if(e==null)return null;if(S.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Gi(t)}return typeof e=="object"&&!Array.isArray(e)?Gi(e):null}function zr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(c3(n)||u3(n)||zN(n))&&(t[n]=e[n]);return t}function Hoe(e){return e==null?null:S.isValidElement(e)?zr(e.props):typeof e=="object"&&!Array.isArray(e)?zr(e):null}var Goe=["children","width","height","viewBox","className","style","title","desc"];function d1(){return d1=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},d1.apply(null,arguments)}function Voe(e,t){if(e==null)return{};var n,r,i=Zoe(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 Zoe(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 RN=S.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:c,title:d,desc:f}=e,p=Voe(e,Goe),m=a||{width:r,height:i,x:0,y:0},y=Ct("recharts-surface",o);return S.createElement("svg",d1({},zr(p),{className:y,width:r,height:i,style:c,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height),ref:t}),S.createElement("title",null,d),S.createElement("desc",null,f),n)}),Yoe=["children","className"];function f1(){return f1=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},f1.apply(null,arguments)}function Woe(e,t){if(e==null)return{};var n,r,i=Qoe(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 Qoe(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 Vi=S.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Woe(e,Yoe),a=Ct("recharts-layer",r);return S.createElement("g",f1({className:a},zr(i),{ref:t}),n)}),d3=S.createContext(null),Xoe=()=>S.useContext(d3);function Bt(e){return function(){return e}}const f3=Math.cos,xg=Math.sin,Qi=Math.sqrt,wg=Math.PI,Xy=2*wg,h1=Math.PI,p1=2*h1,tl=1e-6,Joe=p1-tl;function h3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function ele(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return h3;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 tle{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?h3:ele(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,c=this._y1,d=r-t,f=i-n,p=o-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>tl)if(!(Math.abs(m*d-f*p)>tl)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-o,x=i-c,w=d*d+f*f,j=v*v+x*x,k=Math.sqrt(w),O=Math.sqrt(y),_=a*Math.tan((h1-Math.acos((w+y-j)/(2*k*O)))/2),C=_/O,P=_/k;Math.abs(C-1)>tl&&this._append`L${t+C*p},${n+C*m}`,this._append`A${a},${a},0,0,${+(m*v>p*x)},${this._x1=t+P*d},${this._y1=n+P*f}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),d=r*Math.sin(i),f=t+c,p=n+d,m=1^o,y=o?i-a:a-i;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>tl||Math.abs(this._y1-p)>tl)&&this._append`L${f},${p}`,r&&(y<0&&(y=y%p1+p1),y>Joe?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>tl&&this._append`A${r},${r},0,${+(y>=h1)},${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 MN(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 tle(t)}function DN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function p3(e){this._context=e}p3.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 Jy(e){return new p3(e)}function m3(e){return e[0]}function g3(e){return e[1]}function y3(e,t){var n=Bt(!0),r=null,i=Jy,a=null,o=MN(c);e=typeof e=="function"?e:e===void 0?m3:Bt(e),t=typeof t=="function"?t:t===void 0?g3:Bt(t);function c(d){var f,p=(d=DN(d)).length,m,y=!1,v;for(r==null&&(a=i(v=o())),f=0;f<=p;++f)!(f<p&&n(m=d[f],f,d))===y&&((y=!y)?a.lineStart():a.lineEnd()),y&&a.point(+e(m,f,d),+t(m,f,d));if(v)return a=null,v+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:Bt(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:Bt(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:Bt(!!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 ym(e,t,n){var r=null,i=Bt(!0),a=null,o=Jy,c=null,d=MN(f);e=typeof e=="function"?e:e===void 0?m3:Bt(+e),t=typeof t=="function"?t:Bt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?g3:Bt(+n);function f(m){var y,v,x,w=(m=DN(m)).length,j,k=!1,O,_=new Array(w),C=new Array(w);for(a==null&&(c=o(O=d())),y=0;y<=w;++y){if(!(y<w&&i(j=m[y],y,m))===k)if(k=!k)v=y,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),x=y-1;x>=v;--x)c.point(_[x],C[x]);c.lineEnd(),c.areaEnd()}k&&(_[y]=+e(j,y,m),C[y]=+t(j,y,m),c.point(r?+r(j,y,m):_[y],n?+n(j,y,m):C[y]))}if(O)return c=null,O+""||null}function p(){return y3().defined(i).curve(o).context(a)}return f.x=function(m){return arguments.length?(e=typeof m=="function"?m:Bt(+m),r=null,f):e},f.x0=function(m){return arguments.length?(e=typeof m=="function"?m:Bt(+m),f):e},f.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:Bt(+m),f):r},f.y=function(m){return arguments.length?(t=typeof m=="function"?m:Bt(+m),n=null,f):t},f.y0=function(m){return arguments.length?(t=typeof m=="function"?m:Bt(+m),f):t},f.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:Bt(+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:Bt(!!m),f):i},f.curve=function(m){return arguments.length?(o=m,a!=null&&(c=o(a)),f):o},f.context=function(m){return arguments.length?(m==null?a=c=null:c=o(a=m),f):a},f}class v3{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 nle(e){return new v3(e,!0)}function rle(e){return new v3(e,!1)}const IN={draw(e,t){const n=Qi(t/wg);e.moveTo(n,0),e.arc(0,0,n,0,Xy)}},ile={draw(e,t){const n=Qi(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()}},b3=Qi(1/3),ale=b3*2,sle={draw(e,t){const n=Qi(t/ale),r=n*b3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},ole={draw(e,t){const n=Qi(t),r=-n/2;e.rect(r,r,n,n)}},lle=.8908130915292852,x3=xg(wg/10)/xg(7*wg/10),cle=xg(Xy/10)*x3,ule=-f3(Xy/10)*x3,dle={draw(e,t){const n=Qi(t*lle),r=cle*n,i=ule*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=Xy*a/5,c=f3(o),d=xg(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*i,d*r+c*i)}e.closePath()}},Hx=Qi(3),fle={draw(e,t){const n=-Qi(t/(Hx*3));e.moveTo(0,n*2),e.lineTo(-Hx*n,-n),e.lineTo(Hx*n,-n),e.closePath()}},ui=-.5,di=Qi(3)/2,m1=1/Qi(12),hle=(m1/2+1)*3,ple={draw(e,t){const n=Qi(t/hle),r=n/2,i=n*m1,a=r,o=n*m1+n,c=-a,d=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(c,d),e.lineTo(ui*r-di*i,di*r+ui*i),e.lineTo(ui*a-di*o,di*a+ui*o),e.lineTo(ui*c-di*d,di*c+ui*d),e.lineTo(ui*r+di*i,ui*i-di*r),e.lineTo(ui*a+di*o,ui*o-di*a),e.lineTo(ui*c+di*d,ui*d-di*c),e.closePath()}};function mle(e,t){let n=null,r=MN(i);e=typeof e=="function"?e:Bt(e||IN),t=typeof t=="function"?t:Bt(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:Bt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Bt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Sg(){}function jg(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 w3(e){this._context=e}w3.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:jg(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:jg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function gle(e){return new w3(e)}function S3(e){this._context=e}S3.prototype={areaStart:Sg,areaEnd:Sg,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:jg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function yle(e){return new S3(e)}function j3(e){this._context=e}j3.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:jg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function vle(e){return new j3(e)}function N3(e){this._context=e}N3.prototype={areaStart:Sg,areaEnd:Sg,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 ble(e){return new N3(e)}function uP(e){return e<0?-1:1}function dP(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),c=(a*i+o*r)/(r+i);return(uP(a)+uP(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(c))||0}function fP(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Gx(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,c=(a-r)/3;e._context.bezierCurveTo(r+c,i+c*t,a-c,o-c*n,a,o)}function Ng(e){this._context=e}Ng.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:Gx(this,this._t0,fP(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,Gx(this,fP(this,n=dP(this,e,t)),n);break;default:Gx(this,this._t0,n=dP(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function k3(e){this._context=new C3(e)}(k3.prototype=Object.create(Ng.prototype)).point=function(e,t){Ng.prototype.point.call(this,t,e)};function C3(e){this._context=e}C3.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 xle(e){return new Ng(e)}function wle(e){return new k3(e)}function _3(e){this._context=e}_3.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=hP(e),i=hP(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function hP(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Sle(e){return new _3(e)}function ev(e,t){this._context=e,this._t=t}ev.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function jle(e){return new ev(e,.5)}function Nle(e){return new ev(e,0)}function kle(e){return new ev(e,1)}function _l(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,c=a.length;n<o;++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 g1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Cle(e,t){return e[t]}function _le(e){const t=[];return t.key=e,t}function Ale(){var e=Bt([]),t=g1,n=_l,r=Cle;function i(a){var o=Array.from(e.apply(this,arguments),_le),c,d=o.length,f=-1,p;for(const m of a)for(c=0,++f;c<d;++c)(o[c][f]=[0,+r(m,o[c].key,f,a)]).data=m;for(c=0,p=DN(t(o));c<d;++c)o[p[c]].index=c;return n(o,p),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Bt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Bt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?g1:typeof a=="function"?a:Bt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??_l,i):n},i}function Ole(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}_l(e,t)}}function Ele(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,c=0;o<i;++o)c+=e[o][n][1]||0;r[n][1]+=r[n][0]=-c/2}_l(e,t)}}function Tle(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var c=0,d=0,f=0;c<o;++c){for(var p=e[t[c]],m=p[r][1]||0,y=p[r-1][1]||0,v=(m-y)/2,x=0;x<c;++x){var w=e[t[x]],j=w[r][1]||0,k=w[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,_l(e,t)}}var Vx={},Zx={},pP;function Ple(){return pP||(pP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(Zx)),Zx}var Yx={},mP;function A3(){return mP||(mP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}e.isDeepKey=t})(Yx)),Yx}var Wx={},gP;function LN(){return gP||(gP=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})(Wx)),Wx}var Qx={},Xx={},yP;function zle(){return yP||(yP=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})(Xx)),Xx}var vP;function $N(){return vP||(vP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zle(),n=LN();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],o=i.length;if(o===0)return a;let c=0,d="",f="",p=!1;for(i.charCodeAt(0)===46&&(a.push(""),c++);c<o;){const m=i[c];f?m==="\\"&&c+1<o?(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})(Qx)),Qx}var bP;function UN(){return bP||(bP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ple(),n=A3(),r=LN(),i=$N();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 o(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 o(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})(Vx)),Vx}var Jx,xP;function Rle(){return xP||(xP=1,Jx=UN().get),Jx}var Mle=Rle();const tv=wa(Mle);var Dle=4;function to(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Dle,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Zn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,o)=>{var c=n[o-1];return typeof c=="string"?i+c+a:c!==void 0?i+to(c)+a:i+a},"")}var bi=e=>e===0?0:e>0?1:-1,ya=e=>typeof e=="number"&&e!=+e,Al=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Ue=e=>(typeof e=="number"||e instanceof Number)&&!ya(e),Ni=e=>Ue(e)||typeof e=="string",Ile=0,Pf=e=>{var t=++Ile;return"".concat(e||"").concat(t)},po=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(!Ue(t)&&typeof t!="string")return r;var a;if(Al(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return ya(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},O3=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 la(e,t,n){return Ue(e)&&Ue(t)?to(e+n*(t-e)):t}function E3(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):tv(r,t))===n)}var Xn=e=>e===null||typeof e>"u",ah=e=>Xn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Or(e){return e!=null}function Mu(){}var Lle=["type","size","sizeType"];function y1(){return y1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y1.apply(null,arguments)}function wP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function SP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wP(Object(n),!0).forEach(function(r){$le(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $le(e,t,n){return(t=Ule(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ule(e){var t=Ble(e,"string");return typeof t=="symbol"?t:t+""}function Ble(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 Fle(e,t){if(e==null)return{};var n,r,i=qle(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 qle(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 T3={symbolCircle:IN,symbolCross:ile,symbolDiamond:sle,symbolSquare:ole,symbolStar:dle,symbolTriangle:fle,symbolWye:ple},Kle=Math.PI/180,Hle=e=>{var t="symbol".concat(ah(e));return T3[t]||IN},Gle=(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*Kle;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}},Vle=(e,t)=>{T3["symbol".concat(ah(e))]=t},P3=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=Fle(e,Lle),a=SP(SP({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var c=()=>{var y=Hle(o),v=mle().type(y).size(Gle(n,r,o)),x=v();if(x!==null)return x},{className:d,cx:f,cy:p}=a,m=zr(a);return Ue(f)&&Ue(p)&&Ue(n)?S.createElement("path",y1({},m,{className:Ct("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:c()})):null};P3.registerSymbol=Vle;var z3=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,BN=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(S.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{zN(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},Zle=(e,t,n)=>r=>(e(t,n,r),null),R3=(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];zN(i)&&typeof a=="function"&&(r||(r={}),r[i]=Zle(a,t,n))}),r};function jP(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 Yle(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jP(Object(n),!0).forEach(function(r){Wle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wle(e,t,n){return(t=Qle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qle(e){var t=Xle(e,"string");return typeof t=="symbol"?t:t+""}function Xle(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 gr(e,t){var n=Yle({},e),r=t,i=Object.keys(t),a=i.reduce((o,c)=>(o[c]===void 0&&r[c]!==void 0&&(o[c]=r[c]),o),n);return a}function kg(){return kg=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},kg.apply(null,arguments)}function NP(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 M3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NP(Object(n),!0).forEach(function(r){Jle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jle(e,t,n){return(t=ece(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ece(e){var t=tce(e,"string");return typeof t=="symbol"?t:t+""}function tce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mi=32,nce={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function rce(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function ice(e){var{data:t,iconType:n,inactiveColor:r}=e,i=mi/2,a=mi/6,o=mi/3,c=t.inactive?r:t.color,d=n??t.type;if(d==="none")return null;if(d==="plainline")return S.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:rce(t.payload),x1:0,y1:i,x2:mi,y2:i,className:"recharts-legend-icon"});if(d==="line")return S.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(o,`
|
|
254
|
-
A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(i,`
|
|
255
|
-
H`).concat(mi,"M").concat(2*o,",").concat(i,`
|
|
256
|
-
A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(i),className:"recharts-legend-icon"});if(d==="rect")return S.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(mi/8,"h").concat(mi,"v").concat(mi*3/4,"h").concat(-mi,"z"),className:"recharts-legend-icon"});if(S.isValidElement(t.legendIcon)){var f=M3({},t);return delete f.legendIcon,S.cloneElement(t.legendIcon,f)}return S.createElement(P3,{fill:c,cx:i,cy:i,size:mi,sizeType:"diameter",type:d})}function ace(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:c}=e,d={x:0,y:0,width:mi,height:mi},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,x=Ct({"recharts-legend-item":!0,["legend-item-".concat(y)]:!0,inactive:m.inactive});if(m.type==="none")return null;var w=typeof c=="object"?M3({},c):{};w.color=m.inactive?a:w.color||m.color;var j=v?v(m.value,m,y):m.value;return S.createElement("li",kg({className:x,style:f,key:"legend-item-".concat(y)},R3(e,m,y)),S.createElement(RN,{width:n,height:n,viewBox:d,style:p,"aria-label":"".concat(m.value," legend icon")},S.createElement(ice,{data:m,iconType:o,inactiveColor:a})),S.createElement("span",{className:"recharts-legend-item-text",style:w},j))})}var sce=e=>{var t=gr(e,nce),{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 S.createElement("ul",{className:"recharts-default-legend",style:a},S.createElement(ace,kg({},t,{payload:n})))},ew={},tw={},kP;function oce(){return kP||(kP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a<n.length;a++){const o=n[a],c=r(o,a,n);i.has(c)||i.set(c,o)}return Array.from(i.values())}e.uniqBy=t})(tw)),tw}var nw={},CP;function lce(){return CP||(CP=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})(nw)),nw}var rw={},_P;function D3(){return _P||(_P=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(rw)),rw}var iw={},aw={},sw={},AP;function cce(){return AP||(AP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(sw)),sw}var OP;function I3(){return OP||(OP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cce();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(aw)),aw}var ow={},EP;function uce(){return EP||(EP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(ow)),ow}var TP;function dce(){return TP||(TP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=I3(),n=uce();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(iw)),iw}var lw={},cw={},PP;function fce(){return PP||(PP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=UN();function n(r){return function(i){return t.get(i,r)}}e.property=n})(cw)),cw}var uw={},dw={},fw={},hw={},zP;function L3(){return zP||(zP=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})(hw)),hw}var pw={},RP;function $3(){return RP||(RP=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})(pw)),pw}var mw={},MP;function U3(){return MP||(MP=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})(mw)),mw}var DP;function hce(){return DP||(DP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=L3(),n=$3(),r=U3();function i(p,m,y){return typeof y!="function"?i(p,m,()=>{}):a(p,m,function v(x,w,j,k,O,_){const C=y(x,w,j,k,O,_);return C!==void 0?!!C:a(x,w,v,_)},new Map)}function a(p,m,y,v){if(m===p)return!0;switch(typeof m){case"object":return o(p,m,y,v);case"function":return Object.keys(m).length>0?a(p,{...m},y,v):r.isEqualsSameValueZero(p,m);default:return t.isObject(p)?typeof m=="string"?m==="":!0:r.isEqualsSameValueZero(p,m)}}function o(p,m,y,v){if(m==null)return!0;if(Array.isArray(m))return d(p,m,y,v);if(m instanceof Map)return c(p,m,y,v);if(m instanceof Set)return f(p,m,y,v);const x=Object.keys(m);if(p==null||n.isPrimitive(p))return x.length===0;if(x.length===0)return!0;if(v?.has(m))return v.get(m)===p;v?.set(m,p);try{for(let w=0;w<x.length;w++){const j=x[w];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[x,w]of m.entries()){const j=p.get(x);if(y(j,w,x,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 x=new Set;for(let w=0;w<m.length;w++){const j=m[w];let k=!1;for(let O=0;O<p.length;O++){if(x.has(O))continue;const _=p[O];let C=!1;if(y(_,j,w,p,m,v)&&(C=!0),C){x.add(O),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})(fw)),fw}var IP;function B3(){return IP||(IP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hce();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(dw)),dw}var gw={},yw={},vw={},LP;function pce(){return LP||(LP=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})(vw)),vw}var bw={},$P;function FN(){return $P||($P=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})(bw)),bw}var xw={},UP;function F3(){return UP||(UP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",o="[object Symbol]",c="[object Date]",d="[object Map]",f="[object Set]",p="[object Array]",m="[object Function]",y="[object ArrayBuffer]",v="[object Object]",x="[object Error]",w="[object DataView]",j="[object Uint8Array]",k="[object Uint8ClampedArray]",O="[object Uint16Array]",_="[object Uint32Array]",C="[object BigUint64Array]",P="[object Int8Array]",T="[object Int16Array]",A="[object Int32Array]",z="[object BigInt64Array]",I="[object Float32Array]",q="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=y,e.arrayTag=p,e.bigInt64ArrayTag=z,e.bigUint64ArrayTag=C,e.booleanTag=i,e.dataViewTag=w,e.dateTag=c,e.errorTag=x,e.float32ArrayTag=I,e.float64ArrayTag=q,e.functionTag=m,e.int16ArrayTag=T,e.int32ArrayTag=A,e.int8ArrayTag=P,e.mapTag=d,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=f,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=O,e.uint32ArrayTag=_,e.uint8ArrayTag=j,e.uint8ClampedArrayTag=k})(xw)),xw}var ww={},BP;function mce(){return BP||(BP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(ww)),ww}var FP;function q3(){return FP||(FP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pce(),n=FN(),r=F3(),i=$3(),a=mce();function o(p,m){return c(p,void 0,p,new Map,m)}function c(p,m,y,v=new Map,x=void 0){const w=x?.(p,m,y,v);if(w!==void 0)return w;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,x);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,O]of p)j.set(k,c(O,k,y,v,x));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,x));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,x);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,x),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,x),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,x),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,x),j}if(p instanceof Boolean){const j=new Boolean(p.valueOf());return v.set(p,j),d(j,p,y,v,x),j}if(p instanceof Number){const j=new Number(p.valueOf());return v.set(p,j),d(j,p,y,v,x),j}if(p instanceof String){const j=new String(p.valueOf());return v.set(p,j),d(j,p,y,v,x),j}if(typeof p=="object"&&f(p)){const j=Object.create(Object.getPrototypeOf(p));return v.set(p,j),d(j,p,y,v,x),j}return p}function d(p,m,y=p,v,x){const w=[...Object.keys(m),...t.getSymbols(m)];for(let j=0;j<w.length;j++){const k=w[j],O=Object.getOwnPropertyDescriptor(p,k);(O==null||O.writable)&&(p[k]=c(m[k],k,y,v,x))}}function f(p){switch(n.getTag(p)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=c,e.copyProperties=d})(yw)),yw}var qP;function gce(){return qP||(qP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=q3();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(gw)),gw}var KP;function yce(){return KP||(KP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=B3(),n=gce();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(uw)),uw}var Sw={},jw={},Nw={},HP;function vce(){return HP||(HP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=q3(),n=FN(),r=F3();function i(a,o){return t.cloneDeepWith(a,(c,d,f,p)=>{const m=o?.(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})(Nw)),Nw}var GP;function bce(){return GP||(GP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vce();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(jw)),jw}var kw={},Cw={},VP;function K3(){return VP||(VP=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})(Cw)),Cw}var _w={},ZP;function xce(){return ZP||(ZP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=FN();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(_w)),_w}var YP;function wce(){return YP||(YP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=A3(),n=K3(),r=xce(),i=$N();function a(o,c){let d;if(Array.isArray(c)?d=c:typeof c=="string"&&t.isDeepKey(c)&&o?.[c]==null?d=i.toPath(c):d=[c],d.length===0)return!1;let f=o;for(let p=0;p<d.length;p++){const m=d[p];if((f==null||!Object.hasOwn(f,m))&&!((Array.isArray(f)||r.isArguments(f))&&n.isIndex(m)&&m<f.length))return!1;f=f[m]}return!0}e.has=a})(kw)),kw}var WP;function Sce(){return WP||(WP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=B3(),n=LN(),r=bce(),i=UN(),a=wce();function o(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=o})(Sw)),Sw}var QP;function jce(){return QP||(QP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=D3(),n=fce(),r=yce(),i=Sce();function a(o){if(o==null)return t.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?i.matchesProperty(o[0],o[1]):r.matches(o);case"string":case"symbol":case"number":return n.property(o)}}e.iteratee=a})(lw)),lw}var XP;function Nce(){return XP||(XP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oce(),n=lce(),r=D3(),i=dce(),a=jce();function o(c,d=r.identity){return i.isArrayLikeObject(c)?t.uniqBy(Array.from(c),n.ary(a.iteratee(d),1)):[]}e.uniqBy=o})(ew)),ew}var Aw,JP;function kce(){return JP||(JP=1,Aw=Nce().uniqBy),Aw}var Cce=kce();const ez=wa(Cce);function H3(e,t,n){return t===!0?ez(e,n):typeof t=="function"?ez(e,t):e}var qN=S.createContext(null),_ce=e=>e,ln=()=>{var e=S.useContext(qN);return e?e.store.dispatch:_ce},Hm=()=>{},Ace=()=>Hm,Oce=(e,t)=>e===t;function Fe(e){var t=S.useContext(qN),n=S.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Hm,[t,e]);return bI.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Ace,t?t.store.getState:Hm,t?t.store.getState:Hm,n,Oce)}function Ece(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Tce(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Pce(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 tz=e=>Array.isArray(e)?e:[e];function zce(e){const t=Array.isArray(e[0])?e[0]:e;return Pce(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Rce(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Mce=class{constructor(e){this.value=e}deref(){return this.value}},Dce=typeof WeakRef<"u"?WeakRef:Mce,Ice=0,nz=1;function vm(){return{s:Ice,v:void 0,o:null,p:null}}function G3(e,t={}){let n=vm();const{resultEqualityCheck:r}=t;let i,a=0;function o(){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 x=c.o;x===null&&(c.o=x=new WeakMap);const w=x.get(v);w===void 0?(c=vm(),x.set(v,c)):c=w}else{let x=c.p;x===null&&(c.p=x=new Map);const w=x.get(v);w===void 0?(c=vm(),x.set(v,c)):c=w}}const f=c;let p;if(c.s===nz)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 Dce(p):p}return f.s=nz,f.v=p,p}return o.clearCache=()=>{n=vm(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Lce(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,o=0,c,d={},f=i.pop();typeof f=="object"&&(d=f,f=i.pop()),Ece(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p={...n,...d},{memoize:m,memoizeOptions:y=[],argsMemoize:v=G3,argsMemoizeOptions:x=[]}=p,w=tz(y),j=tz(x),k=zce(i),O=m(function(){return a++,f.apply(null,arguments)},...w),_=v(function(){o++;const P=Rce(k,arguments);return c=O.apply(null,P),c},...j);return Object.assign(_,{resultFunc:f,memoizedResultFunc:O,dependencies:k,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>c,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var le=Lce(G3),$ce=Object.assign((e,t=le)=>{Tce(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((o,c,d)=>(o[n[d]]=c,o),{}))},{withTypes:()=>$ce}),Ow={},Ew={},Tw={},rz;function Uce(){return rz||(rz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,a)=>{if(r!==i){const o=t(r),c=t(i);if(o===c&&o===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?c-o:o-c}return 0};e.compareValues=n})(Tw)),Tw}var Pw={},zw={},iz;function V3(){return iz||(iz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(zw)),zw}var az;function Bce(){return az||(az=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=V3(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,o){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(r.test(a)||!n.test(a))||o!=null&&Object.hasOwn(o,a)}e.isKey=i})(Pw)),Pw}var sz;function Fce(){return sz||(sz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Uce(),n=Bce(),r=$N();function i(a,o,c,d){if(a==null)return[];c=d?void 0:c,Array.isArray(a)||(a=Object.values(a)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(c)||(c=c==null?[]:[c]),c=c.map(v=>String(v));const f=(v,x)=>{let w=v;for(let j=0;j<x.length&&w!=null;++j)w=w[x[j]];return w},p=(v,x)=>x==null||v==null?x:typeof v=="object"&&"key"in v?Object.hasOwn(x,v.key)?x[v.key]:f(x,v.path):typeof v=="function"?v(x):Array.isArray(v)?f(x,v):typeof x=="object"?x[v]:x,m=o.map(v=>(Array.isArray(v)&&v.length===1&&(v=v[0]),v==null||typeof v=="function"||Array.isArray(v)||n.isKey(v)?v:{key:v,path:r.toPath(v)}));return a.map(v=>({original:v,criteria:m.map(x=>p(x,v))})).slice().sort((v,x)=>{for(let w=0;w<m.length;w++){const j=t.compareValues(v.criteria[w],x.criteria[w],c[w]);if(j!==0)return j}return 0}).map(v=>v.original)}e.orderBy=i})(Ew)),Ew}var Rw={},oz;function qce(){return oz||(oz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),o=(c,d)=>{for(let f=0;f<c.length;f++){const p=c[f];Array.isArray(p)&&d<a?o(p,d+1):i.push(p)}};return o(n,0),i}e.flatten=t})(Rw)),Rw}var Mw={},lz;function Z3(){return lz||(lz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=K3(),n=I3(),r=L3(),i=U3();function a(o,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],o):!1}e.isIterateeCall=a})(Mw)),Mw}var cz;function Kce(){return cz||(cz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Fce(),n=qce(),r=Z3();function i(a,...o){const c=o.length;return c>1&&r.isIterateeCall(a,o[0],o[1])?o=[]:c>2&&r.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(a,n.flatten(o),["asc"])}e.sortBy=i})(Ow)),Ow}var Dw,uz;function Hce(){return uz||(uz=1,Dw=Kce().sortBy),Dw}var Gce=Hce();const nv=wa(Gce);var Y3=e=>e.legend.settings,Vce=e=>e.legend.size,Zce=e=>e.legend.payload,Yce=le([Zce,Y3],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?nv(r,n):r});function Wce(){return Fe(Yce)}var bm=1;function W3(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=S.useState({height:0,left:0,top:0,width:0}),r=S.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),o={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(o.height-t.height)>bm||Math.abs(o.left-t.left)>bm||Math.abs(o.top-t.top)>bm||Math.abs(o.width-t.width)>bm)&&n({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Vn(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 Qce=typeof Symbol=="function"&&Symbol.observable||"@@observable",dz=Qce,Iw=()=>Math.random().toString(36).substring(7).split("").join("."),Xce={INIT:`@@redux/INIT${Iw()}`,REPLACE:`@@redux/REPLACE${Iw()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Iw()}`},Cg=Xce;function KN(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 Q3(e,t,n){if(typeof e!="function")throw new Error(Vn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Vn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Vn(1));return n(Q3)(e,t)}let r=e,i=t,a=new Map,o=a,c=0,d=!1;function f(){o===a&&(o=new Map,a.forEach((j,k)=>{o.set(k,j)}))}function p(){if(d)throw new Error(Vn(3));return i}function m(j){if(typeof j!="function")throw new Error(Vn(4));if(d)throw new Error(Vn(5));let k=!0;f();const O=c++;return o.set(O,j),function(){if(k){if(d)throw new Error(Vn(6));k=!1,f(),o.delete(O),a=null}}}function y(j){if(!KN(j))throw new Error(Vn(7));if(typeof j.type>"u")throw new Error(Vn(8));if(typeof j.type!="string")throw new Error(Vn(17));if(d)throw new Error(Vn(9));try{d=!0,i=r(i,j)}finally{d=!1}return(a=o).forEach(O=>{O()}),j}function v(j){if(typeof j!="function")throw new Error(Vn(10));r=j,y({type:Cg.REPLACE})}function x(){const j=m;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(Vn(11));function O(){const C=k;C.next&&C.next(p())}return O(),{unsubscribe:j(O)}},[dz](){return this}}}return y({type:Cg.INIT}),{dispatch:y,subscribe:m,getState:p,replaceReducer:v,[dz]:x}}function Jce(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Cg.INIT})>"u")throw new Error(Vn(12));if(typeof n(void 0,{type:Cg.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Vn(13))})}function X3(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const o=t[a];typeof e[o]=="function"&&(n[o]=e[o])}const r=Object.keys(n);let i;try{Jce(n)}catch(a){i=a}return function(o={},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=o[m],x=y(v,c);if(typeof x>"u")throw c&&c.type,new Error(Vn(14));f[m]=x,d=d||x!==v}return d=d||r.length!==Object.keys(o).length,d?f:o}}function _g(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function eue(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Vn(15))};const o={getState:i.getState,dispatch:(d,...f)=>a(d,...f)},c=e.map(d=>d(o));return a=_g(...c)(i.dispatch),{...i,dispatch:a}}}function J3(e){return KN(e)&&"type"in e&&typeof e.type=="string"}var e4=Symbol.for("immer-nothing"),fz=Symbol.for("immer-draftable"),mr=Symbol.for("immer-state");function Fi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Zr=Object,mu=Zr.getPrototypeOf,Ag="constructor",rv="prototype",v1="configurable",Og="enumerable",Gm="writable",zf="value",as=e=>!!e&&!!e[mr];function Zi(e){return e?t4(e)||av(e)||!!e[fz]||!!e[Ag]?.[fz]||sv(e)||ov(e):!1}var tue=Zr[rv][Ag].toString(),hz=new WeakMap;function t4(e){if(!e||!HN(e))return!1;const t=mu(e);if(t===null||t===Zr[rv])return!0;const n=Zr.hasOwnProperty.call(t,Ag)&&t[Ag];if(n===Object)return!0;if(!qc(n))return!1;let r=hz.get(n);return r===void 0&&(r=Function.toString.call(n),hz.set(n,r)),r===tue}function iv(e,t,n=!0){sh(e)===0?(n?Reflect.ownKeys(e):Zr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function sh(e){const t=e[mr];return t?t.type_:av(e)?1:sv(e)?2:ov(e)?3:0}var pz=(e,t,n=sh(e))=>n===2?e.has(t):Zr[rv].hasOwnProperty.call(e,t),b1=(e,t,n=sh(e))=>n===2?e.get(t):e[t],Eg=(e,t,n,r=sh(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function nue(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var av=Array.isArray,sv=e=>e instanceof Map,ov=e=>e instanceof Set,HN=e=>typeof e=="object",qc=e=>typeof e=="function",Lw=e=>typeof e=="boolean";function rue(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Za=e=>e.copy_||e.base_,GN=e=>e.modified_?e.copy_:e.base_;function x1(e,t){if(sv(e))return new Map(e);if(ov(e))return new Set(e);if(av(e))return Array[rv].slice.call(e);const n=t4(e);if(t===!0||t==="class_only"&&!n){const r=Zr.getOwnPropertyDescriptors(e);delete r[mr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],c=r[o];c[Gm]===!1&&(c[Gm]=!0,c[v1]=!0),(c.get||c.set)&&(r[o]={[v1]:!0,[Gm]:!0,[Og]:c[Og],[zf]:e[o]})}return Zr.create(mu(e),r)}else{const r=mu(e);if(r!==null&&n)return{...e};const i=Zr.create(r);return Zr.assign(i,e)}}function VN(e,t=!1){return lv(e)||as(e)||!Zi(e)||(sh(e)>1&&Zr.defineProperties(e,{set:xm,add:xm,clear:xm,delete:xm}),Zr.freeze(e),t&&iv(e,(n,r)=>{VN(r,!0)},!1)),e}function iue(){Fi(2)}var xm={[zf]:iue};function lv(e){return e===null||!HN(e)?!0:Zr.isFrozen(e)}var Tg="MapSet",w1="Patches",mz="ArrayMethods",n4={};function Ol(e){const t=n4[e];return t||Fi(0,e),t}var gz=e=>!!n4[e],Rf,r4=()=>Rf,aue=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:gz(Tg)?Ol(Tg):void 0,arrayMethodsPlugin_:gz(mz)?Ol(mz):void 0});function yz(e,t){t&&(e.patchPlugin_=Ol(w1),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function S1(e){j1(e),e.drafts_.forEach(sue),e.drafts_=null}function j1(e){e===Rf&&(Rf=e.parent_)}var vz=e=>Rf=aue(Rf,e);function sue(e){const t=e[mr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function bz(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[mr].modified_&&(S1(t),Fi(4)),Zi(e)&&(e=xz(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[mr].base_,e,t)}else e=xz(t,n);return oue(t,e,!0),S1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==e4?e:void 0}function xz(e,t){if(lv(t))return t;const n=t[mr];if(!n)return Pg(t,e.handledSet_,e);if(!cv(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);s4(n,e)}return n.copy_}function oue(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&VN(t,n)}function i4(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var cv=(e,t)=>e.scope_===t,lue=[];function a4(e,t,n,r){const i=Za(e),a=e.type_;if(r!==void 0&&b1(i,r,a)===t){Eg(i,r,n,a);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;iv(i,(d,f)=>{if(as(f)){const p=c.get(f)||[];p.push(d),c.set(f,p)}})}const o=e.draftLocations_.get(t)??lue;for(const c of o)Eg(i,c,n,a)}function cue(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!cv(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const o=GN(a);a4(e,a.draft_??a,o,n),s4(a,i)})}function s4(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)}i4(e)}}function uue(e,t,n){const{scope_:r}=e;if(as(n)){const i=n[mr];cv(i,r)&&i.callbacks_.push(function(){Vm(e);const o=GN(i);a4(e,n,o,t)})}else Zi(n)&&e.callbacks_.push(function(){const a=Za(e);e.type_===3?a.has(n)&&Pg(n,r.handledSet_,r):b1(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Pg(b1(e.copy_,t,e.type_),r.handledSet_,r)})}function Pg(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||as(e)||t.has(e)||!Zi(e)||lv(e)||(t.add(e),iv(e,(r,i)=>{if(as(i)){const a=i[mr];if(cv(a,n)){const o=GN(a);Eg(e,r,o,e.type_),i4(a)}}else Zi(i)&&Pg(i,t,n)})),e}function due(e,t){const n=av(e),r={type_:n?1:0,scope_:t?t.scope_:r4(),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=zg;n&&(i=[r],a=Mf);const{revoke:o,proxy:c}=Proxy.revocable(i,a);return r.draft_=c,r.revoke_=o,[c,r]}var zg={get(e,t){if(t===mr)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=Za(e);if(!pz(i,t,e.type_))return fue(e,i,t);const a=i[t];if(e.finalized_||!Zi(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&rue(t))return a;if(a===$w(e.base_,t)){Vm(e);const o=e.type_===1?+t:t,c=k1(e.scope_,a,e,o);return e.copy_[o]=c}return a},has(e,t){return t in Za(e)},ownKeys(e){return Reflect.ownKeys(Za(e))},set(e,t,n){const r=o4(Za(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=$w(Za(e),t),a=i?.[mr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(nue(n,i)&&(n!==void 0||pz(e.base_,t,e.type_)))return!0;Vm(e),N1(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),uue(e,t,n)),!0},deleteProperty(e,t){return Vm(e),$w(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),N1(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Za(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Gm]:!0,[v1]:e.type_!==1||t!=="length",[Og]:r[Og],[zf]:n[t]}},defineProperty(){Fi(11)},getPrototypeOf(e){return mu(e.base_)},setPrototypeOf(){Fi(12)}},Mf={};for(let e in zg){let t=zg[e];Mf[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Mf.deleteProperty=function(e,t){return Mf.set.call(this,e,t,void 0)};Mf.set=function(e,t,n){return zg.set.call(this,e[0],t,n,e[0])};function $w(e,t){const n=e[mr];return(n?Za(n):e)[t]}function fue(e,t,n){const r=o4(t,n);return r?zf in r?r[zf]:r.get?.call(e.draft_):void 0}function o4(e,t){if(!(t in e))return;let n=mu(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=mu(n)}}function N1(e){e.modified_||(e.modified_=!0,e.parent_&&N1(e.parent_))}function Vm(e){e.copy_||(e.assigned_=new Map,e.copy_=x1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var hue=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(qc(n)&&!qc(r)){const o=r;r=n;const c=this;return function(f=o,...p){return c.produce(f,m=>r.call(this,m,...p))}}qc(r)||Fi(6),i!==void 0&&!qc(i)&&Fi(7);let a;if(Zi(n)){const o=vz(this),c=k1(o,n,void 0);let d=!0;try{a=r(c),d=!1}finally{d?S1(o):j1(o)}return yz(o,i),bz(a,o)}else if(!n||!HN(n)){if(a=r(n),a===void 0&&(a=n),a===e4&&(a=void 0),this.autoFreeze_&&VN(a,!0),i){const o=[],c=[];Ol(w1).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:c}),i(o,c)}return a}else Fi(1,n)},this.produceWithPatches=(n,r)=>{if(qc(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]},Lw(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Lw(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Lw(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Zi(t)||Fi(8),as(t)&&(t=xi(t));const n=vz(this),r=k1(n,t,void 0);return r[mr].isManual_=!0,j1(n),r}finishDraft(t,n){const r=t&&t[mr];(!r||!r.isManual_)&&Fi(9);const{scope_:i}=r;return yz(i,n),bz(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=Ol(w1).applyPatches_;return as(t)?i(t,n):this.produce(t,a=>i(a,n))}};function k1(e,t,n,r){const[i,a]=sv(t)?Ol(Tg).proxyMap_(t,n):ov(t)?Ol(Tg).proxySet_(t,n):due(t,n);return(n?.scope_??r4()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?cue(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 xi(e){return as(e)||Fi(10,e),l4(e)}function l4(e){if(!Zi(e)||lv(e))return e;const t=e[mr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=x1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=x1(e,!0);return iv(n,(i,a)=>{Eg(n,i,l4(a))},r),t&&(t.finalized_=!1),n}var pue=new hue,c4=pue.produce;function u4(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var mue=u4(),gue=u4,yue=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?_g:_g.apply(null,arguments)};function Wr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Yr(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=>J3(r)&&r.type===e,n}var d4=class sf extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,sf.prototype)}static get[Symbol.species](){return sf}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new sf(...t[0].concat(this)):new sf(...t.concat(this))}};function wz(e){return Zi(e)?c4(e,()=>{}):e}function wm(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function vue(e){return typeof e=="boolean"}var bue=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new d4;return n&&(vue(n)?o.push(mue):o.push(gue(n.extraArgument))),o},f4="RTK_autoBatch",Zt=()=>e=>({payload:e,meta:{[f4]:!0}}),Sz=e=>t=>{setTimeout(t,e)},h4=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,o=!1;const c=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Sz(10):e.type==="callback"?e.queueNotification:Sz(e.timeout),f=()=>{o=!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?.[f4],a=!i,a&&(o||(o=!0,d(f))),r.dispatch(p)}finally{i=!0}}})},xue=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new d4(e);return r&&i.push(h4(typeof r=="object"?r:void 0)),i};function wue(e){const t=bue(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(KN(n))c=X3(n);else throw new Error(Yr(1));let d;typeof r=="function"?d=r(t):d=t();let f=_g;i&&(f=yue({trace:!1,...typeof i=="object"&&i}));const p=eue(...d),m=xue(p);let y=typeof o=="function"?o(m):m();const v=f(...y);return Q3(c,a,v)}function p4(e){const t={},n=[];let r;const i={addCase(a,o){const c=typeof a=="string"?a:a.type;if(!c)throw new Error(Yr(28));if(c in t)throw new Error(Yr(29));return t[c]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return n.push({matcher:a,reducer:o}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function Sue(e){return typeof e=="function"}function jue(e,t){let[n,r,i]=p4(t),a;if(Sue(e))a=()=>wz(e());else{const c=wz(e);a=()=>c}function o(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(as(p)){const v=m(p,d);return v===void 0?p:v}else{if(Zi(p))return c4(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 o.getInitialState=a,o}var Nue="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",kue=(e=21)=>{let t="",n=e;for(;n--;)t+=Nue[Math.random()*64|0];return t},Cue=Symbol.for("rtk-slice-createasyncthunk");function _ue(e,t){return`${e}/${t}`}function Aue({creators:e}={}){const t=e?.asyncThunk?.[Cue];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(Yr(11));const o=(typeof r.reducers=="function"?r.reducers(Eue()):r.reducers)||{},c=Object.keys(o),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(_,C){const P=typeof _=="string"?_:_.type;if(!P)throw new Error(Yr(12));if(P in d.sliceCaseReducersByType)throw new Error(Yr(13));return d.sliceCaseReducersByType[P]=C,f},addMatcher(_,C){return d.sliceMatchers.push({matcher:_,reducer:C}),f},exposeAction(_,C){return d.actionCreators[_]=C,f},exposeCaseReducer(_,C){return d.sliceCaseReducersByName[_]=C,f}};c.forEach(_=>{const C=o[_],P={reducerName:_,type:_ue(i,_),createNotation:typeof r.reducers=="function"};Pue(C)?Rue(P,C,f,t):Tue(P,C,f)});function p(){const[_={},C=[],P=void 0]=typeof r.extraReducers=="function"?p4(r.extraReducers):[r.extraReducers],T={..._,...d.sliceCaseReducersByType};return jue(r.initialState,A=>{for(let z in T)A.addCase(z,T[z]);for(let z of d.sliceMatchers)A.addMatcher(z.matcher,z.reducer);for(let z of C)A.addMatcher(z.matcher,z.reducer);P&&A.addDefaultCase(P)})}const m=_=>_,y=new Map,v=new WeakMap;let x;function w(_,C){return x||(x=p()),x(_,C)}function j(){return x||(x=p()),x.getInitialState()}function k(_,C=!1){function P(A){let z=A[_];return typeof z>"u"&&C&&(z=wm(v,P,j)),z}function T(A=m){const z=wm(y,C,()=>new WeakMap);return wm(z,A,()=>{const I={};for(const[q,U]of Object.entries(r.selectors??{}))I[q]=Oue(U,A,()=>wm(v,A,j),C);return I})}return{reducerPath:_,getSelectors:T,get selectors(){return T(P)},selectSlice:P}}const O={name:i,reducer:w,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:j,...k(a),injectInto(_,{reducerPath:C,...P}={}){const T=C??a;return _.inject({reducerPath:T,reducer:w},P),{...O,...k(T,!0)}}};return O}}function Oue(e,t,n,r){function i(a,...o){let c=t(a);return typeof c>"u"&&r&&(c=n()),e(c,...o)}return i.unwrapped=e,i}var or=Aue();function Eue(){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 Tue({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!zue(r))throw new Error(Yr(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Wr(e,o):Wr(e))}function Pue(e){return e._reducerDefinitionType==="asyncThunk"}function zue(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Rue({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Yr(18));const{payloadCreator:a,fulfilled:o,pending:c,rejected:d,settled:f,options:p}=n,m=i(e,a,p);r.exposeAction(t,m),o&&r.addCase(m.fulfilled,o),c&&r.addCase(m.pending,c),d&&r.addCase(m.rejected,d),f&&r.addMatcher(m.settled,f),r.exposeCaseReducer(t,{fulfilled:o||Sm,pending:c||Sm,rejected:d||Sm,settled:f||Sm})}function Sm(){}var Mue="task",m4="listener",g4="completed",ZN="cancelled",Due=`task-${ZN}`,Iue=`task-${g4}`,C1=`${m4}-${ZN}`,Lue=`${m4}-${g4}`,uv=class{constructor(e){this.code=e,this.message=`${Mue} ${ZN} (reason: ${e})`}name="TaskAbortError";message},YN=(e,t)=>{if(typeof e!="function")throw new TypeError(Yr(32))},Rg=()=>{},y4=(e,t=Rg)=>(e.catch(t),e),v4=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),vl=e=>{if(e.aborted)throw new uv(e.reason)};function b4(e,t){let n=Rg;return new Promise((r,i)=>{const a=()=>i(new uv(e.reason));if(e.aborted){a();return}n=v4(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Rg})}var $ue=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof uv?"cancelled":"rejected",error:n}}finally{t?.()}},Mg=e=>t=>y4(b4(e,t).then(n=>(vl(e),n))),x4=e=>{const t=Mg(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:su}=Object,jz={},dv="listenerMiddleware",Uue=(e,t)=>{const n=r=>v4(e,()=>r.abort(e.reason));return(r,i)=>{YN(r);const a=new AbortController;n(a);const o=$ue(async()=>{vl(e),vl(a.signal);const c=await r({pause:Mg(a.signal),delay:x4(a.signal),signal:a.signal});return vl(a.signal),c},()=>a.abort(Iue));return i?.autoJoin&&t.push(o.catch(Rg)),{result:Mg(e)(o),cancel(){a.abort(Due)}}}},Bue=(e,t)=>{const n=async(r,i)=>{vl(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 b4(t,Promise.race(c));return vl(t),d}finally{a()}};return(r,i)=>y4(n(r,i))},w4=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Wr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Yr(21));return YN(a),{predicate:i,type:t,effect:a}},S4=su(e=>{const{type:t,predicate:n,effect:r}=w4(e);return{id:kue(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Yr(22))}}},{withTypes:()=>S4}),Nz=(e,t)=>{const{type:n,effect:r,predicate:i}=w4(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},_1=e=>{e.pending.forEach(t=>{t.abort(C1)})},Fue=(e,t)=>()=>{for(const n of t.keys())_1(n);e.clear()},kz=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},j4=su(Wr(`${dv}/add`),{withTypes:()=>j4}),que=Wr(`${dv}/removeAll`),N4=su(Wr(`${dv}/remove`),{withTypes:()=>N4}),Kue=(...e)=>{console.error(`${dv}/error`,...e)},oh=(e={})=>{const t=new Map,n=new Map,r=v=>{const x=n.get(v)??0;n.set(v,x+1)},i=v=>{const x=n.get(v)??1;x===1?n.delete(v):n.set(v,x-1)},{extra:a,onError:o=Kue}=e;YN(o);const c=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),x=>{v.unsubscribe(),x?.cancelActive&&_1(v)}),d=v=>{const x=Nz(t,v)??S4(v);return c(x)};su(d,{withTypes:()=>d});const f=v=>{const x=Nz(t,v);return x&&(x.unsubscribe(),v.cancelActive&&_1(x)),!!x};su(f,{withTypes:()=>f});const p=async(v,x,w,j)=>{const k=new AbortController,O=Bue(d,k.signal),_=[];try{v.pending.add(k),r(v),await Promise.resolve(v.effect(x,su({},w,{getOriginalState:j,condition:(C,P)=>O(C,P).then(Boolean),take:O,delay:x4(k.signal),pause:Mg(k.signal),extra:a,signal:k.signal,fork:Uue(k.signal,_),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((C,P,T)=>{C!==k&&(C.abort(C1),T.delete(C))})},cancel:()=>{k.abort(C1),v.pending.delete(k)},throwIfCancelled:()=>{vl(k.signal)}})))}catch(C){C instanceof uv||kz(o,C,{raisedBy:"effect"})}finally{await Promise.all(_),k.abort(Lue),i(v),v.pending.delete(k)}},m=Fue(t,n);return{middleware:v=>x=>w=>{if(!J3(w))return x(w);if(j4.match(w))return d(w.payload);if(que.match(w)){m();return}if(N4.match(w))return f(w.payload);let j=v.getState();const k=()=>{if(j===jz)throw new Error(Yr(23));return j};let O;try{if(O=x(w),t.size>0){const _=v.getState(),C=Array.from(t.values());for(const P of C){let T=!1;try{T=P.predicate(w,_,j)}catch(A){T=!1,kz(o,A,{raisedBy:"predicate"})}T&&p(P,w,v,k)}}}finally{j=jz}return O},startListening:d,stopListening:f,clearListeners:m}};function Yr(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 Hue={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},k4=or({name:"chartLayout",initialState:Hue,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:Gue,setLayout:Vue,setChartSize:Zue,setScale:Yue}=k4.actions,Wue=k4.reducer;function C4(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function nt(e){return Number.isFinite(e)}function va(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Cz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Yc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Cz(Object(n),!0).forEach(function(r){Que(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Que(e,t,n){return(t=Xue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xue(e){var t=Jue(e,"string");return typeof t=="symbol"?t:t+""}function Jue(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 $n(e,t,n){return Xn(e)||Xn(t)?n:Ni(t)?tv(e,t,n):typeof t=="function"?t(e):n}var ede=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:c}=t;if((c==="vertical"||c==="horizontal"&&o==="middle")&&a!=="center"&&Ue(e[a]))return Yc(Yc({},e),{},{[a]:e[a]+(r||0)});if((c==="horizontal"||c==="vertical"&&a==="center")&&o!=="middle"&&Ue(e[o]))return Yc(Yc({},e),{},{[o]:e[o]+(i||0)})}return e},Sa=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",_4=(e,t,n,r)=>{if(r)return e.map(c=>c.coordinate);var i,a,o=e.map(c=>(c.coordinate===t&&(i=!0),c.coordinate===n&&(a=!0),c.coordinate));return i||o.push(t),a||o.push(n),o},A4=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:c,isCategorical:d,categoricalDomain:f,tickCount:p,ticks:m,niceTicks:y,axisType:v}=e;if(!o)return null;var x=c==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,w=i==="category"&&o.bandwidth?o.bandwidth()/x:0;if(w=v==="angleAxis"&&a&&a.length>=2?bi(a[0]-a[1])*2*w:w,m||y){var j=(m||y||[]).map((k,O)=>{var _=r?r.indexOf(k):k,C=o.map(_);return nt(C)?{coordinate:C+w,value:k,offset:w,index:O}:null}).filter(Or);return j}return d&&f?f.map((k,O)=>{var _=o.map(k);return nt(_)?{coordinate:_+w,value:k,index:O,offset:w}:null}).filter(Or):o.ticks&&p!=null?o.ticks(p).map((k,O)=>{var _=o.map(k);return nt(_)?{coordinate:_+w,value:k,index:O,offset:w}:null}).filter(Or):o.domain().map((k,O)=>{var _=o.map(k);return nt(_)?{coordinate:_+w,value:r?r[k]:k,index:O,offset:w}:null}).filter(Or)},tde=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,o=0,c=0;c<n;++c){var d=e[c],f=d?.[i];if(f!=null){var p=f[1],m=f[0],y=ya(p)?m:p;y>=0?(f[0]=a,a+=y,f[1]=a):(f[0]=o,o+=y,f[1]=o)}}}},nde=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,o=0;o<n;++o){var c=e[o],d=c?.[i];if(d!=null){var f=ya(d[1])?d[0]:d[1];f>=0?(d[0]=a,a+=f,d[1]=a):(d[0]=0,d[1]=0)}}}},rde={sign:tde,expand:Ole,none:_l,silhouette:Ele,wiggle:Tle,positive:nde},ide=(e,t,n)=>{var r,i=(r=rde[n])!==null&&r!==void 0?r:_l,a=Ale().keys(t).value((c,d)=>Number($n(c,d,0))).order(g1).offset(i),o=a(e);return o.forEach((c,d)=>{c.forEach((f,p)=>{var m=$n(e[p],t[d],0);Array.isArray(m)&&m.length===2&&Ue(m[0])&&Ue(m[1])&&(f[0]=m[0],f[1]=m[1])})}),o};function ade(e){return e==null?void 0:String(e)}function _z(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Xn(i[t.dataKey])){var c=E3(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=$n(i,Xn(o)?t.dataKey:o),f=t.scale.map(d);return Ue(f)?f:null}var sde=e=>{var t=e.flat(2).filter(Ue);return[Math.min(...t),Math.max(...t)]},ode=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],lde=(e,t,n)=>{if(e!=null)return ode(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,c=o.reduce((d,f)=>{var p=C4(f,t,n),m=sde(p);return!nt(m[0])||!nt(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]))},Az=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Oz=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Dg=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=nv(t,p=>p.coordinate),a=1/0,o=1,c=i.length;o<c;o++){var d=i[o],f=i[o-1];a=Math.min((d?.coordinate||0)-(f?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function Ez(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Yc(Yc({},t),{},{dataKey:n,payload:r,value:i,name:a})}function O4(e,t){if(e)return String(e);if(typeof t=="string")return t}var cde=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},ude=(e,t)=>t==="centric"?e.angle:e.radius,us=e=>e.layout.width,ds=e=>e.layout.height,dde=e=>e.layout.scale,E4=e=>e.layout.margin,fv=le(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),hv=le(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),fde="data-recharts-item-index",hde="data-recharts-item-id",lh=60;function Tz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Tz(Object(n),!0).forEach(function(r){pde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pde(e,t,n){return(t=mde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mde(e){var t=gde(e,"string");return typeof t=="symbol"?t:t+""}function gde(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 yde=e=>e.brush.height;function vde(e){var t=hv(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:lh;return n+i}return n},0)}function bde(e){var t=hv(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:lh;return n+i}return n},0)}function xde(e){var t=fv(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function wde(e){var t=fv(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Jn=le([us,ds,E4,yde,vde,bde,xde,wde,Y3,Vce],(e,t,n,r,i,a,o,c,d,f)=>{var p={left:(n.left||0)+i,right:(n.right||0)+a},m={top:(n.top||0)+o,bottom:(n.bottom||0)+c},y=jm(jm({},m),p),v=y.bottom;y.bottom+=r,y=ede(y,d,f);var x=e-y.left-y.right,w=t-y.top-y.bottom;return jm(jm({brushBottom:v},y),{},{width:Math.max(x,0),height:Math.max(w,0)})}),Sde=le(Jn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),T4=le(us,ds,(e,t)=>({x:0,y:0,width:e,height:t})),jde=S.createContext(null),yr=()=>S.useContext(jde)!=null,pv=e=>e.brush,mv=le([pv,Jn,E4],(e,t,n)=>({height:e.height,x:Ue(e.x)?e.x:t.left,y:Ue(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Ue(e.width)?e.width:t.width})),Uw={},Bw={},Fw={},Pz;function Nde(){return Pz||(Pz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let o,c=null;const d=a!=null&&a.includes("leading"),f=a==null||a.includes("trailing"),p=()=>{c!==null&&(n.apply(o,c),o=void 0,c=null)},m=()=>{f&&p(),w()};let y=null;const v=()=>{y!=null&&clearTimeout(y),y=setTimeout(()=>{y=null,m()},r)},x=()=>{y!==null&&(clearTimeout(y),y=null)},w=()=>{x(),o=void 0,c=null},j=()=>{p()},k=function(...O){if(i?.aborted)return;o=this,c=O;const _=y==null;v(),d&&_&&p()};return k.schedule=v,k.cancel=w,k.flush=j,i?.addEventListener("abort",w,{once:!0}),k}e.debounce=t})(Fw)),Fw}var zz;function kde(){return zz||(zz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Nde();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:o=!1,trailing:c=!0,maxWait:d}=a,f=Array(2);o&&(f[0]="leading"),c&&(f[1]="trailing");let p,m=null;const y=t.debounce(function(...w){p=r.apply(this,w),m=null},i,{edges:f}),v=function(...w){return d!=null&&(m===null&&(m=Date.now()),Date.now()-m>=d)?(p=r.apply(this,w),m=Date.now(),y.cancel(),y.schedule(),p):(y.apply(this,w),p)},x=()=>(y.flush(),p);return v.cancel=y.cancel,v.flush=x,v}e.debounce=n})(Bw)),Bw}var Rz;function Cde(){return Rz||(Rz=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kde();function n(r,i=0,a={}){const{leading:o=!0,trailing:c=!0}=a;return t.debounce(r,i,{leading:o,maxWait:i,trailing:c})}e.throttle=n})(Uw)),Uw}var qw,Mz;function _de(){return Mz||(Mz=1,qw=Cde().throttle),qw}var Ade=_de();const Ode=wa(Ade);var Ig=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var o=0;console.warn(n.replace(/%s/g,()=>i[o++]))}},da={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},P4=(e,t,n)=>{var{width:r=da.width,height:i=da.height,aspect:a,maxHeight:o}=n,c=Al(r)?e:Number(r),d=Al(i)?t:Number(i);return a&&a>0&&(c?d=c/a:d&&(c=d*a),o&&d!=null&&d>o&&(d=o)),{calculatedWidth:c,calculatedHeight:d}},Ede={width:0,height:0,overflow:"visible"},Tde={width:0,overflowX:"visible"},Pde={height:0,overflowY:"visible"},zde={},Rde=e=>{var{width:t,height:n}=e,r=Al(t),i=Al(n);return r&&i?Ede:r?Tde:i?Pde:zde};function Mde(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=da.width,a=da.height):i===void 0?i=r&&r>0?void 0:da.width:a===void 0&&(a=r&&r>0?void 0:da.height),{width:i,height:a}}function A1(){return A1=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},A1.apply(null,arguments)}function Dz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Iz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dz(Object(n),!0).forEach(function(r){Dde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dde(e,t,n){return(t=Ide(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ide(e){var t=Lde(e,"string");return typeof t=="symbol"?t:t+""}function Lde(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 z4=S.createContext(da.initialDimension);function $de(e){return va(e.width)&&va(e.height)}function R4(e){var{children:t,width:n,height:r}=e,i=S.useMemo(()=>({width:n,height:r}),[n,r]);return $de(i)?S.createElement(z4.Provider,{value:i},t):null}var WN=()=>S.useContext(z4),Ude=S.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=da.initialDimension,width:i,height:a,minWidth:o=da.minWidth,minHeight:c,maxHeight:d,children:f,debounce:p=da.debounce,id:m,className:y,onResize:v,style:x={}}=e,w=S.useRef(null),j=S.useRef();j.current=v,S.useImperativeHandle(t,()=>w.current);var[k,O]=S.useState({containerWidth:r.width,containerHeight:r.height}),_=S.useCallback((z,I)=>{O(q=>{var U=Math.round(z),L=Math.round(I);return q.containerWidth===U&&q.containerHeight===L?q:{containerWidth:U,containerHeight:L}})},[]);S.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return Mu;var z=L=>{var J,ae=L[0];if(ae!=null){var{width:Q,height:K}=ae.contentRect;_(Q,K),(J=j.current)===null||J===void 0||J.call(j,Q,K)}};p>0&&(z=Ode(z,p,{trailing:!0,leading:!1}));var I=new ResizeObserver(z),{width:q,height:U}=w.current.getBoundingClientRect();return _(q,U),I.observe(w.current),()=>{I.disconnect()}},[_,p]);var{containerWidth:C,containerHeight:P}=k;Ig(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:T,calculatedHeight:A}=P4(C,P,{width:i,height:a,aspect:n,maxHeight:d});return Ig(T!=null&&T>0||A!=null&&A>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
257
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
258
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
259
|
-
height and width.`,T,A,i,a,o,c,n),S.createElement("div",{id:m?"".concat(m):void 0,className:Ct("recharts-responsive-container",y),style:Iz(Iz({},x),{},{width:i,height:a,minWidth:o,minHeight:c,maxHeight:d}),ref:w},S.createElement("div",{style:Rde({width:i,height:a})},S.createElement(R4,{width:T,height:A},f)))}),O1=S.forwardRef((e,t)=>{var n=WN();if(va(n.width)&&va(n.height))return e.children;var{width:r,height:i}=Mde({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=P4(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Ue(a)&&Ue(o)?S.createElement(R4,{width:a,height:o},e.children):S.createElement(Ude,A1({},e,{width:r,height:i,ref:t}))});function QN(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 ch=()=>{var e,t=yr(),n=Fe(Sde),r=Fe(mv),i=(e=Fe(pv))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},Bde={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},M4=()=>{var e;return(e=Fe(Jn))!==null&&e!==void 0?e:Bde},XN=()=>Fe(us),JN=()=>Fe(ds),Fde=()=>Fe(e=>e.layout.margin),tn=e=>e.layout.layoutType,Du=()=>Fe(tn),ek=()=>{var e=Du();if(e==="horizontal"||e==="vertical")return e},D4=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},qde=()=>{var e=Du();return e!==void 0},uh=e=>{var t=ln(),n=yr(),{width:r,height:i}=e,a=WN(),o=r,c=i;return a&&(o=a.width>0?a.width:r,c=a.height>0?a.height:i),S.useEffect(()=>{!n&&va(o)&&va(c)&&t(Zue({width:o,height:c}))},[t,n,o,c]),null},I4=Symbol.for("immer-nothing"),Lz=Symbol.for("immer-draftable"),Qr=Symbol.for("immer-state");function qi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Df=Object.getPrototypeOf;function gu(e){return!!e&&!!e[Qr]}function El(e){return e?L4(e)||Array.isArray(e)||!!e[Lz]||!!e.constructor?.[Lz]||dh(e)||yv(e):!1}var Kde=Object.prototype.constructor.toString(),$z=new WeakMap;function L4(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=$z.get(n);return r===void 0&&(r=Function.toString.call(n),$z.set(n,r)),r===Kde}function Lg(e,t,n=!0){gv(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function gv(e){const t=e[Qr];return t?t.type_:Array.isArray(e)?1:dh(e)?2:yv(e)?3:0}function E1(e,t){return gv(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function $4(e,t,n){const r=gv(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Hde(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function dh(e){return e instanceof Map}function yv(e){return e instanceof Set}function nl(e){return e.copy_||e.base_}function T1(e,t){if(dh(e))return new Map(e);if(yv(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=L4(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Qr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],c=r[o];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(r[o]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[o]})}return Object.create(Df(e),r)}else{const r=Df(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function tk(e,t=!1){return vv(e)||gu(e)||!El(e)||(gv(e)>1&&Object.defineProperties(e,{set:Nm,add:Nm,clear:Nm,delete:Nm}),Object.freeze(e),t&&Object.values(e).forEach(n=>tk(n,!0))),e}function Gde(){qi(2)}var Nm={value:Gde};function vv(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Vde={};function Tl(e){const t=Vde[e];return t||qi(0,e),t}var If;function U4(){return If}function Zde(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Uz(e,t){t&&(Tl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function P1(e){z1(e),e.drafts_.forEach(Yde),e.drafts_=null}function z1(e){e===If&&(If=e.parent_)}function Bz(e){return If=Zde(If,e)}function Yde(e){const t=e[Qr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Fz(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Qr].modified_&&(P1(t),qi(4)),El(e)&&(e=$g(t,e),t.parent_||Ug(t,e)),t.patches_&&Tl("Patches").generateReplacementPatches_(n[Qr].base_,e,t.patches_,t.inversePatches_)):e=$g(t,n,[]),P1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==I4?e:void 0}function $g(e,t,n){if(vv(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Qr];if(!i)return Lg(t,(a,o)=>qz(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Ug(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let o=a,c=!1;i.type_===3&&(o=new Set(a),a.clear(),c=!0),Lg(o,(d,f)=>qz(e,i,a,d,f,n,c),r),Ug(e,a,!1),n&&e.patches_&&Tl("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function qz(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const c=vv(i);if(!(c&&!o)){if(gu(i)){const d=a&&t&&t.type_!==3&&!E1(t.assigned_,r)?a.concat(r):void 0,f=$g(e,i,d);if($4(n,r,f),gu(f))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(El(i)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&c)return;$g(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(dh(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Ug(e,i)}}}function Ug(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&tk(t,n)}function Wde(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:U4(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=nk;n&&(i=[r],a=Lf);const{revoke:o,proxy:c}=Proxy.revocable(i,a);return r.draft_=c,r.revoke_=o,c}var nk={get(e,t){if(t===Qr)return e;const n=nl(e);if(!E1(n,t))return Qde(e,n,t);const r=n[t];return e.finalized_||!El(r)?r:r===Kw(e.base_,t)?(Hw(e),e.copy_[t]=M1(r,e)):r},has(e,t){return t in nl(e)},ownKeys(e){return Reflect.ownKeys(nl(e))},set(e,t,n){const r=B4(nl(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Kw(nl(e),t),a=i?.[Qr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Hde(n,i)&&(n!==void 0||E1(e.base_,t)))return!0;Hw(e),R1(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 Kw(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Hw(e),R1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=nl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){qi(11)},getPrototypeOf(e){return Df(e.base_)},setPrototypeOf(){qi(12)}},Lf={};Lg(nk,(e,t)=>{Lf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Lf.deleteProperty=function(e,t){return Lf.set.call(this,e,t,void 0)};Lf.set=function(e,t,n){return nk.set.call(this,e[0],t,n,e[0])};function Kw(e,t){const n=e[Qr];return(n?nl(n):e)[t]}function Qde(e,t,n){const r=B4(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function B4(e,t){if(!(t in e))return;let n=Df(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Df(n)}}function R1(e){e.modified_||(e.modified_=!0,e.parent_&&R1(e.parent_))}function Hw(e){e.copy_||(e.copy_=T1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Xde=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const o=this;return function(d=a,...f){return o.produce(d,p=>n.call(this,p,...f))}}typeof n!="function"&&qi(6),r!==void 0&&typeof r!="function"&&qi(7);let i;if(El(t)){const a=Bz(this),o=M1(t,void 0);let c=!0;try{i=n(o),c=!1}finally{c?P1(a):z1(a)}return Uz(a,r),Fz(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===I4&&(i=void 0),this.autoFreeze_&&tk(i,!0),r){const a=[],o=[];Tl("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else qi(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...c)=>this.produceWithPatches(o,d=>t(d,...c));let r,i;return[this.produce(t,n,(o,c)=>{r=o,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){El(e)||qi(8),gu(e)&&(e=Jde(e));const t=Bz(this),n=M1(e,void 0);return n[Qr].isManual_=!0,z1(t),n}finishDraft(e,t){const n=e&&e[Qr];(!n||!n.isManual_)&&qi(9);const{scope_:r}=n;return Uz(r,t),Fz(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=Tl("Patches").applyPatches_;return gu(e)?r(e,t):this.produce(e,i=>r(i,t))}};function M1(e,t){const n=dh(e)?Tl("MapSet").proxyMap_(e,t):yv(e)?Tl("MapSet").proxySet_(e,t):Wde(e,t);return(t?t.scope_:U4()).drafts_.push(n),n}function Jde(e){return gu(e)||qi(10,e),F4(e)}function F4(e){if(!El(e)||vv(e))return e;const t=e[Qr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=T1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=T1(e,!0);return Lg(n,(i,a)=>{$4(n,i,F4(a))},r),t&&(t.finalized_=!1),n}var efe=new Xde;efe.produce;var tfe={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},q4=or({name:"legend",initialState:tfe,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:Zt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=xi(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:Zt()},removeLegendPayload:{reducer(e,t){var n=xi(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:Zt()}}}),{setLegendSize:Kz,setLegendSettings:nfe,addLegendPayload:rfe,replaceLegendPayload:ife,removeLegendPayload:afe}=q4.actions,sfe=q4.reducer,Gw={exports:{}},Vw={};var Hz;function ofe(){if(Hz)return Vw;Hz=1;var e=Nu();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,c=e.useDebugValue;return Vw.useSyncExternalStoreWithSelector=function(d,f,p,m,y){var v=i(null);if(v.current===null){var x={hasValue:!1,value:null};v.current=x}else x=v.current;v=o(function(){function j(P){if(!k){if(k=!0,O=P,P=m(P),y!==void 0&&x.hasValue){var T=x.value;if(y(T,P))return _=T}return _=P}if(T=_,n(O,P))return T;var A=m(P);return y!==void 0&&y(T,A)?(O=P,T):(O=P,_=A)}var k=!1,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 w=r(d,v[0],v[1]);return a(function(){x.hasValue=!0,x.value=w},[w]),c(w),w},Vw}var Gz;function lfe(){return Gz||(Gz=1,Gw.exports=ofe()),Gw.exports}lfe();function cfe(e){e()}function ufe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){cfe(()=>{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 Vz={notify(){},get:()=>[]};function dfe(e,t){let n,r=Vz,i=0,a=!1;function o(w){p();const j=r.subscribe(w);let k=!1;return()=>{k||(k=!0,j(),m())}}function c(){r.notify()}function d(){x.onStateChange&&x.onStateChange()}function f(){return a}function p(){i++,n||(n=e.subscribe(d),r=ufe())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Vz)}function y(){a||(a=!0,p())}function v(){a&&(a=!1,m())}const x={addNestedSub:o,notifyNestedSubs:c,handleChangeWrapper:d,isSubscribed:f,trySubscribe:y,tryUnsubscribe:v,getListeners:()=>r};return x}var ffe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",hfe=ffe(),pfe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",mfe=pfe(),gfe=()=>hfe||mfe?S.useLayoutEffect:S.useEffect,yfe=gfe();function Zz(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function vfe(e,t){if(Zz(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])||!Zz(e[n[i]],t[n[i]]))return!1;return!0}var bfe=Symbol.for("react-redux-context"),xfe=typeof globalThis<"u"?globalThis:{};function wfe(){if(!S.createContext)return{};const e=xfe[bfe]??=new Map;let t=e.get(S.createContext);return t||(t=S.createContext(null),e.set(S.createContext,t)),t}var Sfe=wfe();function jfe(e){const{children:t,context:n,serverState:r,store:i}=e,a=S.useMemo(()=>{const d=dfe(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),o=S.useMemo(()=>i.getState(),[i]);yfe(()=>{const{subscription:d}=a;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),o!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[a,o]);const c=n||Sfe;return S.createElement(c.Provider,{value:a},t)}var Nfe=jfe,kfe=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Cfe(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function fh(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(kfe.has(r)){if(e[r]==null&&t[r]==null)continue;if(!vfe(e[r],t[r]))return!1}else if(!Cfe(e[r],t[r]))return!1;return!0}var _fe=["contextPayload"];function D1(){return D1=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},D1.apply(null,arguments)}function Yz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yz(Object(n),!0).forEach(function(r){Afe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Afe(e,t,n){return(t=Ofe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ofe(e){var t=Efe(e,"string");return typeof t=="symbol"?t:t+""}function Efe(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 Tfe(e,t){if(e==null)return{};var n,r,i=Pfe(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 Pfe(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 zfe(e){return e.value}function Rfe(e){var{contextPayload:t}=e,n=Tfe(e,_fe),r=H3(t,e.payloadUniqBy,zfe),i=yu(yu({},n),{},{payload:r});return S.isValidElement(e.content)?S.cloneElement(e.content,i):typeof e.content=="function"?S.createElement(e.content,i):S.createElement(sce,i)}function Mfe(e,t,n,r,i,a){var{layout:o,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"&&o==="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}),yu(yu({},f),p)}function Dfe(e){var t=ln();return S.useEffect(()=>{t(nfe(e))},[t,e]),null}function Ife(e){var t=ln();return S.useEffect(()=>(t(Kz(e)),()=>{t(Kz({width:0,height:0}))}),[t,e]),null}function Lfe(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var $fe={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Ufe(e){var t=gr(e,$fe),n=Wce(),r=Xoe(),i=Fde(),{width:a,height:o,wrapperStyle:c,portal:d}=t,[f,p]=W3([n]),m=XN(),y=JN();if(m==null||y==null)return null;var v=m-(i?.left||0)-(i?.right||0),x=Lfe(t.layout,o,a,v),w=d?c:yu(yu({position:"absolute",width:x?.width||a||"auto",height:x?.height||o||"auto"},Mfe(c,t,i,m,y,f)),c),j=d??r;if(j==null||n==null)return null;var k=S.createElement("div",{className:"recharts-legend-wrapper",style:w,ref:p},S.createElement(Dfe,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&S.createElement(Ife,{width:f.width,height:f.height}),S.createElement(Rfe,D1({},t,x,{margin:i,chartWidth:m,chartHeight:y,contextPayload:n})));return Dl.createPortal(k,j)}var I1=S.memo(Ufe,fh);I1.displayName="Legend";function L1(){return L1=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},L1.apply(null,arguments)}function Wz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wz(Object(n),!0).forEach(function(r){Bfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bfe(e,t,n){return(t=Ffe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ffe(e){var t=qfe(e,"string");return typeof t=="symbol"?t:t+""}function qfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kfe(e){return Array.isArray(e)&&Ni(e[0])&&Ni(e[1])?e.join(" ~ "):e}var Mc={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 Hfe(e,t){return t==null?e:nv(e,t)}var Gfe=e=>{var{separator:t=Mc.separator,contentStyle:n,itemStyle:r,labelStyle:i=Mc.labelStyle,payload:a,formatter:o,itemSorter:c,wrapperClassName:d,labelClassName:f,label:p,labelFormatter:m,accessibilityLayer:y=Mc.accessibilityLayer}=e,v=()=>{if(a&&a.length){var P={padding:0,margin:0},T=Hfe(a,c),A=T.map((z,I)=>{if(!z||z.type==="none")return null;var q=z.formatter||o||Kfe,{value:U,name:L}=z,J=U,ae=L;if(q){var Q=q(U,L,z,I,a);if(Array.isArray(Q))[J,ae]=Q;else if(Q!=null)J=Q;else return null}var K=Gd(Gd({},Mc.itemStyle),{},{color:z.color||Mc.itemStyle.color},r);return S.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(I),style:K},Ni(ae)?S.createElement("span",{className:"recharts-tooltip-item-name"},ae):null,Ni(ae)?S.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,S.createElement("span",{className:"recharts-tooltip-item-value"},J),S.createElement("span",{className:"recharts-tooltip-item-unit"},z.unit||""))});return S.createElement("ul",{className:"recharts-tooltip-item-list",style:P},A)}return null},x=Gd(Gd({},Mc.contentStyle),n),w=Gd({margin:0},i),j=!Xn(p),k=j?p:"",O=Ct("recharts-default-tooltip",d),_=Ct("recharts-tooltip-label",f);j&&m&&a!==void 0&&a!==null&&(k=m(p,a));var C=y?{role:"status","aria-live":"assertive"}:{};return S.createElement("div",L1({className:O,style:x},C),S.createElement("p",{className:_,style:w},S.isValidElement(k)?k:"".concat(k)),v())},Vd="recharts-tooltip-wrapper",Vfe={visibility:"hidden"};function Zfe(e){var{coordinate:t,translateX:n,translateY:r}=e;return Ct(Vd,{["".concat(Vd,"-right")]:Ue(n)&&t&&Ue(t.x)&&n>=t.x,["".concat(Vd,"-left")]:Ue(n)&&t&&Ue(t.x)&&n<t.x,["".concat(Vd,"-bottom")]:Ue(r)&&t&&Ue(t.y)&&r>=t.y,["".concat(Vd,"-top")]:Ue(r)&&t&&Ue(t.y)&&r<t.y})}function Qz(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:c,viewBox:d,viewBoxDimension:f}=e;if(a&&Ue(a[r]))return a[r];var p=n[r]-c-(i>0?i:0),m=n[r]+i;if(t[r])return o[r]?p:m;var y=d[r];if(y==null)return 0;if(o[r]){var v=p,x=y;return v<x?Math.max(m,y):Math.max(p,y)}if(f==null)return 0;var w=m+c,j=y+f;return w>j?Math.max(p,y):Math.max(m,y)}function Yfe(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 Wfe(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:c,useTranslate3d:d,viewBox:f}=e,p,m,y;return c.height>0&&c.width>0&&n?(m=Qz({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:c.width,viewBox:f,viewBoxDimension:f.width}),y=Qz({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:c.height,viewBox:f,viewBoxDimension:f.height}),p=Yfe({translateX:m,translateY:y,useTranslate3d:d})):p=Vfe,{cssProperties:p,cssClasses:Zfe({translateX:m,translateY:y,coordinate:n})}}var Qfe=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),hh={isSsr:Qfe()};function K4(){var[e,t]=S.useState(()=>hh.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return S.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 Xz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xz(Object(n),!0).forEach(function(r){Xfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xfe(e,t,n){return(t=Jfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jfe(e){var t=ehe(e,"string");return typeof t=="symbol"?t:t+""}function ehe(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 the(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function nhe(e){var t,n,r,i,a,o,c=K4(),[d,f]=S.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));S.useEffect(()=>{var x=w=>{if(w.key==="Escape"){var j,k,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:(O=(_=e.coordinate)===null||_===void 0?void 0:_.y)!==null&&O!==void 0?O:0}})}};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),d.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==d.dismissedAtCoordinate.x||((a=(o=e.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==d.dismissedAtCoordinate.y)&&f(Dc(Dc({},d),{},{dismissed:!1}));var{cssClasses:p,cssProperties:m}=Wfe({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?{}:Dc(Dc({transition:the({prefersReducedMotion:c,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},m),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=Dc(Dc({},y),{},{visibility:!d.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return S.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:v,ref:e.innerRef},e.children)}var rhe=S.memo(nhe),H4=()=>{var e;return(e=Fe(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function $1(){return $1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$1.apply(null,arguments)}function Jz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function eR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Jz(Object(n),!0).forEach(function(r){ihe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ihe(e,t,n){return(t=ahe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ahe(e){var t=she(e,"string");return typeof t=="symbol"?t:t+""}function she(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 tR={curveBasisClosed:yle,curveBasisOpen:vle,curveBasis:gle,curveBumpX:nle,curveBumpY:rle,curveLinearClosed:ble,curveLinear:Jy,curveMonotoneX:xle,curveMonotoneY:wle,curveNatural:Sle,curveStep:jle,curveStepAfter:kle,curveStepBefore:Nle},Bg=e=>nt(e.x)&&nt(e.y),nR=e=>e.base!=null&&Bg(e.base)&&Bg(e),Zd=e=>e.x,Yd=e=>e.y,ohe=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(ah(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=tR["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return tR[n]||Jy},rR={connectNulls:!1,type:"linear"},lhe=e=>{var{type:t=rR.type,points:n=[],baseLine:r,layout:i,connectNulls:a=rR.connectNulls}=e,o=ohe(t,i),c=a?n.filter(Bg):n;if(Array.isArray(r)){var d,f=n.map((x,w)=>eR(eR({},x),{},{base:r[w]}));i==="vertical"?d=ym().y(Yd).x1(Zd).x0(x=>x.base.x):d=ym().x(Zd).y1(Yd).y0(x=>x.base.y);var p=d.defined(nR).curve(o),m=a?f.filter(nR):f;return p(m)}var y;i==="vertical"&&Ue(r)?y=ym().y(Yd).x1(Zd).x0(r):Ue(r)?y=ym().x(Zd).y1(Yd).y0(r):y=y3().x(Zd).y(Yd);var v=y.defined(Bg).curve(o);return v(c)},Zm=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Du();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},c=n&&n.length?lhe(o):r;return S.createElement("path",$1({},Gi(e),BN(e),{className:Ct("recharts-curve",t),d:c===null?void 0:c,ref:i}))},che=["x","y","top","left","width","height","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 iR(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 uhe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iR(Object(n),!0).forEach(function(r){dhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dhe(e,t,n){return(t=fhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fhe(e){var t=hhe(e,"string");return typeof t=="symbol"?t:t+""}function hhe(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 phe(e,t){if(e==null)return{};var n,r,i=mhe(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 mhe(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 ghe=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),yhe=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:c}=e,d=phe(e,che),f=uhe({x:t,y:n,top:r,left:i,width:a,height:o},d);return!Ue(t)||!Ue(n)||!Ue(a)||!Ue(o)||!Ue(r)||!Ue(i)?null:S.createElement("path",U1({},zr(f),{className:Ct("recharts-cross",c),d:ghe(t,n,a,o,r,i)}))};function vhe(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 aR(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 sR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aR(Object(n),!0).forEach(function(r){bhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bhe(e,t,n){return(t=xhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xhe(e){var t=whe(e,"string");return typeof t=="symbol"?t:t+""}function whe(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 She=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),jhe=(e,t,n)=>e.map(r=>"".concat(She(r)," ").concat(t,"ms ").concat(n)).join(","),Nhe=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),$f=(e,t)=>Object.keys(t).reduce((n,r)=>sR(sR({},n),{},{[r]:e(r,t[r])}),{});function oR(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 zn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oR(Object(n),!0).forEach(function(r){khe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function khe(e,t,n){return(t=Che(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Che(e){var t=_he(e,"string");return typeof t=="symbol"?t:t+""}function _he(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fg=(e,t,n)=>e+(t-e)*n,B1=e=>{var{from:t,to:n}=e;return t!==n},G4=(e,t,n)=>{var r=$f((i,a)=>{if(B1(a)){var[o,c]=e(a.from,a.to,a.velocity);return zn(zn({},a),{},{from:o,velocity:c})}return a},t);return n<1?$f((i,a)=>B1(a)&&r[i]!=null?zn(zn({},a),{},{velocity:Fg(a.velocity,r[i].velocity,n),from:Fg(a.from,r[i].from,n)}):a,t):G4(e,r,n-1)};function Ahe(e,t,n,r,i,a){var o,c=r.reduce((y,v)=>zn(zn({},y),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),d=()=>$f((y,v)=>v.from,c),f=()=>!Object.values(c).filter(B1).length,p=null,m=y=>{o||(o=y);var v=y-o,x=v/n.dt;c=G4(n,c,x),i(zn(zn(zn({},e),t),d())),o=y,f()||(p=a.setTimeout(m))};return()=>(p=a.setTimeout(m),()=>{var y;(y=p)===null||y===void 0||y()})}function Ohe(e,t,n,r,i,a,o){var c=null,d=i.reduce((m,y)=>{var v=e[y],x=t[y];return v==null||x==null?m:zn(zn({},m),{},{[y]:[v,x]})},{}),f,p=m=>{f||(f=m);var y=(m-f)/r,v=$f((w,j)=>Fg(...j,n(y)),d);if(a(zn(zn(zn({},e),t),v)),y<1)c=o.setTimeout(p);else{var x=$f((w,j)=>Fg(...j,n(1)),d);a(zn(zn(zn({},e),t),x))}};return()=>(c=o.setTimeout(p),()=>{var m;(m=c)===null||m===void 0||m()})}const Ehe=(e,t,n,r,i,a)=>{var o=Nhe(e,t);return n==null?()=>(i(zn(zn({},e),t)),()=>{}):n.isStepper===!0?Ahe(e,t,n,o,i,a):Ohe(e,t,n,r,o,i,a)};var qg=1e-4,V4=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],Z4=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),lR=(e,t)=>n=>{var r=V4(e,t);return Z4(r,n)},The=(e,t)=>n=>{var r=V4(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return Z4(i,n)},Phe=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]]},zhe=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=Phe(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},Rhe=(e,t,n,r)=>{var i=lR(e,n),a=lR(t,r),o=The(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,x=o(m);if(Math.abs(v-p)<qg||x<qg)return a(m);m=c(m-v/x)}return a(m)};return d.isStepper=!1,d},cR=function(){return Rhe(...zhe(...arguments))},Mhe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(o,c,d)=>{var f=-(o-c)*n,p=d*r,m=d+(f-p)*i/1e3,y=d*i/1e3+o;return Math.abs(y-c)<qg&&Math.abs(m)<qg?[c,0]:[y,m]};return a.isStepper=!0,a.dt=i,a},Dhe=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return cR(e);case"spring":return Mhe();default:if(e.split("(")[0]==="cubic-bezier")return cR(e)}return typeof e=="function"?e:null};function Ihe(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var c=o,[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 o=="string"&&(t=o,n(t)),typeof o=="object"&&(t=o,n(t)),typeof o=="function"&&o()}};return{stop:()=>{r=!0},start:o=>{r=!1,i&&(i(),i=null),a(o)},subscribe:o=>(n=o,()=>{n=()=>null}),getTimeoutController:()=>e}}class Lhe{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=o=>{o-r>=n?t(o):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function $he(){return Ihe(new Lhe)}var Uhe=S.createContext($he);function Bhe(e,t){var n=S.useContext(Uhe);return S.useMemo(()=>t??n(e),[e,t,n])}var Fhe={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},uR={t:0},Zw={t:1};function Y4(e){var t=gr(e,Fhe),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:c,onAnimationStart:d,children:f}=t,p=K4(),m=n==="auto"?!hh.isSsr&&!p:n,y=Bhe(t.animationId,t.animationManager),[v,x]=S.useState(m?uR:Zw),w=S.useRef(null);return S.useEffect(()=>{m||x(Zw)},[m]),S.useEffect(()=>{if(!m||!r)return Mu;var j=Ehe(uR,Zw,Dhe(a),i,x,y.getTimeoutController()),k=()=>{w.current=j()};return y.start([d,o,k,i,c]),()=>{y.stop(),w.current&&w.current(),c()}},[m,r,i,a,o,d,c,y]),f(v.t)}function W4(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=S.useRef(Pf(t)),r=S.useRef(e);return r.current!==e&&(n.current=Pf(t),r.current=e),n.current}var qhe=["radius"],Khe=["radius"],dR,fR,hR,pR,mR,gR,yR,vR,bR,xR;function wR(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 SR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wR(Object(n),!0).forEach(function(r){Hhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hhe(e,t,n){return(t=Ghe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ghe(e){var t=Vhe(e,"string");return typeof t=="symbol"?t:t+""}function Vhe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kg(){return Kg=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},Kg.apply(null,arguments)}function jR(e,t){if(e==null)return{};var n,r,i=Zhe(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 Zhe(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 ra(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var NR=(e,t,n,r,i)=>{var a=to(n),o=to(r),c=Math.min(Math.abs(a)/2,Math.abs(o)/2),d=o>=0?1:-1,f=a>=0?1:-1,p=o>=0&&a>=0||o<0&&a<0?1:0,m;if(c>0&&Array.isArray(i)){for(var y=[0,0,0,0],v=0,x=4;v<x;v++){var w,j=(w=i[v])!==null&&w!==void 0?w:0;y[v]=j>c?c:j}m=Zn(dR||(dR=ra(["M",",",""])),e,t+d*y[0]),y[0]>0&&(m+=Zn(fR||(fR=ra(["A ",",",",0,0,",",",",",""])),y[0],y[0],p,e+f*y[0],t)),m+=Zn(hR||(hR=ra(["L ",",",""])),e+n-f*y[1],t),y[1]>0&&(m+=Zn(pR||(pR=ra(["A ",",",",0,0,",`,
|
|
260
|
-
`,",",""])),y[1],y[1],p,e+n,t+d*y[1])),m+=Zn(mR||(mR=ra(["L ",",",""])),e+n,t+r-d*y[2]),y[2]>0&&(m+=Zn(gR||(gR=ra(["A ",",",",0,0,",`,
|
|
261
|
-
`,",",""])),y[2],y[2],p,e+n-f*y[2],t+r)),m+=Zn(yR||(yR=ra(["L ",",",""])),e+f*y[3],t+r),y[3]>0&&(m+=Zn(vR||(vR=ra(["A ",",",",0,0,",`,
|
|
262
|
-
`,",",""])),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=Zn(bR||(bR=ra(["M ",",",`
|
|
263
|
-
A `,",",",0,0,",",",",",`
|
|
264
|
-
L `,",",`
|
|
265
|
-
A `,",",",0,0,",",",",",`
|
|
266
|
-
L `,",",`
|
|
267
|
-
A `,",",",0,0,",",",",",`
|
|
268
|
-
L `,",",`
|
|
269
|
-
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=Zn(xR||(xR=ra(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},kR={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Yhe=e=>{var t=gr(e,kR),n=S.useRef(null),[r,i]=S.useState(-1);S.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var X=n.current.getTotalLength();X&&i(X)}catch{}},[]);var{x:a,y:o,width:c,height:d,radius:f,className:p}=t,{animationEasing:m,animationDuration:y,animationBegin:v,isAnimationActive:x,isUpdateAnimationActive:w}=t,j=S.useRef(c),k=S.useRef(d),O=S.useRef(a),_=S.useRef(o),C=S.useMemo(()=>({x:a,y:o,width:c,height:d,radius:f}),[a,o,c,d,f]),P=W4(C,"rectangle-");if(a!==+a||o!==+o||c!==+c||d!==+d||c===0||d===0)return null;var T=Ct("recharts-rectangle",p);if(!w){var A=zr(t),{radius:z}=A,I=jR(A,qhe);return S.createElement("path",Kg({},I,{x:to(a),y:to(o),width:to(c),height:to(d),radius:typeof f=="number"?f:void 0,className:T,d:NR(a,o,c,d,f)}))}var q=j.current,U=k.current,L=O.current,J=_.current,ae="0px ".concat(r===-1?1:r,"px"),Q="".concat(r,"px ").concat(r,"px"),K=jhe(["strokeDasharray"],y,typeof m=="string"?m:kR.animationEasing);return S.createElement(Y4,{animationId:P,key:P,canBegin:r>0,duration:y,easing:m,isActive:w,begin:v},X=>{var ye=la(q,c,X),Se=la(U,d,X),R=la(L,a,X),F=la(J,o,X);n.current&&(j.current=ye,k.current=Se,O.current=R,_.current=F);var B;x?X>0?B={transition:K,strokeDasharray:Q}:B={strokeDasharray:ae}:B={strokeDasharray:Q};var M=zr(t),{radius:V}=M,se=jR(M,Khe);return S.createElement("path",Kg({},se,{radius:typeof f=="number"?f:void 0,className:T,d:NR(R,F,ye,Se,f),ref:n,style:SR(SR({},B),t.style)}))})};function CR(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 _R(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CR(Object(n),!0).forEach(function(r){Whe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Whe(e,t,n){return(t=Qhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qhe(e){var t=Xhe(e,"string");return typeof t=="symbol"?t:t+""}function Xhe(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 Hg=Math.PI/180,Jhe=e=>e*180/Math.PI,Qn=(e,t,n,r)=>({x:e+Math.cos(-Hg*r)*n,y:t+Math.sin(-Hg*r)*n}),epe=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},tpe=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},npe=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=tpe({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var c=(n-i)/o,d=Math.acos(c);return r>a&&(d=2*Math.PI-d),{radius:o,angle:Jhe(d),angleInRadian:d}},rpe=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}},ipe=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return e+o*360},ape=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=npe({x:n,y:r},t),{innerRadius:o,outerRadius:c}=t;if(i<o||i>c||i===0)return null;var{startAngle:d,endAngle:f}=rpe(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?_R(_R({},t),{},{radius:i,angle:ipe(p,t)}):null};function Q4(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=Qn(t,n,r,i),c=Qn(t,n,r,a);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var AR,OR,ER,TR,PR,zR,RR;function F1(){return F1=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},F1.apply(null,arguments)}function ul(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var spe=(e,t)=>{var n=bi(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},km=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:c,cornerIsExternal:d}=e,f=c*(o?1:-1)+r,p=Math.asin(c/f)/Hg,m=d?i:i+a*p,y=Qn(t,n,f,m),v=Qn(t,n,r,m),x=d?i-a*p:i,w=Qn(t,n,f*Math.cos(p*Hg),x);return{center:y,circleTangency:v,lineTangency:w,theta:p}},X4=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,c=spe(a,o),d=a+c,f=Qn(t,n,i,a),p=Qn(t,n,i,d),m=Zn(AR||(AR=ul(["M ",",",`
|
|
270
|
-
A `,",",`,0,
|
|
271
|
-
`,",",`,
|
|
272
|
-
`,",",`
|
|
273
|
-
`])),f.x,f.y,i,i,+(Math.abs(c)>180),+(a>d),p.x,p.y);if(r>0){var y=Qn(t,n,r,a),v=Qn(t,n,r,d);m+=Zn(OR||(OR=ul(["L ",",",`
|
|
274
|
-
A `,",",`,0,
|
|
275
|
-
`,",",`,
|
|
276
|
-
`,","," Z"])),v.x,v.y,r,r,+(Math.abs(c)>180),+(a<=d),y.x,y.y)}else m+=Zn(ER||(ER=ul(["L ",","," Z"])),t,n);return m},ope=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:c,startAngle:d,endAngle:f}=e,p=bi(f-d),{circleTangency:m,lineTangency:y,theta:v}=km({cx:t,cy:n,radius:i,angle:d,sign:p,cornerRadius:a,cornerIsExternal:c}),{circleTangency:x,lineTangency:w,theta:j}=km({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 o?Zn(TR||(TR=ul(["M ",",",`
|
|
277
|
-
a`,",",",0,0,1,",`,0
|
|
278
|
-
a`,",",",0,0,1,",`,0
|
|
279
|
-
`])),y.x,y.y,a,a,a*2,a,a,-a*2):X4({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:f});var O=Zn(PR||(PR=ul(["M ",",",`
|
|
280
|
-
A`,",",",0,0,",",",",",`
|
|
281
|
-
A`,",",",0,",",",",",",",`
|
|
282
|
-
A`,",",",0,0,",",",",",`
|
|
283
|
-
`])),y.x,y.y,a,a,+(p<0),m.x,m.y,i,i,+(k>180),+(p<0),x.x,x.y,a,a,+(p<0),w.x,w.y);if(r>0){var{circleTangency:_,lineTangency:C,theta:P}=km({cx:t,cy:n,radius:r,angle:d,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),{circleTangency:T,lineTangency:A,theta:z}=km({cx:t,cy:n,radius:r,angle:f,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),I=c?Math.abs(d-f):Math.abs(d-f)-P-z;if(I<0&&a===0)return"".concat(O,"L").concat(t,",").concat(n,"Z");O+=Zn(zR||(zR=ul(["L",",",`
|
|
284
|
-
A`,",",",0,0,",",",",",`
|
|
285
|
-
A`,",",",0,",",",",",",",`
|
|
286
|
-
A`,",",",0,0,",",",",","Z"])),A.x,A.y,a,a,+(p<0),T.x,T.y,r,r,+(I>180),+(p>0),_.x,_.y,a,a,+(p<0),C.x,C.y)}else O+=Zn(RR||(RR=ul(["L",",","Z"])),t,n);return O},lpe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},cpe=e=>{var t=gr(e,lpe),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:c,cornerIsExternal:d,startAngle:f,endAngle:p,className:m}=t;if(a<i||f===p)return null;var y=Ct("recharts-sector",m),v=a-i,x=po(o,v,0,!0),w;return x>0&&Math.abs(f-p)<360?w=ope({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(x,v/2),forceCornerRadius:c,cornerIsExternal:d,startAngle:f,endAngle:p}):w=X4({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:p}),S.createElement("path",F1({},zr(t),{className:y,d:w}))};function upe(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(z3(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:c}=t,d=Qn(r,i,a,c),f=Qn(r,i,o,c);return[{x:d.x,y:d.y},{x:f.x,y:f.y}]}return Q4(t)}}var Yw={},Ww={},Qw={},MR;function dpe(){return MR||(MR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=V3();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(Qw)),Qw}var DR;function fpe(){return DR||(DR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=dpe();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})(Ww)),Ww}var IR;function hpe(){return IR||(IR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Z3(),n=fpe();function r(i,a,o){o&&typeof o!="number"&&t.isIterateeCall(i,a,o)&&(a=o=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),o=o===void 0?i<a?1:-1:n.toFinite(o);const c=Math.max(Math.ceil((a-i)/(o||1)),0),d=new Array(c);for(let f=0;f<c;f++)d[f]=i,i+=o;return d}e.range=r})(Yw)),Yw}var Xw,LR;function ppe(){return LR||(LR=1,Xw=hpe().range),Xw}var mpe=ppe();const J4=wa(mpe);var Xi=e=>e.chartData,rk=le([Xi],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),bv=(e,t,n,r)=>r?rk(e):Xi(e),gpe=(e,t,n)=>n?rk(e):Xi(e),ype=le([bv],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});le([rk],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var vpe=le([Xi],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function ha(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(nt(t)&&nt(n))return!0}return!1}function $R(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function eU(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(nt(n))i=n;else if(typeof n=="function")return;if(nt(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(ha(o))return o}}function bpe(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(ha(r))return $R(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,c;if(i==="auto")t!=null&&(o=Math.min(...t));else if(Ue(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t?.[0]))}catch{}else if(typeof i=="string"&&Az.test(i)){var d=Az.exec(i);if(d==null||d[1]==null||t==null)o=void 0;else{var f=+d[1];o=t[0]-f}}else o=t?.[0];if(a==="auto")t!=null&&(c=Math.max(...t));else if(Ue(a))c=a;else if(typeof a=="function")try{t!=null&&(c=a(t?.[1]))}catch{}else if(typeof a=="string"&&Oz.test(a)){var p=Oz.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=[o,c];if(ha(y))return t==null?y:$R(y,t,n)}}}var Iu=1e9,xpe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},ak,Jt=!0,ki="[DecimalError] ",bl=ki+"Invalid argument: ",ik=ki+"Exponent out of range: ",Lu=Math.floor,rl=Math.pow,wpe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Gr,Ln=1e7,Yt=7,tU=9007199254740991,Gg=Lu(tU/Yt),De={};De.absoluteValue=De.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};De.comparedTo=De.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};De.decimalPlaces=De.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Yt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};De.dividedBy=De.div=function(e){return ns(this,new this.constructor(e))};De.dividedToIntegerBy=De.idiv=function(e){var t=this,n=t.constructor;return It(ns(t,new n(e),0,1),n.precision)};De.equals=De.eq=function(e){return!this.cmp(e)};De.exponent=function(){return An(this)};De.greaterThan=De.gt=function(e){return this.cmp(e)>0};De.greaterThanOrEqualTo=De.gte=function(e){return this.cmp(e)>=0};De.isInteger=De.isint=function(){return this.e>this.d.length-2};De.isNegative=De.isneg=function(){return this.s<0};De.isPositive=De.ispos=function(){return this.s>0};De.isZero=function(){return this.s===0};De.lessThan=De.lt=function(e){return this.cmp(e)<0};De.lessThanOrEqualTo=De.lte=function(e){return this.cmp(e)<1};De.logarithm=De.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Gr))throw Error(ki+"NaN");if(n.s<1)throw Error(ki+(n.s?"NaN":"-Infinity"));return n.eq(Gr)?new r(0):(Jt=!1,t=ns(Uf(n,a),Uf(e,a),a),Jt=!0,It(t,i))};De.minus=De.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?iU(t,e):nU(t,(e.s=-e.s,e))};De.modulo=De.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(ki+"NaN");return n.s?(Jt=!1,t=ns(n,e,0,1).times(e),Jt=!0,n.minus(t)):It(new r(n),i)};De.naturalExponential=De.exp=function(){return rU(this)};De.naturalLogarithm=De.ln=function(){return Uf(this)};De.negated=De.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};De.plus=De.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?nU(t,e):iU(t,(e.s=-e.s,e))};De.precision=De.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(bl+e);if(t=An(i)+1,r=i.d.length-1,n=r*Yt+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};De.squareRoot=De.sqrt=function(){var e,t,n,r,i,a,o,c=this,d=c.constructor;if(c.s<1){if(!c.s)return new d(0);throw Error(ki+"NaN")}for(e=An(c),Jt=!1,i=Math.sqrt(+c),i==0||i==1/0?(t=fa(c.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Lu((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(i.toString()),n=d.precision,i=o=n+3;;)if(a=r,r=a.plus(ns(c,a,o+2)).times(.5),fa(a.d).slice(0,o)===(t=fa(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(It(a,n+1,0),a.times(a).eq(c)){r=a;break}}else if(t!="9999")break;o+=4}return Jt=!0,It(r,n)};De.times=De.mul=function(e){var t,n,r,i,a,o,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,o=d,d=f,f=o),a=[],o=d+f,r=o;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=d+r;i>r;)c=a[i]+v[r]*y[i-r-1]+t,a[i--]=c%Ln|0,t=c/Ln|0;a[i]=(a[i]+t)%Ln|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Jt?It(e,m.precision):e};De.toDecimalPlaces=De.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ba(e,0,Iu),t===void 0?t=r.rounding:ba(t,0,8),It(n,e+An(n)+1,t))};De.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Pl(r,!0):(ba(e,0,Iu),t===void 0?t=i.rounding:ba(t,0,8),r=It(new i(r),e+1,t),n=Pl(r,!0,e+1)),n};De.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?Pl(i):(ba(e,0,Iu),t===void 0?t=a.rounding:ba(t,0,8),r=It(new a(i),e+An(i)+1,t),n=Pl(r.abs(),!1,e+An(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};De.toInteger=De.toint=function(){var e=this,t=e.constructor;return It(new t(e),An(e)+1,t.rounding)};De.toNumber=function(){return+this};De.toPower=De.pow=function(e){var t,n,r,i,a,o,c=this,d=c.constructor,f=12,p=+(e=new d(e));if(!e.s)return new d(Gr);if(c=new d(c),!c.s){if(e.s<1)throw Error(ki+"Infinity");return c}if(c.eq(Gr))return c;if(r=d.precision,e.eq(Gr))return It(c,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=c.s,o){if((n=p<0?-p:p)<=tU){for(i=new d(Gr),t=Math.ceil(r/Yt+4),Jt=!1;n%2&&(i=i.times(c),BR(i.d,t)),n=Lu(n/2),n!==0;)c=c.times(c),BR(c.d,t);return Jt=!0,e.s<0?new d(Gr).div(i):It(i,r)}}else if(a<0)throw Error(ki+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,Jt=!1,i=e.times(Uf(c,r+f)),Jt=!0,i=rU(i),i.s=a,i};De.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=An(i),r=Pl(i,n<=a.toExpNeg||n>=a.toExpPos)):(ba(e,1,Iu),t===void 0?t=a.rounding:ba(t,0,8),i=It(new a(i),e,t),n=An(i),r=Pl(i,e<=n||n<=a.toExpNeg,e)),r};De.toSignificantDigits=De.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ba(e,1,Iu),t===void 0?t=r.rounding:ba(t,0,8)),It(new r(n),e,t)};De.toString=De.valueOf=De.val=De.toJSON=De[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=An(e),n=e.constructor;return Pl(e,t<=n.toExpNeg||t>=n.toExpPos)};function nU(e,t){var n,r,i,a,o,c,d,f,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),Jt?It(t,m):t;if(d=e.d,f=t.d,o=e.e,i=t.e,d=d.slice(),a=o-i,a){for(a<0?(r=d,a=-a,c=f.length):(r=f,i=o,c=d.length),o=Math.ceil(m/Yt),c=o>c?o+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)/Ln|0,d[a]%=Ln;for(n&&(d.unshift(n),++i),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=i,Jt?It(t,m):t}function ba(e,t,n){if(e!==~~e||e<t||e>n)throw Error(bl+e)}function fa(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=Yt-r.length,n&&(a+=Zs(n)),a+=r;o=e[t],r=o+"",n=Yt-r.length,n&&(a+=Zs(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var ns=(function(){function e(r,i){var a,o=0,c=r.length;for(r=r.slice();c--;)a=r[c]*i+o,r[c]=a%Ln|0,o=a/Ln|0;return o&&r.unshift(o),r}function t(r,i,a,o){var c,d;if(a!=o)d=a>o?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 o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*Ln+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var c,d,f,p,m,y,v,x,w,j,k,O,_,C,P,T,A,z,I=r.constructor,q=r.s==i.s?1:-1,U=r.d,L=i.d;if(!r.s)return new I(r);if(!i.s)throw Error(ki+"Division by zero");for(d=r.e-i.e,A=L.length,P=U.length,v=new I(q),x=v.d=[],f=0;L[f]==(U[f]||0);)++f;if(L[f]>(U[f]||0)&&--d,a==null?O=a=I.precision:o?O=a+(An(r)-An(i))+1:O=a,O<0)return new I(0);if(O=O/Yt+2|0,f=0,A==1)for(p=0,L=L[0],O++;(f<P||p)&&O--;f++)_=p*Ln+(U[f]||0),x[f]=_/L|0,p=_%L|0;else{for(p=Ln/(L[0]+1)|0,p>1&&(L=e(L,p),U=e(U,p),A=L.length,P=U.length),C=A,w=U.slice(0,A),j=w.length;j<A;)w[j++]=0;z=L.slice(),z.unshift(0),T=L[0],L[1]>=Ln/2&&++T;do p=0,c=t(L,w,A,j),c<0?(k=w[0],A!=j&&(k=k*Ln+(w[1]||0)),p=k/T|0,p>1?(p>=Ln&&(p=Ln-1),m=e(L,p),y=m.length,j=w.length,c=t(m,w,y,j),c==1&&(p--,n(m,A<y?z:L,y))):(p==0&&(c=p=1),m=L.slice()),y=m.length,y<j&&m.unshift(0),n(w,m,j),c==-1&&(j=w.length,c=t(L,w,A,j),c<1&&(p++,n(w,A<j?z:L,j))),j=w.length):c===0&&(p++,w=[0]),x[f++]=p,c&&w[0]?w[j++]=U[C]||0:(w=[U[C]],j=1);while((C++<P||w[0]!==void 0)&&O--)}return x[0]||x.shift(),v.e=d,It(v,o?a+An(v)+1:a)}})();function rU(e,t){var n,r,i,a,o,c,d=0,f=0,p=e.constructor,m=p.precision;if(An(e)>16)throw Error(ik+An(e));if(!e.s)return new p(Gr);for(Jt=!1,c=m,o=new p(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(rl(2,f))/Math.LN10*2+5|0,c+=r,n=i=a=new p(Gr),p.precision=c;;){if(i=It(i.times(e),c),n=n.times(++d),o=a.plus(ns(i,n,c)),fa(o.d).slice(0,c)===fa(a.d).slice(0,c)){for(;f--;)a=It(a.times(a),c);return p.precision=m,t==null?(Jt=!0,It(a,m)):a}a=o}}function An(e){for(var t=e.e*Yt,n=e.d[0];n>=10;n/=10)t++;return t}function Jw(e,t,n){if(t>e.LN10.sd())throw Jt=!0,n&&(e.precision=n),Error(ki+"LN10 precision limit exceeded");return It(new e(e.LN10),t)}function Zs(e){for(var t="";e--;)t+="0";return t}function Uf(e,t){var n,r,i,a,o,c,d,f,p,m=1,y=10,v=e,x=v.d,w=v.constructor,j=w.precision;if(v.s<1)throw Error(ki+(v.s?"NaN":"-Infinity"));if(v.eq(Gr))return new w(0);if(t==null?(Jt=!1,f=j):f=t,v.eq(10))return t==null&&(Jt=!0),Jw(w,f);if(f+=y,w.precision=f,n=fa(x),r=n.charAt(0),a=An(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=fa(v.d),r=n.charAt(0),m++;a=An(v),r>1?(v=new w("0."+n),a++):v=new w(r+"."+n.slice(1))}else return d=Jw(w,f+2,j).times(a+""),v=Uf(new w(r+"."+n.slice(1)),f-y).plus(d),w.precision=j,t==null?(Jt=!0,It(v,j)):v;for(c=o=v=ns(v.minus(Gr),v.plus(Gr),f),p=It(v.times(v),f),i=3;;){if(o=It(o.times(p),f),d=c.plus(ns(o,new w(i),f)),fa(d.d).slice(0,f)===fa(c.d).slice(0,f))return c=c.times(2),a!==0&&(c=c.plus(Jw(w,f+2,j).times(a+""))),c=ns(c,new w(m),f),w.precision=j,t==null?(Jt=!0,It(c,j)):c;c=d,i+=2}}function UR(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=Lu(n/Yt),e.d=[],r=(n+1)%Yt,n<0&&(r+=Yt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Yt;r<i;)e.d.push(+t.slice(r,r+=Yt));t=t.slice(r),r=Yt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Jt&&(e.e>Gg||e.e<-Gg))throw Error(ik+n)}else e.s=0,e.e=0,e.d=[0];return e}function It(e,t,n){var r,i,a,o,c,d,f,p,m=e.d;for(o=1,a=m[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=Yt,i=t,f=m[p=0];else{if(p=Math.ceil((r+1)/Yt),a=m.length,p>=a)return e;for(f=a=m[p],o=1;a>=10;a/=10)o++;r%=Yt,i=r-Yt+o}if(n!==void 0&&(a=rl(10,o-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/rl(10,o-i):0:m[p-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return d?(a=An(e),m.length=1,t=t-a-1,m[0]=rl(10,(Yt-t%Yt)%Yt),e.e=Lu(-t/Yt)||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=rl(10,Yt-r),m[p]=i>0?(f/rl(10,o-i)%rl(10,i)|0)*a:0),d)for(;;)if(p==0){(m[0]+=a)==Ln&&(m[0]=1,++e.e);break}else{if(m[p]+=a,m[p]!=Ln)break;m[p--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(Jt&&(e.e>Gg||e.e<-Gg))throw Error(ik+An(e));return e}function iU(e,t){var n,r,i,a,o,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),Jt?It(t,v):t;if(d=e.d,m=t.d,r=t.e,f=e.e,d=d.slice(),o=f-r,o){for(p=o<0,p?(n=d,o=-o,c=m.length):(n=m,r=f,c=d.length),i=Math.max(Math.ceil(v/Yt),c)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;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}o=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>o;){if(d[--i]<m[i]){for(a=i;a&&d[--a]===0;)d[a]=Ln-1;--d[a],d[i]+=Ln}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,Jt?It(t,v):t):new y(0)}function Pl(e,t,n){var r,i=An(e),a=fa(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Zs(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Zs(-i-1)+a,n&&(r=n-o)>0&&(a+=Zs(r))):i>=o?(a+=Zs(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Zs(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=Zs(r))),e.s<0?"-"+a:a}function BR(e,t){if(e.length>t)return e.length=t,!0}function aU(e){var t,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(bl+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return UR(o,a.toString())}else if(typeof a!="string")throw Error(bl+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,wpe.test(a))UR(o,a);else throw Error(bl+a)}if(i.prototype=De,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=aU,i.config=i.set=Spe,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 Spe(e){if(!e||typeof e!="object")throw Error(ki+"Object expected");var t,n,r,i=["precision",1,Iu,"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(Lu(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(bl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(bl+n+": "+r);return this}var ak=aU(xpe);Gr=new ak(1);const gt=ak;function sU(e){var t;return e===0?t=1:t=Math.floor(new gt(e).abs().log(10).toNumber())+1,t}function oU(e,t,n){for(var r=new gt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var lU=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},sk=(e,t,n)=>{if(e.lte(0))return new gt(0);var r=sU(e.toNumber()),i=new gt(10).pow(r),a=e.div(i),o=r!==1?.05:.1,c=new gt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),d=c.mul(i);return t?new gt(d.toNumber()):new gt(Math.ceil(d.toNumber()))},cU=(e,t,n)=>{var r;if(e.lte(0))return new gt(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new gt(a).abs().log(10).toNumber()),c=new gt(10).pow(o),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 gt(10).pow(p))}var m=(r=i[f])!==null&&r!==void 0?r:1,y=new gt(m).mul(c);return t?y:new gt(Math.ceil(y.toNumber()))},jpe=(e,t,n)=>{var r=new gt(1),i=new gt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new gt(10).pow(sU(e)-1),i=new gt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new gt(Math.floor(e)))}else e===0?i=new gt(Math.floor((t-1)/2)):n||(i=new gt(Math.floor(e)));for(var o=Math.floor((t-1)/2),c=[],d=0;d<t;d++)c.push(i.add(new gt(d-o).mul(r)).toNumber());return c},uU=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:sk;if(!Number.isFinite((n-t)/(r-1)))return{step:new gt(0),tickMin:new gt(0),tickMax:new gt(0)};var c=o(new gt(n).sub(t).div(r-1),i,a),d;t<=0&&n>=0?d=new gt(0):(d=new gt(t).add(n).div(2),d=d.sub(new gt(d).mod(c)));var f=Math.ceil(d.sub(t).div(c).toNumber()),p=Math.ceil(new gt(n).sub(d).div(c).toNumber()),m=f+p+1;return m>r?uU(t,n,r,i,a+1,o):(m<r&&(p=n>0?p+(r-m):p,f=n>0?f:f+(r-m)),{step:c,tickMin:d.sub(new gt(f).mul(c)),tickMax:d.add(new gt(p).mul(c))})},FR=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(i,2),[d,f]=lU([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 jpe(d,i,a);var m=o==="snap125"?cU:sk,{step:y,tickMin:v,tickMax:x}=uU(d,f,c,a,0,m),w=oU(v,x.add(new gt(.1).mul(y)),y);return n>r?w.reverse():w},qR=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[c,d]=lU([r,i]);if(c===-1/0||d===1/0)return[r,i];if(c===d)return[c];var f=o==="snap125"?cU:sk,p=Math.max(n,2),m=f(new gt(d).sub(c).div(p-1),a,0),y=[...oU(new gt(c),new gt(d),m),d];return a===!1&&(y=y.map(v=>Math.round(v))),r>i?y.reverse():y},Npe=e=>e.rootProps.barCategoryGap,xv=e=>e.rootProps.stackOffset,dU=e=>e.rootProps.reverseStackOrder,ok=e=>e.options.chartName,lk=e=>e.rootProps.syncId,fU=e=>e.rootProps.syncMethod,ck=e=>e.options.eventEmitter,kpe=e=>e.rootProps.baseValue,ar={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Wo={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},ia={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},wv=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Sv(e,t,n){if(n!=="auto")return n;if(e!=null)return Sa(e,t)?"category":"number"}function KR(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?KR(Object(n),!0).forEach(function(r){Cpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cpe(e,t,n){return(t=_pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _pe(e){var t=Ape(e,"string");return typeof t=="symbol"?t:t+""}function Ape(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 HR={allowDataOverflow:Wo.allowDataOverflow,allowDecimals:Wo.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Wo.angleAxisId,includeHidden:!1,name:void 0,reversed:Wo.reversed,scale:Wo.scale,tick:Wo.tick,tickCount:void 0,ticks:void 0,type:Wo.type,unit:void 0,niceTicks:"auto"},GR={allowDataOverflow:ia.allowDataOverflow,allowDecimals:ia.allowDecimals,allowDuplicatedCategory:ia.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:ia.radiusAxisId,includeHidden:ia.includeHidden,name:void 0,reversed:ia.reversed,scale:ia.scale,tick:ia.tick,tickCount:ia.tickCount,ticks:void 0,type:ia.type,unit:void 0,niceTicks:"auto"},Ope=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},uk=le([Ope,D4],(e,t)=>{var n;if(e!=null)return e;var r=(n=Sv(t,"angleAxis",HR.type))!==null&&n!==void 0?n:"category";return Vg(Vg({},HR),{},{type:r})}),Epe=(e,t)=>e.polarAxis.radiusAxis[t],dk=le([Epe,D4],(e,t)=>{var n;if(e!=null)return e;var r=(n=Sv(t,"radiusAxis",GR.type))!==null&&n!==void 0?n:"category";return Vg(Vg({},GR),{},{type:r})}),jv=e=>e.polarOptions,fk=le([us,ds,Jn],epe),hU=le([jv,fk],(e,t)=>{if(e!=null)return po(e.innerRadius,t,0)}),pU=le([jv,fk],(e,t)=>{if(e!=null)return po(e.outerRadius,t,t*.8)}),Tpe=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},mU=le([jv],Tpe);le([uk,mU],wv);var gU=le([fk,hU,pU],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});le([dk,gU],wv);var yU=le([tn,jv,hU,pU,us,ds],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:c,startAngle:d,endAngle:f}=t;return{cx:po(o,i,i/2),cy:po(c,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:f,clockWise:!1}}}),Un=(e,t)=>t,Nv=(e,t,n)=>n;function hk(e){return e?.id}function vU(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=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=hk(c);f.forEach((m,y)=>{var v=a==null||i?y:String($n(m,a,null)),x=$n(m,c.dataKey,0),w;o.has(v)?w=o.get(v):w={},Object.assign(w,{[p]:x}),o.set(v,w)})}}),Array.from(o.values())}function pk(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var kv=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Cv(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Ppe(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 Bn=e=>{var t=tn(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},$u=e=>e.tooltip.settings.axisId;function mk(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(a){function o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var o=i[0],c=i[1];return o<=c?a>=o&&a<=c:a>=c&&a<=o},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,o)=>{var c=e(a);if(c!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var d=e.bandwidth();switch(o.position){case"middle":c+=d/2;break;case"end":c+=d;break}}return c}}}}}var zpe=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!ha(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];nt(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 oo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Rpe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function gk(e){let t,n,r;e.length!==2?(t=oo,n=(c,d)=>oo(e(c),d),r=(c,d)=>e(c)-d):(t=e===oo||e===Rpe?e:Mpe,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 o(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:o,right:a}}function Mpe(){return 0}function bU(e){return e===null?NaN:+e}function*Dpe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Ipe=gk(oo),ph=Ipe.right;gk(bU).center;class VR extends Map{constructor(t,n=Upe){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(ZR(this,t))}has(t){return super.has(ZR(this,t))}set(t,n){return super.set(Lpe(this,t),n)}delete(t){return super.delete($pe(this,t))}}function ZR({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Lpe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function $pe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Upe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Bpe(e=oo){if(e===oo)return xU;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 xU(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Fpe=Math.sqrt(50),qpe=Math.sqrt(10),Kpe=Math.sqrt(2);function Zg(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=Fpe?10:a>=qpe?5:a>=Kpe?2:1;let c,d,f;return i<0?(f=Math.pow(10,-i)/o,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)*o,c=Math.round(e/f),d=Math.round(t/f),c*f<e&&++c,d*f>t&&--d),d<c&&.5<=n&&n<2?Zg(e,t,n*2):[c,d,f]}function q1(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,o]=r?Zg(t,e,n):Zg(e,t,n);if(!(a>=i))return[];const c=a-i+1,d=new Array(c);if(r)if(o<0)for(let f=0;f<c;++f)d[f]=(a-f)/-o;else for(let f=0;f<c;++f)d[f]=(a-f)*o;else if(o<0)for(let f=0;f<c;++f)d[f]=(i+f)/-o;else for(let f=0;f<c;++f)d[f]=(i+f)*o;return d}function K1(e,t,n){return t=+t,e=+e,n=+n,Zg(e,t,n)[2]}function H1(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?K1(t,e,n):K1(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function YR(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function WR(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function wU(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?xU:Bpe(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)),x=Math.min(r,Math.floor(t+(d-f)*m/d+y));wU(e,t,v,x,i)}const a=e[t];let o=n,c=r;for(Wd(e,n,t),i(e[r],a)>0&&Wd(e,n,r);o<c;){for(Wd(e,o,c),++o,--c;i(e[o],a)<0;)++o;for(;i(e[c],a)>0;)--c}i(e[n],a)===0?Wd(e,n,c):(++c,Wd(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function Wd(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Hpe(e,t,n){if(e=Float64Array.from(Dpe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return WR(e);if(t>=1)return YR(e);var r,i=(r-1)*t,a=Math.floor(i),o=YR(wU(e,a).subarray(0,a+1)),c=WR(e.subarray(a+1));return o+(c-o)*(i-a)}}function Gpe(e,t,n=bU){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),c=+n(e[a+1],a+1,e);return o+(c-o)*(i-a)}}function Vpe(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 Ei(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function fs(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 G1=Symbol("implicit");function yk(){var e=new VR,t=[],n=[],r=G1;function i(a){let o=e.get(a);if(o===void 0){if(r!==G1)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new VR;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return yk(t,n).unknown(r)},Ei.apply(i,arguments),i}function vk(){var e=yk().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,c=!1,d=0,f=0,p=.5;delete e.unknown;function m(){var y=t().length,v=i<r,x=v?i:r,w=v?r:i;a=(w-x)/Math.max(1,y-d+f*2),c&&(a=Math.floor(a)),x+=(w-x-a*(y-d))*p,o=a*(1-d),c&&(x=Math.round(x),o=Math.round(o));var j=Vpe(y).map(function(k){return x+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 o},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 vk(t(),[r,i]).round(c).paddingInner(d).paddingOuter(f).align(p)},Ei.apply(m(),arguments)}function SU(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return SU(t())},e}function Zpe(){return SU(vk.apply(null,arguments).paddingInner(1))}function bk(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function jU(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function mh(){}var Bf=.7,Yg=1/Bf,ou="\\s*([+-]?\\d+)\\s*",Ff="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",pa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ype=/^#([0-9a-f]{3,8})$/,Wpe=new RegExp(`^rgb\\(${ou},${ou},${ou}\\)$`),Qpe=new RegExp(`^rgb\\(${pa},${pa},${pa}\\)$`),Xpe=new RegExp(`^rgba\\(${ou},${ou},${ou},${Ff}\\)$`),Jpe=new RegExp(`^rgba\\(${pa},${pa},${pa},${Ff}\\)$`),eme=new RegExp(`^hsl\\(${Ff},${pa},${pa}\\)$`),tme=new RegExp(`^hsla\\(${Ff},${pa},${pa},${Ff}\\)$`),QR={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};bk(mh,qf,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:XR,formatHex:XR,formatHex8:nme,formatHsl:rme,formatRgb:JR,toString:JR});function XR(){return this.rgb().formatHex()}function nme(){return this.rgb().formatHex8()}function rme(){return NU(this).formatHsl()}function JR(){return this.rgb().formatRgb()}function qf(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ype.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?eM(t):n===3?new Er(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Cm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Cm(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=Wpe.exec(e))?new Er(t[1],t[2],t[3],1):(t=Qpe.exec(e))?new Er(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Xpe.exec(e))?Cm(t[1],t[2],t[3],t[4]):(t=Jpe.exec(e))?Cm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=eme.exec(e))?rM(t[1],t[2]/100,t[3]/100,1):(t=tme.exec(e))?rM(t[1],t[2]/100,t[3]/100,t[4]):QR.hasOwnProperty(e)?eM(QR[e]):e==="transparent"?new Er(NaN,NaN,NaN,0):null}function eM(e){return new Er(e>>16&255,e>>8&255,e&255,1)}function Cm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Er(e,t,n,r)}function ime(e){return e instanceof mh||(e=qf(e)),e?(e=e.rgb(),new Er(e.r,e.g,e.b,e.opacity)):new Er}function V1(e,t,n,r){return arguments.length===1?ime(e):new Er(e,t,n,r??1)}function Er(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}bk(Er,V1,jU(mh,{brighter(e){return e=e==null?Yg:Math.pow(Yg,e),new Er(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Bf:Math.pow(Bf,e),new Er(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Er(xl(this.r),xl(this.g),xl(this.b),Wg(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:tM,formatHex:tM,formatHex8:ame,formatRgb:nM,toString:nM}));function tM(){return`#${dl(this.r)}${dl(this.g)}${dl(this.b)}`}function ame(){return`#${dl(this.r)}${dl(this.g)}${dl(this.b)}${dl((isNaN(this.opacity)?1:this.opacity)*255)}`}function nM(){const e=Wg(this.opacity);return`${e===1?"rgb(":"rgba("}${xl(this.r)}, ${xl(this.g)}, ${xl(this.b)}${e===1?")":`, ${e})`}`}function Wg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function xl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function dl(e){return e=xl(e),(e<16?"0":"")+e.toString(16)}function rM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ki(e,t,n,r)}function NU(e){if(e instanceof Ki)return new Ki(e.h,e.s,e.l,e.opacity);if(e instanceof mh||(e=qf(e)),!e)return new Ki;if(e instanceof Ki)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,c=a-i,d=(a+i)/2;return c?(t===a?o=(n-r)/c+(n<r)*6:n===a?o=(r-t)/c+2:o=(t-n)/c+4,c/=d<.5?a+i:2-a-i,o*=60):c=d>0&&d<1?0:o,new Ki(o,c,d,e.opacity)}function sme(e,t,n,r){return arguments.length===1?NU(e):new Ki(e,t,n,r??1)}function Ki(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}bk(Ki,sme,jU(mh,{brighter(e){return e=e==null?Yg:Math.pow(Yg,e),new Ki(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Bf:Math.pow(Bf,e),new Ki(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 Er(eS(e>=240?e-240:e+120,i,r),eS(e,i,r),eS(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ki(iM(this.h),_m(this.s),_m(this.l),Wg(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=Wg(this.opacity);return`${e===1?"hsl(":"hsla("}${iM(this.h)}, ${_m(this.s)*100}%, ${_m(this.l)*100}%${e===1?")":`, ${e})`}`}}));function iM(e){return e=(e||0)%360,e<0?e+360:e}function _m(e){return Math.max(0,Math.min(1,e||0))}function eS(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 xk=e=>()=>e;function ome(e,t){return function(n){return e+n*t}}function lme(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 cme(e){return(e=+e)==1?kU:function(t,n){return n-t?lme(t,n,e):xk(isNaN(t)?n:t)}}function kU(e,t){var n=t-e;return n?ome(e,n):xk(isNaN(e)?t:e)}const aM=(function e(t){var n=cme(t);function r(i,a){var o=n((i=V1(i)).r,(a=V1(a)).r),c=n(i.g,a.g),d=n(i.b,a.b),f=kU(i.opacity,a.opacity);return function(p){return i.r=o(p),i.g=c(p),i.b=d(p),i.opacity=f(p),i+""}}return r.gamma=e,r})(1);function ume(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 dme(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function fme(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=Uu(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(c){for(o=0;o<r;++o)a[o]=i[o](c);return a}}function hme(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Qg(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function pme(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]=Uu(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Z1=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tS=new RegExp(Z1.source,"g");function mme(e){return function(){return e}}function gme(e){return function(t){return e(t)+""}}function yme(e,t){var n=Z1.lastIndex=tS.lastIndex=0,r,i,a,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=Z1.exec(e))&&(i=tS.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),c[o]?c[o]+=a:c[++o]=a),(r=r[0])===(i=i[0])?c[o]?c[o]+=i:c[++o]=i:(c[++o]=null,d.push({i:o,x:Qg(r,i)})),n=tS.lastIndex;return n<t.length&&(a=t.slice(n),c[o]?c[o]+=a:c[++o]=a),c.length<2?d[0]?gme(d[0].x):mme(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 Uu(e,t){var n=typeof t,r;return t==null||n==="boolean"?xk(t):(n==="number"?Qg:n==="string"?(r=qf(t))?(t=r,aM):yme:t instanceof qf?aM:t instanceof Date?hme:dme(t)?ume:Array.isArray(t)?fme:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?pme:Qg)(e,t)}function wk(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function vme(e,t){t===void 0&&(t=e,e=Uu);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var c=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[c](o-c)}}function bme(e){return function(){return e}}function Xg(e){return+e}var sM=[0,1];function fr(e){return e}function Y1(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:bme(isNaN(t)?NaN:.5)}function xme(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function wme(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=Y1(i,r),a=n(o,a)):(r=Y1(r,i),a=n(a,o)),function(c){return a(r(c))}}function Sme(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=Y1(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(c){var d=ph(e,c,1,r)-1;return a[d](i[d](c))}}function gh(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function _v(){var e=sM,t=sM,n=Uu,r,i,a,o=fr,c,d,f;function p(){var y=Math.min(e.length,t.length);return o!==fr&&(o=xme(e[0],e[y-1])),c=y>2?Sme:wme,d=f=null,m}function m(y){return y==null||isNaN(y=+y)?a:(d||(d=c(e.map(r),t,n)))(r(o(y)))}return m.invert=function(y){return o(i((f||(f=c(t,e.map(r),Qg)))(y)))},m.domain=function(y){return arguments.length?(e=Array.from(y,Xg),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=wk,p()},m.clamp=function(y){return arguments.length?(o=y?!0:fr,p()):o!==fr},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 Sk(){return _v()(fr,fr)}function jme(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Jg(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 vu(e){return e=Jg(Math.abs(e)),e?e[1]:NaN}function Nme(e,t){return function(n,r){for(var i=n.length,a=[],o=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[o=(o+1)%e.length];return a.reverse().join(t)}}function kme(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Cme=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Kf(e){if(!(t=Cme.exec(e)))throw new Error("invalid format: "+e);var t;return new jk({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]})}Kf.prototype=jk.prototype;function jk(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+""}jk.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 _me(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 ey;function Ame(e,t){var n=Jg(e,t);if(!n)return ey=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(ey=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Jg(e,Math.max(0,t+a-1))[0]}function oM(e,t){var n=Jg(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 lM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:jme,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)=>oM(e*100,t),r:oM,s:Ame,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function cM(e){return e}var uM=Array.prototype.map,dM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ome(e){var t=e.grouping===void 0||e.thousands===void 0?cM:Nme(uM.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?cM:kme(uM.call(e.numerals,String)),o=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=Kf(m);var v=m.fill,x=m.align,w=m.sign,j=m.symbol,k=m.zero,O=m.width,_=m.comma,C=m.precision,P=m.trim,T=m.type;T==="n"?(_=!0,T="g"):lM[T]||(C===void 0&&(C=12),P=!0,T="g"),(k||v==="0"&&x==="=")&&(k=!0,v="0",x="=");var A=(y&&y.prefix!==void 0?y.prefix:"")+(j==="$"?n:j==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),z=(j==="$"?r:/[%p]/.test(T)?o:"")+(y&&y.suffix!==void 0?y.suffix:""),I=lM[T],q=/[defgprs%]/.test(T);C=C===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function U(L){var J=A,ae=z,Q,K,X;if(T==="c")ae=I(L)+ae,L="";else{L=+L;var ye=L<0||1/L<0;if(L=isNaN(L)?d:I(Math.abs(L),C),P&&(L=_me(L)),ye&&+L==0&&w!=="+"&&(ye=!1),J=(ye?w==="("?w:c:w==="-"||w==="("?"":w)+J,ae=(T==="s"&&!isNaN(L)&&ey!==void 0?dM[8+ey/3]:"")+ae+(ye&&w==="("?")":""),q){for(Q=-1,K=L.length;++Q<K;)if(X=L.charCodeAt(Q),48>X||X>57){ae=(X===46?i+L.slice(Q+1):L.slice(Q))+ae,L=L.slice(0,Q);break}}}_&&!k&&(L=t(L,1/0));var Se=J.length+L.length+ae.length,R=Se<O?new Array(O-Se+1).join(v):"";switch(_&&k&&(L=t(R+L,R.length?O-ae.length:1/0),R=""),x){case"<":L=J+L+ae+R;break;case"=":L=J+R+L+ae;break;case"^":L=R.slice(0,Se=R.length>>1)+J+L+ae+R.slice(Se);break;default:L=R+J+L+ae;break}return a(L)}return U.toString=function(){return m+""},U}function p(m,y){var v=Math.max(-8,Math.min(8,Math.floor(vu(y)/3)))*3,x=Math.pow(10,-v),w=f((m=Kf(m),m.type="f",m),{suffix:dM[8+v/3]});return function(j){return w(x*j)}}return{format:f,formatPrefix:p}}var Am,Nk,CU;Eme({thousands:",",grouping:[3],currency:["$",""]});function Eme(e){return Am=Ome(e),Nk=Am.format,CU=Am.formatPrefix,Am}function Tme(e){return Math.max(0,-vu(Math.abs(e)))}function Pme(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(vu(t)/3)))*3-vu(Math.abs(e)))}function zme(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,vu(t)-vu(e))+1}function _U(e,t,n,r){var i=H1(e,t,n),a;switch(r=Kf(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Pme(i,o))&&(r.precision=a),CU(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=zme(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Tme(i))&&(r.precision=a-(r.type==="%")*2);break}}return Nk(r)}function So(e){var t=e.domain;return e.ticks=function(n){var r=t();return q1(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return _U(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],c=r[a],d,f,p=10;for(c<o&&(f=o,o=c,c=f,f=i,i=a,a=f);p-- >0;){if(f=K1(o,c,n),f===d)return r[i]=o,r[a]=c,t(r);if(f>0)o=Math.floor(o/f)*f,c=Math.ceil(c/f)*f;else if(f<0)o=Math.ceil(o*f)/f,c=Math.floor(c*f)/f;else break;d=f}return e},e}function AU(){var e=Sk();return e.copy=function(){return gh(e,AU())},Ei.apply(e,arguments),So(e)}function OU(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,Xg),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return OU(e).unknown(t)},e=arguments.length?Array.from(e,Xg):[0,1],So(n)}function EU(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function fM(e){return Math.log(e)}function hM(e){return Math.exp(e)}function Rme(e){return-Math.log(-e)}function Mme(e){return-Math.exp(-e)}function Dme(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Ime(e){return e===10?Dme:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Lme(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 pM(e){return(t,n)=>-e(-t,n)}function kk(e){const t=e(fM,hM),n=t.domain;let r=10,i,a;function o(){return i=Lme(r),a=Ime(r),n()[0]<0?(i=pM(i),a=pM(a),e(Rme,Mme)):e(fM,hM),t}return t.base=function(c){return arguments.length?(r=+c,o()):r},t.domain=function(c){return arguments.length?(n(c),o()):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),x,w;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(x=1;x<r;++x)if(w=y<0?x/a(-y):x*a(y),!(w<f)){if(w>p)break;k.push(w)}}else for(;y<=v;++y)for(x=r-1;x>=1;--x)if(w=y>0?x/a(-y):x*a(y),!(w<f)){if(w>p)break;k.push(w)}k.length*2<j&&(k=q1(f,p,j))}else k=q1(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=Kf(d)).precision==null&&(d.trim=!0),d=Nk(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(EU(n(),{floor:c=>a(Math.floor(i(c))),ceil:c=>a(Math.ceil(i(c)))})),t}function TU(){const e=kk(_v()).domain([1,10]);return e.copy=()=>gh(e,TU()).base(e.base()),Ei.apply(e,arguments),e}function mM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function gM(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Ck(e){var t=1,n=e(mM(t),gM(t));return n.constant=function(r){return arguments.length?e(mM(t=+r),gM(t)):t},So(n)}function PU(){var e=Ck(_v());return e.copy=function(){return gh(e,PU()).constant(e.constant())},Ei.apply(e,arguments)}function yM(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function $me(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Ume(e){return e<0?-e*e:e*e}function _k(e){var t=e(fr,fr),n=1;function r(){return n===1?e(fr,fr):n===.5?e($me,Ume):e(yM(n),yM(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},So(t)}function Ak(){var e=_k(_v());return e.copy=function(){return gh(e,Ak()).exponent(e.exponent())},Ei.apply(e,arguments),e}function Bme(){return Ak.apply(null,arguments).exponent(.5)}function vM(e){return Math.sign(e)*e*e}function Fme(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function zU(){var e=Sk(),t=[0,1],n=!1,r;function i(a){var o=Fme(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(vM(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,Xg)).map(vM)),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 zU(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ei.apply(i,arguments),So(i)}function RU(){var e=[],t=[],n=[],r;function i(){var o=0,c=Math.max(1,t.length);for(n=new Array(c-1);++o<c;)n[o-1]=Gpe(e,o/c);return a}function a(o){return o==null||isNaN(o=+o)?r:t[ph(n,o)]}return a.invertExtent=function(o){var c=t.indexOf(o);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let c of o)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(oo),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return RU().domain(e).range(t).unknown(r)},Ei.apply(a,arguments)}function MU(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(d){return d!=null&&d<=d?i[ph(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 o}return o.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,c()):[e,t]},o.range=function(d){return arguments.length?(n=(i=Array.from(d)).length-1,c()):i.slice()},o.invertExtent=function(d){var f=i.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},o.unknown=function(d){return arguments.length&&(a=d),o},o.thresholds=function(){return r.slice()},o.copy=function(){return MU().domain([e,t]).range(i).unknown(a)},Ei.apply(So(o),arguments)}function DU(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[ph(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return DU().domain(e).range(t).unknown(n)},Ei.apply(i,arguments)}const nS=new Date,rS=new Date;function Rn(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),c=i.ceil(a);return a-o<c-a?o:c},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,c)=>{const d=[];if(a=i.ceil(a),c=c==null?1:Math.floor(c),!(a<o)||!(c>0))return d;let f;do d.push(f=new Date(+a)),t(a,c),e(a);while(f<a&&a<o);return d},i.filter=a=>Rn(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,c)=>{if(o>=o)if(c<0)for(;++c<=0;)for(;t(o,-1),!a(o););else for(;--c>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(nS.setTime(+a),rS.setTime(+o),e(nS),e(rS),Math.floor(n(nS,rS))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const ty=Rn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ty.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Rn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ty);ty.range;const Xa=1e3,wi=Xa*60,Ja=wi*60,ss=Ja*24,Ok=ss*7,bM=ss*30,iS=ss*365,fl=Rn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Xa)},(e,t)=>(t-e)/Xa,e=>e.getUTCSeconds());fl.range;const Ek=Rn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xa)},(e,t)=>{e.setTime(+e+t*wi)},(e,t)=>(t-e)/wi,e=>e.getMinutes());Ek.range;const Tk=Rn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*wi)},(e,t)=>(t-e)/wi,e=>e.getUTCMinutes());Tk.range;const Pk=Rn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xa-e.getMinutes()*wi)},(e,t)=>{e.setTime(+e+t*Ja)},(e,t)=>(t-e)/Ja,e=>e.getHours());Pk.range;const zk=Rn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ja)},(e,t)=>(t-e)/Ja,e=>e.getUTCHours());zk.range;const yh=Rn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*wi)/ss,e=>e.getDate()-1);yh.range;const Av=Rn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ss,e=>e.getUTCDate()-1);Av.range;const IU=Rn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ss,e=>Math.floor(e/ss));IU.range;function ql(e){return Rn(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())*wi)/Ok)}const Ov=ql(0),ny=ql(1),qme=ql(2),Kme=ql(3),bu=ql(4),Hme=ql(5),Gme=ql(6);Ov.range;ny.range;qme.range;Kme.range;bu.range;Hme.range;Gme.range;function Kl(e){return Rn(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)/Ok)}const Ev=Kl(0),ry=Kl(1),Vme=Kl(2),Zme=Kl(3),xu=Kl(4),Yme=Kl(5),Wme=Kl(6);Ev.range;ry.range;Vme.range;Zme.range;xu.range;Yme.range;Wme.range;const Rk=Rn(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());Rk.range;const Mk=Rn(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());Mk.range;const os=Rn(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());os.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rn(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)});os.range;const ls=Rn(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());ls.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rn(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)});ls.range;function LU(e,t,n,r,i,a){const o=[[fl,1,Xa],[fl,5,5*Xa],[fl,15,15*Xa],[fl,30,30*Xa],[a,1,wi],[a,5,5*wi],[a,15,15*wi],[a,30,30*wi],[i,1,Ja],[i,3,3*Ja],[i,6,6*Ja],[i,12,12*Ja],[r,1,ss],[r,2,2*ss],[n,1,Ok],[t,1,bM],[t,3,3*bM],[e,1,iS]];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),x=v?v.range(f,+p+1):[];return y?x.reverse():x}function d(f,p,m){const y=Math.abs(p-f)/m,v=gk(([,,j])=>j).right(o,y);if(v===o.length)return e.every(H1(f/iS,p/iS,m));if(v===0)return ty.every(Math.max(H1(f,p,m),1));const[x,w]=o[y/o[v-1][2]<o[v][2]/y?v-1:v];return x.every(w)}return[c,d]}const[Qme,Xme]=LU(ls,Mk,Ev,IU,zk,Tk),[Jme,ege]=LU(os,Rk,Ov,yh,Pk,Ek);function aS(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 sS(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 Qd(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function tge(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,c=e.months,d=e.shortMonths,f=Xd(i),p=Jd(i),m=Xd(a),y=Jd(a),v=Xd(o),x=Jd(o),w=Xd(c),j=Jd(c),k=Xd(d),O=Jd(d),_={a:X,A:ye,b:Se,B:R,c:null,d:kM,e:kM,f:Nge,g:Rge,G:Dge,H:wge,I:Sge,j:jge,L:$U,m:kge,M:Cge,p:F,q:B,Q:AM,s:OM,S:_ge,u:Age,U:Oge,V:Ege,w:Tge,W:Pge,x:null,X:null,y:zge,Y:Mge,Z:Ige,"%":_M},C={a:M,A:V,b:se,B:ie,c:null,d:CM,e:CM,f:Bge,g:Qge,G:Jge,H:Lge,I:$ge,j:Uge,L:BU,m:Fge,M:qge,p:he,q:je,Q:AM,s:OM,S:Kge,u:Hge,U:Gge,V:Vge,w:Zge,W:Yge,x:null,X:null,y:Wge,Y:Xge,Z:eye,"%":_M},P={a:q,A:U,b:L,B:J,c:ae,d:jM,e:jM,f:yge,g:SM,G:wM,H:NM,I:NM,j:hge,L:gge,m:fge,M:pge,p:I,q:dge,Q:bge,s:xge,S:mge,u:sge,U:oge,V:lge,w:age,W:cge,x:Q,X:K,y:SM,Y:wM,Z:uge,"%":vge};_.x=T(n,_),_.X=T(r,_),_.c=T(t,_),C.x=T(n,C),C.X=T(r,C),C.c=T(t,C);function T(ee,de){return function(_e){var Y=[],Ke=-1,Me=0,rt=ee.length,it,Nt,Lt;for(_e instanceof Date||(_e=new Date(+_e));++Ke<rt;)ee.charCodeAt(Ke)===37&&(Y.push(ee.slice(Me,Ke)),(Nt=xM[it=ee.charAt(++Ke)])!=null?it=ee.charAt(++Ke):Nt=it==="e"?" ":"0",(Lt=de[it])&&(it=Lt(_e,Nt)),Y.push(it),Me=Ke+1);return Y.push(ee.slice(Me,Ke)),Y.join("")}}function A(ee,de){return function(_e){var Y=Qd(1900,void 0,1),Ke=z(Y,ee,_e+="",0),Me,rt;if(Ke!=_e.length)return null;if("Q"in Y)return new Date(Y.Q);if("s"in Y)return new Date(Y.s*1e3+("L"in Y?Y.L:0));if(de&&!("Z"in Y)&&(Y.Z=0),"p"in Y&&(Y.H=Y.H%12+Y.p*12),Y.m===void 0&&(Y.m="q"in Y?Y.q:0),"V"in Y){if(Y.V<1||Y.V>53)return null;"w"in Y||(Y.w=1),"Z"in Y?(Me=sS(Qd(Y.y,0,1)),rt=Me.getUTCDay(),Me=rt>4||rt===0?ry.ceil(Me):ry(Me),Me=Av.offset(Me,(Y.V-1)*7),Y.y=Me.getUTCFullYear(),Y.m=Me.getUTCMonth(),Y.d=Me.getUTCDate()+(Y.w+6)%7):(Me=aS(Qd(Y.y,0,1)),rt=Me.getDay(),Me=rt>4||rt===0?ny.ceil(Me):ny(Me),Me=yh.offset(Me,(Y.V-1)*7),Y.y=Me.getFullYear(),Y.m=Me.getMonth(),Y.d=Me.getDate()+(Y.w+6)%7)}else("W"in Y||"U"in Y)&&("w"in Y||(Y.w="u"in Y?Y.u%7:"W"in Y?1:0),rt="Z"in Y?sS(Qd(Y.y,0,1)).getUTCDay():aS(Qd(Y.y,0,1)).getDay(),Y.m=0,Y.d="W"in Y?(Y.w+6)%7+Y.W*7-(rt+5)%7:Y.w+Y.U*7-(rt+6)%7);return"Z"in Y?(Y.H+=Y.Z/100|0,Y.M+=Y.Z%100,sS(Y)):aS(Y)}}function z(ee,de,_e,Y){for(var Ke=0,Me=de.length,rt=_e.length,it,Nt;Ke<Me;){if(Y>=rt)return-1;if(it=de.charCodeAt(Ke++),it===37){if(it=de.charAt(Ke++),Nt=P[it in xM?de.charAt(Ke++):it],!Nt||(Y=Nt(ee,_e,Y))<0)return-1}else if(it!=_e.charCodeAt(Y++))return-1}return Y}function I(ee,de,_e){var Y=f.exec(de.slice(_e));return Y?(ee.p=p.get(Y[0].toLowerCase()),_e+Y[0].length):-1}function q(ee,de,_e){var Y=v.exec(de.slice(_e));return Y?(ee.w=x.get(Y[0].toLowerCase()),_e+Y[0].length):-1}function U(ee,de,_e){var Y=m.exec(de.slice(_e));return Y?(ee.w=y.get(Y[0].toLowerCase()),_e+Y[0].length):-1}function L(ee,de,_e){var Y=k.exec(de.slice(_e));return Y?(ee.m=O.get(Y[0].toLowerCase()),_e+Y[0].length):-1}function J(ee,de,_e){var Y=w.exec(de.slice(_e));return Y?(ee.m=j.get(Y[0].toLowerCase()),_e+Y[0].length):-1}function ae(ee,de,_e){return z(ee,t,de,_e)}function Q(ee,de,_e){return z(ee,n,de,_e)}function K(ee,de,_e){return z(ee,r,de,_e)}function X(ee){return o[ee.getDay()]}function ye(ee){return a[ee.getDay()]}function Se(ee){return d[ee.getMonth()]}function R(ee){return c[ee.getMonth()]}function F(ee){return i[+(ee.getHours()>=12)]}function B(ee){return 1+~~(ee.getMonth()/3)}function M(ee){return o[ee.getUTCDay()]}function V(ee){return a[ee.getUTCDay()]}function se(ee){return d[ee.getUTCMonth()]}function ie(ee){return c[ee.getUTCMonth()]}function he(ee){return i[+(ee.getUTCHours()>=12)]}function je(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var de=T(ee+="",_);return de.toString=function(){return ee},de},parse:function(ee){var de=A(ee+="",!1);return de.toString=function(){return ee},de},utcFormat:function(ee){var de=T(ee+="",C);return de.toString=function(){return ee},de},utcParse:function(ee){var de=A(ee+="",!0);return de.toString=function(){return ee},de}}}var xM={"-":"",_:" ",0:"0"},Fn=/^\s*\d+/,nge=/^%/,rge=/[\\^$*+?|[\]().{}]/g;function wt(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 ige(e){return e.replace(rge,"\\$&")}function Xd(e){return new RegExp("^(?:"+e.map(ige).join("|")+")","i")}function Jd(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function age(e,t,n){var r=Fn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function sge(e,t,n){var r=Fn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function oge(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function lge(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function cge(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function wM(e,t,n){var r=Fn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function SM(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function uge(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 dge(e,t,n){var r=Fn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function fge(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function jM(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function hge(e,t,n){var r=Fn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function NM(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function pge(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function mge(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function gge(e,t,n){var r=Fn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function yge(e,t,n){var r=Fn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function vge(e,t,n){var r=nge.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function bge(e,t,n){var r=Fn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function xge(e,t,n){var r=Fn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function kM(e,t){return wt(e.getDate(),t,2)}function wge(e,t){return wt(e.getHours(),t,2)}function Sge(e,t){return wt(e.getHours()%12||12,t,2)}function jge(e,t){return wt(1+yh.count(os(e),e),t,3)}function $U(e,t){return wt(e.getMilliseconds(),t,3)}function Nge(e,t){return $U(e,t)+"000"}function kge(e,t){return wt(e.getMonth()+1,t,2)}function Cge(e,t){return wt(e.getMinutes(),t,2)}function _ge(e,t){return wt(e.getSeconds(),t,2)}function Age(e){var t=e.getDay();return t===0?7:t}function Oge(e,t){return wt(Ov.count(os(e)-1,e),t,2)}function UU(e){var t=e.getDay();return t>=4||t===0?bu(e):bu.ceil(e)}function Ege(e,t){return e=UU(e),wt(bu.count(os(e),e)+(os(e).getDay()===4),t,2)}function Tge(e){return e.getDay()}function Pge(e,t){return wt(ny.count(os(e)-1,e),t,2)}function zge(e,t){return wt(e.getFullYear()%100,t,2)}function Rge(e,t){return e=UU(e),wt(e.getFullYear()%100,t,2)}function Mge(e,t){return wt(e.getFullYear()%1e4,t,4)}function Dge(e,t){var n=e.getDay();return e=n>=4||n===0?bu(e):bu.ceil(e),wt(e.getFullYear()%1e4,t,4)}function Ige(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+wt(t/60|0,"0",2)+wt(t%60,"0",2)}function CM(e,t){return wt(e.getUTCDate(),t,2)}function Lge(e,t){return wt(e.getUTCHours(),t,2)}function $ge(e,t){return wt(e.getUTCHours()%12||12,t,2)}function Uge(e,t){return wt(1+Av.count(ls(e),e),t,3)}function BU(e,t){return wt(e.getUTCMilliseconds(),t,3)}function Bge(e,t){return BU(e,t)+"000"}function Fge(e,t){return wt(e.getUTCMonth()+1,t,2)}function qge(e,t){return wt(e.getUTCMinutes(),t,2)}function Kge(e,t){return wt(e.getUTCSeconds(),t,2)}function Hge(e){var t=e.getUTCDay();return t===0?7:t}function Gge(e,t){return wt(Ev.count(ls(e)-1,e),t,2)}function FU(e){var t=e.getUTCDay();return t>=4||t===0?xu(e):xu.ceil(e)}function Vge(e,t){return e=FU(e),wt(xu.count(ls(e),e)+(ls(e).getUTCDay()===4),t,2)}function Zge(e){return e.getUTCDay()}function Yge(e,t){return wt(ry.count(ls(e)-1,e),t,2)}function Wge(e,t){return wt(e.getUTCFullYear()%100,t,2)}function Qge(e,t){return e=FU(e),wt(e.getUTCFullYear()%100,t,2)}function Xge(e,t){return wt(e.getUTCFullYear()%1e4,t,4)}function Jge(e,t){var n=e.getUTCDay();return e=n>=4||n===0?xu(e):xu.ceil(e),wt(e.getUTCFullYear()%1e4,t,4)}function eye(){return"+0000"}function _M(){return"%"}function AM(e){return+e}function OM(e){return Math.floor(+e/1e3)}var Ic,qU,KU;tye({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 tye(e){return Ic=tge(e),qU=Ic.format,Ic.parse,KU=Ic.utcFormat,Ic.utcParse,Ic}function nye(e){return new Date(e)}function rye(e){return e instanceof Date?+e:+new Date(+e)}function Dk(e,t,n,r,i,a,o,c,d,f){var p=Sk(),m=p.invert,y=p.domain,v=f(".%L"),x=f(":%S"),w=f("%I:%M"),j=f("%I %p"),k=f("%a %d"),O=f("%b %d"),_=f("%B"),C=f("%Y");function P(T){return(d(T)<T?v:c(T)<T?x:o(T)<T?w:a(T)<T?j:r(T)<T?i(T)<T?k:O:n(T)<T?_:C)(T)}return p.invert=function(T){return new Date(m(T))},p.domain=function(T){return arguments.length?y(Array.from(T,rye)):y().map(nye)},p.ticks=function(T){var A=y();return e(A[0],A[A.length-1],T??10)},p.tickFormat=function(T,A){return A==null?P:f(A)},p.nice=function(T){var A=y();return(!T||typeof T.range!="function")&&(T=t(A[0],A[A.length-1],T??10)),T?y(EU(A,T)):p},p.copy=function(){return gh(p,Dk(e,t,n,r,i,a,o,c,d,f))},p}function iye(){return Ei.apply(Dk(Jme,ege,os,Rk,Ov,yh,Pk,Ek,fl,qU).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function aye(){return Ei.apply(Dk(Qme,Xme,ls,Mk,Ev,Av,zk,Tk,fl,KU).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Tv(){var e=0,t=1,n,r,i,a,o=fr,c=!1,d;function f(m){return m==null||isNaN(m=+m)?d:o(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?(o=m,f):o};function p(m){return function(y){var v,x;return arguments.length?([v,x]=y,o=m(v,x),f):[o(0),o(1)]}}return f.range=p(Uu),f.rangeRound=p(wk),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 jo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function HU(){var e=So(Tv()(fr));return e.copy=function(){return jo(e,HU())},fs.apply(e,arguments)}function GU(){var e=kk(Tv()).domain([1,10]);return e.copy=function(){return jo(e,GU()).base(e.base())},fs.apply(e,arguments)}function VU(){var e=Ck(Tv());return e.copy=function(){return jo(e,VU()).constant(e.constant())},fs.apply(e,arguments)}function Ik(){var e=_k(Tv());return e.copy=function(){return jo(e,Ik()).exponent(e.exponent())},fs.apply(e,arguments)}function sye(){return Ik.apply(null,arguments).exponent(.5)}function ZU(){var e=[],t=fr;function n(r){if(r!=null&&!isNaN(r=+r))return t((ph(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(oo),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)=>Hpe(e,a/r))},n.copy=function(){return ZU(t).domain(e)},fs.apply(n,arguments)}function Pv(){var e=0,t=.5,n=1,r=1,i,a,o,c,d,f=fr,p,m=!1,y;function v(w){return isNaN(w=+w)?y:(w=.5+((w=+p(w))-a)*(r*w<r*a?c:d),f(m?Math.max(0,Math.min(1,w)):w))}v.domain=function(w){return arguments.length?([e,t,n]=w,i=p(e=+e),a=p(t=+t),o=p(n=+n),c=i===a?0:.5/(a-i),d=a===o?0:.5/(o-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(w){return arguments.length?(m=!!w,v):m},v.interpolator=function(w){return arguments.length?(f=w,v):f};function x(w){return function(j){var k,O,_;return arguments.length?([k,O,_]=j,f=vme(w,[k,O,_]),v):[f(0),f(.5),f(1)]}}return v.range=x(Uu),v.rangeRound=x(wk),v.unknown=function(w){return arguments.length?(y=w,v):y},function(w){return p=w,i=w(e),a=w(t),o=w(n),c=i===a?0:.5/(a-i),d=a===o?0:.5/(o-a),r=a<i?-1:1,v}}function YU(){var e=So(Pv()(fr));return e.copy=function(){return jo(e,YU())},fs.apply(e,arguments)}function WU(){var e=kk(Pv()).domain([.1,1,10]);return e.copy=function(){return jo(e,WU()).base(e.base())},fs.apply(e,arguments)}function QU(){var e=Ck(Pv());return e.copy=function(){return jo(e,QU()).constant(e.constant())},fs.apply(e,arguments)}function Lk(){var e=_k(Pv());return e.copy=function(){return jo(e,Lk()).exponent(e.exponent())},fs.apply(e,arguments)}function oye(){return Lk.apply(null,arguments).exponent(.5)}const XU=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:vk,scaleDiverging:YU,scaleDivergingLog:WU,scaleDivergingPow:Lk,scaleDivergingSqrt:oye,scaleDivergingSymlog:QU,scaleIdentity:OU,scaleImplicit:G1,scaleLinear:AU,scaleLog:TU,scaleOrdinal:yk,scalePoint:Zpe,scalePow:Ak,scaleQuantile:RU,scaleQuantize:MU,scaleRadial:zU,scaleSequential:HU,scaleSequentialLog:GU,scaleSequentialPow:Ik,scaleSequentialQuantile:ZU,scaleSequentialSqrt:sye,scaleSequentialSymlog:VU,scaleSqrt:Bme,scaleSymlog:PU,scaleThreshold:DU,scaleTime:iye,scaleUtc:aye,tickFormat:_U},Symbol.toStringTag,{value:"Module"}));function lye(e){var t=XU;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(ah(e));if(n in t&&typeof t[n]=="function")return t[n]()}function EM(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=lye(e);if(r!=null)return r.domain(t).range(n),r}}function $k(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?EM(e.scale,n,r):EM(t,n,r)}function cye(e){return"scale".concat(ah(e))}function uye(e){return cye(e)in XU}var JU=(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 uye(r)?r:"point"}};function dye(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 e6(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var o;return(o=e(a))!==null&&o!==void 0?o:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var o,c,d=dye(r,a);if(d<=0)return n[0];if(d>=n.length)return n[n.length-1];var f=(o=r[d-1])!==null&&o!==void 0?o:0,p=(c=r[d])!==null&&c!==void 0?c:0;return Math.abs(a-f)<=Math.abs(a-p)?n[d-1]:n[d]}}}function fye(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):e6(e,void 0)}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 iy(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){hye(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 hye(e,t,n){return(t=pye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pye(e){var t=mye(e,"string");return typeof t=="symbol"?t:t+""}function mye(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 W1=[0,"auto"],Tn={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"},t6=(e,t)=>e.cartesianAxis.xAxis[t],ja=(e,t)=>{var n=t6(e,t);return n??Tn},Pn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:W1,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:lh},n6=(e,t)=>e.cartesianAxis.yAxis[t],Na=(e,t)=>{var n=n6(e,t);return n??Pn},gye={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:""},Uk=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??gye},vr=(e,t,n)=>{switch(t){case"xAxis":return ja(e,n);case"yAxis":return Na(e,n);case"zAxis":return Uk(e,n);case"angleAxis":return uk(e,n);case"radiusAxis":return dk(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},yye=(e,t,n)=>{switch(t){case"xAxis":return ja(e,n);case"yAxis":return Na(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},vh=(e,t,n)=>{switch(t){case"xAxis":return ja(e,n);case"yAxis":return Na(e,n);case"angleAxis":return uk(e,n);case"radiusAxis":return dk(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},r6=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function i6(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 a6=e=>e.graphicalItems.cartesianItems,vye=le([Un,Nv],i6),s6=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),Bu=le([a6,vr,vye],s6,{memoizeOptions:{resultEqualityCheck:Cv}}),o6=le([Bu],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(pk)),l6=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),bye=le([Bu],l6),c6=e=>e.map(t=>t.data).filter(Boolean).flat(1),xye=le([Bu],e=>e.some(t=>!t.data)),u6=le([Bu],c6,{memoizeOptions:{resultEqualityCheck:Cv}}),d6=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},Bk=le([u6,bv],d6),wye=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:$n(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:$n(i,r)}))):e.map(r=>({value:r})),f6=(e,t,n,r,i,a)=>{var{chartData:o=[],dataStartIndex:c,dataEndIndex:d}=r,f=wye(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=o.slice(c,d+1),m=p.map(y=>({value:$n(y,t.dataKey)})).filter(y=>y.value!=null);return[...m,...f]}return f},bh=le([Bk,vr,Bu,bv,xye,u6],f6);function lu(e){if(Ni(e)||e instanceof Date){var t=Number(e);if(nt(t))return t}}function PM(e){if(Array.isArray(e)){var t=[lu(e[0]),lu(e[1])];return ha(t)?t:void 0}var n=lu(e);if(n!=null)return[n,n]}function xa(e){return e.map(lu).filter(Or)}function Sye(e,t){var n=lu(e),r=lu(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var jye=le([bh],e=>e?.map(t=>t.value).sort(Sye));function h6(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Nye(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!ya(t))r=t;else if(Array.isArray(t)){var i=xa(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:xa(n.flatMap(a=>{var o=$n(e,a.dataKey),c,d;if(Array.isArray(o)?[c,d]=o:c=d=o,!(!nt(c)||!nt(d)))return[r-c,r+d]}))}var Mn=e=>{var t=Bn(e),n=$u(e);return vh(e,t,n)},wu=le([Mn],e=>e?.dataKey),kye=le([o6,bv,Mn],vU),p6=(e,t,n,r)=>{var i={},a=t.reduce((o,c)=>{if(c.stackId==null)return o;var d=o[c.stackId];return d==null&&(d=[]),d.push(c),o[c.stackId]=d,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var[c,d]=o,f=r?[...d].reverse():d,p=f.map(hk);return[c,{stackedData:ide(e,p,n),graphicalItems:f}]}))},m6=le([kye,o6,xv,dU],p6),g6=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=lde(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},Cye=le([vr],e=>e.allowDataOverflow),Fk=e=>{var t;if(e==null||!("domain"in e))return W1;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=xa(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:W1},y6=le([vr],Fk),v6=le([y6,Cye],eU),_ye=le([m6,Xi,Un,v6],g6,{memoizeOptions:{resultEqualityCheck:kv}}),qk=e=>e.errorBars,Aye=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>h6(n,r)),ay=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),o=Math.min(...a),c=Math.max(...a);return[o,c]}},b6=function(t,n,r,i,a){var o=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]:o,y=(p=i[f.id])===null||p===void 0?void 0:p.filter(v=>h6(a,v));m.forEach(v=>{var x,w=$n(v,(x=n.dataKey)!==null&&x!==void 0?x:f.dataKey),j=Nye(v,w,y);if(j.length>=2){var k=Math.min(...j),O=Math.max(...j);(c==null||k<c)&&(c=k),(d==null||O>d)&&(d=O)}var _=PM(w);_!=null&&(c=c==null?_[0]:Math.min(c,_[0]),d=d==null?_[1]:Math.max(d,_[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(f=>{var p=PM($n(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]))}),nt(c)&&nt(d))return[c,d]},Oye=le([Bk,vr,bye,qk,Un,ype],b6,{memoizeOptions:{resultEqualityCheck:kv}});function Eye(e){var{value:t}=e;if(Ni(t)||t instanceof Date)return t}var Tye=(e,t,n)=>{var r=e.map(Eye).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&O3(r))?J4(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},x6=e=>e.referenceElements.dots,Fu=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),Pye=le([x6,Un,Nv],Fu),w6=e=>e.referenceElements.areas,zye=le([w6,Un,Nv],Fu),S6=e=>e.referenceElements.lines,Rye=le([S6,Un,Nv],Fu),j6=(e,t)=>{if(e!=null){var n=xa(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Mye=le(Pye,Un,j6),N6=(e,t)=>{if(e!=null){var n=xa(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)]}},Dye=le([zye,Un],N6);function Iye(e){var t;if(e.x!=null)return xa([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:xa(n)}function Lye(e){var t;if(e.y!=null)return xa([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:xa(n)}var k6=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?Iye(r):Lye(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},$ye=le([Rye,Un],k6),Uye=le(Mye,$ye,Dye,(e,t,n)=>ay(e,n,t)),C6=(e,t,n,r,i,a,o,c)=>{if(n!=null)return n;var d=o==="vertical"&&c==="xAxis"||o==="horizontal"&&c==="yAxis",f=d?ay(r,a,i):ay(a,i);return bpe(t,f,e.allowDataOverflow)},Bye=le([vr,y6,v6,_ye,Oye,Uye,tn,Un],C6,{memoizeOptions:{resultEqualityCheck:kv}}),Fye=[0,1],_6=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:c,type:d}=e,f=Sa(t,a);if(f&&c==null){var p;return J4(0,(p=n?.length)!==null&&p!==void 0?p:0)}return d==="category"?Tye(r,e,f):i==="expand"&&!f?Fye:o}},Kk=le([vr,tn,Bk,bh,xv,Un,Bye],_6),qu=le([vr,r6,ok],JU),A6=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=Fk(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&ha(e)){if(a)return FR(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return qR(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&ha(e))return FR(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&ha(e))return qR(e,t.tickCount,t.allowDecimals,"adaptive")}}},Hk=le([Kk,vh,qu],A6),O6=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&ha(t)&&Array.isArray(n)&&n.length>0){var i,a,o=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(o,c),Math.max(d,f)]}return t},qye=le([vr,Kk,Hk,Un],O6),Kye=le(bh,vr,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(xa(e.map(m=>m.value))).sort((m,y)=>m-y),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var 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/o}}),E6=le(Kye,tn,Npe,Jn,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!nt(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=po(n,e*a),c=e*a/2;return c-o-(c-o)/a*o}return 0}),Hye=(e,t,n)=>{var r=ja(e,t);return r==null||typeof r.padding!="string"?0:E6(e,"xAxis",t,n,r.padding)},Gye=(e,t,n)=>{var r=Na(e,t);return r==null||typeof r.padding!="string"?0:E6(e,"yAxis",t,n,r.padding)},Vye=le(ja,Hye,(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}}),Zye=le(Na,Gye,(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}}),Yye=le([Jn,Vye,mv,pv,(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]}),Wye=le([Jn,tn,Zye,mv,pv,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),xh=(e,t,n,r)=>{var i;switch(t){case"xAxis":return Yye(e,n,r);case"yAxis":return Wye(e,n,r);case"zAxis":return(i=Uk(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return mU(e);case"radiusAxis":return gU(e,n);default:return}},T6=le([vr,xh],wv),Qye=le([qu,qye],zpe),Gk=le([vr,qu,Qye,T6],$k),P6=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=Sa(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(c=>c.value)}},Vk=le([tn,bh,vh,Un],P6),Su=le([Gk],mk);le([Gk],fye);le([Gk,jye],e6);le([Bu,qk,Un],Aye);function z6(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var zv=(e,t)=>t,Rv=(e,t,n)=>n,Xye=le(fv,zv,Rv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(z6)),Jye=le(hv,zv,Rv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(z6)),R6=(e,t)=>({width:e.width,height:t.height}),eve=(e,t)=>{var n=typeof t.width=="number"?t.width:lh;return{width:n,height:e.height}},tve=le(Jn,ja,R6),nve=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},rve=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},ive=le(ds,Jn,Xye,zv,Rv,(e,t,n,r,i)=>{var a={},o;return n.forEach(c=>{var d=R6(t,c);o==null&&(o=nve(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[c.id]=o-Number(f)*d.height,o+=(f?-1:1)*d.height}),a}),ave=le(us,Jn,Jye,zv,Rv,(e,t,n,r,i)=>{var a={},o;return n.forEach(c=>{var d=eve(t,c);o==null&&(o=rve(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[c.id]=o-Number(f)*d.width,o+=(f?-1:1)*d.width}),a}),sve=(e,t)=>{var n=ja(e,t);if(n!=null)return ive(e,n.orientation,n.mirror)},ove=le([Jn,ja,sve,(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}}}),lve=(e,t)=>{var n=Na(e,t);if(n!=null)return ave(e,n.orientation,n.mirror)},cve=le([Jn,Na,lve,(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}}}),uve=le(Jn,Na,(e,t)=>{var n=typeof t.width=="number"?t.width:lh;return{width:n,height:e.height}}),M6=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,c=Sa(e,r),d=t.map(p=>p.value),f=d.filter(p=>p!=null);if(o&&c&&a==="category"&&i&&O3(f))return d}},Zk=le([tn,bh,vr,Un],M6),zM=le([tn,yye,qu,Su,Zk,Vk,xh,Hk,Un],(e,t,n,r,i,a,o,c,d)=>{if(t!=null){var f=Sa(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:o,realScaleType:n,scale:r}}}),dve=(e,t,n,r,i,a,o,c,d)=>{if(!(t==null||r==null)){var f=Sa(e,d),{type:p,ticks:m,tickCount:y}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,x=p==="category"&&r.bandwidth?r.bandwidth()/v:0;x=d==="angleAxis"&&a!=null&&a.length>=2?bi(a[0]-a[1])*2*x:x;var w=m||i;return w?w.map((j,k)=>{var O=o?o.indexOf(j):j,_=r.map(O);return nt(_)?{index:k,coordinate:_+x,value:j,offset:x}:null}).filter(Or):f&&c?c.map((j,k)=>{var O=r.map(j);return nt(O)?{coordinate:O+x,value:j,index:k,offset:x}:null}).filter(Or):r.ticks?r.ticks(y).map((j,k)=>{var O=r.map(j);return nt(O)?{coordinate:O+x,value:j,index:k,offset:x}:null}).filter(Or):r.domain().map((j,k)=>{var O=r.map(j);return nt(O)?{coordinate:O+x,value:o?o[j]:j,index:k,offset:x}:null}).filter(Or)}},D6=le([tn,vh,qu,Su,Hk,xh,Zk,Vk,Un],dve),fve=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var c=Sa(e,o),{tickCount:d}=t,f=0;return f=o==="angleAxis"&&r?.length>=2?bi(r[0]-r[1])*2*f:f,c&&a?a.map((p,m)=>{var y=n.map(p);return nt(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(Or):n.ticks?n.ticks(d).map((p,m)=>{var y=n.map(p);return nt(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(Or):n.domain().map((p,m)=>{var y=n.map(p);return nt(y)?{coordinate:y+f,value:i?i[p]:p,index:m,offset:f}:null}).filter(Or)}},I6=le([tn,vh,Su,xh,Zk,Vk,Un],fve),L6=le(vr,Su,(e,t)=>{if(!(e==null||t==null))return iy(iy({},e),{},{scale:t})}),hve=le([vr,qu,Kk,T6],$k),pve=le([hve],mk);le((e,t,n)=>Uk(e,n),pve,(e,t)=>{if(!(e==null||t==null))return iy(iy({},e),{},{scale:t})});var mve=le([tn,fv,hv],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),gve=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};le([gve],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var o=Math.abs(a.coordinate-t);o<r&&(r=o,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var $6=e=>e.options.defaultTooltipEventType,U6=e=>e.options.validateTooltipEventTypes;function B6(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function wh(e,t){var n=$6(e),r=U6(e);return B6(t,n,r)}function yve(e){return Fe(t=>wh(t,e))}var F6=(e,t)=>{var n,r=Number(t);if(!(ya(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},vve=e=>e.tooltip.settings,Ws={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},bve={itemInteraction:{click:Ws,hover:Ws},axisInteraction:{click:Ws,hover:Ws},keyboardInteraction:Ws,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}},q6=or({name:"tooltip",initialState:bve,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Zt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=xi(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:Zt()},removeTooltipEntrySettings:{reducer(e,t){var n=xi(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Zt()},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:xve,replaceTooltipEntrySettings:wve,removeTooltipEntrySettings:Sve,setTooltipSettingsState:jve,setActiveMouseOverItemIndex:Nve,mouseLeaveItem:tke,mouseLeaveChart:K6,setActiveClickItemIndex:nke,setMouseOverAxisIndex:H6,setMouseClickAxisIndex:kve,setSyncInteraction:of,setKeyboardInteraction:sy}=q6.actions,Cve=q6.reducer;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 Om(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){_ve(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 _ve(e,t,n){return(t=Ave(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ave(e){var t=Ove(e,"string");return typeof t=="symbol"?t:t+""}function Ove(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 Eve(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Tve(e){return e.index!=null}var G6=(e,t,n,r)=>{if(t==null)return Ws;var i=Eve(e,t,n);if(i==null)return Ws;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(Tve(i)){if(a)return Om(Om({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Om(Om({},Ws),{},{coordinate:i.coordinate})};function Pve(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 zve(e,t){var n=Pve(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),o=Math.max(r,i);return n>=a&&n<=o}function Rve(e,t,n){if(n==null||t==null)return!0;var r=$n(e,t);return r==null||!ha(n)?!0:zve(r,n)}var yf=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!nt(a))return i;var o=0,c=1/0;t.length>0&&(c=t.length-1);var d=Math.max(o,Math.min(a,c)),f=t[d];return f==null||Rve(f,n,r)?String(d):null},V6=(e,t,n,r,i,a,o)=>{if(a!=null){var c=o[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}}},Z6=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(o=>{var c;return((c=o.settings)===null||c===void 0?void 0:c.graphicalItemId)===i})},Y6=e=>e.options.tooltipPayloadSearcher,Ku=e=>e.tooltip;function MM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function DM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MM(Object(n),!0).forEach(function(r){Mve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mve(e,t,n){return(t=Dve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dve(e){var t=Ive(e,"string");return typeof t=="symbol"?t:t+""}function Ive(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 Lve(e){if(typeof e=="string"||typeof e=="number")return e}function $ve(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Uve(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function IM(e){if(typeof e=="string")return e}function Bve(e){if(!(e==null||typeof e!="object")){var t="name"in e?Lve(e.name):void 0,n="unit"in e?$ve(e.unit):void 0,r="dataKey"in e?Uve(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?IM(e.color):void 0,o="fill"in e?IM(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function Fve(e,t){return e??t}var W6=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:c,computedData:d,dataStartIndex:f,dataEndIndex:p}=n,m=[];return e.reduce((y,v)=>{var x,{dataDefinedOnItem:w,settings:j}=v,k=Fve(w,c),O=Array.isArray(k)?C4(k,f,p):k,_=(x=j?.dataKey)!==null&&x!==void 0?x:r,C=j?.nameKey,P;if(r&&Array.isArray(O)&&!Array.isArray(O[0])&&o==="axis"?P=E3(O,r,i):P=a(O,t,d,C),Array.isArray(P))P.forEach(A=>{var z,I,q=Bve(A),U=q?.name,L=q?.dataKey,J=q?.payload,ae=DM(DM({},j),{},{name:U,unit:q?.unit,color:(z=q?.color)!==null&&z!==void 0?z:j?.color,fill:(I=q?.fill)!==null&&I!==void 0?I:j?.fill});y.push(Ez({tooltipEntrySettings:ae,dataKey:L,payload:J,value:$n(J,L),name:U==null?void 0:String(U)}))});else{var T;y.push(Ez({tooltipEntrySettings:j,dataKey:_,payload:P,value:$n(P,_),name:(T=$n(P,C))!==null&&T!==void 0?T:j?.name}))}return y},m)}},Yk=le([Mn,r6,ok],JU),qve=le([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Kve=le([Bn,$u],i6),Hl=le([qve,Mn,Kve],s6,{memoizeOptions:{resultEqualityCheck:Cv}}),Hve=le([Hl],e=>e.filter(pk)),Q6=le([Hl],c6,{memoizeOptions:{resultEqualityCheck:Cv}}),Gve=le([Hl],e=>e.some(t=>!t.data)),zl=le([Q6,Xi],d6),Vve=le([Hve,Xi,Mn],vU),Wk=le([zl,Mn,Hl,Xi,Gve,Q6],f6),X6=le([Mn],Fk),Zve=le([Mn],e=>e.allowDataOverflow),J6=le([X6,Zve],eU),Yve=le([Hl],e=>e.filter(pk)),Wve=le([Vve,Yve,xv,dU],p6),Qve=le([Wve,Xi,Bn,J6],g6),Xve=le([Hl],l6),Jve=le([zl,Mn,Xve,qk,Bn,vpe],b6,{memoizeOptions:{resultEqualityCheck:kv}}),e0e=le([x6,Bn,$u],Fu),t0e=le([e0e,Bn],j6),n0e=le([w6,Bn,$u],Fu),r0e=le([n0e,Bn],N6),i0e=le([S6,Bn,$u],Fu),a0e=le([i0e,Bn],k6),s0e=le([t0e,a0e,r0e],ay),o0e=le([Mn,X6,J6,Qve,Jve,s0e,tn,Bn],C6),ju=le([Mn,tn,zl,Wk,xv,Bn,o0e],_6),l0e=le([ju,Mn,Yk],A6),c0e=le([Mn,ju,l0e,Bn],O6),eB=e=>{var t=Bn(e),n=$u(e),r=!1;return xh(e,t,n,r)},tB=le([Mn,eB],wv),u0e=le([Mn,Yk,c0e,tB],$k),nB=le([u0e],mk),d0e=le([tn,Wk,Mn,Bn],M6),f0e=le([tn,Wk,Mn,Bn],P6),h0e=(e,t,n,r,i,a,o,c)=>{if(t){var{type:d}=t,f=Sa(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?bi(i[0]-i[1])*2*m:m,f&&o?o.map((y,v)=>{var x=r.map(y);return nt(x)?{coordinate:x+m,value:y,index:v,offset:m}:null}).filter(Or):r.domain().map((y,v)=>{var x=r.map(y);return nt(x)?{coordinate:x+m,value:a?a[y]:y,index:v,offset:m}:null}).filter(Or)}}},hs=le([tn,Mn,Yk,nB,eB,d0e,f0e,Bn],h0e),Qk=le([$6,U6,vve],(e,t,n)=>B6(n.shared,e,t)),rB=e=>e.tooltip.settings.trigger,Xk=e=>e.tooltip.settings.defaultIndex,Sh=le([Ku,Qk,rB,Xk],G6),Hf=le([Sh,zl,wu,ju],yf),iB=le([hs,Hf],F6),p0e=le([Sh],e=>{if(e)return e.dataKey}),m0e=le([Sh],e=>{if(e)return e.graphicalItemId}),aB=le([Ku,Qk,rB,Xk],Z6),g0e=le([us,ds,tn,Jn,hs,Xk,aB],V6),y0e=le([Sh,g0e],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),v0e=le([Sh],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),b0e=le([aB,Hf,Xi,wu,iB,Y6,Qk],W6),x0e=le([b0e],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});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 $M(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){w0e(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 w0e(e,t,n){return(t=S0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S0e(e){var t=j0e(e,"string");return typeof t=="symbol"?t:t+""}function j0e(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 N0e=()=>Fe(Mn),k0e=()=>{var e=N0e(),t=Fe(hs),n=Fe(nB);return Dg(!e||!n?void 0:$M($M({},e),{},{scale:n}),t)};function UM(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 Lc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UM(Object(n),!0).forEach(function(r){C0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function C0e(e,t,n){return(t=_0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _0e(e){var t=A0e(e,"string");return typeof t=="symbol"?t:t+""}function A0e(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 O0e=(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}},E0e=(e,t,n,r)=>{var i=t.find(f=>f&&f.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:o}=r;return Lc(Lc(Lc({},r),Qn(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var c=i.coordinate,{angle:d}=r;return Lc(Lc(Lc({},r),Qn(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 T0e(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 sB=(e,t,n,r,i)=>{var a,o=(a=t?.length)!==null&&a!==void 0?a:0;if(o<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var c=0;c<o;c++){var d,f,p,m,y,v=c>0?(d=n[c-1])===null||d===void 0?void 0:d.coordinate:(f=n[o-1])===null||f===void 0?void 0:f.coordinate,x=(p=n[c])===null||p===void 0?void 0:p.coordinate,w=c>=o-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||x==null||w==null))if(bi(x-v)!==bi(w-x)){var k=[];if(bi(w-x)===bi(i[1]-i[0])){j=w;var O=x+i[1]-i[0];k[0]=Math.min(O,(O+v)/2),k[1]=Math.max(O,(O+v)/2)}else{j=v;var _=w+i[1]-i[0];k[0]=Math.min(x,(_+x)/2),k[1]=Math.max(x,(_+x)/2)}var C=[Math.min(x,(j+x)/2),Math.max(x,(j+x)/2)];if(e>C[0]&&e<=C[1]||e>=k[0]&&e<=k[1]){var P;return(P=n[c])===null||P===void 0?void 0:P.index}}else{var T=Math.min(v,w),A=Math.max(v,w);if(e>(T+x)/2&&e<=(A+x)/2){var z;return(z=n[c])===null||z===void 0?void 0:z.index}}}else if(t)for(var I=0;I<o;I++){var q=t[I];if(q!=null){var U=t[I+1],L=t[I-1];if(I===0&&U!=null&&e<=(q.coordinate+U.coordinate)/2||I===o-1&&L!=null&&e>(q.coordinate+L.coordinate)/2||I>0&&I<o-1&&L!=null&&U!=null&&e>(q.coordinate+L.coordinate)/2&&e<=(q.coordinate+U.coordinate)/2)return q.index}}return-1},oB=()=>Fe(ok),Jk=(e,t)=>t,lB=(e,t,n)=>n,eC=(e,t,n,r)=>r,P0e=le(hs,e=>nv(e,t=>t.coordinate)),tC=le([Ku,Jk,lB,eC],G6),nC=le([tC,zl,wu,ju],yf),z0e=(e,t,n)=>{if(t!=null){var r=Ku(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},cB=le([Ku,Jk,lB,eC],Z6),oy=le([us,ds,tn,Jn,hs,eC,cB],V6),R0e=le([tC,oy],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),uB=le([hs,nC],F6),M0e=le([cB,nC,Xi,wu,uB,Y6,Jk],W6),D0e=le([tC,nC],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),I0e=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&T0e(e,o)){var c=cde(e,t),d=sB(c,a,i,n,r),f=O0e(t,i,d,e);return{activeIndex:String(d),activeCoordinate:f}}},L0e=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var c=ape(e,n);if(c){var d=ude(c,t),f=sB(d,o,a,r,i),p=E0e(t,a,f,c);return{activeIndex:String(f),activeCoordinate:p}}}},$0e=(e,t,n,r,i,a,o,c)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?I0e(e,t,r,i,a,o,c):L0e(e,t,n,r,i,a,o)},U0e=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}}),B0e=le(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(ar)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:Ppe}});function BM(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 FM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BM(Object(n),!0).forEach(function(r){F0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function F0e(e,t,n){return(t=q0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q0e(e){var t=K0e(e,"string");return typeof t=="symbol"?t:t+""}function K0e(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 H0e={},G0e={zIndexMap:Object.values(ar).reduce((e,t)=>FM(FM({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),H0e)},V0e=new Set(Object.values(ar));function Z0e(e){return V0e.has(e)}var dB=or({name:"zIndex",initialState:G0e,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:Zt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!Z0e(n)&&delete e.zIndexMap[n])},prepare:Zt()},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:Zt()},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:Zt()}}}),{registerZIndexPortal:Y0e,unregisterZIndexPortal:oS,registerZIndexPortalElement:W0e,unregisterZIndexPortalElement:Q0e}=dB.actions,X0e=dB.reducer;function ka(e){var{zIndex:t,children:n}=e,r=qde(),i=r&&t!==void 0&&t!==0,a=yr(),o=S.useRef(void 0),c=S.useRef(new Set),d=ln(),f=Fe(m=>U0e(m,t,a));if(S.useLayoutEffect(()=>{if(!i){var m=c.current;m.forEach(v=>{d(oS({zIndex:v}))}),m.clear(),o.current=void 0;return}if(c.current.has(t)||(d(Y0e({zIndex:t})),c.current.add(t)),f){o.current=f;var y=c.current;y.forEach(v=>{v!==t&&(d(oS({zIndex:v})),y.delete(v))})}},[d,t,i,f]),S.useLayoutEffect(()=>{var m=c.current;return()=>{m.forEach(y=>{d(oS({zIndex:y}))}),m.clear()}},[d]),!i)return n;var p=f??o.current;return p?Dl.createPortal(n,p):null}function Q1(){return Q1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q1.apply(null,arguments)}function 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 Em(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){J0e(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 J0e(e,t,n){return(t=ebe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ebe(e){var t=tbe(e,"string");return typeof t=="symbol"?t:t+""}function tbe(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 nbe(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return S.isValidElement(t)?S.cloneElement(t,r):S.createElement(n,r)}function rbe(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:o,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 x,w,j;if(p==="ScatterChart")x=m,w=yhe,j=ar.cursorLine;else if(p==="BarChart")x=vhe(c,m,a,o),w=Yhe,j=ar.cursorRectangle;else if(c==="radial"&&z3(m)){var{cx:k,cy:O,radius:_,startAngle:C,endAngle:P}=Q4(m);x={cx:k,cy:O,startAngle:C,endAngle:P,innerRadius:_,outerRadius:_},w=cpe,j=ar.cursorLine}else x={points:upe(c,m,a)},w=Zm,j=ar.cursorLine;var T=typeof d=="object"&&"className"in d?d.className:void 0,A=Em(Em(Em(Em({stroke:"#ccc",pointerEvents:"none"},a),x),Qy(d)),{},{payload:y,payloadIndex:v,className:Ct("recharts-tooltip-cursor",T)});return S.createElement(ka,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:j},S.createElement(nbe,{cursor:d,cursorComp:w,cursorProps:A}))}function ibe(e){var t=k0e(),n=M4(),r=Du(),i=oB();return t==null||n==null||r==null||i==null?null:S.createElement(rbe,Q1({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var fB=S.createContext(null),abe=()=>S.useContext(fB),lS={exports:{}},KM;function sbe(){return KM||(KM=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),x=n?n+f:f;return d._events[x]?d._events[x].fn?d._events[x]=[d._events[x],v]:d._events[x].push(v):(d._events[x]=v,d._eventsCount++),d}function o(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,x=new Array(v);y<v;y++)x[y]=m[y].fn;return x},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,x){var w=n?n+f:f;if(!this._events[w])return!1;var j=this._events[w],k=arguments.length,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,x),!0}for(_=1,O=new Array(k-1);_<k;_++)O[_-1]=arguments[_];j.fn.apply(j.context,O)}else{var C=j.length,P;for(_=0;_<C;_++)switch(j[_].once&&this.removeListener(f,j[_].fn,void 0,!0),k){case 1:j[_].fn.call(j[_].context);break;case 2:j[_].fn.call(j[_].context,p);break;case 3:j[_].fn.call(j[_].context,p,m);break;case 4:j[_].fn.call(j[_].context,p,m,y);break;default:if(!O)for(P=1,O=new Array(k-1);P<k;P++)O[P-1]=arguments[P];j[_].fn.apply(j[_].context,O)}}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 o(this,v),this;var x=this._events[v];if(x.fn)x.fn===p&&(!y||x.once)&&(!m||x.context===m)&&o(this,v);else{for(var w=0,j=[],k=x.length;w<k;w++)(x[w].fn!==p||y&&!x[w].once||m&&x[w].context!==m)&&j.push(x[w]);j.length?this._events[v]=j.length===1?j[0]:j:o(this,v)}return this},c.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&o(this,p)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(lS)),lS.exports}var obe=sbe();const lbe=wa(obe);var Gf=new lbe,X1="recharts.syncEvent.tooltip",HM="recharts.syncEvent.brush",cbe=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!ya(n))return e[n]}},ube={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},hB=or({name:"options",initialState:ube,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),dbe=hB.reducer,{createEventEmitter:fbe}=hB.actions;function hbe(e){return e.tooltip.syncInteraction}var pbe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},pB=or({name:"chartData",initialState:pbe,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:GM,setDataStartEndIndexes:mbe,setComputedData:rke}=pB.actions,gbe=pB.reducer,ybe=["x","y"];function VM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $c(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VM(Object(n),!0).forEach(function(r){vbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vbe(e,t,n){return(t=bbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bbe(e){var t=xbe(e,"string");return typeof t=="symbol"?t:t+""}function xbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wbe(e,t){if(e==null)return{};var n,r,i=Sbe(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 Sbe(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 jbe(){var e=Fe(lk),t=Fe(ck),n=ln(),r=Fe(fU),i=Fe(hs),a=Du(),o=ch(),c=Fe(d=>d.rootProps.className);S.useEffect(()=>{if(e==null)return Mu;var d=(f,p,m)=>{if(t!==m&&e===f){if(p.payload.active===!1){n(of({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var y;if(o&&p!==null&&p!==void 0&&(y=p.payload)!==null&&y!==void 0&&y.coordinate&&p.payload.sourceViewBox){var v=p.payload.coordinate,{x,y:w}=v,j=wbe(v,ybe),{x:k,y:O,width:_,height:C}=p.payload.sourceViewBox,P=$c($c({},j),{},{x:o.x+(_?(x-k)/_:0)*o.width,y:o.y+(C?(w-O)/C:0)*o.height});n($c($c({},p),{},{payload:$c($c({},p.payload),{},{coordinate:P})}))}else n(p);return}if(i!=null){var T;if(typeof r=="function"){var A={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},z=r(i,A);T=i[z]}else r==="value"&&(T=i.find(K=>String(K.value)===p.payload.label));var{coordinate:I}=p.payload;if(I==null||o==null){n(of({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(T==null){n(of({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:q,y:U}=I,L=Math.min(q,o.x+o.width),J=Math.min(U,o.y+o.height),ae={x:a==="horizontal"?T.coordinate:L,y:a==="horizontal"?J:T.coordinate},Q=of({active:p.payload.active,coordinate:ae,dataKey:p.payload.dataKey,index:String(T.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(Q)}}};return Gf.on(X1,d),()=>{Gf.off(X1,d)}},[c,n,t,e,r,i,a,o])}function Nbe(){var e=Fe(lk),t=Fe(ck),n=ln();S.useEffect(()=>{if(e==null)return Mu;var r=(i,a,o)=>{t!==o&&e===i&&n(mbe(a))};return Gf.on(HM,r),()=>{Gf.off(HM,r)}},[n,t,e])}function kbe(){var e=ln();S.useEffect(()=>{e(fbe())},[e]),jbe(),Nbe()}function Cbe(e,t,n,r,i,a){var o=Fe(x=>z0e(x,e,t)),c=Fe(m0e),d=Fe(ck),f=Fe(lk),p=Fe(fU),m=Fe(hbe),y=m?.sourceViewBox!=null,v=ch();S.useEffect(()=>{if(!y&&f!=null&&d!=null){var x=of({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:c});Gf.emit(X1,f,x,d)}},[y,n,o,c,i,r,d,f,p,a,v])}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 YM(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){_be(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 _be(e,t,n){return(t=Abe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Abe(e){var t=Obe(e,"string");return typeof t=="symbol"?t:t+""}function Obe(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 Ebe(e){return e.dataKey}function Tbe(e,t){return S.isValidElement(e)?S.cloneElement(e,t):typeof e=="function"?S.createElement(e,t):S.createElement(Gfe,t)}var WM=[],Pbe={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 J1(e){var t,n,r=gr(e,Pbe),{active:i,allowEscapeViewBox:a,animationDuration:o,animationEasing:c,content:d,filterNull:f,isAnimationActive:p,offset:m,payloadUniqBy:y,position:v,reverseDirection:x,useTranslate3d:w,wrapperStyle:j,cursor:k,shared:O,trigger:_,defaultIndex:C,portal:P,axisId:T}=r,A=ln(),z=typeof C=="number"?String(C):C;S.useEffect(()=>{A(jve({shared:O,trigger:_,axisId:T,active:i,defaultIndex:z}))},[A,O,_,T,i,z]);var I=ch(),q=H4(),U=yve(O),{activeIndex:L,isActive:J}=(t=Fe(je=>D0e(je,U,_,z)))!==null&&t!==void 0?t:{},ae=Fe(je=>M0e(je,U,_,z)),Q=Fe(je=>uB(je,U,_,z)),K=Fe(je=>R0e(je,U,_,z)),X=ae,ye=abe(),Se=(n=i??J)!==null&&n!==void 0?n:!1,[R,F]=W3([X,Se]),B=U==="axis"?Q:void 0;Cbe(U,_,K,B,L,Se);var M=P??ye;if(M==null||I==null||U==null)return null;var V=X??WM;Se||(V=WM),f&&V.length&&(V=H3(V.filter(je=>je.value!=null&&(je.hide!==!0||r.includeHidden)),y,Ebe));var se=V.length>0,ie=YM(YM({},r),{},{payload:V,label:B,active:Se,activeIndex:L,coordinate:K,accessibilityLayer:q}),he=S.createElement(rhe,{allowEscapeViewBox:a,animationDuration:o,animationEasing:c,isAnimationActive:p,active:Se,coordinate:K,hasPayload:se,offset:m,position:v,reverseDirection:x,useTranslate3d:w,viewBox:I,wrapperStyle:j,lastBoundingBox:R,innerRef:F,hasPortalFromProps:!!P},Tbe(d,ie));return S.createElement(S.Fragment,null,Dl.createPortal(he,M),Se&&S.createElement(ibe,{cursor:k,tooltipEventType:U,coordinate:K,payload:V,index:L}))}function zbe(e,t,n){return(t=Rbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rbe(e){var t=Mbe(e,"string");return typeof t=="symbol"?t:t+""}function Mbe(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 Dbe{constructor(t){zbe(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 Ibe(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){Lbe(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 Lbe(e,t,n){return(t=$be(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $be(e){var t=Ube(e,"string");return typeof t=="symbol"?t:t+""}function Ube(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 Bbe={cacheSize:2e3,enableCache:!0},mB=Ibe({},Bbe),XM=new Dbe(mB.cacheSize),Fbe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},JM="recharts_measurement_span";function qbe(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",o=t.letterSpacing||"",c=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(o,"|").concat(c)}var eD=(e,t)=>{try{var n=document.getElementById(JM);n||(n=document.createElement("span"),n.setAttribute("id",JM),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Fbe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},vf=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||hh.isSsr)return{width:0,height:0};if(!mB.enableCache)return eD(t,n);var r=qbe(t,n),i=XM.get(r);if(i)return i;var a=eD(t,n);return XM.set(r,a),a},gB;function Kbe(e,t,n){return(t=Hbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hbe(e){var t=Gbe(e,"string");return typeof t=="symbol"?t:t+""}function Gbe(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 tD=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,nD=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Vbe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Zbe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Ybe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Wbe=["cm","mm","pt","pc","in","Q","px"];function Qbe(e){return Wbe.includes(e)}var Wc="NaN";function Xbe(e,t){return e*Ybe[t]}class Yn{static parse(t){var n,[,r,i]=(n=Zbe.exec(t))!==null&&n!==void 0?n:[];return r==null?Yn.NaN:new Yn(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,ya(t)&&(this.unit=""),n!==""&&!Vbe.test(n)&&(this.num=NaN,this.unit=""),Qbe(n)&&(this.num=Xbe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Yn(NaN,""):new Yn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Yn(NaN,""):new Yn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Yn(NaN,""):new Yn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Yn(NaN,""):new Yn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return ya(this.num)}}gB=Yn;Kbe(Yn,"NaN",new gB(NaN,""));function yB(e){if(e==null||e.includes(Wc))return Wc;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=tD.exec(t))!==null&&n!==void 0?n:[],o=Yn.parse(r??""),c=Yn.parse(a??""),d=i==="*"?o.multiply(c):o.divide(c);if(d.isNaN())return Wc;t=t.replace(tD,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,p,m,y]=(f=nD.exec(t))!==null&&f!==void 0?f:[],v=Yn.parse(p??""),x=Yn.parse(y??""),w=m==="+"?v.add(x):v.subtract(x);if(w.isNaN())return Wc;t=t.replace(nD,w.toString())}return t}var rD=/\(([^()]*)\)/;function Jbe(e){for(var t=e,n;(n=rD.exec(t))!=null;){var[,r]=n;t=t.replace(rD,yB(r))}return t}function exe(e){var t=e.replace(/\s+/g,"");return t=Jbe(t),t=yB(t),t}function txe(e){try{return exe(e)}catch{return Wc}}function cS(e){var t=txe(e.slice(5,-1));return t===Wc?"":t}var nxe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],rxe=["dx","dy","angle","className","breakAll"];function ej(){return ej=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},ej.apply(null,arguments)}function iD(e,t){if(e==null)return{};var n,r,i=ixe(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 ixe(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 vB=/[ \f\n\r\t\v\u2028\u2029]+/,bB=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Xn(t)||(n?i=t.toString().split(""):i=t.toString().split(vB));var a=i.map(c=>({word:c,width:vf(c,r).width})),o=n?0:vf(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function xB(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function axe(e){return Xn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var wB=(e,t,n,r)=>e.reduce((i,a)=>{var{word:o,width:c}=a,d=i[i.length-1];if(d&&c!=null&&(t==null||r||d.width+c+n<Number(t)))d.words.push(o),d.width+=c+n;else{var f={words:[o],width:c};i.push(f)}return i},[]),SB=e=>e.reduce((t,n)=>t.width>n.width?t:n),sxe="…",aD=(e,t,n,r,i,a,o,c)=>{var d=e.slice(0,t),f=bB({breakAll:n,style:r,children:d+sxe});if(!f)return[!1,[]];var p=wB(f.wordsWithComputedWidth,a,o,c),m=p.length>i||SB(p).width>Number(a);return[m,p]},oxe=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:c,breakAll:d}=e,f=Ue(a),p=String(o),m=wB(t,r,n,i);if(!f||i)return m;var y=m.length>a||SB(m).width>Number(r);if(!y)return m;for(var v=0,x=p.length-1,w=0,j;v<=x&&w<=p.length-1;){var k=Math.floor((v+x)/2),O=k-1,[_,C]=aD(p,O,d,c,a,r,n,i),[P]=aD(p,k,d,c,a,r,n,i);if(!_&&!P&&(v=k+1),_&&P&&(x=k-1),!_&&P){j=C;break}w++}return j||m},sD=e=>{var t=Xn(e)?[]:e.toString().split(vB);return[{words:t,width:void 0}]},lxe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!hh.isSsr){var c,d,f=bB({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:p,spaceWidth:m}=f;c=p,d=m}else return sD(r);return oxe({breakAll:a,children:r,maxLines:o,style:i},c,d,t,!!n)}return sD(r)},jB="#808080",cxe={angle:0,breakAll:!1,capHeight:"0.71em",fill:jB,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},rC=S.forwardRef((e,t)=>{var n=gr(e,cxe),{x:r,y:i,lineHeight:a,capHeight:o,fill:c,scaleToFit:d,textAnchor:f,verticalAnchor:p}=n,m=iD(n,nxe),y=S.useMemo(()=>lxe({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:x,angle:w,className:j,breakAll:k}=m,O=iD(m,rxe);if(!Ni(r)||!Ni(i)||y.length===0)return null;var _=Number(r)+(Ue(v)?v:0),C=Number(i)+(Ue(x)?x:0);if(!nt(_)||!nt(C))return null;var P;switch(p){case"start":P=cS("calc(".concat(o,")"));break;case"middle":P=cS("calc(".concat((y.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:P=cS("calc(".concat(y.length-1," * -").concat(a,")"));break}var T=[],A=y[0];if(d&&A!=null){var z=A.width,{width:I}=m;T.push("scale(".concat(Ue(I)&&Ue(z)?I/z:1,")"))}return w&&T.push("rotate(".concat(w,", ").concat(_,", ").concat(C,")")),T.length&&(O.transform=T.join(" ")),S.createElement("text",ej({},zr(O),{ref:t,x:_,y:C,className:Ct("recharts-text",j),textAnchor:f,fill:c.includes("url")?jB:c}),y.map((q,U)=>{var L=q.words.join(k?"":" ");return S.createElement("tspan",{x:_,dy:U===0?P:a,key:"".concat(L,"-").concat(U)},L)}))});rC.displayName="Text";function oD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function aa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oD(Object(n),!0).forEach(function(r){uxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uxe(e,t,n){return(t=dxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dxe(e){var t=fxe(e,"string");return typeof t=="symbol"?t:t+""}function fxe(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 hxe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:c,upperWidth:d,lowerWidth:f}=QN(t),p=a,m=a+(d-f)/2,y=(p+m)/2,v=(d+f)/2,x=p+d/2,w=c>=0?1:-1,j=w*r,k=w>0?"end":"start",O=w>0?"start":"end",_=d>=0?1:-1,C=_*r,P=_>0?"end":"start",T=_>0?"start":"end",A=i;if(n==="top"){var z={x:p+d/2,y:o-j,horizontalAnchor:"middle",verticalAnchor:k};return A&&(z.height=Math.max(o-A.y,0),z.width=d),z}if(n==="bottom"){var I={x:m+f/2,y:o+c+j,horizontalAnchor:"middle",verticalAnchor:O};return A&&(I.height=Math.max(A.y+A.height-(o+c),0),I.width=f),I}if(n==="left"){var q={x:y-C,y:o+c/2,horizontalAnchor:P,verticalAnchor:"middle"};return A&&(q.width=Math.max(q.x-A.x,0),q.height=c),q}if(n==="right"){var U={x:y+v+C,y:o+c/2,horizontalAnchor:T,verticalAnchor:"middle"};return A&&(U.width=Math.max(A.x+A.width-U.x,0),U.height=c),U}var L=A?{width:v,height:c}:{};return n==="insideLeft"?aa({x:y+C,y:o+c/2,horizontalAnchor:T,verticalAnchor:"middle"},L):n==="insideRight"?aa({x:y+v-C,y:o+c/2,horizontalAnchor:P,verticalAnchor:"middle"},L):n==="insideTop"?aa({x:p+d/2,y:o+j,horizontalAnchor:"middle",verticalAnchor:O},L):n==="insideBottom"?aa({x:m+f/2,y:o+c-j,horizontalAnchor:"middle",verticalAnchor:k},L):n==="insideTopLeft"?aa({x:p+C,y:o+j,horizontalAnchor:T,verticalAnchor:O},L):n==="insideTopRight"?aa({x:p+d-C,y:o+j,horizontalAnchor:P,verticalAnchor:O},L):n==="insideBottomLeft"?aa({x:m+C,y:o+c-j,horizontalAnchor:T,verticalAnchor:k},L):n==="insideBottomRight"?aa({x:m+f-C,y:o+c-j,horizontalAnchor:P,verticalAnchor:k},L):n&&typeof n=="object"&&(Ue(n.x)||Al(n.x))&&(Ue(n.y)||Al(n.y))?aa({x:a+po(n.x,v),y:o+po(n.y,c),horizontalAnchor:"end",verticalAnchor:"end"},L):aa({x,y:o+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},L)},pxe=["labelRef"],mxe=["content"];function lD(e,t){if(e==null)return{};var n,r,i=gxe(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 gxe(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 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 lf(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){yxe(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 yxe(e,t,n){return(t=vxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vxe(e){var t=bxe(e,"string");return typeof t=="symbol"?t:t+""}function bxe(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 Wa(){return Wa=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},Wa.apply(null,arguments)}var NB=S.createContext(null),kB=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:c}=e,d=S.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return S.createElement(NB.Provider,{value:d},c)},CB=()=>{var e=S.useContext(NB),t=ch();return e||(t?QN(t):void 0)},xxe=S.createContext(null),wxe=()=>{var e=S.useContext(xxe),t=Fe(yU);return e||t},Sxe=e=>{var{value:t,formatter:n}=e,r=Xn(e.children)?t:e.children;return typeof n=="function"?n(r):r},iC=e=>e!=null&&typeof e=="function",jxe=(e,t)=>{var n=bi(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Nxe=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:c,cy:d,innerRadius:f,outerRadius:p,startAngle:m,endAngle:y,clockWise:v}=i,x=(f+p)/2,w=jxe(m,y),j=w>=0?1:-1,k,O;switch(t){case"insideStart":k=m+j*a,O=v;break;case"insideEnd":k=y-j*a,O=!v;break;case"end":k=y+j*a,O=v;break;default:throw new Error("Unsupported position ".concat(t))}O=w<=0?O:!O;var _=Qn(c,d,x,k),C=Qn(c,d,x,k+(O?1:-1)*359),P="M".concat(_.x,",").concat(_.y,`
|
|
287
|
-
A`).concat(x,",").concat(x,",0,1,").concat(O?0:1,`,
|
|
288
|
-
`).concat(C.x,",").concat(C.y),T=Xn(e.id)?Pf("recharts-radial-line-"):e.id;return S.createElement("text",Wa({},r,{dominantBaseline:"central",className:Ct("recharts-radial-bar-label",o)}),S.createElement("defs",null,S.createElement("path",{id:T,d:P})),S.createElement("textPath",{xlinkHref:"#".concat(T)},n))},kxe=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:c,endAngle:d}=e,f=(c+d)/2;if(n==="outside"){var{x:p,y:m}=Qn(r,i,o+t,f);return{x:p,y:m,textAnchor:p>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var y=(a+o)/2,{x:v,y:x}=Qn(r,i,y,f);return{x:v,y:x,textAnchor:"middle",verticalAnchor:"middle"}},Ym=e=>e!=null&&"cx"in e&&Ue(e.cx),Cxe={angle:0,offset:5,zIndex:ar.label,position:"middle",textBreakAll:!1};function _xe(e){if(!Ym(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function Ys(e){var t=gr(e,Cxe),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:c,className:d="",textBreakAll:f,labelRef:p}=t,m=wxe(),y=CB(),v=i==="center"?y:m??y,x,w,j;n==null?x=v:Ym(n)?x=n:x=QN(n);var k=_xe(x);if(!x||Xn(a)&&Xn(o)&&!S.isValidElement(c)&&typeof c!="function")return null;var O=lf(lf({},t),{},{viewBox:x});if(S.isValidElement(c)){var{labelRef:_}=O,C=lD(O,pxe);return S.cloneElement(c,C)}if(typeof c=="function"){var{content:P}=O,T=lD(O,mxe);if(w=S.createElement(c,T),S.isValidElement(w))return w}else w=Sxe(t);var A=zr(t);if(Ym(x)){if(i==="insideStart"||i==="insideEnd"||i==="end")return Nxe(t,i,w,A,x);j=kxe(x,t.offset,t.position)}else{if(!k)return null;var z=hxe({viewBox:k,position:i,offset:t.offset,parentViewBox:Ym(r)?void 0:r});j=lf(lf({x:z.x,y:z.y,textAnchor:z.horizontalAnchor,verticalAnchor:z.verticalAnchor},z.width!==void 0?{width:z.width}:{}),z.height!==void 0?{height:z.height}:{})}return S.createElement(ka,{zIndex:t.zIndex},S.createElement(rC,Wa({ref:p,className:Ct("recharts-label",d)},A,j,{textAnchor:xB(A.textAnchor)?A.textAnchor:j.textAnchor,breakAll:f}),w))}Ys.displayName="Label";var Axe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?S.createElement(Ys,Wa({key:"label-implicit"},r)):Ni(e)?S.createElement(Ys,Wa({key:"label-implicit",value:e},r)):S.isValidElement(e)?e.type===Ys?S.cloneElement(e,lf({key:"label-implicit"},r)):S.createElement(Ys,Wa({key:"label-implicit",content:e},r)):iC(e)?S.createElement(Ys,Wa({key:"label-implicit",content:e},r)):e&&typeof e=="object"?S.createElement(Ys,Wa({},e,{key:"label-implicit"},r)):null};function _B(e){var{label:t,labelRef:n}=e,r=CB();return Axe(t,r,n)||null}var Oxe=["valueAccessor"],Exe=["dataKey","clockWise","id","textBreakAll","zIndex"];function ly(){return ly=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},ly.apply(null,arguments)}function uD(e,t){if(e==null)return{};var n,r,i=Txe(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 Txe(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 Pxe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(axe(t))return t},AB=S.createContext(void 0),zxe=AB.Provider,OB=S.createContext(void 0);OB.Provider;function Rxe(){return S.useContext(AB)}function Mxe(){return S.useContext(OB)}function Wm(e){var{valueAccessor:t=Pxe}=e,n=uD(e,Oxe),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:c}=n,d=uD(n,Exe),f=Rxe(),p=Mxe(),m=f||p;return!m||!m.length?null:S.createElement(ka,{zIndex:c??ar.label},S.createElement(Vi,{className:"recharts-label-list"},m.map((y,v)=>{var x,w=Xn(r)?t(y,v):$n(y.payload,r),j=Xn(a)?{}:{id:"".concat(a,"-").concat(v)};return S.createElement(Ys,ly({key:"label-".concat(v)},zr(y),d,j,{fill:(x=n.fill)!==null&&x!==void 0?x:y.fill,parentViewBox:y.parentViewBox,value:w,textBreakAll:o,viewBox:y.viewBox,index:v,zIndex:0}))})))}Wm.displayName="LabelList";function Dxe(e){var{label:t}=e;return t?t===!0?S.createElement(Wm,{key:"labelList-implicit"}):S.isValidElement(t)||iC(t)?S.createElement(Wm,{key:"labelList-implicit",content:t}):typeof t=="object"?S.createElement(Wm,ly({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function tj(){return tj=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},tj.apply(null,arguments)}var EB=e=>{var{cx:t,cy:n,r,className:i}=e,a=Ct("recharts-dot",i);return Ue(t)&&Ue(n)&&Ue(r)?S.createElement("circle",tj({},Gi(e),BN(e),{className:a,cx:t,cy:n,r})):null},Ixe={radiusAxis:{},angleAxis:{}},TB=or({name:"polarAxis",initialState:Ixe,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:ike,removeRadiusAxis:ake,addAngleAxis:ske,removeAngleAxis:oke}=TB.actions,Lxe=TB.reducer;function $xe(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var PB=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function Uxe(e){var{tooltipEntrySettings:t}=e,n=ln(),r=yr(),i=S.useRef(null);return S.useLayoutEffect(()=>{r||(i.current===null?n(xve(t)):i.current!==t&&n(wve({prev:i.current,next:t})),i.current=t)},[t,n,r]),S.useLayoutEffect(()=>()=>{i.current&&(n(Sve(i.current)),i.current=null)},[n]),null}function Bxe(e){var{legendPayload:t}=e,n=ln(),r=yr(),i=S.useRef(null);return S.useLayoutEffect(()=>{r||(i.current===null?n(rfe(t)):i.current!==t&&n(ife({prev:i.current,next:t})),i.current=t)},[n,r,t]),S.useLayoutEffect(()=>()=>{i.current&&(n(afe(i.current)),i.current=null)},[n]),null}var uS,Fxe=()=>{var[e]=S.useState(()=>Pf("uid-"));return e},qxe=(uS=yy.useId)!==null&&uS!==void 0?uS:Fxe;function Kxe(e,t){var n=qxe();return t||(e?"".concat(e,"-").concat(n):n)}var Hxe=S.createContext(void 0),Gxe=e=>{var{id:t,type:n,children:r}=e,i=Kxe("recharts-".concat(n),t);return S.createElement(Hxe.Provider,{value:i},r(i))},Vxe={cartesianItems:[],polarItems:[]},zB=or({name:"graphicalItems",initialState:Vxe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Zt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=xi(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:Zt()},removeCartesianGraphicalItem:{reducer(e,t){var n=xi(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Zt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Zt()},removePolarGraphicalItem:{reducer(e,t){var n=xi(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Zt()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=xi(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:Zt()}}}),{addCartesianGraphicalItem:Zxe,replaceCartesianGraphicalItem:Yxe,removeCartesianGraphicalItem:Wxe,addPolarGraphicalItem:lke,removePolarGraphicalItem:cke,replacePolarGraphicalItem:uke}=zB.actions,Qxe=zB.reducer,Xxe=e=>{var t=ln(),n=S.useRef(null);return S.useLayoutEffect(()=>{n.current===null?t(Zxe(e)):n.current!==e&&t(Yxe({prev:n.current,next:e})),n.current=e},[t,e]),S.useLayoutEffect(()=>()=>{n.current&&(t(Wxe(n.current)),n.current=null)},[t]),null},Jxe=S.memo(Xxe),ewe=["points"];function dD(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 dS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dD(Object(n),!0).forEach(function(r){twe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function twe(e,t,n){return(t=nwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nwe(e){var t=rwe(e,"string");return typeof t=="symbol"?t:t+""}function rwe(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 cy(){return cy=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},cy.apply(null,arguments)}function iwe(e,t){if(e==null)return{};var n,r,i=awe(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 awe(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 swe(e){var{option:t,dotProps:n,className:r}=e;if(S.isValidElement(t))return S.cloneElement(t,n);if(typeof t=="function")return t(n);var i=Ct(r,typeof t!="boolean"?t.className:""),a=n??{},{points:o}=a,c=iwe(a,ewe);return S.createElement(EB,cy({},c,{className:i}))}function owe(e,t){return e==null?!1:t?!0:e.length===1}function lwe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:c,clipPathId:d,zIndex:f=ar.scatter}=e;if(!owe(t,n))return null;var p=PB(n),m=Hoe(n),y=t.map((x,w)=>{var j,k,O=dS(dS(dS({r:3},o),m),{},{index:w,cx:(j=x.x)!==null&&j!==void 0?j:void 0,cy:(k=x.y)!==null&&k!==void 0?k:void 0,dataKey:a,value:x.value,payload:x.payload,points:t});return S.createElement(swe,{key:"dot-".concat(w),option:n,dotProps:O,className:i})}),v={};return c&&d!=null&&(v.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(d,")")),S.createElement(ka,{zIndex:f},S.createElement(Vi,cy({className:r},v),y))}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){cwe(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 cwe(e,t,n){return(t=uwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uwe(e){var t=dwe(e,"string");return typeof t=="symbol"?t:t+""}function dwe(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 RB=0,fwe={xAxis:{},yAxis:{},zAxis:{}},MB=or({name:"cartesianAxis",initialState:fwe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Zt()},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:Zt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Zt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Zt()},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:Zt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Zt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Zt()},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:Zt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Zt()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,o=i.widthHistory||[];if(o.length===3&&o[0]===o[2]&&r===o[1]&&r!==i.width&&Math.abs(r-((a=o[0])!==null&&a!==void 0?a:0))<=1)return;var c=[...o,r].slice(-3);e.yAxis[n]=hD(hD({},i),{},{width:r,widthHistory:c})}}}}),{addXAxis:hwe,replaceXAxis:pwe,removeXAxis:mwe,addYAxis:gwe,replaceYAxis:ywe,removeYAxis:vwe,addZAxis:dke,replaceZAxis:fke,removeZAxis:hke,updateYAxisWidth:bwe}=MB.actions,xwe=MB.reducer,wwe=le([Jn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Swe=le([wwe,us,ds],(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)}}),aC=()=>Fe(Swe),jwe=()=>Fe(x0e);function pD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pD(Object(n),!0).forEach(function(r){Nwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nwe(e,t,n){return(t=kwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kwe(e){var t=Cwe(e,"string");return typeof t=="symbol"?t:t+""}function Cwe(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 _we=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var 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=fS(fS(fS({},c),Qy(i)),BN(i)),f;return S.isValidElement(i)?f=S.cloneElement(i,d):typeof i=="function"?f=i(d):f=S.createElement(EB,d),S.createElement(Vi,{className:"recharts-active-dot",clipPath:o},f)};function mD(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=ar.activeDot}=e,c=Fe(Hf),d=jwe();if(t==null||d==null)return null;var f=t.find(p=>d.includes(p.payload));return Xn(f)?null:S.createElement(ka,{zIndex:o},S.createElement(_we,{point:f,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var Awe=e=>{var{chartData:t}=e,n=ln(),r=yr();return S.useEffect(()=>r?()=>{}:(n(GM(t)),()=>{n(GM(void 0))}),[t,n,r]),null},gD={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},DB=or({name:"brush",initialState:gD,reducers:{setBrushSettings(e,t){return t.payload==null?gD:t.payload}}}),{setBrushSettings:pke}=DB.actions,Owe=DB.reducer,Ewe=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return{x:Math.min(n,i),y:Math.min(r,a),width:Math.abs(i-n),height:Math.abs(a-r)}},Twe=e=>{var{x1:t,y1:n,x2:r,y2:i}=e;return Ewe({x:t,y:n},{x:r,y:i})};function Pwe(e){return(e%180+180)%180}var zwe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Pwe(i),o=a*Math.PI/180,c=Math.atan(r/n),d=o>c&&o<Math.PI-c?r/Math.sin(o):n/Math.cos(o);return Math.abs(d)},Rwe={dots:[],areas:[],lines:[]},IB=or({name:"referenceElements",initialState:Rwe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=xi(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=xi(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=xi(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:mke,removeDot:gke,addArea:yke,removeArea:vke,addLine:Mwe,removeLine:Dwe}=IB.actions,Iwe=IB.reducer,LB=S.createContext(void 0),Lwe=e=>{var{children:t}=e,[n]=S.useState("".concat(Pf("recharts"),"-clip")),r=aC();if(r==null)return null;var{x:i,y:a,width:o,height:c}=r;return S.createElement(LB.Provider,{value:n},S.createElement("defs",null,S.createElement("clipPath",{id:n},S.createElement("rect",{x:i,y:a,height:c,width:o}))),t)},$we=()=>S.useContext(LB);class Uwe{constructor(t){var{x:n,y:r}=t;this.xAxisScale=n,this.yAxisScale=r}map(t,n){var r,i,{position:a}=n;return{x:(r=this.xAxisScale.map(t.x,{position:a}))!==null&&r!==void 0?r:0,y:(i=this.yAxisScale.map(t.y,{position:a}))!==null&&i!==void 0?i:0}}mapWithFallback(t,n){var r,i,{position:a,fallback:o}=n,c,d;return o==="rangeMin"?c=this.yAxisScale.rangeMin():o==="rangeMax"?c=this.yAxisScale.rangeMax():c=0,o==="rangeMin"?d=this.xAxisScale.rangeMin():o==="rangeMax"?d=this.xAxisScale.rangeMax():d=0,{x:(r=this.xAxisScale.map(t.x,{position:a}))!==null&&r!==void 0?r:d,y:(i=this.yAxisScale.map(t.y,{position:a}))!==null&&i!==void 0?i:c}}isInRange(t){var{x:n,y:r}=t,i=n==null||this.xAxisScale.isInRange(n),a=r==null||this.yAxisScale.isInRange(r);return i&&a}}function yD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yD(Object(n),!0).forEach(function(r){Bwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bwe(e,t,n){return(t=Fwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fwe(e){var t=qwe(e,"string");return typeof t=="symbol"?t:t+""}function qwe(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 uy(){return uy=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},uy.apply(null,arguments)}var Kwe=(e,t)=>{var n;if(S.isValidElement(e))n=S.cloneElement(e,t);else if(typeof e=="function")n=e(t);else{if(!nt(t.x1)||!nt(t.y1)||!nt(t.x2)||!nt(t.y2))return null;n=S.createElement("line",uy({},t,{className:"recharts-reference-line-line"}))}return n},Hwe=(e,t,n,r,i,a)=>{var{x:o,width:c}=a,d=i.map(e,{position:n});if(!nt(d)||t==="discard"&&!i.isInRange(d))return null;var f=[{x:o+c,y:d},{x:o,y:d}];return r==="left"?f.reverse():f},Gwe=(e,t,n,r,i,a)=>{var{y:o,height:c}=a,d=i.map(e,{position:n});if(!nt(d)||t==="discard"&&!i.isInRange(d))return null;var f=[{x:d,y:o+c},{x:d,y:o}];return r==="top"?f.reverse():f},Vwe=(e,t,n,r)=>{var i=[r.mapWithFallback(e[0],{position:n,fallback:"rangeMin"}),r.mapWithFallback(e[1],{position:n,fallback:"rangeMax"})];return t==="discard"&&i.some(a=>!r.isInRange(a))?null:i},Zwe=(e,t,n,r,i,a,o)=>{var{x:c,y:d,segment:f,ifOverflow:p}=o,m=Ni(c),y=Ni(d);return y?Hwe(d,p,r,a,t,n):m?Gwe(c,p,r,i,e,n):f!=null&&f.length===2?Vwe(f,p,r,new Uwe({x:e,y:t})):null};function Ywe(e){var t=ln();return S.useEffect(()=>(t(Mwe(e)),()=>{t(Dwe(e))})),null}function Wwe(e){var{xAxisId:t,yAxisId:n,shape:r,className:i,ifOverflow:a}=e,o=yr(),c=$we(),d=Fe(A=>ja(A,t)),f=Fe(A=>Na(A,n)),p=Fe(A=>Su(A,"xAxis",t,o)),m=Fe(A=>Su(A,"yAxis",n,o)),y=ch();if(!c||!y||d==null||f==null||p==null||m==null)return null;var v=Zwe(p,m,y,e.position,d.orientation,f.orientation,e);if(!v)return null;var x=v[0],w=v[1];if(x==null||w==null)return null;var{x:j,y:k}=x,{x:O,y:_}=w,C=a==="hidden"?"url(#".concat(c,")"):void 0,P=vD(vD({clipPath:C},zr(e)),{},{x1:j,y1:k,x2:O,y2:_}),T=Twe({x1:j,y1:k,x2:O,y2:_});return S.createElement(ka,{zIndex:e.zIndex},S.createElement(Vi,{className:Ct("recharts-reference-line",i)},Kwe(r,P),S.createElement(kB,uy({},T,{lowerWidth:T.width,upperWidth:T.width}),S.createElement(_B,{label:e.label}),e.children)))}var Qwe={ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",label:!1,stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle",zIndex:ar.line};function $B(e){var t=gr(e,Qwe);return S.createElement(S.Fragment,null,S.createElement(Ywe,{yAxisId:t.yAxisId,xAxisId:t.xAxisId,ifOverflow:t.ifOverflow,x:t.x,y:t.y,segment:t.segment}),S.createElement(Wwe,t))}$B.displayName="ReferenceLine";function UB(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 Xwe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return zwe(r,n)}function Jwe(e,t,n){var r=n==="width",{x:i,y:a,width:o,height:c}=e;return t===1?{start:r?i:a,end:r?i+o:a+c}:{start:r?i+o:a+c,end:r?i:a}}function Vf(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 eSe(e,t){return UB(e,t+1)}function tSe(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:c}=t,d=0,f=1,p=o,m=function(){var x=r?.[d];if(x===void 0)return{v:UB(r,f)};var w=d,j,k=()=>(j===void 0&&(j=n(x,w)),j),O=x.coordinate,_=d===0||Vf(e,O,k,p,c);_||(d=0,p=o,f+=1),_&&(p=O+e*(k()/2+i),d+=f)},y;f<=a.length;)if(y=m(),y)return y.v;return[]}function nSe(e,t,n,r,i){var a=(r||[]).slice(),o=a.length;if(o===0)return[];for(var{start:c,end:d}=t,f=1;f<=o;f++){for(var p=(o-1)%f,m=c,y=!0,v=function(){var C=r[w];if(C==null)return 0;var P=w,T,A=()=>(T===void 0&&(T=n(C,P)),T),z=C.coordinate,I=w===p||Vf(e,z,A,m,d);if(!I)return y=!1,1;I&&(m=z+e*(A()/2+i))},x,w=p;w<o&&(x=v(),!(x!==0&&x===1));w+=f);if(y){for(var j=[],k=p;k<o;k+=f){var O=r[k];O!=null&&j.push(O)}return j}}return[]}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 tr(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){rSe(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 rSe(e,t,n){return(t=iSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iSe(e){var t=aSe(e,"string");return typeof t=="symbol"?t:t+""}function aSe(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 sSe(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:c}=t,{end:d}=t,f=function(y){var v=a[y];if(v==null)return 1;var x=v,w,j=()=>(w===void 0&&(w=n(v,y)),w);if(y===o-1){var k=e*(x.coordinate+e*j()/2-d);a[y]=x=tr(tr({},x),{},{tickCoord:k>0?x.coordinate-k*e:x.coordinate})}else a[y]=x=tr(tr({},x),{},{tickCoord:x.coordinate});if(x.tickCoord!=null){var O=Vf(e,x.tickCoord,j,c,d);O&&(d=x.tickCoord-e*(j()/2+i),a[y]=tr(tr({},x),{},{isShow:!0}))}},p=o-1;p>=0;p--)f(p);return a}function oSe(e,t,n,r,i,a){var o=(r||[]).slice(),c=o.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(o[c-1]=p=tr(tr({},p),{},{tickCoord:y>0?p.coordinate-y*e:p.coordinate}),p.tickCoord!=null){var v=Vf(e,p.tickCoord,()=>m,d,f);v&&(f=p.tickCoord-e*(m/2+i),o[c-1]=tr(tr({},p),{},{isShow:!0}))}}}for(var x=a?c-1:c,w=function(O){var _=o[O];if(_==null)return 1;var C=_,P,T=()=>(P===void 0&&(P=n(_,O)),P);if(O===0){var A=e*(C.coordinate-e*T()/2-d);o[O]=C=tr(tr({},C),{},{tickCoord:A<0?C.coordinate-A*e:C.coordinate})}else o[O]=C=tr(tr({},C),{},{tickCoord:C.coordinate});if(C.tickCoord!=null){var z=Vf(e,C.tickCoord,T,d,f);z&&(d=C.tickCoord+e*(T()/2+i),o[O]=tr(tr({},C),{},{isShow:!0}))}},j=0;j<x;j++)w(j);return o}function sC(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:c,interval:d,tickFormatter:f,unit:p,angle:m}=e;if(!i||!i.length||!r)return[];if(Ue(d)||hh.isSsr){var y;return(y=eSe(i,Ue(d)?d:0))!==null&&y!==void 0?y:[]}var v=[],x=c==="top"||c==="bottom"?"width":"height",w=p&&x==="width"?vf(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=(P,T)=>{var A=typeof f=="function"?f(P.value,T):P.value;return x==="width"?Xwe(vf(A,{fontSize:t,letterSpacing:n}),w,m):vf(A,{fontSize:t,letterSpacing:n})[x]},k=i[0],O=i[1],_=i.length>=2&&k!=null&&O!=null?bi(O.coordinate-k.coordinate):1,C=Jwe(a,_,x);return d==="equidistantPreserveStart"?tSe(_,C,j,i,o):d==="equidistantPreserveEnd"?nSe(_,C,j,i,o):(d==="preserveStart"||d==="preserveStartEnd"?v=oSe(_,C,j,i,o,d==="preserveStartEnd"):v=sSe(_,C,j,i,o),v.filter(P=>P.isShow))}var lSe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(p=>{if(p){var m=p.getBoundingClientRect();m.width>o&&(o=m.width)}});var c=n?n.getBoundingClientRect().width:0,d=i+a,f=o+d+c+(n?r:0);return Math.round(f)}return 0},cSe={xAxis:{},yAxis:{}},BB=or({name:"renderedTicks",initialState:cSe,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:uSe,removeRenderedTicks:dSe}=BB.actions,fSe=BB.reducer,hSe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function pSe(e,t){if(e==null)return{};var n,r,i=mSe(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 mSe(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 Rl(){return Rl=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},Rl.apply(null,arguments)}function xD(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 dn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xD(Object(n),!0).forEach(function(r){gSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gSe(e,t,n){return(t=ySe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ySe(e){var t=vSe(e,"string");return typeof t=="symbol"?t:t+""}function vSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rs={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:ar.axis};function bSe(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:c,otherSvgProps:d}=e;if(!c)return null;var f=dn(dn(dn({},d),Gi(c)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!o||a==="bottom"&&o);f=dn(dn({},f),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var m=+(a==="left"&&!o||a==="right"&&o);f=dn(dn({},f),{},{x1:t+m*r,y1:n,x2:t+m*r,y2:n+i})}return S.createElement("line",Rl({},f,{className:Ct("recharts-cartesian-axis-line",tv(c,"className"))}))}function xSe(e,t,n,r,i,a,o,c,d){var f,p,m,y,v,x,w=c?-1:1,j=e.tickSize||o,k=Ue(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=p=e.coordinate,y=n+ +!c*i,m=y-w*j,x=m-w*d,v=k;break;case"left":m=y=e.coordinate,p=t+ +!c*r,f=p-w*j,v=f-w*d,x=k;break;case"right":m=y=e.coordinate,p=t+ +c*r,f=p+w*j,v=f+w*d,x=k;break;default:f=p=e.coordinate,y=n+ +c*i,m=y+w*j,x=m+w*d,v=k;break}return{line:{x1:f,y1:m,x2:p,y2:y},tick:{x:v,y:x}}}function wSe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function SSe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function jSe(e){var{option:t,tickProps:n,value:r}=e,i,a=Ct(n.className,"recharts-cartesian-axis-tick-value");if(S.isValidElement(t))i=S.cloneElement(t,dn(dn({},n),{},{className:a}));else if(typeof t=="function")i=t(dn(dn({},n),{},{className:a}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=Ct(o,$xe(t))),i=S.createElement(rC,Rl({},n,{className:o}),r)}return i}function NSe(e){var{ticks:t,axisType:n,axisId:r}=e,i=ln();return S.useEffect(()=>{if(r==null||n==null)return Mu;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(uSe({ticks:a,axisId:r,axisType:n})),()=>{i(dSe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var kSe=S.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:c,padding:d,tickTextProps:f,orientation:p,mirror:m,x:y,y:v,width:x,height:w,tickSize:j,tickMargin:k,fontSize:O,letterSpacing:_,getTicksConfig:C,events:P,axisType:T,axisId:A}=e,z=sC(dn(dn({},C),{},{ticks:n}),O,_),I=Gi(C),q=Qy(r),U=xB(I.textAnchor)?I.textAnchor:wSe(p,m),L=SSe(p,m),J={};typeof i=="object"&&(J=i);var ae=dn(dn({},I),{},{fill:"none"},J),Q=z.map(ye=>dn({entry:ye},xSe(ye,y,v,x,w,p,j,m,k))),K=Q.map(ye=>{var{entry:Se,line:R}=ye;return S.createElement(Vi,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Se.value,"-").concat(Se.coordinate,"-").concat(Se.tickCoord)},i&&S.createElement("line",Rl({},ae,R,{className:Ct("recharts-cartesian-axis-tick-line",tv(i,"className"))})))}),X=Q.map((ye,Se)=>{var R,F,{entry:B,tick:M}=ye,V=dn(dn(dn(dn({verticalAnchor:L},I),{},{textAnchor:U,stroke:"none",fill:a},M),{},{index:Se,payload:B,visibleTicksCount:z.length,tickFormatter:o,padding:d},f),{},{angle:(R=(F=f?.angle)!==null&&F!==void 0?F:I.angle)!==null&&R!==void 0?R:0}),se=dn(dn({},V),q);return S.createElement(Vi,Rl({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(B.value,"-").concat(B.coordinate,"-").concat(B.tickCoord)},R3(P,B,Se)),r&&S.createElement(jSe,{option:r,tickProps:se,value:"".concat(typeof o=="function"?o(B.value,Se):B.value).concat(c||"")}))});return S.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(T,"-ticks")},S.createElement(NSe,{ticks:z,axisId:A,axisType:T}),X.length>0&&S.createElement(ka,{zIndex:ar.label},S.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(T,"-tick-labels"),ref:t},X)),K.length>0&&S.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(T,"-tick-lines")},K))}),CSe=S.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:c,axisType:d,axisId:f}=e,p=pSe(e,hSe),[m,y]=S.useState(""),[v,x]=S.useState(""),w=S.useRef(null);S.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return lSe({ticks:w.current,label:(k=e.labelRef)===null||k===void 0?void 0:k.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=S.useCallback(k=>{if(k){var O=k.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=O;var _=O[0];if(_){var C=window.getComputedStyle(_),P=C.fontSize,T=C.letterSpacing;(P!==m||T!==v)&&(y(P),x(T))}}},[m,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:S.createElement(ka,{zIndex:e.zIndex},S.createElement(Vi,{className:Ct("recharts-cartesian-axis",a)},S.createElement(bSe,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Gi(e)}),S.createElement(kSe,{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}),S.createElement(kB,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},S.createElement(_B,{label:e.label,labelRef:e.labelRef}),e.children)))}),oC=S.forwardRef((e,t)=>{var n=gr(e,rs);return S.createElement(CSe,Rl({},n,{ref:t}))});oC.displayName="CartesianAxis";var _Se=["x1","y1","x2","y2","key"],ASe=["offset"],OSe=["xAxisId","yAxisId"],ESe=["xAxisId","yAxisId"];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 ir(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){TSe(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 TSe(e,t,n){return(t=PSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PSe(e){var t=zSe(e,"string");return typeof t=="symbol"?t:t+""}function zSe(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 hl(){return hl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hl.apply(null,arguments)}function dy(e,t){if(e==null)return{};var n,r,i=RSe(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 RSe(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 MSe=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:c}=e;return S.createElement("rect",{x:r,y:i,ry:c,width:a,height:o,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function FB(e){var{option:t,lineItemProps:n}=e,r;if(S.isValidElement(t))r=S.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:o,x2:c,y2:d,key:f}=n,p=dy(n,_Se),m=(i=Gi(p))!==null&&i!==void 0?i:{},{offset:y}=m,v=dy(m,ASe);r=S.createElement("line",hl({},v,{x1:a,y1:o,x2:c,y2:d,fill:"none",key:f}))}return r}function DSe(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,c=dy(e,OSe),d=i.map((f,p)=>{var m=ir(ir({},c),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(p),index:p});return S.createElement(FB,{key:"line-".concat(p),option:r,lineItemProps:m})});return S.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function ISe(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,c=dy(e,ESe),d=i.map((f,p)=>{var m=ir(ir({},c),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(p),index:p});return S.createElement(FB,{option:r,lineItemProps:m,key:"line-".concat(p)})});return S.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function LSe(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,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],x=v==null,w=x?i+o-m:v-m;if(w<=0)return null;var j=y%t.length;return S.createElement("rect",{key:"react-".concat(y),y:m,x:r,height:w,width:a,stroke:"none",fill:t[j],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function $Se(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,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],x=v==null,w=x?i+o-m:v-m;if(w<=0)return null;var j=y%n.length;return S.createElement("rect",{key:"react-".concat(y),x:m,y:a,width:w,height:c,stroke:"none",fill:n[j],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var USe=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return _4(sC(ir(ir(ir({},rs),n),{},{ticks:A4(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},BSe=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return _4(sC(ir(ir(ir({},rs),n),{},{ticks:A4(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},FSe={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:ar.grid};function qB(e){var t=XN(),n=JN(),r=M4(),i=ir(ir({},gr(e,FSe)),{},{x:Ue(e.x)?e.x:r.left,y:Ue(e.y)?e.y:r.top,width:Ue(e.width)?e.width:r.width,height:Ue(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:c,y:d,width:f,height:p,syncWithTicks:m,horizontalValues:y,verticalValues:v}=i,x=yr(),w=Fe(I=>zM(I,"xAxis",a,x)),j=Fe(I=>zM(I,"yAxis",o,x));if(!va(f)||!va(p)||!Ue(c)||!Ue(d))return null;var k=i.verticalCoordinatesGenerator||USe,O=i.horizontalCoordinatesGenerator||BSe,{horizontalPoints:_,verticalPoints:C}=i;if((!_||!_.length)&&typeof O=="function"){var P=y&&y.length,T=O({yAxis:j?ir(ir({},j),{},{ticks:P?y:j.ticks}):void 0,width:t??f,height:n??p,offset:r},P?!0:m);Ig(Array.isArray(T),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof T,"]")),Array.isArray(T)&&(_=T)}if((!C||!C.length)&&typeof k=="function"){var A=v&&v.length,z=k({xAxis:w?ir(ir({},w),{},{ticks:A?v:w.ticks}):void 0,width:t??f,height:n??p,offset:r},A?!0:m);Ig(Array.isArray(z),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof z,"]")),Array.isArray(z)&&(C=z)}return S.createElement(ka,{zIndex:i.zIndex},S.createElement("g",{className:"recharts-cartesian-grid"},S.createElement(MSe,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),S.createElement(LSe,hl({},i,{horizontalPoints:_})),S.createElement($Se,hl({},i,{verticalPoints:C})),S.createElement(DSe,hl({},i,{offset:r,horizontalPoints:_,xAxis:w,yAxis:j})),S.createElement(ISe,hl({},i,{offset:r,verticalPoints:C,xAxis:w,yAxis:j}))))}qB.displayName="CartesianGrid";var qSe={},KB=or({name:"errorBars",initialState:qSe,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:bke,replaceErrorBar:xke,removeErrorBar:wke}=KB.actions,KSe=KB.reducer;function HB(e,t){var n,r,i=Fe(f=>ja(f,e)),a=Fe(f=>Na(f,t)),o=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:Tn.allowDataOverflow,c=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Pn.allowDataOverflow,d=o||c;return{needClip:d,needClipX:o,needClipY:c}}function HSe(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=aC(),{needClipX:a,needClipY:o,needClip:c}=HB(t,n);if(!c||!i)return null;var{x:d,y:f,width:p,height:m}=i;return S.createElement("clipPath",{id:"clipPath-".concat(r)},S.createElement("rect",{x:a?d:d-p/2,y:o?f:f-m/2,width:a?p:p*2,height:o?m:m*2}))}function GSe(e){var t=Qy(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),c=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(c)||c<0)&&(c=r),{r:o,strokeWidth:c}}return{r:n,strokeWidth:r}}function lC(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:RB}function cC(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:RB}var GB=(e,t,n)=>L6(e,"xAxis",lC(e,t),n),VB=(e,t,n)=>I6(e,"xAxis",lC(e,t),n),ZB=(e,t,n)=>L6(e,"yAxis",cC(e,t),n),YB=(e,t,n)=>I6(e,"yAxis",cC(e,t),n),VSe=le([tn,GB,ZB,VB,YB],(e,t,n,r,i)=>Sa(e,"xAxis")?Dg(t,r,!1):Dg(n,i,!1)),ZSe=(e,t)=>t,WB=le([a6,ZSe],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),QB=e=>{var t=tn(e),n=Sa(t,"xAxis");return n?"yAxis":"xAxis"},YSe=(e,t)=>{var n=QB(e);return n==="yAxis"?cC(e,t):lC(e,t)},WSe=(e,t,n)=>m6(e,QB(e),YSe(e,t),n),QSe=le([WB,WSe],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=hk(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,o=a?.find(c=>c.key===i);if(o!=null)return o.map(c=>[c[0],c[1]])}}}),XSe=le([tn,GB,ZB,VB,YB,QSe,gpe,VSe,WB,kpe],(e,t,n,r,i,a,o,c,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:y}=o;if(!(d==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||c==null)){var{data:v}=d,x;if(v&&v.length>0?x=v:x=p?.slice(m,y+1),x!=null)return v1e({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:m,areaSettings:d,stackedData:a,displayedData:x,chartBaseValue:f,bandSize:c})}}),JSe=["id"],e1e=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function wl(){return wl=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},wl.apply(null,arguments)}function XB(e,t){if(e==null)return{};var n,r,i=t1e(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 t1e(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 SD(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 Qc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SD(Object(n),!0).forEach(function(r){n1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function n1e(e,t,n){return(t=r1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r1e(e){var t=i1e(e,"string");return typeof t=="symbol"?t:t+""}function i1e(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(e,t){return e&&e!=="none"?e:t}var a1e=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:fy(r,i),value:O4(n,t),payload:e}]},s1e=S.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:c,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:Mu,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:O4(o,t),hide:c,type:f,color:fy(r,a),unit:d,graphicalItemId:p}};return S.createElement(Uxe,{tooltipEntrySettings:m})});function o1e(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,c=Gi(r);return S.createElement(lwe,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:c,needClip:i,clipPathId:t})}function l1e(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var o,c,d={x:(o=a.x)!==null&&o!==void 0?o:0,y:(c=a.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Qc(Qc({},d),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return S.createElement(zxe,{value:t?i:void 0},n)}function jD(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:o,type:c,stroke:d,connectNulls:f,isRange:p}=a,{id:m}=a,y=XB(a,JSe),v=Gi(y),x=zr(y);return S.createElement(S.Fragment,null,t?.length>1&&S.createElement(Vi,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},S.createElement(Zm,wl({},x,{id:m,points:t,connectNulls:f,type:c,baseLine:n,layout:o,stroke:"none",className:"recharts-area-area"})),d!=="none"&&S.createElement(Zm,wl({},v,{className:"recharts-area-curve",layout:o,type:c,connectNulls:f,fill:"none",points:t})),d!=="none"&&p&&Array.isArray(n)&&S.createElement(Zm,wl({},v,{className:"recharts-area-curve",layout:o,type:c,connectNulls:f,fill:"none",points:n}))),S.createElement(o1e,{points:t,props:y,clipPathId:i}))}function c1e(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=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(!nt(c)||!nt(d))return null;var f=r*Math.abs(c-d),p=Math.max(...a.map(m=>m.x||0));return Ue(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.x||0),p)),Ue(p)?S.createElement("rect",{x:0,y:c<d?c:c-f,width:p+(o?parseInt("".concat(o),10):1),height:Math.floor(f)}):null}function u1e(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=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(!nt(c)||!nt(d))return null;var f=r*Math.abs(c-d),p=Math.max(...a.map(m=>m.y||0));return Ue(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.y||0),p)),Ue(p)?S.createElement("rect",{x:c<d?c:c-f,y:0,width:f,height:Math.floor(p+(o?parseInt("".concat(o),10):1))}):null}function d1e(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?S.createElement(c1e,{alpha:t,points:r,baseLine:i,strokeWidth:a}):S.createElement(u1e,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function f1e(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:o,baseLine:c,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,onAnimationStart:y,onAnimationEnd:v}=r,x=S.useMemo(()=>({points:o,baseLine:c}),[o,c]),w=W4(x,"recharts-area-"),j=ek(),[k,O]=S.useState(!1),_=!k,C=S.useCallback(()=>{typeof v=="function"&&v(),O(!1)},[v]),P=S.useCallback(()=>{typeof y=="function"&&y(),O(!0)},[y]);if(j==null)return null;var T=i.current,A=a.current;return S.createElement(l1e,{showLabels:_,points:o},r.children,S.createElement(Y4,{animationId:w,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:C,onAnimationStart:P,key:w},z=>{if(T){var I=T.length/o.length,q=z===1?o:o.map((L,J)=>{var ae=Math.floor(J*I);if(T[ae]){var Q=T[ae];return Qc(Qc({},L),{},{x:la(Q.x,L.x,z),y:la(Q.y,L.y,z)})}return L}),U;return Ue(c)?U=la(A,c,z):Xn(c)||ya(c)?U=la(A,0,z):U=c.map((L,J)=>{var ae=Math.floor(J*I);if(Array.isArray(A)&&A[ae]){var Q=A[ae];return Qc(Qc({},L),{},{x:la(Q.x,L.x,z),y:la(Q.y,L.y,z)})}return L}),z>0&&(i.current=q,a.current=U),S.createElement(jD,{points:q,baseLine:U,needClip:t,clipPathId:n,props:r})}return z>0&&(i.current=o,a.current=c),S.createElement(Vi,null,d&&S.createElement("defs",null,S.createElement("clipPath",{id:"animationClipPath-".concat(n)},S.createElement(d1e,{alpha:z,points:o,baseLine:c,layout:j,strokeWidth:r.strokeWidth}))),S.createElement(Vi,{clipPath:"url(#animationClipPath-".concat(n,")")},S.createElement(jD,{points:o,baseLine:c,needClip:t,clipPathId:n,props:r})))}),S.createElement(Dxe,{label:r.label}))}function h1e(e){var{needClip:t,clipPathId:n,props:r}=e,i=S.useRef(null),a=S.useRef();return S.createElement(f1e,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class p1e extends S.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:o,needClip:c,xAxisId:d,yAxisId:f,width:p,height:m,id:y,baseLine:v,zIndex:x}=this.props;if(t)return null;var w=Ct("recharts-area",i),j=y,{r:k,strokeWidth:O}=GSe(n),_=PB(n),C=k*2+O,P=c?"url(#clipPath-".concat(_?"":"dots-").concat(j,")"):void 0;return S.createElement(ka,{zIndex:x},S.createElement(Vi,{className:w},c&&S.createElement("defs",null,S.createElement(HSe,{clipPathId:j,xAxisId:d,yAxisId:f}),!_&&S.createElement("clipPath",{id:"clipPath-dots-".concat(j)},S.createElement("rect",{x:o-C/2,y:a-C/2,width:p+C,height:m+C}))),S.createElement(h1e,{needClip:c,clipPathId:j,props:this.props})),S.createElement(mD,{points:r,mainColor:fy(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:P}),this.props.isRange&&Array.isArray(v)&&S.createElement(mD,{points:v,mainColor:fy(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:P}))}}var m1e={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:ar.area};function g1e(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:o,dot:c,fill:d,fillOpacity:f,hide:p,isAnimationActive:m,legendType:y,stroke:v,xAxisId:x,yAxisId:w}=e,j=XB(e,e1e),k=Du(),O=oB(),{needClip:_}=HB(x,w),C=yr(),{points:P,isRange:T,baseLine:A}=(t=Fe(J=>XSe(J,e.id,C)))!==null&&t!==void 0?t:{},z=aC();if(k!=="horizontal"&&k!=="vertical"||z==null||O!=="AreaChart"&&O!=="ComposedChart")return null;var{height:I,width:q,x:U,y:L}=z;return!P||!P.length?null:S.createElement(p1e,wl({},j,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:A,connectNulls:o,dot:c,fill:d,fillOpacity:f,height:I,hide:p,layout:k,isAnimationActive:m,isRange:T,legendType:y,needClip:_,points:P,stroke:v,width:q,left:U,top:L,xAxisId:x,yAxisId:w}))}var y1e=(e,t,n,r,i)=>{var a=n??t;if(Ue(a))return a;var o=e==="horizontal"?i:r,c=o.scale.domain();if(o.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 v1e(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:o,xAxis:c,yAxis:d,displayedData:f,dataStartIndex:p,xAxisTicks:m,yAxisTicks:y,bandSize:v}=e,x=i&&i.length,w=y1e(a,o,n,c,d),j=a==="horizontal",k=!1,O=f.map((C,P)=>{var T,A,z,I;if(x)I=i[p+P];else{var q=$n(C,r);Array.isArray(q)?(I=q,k=!0):I=[w,q]}var U=(T=(A=I)===null||A===void 0?void 0:A[1])!==null&&T!==void 0?T:null,L=U==null||x&&!t&&$n(C,r)==null;if(j){var J;return{x:_z({axis:c,ticks:m,bandSize:v,entry:C,index:P}),y:L?null:(J=d.scale.map(U))!==null&&J!==void 0?J:null,value:I,payload:C}}return{x:L?null:(z=c.scale.map(U))!==null&&z!==void 0?z:null,y:_z({axis:d,ticks:y,bandSize:v,entry:C,index:P}),value:I,payload:C}}),_;return x||k?_=O.map(C=>{var P,T=Array.isArray(C.value)?C.value[0]:null;if(j){var A;return{x:C.x,y:T!=null&&C.y!=null&&(A=d.scale.map(T))!==null&&A!==void 0?A:null,payload:C.payload}}return{x:T!=null&&(P=c.scale.map(T))!==null&&P!==void 0?P:null,y:C.y,payload:C.payload}}):_=j?d.scale.map(w):c.scale.map(w),{points:O,baseLine:_??0,isRange:k}}function b1e(e){var t=gr(e,m1e),n=yr();return S.createElement(Gxe,{id:t.id,type:"area"},r=>S.createElement(S.Fragment,null,S.createElement(Bxe,{legendPayload:a1e(t)}),S.createElement(s1e,{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}),S.createElement(Jxe,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:ade(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),S.createElement(g1e,wl({},t,{id:r}))))}var Xc=S.memo(b1e,fh);Xc.displayName="Area";var x1e=["domain","range"],w1e=["domain","range"];function ND(e,t){if(e==null)return{};var n,r,i=S1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function S1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function kD(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 JB(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=ND(e,x1e),{domain:a,range:o}=t,c=ND(t,w1e);return!kD(n,a)||!kD(r,o)?!1:fh(i,c)}var j1e=["type"],N1e=["dangerouslySetInnerHTML","ticks","scale"],k1e=["id","scale"];function nj(){return nj=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},nj.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 _D(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){C1e(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 C1e(e,t,n){return(t=_1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _1e(e){var t=A1e(e,"string");return typeof t=="symbol"?t:t+""}function A1e(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 rj(e,t){if(e==null)return{};var n,r,i=O1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function O1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function E1e(e){var t=ln(),n=S.useRef(null),r=ek(),{type:i}=e,a=rj(e,j1e),o=Sv(r,"xAxis",i),c=S.useMemo(()=>{if(o!=null)return _D(_D({},a),{},{type:o})},[a,o]);return S.useLayoutEffect(()=>{c!=null&&(n.current===null?t(hwe(c)):n.current!==c&&t(pwe({prev:n.current,next:c})),n.current=c)},[c,t]),S.useLayoutEffect(()=>()=>{n.current&&(t(mwe(n.current)),n.current=null)},[t]),null}var T1e=e=>{var{xAxisId:t,className:n}=e,r=Fe(T4),i=yr(),a="xAxis",o=Fe(k=>D6(k,a,t,i)),c=Fe(k=>tve(k,t)),d=Fe(k=>ove(k,t)),f=Fe(k=>t6(k,t));if(c==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:p,ticks:m,scale:y}=e,v=rj(e,N1e),{id:x,scale:w}=f,j=rj(f,k1e);return S.createElement(oC,nj({},v,j,{x:d.x,y:d.y,width:c.width,height:c.height,className:Ct("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:o,axisType:a,axisId:t}))},P1e={allowDataOverflow:Tn.allowDataOverflow,allowDecimals:Tn.allowDecimals,allowDuplicatedCategory:Tn.allowDuplicatedCategory,angle:Tn.angle,axisLine:rs.axisLine,height:Tn.height,hide:!1,includeHidden:Tn.includeHidden,interval:Tn.interval,label:!1,minTickGap:Tn.minTickGap,mirror:Tn.mirror,orientation:Tn.orientation,padding:Tn.padding,reversed:Tn.reversed,scale:Tn.scale,tick:Tn.tick,tickCount:Tn.tickCount,tickLine:rs.tickLine,tickSize:rs.tickSize,type:Tn.type,niceTicks:Tn.niceTicks,xAxisId:0},z1e=e=>{var t=gr(e,P1e);return S.createElement(S.Fragment,null,S.createElement(E1e,{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}),S.createElement(T1e,t))},hy=S.memo(z1e,JB);hy.displayName="XAxis";var R1e=["type"],M1e=["dangerouslySetInnerHTML","ticks","scale"],D1e=["id","scale"];function ij(){return ij=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},ij.apply(null,arguments)}function AD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function OD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AD(Object(n),!0).forEach(function(r){I1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function I1e(e,t,n){return(t=L1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L1e(e){var t=$1e(e,"string");return typeof t=="symbol"?t:t+""}function $1e(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 aj(e,t){if(e==null)return{};var n,r,i=U1e(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 U1e(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 B1e(e){var t=ln(),n=S.useRef(null),r=ek(),{type:i}=e,a=aj(e,R1e),o=Sv(r,"yAxis",i),c=S.useMemo(()=>{if(o!=null)return OD(OD({},a),{},{type:o})},[o,a]);return S.useLayoutEffect(()=>{c!=null&&(n.current===null?t(gwe(c)):n.current!==c&&t(ywe({prev:n.current,next:c})),n.current=c)},[c,t]),S.useLayoutEffect(()=>()=>{n.current&&(t(vwe(n.current)),n.current=null)},[t]),null}function F1e(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=S.useRef(null),o=S.useRef(null),c=Fe(T4),d=yr(),f=ln(),p="yAxis",m=Fe(T=>uve(T,t)),y=Fe(T=>cve(T,t)),v=Fe(T=>D6(T,p,t,d)),x=Fe(T=>n6(T,t));if(S.useLayoutEffect(()=>{if(!(r!=="auto"||!m||iC(i)||S.isValidElement(i)||x==null)){var T=a.current;if(T){var A=T.getCalculatedWidth();Math.round(m.width)!==Math.round(A)&&f(bwe({id:t,width:A}))}}},[v,m,f,i,t,r,x]),m==null||y==null||x==null)return null;var{dangerouslySetInnerHTML:w,ticks:j,scale:k}=e,O=aj(e,M1e),{id:_,scale:C}=x,P=aj(x,D1e);return S.createElement(oC,ij({},O,P,{ref:a,labelRef:o,x:y.x,y:y.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:m.width,height:m.height,className:Ct("recharts-".concat(p," ").concat(p),n),viewBox:c,ticks:v,axisType:p,axisId:t}))}var q1e={allowDataOverflow:Pn.allowDataOverflow,allowDecimals:Pn.allowDecimals,allowDuplicatedCategory:Pn.allowDuplicatedCategory,angle:Pn.angle,axisLine:rs.axisLine,hide:!1,includeHidden:Pn.includeHidden,interval:Pn.interval,label:!1,minTickGap:Pn.minTickGap,mirror:Pn.mirror,orientation:Pn.orientation,padding:Pn.padding,reversed:Pn.reversed,scale:Pn.scale,tick:Pn.tick,tickCount:Pn.tickCount,tickLine:rs.tickLine,tickSize:rs.tickSize,type:Pn.type,niceTicks:Pn.niceTicks,width:Pn.width,yAxisId:0},K1e=e=>{var t=gr(e,q1e);return S.createElement(S.Fragment,null,S.createElement(B1e,{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}),S.createElement(F1e,t))},py=S.memo(K1e,JB);py.displayName="YAxis";var H1e=(e,t)=>t,uC=le([H1e,tn,yU,Bn,tB,hs,P0e,Jn],$0e);function G1e(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function dC(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(G1e(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(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=>o(c.clientX,c.clientY)):o(e.clientX,e.clientY)}var e8=Wr("mouseClick"),t8=oh();t8.startListening({actionCreator:e8,effect:(e,t)=>{var n=e.payload,r=uC(t.getState(),dC(n));r?.activeIndex!=null&&t.dispatch(kve({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var sj=Wr("mouseMove"),n8=oh(),Uc=null,Qo=null,hS=null;n8.startListening({actionCreator:sj,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a?.includes("mousemove");Uc!==null&&(cancelAnimationFrame(Uc),Uc=null),Qo!==null&&(typeof i!="number"||!o)&&(clearTimeout(Qo),Qo=null),hS=dC(n);var c=()=>{var d=t.getState(),f=wh(d,d.tooltip.settings.shared);if(!hS){Uc=null,Qo=null;return}if(f==="axis"){var p=uC(d,hS);p?.activeIndex!=null?t.dispatch(H6({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(K6())}Uc=null,Qo=null};if(!o){c();return}i==="raf"?Uc=requestAnimationFrame(c):typeof i=="number"&&Qo===null&&(Qo=setTimeout(c,i))}});function V1e(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 ED={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},r8=or({name:"rootProps",initialState:ED,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:ED.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}}}),Z1e=r8.reducer,{updateOptions:Y1e}=r8.actions,W1e=null,Q1e={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)},i8=or({name:"polarOptions",initialState:W1e,reducers:Q1e}),{updatePolarOptions:Ske}=i8.actions,X1e=i8.reducer,a8=Wr("keyDown"),s8=Wr("focus"),o8=Wr("blur"),Mv=oh(),Bc=null,Xo=null,Tm=null;Mv.startListening({actionCreator:a8,effect:(e,t)=>{Tm=e.payload,Bc!==null&&(cancelAnimationFrame(Bc),Bc=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");Xo!==null&&(typeof r!="number"||!a)&&(clearTimeout(Xo),Xo=null);var o=()=>{try{var c=t.getState(),d=c.rootProps.accessibilityLayer!==!1;if(!d)return;var{keyboardInteraction:f}=c.tooltip,p=Tm;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var m=yf(f,zl(c),wu(c),ju(c)),y=m==null?-1:Number(m),v=!Number.isFinite(y)||y<0,x=hs(c),w=zl(c),j=wh(c,c.tooltip.settings.shared);if(p==="Enter"){if(v)return;var k=oy(c,j,"hover",String(f.index));t.dispatch(sy({active:!f.active,activeIndex:f.index,activeCoordinate:k}));return}var O=mve(c),_=O==="left-to-right"?1:-1,C=p==="ArrowRight"?1:-1,P;if(v){var T=wu(c),A=ju(c),z=C*_,I=ae=>({active:!1,index:String(ae),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(P=-1,z>0){for(var q=0;q<w.length;q++)if(yf(I(q),w,T,A)!=null){P=q;break}}else for(var U=w.length-1;U>=0;U--)if(yf(I(U),w,T,A)!=null){P=U;break}if(P<0)return}else{P=y+C*_;var L=x?.length||w.length;if(L===0||P>=L||P<0)return}var J=oy(c,j,"hover",String(P));t.dispatch(sy({active:!0,activeIndex:P.toString(),activeCoordinate:J}))}finally{Bc=null,Xo=null}};if(!a){o();return}r==="raf"?Bc=requestAnimationFrame(o):typeof r=="number"&&Xo===null&&(o(),Tm=null,Xo=setTimeout(()=>{Tm?o():(Xo=null,Bc=null)},r))}});Mv.startListening({actionCreator:s8,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var a="0",o=wh(n,n.tooltip.settings.shared),c=oy(n,o,"hover",String(a));t.dispatch(sy({active:!0,activeIndex:a,activeCoordinate:c}))}}}});Mv.startListening({actionCreator:o8,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(sy({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function l8(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 pi=Wr("externalEvent"),c8=oh(),Pm=new Map,ef=new Map,pS=new Map;c8.startListening({actionCreator:pi,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=l8(r);pS.set(i,{handler:n,reactEvent:a});var o=Pm.get(i);o!==void 0&&(cancelAnimationFrame(o),Pm.delete(i));var c=t.getState(),{throttleDelay:d,throttledEvents:f}=c.eventSettings,p=f,m=p==="all"||p?.includes(i),y=ef.get(i);y!==void 0&&(typeof d!="number"||!m)&&(clearTimeout(y),ef.delete(i));var v=()=>{var j=pS.get(i);try{if(!j)return;var{handler:k,reactEvent:O}=j,_=t.getState(),C={activeCoordinate:y0e(_),activeDataKey:p0e(_),activeIndex:Hf(_),activeLabel:iB(_),activeTooltipIndex:Hf(_),isTooltipActive:v0e(_)};k&&k(C,O)}finally{Pm.delete(i),ef.delete(i),pS.delete(i)}};if(!m){v();return}if(d==="raf"){var x=requestAnimationFrame(v);Pm.set(i,x)}else if(typeof d=="number"){if(!ef.has(i)){v();var w=setTimeout(v,d);ef.set(i,w)}}else v()}}});var J1e=le([Ku],e=>e.tooltipItemPayloads),eje=le([J1e,(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)}}}),u8=Wr("touchMove"),d8=oh(),Jo=null,qs=null,TD=null,tf=null;d8.startListening({actionCreator:u8,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){tf=l8(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");Jo!==null&&(cancelAnimationFrame(Jo),Jo=null),qs!==null&&(typeof i!="number"||!o)&&(clearTimeout(qs),qs=null),TD=Array.from(n.touches).map(d=>dC({clientX:d.clientX,clientY:d.clientY,currentTarget:n.currentTarget}));var c=()=>{if(tf!=null){var d=t.getState(),f=wh(d,d.tooltip.settings.shared);if(f==="axis"){var p,m=(p=TD)===null||p===void 0?void 0:p[0];if(m==null){Jo=null,qs=null;return}var y=uC(d,m);y?.activeIndex!=null&&t.dispatch(H6({activeIndex:y.activeIndex,activeDataKey:void 0,activeCoordinate:y.activeCoordinate}))}else if(f==="item"){var v,x=tf.touches[0];if(document.elementFromPoint==null||x==null)return;var w=document.elementFromPoint(x.clientX,x.clientY);if(!w||!w.getAttribute)return;var j=w.getAttribute(fde),k=(v=w.getAttribute(hde))!==null&&v!==void 0?v:void 0,O=Hl(d).find(P=>P.id===k);if(j==null||O==null||k==null)return;var{dataKey:_}=O,C=eje(d,j,k);t.dispatch(Nve({activeDataKey:_,activeIndex:j,activeCoordinate:C,activeGraphicalItemId:k}))}Jo=null,qs=null}};if(!o){c();return}i==="raf"?Jo=requestAnimationFrame(c):typeof i=="number"&&qs===null&&(c(),tf=null,qs=setTimeout(()=>{tf?c():(qs=null,Jo=null)},i))}}});var f8={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},h8=or({name:"eventSettings",initialState:f8,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:tje}=h8.actions,nje=h8.reducer,rje=X3({brush:Owe,cartesianAxis:xwe,chartData:gbe,errorBars:KSe,eventSettings:nje,graphicalItems:Qxe,layout:Wue,legend:sfe,options:dbe,polarAxis:Lxe,polarOptions:X1e,referenceElements:Iwe,renderedTicks:fSe,rootProps:Z1e,tooltip:Cve,zIndex:X0e}),ije=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return wue({reducer:rje,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([t8.middleware,n8.middleware,Mv.middleware,c8.middleware,d8.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(h4({type:"raf"}))},devTools:{serialize:{replacer:V1e},name:"recharts-".concat(n)}})};function aje(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=yr(),a=S.useRef(null);if(i)return n;a.current==null&&(a.current=ije(t,r));var o=qN;return S.createElement(Nfe,{context:o,store:a.current},n)}function sje(e){var{layout:t,margin:n}=e,r=ln(),i=yr();return S.useEffect(()=>{i||(r(Vue(t)),r(Gue(n)))},[r,i,t,n]),null}var oje=S.memo(sje,fh);function lje(e){var t=ln();return S.useEffect(()=>{t(Y1e(e))},[t,e]),null}var cje=e=>{var t=ln();return S.useEffect(()=>{t(tje(e))},[t,e]),null},uje=S.memo(cje,fh);function PD(e){var{zIndex:t,isPanorama:n}=e,r=S.useRef(null),i=ln();return S.useLayoutEffect(()=>(r.current&&i(W0e({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Q0e({zIndex:t,isPanorama:n}))}),[i,t,n]),S.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function zD(e){var{children:t,isPanorama:n}=e,r=Fe(B0e);if(!r||r.length===0)return t;var i=r.filter(o=>o<0),a=r.filter(o=>o>0);return S.createElement(S.Fragment,null,i.map(o=>S.createElement(PD,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>S.createElement(PD,{key:o,zIndex:o,isPanorama:n})))}var dje=["children"];function fje(e,t){if(e==null)return{};var n,r,i=hje(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function hje(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function my(){return my=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},my.apply(null,arguments)}var pje={width:"100%",height:"100%",display:"block"},mje=S.forwardRef((e,t)=>{var n=XN(),r=JN(),i=H4();if(!va(n)||!va(r))return null;var{children:a,otherAttributes:o,title:c,desc:d}=e,f,p;return o!=null&&(typeof o.tabIndex=="number"?f=o.tabIndex:f=i?0:void 0,typeof o.role=="string"?p=o.role:p=i?"application":void 0),S.createElement(RN,my({},o,{title:c,desc:d,role:p,tabIndex:f,width:n,height:r,style:pje,ref:t}),a)}),gje=e=>{var{children:t}=e,n=Fe(mv);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return S.createElement(RN,{width:r,height:i,x:o,y:a},t)},RD=S.forwardRef((e,t)=>{var{children:n}=e,r=fje(e,dje),i=yr();return i?S.createElement(gje,null,S.createElement(zD,{isPanorama:!0},n)):S.createElement(mje,my({ref:t},r),S.createElement(zD,{isPanorama:!1},n))});function yje(){var e=ln(),[t,n]=S.useState(null),r=Fe(dde);return S.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;nt(a)&&a!==r&&e(Yue(a))}},[t,e,r]),n}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 vje(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){bje(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 bje(e,t,n){return(t=xje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xje(e){var t=wje(e,"string");return typeof t=="symbol"?t:t+""}function wje(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 lo(){return lo=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},lo.apply(null,arguments)}var Sje=()=>(kbe(),null);function gy(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var jje=S.forwardRef((e,t)=>{var n,r,i=S.useRef(null),[a,o]=S.useState({containerWidth:gy((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:gy((r=e.style)===null||r===void 0?void 0:r.height)}),c=S.useCallback((f,p)=>{o(m=>{var y=Math.round(f),v=Math.round(p);return m.containerWidth===y&&m.containerHeight===v?m:{containerWidth:y,containerHeight:v}})},[]),d=S.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=x=>{var w=x[0];if(w!=null){var{width:j,height:k}=w.contentRect;c(j,k)}},v=new ResizeObserver(y);v.observe(f),i.current=v}},[t,c]);return S.useEffect(()=>()=>{var f=i.current;f?.disconnect()},[c]),S.createElement(S.Fragment,null,S.createElement(uh,{width:a.containerWidth,height:a.containerHeight}),S.createElement("div",lo({ref:d},e)))}),Nje=S.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=S.useState({containerWidth:gy(n),containerHeight:gy(r)}),o=S.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=S.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:f,height:p}=d.getBoundingClientRect();o(f,p)}},[t,o]);return S.createElement(S.Fragment,null,S.createElement(uh,{width:i.containerWidth,height:i.containerHeight}),S.createElement("div",lo({ref:c},e)))}),kje=S.forwardRef((e,t)=>{var{width:n,height:r}=e;return S.createElement(S.Fragment,null,S.createElement(uh,{width:n,height:r}),S.createElement("div",lo({ref:t},e)))}),Cje=S.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?S.createElement(Nje,lo({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?S.createElement(kje,lo({},e,{width:n,height:r,ref:t})):S.createElement(S.Fragment,null,S.createElement(uh,{width:n,height:r}),S.createElement("div",lo({ref:t},e)))});function _je(e){return e?jje:Cje}var Aje=S.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:c,onMouseDown:d,onMouseEnter:f,onMouseLeave:p,onMouseMove:m,onMouseUp:y,onTouchEnd:v,onTouchMove:x,onTouchStart:w,style:j,width:k,responsive:O,dispatchTouchEvents:_=!0}=e,C=S.useRef(null),P=ln(),[T,A]=S.useState(null),[z,I]=S.useState(null),q=yje(),U=WN(),L=U?.width>0?U.width:k,J=U?.height>0?U.height:i,ae=S.useCallback(de=>{q(de),typeof t=="function"&&t(de),A(de),I(de),de!=null&&(C.current=de)},[q,t,A,I]),Q=S.useCallback(de=>{P(e8(de)),P(pi({handler:a,reactEvent:de}))},[P,a]),K=S.useCallback(de=>{P(sj(de)),P(pi({handler:f,reactEvent:de}))},[P,f]),X=S.useCallback(de=>{P(K6()),P(pi({handler:p,reactEvent:de}))},[P,p]),ye=S.useCallback(de=>{P(sj(de)),P(pi({handler:m,reactEvent:de}))},[P,m]),Se=S.useCallback(()=>{P(s8())},[P]),R=S.useCallback(()=>{P(o8())},[P]),F=S.useCallback(de=>{P(a8(de.key))},[P]),B=S.useCallback(de=>{P(pi({handler:o,reactEvent:de}))},[P,o]),M=S.useCallback(de=>{P(pi({handler:c,reactEvent:de}))},[P,c]),V=S.useCallback(de=>{P(pi({handler:d,reactEvent:de}))},[P,d]),se=S.useCallback(de=>{P(pi({handler:y,reactEvent:de}))},[P,y]),ie=S.useCallback(de=>{P(pi({handler:w,reactEvent:de}))},[P,w]),he=S.useCallback(de=>{_&&P(u8(de)),P(pi({handler:x,reactEvent:de}))},[P,_,x]),je=S.useCallback(de=>{P(pi({handler:v,reactEvent:de}))},[P,v]),ee=_je(O);return S.createElement(fB.Provider,{value:T},S.createElement(d3.Provider,{value:z},S.createElement(ee,{width:L??j?.width,height:J??j?.height,className:Ct("recharts-wrapper",r),style:vje({position:"relative",cursor:"default",width:L,height:J},j),onClick:Q,onContextMenu:B,onDoubleClick:M,onFocus:Se,onBlur:R,onKeyDown:F,onMouseDown:V,onMouseEnter:K,onMouseLeave:X,onMouseMove:ye,onMouseUp:se,onTouchEnd:je,onTouchMove:he,onTouchStart:ie,ref:ae},S.createElement(Sje,null),n)))}),Oje=["width","height","responsive","children","className","style","compact","title","desc"];function Eje(e,t){if(e==null)return{};var n,r,i=Tje(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 Tje(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 Pje=S.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:c,compact:d,title:f,desc:p}=e,m=Eje(e,Oje),y=Gi(m);return d?S.createElement(S.Fragment,null,S.createElement(uh,{width:n,height:r}),S.createElement(RD,{otherAttributes:y,title:f,desc:p},a)):S.createElement(Aje,{className:o,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},S.createElement(RD,{otherAttributes:y,title:f,desc:p,ref:t},S.createElement(Lwe,null,a)))});function oj(){return oj=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},oj.apply(null,arguments)}function DD(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 zje(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DD(Object(n),!0).forEach(function(r){Rje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rje(e,t,n){return(t=Mje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mje(e){var t=Dje(e,"string");return typeof t=="symbol"?t:t+""}function Dje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ije={top:5,right:5,bottom:5,left:5},Lje=zje({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:Ije,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},f8),$je=S.forwardRef(function(t,n){var r,i=gr(t.categoricalChartProps,Lje),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:c,tooltipPayloadSearcher:d,categoricalChartProps:f}=t,p={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:c,tooltipPayloadSearcher:d,eventEmitter:void 0};return S.createElement(aje,{preloadedState:{options:p},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},S.createElement(Awe,{chartData:f.data}),S.createElement(oje,{layout:i.layout,margin:i.margin}),S.createElement(uje,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),S.createElement(lje,{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}),S.createElement(Pje,oj({},i,{ref:n})))}),Uje=["axis"],lj=S.forwardRef((e,t)=>S.createElement($je,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Uje,tooltipPayloadSearcher:cbe,categoricalChartProps:e,ref:t}));const cj={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},Jc={fill:"#71717a",fontSize:11},Bje="#27272a",uj="#27272a",cf=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function p8(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function dj(e){return p8(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function fj(e){const t=p8(e);return`${t.getMonth()+1}/${t.getDate()}`}const Fje=["7d","30d","90d","all"],qje=["gap","cited","uncited"],m8={forum:"bg-amber-500",social:"bg-blue-500",news:"bg-zinc-400",reference:"bg-purple-500",blog:"bg-emerald-500",ecommerce:"bg-orange-500",video:"bg-red-500",academic:"bg-cyan-500",other:"bg-zinc-600"},Kje={[Js.answer]:"Answer",[Js.citation]:"Sources"};function Hje({projectName:e}){const[t,n]=S.useState("30d"),[r,i]=S.useState(Js.answer),[a,o]=S.useState(null),[c,d]=S.useState(null),[f,p]=S.useState(null),[m,y]=S.useState(null),[v,x]=S.useState(!0);if(S.useEffect(()=>{let z=!1;return x(!0),Promise.all([c7(e,t),u7(e,t),d7(e,t)]).then(([I,q,U])=>{z||(o(I),d(q),p(U),x(!1))}).catch(()=>{z||x(!1)}),()=>{z=!0}},[e,t]),S.useEffect(()=>{y(null)},[r]),v&&!a)return u.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"});const w=r===Js.answer,j=a?w?a.overall.answerRate:a.overall.citationRate:0,k=a?w?a.overall.answerMentionedCount:a.overall.cited:0,O=a?.overall.total??0,_=a?w?a.answerTrend:a.trend:"stable",C=_==="improving"?"positive":_==="declining"?"negative":"neutral",P=c?w?c.mentionedKeywords:c.cited:[],T=c?w?c.mentionGap:c.gap:[],A=c?w?c.notMentioned:c.uncited:[];return u.jsxs(u.Fragment,{children:[u.jsxs("section",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-4",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:w?"Visibility Metrics":"Citation Metrics"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:[w?"Answer Visibility Trends":"Source Citation Trends",u.jsx(Wn,{text:w?"Percentage of queries where your brand is mentioned in the AI-generated answer text. A higher rate means AI engines are actively surfacing your brand when answering user questions.":"Percentage of queries where your domain appears in the AI provider's source/reference links. This measures whether your pages are used as grounding sources, not whether your brand is named in the answer."})]})]}),u.jsx("div",{className:"sidebar-tabs ml-2",children:[Js.answer,Js.citation].map(z=>u.jsx("button",{type:"button",className:`sidebar-tab ${r===z?"sidebar-tab--active":""}`,onClick:()=>i(z),children:Kje[z]},z))})]}),u.jsx("div",{className:"flex gap-1",children:Fje.map(z=>u.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===z?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>n(z),children:z==="all"?"All":z},z))})]}),a&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center gap-6",children:[u.jsx(l3,{value:`${Math.round(j*100)}`,label:w?"Answer Rate":"Citation Rate",delta:`${k} / ${O}`,tone:C,description:`Trend: ${_}`,isNumeric:!0}),u.jsxs("div",{className:"flex-1 space-y-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-xs text-zinc-500",children:"Trend"}),u.jsx(Et,{tone:C,children:_})]}),Object.keys(a.byProvider).length>0&&u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[u.jsx("th",{className:"text-left py-1 font-medium",children:"Provider"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Rate"}),u.jsx("th",{className:"text-right py-1 font-medium",children:w?"Mentioned / Total":"Cited / Total"})]})}),u.jsx("tbody",{children:Object.entries(a.byProvider).map(([z,I])=>{const q=w?I.answerRate:I.citationRate,U=w?I.answerMentionedCount:I.cited;return u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsx("td",{className:"py-1.5 text-zinc-300",children:z}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(q*100).toFixed(1),"%"]}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[U," / ",I.total]})]},z)})})]})]})]}),a.buckets.length>=1&&u.jsx(Gje,{buckets:a.buckets,keywordChanges:a.keywordChanges??[],metricMode:r})]})]}),u.jsx("div",{className:"page-section-divider"}),u.jsxs("section",{children:[u.jsx("div",{className:"flex items-center justify-between mb-4",children:u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Opportunity Analysis"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Brand Gap Analysis ",u.jsx(Wn,{text:w?"Classification based on the most recent completed run. Mentioned: your brand was named in the AI answer text. Gap: a competitor was cited but your brand was not mentioned. Not Mentioned: your brand was not mentioned and no competitors were cited.":"Classification based on the most recent completed run. Cited: your domain appeared in the AI provider's source links. Gap: a competitor was cited but you were not. Not Cited: neither your domain nor competitors appeared in sources. Consistency shows how often each key phrase was cited across all runs in the selected window."})]})]})}),c&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"flex gap-1 mb-4",children:qje.map(z=>{const I=z==="cited"?P.length:z==="gap"?T.length:A.length,q=m===z,U=z==="gap"?"Gap":z==="cited"?w?"Mentioned":"Cited":w?"Not Mentioned":"Not Cited";return u.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${q?z==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":z==="cited"?"bg-emerald-900/40 border-emerald-700/60 text-emerald-300":"bg-zinc-800/40 border-zinc-700 text-zinc-300":"border-zinc-800 text-zinc-400 hover:border-zinc-700"}`,onClick:()=>y(q?null:z),children:[U," (",I,")"]},z)})}),u.jsx(Vje,{citedRows:P,gapRows:T,uncitedRows:A,filter:m,metricMode:r})]})]}),u.jsx("div",{className:"page-section-divider"}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Source Intelligence"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Source Origin Breakdown ",u.jsx(Wn,{text:"Aggregated across all runs in the selected window. Shows what types of websites AI engines cite as grounding sources. More runs = more statistically meaningful breakdown."})]})]}),f&&f.overall.length>0&&u.jsxs("div",{className:"space-y-4",children:[u.jsx(Zje,{categories:f.overall}),u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[u.jsx("th",{className:"text-left py-1 font-medium",children:"Category"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Count"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"%"}),u.jsx("th",{className:"text-left py-1 pl-4 font-medium",children:"Top Sources"})]})}),u.jsx("tbody",{children:f.overall.map(z=>u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsxs("td",{className:"py-1.5 text-zinc-300 flex items-center gap-2",children:[u.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${m8[z.category]??"bg-zinc-600"}`}),z.label]}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:z.count}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(z.percentage*100).toFixed(1),"%"]}),u.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:z.topDomains.slice(0,3).map(I=>I.domain).join(", ")})]},z.category))})]})]}),f&&f.overall.length===0&&u.jsx("p",{className:"text-sm text-zinc-500 py-4",children:"No source data available. Run a visibility sweep first."})]})]})}function Gje({buckets:e,keywordChanges:t,metricMode:n}){const r=n===Js.answer,i=r?"answerRate":"citationRate",a=r?"Answer Rate":"Citation Rate",o=e.map(d=>({date:d.startDate,answerRate:Math.round(d.answerRate*1e3)/10,citationRate:Math.round(d.citationRate*1e3)/10,keywordCount:d.keywordCount??0})),c=S.useMemo(()=>{if(!t||t.length===0||e.length<2)return[];const d=new Date(e[0].startDate).getTime(),f=new Date(e[e.length-1].startDate).getTime();return t.filter(p=>{const m=new Date(p.date).getTime();return m>=d&&m<=f}).map(p=>{const m=new Date(p.date).getTime();let y=e[0].startDate,v=Math.abs(m-new Date(y).getTime());for(const x of e){const w=Math.abs(m-new Date(x.startDate).getTime());w<v&&(y=x.startDate,v=w)}return{...p,date:y}})},[e,t]);return u.jsxs("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:[u.jsx("p",{className:"text-[10px] text-zinc-500 mb-1 flex items-center gap-1",children:"kp = key phrases tracked in this window"}),u.jsx("div",{className:"h-40",role:"img","aria-label":`${a} trend chart`,children:u.jsx(O1,{width:"100%",height:"100%",children:u.jsxs(lj,{data:o,margin:{top:8,right:8,bottom:0,left:0},children:[u.jsx(qB,{strokeDasharray:"3 3",stroke:Bje,vertical:!1}),u.jsx(hy,{dataKey:"date",tick:Jc,tickLine:!1,axisLine:{stroke:uj},tickFormatter:fj}),u.jsx(py,{tick:Jc,tickLine:!1,axisLine:!1,domain:[0,100],tickFormatter:d=>`${d}%`,width:40}),u.jsx(J1,{...cj,labelFormatter:dj,formatter:(d,f)=>{const p=typeof d=="number"?d:Number(d??0);return String(f)===i?[`${p.toFixed(1)}%`,a]:[String(p),String(f)]}}),c.map(d=>u.jsx($B,{x:d.date,stroke:"#52525b",strokeDasharray:"4 2",label:{value:d.label,position:"top",fill:"#71717a",fontSize:9}},d.date)),u.jsx(Xc,{type:"monotone",dataKey:i,stroke:cf[0],fill:cf[0],fillOpacity:.15,strokeWidth:2,dot:{fill:cf[0],r:3,strokeWidth:0},activeDot:{fill:cf[0],r:5,strokeWidth:0,opacity:.8}})]})})})]})}function Vje({citedRows:e,gapRows:t,uncitedRows:n,filter:r,metricMode:i}){const a=i===Js.answer,o=S.useMemo(()=>{const c=[...t.map(d=>({...d,_sort:0})),...e.map(d=>({...d,_sort:1})),...n.map(d=>({...d,_sort:2}))];return r?c.filter(d=>d.category===r):c.sort((d,f)=>d._sort-f._sort)},[e,t,n,r]);return o.length===0?u.jsxs("p",{className:"text-sm text-zinc-500 py-4",children:["No key phrases found",r?` with status "${r}"`:"","."]}):u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[u.jsx("th",{className:"text-left py-1 font-medium",children:"Keyword"}),u.jsx("th",{className:"text-left py-1 font-medium",children:"Status"}),u.jsx("th",{className:"text-left py-1 font-medium",children:a?"Providers Mentioning":"Providers Citing"}),u.jsx("th",{className:"text-left py-1 font-medium",children:"Competitors Citing"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Consistency"})]})}),u.jsx("tbody",{children:o.map(c=>{const d=c.category==="cited"?"positive":c.category==="gap"?"caution":"neutral",f=c.category==="gap"?"Gap":c.category==="cited"?a?"Mentioned":"Cited":a?"Not Mentioned":"Not Cited",p=a?c.consistency.mentionedRuns:c.consistency.citedRuns;return u.jsxs("tr",{className:`border-t border-zinc-800/40 ${c.category==="gap"?"border-l-2 border-l-amber-600/60":""}`,children:[u.jsx("td",{className:"py-1.5 text-zinc-200",children:c.keyword}),u.jsx("td",{className:"py-1.5",children:u.jsx(Et,{tone:d,children:f})}),u.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:c.providers.length>0?c.providers.join(", "):"—"}),u.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:c.competitorsCiting.length>0?c.competitorsCiting.join(", "):"—"}),u.jsx("td",{className:"py-1.5 text-right text-zinc-400 text-xs",children:c.consistency.totalRuns>0?`${p}/${c.consistency.totalRuns} runs`:"—"})]},c.keywordId)})})]})}function Zje({categories:e}){const t=e.reduce((n,r)=>n+r.count,0);return t===0?null:u.jsx("div",{className:"flex rounded-full overflow-hidden h-3 bg-zinc-800","aria-label":"Source category distribution",children:e.map(n=>{const r=n.count/t*100;return r<.5?null:u.jsx("div",{className:`${m8[n.category]??"bg-zinc-600"} transition-all`,style:{width:`${r}%`},title:`${n.label}: ${(n.percentage*100).toFixed(1)}%`},n.category)})})}const Yje=["7d","30d","90d","all"],Ks=cf;function nf(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function Wje(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 Qje({projectName:e}){const[t,n]=S.useState(null),[r,i]=S.useState(null),[a,o]=S.useState(!0),[c,d]=S.useState(!1),[f,p]=S.useState(!1),[m,y]=S.useState(null),[v,x]=S.useState(null),[w,j]=S.useState("sessions"),[k,O]=S.useState("desc"),[_,C]=S.useState("sessions"),[P,T]=S.useState("desc"),[A,z]=S.useState("sessions"),[I,q]=S.useState("desc"),[U,L]=S.useState([]),[J,ae]=S.useState([]),[Q,K]=S.useState([]),[X,ye]=S.useState("30d");function Se(be){o(!0),QE(e).then(ze=>{if(!be.current)return n(ze),ze.connected?Promise.all([XE(e,void 0,X),JE(e,X).catch(()=>[]),tT(e,X).catch(()=>[]),eT(e,X).catch(()=>[])]):null}).then(ze=>{be.current||(Array.isArray(ze)?(i(ze[0]),L(ze[1]),ae(ze[2]),K(ze[3])):(i(null),L([]),ae([]),K([])),o(!1))}).catch(ze=>{be.current||(y(ze instanceof Error?ze.message:"Failed to load GA4 data"),o(!1))})}S.useEffect(()=>{const be={current:!1};return Se(be),()=>{be.current=!0}},[e,X]);async function R(){d(!0),y(null),x(null);try{const be=await zI(e);x(`Synced ${be.rowCount.toLocaleString()} page rows, ${be.aiReferralCount.toLocaleString()} AI and ${be.socialReferralCount.toLocaleString()} social referral rows (${be.days} days)`);const[ze,Re,Oe,te]=await Promise.all([XE(e,void 0,X),JE(e,X).catch(()=>[]),tT(e,X).catch(()=>[]),eT(e,X).catch(()=>[])]);i(ze),L(Re),ae(Oe),K(te);const xe=await QE(e);n(xe)}catch(be){y(be instanceof Error?be.message:"Sync failed")}finally{d(!1)}}async function F(){p(!0),y(null),x(null);try{await h7(e),n({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),i(null),x("GA4 disconnected")}catch(be){y(be instanceof Error?be.message:"Disconnect failed")}finally{p(!1)}}function B(be){w===be?O(ze=>ze==="desc"?"asc":"desc"):(j(be),O("desc"))}function M(be){_===be?T(ze=>ze==="desc"?"asc":"desc"):(C(be),T("desc"))}function V(be){A===be?q(ze=>ze==="desc"?"asc":"desc"):(z(be),q("desc"))}const se=S.useMemo(()=>r?.topPages?[...r.topPages].sort((be,ze)=>{const Re=be[w],Oe=ze[w];return typeof Re=="string"&&typeof Oe=="string"?k==="asc"?Re.localeCompare(Oe):Oe.localeCompare(Re):k==="asc"?Re-Oe:Oe-Re}):[],[r?.topPages,w,k]),ie=S.useMemo(()=>r?.aiReferrals?[...r.aiReferrals].sort((be,ze)=>{const Re=be[_],Oe=ze[_];return typeof Re=="string"&&typeof Oe=="string"?P==="asc"?Re.localeCompare(Oe):Oe.localeCompare(Re):P==="asc"?Re-Oe:Oe-Re}):[],[r?.aiReferrals,_,P]),he=S.useMemo(()=>r?.socialReferrals?[...r.socialReferrals].sort((be,ze)=>{const Re=be[A],Oe=ze[A];return typeof Re=="string"&&typeof Oe=="string"?I==="asc"?Re.localeCompare(Oe):Oe.localeCompare(Re):I==="asc"?Re-Oe:Oe-Re}):[],[r?.socialReferrals,A,I]),{socialChartData:je,socialChartSources:ee}=S.useMemo(()=>{const be=[...new Set(Q.map(Oe=>Oe.source))],ze=new Map;for(const Oe of Q){let te=ze.get(Oe.date);te||(te={_socialTotal:0},ze.set(Oe.date,te)),te[Oe.source]=(te[Oe.source]??0)+Oe.sessions,te._socialTotal=(te._socialTotal??0)+Oe.sessions}return{socialChartData:[...ze.entries()].sort(([Oe],[te])=>Oe.localeCompare(te)).map(([Oe,te])=>({date:Oe,...te})),socialChartSources:be}},[Q]),{chartData:de,chartSources:_e,dateRange:Y}=S.useMemo(()=>{const be=[...new Set(U.map(Ee=>Ee.source))],ze=new Map;for(const Ee of J)ze.set(Ee.date,{_totalSessions:Ee.sessions,_organicSessions:Ee.organicSessions});const Re=new Map;for(const Ee of U){const Ge=`${Ee.date}::${Ee.source}`,Je=Re.get(Ge)??0;Re.set(Ge,Math.max(Je,Ee.sessions))}for(const[Ee,Ge]of Re){const[Je,nn]=Ee.split("::");let wn=ze.get(Je);wn||(wn={_totalSessions:0,_organicSessions:0},ze.set(Je,wn)),wn[nn]=(wn[nn]??0)+Ge}const Oe=[...ze.entries()].sort(([Ee],[Ge])=>Ee.localeCompare(Ge)).map(([Ee,Ge])=>({date:Ee,...Ge})),te=Oe.map(Ee=>Ee.date),xe=te.length>0?{start:te[0],end:te[te.length-1]}:null;return{chartData:Oe,chartSources:be,dateRange:xe}},[U,J]);if(a&&!t)return u.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!t?.connected)return u.jsx(Xje,{projectName:e,onConnected:()=>Se({current:!1})});const Ke=r?.organicSharePct??0,Me=r?.aiSessionsDeduped??0,rt=r?.aiSharePct??0,it=r?new Set(r.aiReferrals.map(be=>be.source.toLowerCase())).size:0,Nt=ie[0]??null,Lt=r?.socialSessions??0,xn=r?.socialSharePct??0,ve=r?new Set(r.socialReferrals.map(be=>be.source.toLowerCase())).size:0,Ve=he[0]??null;return u.jsxs(u.Fragment,{children:[m&&u.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:m}),v&&u.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-emerald-900/20 border border-emerald-800/60 text-sm text-emerald-300",children:v}),u.jsxs("div",{className:"flex items-center justify-between mb-6",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),u.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",u.jsx("span",{className:"text-zinc-300",children:t.propertyId}),t.clientEmail&&u.jsxs(u.Fragment,{children:[" · ",u.jsx("span",{className:"text-zinc-500",children:t.clientEmail})]})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(we,{variant:"outline",size:"sm",disabled:c,onClick:R,children:[u.jsx(sT,{className:`w-3.5 h-3.5 mr-1.5 ${c?"animate-spin":""}`}),c?"Syncing…":"Sync"]}),u.jsxs(we,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:f,onClick:F,children:[u.jsx(fG,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-4 flex items-start justify-between",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",u.jsx(Wn,{text:`Aggregated traffic metrics from Google Analytics 4. Sessions and users are summed across the selected period.${r?.periodStart&&r?.periodEnd?` Data available: ${new Date(r.periodStart+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})} – ${new Date(r.periodEnd+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}.`:""} Organic sessions are Google organic search sessions specifically.`})]})]}),u.jsx("div",{className:"flex gap-1",children:Yje.map(be=>u.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${X===be?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>ye(be),children:be==="all"?"All":be},be))})]}),r?u.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[u.jsx(mS,{value:nf(r.totalSessions),label:"Total Sessions",subtitle:r.totalSessions.toLocaleString(),tone:"neutral"}),u.jsx(mS,{value:nf(r.totalOrganicSessions),label:"Organic Sessions",subtitle:`${Ke}% of total`,tone:"positive"}),u.jsx(mS,{value:nf(r.totalUsers),label:"Total Users",subtitle:r.totalUsers.toLocaleString(),tone:"neutral"})]}):u.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[u.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),u.jsxs(we,{variant:"outline",size:"sm",disabled:c,onClick:R,children:[u.jsx(sT,{className:`w-3.5 h-3.5 mr-1.5 ${c?"animate-spin":""}`}),"Sync from GA4"]})]})]}),r&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"page-section-divider"}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"AI Attribution"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["AI Referral Sources",u.jsx(Wn,{text:"Tracks sessions from known AI referrers and matching AI-tagged UTMs detected in GA4 sessionSource, firstUserSource, and sessionManualSource. Generic search sources are excluded to avoid false positives."})]})]}),Y&&u.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(Y.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(Y.end+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),de.length>0&&u.jsxs(We,{className:"surface-card p-5 mb-4",children:[u.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),u.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:_e.length>0?"AI vs. total sessions":"All sessions (baseline)"}),_e.length===0&&u.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),_e.length===0&&u.jsx("p",{className:"text-xs text-zinc-500",children:"No AI referrals detected yet"})]}),u.jsx("div",{className:"h-64",children:u.jsx(O1,{width:"100%",height:"100%",children:u.jsxs(lj,{data:de,margin:{top:4,right:4,bottom:0,left:0},children:[u.jsx(hy,{dataKey:"date",tick:Jc,tickLine:!1,axisLine:{stroke:uj},tickFormatter:fj}),u.jsx(py,{tick:Jc,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),u.jsx(J1,{...cj,labelFormatter:dj,formatter:(be,ze)=>{const Re=typeof be=="number"?be.toLocaleString():String(be??0),Oe=String(ze??"");return Oe==="_totalSessions"?[Re,"Total Sessions"]:Oe==="_organicSessions"?[Re,"Organic Sessions"]:[Re,Oe]}}),u.jsx(I1,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:be=>be==="_totalSessions"?"Total Sessions":be==="_organicSessions"?"Organic Sessions":be}),u.jsx(Xc,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),_e.map((be,ze)=>u.jsx(Xc,{type:"monotone",dataKey:be,stackId:"ai",stroke:Ks[ze%Ks.length],fill:Ks[ze%Ks.length],fillOpacity:.4,strokeWidth:1.5},be))]})})})]}),u.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[u.jsxs(We,{className:"surface-card p-5",children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),u.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Attributable AI visits"})]}),r.aiReferrals.length>0?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[u.jsx(hi,{label:"AI Sessions",value:nf(Me),hint:`${Me.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions attributed to AI referral sources detected via GA4 sessionSource, firstUserSource, and sessionManualSource dimensions."}),u.jsx(hi,{label:"Share of Traffic",value:`${rt}%`,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from AI answer engines. A higher share indicates stronger AI-driven discovery."}),u.jsx(hi,{label:"Tracked Sources",value:String(it),hint:`${r.aiReferrals.length} source rows`,tone:"neutral",tooltip:"Number of distinct AI referral sources detected. Each unique source/medium combination (e.g. chatgpt.com/referral) counts as one source row."})]}),Nt&&u.jsxs("div",{className:"mt-4 rounded-lg border border-emerald-800/40 bg-emerald-500/6 px-4 py-3 text-sm text-emerald-100",children:["Top AI referrer: ",u.jsx("span",{className:"font-medium",children:Nt.source})," via ",Nt.medium,", accounting for ",Nt.sessions.toLocaleString()," sessions."]})]}):u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[u.jsx(hi,{label:"AI Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to AI referral sources detected via GA4 sessionSource, firstUserSource, and sessionManualSource dimensions."}),u.jsx(hi,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from AI answer engines."}),u.jsx(hi,{label:"Tracked Sources",value:"0",hint:"known AI sources",tone:"neutral",tooltip:"Number of distinct AI referral sources detected after matching known AI engine referrers and AI-tagged UTM sources."})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3 text-sm text-zinc-400",children:[u.jsx("p",{className:"mb-1.5 text-zinc-300",children:"Monitoring for AI referral traffic from:"}),u.jsx("p",{className:"text-xs text-zinc-500",children:"Known AI answer engines and matching UTM-tagged variants. Sessions will appear here once GA4 detects visits from tracked AI sources."})]})]})]}),u.jsxs(We,{className:"surface-card p-5",children:[u.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Breakdown"}),u.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Source / medium"})]}),u.jsx("p",{className:"text-xs text-zinc-500",children:r.aiReferrals.length>0?`${r.aiReferrals.length} rows`:"No source rows"})]}),r.aiReferrals.length>0?u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[u.jsx(fi,{label:"Source",sortKey:"source",current:_,dir:P,onSort:M,align:"left"}),u.jsx(fi,{label:"Medium",sortKey:"medium",current:_,dir:P,onSort:M,align:"left"}),u.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),u.jsx(fi,{label:"Sessions",sortKey:"sessions",current:_,dir:P,onSort:M,align:"right"}),u.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),u.jsx(fi,{label:"Users",sortKey:"users",current:_,dir:P,onSort:M,align:"right"})]})}),u.jsx("tbody",{children:ie.map(be=>u.jsx(nNe,{referral:be,totalSessions:Me},`${be.source}:${be.medium}:${be.sourceDimension}`))})]})}):u.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[u.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI referrer sessions detected yet"}),u.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"When visitors arrive from ChatGPT, Claude, Gemini, or other AI platforms, their sessions will be broken down here by source and medium."})]})]})]})]})]}),r&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"page-section-divider"}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Social Attribution"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Social Media Traffic",u.jsx(Wn,{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."})]})]}),je.length>0&&u.jsxs(We,{className:"surface-card p-5 mb-4",children:[u.jsx("div",{className:"mb-4 flex items-end justify-between",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),u.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social sessions over time"})]})}),u.jsx("div",{className:"h-64",children:u.jsx(O1,{width:"100%",height:"100%",children:u.jsxs(lj,{data:je,margin:{top:4,right:4,bottom:0,left:0},children:[u.jsx(hy,{dataKey:"date",tick:Jc,tickLine:!1,axisLine:{stroke:uj},tickFormatter:fj}),u.jsx(py,{tick:Jc,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),u.jsx(J1,{...cj,labelFormatter:dj,formatter:(be,ze)=>{const Re=typeof be=="number"?be.toLocaleString():String(be??0),Oe=String(ze??"");return Oe==="_socialTotal"?[Re,"Total Social"]:[Re,Oe]}}),u.jsx(I1,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:be=>be==="_socialTotal"?"Total Social":be}),u.jsx(Xc,{type:"monotone",dataKey:"_socialTotal",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),ee.map((be,ze)=>u.jsx(Xc,{type:"monotone",dataKey:be,stackId:"social",stroke:Ks[ze%Ks.length],fill:Ks[ze%Ks.length],fillOpacity:.4,strokeWidth:1.5},be))]})})})]}),u.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[u.jsxs(We,{className:"surface-card p-5",children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),u.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social media visits"})]}),r.socialReferrals.length>0?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[u.jsx(hi,{label:"Social Sessions",value:nf(Lt),hint:`${Lt.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions classified as Organic Social or Paid Social by GA4's default channel grouping."}),u.jsx(hi,{label:"Share of Traffic",value:`${xn}%`,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from social media platforms."}),u.jsx(hi,{label:"Platforms",value:String(ve),hint:`${r.socialReferrals.length} source rows`,tone:"neutral",tooltip:"Number of distinct social media platforms detected. Each unique source/medium combination counts as one source row."})]}),Ve&&u.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:["Top social source: ",u.jsx("span",{className:"font-medium",children:Ve.source})," via ",Ve.medium,", accounting for ",Ve.sessions.toLocaleString()," sessions."]})]}):u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[u.jsx(hi,{label:"Social Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to social media platforms."}),u.jsx(hi,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions from social media."}),u.jsx(hi,{label:"Platforms",value:"0",hint:"known platforms",tone:"neutral",tooltip:"Number of distinct social media platforms detected."})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3 text-sm text-zinc-400",children:[u.jsx("p",{className:"mb-1.5 text-zinc-300",children:"Monitoring social media traffic via GA4 channel grouping"}),u.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."})]})]})]}),u.jsxs(We,{className:"surface-card p-5",children:[u.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Breakdown"}),u.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Source / medium"})]}),u.jsx("p",{className:"text-xs text-zinc-500",children:r.socialReferrals.length>0?`${r.socialReferrals.length} rows`:"No source rows"})]}),r.socialReferrals.length>0?u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[u.jsx(fi,{label:"Source",sortKey:"source",current:A,dir:I,onSort:V,align:"left"}),u.jsx(fi,{label:"Medium",sortKey:"medium",current:A,dir:I,onSort:V,align:"left"}),u.jsx("th",{className:"py-1 font-medium text-left",children:"Channel"}),u.jsx(fi,{label:"Sessions",sortKey:"sessions",current:A,dir:I,onSort:V,align:"right"}),u.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),u.jsx(fi,{label:"Users",sortKey:"users",current:A,dir:I,onSort:V,align:"right"})]})}),u.jsx("tbody",{children:he.map(be=>u.jsx(rNe,{referral:be,totalSessions:Lt},`${be.source}:${be.medium}:${be.channelGroup}`))})]})}):u.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[u.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No social media sessions detected yet"}),u.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."})]})]})]})]})]}),r&&r.topPages.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"page-section-divider"}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",u.jsx(Wn,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[u.jsx(fi,{label:"Landing Page",sortKey:"landingPage",current:w,dir:k,onSort:B,align:"left"}),u.jsx(fi,{label:"Sessions",sortKey:"sessions",current:w,dir:k,onSort:B,align:"right"}),u.jsx(fi,{label:"Organic",sortKey:"organicSessions",current:w,dir:k,onSort:B,align:"right"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),u.jsx(fi,{label:"Users",sortKey:"users",current:w,dir:k,onSort:B,align:"right"})]})}),u.jsx("tbody",{children:se.map(be=>u.jsx(Jje,{page:be},be.landingPage))})]})})]})]}),u.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[u.jsx("span",{children:r?.lastSyncedAt?`Last synced ${Wje(r.lastSyncedAt)}`:"Never synced"}),u.jsx("span",{children:r?`${r.topPages.length} pages · ${r.aiReferrals.length} AI rows · ${r.socialReferrals.length} social rows`:""})]})]})}function Xje({projectName:e,onConnected:t}){const[n,r]=S.useState(""),[i,a]=S.useState(null),[o,c]=S.useState(null),[d,f]=S.useState(!1),[p,m]=S.useState(null),y=S.useRef(null),v=S.useCallback(w=>{const j=w.target.files?.[0];if(!j)return;m(null),a(j.name);const k=new FileReader;k.onload=()=>{const O=k.result;try{const _=JSON.parse(O);if(!_.client_email||!_.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(O)}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 x(){if(m(null),!n.trim()){m("Property ID is required.");return}if(!o){m("Please upload a service account key file.");return}f(!0);try{await f7(e,{propertyId:n.trim(),keyJson:o});try{await zI(e)}catch{}t()}catch(w){m(w instanceof Error?w.message:"Failed to connect GA4")}finally{f(!1)}}return u.jsxs(We,{className:"surface-card p-6",children:[u.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-1",children:"Connect Google Analytics 4"}),u.jsx("p",{className:"text-sm text-zinc-400 mb-5",children:"Connect a GA4 property to see traffic data for this project. You'll need a service account key file from Google Cloud Console."}),p&&u.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:p}),u.jsxs("div",{className:"mb-4",children:[u.jsx("label",{htmlFor:"ga4-property-id",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"GA4 Property ID"}),u.jsx("input",{id:"ga4-property-id",type:"text",placeholder:"e.g. 123456789",value:n,onChange:w=>r(w.target.value),className:"w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 px-3 py-2 text-sm text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:ring-1 focus:ring-zinc-600"}),u.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Find this in GA4 → Admin → Property Settings. It's a numeric ID, not the Measurement ID (G-XXXXXX)."})]}),u.jsxs("div",{className:"mb-5",children:[u.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Service Account Key File"}),u.jsx("input",{ref:y,type:"file",accept:".json,application/json",onChange:v,className:"hidden"}),u.jsxs("button",{type:"button",onClick:()=>y.current?.click(),className:"flex items-center gap-2 w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 border-dashed px-4 py-3 text-sm text-zinc-400 hover:border-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:[u.jsx(pG,{className:"w-4 h-4 shrink-0"}),i?u.jsx("span",{className:"text-zinc-200 truncate",children:i}):u.jsx("span",{children:"Upload .json key file"})]}),u.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Download from Google Cloud Console → IAM & Admin → Service Accounts → Keys → Add Key → JSON. The service account must have ",u.jsx("span",{className:"text-zinc-400",children:"Viewer"})," access on the GA4 property."]})]}),u.jsx(we,{variant:"default",size:"sm",disabled:d||!n.trim()||!o,onClick:x,children:d?"Connecting & syncing…":"Connect GA4"})]})}function fi({label:e,sortKey:t,current:n,dir:r,onSort:i,align:a}){const o=n===t;return u.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${a==="right"?"text-right":"text-left"}`,onClick:()=>i(t),children:[e,o&&u.jsx("span",{className:"ml-0.5",children:r==="asc"?"↑":"↓"})]})}const g8={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function mS({value:e,label:t,subtitle:n,tone:r}){return u.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),u.jsx("p",{className:`text-2xl font-bold tabular-nums ${g8[r]}`,children:e}),u.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function hi({value:e,label:t,hint:n,tone:r,tooltip:i}){return u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-4 py-3 flex flex-col",children:[u.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1 flex items-center gap-1",children:[t,i&&u.jsx(Wn,{text:i})]}),u.jsx("p",{className:`text-xl font-semibold tabular-nums ${g8[r]}`,children:e}),u.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function Jje({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),u.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}const eNe={session:"Session",first_user:"First Visit",manual_utm:"UTM"},tNe={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 nNe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=eNe[e.sourceDimension]??e.sourceDimension,i=tNe[e.sourceDimension]??"";return u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),u.jsx("td",{className:"py-1.5 text-zinc-500 max-w-[180px] truncate",title:e.medium,children:e.medium}),u.jsx("td",{className:"py-1.5",children:u.jsx("span",{className:"inline-block text-[10px] px-1.5 py-0.5 rounded-full border border-zinc-700 text-zinc-400",title:i,children:r})}),u.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function rNe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=e.channelGroup==="Paid Social"?"Paid":"Organic";return u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),u.jsx("td",{className:"py-1.5 text-zinc-500 max-w-[180px] truncate",title:e.medium,children:e.medium}),u.jsx("td",{className:"py-1.5",children:u.jsx("span",{className:"inline-block text-[10px] px-1.5 py-0.5 rounded-full border border-zinc-700 text-zinc-400",title:`GA4 channel group: ${e.channelGroup}`,children:r})}),u.jsx("td",{className:"py-1.5 text-right text-sky-400 tabular-nums",children:e.sessions.toLocaleString()}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function jh(e){e.invalidateQueries({queryKey:Ar.runs.all}),e.invalidateQueries({queryKey:Ar.projects.all})}function iNe(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function aNe(e,t){const n=e??"Project";return t==="gsc-sync"?`${n} will refresh after the sync completes.`:t==="inspect-sitemap"?`${n} will notify you when sitemap inspection finishes.`:`${n} will notify you when the run finishes.`}function Dv(e,t){TL({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),ft({title:iNe(e.kind),detail:aNe(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function sNe(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){ft({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)TL({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=QQ({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});ft({title:"Run-all batch queued",detail:n.length>0?`${t.length} project${t.length===1?"":"s"} queued, ${n.length} skipped because a run is already active.`:`${t.length} project${t.length===1?"":"s"} queued.`,tone:n.length>0?"caution":"neutral",dedupeKey:`batch:${r}`,dedupeMode:"replace"})}function Iv(e,t){if(e instanceof is&&e.code==="RUN_IN_PROGRESS"){ft({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}ft({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function y8(){const e=mo();return Zf({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>jH(t,n),onSuccess:(t,n)=>{jh(e),Dv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{Iv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function oNe(){const e=mo();return Zf({meta:{skipGlobalErrorToast:!0},mutationFn:t=>FH(t),onSuccess:t=>{jh(e),sNe(t)},onError:t=>{ft({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function lNe(){const e=mo();return Zf({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>OI(t,n),onSuccess:(t,n)=>{jh(e),Dv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{Iv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function cNe(){const e=mo();return Zf({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>t7(t),onSuccess:(t,n)=>{jh(e),Dv(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{Iv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function uNe(){const e=mo();return Zf({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>JH(t,n),onSuccess:(t,n)=>{jh(e),Dv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{Iv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}const dNe=["7d","30d","90d","all"];function fNe({projectName:e}){const[t,n]=S.useState(!1),[r,i]=S.useState([]),[a,o]=S.useState([]),[c,d]=S.useState([]),[f,p]=S.useState([]),[m,y]=S.useState([]),[v,x]=S.useState(null),[w,j]=S.useState(""),[k,O]=S.useState(""),[_,C]=S.useState("30"),[P,T]=S.useState(!1),[A,z]=S.useState("30d"),[I,q]=S.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[U,L]=S.useState(""),[J,ae]=S.useState(!0),[Q,K]=S.useState(!1),[X,ye]=S.useState(!1),[Se,R]=S.useState(!1),[F,B]=S.useState(!1),[M,V]=S.useState(!1),[se,ie]=S.useState(!1),[he,je]=S.useState(null),[ee,de]=S.useState(!1),[_e,Y]=S.useState(!1),[Ke,Me]=S.useState(null),[rt,it]=S.useState(""),[Nt,Lt]=S.useState(!1),[xn,ve]=S.useState(!1),[Ve,be]=S.useState("indexed"),[ze,Re]=S.useState(null),Oe=S.useMemo(()=>{if(!ze)return c;const{key:G,dir:Ne}=ze;return[...c].sort((yt,ct)=>{const _t=G===eo.CTR?Number.isFinite(yt.ctr)?yt.ctr:0:yt[G],Dr=G===eo.CTR?Number.isFinite(ct.ctr)?ct.ctr:0:ct[G];return Ne==="asc"?_t-Dr:Dr-_t})},[c,ze]),[te,xe]=S.useState([]),[Ee,Ge]=S.useState(null),[Je,nn]=S.useState(!1),[wn,Qe]=S.useState(null),[kt,$t]=S.useState(null),ue=r.find(G=>G.connectionType==="gsc"),Dn=c.length>0||f.length>0||m.length>0,lr=lNe(),No=cNe(),ps=uNe();async function ko(G){if(!G){o([]),j("");return}ye(!0);try{const{sites:Ne}=await HH(e);o(Ne),j(G.propertyId??Ne[0]?.siteUrl??"")}catch(Ne){o([]),Qe(Ne instanceof Error?Ne.message:"Failed to load Search Console properties")}finally{ye(!1)}}async function Ca(){B(!0);try{const G=await ZH(e,{startDate:I.startDate||void 0,endDate:I.endDate||void 0,query:I.query||void 0,page:I.page||void 0,limit:parseInt(I.limit,10)||20,window:A});d(G)}catch(G){d([]),Qe(G instanceof Error?G.message:"Failed to load GSC performance data")}finally{B(!1)}}async function Xr(){V(!0);try{const[G,Ne]=await Promise.all([WH(e,{url:U.trim()||void 0,limit:20}),QH(e)]);p(G),y(Ne)}catch(G){p([]),y([]),Qe(G instanceof Error?G.message:"Failed to load GSC inspection history")}finally{V(!1)}}async function Co(){de(!0);try{const[G,Ne]=await Promise.all([Mj(e),XH(e).catch(()=>[])]);je(G),xe(Ne)}catch(G){je(null),xe([]),Qe(G instanceof Error?G.message:"Failed to load coverage data")}finally{de(!1)}}async function ms(G){nn(!0),Qe(null);try{const Ne=await YE(e,{urls:G}),{succeeded:yt,failed:ct,total:_t}=Ne.summary;ft({title:"Indexing requested",detail:ct===0?`${yt} URL${yt!==1?"s":""} submitted for indexing.`:`${yt}/${_t} submitted successfully, ${ct} failed.`,tone:ct===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(Ne){Qe(Ne instanceof Error?Ne.message:"Failed to request indexing")}finally{nn(!1)}}async function $v(){nn(!0),Qe(null);try{const G=await YE(e,{urls:[],allUnindexed:!0}),{succeeded:Ne,failed:yt,total:ct}=G.summary;ft({title:"Indexing requested",detail:yt===0?`${Ne} unindexed URL${Ne!==1?"s":""} submitted for indexing.`:`${Ne}/${ct} submitted successfully, ${yt} failed.`,tone:yt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(G){Qe(G instanceof Error?G.message:"Failed to request indexing")}finally{nn(!1)}}async function _o(){if(rt.trim()){Lt(!0),Qe(null);try{await VH(e,"gsc",rt.trim()),i(G=>G.map(Ne=>Ne.connectionType==="gsc"?{...Ne,sitemapUrl:rt.trim()}:Ne)),ft({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),it("")}catch(G){Qe(G instanceof Error?G.message:"Failed to save sitemap URL")}finally{Lt(!1)}}}async function Gl(){Qe(null);try{const G=await No.mutateAsync({projectName:e,projectLabel:e});Me(G.sitemaps),i(Ne=>Ne.map(yt=>yt.connectionType==="gsc"?{...yt,sitemapUrl:G.primarySitemapUrl}:yt))}catch{}}async function Ao(){Y(!0),Qe(null);try{const G=await e7(e);Me(G.sitemaps),G.sitemaps.length===0&&$t("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(G){Qe(G instanceof Error?G.message:"Failed to list sitemaps")}finally{Y(!1)}}async function kh(){ae(!0),Qe(null);try{const[G,Ne]=await Promise.all([Rj().catch(()=>null),AI(e).catch(()=>[])]);n(!!G?.google?.configured),i(Ne);const yt=Ne.find(ct=>ct.connectionType==="gsc");await Promise.all([ko(yt),Ca(),Xr(),Co()])}finally{ae(!1)}}S.useEffect(()=>{kh()},[e]),S.useEffect(()=>{Ca()},[A]);async function Ch(){if(!t){Qe("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}K(!0),Qe(null),$t(null);try{const{authUrl:G}=await qH(e,"gsc");if(!G.startsWith("https://accounts.google.com/")){Qe("Unexpected OAuth redirect URL. Please try again.");return}const Ne=window.open(G,"_blank","width=600,height=700");if(!Ne){window.location.assign(G);return}$t("Finish the Google consent flow in the popup, then close it to refresh this project.");const yt=window.setInterval(()=>{Ne.closed&&(window.clearInterval(yt),$t(null),kh())},1e3)}catch(G){Qe(G instanceof Error?G.message:"Failed to start OAuth flow")}finally{K(!1)}}async function _h(){Qe(null),$t(null);try{await KH(e,"gsc"),i(G=>G.filter(Ne=>Ne.connectionType!=="gsc")),o([]),j("")}catch(G){Qe(G instanceof Error?G.message:"Failed to disconnect")}}async function Ah(){if(w){R(!0),Qe(null);try{await GH(e,"gsc",w),i(G=>G.map(Ne=>Ne.connectionType==="gsc"?{...Ne,propertyId:w}:Ne)),ft({title:"GSC property updated",detail:`${e} is now linked to ${w}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(G){Qe(G instanceof Error?G.message:"Failed to save GSC property")}finally{R(!1)}}}async function Hu(){Qe(null),$t(null);try{await lr.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(_,10)||void 0,full:P||void 0}})}catch{}}async function Vl(){if(k.trim()){ie(!0),Qe(null),$t(null);try{const G=await YH(e,k.trim());x(G),O(""),await Xr()}catch(G){Qe(G instanceof Error?G.message:"Failed to inspect URL")}finally{ie(!1)}}}return u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),u.jsx("h2",{children:"Google Search Console"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"flex gap-1",children:dNe.map(G=>u.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${A===G?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>z(G),children:G==="all"?"All":G},G))}),ue&&u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:F,onClick:()=>{Ca()},children:F?"Refreshing…":"Refresh data"})]})]}),wn&&u.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[wn,u.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>Qe(null),children:"×"})]}),kt&&u.jsxs("div",{className:"mb-3 rounded-lg border border-emerald-800/40 bg-emerald-950/20 px-3 py-2 text-sm text-emerald-300",children:[kt,u.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>$t(null),children:"×"})]}),J?u.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):u.jsxs("div",{className:"space-y-3",children:[u.jsxs(We,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),u.jsx("h3",{children:"Domain authorization"})]}),u.jsx(Et,{tone:ue?"positive":t?"caution":"negative",children:ue?"Connected":t?"Ready to connect":"App credentials missing"})]}),ue?u.jsxs("div",{className:"mt-3 space-y-3",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),u.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),u.jsx("span",{className:"text-xs text-zinc-500",children:ue.domain}),u.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:_h,children:"Disconnect"})]}),u.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",u.jsx("code",{children:ue.domain}),"."]})]}),u.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ue.propertyId??"No property selected yet"})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Ui(ue.updatedAt)})]})]})]}):u.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[u.jsx("p",{className:"text-sm text-zinc-300",children:t?"Generate a Google OAuth link for this project and have the client sign in with a Google account that already has access to the correct Search Console property.":"Set Google OAuth client credentials first. Once configured, you can generate a consent link for this project domain."}),u.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t?u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:Q,onClick:Ch,children:Q?"Opening…":"Connect Google Search Console"}):u.jsx(we,{type:"button",variant:"outline",size:"sm",asChild:!0,children:u.jsx(Qt,{to:"/settings",children:"Open Settings"})}),!t&&u.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),ue&&!ue.sitemapUrl&&u.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("span",{className:"mt-0.5 text-amber-400",children:u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5","aria-hidden":"true",children:u.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),u.jsx("p",{className:"mt-1 text-xs text-amber-400/70",children:"Canonry uses your sitemap to discover URLs for index coverage inspection. Auto-discover from GSC or enter it manually."}),u.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[u.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[u.jsx(we,{type:"button",size:"sm",disabled:No.isPending||!ue.propertyId,onClick:Gl,children:No.isPending?"Discovering…":"Auto-discover from GSC"}),u.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),u.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-amber-800/40 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-500 focus:border-amber-600 focus:outline-none",type:"url",placeholder:"https://example.com/sitemap.xml",value:rt,onChange:G=>it(G.target.value),onKeyDown:G=>G.key==="Enter"&&void _o()}),u.jsx(we,{type:"button",size:"sm",variant:"outline",disabled:Nt||!rt.trim(),onClick:_o,children:Nt?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ue||Dn)&&u.jsxs(u.Fragment,{children:[u.jsxs(We,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),u.jsx("h3",{children:"Index coverage"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[he&&he.notIndexed.length>0&&u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:Je,onClick:()=>{$v()},children:Je?"Requesting…":`Request indexing (${he.notIndexed.length})`}),u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:ee,onClick:()=>{Co()},children:ee?"Loading…":"Refresh coverage"})]})]}),he&&he.summary.total>0?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const G=he.summary.indexed+he.summary.notIndexed,Ne=G>0?he.summary.indexed/G:0,yt=G>0?he.summary.notIndexed/G:0,ct=54,_t=2*Math.PI*ct,Dr=_t*(1-Ne),Ti=_t*yt,gs=_t*Ne;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"relative h-48 w-48",children:[u.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[u.jsx("circle",{cx:"64",cy:"64",r:ct,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),u.jsx("circle",{cx:"64",cy:"64",r:ct,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:_t,strokeDashoffset:Dr,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),he.summary.notIndexed>0&&u.jsx("circle",{cx:"64",cy:"64",r:ct,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Ti} ${_t-Ti}`,strokeDashoffset:-gs,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),u.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[u.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(Ne*100).toFixed(0),"%"]}),u.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),u.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:he.summary.indexed.toLocaleString()}),u.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),u.jsx("div",{className:"h-8 w-px bg-zinc-800"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:he.summary.notIndexed.toLocaleString()}),u.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(he.reasonGroups??[]).length>0&&u.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(he.reasonGroups??[]).length," ",(he.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),he.summary.deindexed>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"h-8 w-px bg-zinc-800"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:he.summary.deindexed.toLocaleString()}),u.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),u.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(G=>{const Ne=G==="indexed"?he.indexed.length:G==="notIndexed"?he.notIndexed.length:he.deindexed.length,yt=G==="indexed"?"Indexed":G==="notIndexed"?"Not Indexed":"Deindexed";return u.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${Ve===G?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{be(G),Ge(null)},children:[yt," (",Ne,")"]},G)})}),u.jsxs("div",{className:"mt-3 overflow-x-auto",children:[Ve==="indexed"&&he.indexed.length>0&&u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Verdict"}),u.jsx("th",{className:"text-left",children:"Last Crawl"}),u.jsx("th",{className:"text-left",children:"Mobile"})]})}),u.jsx("tbody",{children:he.indexed.map(G=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),u.jsx("td",{className:"text-zinc-400",children:G.verdict??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:G.crawlTime?G.crawlTime.split("T")[0]:"—"}),u.jsx("td",{className:"text-zinc-400",children:G.isMobileFriendly===!0?"Yes":G.isMobileFriendly===!1?"No":"—"})]},G.id))})]}),Ve==="notIndexed"&&!Ee&&(he.reasonGroups??[]).length>0&&u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"Reason"}),u.jsx("th",{className:"text-right",children:"Pages"})]})}),u.jsx("tbody",{children:(he.reasonGroups??[]).map(G=>u.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Ge(G.reason),children:[u.jsx("td",{className:"text-zinc-200",children:G.reason}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:G.count})]},G.reason))})]}),Ve==="notIndexed"&&!Ee&&(he.reasonGroups??[]).length===0&&he.notIndexed.length>0&&u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Indexing State"}),u.jsx("th",{className:"text-left",children:"Coverage"})]})}),u.jsx("tbody",{children:he.notIndexed.map(G=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),u.jsx("td",{className:"text-zinc-400",children:G.indexingState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:G.coverageState??"Unknown"})]},G.id))})]}),Ve==="notIndexed"&&Ee&&(()=>{const G=(he.reasonGroups??[]).find(Ne=>Ne.reason===Ee);return G?u.jsxs("div",{children:[u.jsx("div",{className:"flex items-center gap-2 mb-3",children:u.jsxs("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Ge(null),children:["←"," Back to reasons"]})}),u.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-medium text-zinc-200",children:G.reason}),u.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[G.count," affected page",G.count!==1?"s":""]})]}),u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:Je,onClick:()=>{ms(G.urls.map(Ne=>Ne.url))},children:Je?"Requesting…":`Request indexing (${G.count})`})]}),u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Last Crawl"}),u.jsx("th",{className:"w-8"})]})}),u.jsx("tbody",{children:G.urls.map(Ne=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Ne.url}),u.jsx("td",{className:"text-zinc-400",children:Ne.crawlTime?Ne.crawlTime.split("T")[0]:"—"}),u.jsx("td",{children:u.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:Je,onClick:()=>{ms([Ne.url])},title:"Request indexing",children:"Index"})})]},Ne.id))})]})]}):null})(),Ve==="deindexed"&&he.deindexed.length>0&&u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Previous"}),u.jsx("th",{className:"text-left",children:"Current"}),u.jsx("th",{className:"text-left",children:"Detected"})]})}),u.jsx("tbody",{children:he.deindexed.map((G,Ne)=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),u.jsx("td",{className:"text-zinc-400",children:G.previousState}),u.jsx("td",{className:"text-zinc-400",children:G.currentState}),u.jsx("td",{className:"text-zinc-400",children:G.transitionDate.split("T")[0]})]},`${G.url}-${Ne}`))})]}),(Ve==="indexed"&&he.indexed.length===0||Ve==="notIndexed"&&!Ee&&he.notIndexed.length===0||Ve==="deindexed"&&he.deindexed.length===0)&&u.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:ee?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),u.jsxs(We,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),u.jsx("h3",{children:"Search performance"})]}),u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:F,onClick:()=>{Ca()},children:F?"Loading…":"Apply filters"})]}),c.length>0&&(()=>{const G=new Map;for(const at of c){const vt=G.get(at.date);vt?(vt.clicks+=at.clicks,vt.impressions+=at.impressions):G.set(at.date,{clicks:at.clicks,impressions:at.impressions})}const Ne=[...G.entries()].sort(([at],[vt])=>at.localeCompare(vt));if(Ne.length===0)return null;const yt=Math.max(...Ne.map(([,at])=>at.impressions),1),ct=Ne.reduce((at,[,vt])=>at+vt.clicks,0),_t=Ne.reduce((at,[,vt])=>at+vt.impressions,0),Dr=_t>0?(ct/_t*100).toFixed(1):"0.0",Ti=700,gs=220,br={top:12,bottom:36,left:48,right:12},Oh=Ti-br.left-br.right,Jr=gs-br.top-br.bottom,_a=Oh/Ne.length,Pi=Math.max(Math.min(_a*.35,24),4),Aa=Math.max(Pi*.15,1),Oo=at=>{if(at<=0)return 1;const vt=Math.pow(10,Math.floor(Math.log10(at))),Ir=at/vt,Ri=Ir<=1.5?1.5:Ir<=3?3:Ir<=5?5:10;return Math.ceil(Ri*vt)},zi=4,rn=Math.ceil(Oo(yt)/zi)*zi,Eh=Array.from({length:zi+1},(at,vt)=>rn/zi*vt),Th=at=>at>=1e3?`${(at/1e3).toFixed(at>=1e4?0:1)}k`:String(at);return u.jsxs("div",{className:"mt-3",children:[u.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),u.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",u.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:ct.toLocaleString()})]})]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),u.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",u.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:_t.toLocaleString()})]})]}),u.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",u.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Dr,"%"]})]})]}),u.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Ti} / ${gs}`},children:u.jsxs("svg",{viewBox:`0 0 ${Ti} ${gs}`,className:"h-full w-full",children:[Eh.map((at,vt)=>{const Ir=br.top+Jr-at/rn*Jr;return u.jsxs("g",{children:[u.jsx("line",{x1:br.left,y1:Ir,x2:Ti-br.right,y2:Ir,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),u.jsx("text",{x:br.left-6,y:Ir+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Th(at)})]},`t-${vt}`)}),Ne.map(([at,vt],Ir)=>{const Ri=br.left+_a*Ir+_a/2,Eo=vt.impressions/rn*Jr,Ph=vt.clicks/rn*Jr;return u.jsxs("g",{children:[u.jsx("title",{children:`${at}
|
|
289
|
-
Clicks: ${vt.clicks}
|
|
290
|
-
Impressions: ${vt.impressions}
|
|
291
|
-
CTR: ${vt.impressions>0?(vt.clicks/vt.impressions*100).toFixed(1):0}%`}),u.jsx("rect",{x:Ri-Pi-Aa/2,y:br.top+Jr-Eo,width:Pi,height:Math.max(Eo,1),rx:2,fill:"#3b82f6",opacity:.85}),u.jsx("rect",{x:Ri+Aa/2,y:br.top+Jr-Ph,width:Pi,height:Math.max(Ph,1),rx:2,fill:"#10b981",opacity:.85})]},at)}),(()=>{const at=Math.min(Ne.length,7);return Array.from({length:at},(vt,Ir)=>{const Ri=Ne.length===1?0:Math.round(Ir/(at-1)*(Ne.length-1)),Eo=br.left+_a*Ri+_a/2;return u.jsx("text",{x:Eo,y:gs-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:Ne[Ri][0].slice(5)},`xl-${Ri}`)})})()]})})]})})(),u.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:I.startDate,onChange:G=>q(Ne=>({...Ne,startDate:G.target.value}))}),u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:I.endDate,onChange:G=>q(Ne=>({...Ne,endDate:G.target.value}))}),u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter query",value:I.query,onChange:G=>q(Ne=>({...Ne,query:G.target.value}))}),u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter page",value:I.page,onChange:G=>q(Ne=>({...Ne,page:G.target.value}))}),u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"number",min:"1",placeholder:"Limit",value:I.limit,onChange:G=>q(Ne=>({...Ne,limit:G.target.value}))})]}),c.length>0?u.jsx("div",{className:"mt-3 overflow-x-auto",children:u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"Date"}),u.jsx("th",{className:"text-left",children:"Query"}),u.jsx("th",{className:"text-left",children:"Page"}),Object.values(eo).map(G=>u.jsx("th",{className:"text-right","aria-sort":ze?.key===G?ze.dir==="asc"?"ascending":"descending":"none",children:u.jsxs("button",{type:"button",className:"w-full cursor-pointer select-none text-right hover:text-zinc-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-zinc-400 rounded px-1 -mx-1",onClick:()=>Re(Ne=>Ne?.key===G?Ne.dir==="desc"?{key:G,dir:"asc"}:null:{key:G,dir:"desc"}),children:[DQ[G],ze?.key===G?ze.dir==="desc"?" ↓":" ↑":""]})},G))]})}),u.jsx("tbody",{children:Oe.map((G,Ne)=>u.jsxs("tr",{children:[u.jsx("td",{className:"text-zinc-400",children:G.date}),u.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:G.query}),u.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:G.page}),u.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:G.clicks.toLocaleString()}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:G.impressions.toLocaleString()}),u.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(G.ctr)?G.ctr*100:0).toFixed(1),"%"]}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:G.position.toFixed(1)})]},`${G.date}:${G.query}:${G.page}:${Ne}`))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),u.jsxs(We,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),u.jsx("h3",{children:"Inspect a URL"})]})}),u.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://example.com/page",value:k,onChange:G=>O(G.target.value),onKeyDown:G=>G.key==="Enter"&&void Vl()}),u.jsx(we,{type:"button",size:"sm",disabled:se||!ue?.propertyId||!k.trim(),onClick:Vl,children:se?"Inspecting…":"Inspect URL"})]}),v&&u.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:v.indexingState??"Unknown"})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:v.verdict??"Unknown"})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:PT(v.isMobileFriendly)})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Ui(v.crawlTime)})]})]})]}),u.jsxs(We,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),u.jsx("h3",{children:"Inspection log"})]}),u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:M,onClick:()=>{Xr()},children:M?"Loading…":"Refresh history"})]}),u.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter exact URL",value:U,onChange:G=>L(G.target.value)}),u.jsx(we,{type:"button",size:"sm",variant:"outline",disabled:M,onClick:()=>{Xr()},children:"Apply filter"})]}),f.length>0?u.jsx("div",{className:"mt-3 overflow-x-auto",children:u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Indexing"}),u.jsx("th",{className:"text-left",children:"Verdict"}),u.jsx("th",{className:"text-left",children:"Coverage"}),u.jsx("th",{className:"text-left",children:"Mobile"}),u.jsx("th",{className:"text-left",children:"Inspected"})]})}),u.jsx("tbody",{children:f.map(G=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),u.jsx("td",{className:"text-zinc-300",children:G.indexingState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:G.verdict??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:G.coverageState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:PT(G.isMobileFriendly)}),u.jsx("td",{className:"text-zinc-400",children:Ui(G.inspectedAt)})]},G.id))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),u.jsxs(We,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),u.jsx("h3",{children:"Recent indexing losses"})]})}),m.length>0?u.jsx("div",{className:"mt-3 overflow-x-auto",children:u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Previous"}),u.jsx("th",{className:"text-left",children:"Current"}),u.jsx("th",{className:"text-left",children:"Changed at"})]})}),u.jsx("tbody",{children:m.map(G=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),u.jsx("td",{className:"text-zinc-400",children:G.previousState??"Unknown"}),u.jsx("td",{className:"text-zinc-300",children:G.currentState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:Ui(G.transitionDate)})]},`${G.url}:${G.transitionDate}`))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ue&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:u.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>ve(G=>!G),children:[u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`h-4 w-4 text-zinc-500 transition-transform ${xn?"rotate-90":""}`,"aria-hidden":"true",children:u.jsx("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})}),u.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),xn&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[u.jsxs(We,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),u.jsx("h3",{children:"Pick the Search Console property"})]})}),u.jsxs("div",{className:"mt-3 space-y-2",children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),u.jsx("select",{id:`gsc-property-${e}`,className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:w,disabled:X||a.length===0,onChange:G=>j(G.target.value),children:a.length===0?u.jsx("option",{value:"",children:X?"Loading properties…":"No properties available"}):a.map(G=>u.jsxs("option",{value:G.siteUrl,children:[G.siteUrl," · ",G.permissionLevel]},G.siteUrl))}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(we,{type:"button",size:"sm",variant:"outline",disabled:X,onClick:()=>{ko(ue)},children:X?"Refreshing…":"Refresh properties"}),u.jsx(we,{type:"button",size:"sm",disabled:!w||Se,onClick:Ah,children:Se?"Saving…":"Save property"})]}),u.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),u.jsxs(We,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),u.jsx("h3",{children:"Import GSC performance data"})]})}),u.jsxs("div",{className:"mt-3 space-y-3",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),u.jsx("input",{id:`gsc-sync-days-${e}`,type:"number",min:"1",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",value:_,onChange:G=>C(G.target.value)})]}),u.jsxs("label",{className:"flex items-center gap-2 rounded border border-zinc-800/60 bg-zinc-900/20 px-3 py-2 text-sm text-zinc-300",children:[u.jsx("input",{type:"checkbox",checked:P,onChange:G=>T(G.target.checked)}),"Replace existing imported rows for the requested range"]})]}),u.jsx(we,{type:"button",size:"sm",disabled:lr.isPending||!ue.propertyId,onClick:Hu,children:lr.isPending?"Queueing…":"Queue sync"}),!ue.propertyId&&u.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),u.jsxs(We,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),u.jsx("h3",{children:"Sitemap configuration"})]})}),u.jsxs("div",{className:"mt-3 space-y-3",children:[ue.sitemapUrl&&u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:ue.sitemapUrl})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(we,{type:"button",size:"sm",variant:"outline",disabled:_e||!ue.propertyId,onClick:()=>{Ao()},children:_e?"Loading…":"Browse sitemaps from GSC"}),u.jsx(we,{type:"button",size:"sm",variant:"outline",disabled:No.isPending||!ue.propertyId,onClick:Gl,children:No.isPending?"Discovering…":"Auto-discover and queue inspection"})]}),u.jsx("p",{className:"text-xs text-zinc-500",children:"Browse lists available sitemaps without queueing a run. Auto-discover saves the primary sitemap and queues an inspection."}),Ke&&Ke.length>0&&u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[u.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",Ke.length,")"]}),Ke.map(G=>{const Ne=G.contents?.[0];return u.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-zinc-200 break-all",children:G.path}),G.lastSubmitted&&u.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",G.lastSubmitted.split("T")[0]]})]}),u.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[Ne&&u.jsxs("div",{className:"text-right",children:[u.jsxs("p",{className:"text-zinc-300",children:[Ne.indexed," / ",Ne.submitted]}),u.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),u.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>it(G.path),children:"Use"})]})]},G.path)})]}),u.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:ue.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:rt,onChange:G=>it(G.target.value),onKeyDown:G=>G.key==="Enter"&&rt.trim()&&void _o()}),u.jsx(we,{type:"button",size:"sm",disabled:Nt||!rt.trim(),onClick:_o,children:Nt?"Saving…":ue.sitemapUrl?"Update":"Save"})]}),u.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"Sitemap URL for inspection (leave empty for saved default)",id:`gsc-sitemap-inspect-${e}`}),u.jsx(we,{type:"button",size:"sm",variant:"outline",disabled:ps.isPending||!ue.propertyId,onClick:async()=>{const Ne=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ue.sitemapUrl||void 0;Qe(null),$t(null);try{await ps.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:Ne}})}catch{}},children:ps.isPending?"Queueing…":"Inspect sitemap"})]}),!ue.propertyId&&u.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function hNe({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=S.useState(!1),[a,o]=S.useState(!1),[c,d]=S.useState(null),[f,p]=S.useState(e.displayName),[m,y]=S.useState(e.canonicalDomain),[v,x]=S.useState(e.country),[w,j]=S.useState(e.language),[k,O]=S.useState(e.ownedDomains??[]),[_,C]=S.useState(""),[P,T]=S.useState(null),[A,z]=S.useState(!1),[I,q]=S.useState(!1),[U,L]=S.useState(""),[J,ae]=S.useState(""),[Q,K]=S.useState(""),[X,ye]=S.useState(""),[Se,R]=S.useState("");S.useEffect(()=>{r||(p(e.displayName),y(e.canonicalDomain),x(e.country),j(e.language),O(e.ownedDomains??[]))},[e,r]);function F(){i(!1),d(null),p(e.displayName),y(e.canonicalDomain),x(e.country),j(e.language),O(e.ownedDomains??[]),C("")}function B(){const Y=_.trim();Y&&(k.includes(Y)||O([...k,Y]),C(""))}function M(Y){O(k.filter(Ke=>Ke!==Y))}async function V(){if(!(!f.trim()||!m.trim()||!v.trim()||!w.trim())){o(!0),d(null);try{await t(e.name,{displayName:f.trim(),canonicalDomain:m.trim(),ownedDomains:k,country:v.trim(),language:w.trim()}),i(!1),ft({title:"Project settings saved",detail:`${f.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(Y){d(Y instanceof Error?Y.message:"Failed to save")}finally{o(!1)}}}async function se(){const Y=U.trim(),Ke=J.trim(),Me=Q.trim(),rt=X.trim();if(!(!Y||!Ke||!Me||!rt)){z(!0),T(null);try{const it={label:Y,city:Ke,region:Me,country:rt};Se.trim()&&(it.timezone=Se.trim()),await NH(e.name,it),n(),L(""),ae(""),K(""),ye(""),R(""),q(!1),ft({title:"Location added",detail:`${Y} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${Y}`,dedupeMode:"drop"})}catch(it){T(it instanceof Error?it.message:"Failed to add location")}finally{z(!1)}}}async function ie(Y){z(!0),T(null);try{await kH(e.name,Y),n(),ft({title:"Location removed",detail:`${Y} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${Y}`,dedupeMode:"drop"})}catch(Ke){T(Ke instanceof Error?Ke.message:"Failed to remove location")}finally{z(!1)}}async function he(Y){z(!0),T(null);try{await CH(e.name,Y),n(),ft({title:"Default location updated",detail:`${Y} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Ke){T(Ke instanceof Error?Ke.message:"Failed to set default location")}finally{z(!1)}}const je=f!==e.displayName||m!==e.canonicalDomain||v!==e.country||w!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),ee="w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",de="block text-xs font-medium text-zinc-400 mb-1",_e=U.trim()&&J.trim()&&Q.trim()&&X.trim();return u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),u.jsx("h2",{children:"Project settings"})]}),!r&&u.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!0),children:"Edit settings"})]}),c&&u.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[c,u.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>d(null),children:"×"})]}),r?u.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:de,children:"Display name"}),u.jsx("input",{className:ee,type:"text",value:f,onChange:Y=>p(Y.target.value),placeholder:"My Project"})]}),u.jsxs("div",{children:[u.jsx("label",{className:de,children:"Canonical domain"}),u.jsx("input",{className:ee,type:"text",value:m,onChange:Y=>y(Y.target.value),placeholder:"example.com"})]}),u.jsxs("div",{children:[u.jsx("label",{className:de,children:"Country"}),u.jsx("input",{className:ee,type:"text",value:v,onChange:Y=>x(Y.target.value),placeholder:"US",maxLength:2})]}),u.jsxs("div",{children:[u.jsx("label",{className:de,children:"Language"}),u.jsx("input",{className:ee,type:"text",value:w,onChange:Y=>j(Y.target.value),placeholder:"en"})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:de,children:"Owned domains"}),u.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(Y=>u.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[Y,u.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>M(Y),"aria-label":`Remove ${Y}`,children:"×"})]},Y))}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{className:`${ee} flex-1`,type:"text",placeholder:"docs.example.com",value:_,onChange:Y=>C(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&(Y.preventDefault(),B())}),u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:!_.trim(),onClick:B,children:"Add"})]})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[u.jsx(we,{type:"button",disabled:a||!je||!f.trim()||!m.trim(),onClick:V,children:a?"Saving...":"Save changes"}),u.jsx(we,{type:"button",variant:"outline",disabled:a,onClick:F,children:"Cancel"})]})]}):u.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:u.jsx("table",{className:"w-full text-sm",children:u.jsxs("tbody",{children:[u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),u.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),u.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),u.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?u.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(Y=>u.jsx("span",{className:"rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:Y},Y))}):u.jsx("span",{className:"text-zinc-500",children:"—"})})]}),u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),u.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),u.jsxs("tr",{className:"border-b border-zinc-800/40",children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),u.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),u.jsxs("tr",{children:[u.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),u.jsxs("td",{className:"px-4 py-2.5",children:[P&&u.jsxs("div",{className:"mb-2 rounded border border-rose-800/40 bg-rose-950/20 px-2 py-1 text-xs text-rose-300",children:[P,u.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>T(null),children:"×"})]}),(e.locations??[]).length>0?u.jsxs("table",{className:"w-full text-xs mb-2",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-zinc-600",children:[u.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),u.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),u.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),u.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),u.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),u.jsx("th",{className:"pb-1"})]})}),u.jsx("tbody",{children:e.locations.map(Y=>u.jsxs("tr",{className:"border-t border-zinc-800/30",children:[u.jsx("td",{className:"py-1.5 pr-3",children:u.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${Y.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:[Y.label,Y.label===e.defaultLocation?" ★":""]})}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Y.city}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Y.region}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Y.country}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:Y.timezone??"—"}),u.jsx("td",{className:"py-1.5",children:u.jsxs("div",{className:"flex items-center gap-1.5",children:[Y.label!==e.defaultLocation&&u.jsx("button",{type:"button",disabled:A,onClick:()=>he(Y.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${Y.label} as default location`,children:"Set default"}),u.jsx("button",{type:"button",disabled:A,onClick:()=>ie(Y.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${Y.label}`,children:"Remove"})]})})]},Y.label))})]}):u.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),I?u.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[u.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),u.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),u.jsx("input",{className:ee,type:"text",value:U,onChange:Y=>L(Y.target.value),placeholder:"nyc"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),u.jsx("input",{className:ee,type:"text",value:J,onChange:Y=>ae(Y.target.value),placeholder:"New York"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),u.jsx("input",{className:ee,type:"text",value:Q,onChange:Y=>K(Y.target.value),placeholder:"NY"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),u.jsx("input",{className:ee,type:"text",value:X,onChange:Y=>ye(Y.target.value),placeholder:"US",maxLength:2})]}),u.jsxs("div",{className:"col-span-2",children:[u.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),u.jsx("input",{className:ee,type:"text",value:Se,onChange:Y=>R(Y.target.value),placeholder:"America/New_York"})]})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[u.jsx(we,{type:"button",size:"sm",disabled:A||!_e,onClick:se,children:A?"Adding...":"Add location"}),u.jsx(we,{type:"button",size:"sm",variant:"outline",disabled:A,onClick:()=>{q(!1),T(null)},children:"Cancel"})]})]}):u.jsx(we,{type:"button",size:"sm",variant:"outline",onClick:()=>q(!0),children:"+ Add location"})]})]})]})})})]})}const pNe=[{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"}],ID=["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 mNe({projectName:e}){const[t,n]=S.useState("loading"),[r,i]=S.useState(!1),[a,o]=S.useState("daily"),[c,d]=S.useState(6),[f,p]=S.useState(""),[m,y]=S.useState("UTC"),[v,x]=S.useState(!1),[w,j]=S.useState(""),[k,O]=S.useState(!1),[_,C]=S.useState(!1),[P,T]=S.useState(null);S.useEffect(()=>{RH(e).then(n).catch(()=>n(null))},[e]);const A=()=>{if(t&&t!=="loading"){const U=$Q(t.preset??null,t.cronExpr);o(U.freq),d(U.hour),p(U.customCron);const L=ID.includes(t.timezone);y(L?t.timezone:"Other"),x(!L),j(L?"":t.timezone)}else o("daily"),d(6),p(""),y("UTC"),x(!1),j("");T(null),i(!0)},z=async()=>{O(!0),T(null);try{const L={timezone:v?w.trim()||"UTC":m};a==="custom"?L.cron=f.trim():L.preset=LQ(a,c);const J=await VE(e,L);n(J),i(!1),ft({title:"Schedule saved",detail:hx(J.preset??null,J.cronExpr,J.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(U){T(U instanceof Error?U.message:"Failed to save schedule")}finally{O(!1)}},I=async()=>{if(!(!t||t==="loading")){O(!0),T(null);try{const U={timezone:t.timezone,enabled:!t.enabled};t.preset?U.preset=t.preset:U.cron=t.cronExpr;const L=await VE(e,U);n(L),ft({title:L.enabled?"Schedule resumed":"Schedule paused",detail:hx(L.preset??null,L.cronExpr,L.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(U){T(U instanceof Error?U.message:"Failed to update schedule")}finally{O(!1)}}},q=async()=>{C(!0),T(null);try{await MH(e),n(null),i(!1),ft({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch(U){T(U instanceof Error?U.message:"Failed to remove schedule")}finally{C(!1)}};return u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),u.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!r&&u.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:A,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&u.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&u.jsx(We,{className:"surface-card compact-card",children:u.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!r&&t!==null&&u.jsxs(We,{className:"surface-card compact-card",children:[u.jsxs("div",{className:"flex items-start justify-between gap-4",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("p",{className:"text-sm font-medium text-zinc-200",children:hx(t.preset??null,t.cronExpr,t.timezone)}),u.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",u.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&u.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&u.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),u.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.jsx(Et,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:I,children:t.enabled?"Pause":"Resume"}),u.jsx(we,{type:"button",variant:"ghost",size:"sm",disabled:_,onClick:q,children:_?"Removing...":"Remove"})]})]}),P&&u.jsx("p",{className:"text-rose-400 text-sm mt-2",children:P})]}),r&&u.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),u.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:a,onChange:U=>o(U.target.value),children:pNe.map(U=>u.jsx("option",{value:U.value,children:U.label},U.value))})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),u.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none disabled:opacity-40",value:c,disabled:a==="twice-daily"||a==="custom",onChange:U=>d(parseInt(U.target.value)),children:Array.from({length:24},(U,L)=>u.jsx("option",{value:L,children:LS(L)},L))})]})]}),a==="custom"&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),u.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 font-mono focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"0 9 * * 1-5",value:f,onChange:U=>p(U.target.value)})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),u.jsxs("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:v?"Other":m,onChange:U=>{U.target.value==="Other"?(x(!0),y("Other")):(x(!1),y(U.target.value))},children:[ID.map(U=>u.jsx("option",{value:U,children:U},U)),u.jsxs("option",{value:"Other",children:["Other (enter manually)","…"]})]}),v&&u.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"e.g. America/New_York",value:w,onChange:U=>j(U.target.value)})]}),P&&u.jsx("p",{className:"text-rose-400 text-sm",children:P}),u.jsxs("div",{className:"flex gap-2 justify-end",children:[u.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),T(null)},children:"Cancel"}),u.jsx(we,{type:"button",size:"sm",disabled:k||a==="custom"&&!f.trim(),onClick:z,children:k?"Saving...":"Save schedule"})]})]})]})}const gNe=[{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 yNe({projectName:e}){const[t,n]=S.useState("loading"),[r,i]=S.useState(!1),[a,o]=S.useState(""),[c,d]=S.useState(["citation.lost","citation.gained"]),[f,p]=S.useState(!1),[m,y]=S.useState(null),[v,x]=S.useState({});S.useEffect(()=>{DH(e).then(n).catch(()=>n([]))},[e]);const w=_=>{d(C=>C.includes(_)?C.filter(P=>P!==_):[...C,_])},j=async()=>{if(!(!a.trim()||c.length===0)){p(!0),y(null);try{const _=await IH(e,{channel:"webhook",url:a.trim(),events:c});n(C=>C==="loading"?[_]:[...C,_]),o(""),d(["citation.lost","citation.gained"]),i(!1),ft({title:"Webhook added",detail:`Notifications will be sent to ${_.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(_){y(_ instanceof Error?_.message:"Failed to add webhook")}finally{p(!1)}}},k=async _=>{try{await LH(e,_),n(C=>C==="loading"?C:C.filter(P=>P.id!==_)),ft({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${_}`,dedupeMode:"drop"})}catch(C){y(C instanceof Error?C.message:"Failed to remove webhook")}},O=async _=>{x(C=>({...C,[_]:{state:"testing"}}));try{const C=await $H(e,_);x(P=>({...P,[_]:{state:C.ok?"ok":"fail",status:C.status}})),C.ok&&ft({title:"Test notification sent",detail:`Webhook returned status ${C.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${_}`,dedupeMode:"replace"})}catch{x(C=>({...C,[_]:{state:"fail"}}))}};return u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),u.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&u.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),y(null)},children:r?"Cancel":"+ Add webhook"})]}),r&&u.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),u.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://hooks.example.com/canonry",value:a,onChange:_=>o(_.target.value)})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),u.jsx("div",{className:"flex flex-wrap gap-3",children:gNe.map(_=>u.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[u.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:c.includes(_.value),onChange:()=>w(_.value)}),u.jsx("span",{className:"text-sm text-zinc-300",children:_.label})]},_.value))})]}),m&&u.jsx("p",{className:"text-rose-400 text-sm",children:m}),u.jsxs("div",{className:"flex gap-2 justify-end",children:[u.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),y(null)},children:"Cancel"}),u.jsx(we,{type:"button",size:"sm",disabled:f||!a.trim()||c.length===0,onClick:j,children:f?"Adding...":"Add webhook"})]})]}),t==="loading"&&u.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&u.jsx(We,{className:"surface-card compact-card",children:u.jsx("p",{className:"supporting-copy",children:"No webhooks configured. Add one to get alerted when citations change or runs complete."})}),t!=="loading"&&t.length>0&&u.jsxs("div",{className:"evidence-table-wrap",children:[u.jsxs("table",{className:"evidence-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Endpoint"}),u.jsx("th",{children:"Events"}),u.jsx("th",{children:"Status"}),u.jsx("th",{})]})}),u.jsx("tbody",{children:t.map(_=>u.jsxs("tr",{children:[u.jsx("td",{className:"evidence-keyword-cell",children:u.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:_.urlHost,children:_.urlDisplay??_.url})}),u.jsx("td",{children:u.jsx("div",{className:"flex flex-wrap gap-1",children:_.events.map(C=>u.jsx("span",{className:"inline-flex items-center rounded-full border border-zinc-700 bg-zinc-800/60 px-2 py-0.5 text-[10px] font-medium text-zinc-400 uppercase tracking-wide",children:C.replace("."," ")},C))})}),u.jsx("td",{children:u.jsx(Et,{tone:_.enabled?"positive":"neutral",children:_.enabled?"Active":"Paused"})}),u.jsx("td",{children:u.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[v[_.id]&&(()=>{const C=v[_.id],P=C.state==="testing"?"Sending…":C.state==="ok"?`Delivered${C.status?` (${C.status})`:""}`:`Failed${C.status?` (${C.status})`:""}`;return u.jsx(Et,{tone:C.state==="ok"?"positive":C.state==="fail"?"negative":"neutral",children:P})})(),u.jsx(we,{variant:"ghost",size:"sm",type:"button",disabled:v[_.id]?.state==="testing",onClick:()=>O(_.id),children:"Test"}),u.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>k(_.id),children:"Remove"})]})})]},_.id))})]}),m&&u.jsx("p",{className:"text-rose-400 text-sm mt-2",children:m})]})]})}function vNe({projectName:e,refreshNonce:t}){const[n,r]=S.useState(null),[i,a]=S.useState([]),[o,c]=S.useState(null),[d,f]=S.useState([]),[p,m]=S.useState([]),[y,v]=S.useState(null),[x,w]=S.useState(""),[j,k]=S.useState(""),[O,_]=S.useState(""),[C,P]=S.useState(!0),[T,A]=S.useState(!1),[z,I]=S.useState(null),[q,U]=S.useState("coverage");S.useEffect(()=>{L()},[e,t]);async function L(){P(!0),I(null);try{const R=await EI(e);if(r(R),R.connected){const[F,B,M,V]=await Promise.all([Dj(e).catch(()=>null),TI(e).catch(()=>[]),o7(e).catch(()=>[]),R.siteUrl?Promise.resolve([]):a7(e).then(se=>se.sites).catch(()=>[])]);c(F),f(B),m(M),a(V)}else c(null),f([]),m([]),a([])}catch(R){I(R instanceof Error?R.message:"Failed to load Bing data")}finally{P(!1)}}async function J(){if(j.trim()){I(null);try{const R=await r7(e,j.trim());k(""),R.availableSites.length>0&&a(R.availableSites),await L()}catch(R){I(R instanceof Error?R.message:"Failed to connect")}}}async function ae(){try{await i7(e),r(null),a([]),c(null),f([]),m([]),v(null),_(""),I(null)}catch(R){I(R instanceof Error?R.message:"Failed to disconnect")}}async function Q(){if(O)try{await s7(e,O),await L()}catch(R){I(R instanceof Error?R.message:"Failed to set site")}}async function K(){if(x.trim())try{const R=await PI(e,x.trim());v(R),f(F=>[R,...F])}catch(R){I(R instanceof Error?R.message:"Inspection failed")}}async function X(R){A(!0),I(null);try{const F=await WE(e,{urls:[R]}),{succeeded:B,failed:M,total:V}=F.summary;ft({title:"Bing submission requested",detail:M===0?`${B} URL submitted to Bing.`:`${B}/${V} submitted successfully, ${M} failed.`,tone:M===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${R}`,dedupeMode:"replace"})}catch(F){const B=F instanceof Error?F.message:"Submission failed";I(B),ft({title:"Bing submission failed",detail:B,tone:"negative",dedupeKey:`bing:indexing:${e}:${R}`,dedupeMode:"replace"})}finally{A(!1)}}async function ye(){A(!0),I(null),ft({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const R=await WE(e,{allUnindexed:!0}),{succeeded:F,failed:B,total:M}=R.summary;ft({title:"Bing submissions requested",detail:B===0?`${F}/${M} URL${M!==1?"s":""} submitted to Bing.`:`${F}/${M} submitted successfully, ${B} failed.`,tone:B===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(R){const F=R instanceof Error?R.message:"Batch submission failed";I(F),ft({title:"Bing submissions failed",detail:F,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{A(!1)}}if(C)return u.jsx(We,{className:"surface-card",children:u.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!n?.connected)return u.jsxs(We,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),u.jsx("h3",{children:"Domain authorization"})]}),u.jsx(Et,{tone:"caution",children:"Not connected"})]}),u.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),u.jsxs("div",{className:"mt-3",children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[u.jsx("input",{id:"bing-api-key",type:"password",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:j,onChange:R=>k(R.target.value),onKeyDown:R=>R.key==="Enter"&&J()}),u.jsx(we,{size:"sm",disabled:!j.trim(),onClick:J,children:"Connect"})]}),u.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",u.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]})]}),z&&u.jsx("p",{className:"mt-3 text-xs text-rose-400",children:z})]});if(!n.siteUrl)return u.jsxs(We,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),u.jsx("h3",{children:"Domain authorization"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Et,{tone:"positive",children:"Connected"}),u.jsx(we,{size:"sm",variant:"ghost",onClick:ae,children:"Disconnect"})]})]}),u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),u.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),u.jsx("span",{className:"text-xs text-zinc-500",children:n.domain})]}),u.jsx("p",{className:"mt-2 text-xs text-zinc-500",children:"The API key is connected, but no Bing site is selected yet. Pick the verified site that should receive inspections and indexing requests."})]}),u.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.domain})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.updatedAt?Ui(n.updatedAt):"—"})]})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),i.length>0?u.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[u.jsxs("select",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:O,onChange:R=>_(R.target.value),children:[u.jsx("option",{value:"",children:"Select a site..."}),i.map(R=>u.jsxs("option",{value:R.url,children:[R.url,R.verified?" (verified)":""]},R.url))]}),u.jsx(we,{size:"sm",disabled:!O,onClick:Q,children:"Set Site"})]}):u.jsx("p",{className:"mt-3 text-xs text-zinc-500",children:"No verified Bing sites are available yet. Verify the domain in Bing Webmaster Tools, then use the page-level refresh to reload everything."})]})]}),z&&u.jsx("p",{className:"mt-3 text-xs text-rose-400",children:z})]});const Se=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return u.jsxs("div",{className:"space-y-3",children:[u.jsxs(We,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),u.jsx("h3",{children:"Domain authorization"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Et,{tone:"positive",children:"Connected"}),u.jsx(we,{size:"sm",variant:"ghost",onClick:ae,children:"Disconnect"})]})]}),z&&u.jsx("p",{className:"mb-3 text-xs text-rose-400",children:z}),u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),u.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),u.jsx("span",{className:"text-xs text-zinc-500",children:n.domain})]}),u.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",u.jsx("code",{children:n.siteUrl}),"."]})]}),u.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.siteUrl})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.updatedAt?Ui(n.updatedAt):"—"})]})]})]})]}),u.jsxs(We,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),u.jsx("h3",{children:"Index monitoring"})]}),u.jsx("p",{className:"text-xs text-zinc-500",children:o?.lastInspectedAt?`Last inspected ${Ui(o.lastInspectedAt)}`:"No inspection history yet"})]}),u.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:Se.map(R=>u.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${q===R.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>U(R.key),children:R.label},R.key))}),q==="coverage"&&o&&u.jsxs("div",{className:"mt-4 space-y-4",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[u.jsx(gm,{label:"Indexed",value:o.summary.indexed,tone:"positive"}),u.jsx(gm,{label:"Not in index",value:o.summary.notIndexed+(o.summary.unknown??0),tone:"negative"}),u.jsx(gm,{label:"Status unknown",value:o.summary.unknown??0,tone:"neutral"}),u.jsx(gm,{label:"Coverage",value:`${o.summary.percentage}%`,tone:"neutral"})]}),o.notIndexed.length>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[u.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",o.notIndexed.length,")"]}),u.jsx(we,{size:"sm",variant:"ghost",disabled:T,onClick:ye,children:T?"Submitting…":"Submit all to Bing"})]}),u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),u.jsx("tbody",{children:o.notIndexed.map(R=>u.jsxs("tr",{className:"border-b border-zinc-800/50",children:[u.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:R.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:R.httpCode??"—"}),u.jsx("td",{className:"py-1.5 px-3 text-right",children:u.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:T,onClick:()=>X(R.url),children:"Submit"})})]},R.id))})]})})]}),(o.unknown??[]).length>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[u.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(o.unknown??[]).length,")"]}),u.jsx(we,{size:"sm",variant:"ghost",disabled:T,onClick:ye,children:T?"Submitting…":"Submit all to Bing"})]}),u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),u.jsx("tbody",{children:(o.unknown??[]).map(R=>u.jsxs("tr",{className:"border-b border-zinc-800/50",children:[u.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:R.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:R.lastCrawledDate?Ui(R.lastCrawledDate):"—"}),u.jsx("td",{className:"py-1.5 px-3 text-right",children:u.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:T,onClick:()=>X(R.url),children:"Submit"})})]},R.id))})]})})]}),o.indexed.length>0&&u.jsxs("div",{children:[u.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",o.indexed.length,")"]}),u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),u.jsx("tbody",{children:o.indexed.map(R=>u.jsxs("tr",{className:"border-b border-zinc-800/50",children:[u.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:R.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:R.lastCrawledDate?Ui(R.lastCrawledDate):"—"})]},R.id))})]})})]})]}),q==="coverage"&&!o&&u.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),q==="inspections"&&u.jsxs("div",{className:"mt-4 space-y-3",children:[u.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{type:"text",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"URL to inspect",value:x,onChange:R=>w(R.target.value),onKeyDown:R=>R.key==="Enter"&&K()}),u.jsx(we,{size:"sm",disabled:!x.trim(),onClick:K,children:"Inspect"})]}),y&&u.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[u.jsx("div",{className:"font-medium text-zinc-200",children:y.url}),u.jsxs("div",{className:"text-zinc-400",children:["In Index: ",u.jsx("span",{className:y.inIndex?"text-emerald-400":"text-rose-400",children:y.inIndex?"Yes":"No"})," · ","HTTP: ",y.httpCode??"—"," · ","Crawled: ",y.lastCrawledDate??"—"]})]}),d.length>0&&u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),u.jsx("tbody",{children:d.map(R=>u.jsxs("tr",{className:"border-b border-zinc-800/50",children:[u.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:R.url}),u.jsx("td",{className:"py-1.5 px-3",children:u.jsx(Et,{tone:R.inIndex?"positive":"negative",children:R.inIndex?"Yes":"No"})}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:R.httpCode??"—"}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:Ui(R.inspectedAt)})]},R.id))})]})})]}),q==="performance"&&u.jsx("div",{className:"mt-4",children:p.length===0?u.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Xp[eo.Clicks]}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Xp[eo.Impressions]}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Xp[eo.CTR]}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Xp[eo.Position]})]})}),u.jsx("tbody",{children:p.map((R,F)=>u.jsxs("tr",{className:"border-b border-zinc-800/50",children:[u.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:R.query}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:R.clicks}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:R.impressions}),u.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(R.ctr)?R.ctr*100:0).toFixed(1),"%"]}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:R.averagePosition.toFixed(1)})]},F))})]})})})]})]})}function bNe({projectName:e}){const[t,n]=S.useState("google"),[r,i]=S.useState(!0),[a,o]=S.useState("idle"),[c,d]=S.useState(null),f=S.useRef(null),[p,m]=S.useState(!1),[y,v]=S.useState(null),[x,w]=S.useState(null),[j,k]=S.useState(!1),[O,_]=S.useState(null),[C,P]=S.useState(null),[T,A]=S.useState(0);async function z(F=!1){F||i(!0),d(null);try{const[B,M,V]=await Promise.all([Rj().catch(()=>null),AI(e).catch(()=>[]),EI(e).catch(()=>null)]),se=M.find(je=>je.connectionType==="gsc")??null;m(!!B?.google?.configured),k(!!B?.bing?.configured),v(se),_(V);const[ie,he]=await Promise.all([se?Mj(e).catch(()=>null):Promise.resolve(null),V?.connected?Dj(e).catch(()=>null):Promise.resolve(null)]);w(ie),P(he)}catch(B){d(B instanceof Error?B.message:"Failed to load search console overview")}finally{i(!1)}}async function I(){if(a!=="idle")return;f.current?.abort();const F=new AbortController;f.current=F;const B=F.signal;o("syncing"),d(null);const M=[];try{async function V(){if(!y)return;const je=await OI(e);if(!je?.id)return;const ee=2e3,_e=Date.now()+12e4;for(;Date.now()<_e;){if(B.aborted||(await new Promise(Ke=>setTimeout(Ke,ee)),B.aborted))return;const Y=await uu(je.id).catch(()=>null);if(!Y)break;if(["completed","failed","cancelled"].includes(Y.status)){Y.status!=="completed"&&M.push(`Google sync ${Y.status}`);break}}}const se=10;async function ie(){if(!O?.connected)return;const je=await TI(e).catch(()=>[]),ee=[...new Set(je.map(de=>de.url))];if(ee.length!==0)for(let de=0;de<ee.length;de+=se){if(B.aborted)return;const _e=ee.slice(de,de+se),Ke=(await Promise.allSettled(_e.map(Me=>PI(e,Me)))).filter(Me=>Me.status==="rejected").length;Ke>0&&M.push(`${Ke} Bing inspection(s) failed`)}}const he=await Promise.allSettled([V(),ie()]);for(const je of he)je.status==="rejected"&&M.push(je.reason instanceof Error?je.reason.message:"Sync failed");if(B.aborted)return;o("reloading"),await z(!0),A(je=>je+1),M.length>0&&d(`Partial refresh: ${M.join("; ")}`)}catch(V){B.aborted||d(V instanceof Error?V.message:"Refresh failed")}finally{B.aborted||o("idle")}}S.useEffect(()=>(z(),()=>{f.current?.abort()}),[e]);const q=y?"positive":p?"caution":"negative",U=y?"Connected":p?"Ready to connect":"Needs setup",L=x?`${x.summary.percentage}% indexed`:y?"Awaiting coverage":"No coverage data",J=x?`${x.summary.notIndexed} not indexed${x.summary.deindexed>0?` · ${x.summary.deindexed} deindexed`:""}`:y?"Run sitemap inspection to populate coverage":p?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",ae=x?.lastInspectedAt??y?.updatedAt??null,Q=O?.connected?"positive":j?"caution":"negative",K=O?.connected?"Connected":j?"Ready to connect":"Needs setup",X=C?`${C.summary.percentage}% indexed`:O?.connected?"Awaiting coverage":"No coverage data",ye=C?C.summary.notIndexed+(C.summary.unknown??0):0,Se=C?`${ye} not in index`:O?.connected?"Inspect URLs to populate coverage":j?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",R=C?.lastInspectedAt??O?.updatedAt??null;return u.jsxs("div",{className:"space-y-6",children:[u.jsxs(We,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),u.jsx("h2",{children:"Search Engine Intelligence"}),u.jsx("p",{className:"mt-1 max-w-3xl text-sm leading-6 text-zinc-500",children:"Scan both engines at a glance, then open the Google or Bing workspace when you need to inspect coverage or take action."})]}),u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:r||a!=="idle",onClick:()=>{I()},children:r?"Loading…":a==="syncing"?"Refreshing Google & Bing…":a==="reloading"?"Reloading workspaces…":"Refresh all"})]}),c&&u.jsx("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:c}),u.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[u.jsx(cP,{eyebrow:"Google",title:"Google Search Console",status:r?"Loading…":U,tone:r?"neutral":q,targetLabel:"Selected property",targetValue:y?.propertyId??"No property selected",coverageValue:r?"Loading…":L,note:r?"Loading overview…":J,updatedAt:ae,active:t==="google",onClick:()=>n("google")}),u.jsx(cP,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:r?"Loading…":K,tone:r?"neutral":Q,targetLabel:"Selected site",targetValue:O?.siteUrl??"No site selected",coverageValue:r?"Loading…":X,note:r?"Loading overview…":Se,updatedAt:R,active:t==="bing",onClick:()=>n("bing")})]})]}),u.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([F,B])=>u.jsx("button",{type:"button",role:"tab","aria-selected":t===F,className:`project-subnav-link ${t===F?"project-subnav-link-active":""}`,onClick:()=>n(F),children:B},F))}),t==="google"&&u.jsx(fNe,{projectName:e}),t==="bing"&&u.jsxs("section",{className:"page-section-divider",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),u.jsx("h2",{children:"Bing Webmaster Tools"})]})}),u.jsx(vNe,{projectName:e,refreshNonce:T})]})]})}function xNe({insights:e}){const{openEvidence:t}=Au(),[n,r]=S.useState(null);return u.jsx("div",{className:"insight-list",children:e.map(i=>{const a=n===i.id,o=i.affectedPhrases.length>0;return u.jsxs("div",{children:[u.jsxs("div",{className:`insight-row insight-row-${i.tone} ${o?"cursor-pointer":""}`,onClick:o?()=>r(a?null:i.id):void 0,children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o&&u.jsx(Yf,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${a?"rotate-90":""}`}),u.jsx(Et,{tone:i.tone,children:i.actionLabel}),u.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:i.title}),u.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:i.detail})]}),o&&u.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[i.affectedPhrases.length," phrase",i.affectedPhrases.length>1?"s":""]})]}),a&&u.jsx("div",{className:"divide-y divide-zinc-800/20",children:i.affectedPhrases.map((c,d)=>u.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u.jsx(u1,{state:c.citationState}),u.jsx("span",{className:"text-sm text-zinc-200 truncate",children:c.keyword}),u.jsx("div",{className:"hidden sm:flex gap-1",children:c.provider&&u.jsx(Cf,{provider:c.provider})})]}),c.evidenceId&&u.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:f=>{f.stopPropagation(),t(c.evidenceId)},children:"View →"})]},c.evidenceId||`${i.id}-${d}`))})]},i.id)})})}function Lv({tab:e}){const{projectId:t}=Sy({from:"/projects/$projectId"}),n=yo(),{dashboard:r,isLoading:i,refetch:a}=Ul();if(!r||i)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-48"}),u.jsx("div",{className:"skeleton-text-sm w-32"})]}),u.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(ve=>u.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[u.jsx("div",{className:"skeleton-circle size-20"}),u.jsx("div",{className:"skeleton-text w-16 mt-3"})]},ve))}),u.jsxs("div",{className:"page-skeleton-card",children:[u.jsx("div",{className:"skeleton-text w-28"}),u.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(ve=>u.jsx("div",{className:"skeleton-text-sm w-full"},ve))})]})]});const o=Vee(r,t),[c,d]=S.useState(!1),[f,p]=S.useState(!1),[m,y]=S.useState(!1),[v,x]=S.useState(""),[w,j]=S.useState(!1),[k,O]=S.useState(!1),[_,C]=S.useState(""),[P,T]=S.useState(!1),[A,z]=S.useState(!1),[I,q]=S.useState(""),[U,L]=S.useState(!1),[J,ae]=S.useState(void 0),[Q,K]=S.useState(!1),[X,ye]=S.useState(null),[Se,R]=S.useState(!1),F=o?.visibilityEvidence??[],B=o?.project.name??"",M=o?.project.displayName||o?.project.name||B,V=y8(),se=S.useMemo(()=>new Set(F.map(ve=>ve.location??"")),[F]),ie=se.has(""),he=S.useMemo(()=>[...se].filter(Boolean),[se]);S.useEffect(()=>{if(J===void 0||J===""||!B){ye(null),R(!1);return}R(!0),CI(B,J).then(ve=>{ye(ve),R(!1)}).catch(()=>{ye(null),R(!1)})},[J,B]);const je=S.useMemo(()=>{if(!X)return null;const ve=new Map;for(const Ve of X){for(const[be,ze]of Object.entries(Ve.providerRuns??{}))ve.set(`${Ve.keyword}::${be}`,ze.map(Re=>({runId:Re.runId,citationState:Re.citationState,createdAt:Re.createdAt,answerMentioned:Re.answerMentioned,visibilityState:Re.visibilityState,visibilityTransition:Re.visibilityTransition})));(!Ve.providerRuns||Object.keys(Ve.providerRuns).length===0)&&ve.set(`${Ve.keyword}::`,Ve.runs.map(be=>({runId:be.runId,citationState:be.citationState,createdAt:be.createdAt,answerMentioned:be.answerMentioned,visibilityState:be.visibilityState,visibilityTransition:be.visibilityTransition})))}return ve},[X]),ee=S.useMemo(()=>{const ve=J!==void 0?F.filter(Ve=>J===""?!Ve.location:Ve.location===J):F;return je?ve.map(Ve=>{const be=je.get(`${Ve.keyword}::${Ve.provider}`)??je.get(`${Ve.keyword}::`);return be?{...Ve,runHistory:be}:Ve}):ve},[F,J,je]);if(!o)return u.jsx("div",{className:"page-container",children:u.jsxs(We,{className:"surface-card empty-card",children:[u.jsx("h1",{children:"Project not found"}),u.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),u.jsx(we,{asChild:!0,children:u.jsx(Qt,{to:"/",children:"Return to overview"})})]})});async function de(){try{await V.mutateAsync({projectName:B,projectLabel:M,sourceAction:"project-run"}),a()}catch{}}async function _e(){p(!0);try{await _H(B),ft({title:"Project deleted",detail:`${M} was removed.`,tone:"positive",dedupeKey:`project:delete:${B}`,dedupeMode:"drop"}),n({to:"/"}),a()}catch(ve){console.error("Failed to delete project:",ve)}finally{p(!1)}}async function Y(){try{const ve=await AH(B),Ve=typeof ve=="string"?ve:JSON.stringify(ve,null,2),be=new Blob([Ve],{type:"text/yaml"}),ze=URL.createObjectURL(be),Re=document.createElement("a");Re.href=ze,Re.download=`${B}.yaml`,Re.click()}catch(ve){ft({title:"Export failed",detail:ve instanceof Error?ve.message:"Could not export project YAML.",tone:"negative"})}}async function Ke(){const ve=v.split(`
|
|
292
|
-
`).map(Ve=>Ve.trim()).filter(Boolean);if(ve.length!==0){j(!0);try{await wH(B,ve),a(),x(""),y(!1)}finally{j(!1)}}}async function Me(){const ve=_.trim();if(ve){T(!0);try{const be=(await kI(B)).map(Re=>Re.domain),ze=[...new Set([...be,ve])];await _I(B,ze),a(),C(""),O(!1)}finally{T(!1)}}}async function rt(){const ve=I.trim();if(ve){L(!0);try{const Ve=o?.project.ownedDomains??[];await GE(B,[...Ve,ve]),a(),q(""),z(!1)}finally{L(!1)}}}async function it(ve){L(!0);try{const Ve=o?.project.ownedDomains??[];await GE(B,Ve.filter(be=>be!==ve)),a()}finally{L(!1)}}async function Nt(ve,Ve){await SH(ve,Ve),a()}const Lt=ve=>!Number.isNaN(Number.parseInt(ve,10)),xn=[{key:"overview",label:"Overview",href:`/projects/${o.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${o.project.id}/search-console`},{key:"traffic",label:"Traffic",href:`/projects/${o.project.id}/traffic`},{key:"analytics",label:"Visibility",href:`/projects/${o.project.id}/analytics`}];return u.jsxs("div",{className:"page-container",children:[c?u.jsxs(We,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[u.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),u.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",u.jsx("strong",{className:"text-zinc-200",children:o.project.displayName||o.project.name})," and all its key phrases, competitors, runs, and snapshots. This cannot be undone."]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(we,{type:"button",variant:"destructive",disabled:f,onClick:_e,children:f?"Deleting...":"Yes, delete project"}),u.jsx(we,{type:"button",variant:"outline",disabled:f,onClick:()=>d(!1),children:"Cancel"})]})]}):null,u.jsxs("div",{className:"page-header",children:[u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:o.project.displayName||o.project.name}),u.jsxs("p",{className:"page-subtitle",children:[o.project.canonicalDomain,(o.project.ownedDomains??[]).length===0&&!A&&u.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>z(!0),children:"+ add domain"})," "," · ",o.contextLabel]}),u.jsxs("div",{className:"tag-row",children:[u.jsx("span",{className:"tag",children:o.project.country}),u.jsx("span",{className:"tag",children:o.project.language.toUpperCase()}),o.project.tags.map(ve=>u.jsx("span",{className:"tag",children:ve},ve))]}),((o.project.ownedDomains??[]).length>0||A)&&u.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[u.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(o.project.ownedDomains??[]).map(ve=>u.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[ve,u.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:U,onClick:()=>it(ve),"aria-label":`Remove ${ve}`,children:"×"})]},ve)),A?u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-1.5 py-0.5 text-xs text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none w-40",type:"text",placeholder:"docs.example.com",value:I,onChange:ve=>q(ve.target.value),onKeyDown:ve=>ve.key==="Enter"&&rt(),autoFocus:!0}),u.jsx(we,{type:"button",size:"sm",disabled:!I.trim()||U,onClick:rt,children:U?"...":"Add"}),u.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{z(!1),q("")},children:"Cancel"})]}):u.jsx("button",{type:"button",className:"rounded-full border border-dashed border-zinc-700 px-2 py-0.5 text-[10px] uppercase tracking-wide text-zinc-500 hover:text-zinc-300 hover:border-zinc-500 transition-colors",onClick:()=>z(!0),children:"+ domain"})]})]}),u.jsxs("div",{className:"page-header-right",children:[u.jsx("p",{className:"text-sm text-zinc-500",children:o.dateRangeLabel}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(we,{type:"button",variant:"outline",size:"icon",onClick:Y,"aria-label":"Export project as YAML",children:u.jsx(I7,{className:"h-4 w-4 text-zinc-400"})}),u.jsx(we,{type:"button",variant:"outline",size:"icon",onClick:()=>d(!0),"aria-label":"Delete project",children:u.jsx(cG,{className:"h-4 w-4 text-zinc-400"})}),u.jsx(we,{type:"button",disabled:V.isPending,onClick:de,children:V.isPending?"Starting...":"Run now"})]})]})]}),u.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:xn.map(ve=>u.jsx(Qt,{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"?u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"gauge-row",children:[u.jsx(l3,{value:o.visibilitySummary.value,label:o.visibilitySummary.label,delta:o.visibilitySummary.delta,tone:o.visibilitySummary.tone,description:o.visibilitySummary.description,tooltip:o.visibilitySummary.tooltip,isNumeric:Lt(o.visibilitySummary.value),progress:o.visibilitySummary.progress,providerCoverage:o.visibilitySummary.providerCoverage}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Key Phrases",u.jsx(Wn,{text:"Tracked key phrases where competitors are cited in the latest completed visibility run but your domain is not."})]}),u.jsxs("p",{className:"metric-card-big-value",children:[u.jsx("span",{className:"text-zinc-50",children:o.gapKeyPhrases.value}),u.jsxs("span",{className:"text-zinc-600",children:[" / ",o.keywordCounts.total]})]}),u.jsx("div",{className:"metric-card-bar",children:u.jsx("div",{className:`metric-card-bar-fill progress-fill-${o.gapKeyPhrases.tone}`,style:{width:o.gapKeyPhrases.progress!==void 0?`${o.gapKeyPhrases.progress*100}%`:"0%"}})}),u.jsx("p",{className:"metric-card-detail",children:o.gapKeyPhrases.delta}),u.jsx("p",{className:"metric-card-sub",children:o.gapKeyPhrases.description})]}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",u.jsx(Wn,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),u.jsxs("p",{className:"metric-card-big-value",children:[u.jsx("span",{className:"text-zinc-50",children:o.indexCoverage.value}),u.jsx("span",{className:"text-zinc-600",children:"%"})]}),u.jsx("div",{className:"metric-card-bar",children:u.jsx("div",{className:`metric-card-bar-fill progress-fill-${o.indexCoverage.tone}`,style:{width:`${Number.parseInt(o.indexCoverage.value,10)||0}%`}})}),u.jsx("p",{className:"metric-card-detail",children:o.indexCoverage.delta}),u.jsx("p",{className:"metric-card-sub",children:o.indexCoverage.description})]}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",u.jsx(Wn,{text:"Keyword-level citation changes compared to the previous completed run."})]}),o.movementSummary.hasPreviousRun?u.jsxs("div",{className:"metric-card-movement",children:[u.jsxs("span",{className:o.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",o.movementSummary.gained," gained"]}),u.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),u.jsxs("span",{className:o.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",o.movementSummary.lost," lost"]})]}):u.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),u.jsx("p",{className:"metric-card-sub mt-auto",children:o.movementSummary.gained===0&&o.movementSummary.lost===0&&o.movementSummary.hasPreviousRun?"No changes since last run":o.movementSummary.gained>o.movementSummary.lost?"Visibility improving":o.movementSummary.lost>o.movementSummary.gained?"Visibility declining":""})]})]}),o.providerScores.length>1&&u.jsxs("section",{className:"page-section-divider",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),u.jsxs("h2",{children:["Visibility by model ",u.jsx(Wn,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked key phrases. Switching models can significantly affect citation rates."})]})]})}),u.jsx("div",{className:"evidence-table-wrap",children:u.jsxs("table",{className:"evidence-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Model"}),u.jsx("th",{children:"Score"}),u.jsx("th",{children:"Cited key phrases"})]})}),u.jsx("tbody",{children:o.providerScores.map(ve=>u.jsxs("tr",{children:[u.jsx("td",{children:u.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[u.jsx(Cf,{provider:ve.provider}),ve.model&&u.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:ve.model})]})}),u.jsx("td",{children:u.jsxs("span",{className:`font-semibold ${ve.score>=70?"text-emerald-400":ve.score>=40?"text-amber-400":"text-rose-400"}`,children:[ve.score,"%"]})}),u.jsxs("td",{className:"text-zinc-500",children:[ve.cited," of ",ve.total]})]},`${ve.provider}::${ve.model??"unknown"}`))})]})})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),u.jsx("h2",{children:"Citation signals"})]})}),u.jsx(xNe,{insights:o.insights})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),u.jsx("h2",{children:"Key phrase citation tracking"})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("p",{className:"supporting-copy",children:[new Set(o.visibilityEvidence.map(ve=>ve.keyword)).size," key phrases tracked"]}),u.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!m),children:m?"Cancel":"+ Add key phrases"})]})]}),m&&u.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[u.jsx("textarea",{className:"w-full resize-none rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",rows:3,placeholder:"Enter key phrases, one per line",value:v,onChange:ve=>x(ve.target.value)}),u.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[u.jsxs("p",{className:"text-xs text-zinc-500",children:[v.split(`
|
|
293
|
-
`).filter(ve=>ve.trim()).length," key phrases"]}),u.jsx(we,{type:"button",size:"sm",disabled:!v.trim()||w,onClick:Ke,children:w?"Adding...":"Add key phrases"})]})]}),o.project.locations&&o.project.locations.length>0&&u.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[u.jsx("button",{className:`filter-chip ${J===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":J===void 0,onClick:()=>{ae(void 0)},children:"All locations"}),o.project.locations.map(ve=>se.has(ve.label)&&u.jsx("button",{className:`filter-chip ${J===ve.label?"filter-chip-active":""}`,type:"button","aria-pressed":J===ve.label,onClick:()=>{ae(ve.label),K(!1)},children:ve.label},ve.label)),ie&&u.jsx("button",{className:`filter-chip ${J===""?"filter-chip-active":""}`,type:"button","aria-pressed":J==="",onClick:()=>{ae(""),K(!1)},children:"No location"}),he.length>1&&J===void 0&&u.jsx("button",{className:`filter-chip filter-chip-compare ${Q?"filter-chip-active":""}`,type:"button","aria-pressed":Q,onClick:()=>K(ve=>!ve),title:"Side-by-side location comparison",children:"Compare"})]}),u.jsx(Uoe,{evidence:ee})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),u.jsx("h2",{children:"Competitive landscape"})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("p",{className:"supporting-copy",children:[o.competitors.length," tracked"]}),u.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:()=>O(!k),children:k?"Cancel":"+ Add competitor"})]})]}),k&&u.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"competitor.com",value:_,onChange:ve=>C(ve.target.value),onKeyDown:ve=>ve.key==="Enter"&&Me()}),u.jsx(we,{type:"button",size:"sm",disabled:!_.trim()||P,onClick:Me,children:P?"Adding...":"Add"})]}),u.jsx(Boe,{competitors:o.competitors})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),u.jsx("h2",{children:"Recent execution history"})]})}),u.jsx("div",{className:"run-list",children:o.recentRuns.map(ve=>u.jsx(o3,{run:ve},ve.id))})]}),u.jsx(hNe,{project:{...o.project,displayName:o.project.displayName??o.project.name,defaultLocation:o.project.defaultLocation??null},onUpdateProject:Nt,onRefresh:()=>{a()}}),u.jsx(mNe,{projectName:o.project.name}),u.jsx(yNe,{projectName:o.project.name})]}):e==="analytics"?u.jsx(Hje,{projectName:o.project.name}):e==="traffic"?u.jsx(Qje,{projectName:o.project.name}):u.jsx(bNe,{projectName:o.project.name})]})}function wNe(){const{dashboard:e,isLoading:t}=Ul(),n=oNe();if(!e||t)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-20"}),u.jsx("div",{className:"skeleton-text-sm w-72"})]}),u.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(d=>u.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[u.jsxs("div",{className:"flex-1 space-y-1.5",children:[u.jsx("div",{className:"skeleton-text w-40"}),u.jsx("div",{className:"skeleton-text-sm w-56"})]}),u.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},d))})]});const r=e.runs,[i,a]=S.useState("all"),o=i==="all"?r:r.filter(d=>d.status===i),c=async()=>{try{await n.mutateAsync(void 0)}catch{}};return u.jsxs("div",{className:"page-container",children:[u.jsxs("div",{className:"page-header",children:[u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Runs"}),u.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),u.jsx(we,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{c()},children:n.isPending?"Queueing…":"Run all projects"})]}),u.jsxs("section",{children:[u.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(d=>u.jsx("button",{className:`filter-chip ${i===d?"filter-chip-active":""}`,type:"button","aria-pressed":i===d,onClick:()=>a(d),children:d==="all"?"All runs":Ay(d)},d))}),u.jsx("div",{className:"run-list",children:o.length>0?o.map(d=>u.jsx(o3,{run:d},d.id)):u.jsxs(We,{className:"surface-card empty-card",children:[u.jsx("h2",{children:"No runs match this filter"}),u.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function SNe({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[a,o]=S.useState(""),[c,d]=S.useState(""),[f,p]=S.useState(""),[m,y]=S.useState(""),[v,x]=S.useState(""),[w,j]=S.useState(""),[k,O]=S.useState(!1),[_,C]=S.useState(null),[P,T]=S.useState(!1),A=i?c.trim().length>0:a.trim().length>0;async function z(){if(A){O(!0),C(null),T(!1);try{const q=Q=>{const K=parseInt(Q.trim(),10);return Number.isFinite(K)&&K>0?K:void 0},U={},L=q(m);L!==void 0&&(U.maxConcurrency=L);const J=q(v);J!==void 0&&(U.maxRequestsPerMinute=J);const ae=q(w);ae!==void 0&&(U.maxRequestsPerDay=ae),await PH(e.toLowerCase(),{...a.trim()?{apiKey:a.trim()}:{},...c.trim()?{baseUrl:c.trim()}:{},...f.trim()?{model:f.trim()}:{},...Object.keys(U).length>0?{quota:U}:{}}),o(""),d(""),p(""),y(""),x(""),j(""),T(!0),ft({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(q){C(q instanceof Error?q.message:"Failed to update provider")}finally{O(!1)}}}const I=n??"Use default model";return u.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[i&&u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),u.jsx("input",{id:`base-url-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"http://localhost:11434/v1",value:c,onChange:q=>d(q.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",i?" (optional)":""]}),t&&u.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:["Get API key ","↗"]})]}),u.jsx("input",{id:`api-key-${e}`,type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:i?"Optional — most local servers don't need one":`Enter ${e} API key`,value:a,onChange:q=>o(q.target.value)})]}),u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),u.jsx("input",{id:`model-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:I,value:f,onChange:q=>p(q.target.value)})]}),u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),u.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[u.jsxs("div",{children:[u.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Concurrent",value:m,onChange:q=>y(q.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),u.jsxs("div",{children:[u.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/min",value:v,onChange:q=>x(q.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),u.jsxs("div",{children:[u.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/day",value:w,onChange:q=>j(q.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),_&&u.jsx("p",{className:"text-xs text-rose-400",children:_}),P&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),u.jsx(we,{type:"button",size:"sm",disabled:!A||k,onClick:z,children:k?"Saving...":"Save"})]})}function jNe({onSaved:e}){const[t,n]=S.useState(""),[r,i]=S.useState(""),[a,o]=S.useState(!1),[c,d]=S.useState(null),[f,p]=S.useState(!1),m=t.trim().length>0&&r.trim().length>0;async function y(){if(m){o(!0),d(null),p(!1);try{await zH({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),p(!0),ft({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),e()}catch(v){d(v instanceof Error?v.message:"Failed to update Google OAuth credentials")}finally{o(!1)}}}return u.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),u.jsxs("a",{href:"https://console.cloud.google.com/apis/credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:["Google Cloud ","↗"]})]}),u.jsx("input",{id:"google-client-id",type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client ID",value:t,onChange:v=>n(v.target.value)})]}),u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),u.jsx("input",{id:"google-client-secret",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client secret",value:r,onChange:v=>i(v.target.value)})]}),u.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",u.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),c&&u.jsx("p",{className:"text-xs text-rose-400",children:c}),f&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),u.jsx(we,{type:"button",size:"sm",disabled:!m||a,onClick:y,children:a?"Saving...":"Save Google OAuth app"})]})}function NNe(){const[e,t]=S.useState(null),[n,r]=S.useState(null),[i,a]=S.useState(!1),[o,c]=S.useState("localhost"),[d,f]=S.useState("9222"),[p,m]=S.useState(!1);return S.useEffect(()=>{ZE().then(t).catch(y=>{const v=y instanceof Error?y.message:String(y);v.includes("501")||r(v)})},[]),u.jsxs(We,{className:"surface-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),u.jsx("h2",{children:"ChatGPT (CDP)"})]}),u.jsx(Et,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),u.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&u.jsxs("div",{children:[u.jsx("dt",{children:"Endpoint"}),u.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&u.jsxs("div",{children:[u.jsx("dt",{children:"Browser"}),u.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&u.jsxs("div",{children:[u.jsx("dt",{children:"Tabs"}),u.jsx("dd",{children:e.targets.map(y=>u.jsxs("span",{className:"mr-2",children:[y.name,": ",y.alive?"● alive":"○ idle"]},y.name))})]})]}),u.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:e?.connected?"Connected to Chrome via CDP. Launch Chrome with --remote-debugging-port to use this provider.":n||"Not configured. Set an endpoint below or run: canonry cdp connect --host localhost --port 9222"}),u.jsx("div",{className:"mt-2",children:u.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!i),children:i?"Cancel":e?.connected?"Update endpoint":"Configure"})}),i&&u.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async y=>{y.preventDefault(),m(!0);try{await n7(o,parseInt(d,10)||9222);const v=await ZE().catch(()=>null);v&&t(v),a(!1),ft({title:"CDP endpoint saved",detail:`${o}:${parseInt(d,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}catch(v){r(v instanceof Error?v.message:String(v))}finally{m(!1)}},children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"localhost",value:o,onChange:y=>c(y.target.value),"aria-label":"CDP host"}),u.jsx("input",{className:"w-24 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"9222",value:d,onChange:y=>f(y.target.value),"aria-label":"CDP port"})]}),u.jsx("div",{children:u.jsx(we,{type:"submit",size:"sm",disabled:p,children:p?"Saving…":"Save endpoint"})})]})]})}const kNe={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function CNe(){const e=Xf(),{dashboard:t}=Ul(),n=t?.settings??e?.dashboard?.settings,a=Dy(!e,e?.health).data??e?.health??kNe,[o,c]=S.useState(null),[d,f]=S.useState(!1),[p,m]=S.useState(!1),[y,v]=S.useState(""),[x,w]=S.useState(!1),[j,k]=S.useState(null),[O,_]=S.useState(!1);return n?u.jsxs("div",{className:"page-container",children:[u.jsx("div",{className:"page-header",children:u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Settings"}),u.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),u.jsxs("section",{className:"settings-grid",children:[n.providerStatuses.map(C=>u.jsxs(We,{className:"surface-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),u.jsx("h2",{children:C.displayName??C.name})]}),u.jsx(Et,{tone:C.state==="ready"?"positive":"caution",children:C.state==="ready"?"Ready":"Needs config"})]}),u.jsxs("dl",{className:"definition-list mt-3",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Model"}),u.jsx("dd",{className:"font-mono text-xs",children:C.model})]}),C.quota&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Concurrency"}),u.jsx("dd",{children:C.quota.maxConcurrency})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Rate limit"}),u.jsxs("dd",{children:[C.quota.maxRequestsPerMinute,"/min · ",C.quota.maxRequestsPerDay,"/day"]})]})]})]}),u.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:C.detail}),u.jsx("div",{className:"mt-2",children:u.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:()=>c(o===C.name?null:C.name),children:o===C.name?"Cancel":C.state==="ready"?C.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),o===C.name&&u.jsx(SNe,{providerName:C.name,keyUrl:C.keyUrl,modelHint:C.modelHint,onSaved:()=>{c(null)}})]},C.name)),u.jsxs(We,{className:"surface-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),u.jsx("h2",{children:"Search Console OAuth"})]}),u.jsx(Et,{tone:n.google.state==="ready"?"positive":"caution",children:n.google.state==="ready"?"Ready":"Needs config"})]}),u.jsxs("dl",{className:"definition-list mt-3",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Auth model"}),u.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Storage"}),u.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),u.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.google.detail}),u.jsx("div",{className:"mt-2",children:u.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:()=>f(!d),children:d?"Cancel":n.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),d&&u.jsx(jNe,{onSaved:()=>{f(!1)}})]}),u.jsxs(We,{className:"surface-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),u.jsx("h2",{children:"Webmaster Tools"})]}),u.jsx(Et,{tone:n.bing.state==="ready"?"positive":"caution",children:n.bing.state==="ready"?"Ready":"Needs config"})]}),u.jsxs("dl",{className:"definition-list mt-3",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Auth model"}),u.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Storage"}),u.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),u.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.bing.detail}),u.jsx("div",{className:"mt-2",children:u.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":n.bing.state==="ready"?"Update API key":"Configure Bing"})}),p&&u.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),u.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]}),u.jsx("input",{id:"bing-api-key",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:y,onChange:C=>v(C.target.value)})]}),u.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",u.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),j&&u.jsx("p",{className:"text-xs text-rose-400",children:j}),O&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),u.jsx(we,{type:"button",size:"sm",disabled:!y.trim()||x,onClick:async()=>{if(y.trim()){w(!0),k(null),_(!1);try{await l7(y.trim()),v(""),_(!0),m(!1),ft({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{w(!1)}}},children:x?"Saving...":"Save Bing API key"})]})]}),u.jsx(NNe,{}),u.jsxs(We,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),u.jsx("h2",{children:"API and worker"})]})}),u.jsxs("div",{className:"compact-stack",children:[u.jsxs("div",{className:"health-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:"API"}),u.jsx("p",{className:"supporting-copy",children:a.apiStatus.detail})]}),u.jsx(Et,{tone:fg(a.apiStatus),title:ho(a.apiStatus),children:a.apiStatus.state==="ok"?"Healthy":"Attention"})]}),u.jsxs("div",{className:"health-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:"Worker"}),u.jsx("p",{className:"supporting-copy",children:a.workerStatus.detail})]}),u.jsx(Et,{tone:fg(a.workerStatus),title:ho(a.workerStatus),children:a.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),u.jsx("section",{className:"page-section",children:u.jsxs(We,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),u.jsx("h2",{children:"Operational guidance"})]})}),u.jsx("ul",{className:"detail-list",children:n.selfHostNotes.map(C=>u.jsx("li",{children:C},C))}),u.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const _Ne=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Key phrases",description:"Add key phrases to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function ANe({current:e,labels:t}){return u.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((n,r)=>{const i=r<e,a=r===e;return u.jsxs("div",{className:`setup-step ${i?"setup-step-done":""} ${a?"setup-step-active":""}`,role:"listitem","aria-current":a?"step":void 0,children:[u.jsx("span",{className:"setup-step-number",children:i?"✓":r+1}),u.jsx("span",{className:"setup-step-label",children:n.label})]},n.label)})})}function ONe(){const e=Xf(),{dashboard:t,isLoading:n,refetch:r}=Ul(),i=t??e?.dashboard;if(!i||n)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-24"}),u.jsx("div",{className:"skeleton-text-sm w-80"})]}),u.jsxs("div",{className:"page-skeleton-card",children:[u.jsx("div",{className:"skeleton-text w-32"}),u.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(ue=>u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"space-y-1 flex-1",children:[u.jsx("div",{className:"skeleton-text w-24"}),u.jsx("div",{className:"skeleton-text-sm w-48"})]}),u.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},ue))})]})]});const a=i.settings,d=Dy(!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=HQ(i.setup,d,a),p=yo(),[m,y]=S.useState(0),[v,x]=S.useState(""),[w,j]=S.useState(""),[k,O]=S.useState(""),[_,C]=S.useState("US"),[P,T]=S.useState("en"),[A,z]=S.useState(null),[I,q]=S.useState(null),[U,L]=S.useState(null),[J,ae]=S.useState(!1),[Q,K]=S.useState(""),[X,ye]=S.useState(!1),[Se,R]=S.useState(null),[F,B]=S.useState(!1),M=a.providerStatuses.filter(ue=>ue.state==="ready"),[V,se]=S.useState(M[0]?.name??""),[ie,he]=S.useState(5),[je,ee]=S.useState(!1),[de,_e]=S.useState(null),[Y,Ke]=S.useState(""),[Me,rt]=S.useState(!1),[it,Nt]=S.useState(null),[Lt,xn]=S.useState(!1),[ve,Ve]=S.useState(!1),[be,ze]=S.useState(!1),Re=y8(),Oe=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),te=Q.split(`
|
|
294
|
-
`).map(ue=>ue.trim()).filter(Boolean),xe=Y.split(`
|
|
295
|
-
`).map(ue=>ue.trim()).filter(Boolean),Ee=f.healthChecks.some(ue=>ue.id==="api"&&ue.state==="ready"),Ge=async()=>{if(!(!Oe||!k)){ae(!0),L(null);try{const ue=await Ny(Oe,{displayName:w||v,canonicalDomain:k,country:_,language:P});z(Oe),q(ue.id),ft({title:"Project created",detail:`${ue.displayName||ue.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${ue.name}`,dedupeMode:"drop"}),r(),y(2)}catch(ue){L(ue instanceof Error?ue.message:"Failed to create project")}finally{ae(!1)}}},Je=async()=>{if(!A)return;const ue=te;if(ue.length!==0){B(!0),R(null);try{await xH(A,ue),ye(!0),r(),y(3)}catch(Dn){R(Dn instanceof Error?Dn.message:"Failed to save key phrases")}finally{B(!1)}}},nn=async()=>{if(!(!A||!V)){ee(!0),_e(null);try{const ue=await UH(A,V,ie);if(ue.keywords.length>0){const Dn=Q?Q.trimEnd()+`
|
|
296
|
-
`+ue.keywords.join(`
|
|
297
|
-
`):ue.keywords.join(`
|
|
298
|
-
`);K(Dn)}}catch(ue){_e(ue instanceof Error?ue.message:"Failed to generate key phrases")}finally{ee(!1)}}},wn=async()=>{if(!A)return;const ue=xe;if(ue.length!==0){xn(!0),Nt(null);try{await _I(A,ue),rt(!0),r(),y(4)}catch(Dn){Nt(Dn instanceof Error?Dn.message:"Failed to save competitors")}finally{xn(!1)}}},Qe=async()=>{if(A){ze(!0);try{await Re.mutateAsync({projectName:A,projectLabel:w||v||A,sourceAction:"setup-launch"}),Ve(!0),r()}catch{}finally{ze(!1)}}},kt=()=>y(ue=>Math.max(0,ue-1)),$t=(()=>{switch(m){case 0:return u.jsxs(We,{className:"surface-card step-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),u.jsx("h2",{children:"System ready"})]})}),u.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),u.jsx("div",{className:"compact-stack",children:f.healthChecks.map(ue=>u.jsxs("div",{className:"health-check-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:ue.label}),u.jsx("p",{className:"supporting-copy",children:ue.detail}),ue.id==="provider"&&ue.state!=="ready"&&u.jsx(Qt,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),u.jsx(Et,{tone:ue.state==="ready"?"positive":"caution",title:ue.id==="api"?ho(d.apiStatus):ue.id==="worker"?ho(d.workerStatus):ue.detail,children:ue.state==="ready"?"Ready":"Attention"})]},ue.id))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx("span",{}),u.jsx(we,{type:"button",disabled:!Ee,onClick:()=>y(1),children:"Continue"})]})]});case 1:return u.jsxs(We,{className:"surface-card step-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),u.jsx("h2",{children:"Create project"})]}),A?u.jsx(Et,{tone:"positive",children:"Created"}):null]}),A?u.jsxs("div",{className:"compact-stack",children:[u.jsxs("p",{className:"text-zinc-300",children:["Project ",u.jsx("span",{className:"text-zinc-100 font-medium",children:A})," created successfully."]}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(we,{type:"button",variant:"outline",onClick:kt,children:"Back"}),u.jsx(we,{type:"button",onClick:()=>y(2),children:"Continue"})]})]}):u.jsxs("div",{className:"compact-stack",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),u.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:v,onChange:ue=>x(ue.target.value)}),Oe&&Oe!==v?u.jsxs("p",{className:"supporting-copy",children:["Slug: ",Oe]}):null]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),u.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:w,onChange:ue=>j(ue.target.value)})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),u.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:k,onChange:ue=>O(ue.target.value)})]}),u.jsxs("div",{className:"setup-field-row",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),u.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:_,onChange:ue=>C(ue.target.value.toUpperCase())})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),u.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:P,onChange:ue=>T(ue.target.value.toLowerCase())})]})]}),U?u.jsx("p",{className:"text-rose-400 text-sm",children:U}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(we,{type:"button",variant:"outline",onClick:kt,children:"Back"}),u.jsx(we,{type:"button",disabled:!Oe||!k||J,onClick:Ge,children:J?"Creating...":"Create project"})]})]})]});case 2:return u.jsxs(We,{className:"surface-card step-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),u.jsx("h2",{children:"Add key phrases"})]}),X?u.jsxs(Et,{tone:"positive",children:[te.length," saved"]}):u.jsxs(Et,{tone:"neutral",children:[te.length," key phrase",te.length!==1?"s":""]})]}),u.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),X?u.jsxs("div",{className:"compact-stack",children:[u.jsx("ul",{className:"detail-list",children:te.map(ue=>u.jsx("li",{children:ue},ue))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(we,{type:"button",variant:"outline",onClick:kt,children:"Back"}),u.jsx(we,{type:"button",onClick:()=>y(3),children:"Continue"})]})]}):u.jsxs("div",{className:"compact-stack",children:[M.length>0?u.jsxs("div",{className:"compact-stack",children:[u.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[u.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",u.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),u.jsxs("div",{className:"flex items-end gap-2",children:[u.jsxs("div",{className:"setup-field flex-1",children:[u.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),u.jsx("select",{id:"gen-provider",className:"setup-input",value:V,onChange:ue=>se(ue.target.value),children:M.map(ue=>u.jsxs("option",{value:ue.name,children:[ue.displayName??ue.name,ue.model?` (${ue.model})`:""]},ue.name))})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),u.jsx("select",{id:"gen-count",className:"setup-input",value:ie,onChange:ue=>he(Number(ue.target.value)),children:[3,5,10,15,20].map(ue=>u.jsx("option",{value:ue,children:ue},ue))})]}),u.jsx(we,{type:"button",variant:"outline",disabled:je||!V,onClick:nn,children:je?"Analyzing site...":"Generate"})]}),de?u.jsx("p",{className:"text-rose-400 text-sm",children:de}):null]}):null,u.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[u.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",u.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"keywords",children:"Key phrases (one per line)"}),u.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
|
|
299
|
-
best invisalign downtown brooklyn
|
|
300
|
-
pediatric dentist brooklyn heights`,value:Q,onChange:ue=>K(ue.target.value)})]}),Se?u.jsx("p",{className:"text-rose-400 text-sm",children:Se}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(we,{type:"button",variant:"outline",onClick:kt,children:"Back"}),u.jsx(we,{type:"button",disabled:te.length===0||F,onClick:Je,children:F?"Saving...":`Save ${te.length} key phrase${te.length!==1?"s":""}`})]})]})]});case 3:return u.jsxs(We,{className:"surface-card step-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),u.jsx("h2",{children:"Add competitors"})]}),Me?u.jsx(Et,{tone:"positive",children:"Saved"}):null]}),u.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),Me?u.jsxs("div",{className:"compact-stack",children:[u.jsx("ul",{className:"detail-list",children:xe.map(ue=>u.jsx("li",{children:ue},ue))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(we,{type:"button",variant:"outline",onClick:kt,children:"Back"}),u.jsx(we,{type:"button",onClick:()=>y(4),children:"Continue"})]})]}):u.jsxs("div",{className:"compact-stack",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),u.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
|
|
301
|
-
competitor2.com`,value:Y,onChange:ue=>Ke(ue.target.value)})]}),it?u.jsx("p",{className:"text-rose-400 text-sm",children:it}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(we,{type:"button",variant:"outline",onClick:kt,children:"Back"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(we,{type:"button",variant:"outline",onClick:()=>y(4),children:"Skip"}),u.jsx(we,{type:"button",disabled:xe.length===0||Lt,onClick:wn,children:Lt?"Saving...":`Save ${xe.length} competitor${xe.length!==1?"s":""}`})]})]})]})]});case 4:return u.jsxs(We,{className:"surface-card step-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),u.jsx("h2",{children:"Launch first run"})]}),ve?u.jsx(Et,{tone:"positive",children:"Queued"}):null]}),ve?u.jsxs("div",{className:"compact-stack",children:[u.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),u.jsxs("div",{className:"setup-nav",children:[u.jsx("span",{}),u.jsx(we,{type:"button",onClick:()=>p({to:I?`/projects/${I}`:"/"}),children:"Open project"})]})]}):u.jsxs("div",{className:"compact-stack",children:[u.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",u.jsx("span",{className:"text-zinc-100 font-medium",children:A}),"."]}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(we,{type:"button",variant:"outline",onClick:kt,children:"Back"}),u.jsx(we,{type:"button",disabled:be,onClick:Qe,children:be?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return u.jsxs("div",{className:"page-container",children:[u.jsx("div",{className:"page-header",children:u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Setup"}),u.jsx("p",{className:"page-subtitle",children:"Create a project, add key phrases, add competitors, and launch the first run."})]})}),u.jsx(ANe,{current:m,labels:_Ne}),u.jsx("section",{className:"setup-wizard",children:$t})]})}function ENe(){return u.jsx("div",{className:"page-container",children:u.jsx("section",{className:"page-section",children:u.jsxs(We,{className:"surface-card empty-card",children:[u.jsx("h1",{children:"Route not found"}),u.jsx("p",{children:"The current path does not map to a dashboard view."}),u.jsx(we,{asChild:!0,children:u.jsx(Qt,{to:"/",children:"Return to overview"})})]})})})}function TNe(){return u.jsx(jse,{children:u.jsx(Sse,{})})}const Hi=JK()({component:TNe,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),PNe=_i({getParentRoute:()=>Hi,path:"/",component:Cse,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ar.projects.all);if(t&&t.length===0)throw jj({to:"/setup"})}}),zNe=_i({getParentRoute:()=>Hi,path:"/projects",component:Loe}),Nh=_i({getParentRoute:()=>Hi,path:"/projects/$projectId",component:()=>u.jsx(Pj,{})}),RNe=_i({getParentRoute:()=>Nh,path:"/",component:()=>u.jsx(Lv,{tab:"overview"})}),MNe=_i({getParentRoute:()=>Nh,path:"/search-console",component:()=>u.jsx(Lv,{tab:"search-console"})}),DNe=_i({getParentRoute:()=>Nh,path:"/analytics",component:()=>u.jsx(Lv,{tab:"analytics"})}),INe=_i({getParentRoute:()=>Nh,path:"/traffic",component:()=>u.jsx(Lv,{tab:"traffic"})}),LNe=_i({getParentRoute:()=>Hi,path:"/runs",component:wNe}),$Ne=_i({getParentRoute:()=>Hi,path:"/settings",component:CNe,beforeLoad:({context:e})=>{}}),UNe=_i({getParentRoute:()=>Hi,path:"/setup",component:ONe,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ar.projects.all);if(t&&t.length>0)throw jj({to:"/"})}}),BNe=_i({getParentRoute:()=>Hi,path:"*",component:ENe}),FNe=Hi.addChildren([PNe,zNe,Nh.addChildren([RNe,MNe,DNe,INe]),LNe,$Ne,UNe,BNe]);function qNe(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const LD=qNe(),KNe=LD==="/"?"":LD.replace(/\/$/,"");function HNe(e,t){return cH({routeTree:FNe,basepath:KNe||"/",context:{queryClient:e},...t?.initialEntries})}const v8=S7(),GNe=HNe(v8),b8=document.getElementById("root");if(!b8)throw new Error("Expected #root element for web app bootstrap.");function VNe(){const[e,t]=S.useState(HE()?"ready":"checking"),[n,r]=S.useState(""),[i,a]=S.useState(""),[o,c]=S.useState(null),[d,f]=S.useState(!1);S.useEffect(()=>{if(HE())return;let y=!1;return OH().then(v=>{y||(v.authenticated?t("ready"):t(v.setupRequired?"setup":"login"))}).catch(v=>{y||(c(v instanceof Error?v.message:"Failed to reach the Canonry API"),t("login"))}),()=>{y=!0}},[]);const p=async y=>{if(y.preventDefault(),!n.trim()||n.trim().length<8){c("Password must be at least 8 characters");return}if(n!==i){c("Passwords do not match");return}f(!0),c(null);try{if(!(await EH(n.trim())).authenticated){c("Setup failed");return}r(""),a(""),t("ready")}catch(v){c(v instanceof is||v instanceof Error?v.message:"Setup failed")}finally{f(!1)}},m=async y=>{if(y.preventDefault(),!!n.trim()){f(!0),c(null);try{if(!(await TH(n.trim())).authenticated){c("Incorrect password");return}r(""),t("ready")}catch(v){c(v instanceof is||v instanceof Error?v.message:"Authentication failed")}finally{f(!1)}}};return e==="ready"?u.jsx(oq,{client:v8,children:u.jsx(fH,{router:GNe})}):u.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:u.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:u.jsx(We,{className:"surface-card w-full",children:e==="checking"?u.jsx(Bm,{className:"py-8",children:u.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?u.jsxs(u.Fragment,{children:[u.jsxs(t1,{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),u.jsx(n1,{children:"Create a dashboard password"}),u.jsx(r1,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),u.jsx(Bm,{children:u.jsxs("form",{className:"space-y-4",onSubmit:p,children:[u.jsxs("label",{className:"block space-y-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),u.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:n,onChange:y=>r(y.target.value),placeholder:"At least 8 characters"})]}),u.jsxs("label",{className:"block space-y-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),u.jsx("input",{className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:y=>a(y.target.value),placeholder:"Re-enter password"})]}),o?u.jsx("p",{className:"text-sm text-rose-400",children:o}):null,u.jsx(we,{type:"submit",disabled:d||!n.trim()||!i.trim(),children:d?"Setting up…":"Create password & open dashboard"})]})})]}):u.jsxs(u.Fragment,{children:[u.jsxs(t1,{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),u.jsx(n1,{children:"Sign in to Canonry"}),u.jsx(r1,{children:"Enter your dashboard password to continue."})]}),u.jsx(Bm,{children:u.jsxs("form",{className:"space-y-4",onSubmit:m,children:[u.jsxs("label",{className:"block space-y-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),u.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:n,onChange:y=>r(y.target.value),placeholder:"Dashboard password"})]}),o?u.jsx("p",{className:"text-sm text-rose-400",children:o}):null,u.jsx(we,{type:"submit",disabled:d||!n.trim(),children:d?"Signing in…":"Open dashboard"})]})})]})})})})}D9.createRoot(b8).render(u.jsx(S.StrictMode,{children:u.jsx(VNe,{})}));
|