@ainyc/canonry 1.40.1 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/assets/index--ev1Bjls.css +1 -0
- package/assets/assets/index-BAzKj_9S.js +281 -0
- package/assets/index.html +2 -2
- package/dist/{chunk-FOWWBLXD.js → chunk-AATIMNOX.js} +39 -2
- package/dist/{chunk-FXHVGU5S.js → chunk-C3LF36DQ.js} +633 -135
- package/dist/cli.js +287 -11
- package/dist/index.js +2 -2
- package/dist/{intelligence-service-PDZOIB7L.js → intelligence-service-36ERONKI.js} +1 -1
- package/package.json +6 -6
- package/assets/assets/index-DU7KOHur.js +0 -281
- package/assets/assets/index-Djm1st6N.css +0 -1
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
function vB(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Ks(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Y0={exports:{}},nd={};var uk;function yB(){if(uk)return nd;uk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var l=null;if(s!==void 0&&(l=""+s),i.key!==void 0&&(l=""+i.key),"key"in i){s={};for(var c in i)c!=="key"&&(s[c]=i[c])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:s}}return nd.Fragment=t,nd.jsx=n,nd.jsxs=n,nd}var dk;function bB(){return dk||(dk=1,Y0.exports=yB()),Y0.exports}var u=bB(),W0={exports:{}},Ve={};var fk;function xB(){if(fk)return Ve;fk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function y(D){return D===null||typeof D!="object"?null:(D=v&&D[v]||D["@@iterator"],typeof D=="function"?D:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,N={};function C(D,G,ae){this.props=D,this.context=G,this.refs=N,this.updater=ae||S}C.prototype.isReactComponent={},C.prototype.setState=function(D,G){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,G,"setState")},C.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function E(){}E.prototype=C.prototype;function A(D,G,ae){this.props=D,this.context=G,this.refs=N,this.updater=ae||S}var O=A.prototype=new E;O.constructor=A,w(O,C.prototype),O.isPureReactComponent=!0;var P=Array.isArray;function z(){}var _={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function R(D,G,ae){var Y=ae.ref;return{$$typeof:e,type:D,key:G,ref:Y!==void 0?Y:null,props:ae}}function B(D,G){return R(D.type,G,D.props)}function $(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function L(D){var G={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ae){return G[ae]})}var ne=/\/+/g;function he(D,G){return typeof D=="object"&&D!==null&&D.key!=null?L(""+D.key):G.toString(36)}function ge(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(z,z):(D.status="pending",D.then(function(G){D.status==="pending"&&(D.status="fulfilled",D.value=G)},function(G){D.status==="pending"&&(D.status="rejected",D.reason=G)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function H(D,G,ae,Y,W){var oe=typeof D;(oe==="undefined"||oe==="boolean")&&(D=null);var xe=!1;if(D===null)xe=!0;else switch(oe){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(D.$$typeof){case e:case t:xe=!0;break;case p:return xe=D._init,H(xe(D._payload),G,ae,Y,W)}}if(xe)return W=W(D),xe=Y===""?"."+he(D,0):Y,P(W)?(ae="",xe!=null&&(ae=xe.replace(ne,"$&/")+"/"),H(W,G,ae,"",function(le){return le})):W!=null&&($(W)&&(W=B(W,ae+(W.key==null||D&&D.key===W.key?"":(""+W.key).replace(ne,"$&/")+"/")+xe)),G.push(W)),1;xe=0;var Se=Y===""?".":Y+":";if(P(D))for(var Q=0;Q<D.length;Q++)Y=D[Q],oe=Se+he(Y,Q),xe+=H(Y,G,ae,oe,W);else if(Q=y(D),typeof Q=="function")for(D=Q.call(D),Q=0;!(Y=D.next()).done;)Y=Y.value,oe=Se+he(Y,Q++),xe+=H(Y,G,ae,oe,W);else if(oe==="object"){if(typeof D.then=="function")return H(ge(D),G,ae,Y,W);throw G=String(D),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return xe}function ie(D,G,ae){if(D==null)return D;var Y=[],W=0;return H(D,Y,"","",function(oe){return G.call(ae,oe,W++)}),Y}function pe(D){if(D._status===-1){var G=D._result;G=G(),G.then(function(ae){(D._status===0||D._status===-1)&&(D._status=1,D._result=ae)},function(ae){(D._status===0||D._status===-1)&&(D._status=2,D._result=ae)}),D._status===-1&&(D._status=0,D._result=G)}if(D._status===1)return D._result.default;throw D._result}var we=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},q={map:ie,forEach:function(D,G,ae){ie(D,function(){G.apply(this,arguments)},ae)},count:function(D){var G=0;return ie(D,function(){G++}),G},toArray:function(D){return ie(D,function(G){return G})||[]},only:function(D){if(!$(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Ve.Activity=g,Ve.Children=q,Ve.Component=C,Ve.Fragment=n,Ve.Profiler=i,Ve.PureComponent=A,Ve.StrictMode=r,Ve.Suspense=f,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,Ve.__COMPILER_RUNTIME={__proto__:null,c:function(D){return _.H.useMemoCache(D)}},Ve.cache=function(D){return function(){return D.apply(null,arguments)}},Ve.cacheSignal=function(){return null},Ve.cloneElement=function(D,G,ae){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var Y=w({},D.props),W=D.key;if(G!=null)for(oe in G.key!==void 0&&(W=""+G.key),G)!T.call(G,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&G.ref===void 0||(Y[oe]=G[oe]);var oe=arguments.length-2;if(oe===1)Y.children=ae;else if(1<oe){for(var xe=Array(oe),Se=0;Se<oe;Se++)xe[Se]=arguments[Se+2];Y.children=xe}return R(D.type,W,Y)},Ve.createContext=function(D){return D={$$typeof:l,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:s,_context:D},D},Ve.createElement=function(D,G,ae){var Y,W={},oe=null;if(G!=null)for(Y in G.key!==void 0&&(oe=""+G.key),G)T.call(G,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(W[Y]=G[Y]);var xe=arguments.length-2;if(xe===1)W.children=ae;else if(1<xe){for(var Se=Array(xe),Q=0;Q<xe;Q++)Se[Q]=arguments[Q+2];W.children=Se}if(D&&D.defaultProps)for(Y in xe=D.defaultProps,xe)W[Y]===void 0&&(W[Y]=xe[Y]);return R(D,oe,W)},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(D){return{$$typeof:c,render:D}},Ve.isValidElement=$,Ve.lazy=function(D){return{$$typeof:p,_payload:{_status:-1,_result:D},_init:pe}},Ve.memo=function(D,G){return{$$typeof:h,type:D,compare:G===void 0?null:G}},Ve.startTransition=function(D){var G=_.T,ae={};_.T=ae;try{var Y=D(),W=_.S;W!==null&&W(ae,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(z,we)}catch(oe){we(oe)}finally{G!==null&&ae.types!==null&&(G.types=ae.types),_.T=G}},Ve.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},Ve.use=function(D){return _.H.use(D)},Ve.useActionState=function(D,G,ae){return _.H.useActionState(D,G,ae)},Ve.useCallback=function(D,G){return _.H.useCallback(D,G)},Ve.useContext=function(D){return _.H.useContext(D)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(D,G){return _.H.useDeferredValue(D,G)},Ve.useEffect=function(D,G){return _.H.useEffect(D,G)},Ve.useEffectEvent=function(D){return _.H.useEffectEvent(D)},Ve.useId=function(){return _.H.useId()},Ve.useImperativeHandle=function(D,G,ae){return _.H.useImperativeHandle(D,G,ae)},Ve.useInsertionEffect=function(D,G){return _.H.useInsertionEffect(D,G)},Ve.useLayoutEffect=function(D,G){return _.H.useLayoutEffect(D,G)},Ve.useMemo=function(D,G){return _.H.useMemo(D,G)},Ve.useOptimistic=function(D,G){return _.H.useOptimistic(D,G)},Ve.useReducer=function(D,G,ae){return _.H.useReducer(D,G,ae)},Ve.useRef=function(D){return _.H.useRef(D)},Ve.useState=function(D){return _.H.useState(D)},Ve.useSyncExternalStore=function(D,G,ae){return _.H.useSyncExternalStore(D,G,ae)},Ve.useTransition=function(){return _.H.useTransition()},Ve.version="19.2.4",Ve}var hk;function Vc(){return hk||(hk=1,W0.exports=xB()),W0.exports}var x=Vc();const wi=Ks(x),xg=vB({__proto__:null,default:wi},[x]);var Q0={exports:{}},rd={},X0={exports:{}},J0={};var pk;function wB(){return pk||(pk=1,(function(e){function t(H,ie){var pe=H.length;H.push(ie);e:for(;0<pe;){var we=pe-1>>>1,q=H[we];if(0<i(q,ie))H[we]=ie,H[pe]=q,pe=we;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var ie=H[0],pe=H.pop();if(pe!==ie){H[0]=pe;e:for(var we=0,q=H.length,D=q>>>1;we<D;){var G=2*(we+1)-1,ae=H[G],Y=G+1,W=H[Y];if(0>i(ae,pe))Y<q&&0>i(W,ae)?(H[we]=W,H[Y]=pe,we=Y):(H[we]=ae,H[G]=pe,we=G);else if(Y<q&&0>i(W,pe))H[we]=W,H[Y]=pe,we=Y;else break e}}return ie}function i(H,ie){var pe=H.sortIndex-ie.sortIndex;return pe!==0?pe:H.id-ie.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],h=[],p=1,g=null,v=3,y=!1,S=!1,w=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function O(H){for(var ie=n(h);ie!==null;){if(ie.callback===null)r(h);else if(ie.startTime<=H)r(h),ie.sortIndex=ie.expirationTime,t(f,ie);else break;ie=n(h)}}function P(H){if(w=!1,O(H),!S)if(n(f)!==null)S=!0,z||(z=!0,L());else{var ie=n(h);ie!==null&&ge(P,ie.startTime-H)}}var z=!1,_=-1,T=5,R=-1;function B(){return N?!0:!(e.unstable_now()-R<T)}function $(){if(N=!1,z){var H=e.unstable_now();R=H;var ie=!0;try{e:{S=!1,w&&(w=!1,E(_),_=-1),y=!0;var pe=v;try{t:{for(O(H),g=n(f);g!==null&&!(g.expirationTime>H&&B());){var we=g.callback;if(typeof we=="function"){g.callback=null,v=g.priorityLevel;var q=we(g.expirationTime<=H);if(H=e.unstable_now(),typeof q=="function"){g.callback=q,O(H),ie=!0;break t}g===n(f)&&r(f),O(H)}else r(f);g=n(f)}if(g!==null)ie=!0;else{var D=n(h);D!==null&&ge(P,D.startTime-H),ie=!1}}break e}finally{g=null,v=pe,y=!1}ie=void 0}}finally{ie?L():z=!1}}}var L;if(typeof A=="function")L=function(){A($)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,he=ne.port2;ne.port1.onmessage=$,L=function(){he.postMessage(null)}}else L=function(){C($,0)};function ge(H,ie){_=C(function(){H(e.unstable_now())},ie)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(H){switch(v){case 1:case 2:case 3:var ie=3;break;default:ie=v}var pe=v;v=ie;try{return H()}finally{v=pe}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(H,ie){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var pe=v;v=H;try{return ie()}finally{v=pe}},e.unstable_scheduleCallback=function(H,ie,pe){var we=e.unstable_now();switch(typeof pe=="object"&&pe!==null?(pe=pe.delay,pe=typeof pe=="number"&&0<pe?we+pe:we):pe=we,H){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=pe+q,H={id:p++,callback:ie,priorityLevel:H,startTime:pe,expirationTime:q,sortIndex:-1},pe>we?(H.sortIndex=pe,t(h,H),n(f)===null&&H===n(h)&&(w?(E(_),_=-1):w=!0,ge(P,pe-we))):(H.sortIndex=q,t(f,H),S||y||(S=!0,z||(z=!0,L()))),H},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(H){var ie=v;return function(){var pe=v;v=ie;try{return H.apply(this,arguments)}finally{v=pe}}}})(J0)),J0}var mk;function SB(){return mk||(mk=1,X0.exports=wB()),X0.exports}var eb={exports:{}},Kn={};var gk;function jB(){if(gk)return Kn;gk=1;var e=Vc();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(f,h,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:f,containerInfo:h,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Kn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Kn.createPortal=function(f,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return s(f,h,null,p)},Kn.flushSync=function(f){var h=l.T,p=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=h,r.p=p,r.d.f()}},Kn.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},Kn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Kn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var p=h.as,g=c(p,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,y=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:y}):p==="script"&&r.d.X(f,{crossOrigin:g,integrity:v,fetchPriority:y,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Kn.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=c(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},Kn.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,g=c(p,h.crossOrigin);r.d.L(f,p,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Kn.preloadModule=function(f,h){if(typeof f=="string")if(h){var p=c(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},Kn.requestFormReset=function(f){r.d.r(f)},Kn.unstable_batchedUpdates=function(f,h){return f(h)},Kn.useFormState=function(f,h,p){return l.H.useFormState(f,h,p)},Kn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Kn.version="19.2.4",Kn}var vk;function lM(){if(vk)return eb.exports;vk=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(),eb.exports=jB(),eb.exports}var yk;function NB(){if(yk)return rd;yk=1;var e=SB(),t=Vc(),n=lM();function r(a){var o="https://react.dev/errors/"+a;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)o+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+a+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var o=a,d=a;if(a.alternate)for(;o.return;)o=o.return;else{a=o;do o=a,(o.flags&4098)!==0&&(d=o.return),a=o.return;while(a)}return o.tag===3?d:null}function l(a){if(a.tag===13){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function c(a){if(a.tag===31){var o=a.memoizedState;if(o===null&&(a=a.alternate,a!==null&&(o=a.memoizedState)),o!==null)return o.dehydrated}return null}function f(a){if(s(a)!==a)throw Error(r(188))}function h(a){var o=a.alternate;if(!o){if(o=s(a),o===null)throw Error(r(188));return o!==a?null:a}for(var d=a,m=o;;){var b=d.return;if(b===null)break;var j=b.alternate;if(j===null){if(m=b.return,m!==null){d=m;continue}break}if(b.child===j.child){for(j=b.child;j;){if(j===d)return f(b),a;if(j===m)return f(b),o;j=j.sibling}throw Error(r(188))}if(d.return!==m.return)d=b,m=j;else{for(var k=!1,M=b.child;M;){if(M===d){k=!0,d=b,m=j;break}if(M===m){k=!0,m=b,d=j;break}M=M.sibling}if(!k){for(M=j.child;M;){if(M===d){k=!0,d=j,m=b;break}if(M===m){k=!0,m=j,d=b;break}M=M.sibling}if(!k)throw Error(r(189))}}if(d.alternate!==m)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?a:o}function p(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a;for(a=a.child;a!==null;){if(o=p(a),o!==null)return o;a=a.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),A=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function L(a){return a===null||typeof a!="object"?null:(a=$&&a[$]||a["@@iterator"],typeof a=="function"?a:null)}var ne=Symbol.for("react.client.reference");function he(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ne?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case w:return"Fragment";case C:return"Profiler";case N:return"StrictMode";case P:return"Suspense";case z:return"SuspenseList";case R:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case S:return"Portal";case A:return a.displayName||"Context";case E:return(a._context.displayName||"Context")+".Consumer";case O:var o=a.render;return a=a.displayName,a||(a=o.displayName||o.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case _:return o=a.displayName||null,o!==null?o:he(a.type)||"Memo";case T:o=a._payload,a=a._init;try{return he(a(o))}catch{}}return null}var ge=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe={pending:!1,data:null,method:null,action:null},we=[],q=-1;function D(a){return{current:a}}function G(a){0>q||(a.current=we[q],we[q]=null,q--)}function ae(a,o){q++,we[q]=a.current,a.current=o}var Y=D(null),W=D(null),oe=D(null),xe=D(null);function Se(a,o){switch(ae(oe,o),ae(W,a),ae(Y,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?z_(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=z_(o),a=M_(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}G(Y),ae(Y,a)}function Q(){G(Y),G(W),G(oe)}function le(a){a.memoizedState!==null&&ae(xe,a);var o=Y.current,d=M_(o,a.type);o!==d&&(ae(W,a),ae(Y,d))}function je(a){W.current===a&&(G(Y),G(W)),xe.current===a&&(G(xe),Xu._currentValue=pe)}var V,De;function Ee(a){if(V===void 0)try{throw Error()}catch(d){var o=d.stack.trim().match(/\n( *(at )?)/);V=o&&o[1]||"",De=-1<d.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+V+a+De}var tt=!1;function ve(a,o){if(!a||tt)return"";tt=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(o){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(re){var ee=re}Reflect.construct(a,[],de)}else{try{de.call()}catch(re){ee=re}a.call(de.prototype)}}else{try{throw Error()}catch(re){ee=re}(de=a())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(re){if(re&&ee&&typeof re.stack=="string")return[re.stack,ee.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var j=m.DetermineComponentFrameRoot(),k=j[0],M=j[1];if(k&&M){var U=k.split(`
|
|
4
|
+
`),J=M.split(`
|
|
5
|
+
`);for(b=m=0;m<U.length&&!U[m].includes("DetermineComponentFrameRoot");)m++;for(;b<J.length&&!J[b].includes("DetermineComponentFrameRoot");)b++;if(m===U.length||b===J.length)for(m=U.length-1,b=J.length-1;1<=m&&0<=b&&U[m]!==J[b];)b--;for(;1<=m&&0<=b;m--,b--)if(U[m]!==J[b]){if(m!==1||b!==1)do if(m--,b--,0>b||U[m]!==J[b]){var se=`
|
|
6
|
+
`+U[m].replace(" at new "," at ");return a.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",a.displayName)),se}while(1<=m&&0<=b);break}}}finally{tt=!1,Error.prepareStackTrace=d}return(d=a?a.displayName||a.name:"")?Ee(d):""}function Le(a,o){switch(a.tag){case 26:case 27:case 5:return Ee(a.type);case 16:return Ee("Lazy");case 13:return a.child!==o&&o!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return ve(a.type,!1);case 11:return ve(a.type.render,!1);case 1:return ve(a.type,!0);case 31:return Ee("Activity");default:return""}}function Fe(a){try{var o="",d=null;do o+=Le(a,d),d=a,a=a.return;while(a);return o}catch(m){return`
|
|
7
|
+
Error generating stack: `+m.message+`
|
|
8
|
+
`+m.stack}}var Be=Object.prototype.hasOwnProperty,fe=e.unstable_scheduleCallback,Ge=e.unstable_cancelCallback,Ke=e.unstable_shouldYield,Ft=e.unstable_requestPaint,nt=e.unstable_now,Xe=e.unstable_getCurrentPriorityLevel,Je=e.unstable_ImmediatePriority,Rt=e.unstable_UserBlockingPriority,cr=e.unstable_NormalPriority,Ka=e.unstable_LowPriority,Js=e.unstable_IdlePriority,pt=e.log,yl=e.unstable_setDisableYieldValue,En=null,qe=null;function Rr(a){if(typeof pt=="function"&&yl(a),qe&&typeof qe.setStrictMode=="function")try{qe.setStrictMode(En,a)}catch{}}var ye=Math.clz32?Math.clz32:If,Qn=Math.log,fu=Math.LN2;function If(a){return a>>>=0,a===0?32:31-(Qn(a)/fu|0)|0}var Ha=256,sa=262144,eo=4194304;function zi(a){var o=a&42;if(o!==0)return o;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function bl(a,o,d){var m=a.pendingLanes;if(m===0)return 0;var b=0,j=a.suspendedLanes,k=a.pingedLanes;a=a.warmLanes;var M=m&134217727;return M!==0?(m=M&~j,m!==0?b=zi(m):(k&=M,k!==0?b=zi(k):d||(d=M&~a,d!==0&&(b=zi(d))))):(M=m&~j,M!==0?b=zi(M):k!==0?b=zi(k):d||(d=m&~a,d!==0&&(b=zi(d)))),b===0?0:o!==0&&o!==b&&(o&j)===0&&(j=b&-b,d=o&-o,j>=d||j===32&&(d&4194048)!==0)?o:b}function Mi(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function Lf(a,o){switch(a){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $f(){var a=eo;return eo<<=1,(eo&62914560)===0&&(eo=4194304),a}function xl(a){for(var o=[],d=0;31>d;d++)o.push(a);return o}function to(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Uv(a,o,d,m,b,j){var k=a.pendingLanes;a.pendingLanes=d,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=d,a.entangledLanes&=d,a.errorRecoveryDisabledLanes&=d,a.shellSuspendCounter=0;var M=a.entanglements,U=a.expirationTimes,J=a.hiddenUpdates;for(d=k&~d;0<d;){var se=31-ye(d),de=1<<se;M[se]=0,U[se]=-1;var ee=J[se];if(ee!==null)for(J[se]=null,se=0;se<ee.length;se++){var re=ee[se];re!==null&&(re.lane&=-536870913)}d&=~de}m!==0&&Uf(a,m,0),j!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=j&~(k&~o))}function Uf(a,o,d){a.pendingLanes|=o,a.suspendedLanes&=~o;var m=31-ye(o);a.entangledLanes|=o,a.entanglements[m]=a.entanglements[m]|1073741824|d&261930}function Bf(a,o){var d=a.entangledLanes|=o;for(a=a.entanglements;d;){var m=31-ye(d),b=1<<m;b&o|a[m]&o&&(a[m]|=o),d&=~b}}function hu(a,o){var d=o&-o;return d=(d&42)!==0?1:F(d),(d&(a.suspendedLanes|o))!==0?0:d}function F(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function be(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function wt(){var a=ie.p;return a!==0?a:(a=window.event,a===void 0?32:rk(a.type))}function Wt(a,o){var d=ie.p;try{return ie.p=a,o()}finally{ie.p=d}}var Kt=Math.random().toString(36).slice(2),Dt="__reactFiber$"+Kt,Qt="__reactProps$"+Kt,Sr="__reactContainer$"+Kt,Fn="__reactEvents$"+Kt,Bv="__reactListeners$"+Kt,Ga="__reactHandles$"+Kt,Va="__reactResources$"+Kt,Ri="__reactMarker$"+Kt;function wl(a){delete a[Dt],delete a[Qt],delete a[Fn],delete a[Bv],delete a[Ga]}function Za(a){var o=a[Dt];if(o)return o;for(var d=a.parentNode;d;){if(o=d[Sr]||d[Dt]){if(d=o.alternate,o.child!==null||d!==null&&d.child!==null)for(a=B_(a);a!==null;){if(d=a[Dt])return d;a=B_(a)}return o}a=d,d=a.parentNode}return null}function pi(a){if(a=a[Dt]||a[Sr]){var o=a.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return a}return null}function Di(a){var o=a.tag;if(o===5||o===26||o===27||o===6)return a.stateNode;throw Error(r(33))}function Ya(a){var o=a[Va];return o||(o=a[Va]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function cn(a){a[Ri]=!0}var st=new Set,St={};function gn(a,o){Xn(a,o),Xn(a+"Capture",o)}function Xn(a,o){for(St[a]=o,a=0;a<o.length;a++)st.add(o[a])}var Sl=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]*$"),pu={},NN={};function cU(a){return Be.call(NN,a)?!0:Be.call(pu,a)?!1:Sl.test(a)?NN[a]=!0:(pu[a]=!0,!1)}function qf(a,o,d){if(cU(o))if(d===null)a.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":a.removeAttribute(o);return;case"boolean":var m=o.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(o);return}}a.setAttribute(o,""+d)}}function Ff(a,o,d){if(d===null)a.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttribute(o,""+d)}}function oa(a,o,d,m){if(m===null)a.removeAttribute(d);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(d);return}a.setAttributeNS(o,d,""+m)}}function Dr(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function CN(a){var o=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function uU(a,o,d){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,o);if(!a.hasOwnProperty(o)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var b=m.get,j=m.set;return Object.defineProperty(a,o,{configurable:!0,get:function(){return b.call(this)},set:function(k){d=""+k,j.call(this,k)}}),Object.defineProperty(a,o,{enumerable:m.enumerable}),{getValue:function(){return d},setValue:function(k){d=""+k},stopTracking:function(){a._valueTracker=null,delete a[o]}}}}function qv(a){if(!a._valueTracker){var o=CN(a)?"checked":"value";a._valueTracker=uU(a,o,""+a[o])}}function ON(a){if(!a)return!1;var o=a._valueTracker;if(!o)return!0;var d=o.getValue(),m="";return a&&(m=CN(a)?a.checked?"true":"false":a.value),a=m,a!==d?(o.setValue(a),!0):!1}function Kf(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var dU=/[\n"\\]/g;function Ir(a){return a.replace(dU,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Fv(a,o,d,m,b,j,k,M){a.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?a.type=k:a.removeAttribute("type"),o!=null?k==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+Dr(o)):a.value!==""+Dr(o)&&(a.value=""+Dr(o)):k!=="submit"&&k!=="reset"||a.removeAttribute("value"),o!=null?Kv(a,k,Dr(o)):d!=null?Kv(a,k,Dr(d)):m!=null&&a.removeAttribute("value"),b==null&&j!=null&&(a.defaultChecked=!!j),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?a.name=""+Dr(M):a.removeAttribute("name")}function _N(a,o,d,m,b,j,k,M){if(j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(a.type=j),o!=null||d!=null){if(!(j!=="submit"&&j!=="reset"||o!=null)){qv(a);return}d=d!=null?""+Dr(d):"",o=o!=null?""+Dr(o):d,M||o===a.value||(a.value=o),a.defaultValue=o}m=m??b,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=M?a.checked:!!m,a.defaultChecked=!!m,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(a.name=k),qv(a)}function Kv(a,o,d){o==="number"&&Kf(a.ownerDocument)===a||a.defaultValue===""+d||(a.defaultValue=""+d)}function jl(a,o,d,m){if(a=a.options,o){o={};for(var b=0;b<d.length;b++)o["$"+d[b]]=!0;for(d=0;d<a.length;d++)b=o.hasOwnProperty("$"+a[d].value),a[d].selected!==b&&(a[d].selected=b),b&&m&&(a[d].defaultSelected=!0)}else{for(d=""+Dr(d),o=null,b=0;b<a.length;b++){if(a[b].value===d){a[b].selected=!0,m&&(a[b].defaultSelected=!0);return}o!==null||a[b].disabled||(o=a[b])}o!==null&&(o.selected=!0)}}function kN(a,o,d){if(o!=null&&(o=""+Dr(o),o!==a.value&&(a.value=o),d==null)){a.defaultValue!==o&&(a.defaultValue=o);return}a.defaultValue=d!=null?""+Dr(d):""}function AN(a,o,d,m){if(o==null){if(m!=null){if(d!=null)throw Error(r(92));if(ge(m)){if(1<m.length)throw Error(r(93));m=m[0]}d=m}d==null&&(d=""),o=d}d=Dr(o),a.defaultValue=d,m=a.textContent,m===d&&m!==""&&m!==null&&(a.value=m),qv(a)}function Nl(a,o){if(o){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=o;return}}a.textContent=o}var fU=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 EN(a,o,d){var m=o.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?m?a.setProperty(o,""):o==="float"?a.cssFloat="":a[o]="":m?a.setProperty(o,d):typeof d!="number"||d===0||fU.has(o)?o==="float"?a.cssFloat=d:a[o]=(""+d).trim():a[o]=d+"px"}function TN(a,o,d){if(o!=null&&typeof o!="object")throw Error(r(62));if(a=a.style,d!=null){for(var m in d)!d.hasOwnProperty(m)||o!=null&&o.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var b in o)m=o[b],o.hasOwnProperty(b)&&d[b]!==m&&EN(a,b,m)}else for(var j in o)o.hasOwnProperty(j)&&EN(a,j,o[j])}function Hv(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var hU=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"]]),pU=/^[\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 Hf(a){return pU.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function la(){}var Gv=null;function Vv(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Cl=null,Ol=null;function PN(a){var o=pi(a);if(o&&(a=o.stateNode)){var d=a[Qt]||null;e:switch(a=o.stateNode,o.type){case"input":if(Fv(a,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),o=d.name,d.type==="radio"&&o!=null){for(d=a;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+Ir(""+o)+'"][type="radio"]'),o=0;o<d.length;o++){var m=d[o];if(m!==a&&m.form===a.form){var b=m[Qt]||null;if(!b)throw Error(r(90));Fv(m,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(o=0;o<d.length;o++)m=d[o],m.form===a.form&&ON(m)}break e;case"textarea":kN(a,d.value,d.defaultValue);break e;case"select":o=d.value,o!=null&&jl(a,!!d.multiple,o,!1)}}}var Zv=!1;function zN(a,o,d){if(Zv)return a(o,d);Zv=!0;try{var m=a(o);return m}finally{if(Zv=!1,(Cl!==null||Ol!==null)&&(Ph(),Cl&&(o=Cl,a=Ol,Ol=Cl=null,PN(o),a)))for(o=0;o<a.length;o++)PN(a[o])}}function mu(a,o){var d=a.stateNode;if(d===null)return null;var m=d[Qt]||null;if(m===null)return null;d=m[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(d&&typeof d!="function")throw Error(r(231,o,typeof d));return d}var ca=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yv=!1;if(ca)try{var gu={};Object.defineProperty(gu,"passive",{get:function(){Yv=!0}}),window.addEventListener("test",gu,gu),window.removeEventListener("test",gu,gu)}catch{Yv=!1}var Wa=null,Wv=null,Gf=null;function MN(){if(Gf)return Gf;var a,o=Wv,d=o.length,m,b="value"in Wa?Wa.value:Wa.textContent,j=b.length;for(a=0;a<d&&o[a]===b[a];a++);var k=d-a;for(m=1;m<=k&&o[d-m]===b[j-m];m++);return Gf=b.slice(a,1<m?1-m:void 0)}function Vf(a){var o=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&o===13&&(a=13)):a=o,a===10&&(a=13),32<=a||a===13?a:0}function Zf(){return!0}function RN(){return!1}function ur(a){function o(d,m,b,j,k){this._reactName=d,this._targetInst=b,this.type=m,this.nativeEvent=j,this.target=k,this.currentTarget=null;for(var M in a)a.hasOwnProperty(M)&&(d=a[M],this[M]=d?d(j):j[M]);return this.isDefaultPrevented=(j.defaultPrevented!=null?j.defaultPrevented:j.returnValue===!1)?Zf:RN,this.isPropagationStopped=RN,this}return g(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Zf)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Zf)},persist:function(){},isPersistent:Zf}),o}var no={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yf=ur(no),vu=g({},no,{view:0,detail:0}),mU=ur(vu),Qv,Xv,yu,Wf=g({},vu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ey,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==yu&&(yu&&a.type==="mousemove"?(Qv=a.screenX-yu.screenX,Xv=a.screenY-yu.screenY):Xv=Qv=0,yu=a),Qv)},movementY:function(a){return"movementY"in a?a.movementY:Xv}}),DN=ur(Wf),gU=g({},Wf,{dataTransfer:0}),vU=ur(gU),yU=g({},vu,{relatedTarget:0}),Jv=ur(yU),bU=g({},no,{animationName:0,elapsedTime:0,pseudoElement:0}),xU=ur(bU),wU=g({},no,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),SU=ur(wU),jU=g({},no,{data:0}),IN=ur(jU),NU={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},CU={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"},OU={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _U(a){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(a):(a=OU[a])?!!o[a]:!1}function ey(){return _U}var kU=g({},vu,{key:function(a){if(a.key){var o=NU[a.key]||a.key;if(o!=="Unidentified")return o}return a.type==="keypress"?(a=Vf(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?CU[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ey,charCode:function(a){return a.type==="keypress"?Vf(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Vf(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),AU=ur(kU),EU=g({},Wf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),LN=ur(EU),TU=g({},vu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ey}),PU=ur(TU),zU=g({},no,{propertyName:0,elapsedTime:0,pseudoElement:0}),MU=ur(zU),RU=g({},Wf,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),DU=ur(RU),IU=g({},no,{newState:0,oldState:0}),LU=ur(IU),$U=[9,13,27,32],ty=ca&&"CompositionEvent"in window,bu=null;ca&&"documentMode"in document&&(bu=document.documentMode);var UU=ca&&"TextEvent"in window&&!bu,$N=ca&&(!ty||bu&&8<bu&&11>=bu),UN=" ",BN=!1;function qN(a,o){switch(a){case"keyup":return $U.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function FN(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var _l=!1;function BU(a,o){switch(a){case"compositionend":return FN(o);case"keypress":return o.which!==32?null:(BN=!0,UN);case"textInput":return a=o.data,a===UN&&BN?null:a;default:return null}}function qU(a,o){if(_l)return a==="compositionend"||!ty&&qN(a,o)?(a=MN(),Gf=Wv=Wa=null,_l=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return $N&&o.locale!=="ko"?null:o.data;default:return null}}var FU={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 KN(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o==="input"?!!FU[a.type]:o==="textarea"}function HN(a,o,d,m){Cl?Ol?Ol.push(m):Ol=[m]:Cl=m,o=$h(o,"onChange"),0<o.length&&(d=new Yf("onChange","change",null,d,m),a.push({event:d,listeners:o}))}var xu=null,wu=null;function KU(a){__(a,0)}function Qf(a){var o=Di(a);if(ON(o))return a}function GN(a,o){if(a==="change")return o}var VN=!1;if(ca){var ny;if(ca){var ry="oninput"in document;if(!ry){var ZN=document.createElement("div");ZN.setAttribute("oninput","return;"),ry=typeof ZN.oninput=="function"}ny=ry}else ny=!1;VN=ny&&(!document.documentMode||9<document.documentMode)}function YN(){xu&&(xu.detachEvent("onpropertychange",WN),wu=xu=null)}function WN(a){if(a.propertyName==="value"&&Qf(wu)){var o=[];HN(o,wu,a,Vv(a)),zN(KU,o)}}function HU(a,o,d){a==="focusin"?(YN(),xu=o,wu=d,xu.attachEvent("onpropertychange",WN)):a==="focusout"&&YN()}function GU(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Qf(wu)}function VU(a,o){if(a==="click")return Qf(o)}function ZU(a,o){if(a==="input"||a==="change")return Qf(o)}function YU(a,o){return a===o&&(a!==0||1/a===1/o)||a!==a&&o!==o}var jr=typeof Object.is=="function"?Object.is:YU;function Su(a,o){if(jr(a,o))return!0;if(typeof a!="object"||a===null||typeof o!="object"||o===null)return!1;var d=Object.keys(a),m=Object.keys(o);if(d.length!==m.length)return!1;for(m=0;m<d.length;m++){var b=d[m];if(!Be.call(o,b)||!jr(a[b],o[b]))return!1}return!0}function QN(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function XN(a,o){var d=QN(a);a=0;for(var m;d;){if(d.nodeType===3){if(m=a+d.textContent.length,a<=o&&m>=o)return{node:d,offset:o-a};a=m}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=QN(d)}}function JN(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?JN(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function eC(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=Kf(a.document);o instanceof a.HTMLIFrameElement;){try{var d=typeof o.contentWindow.location.href=="string"}catch{d=!1}if(d)a=o.contentWindow;else break;o=Kf(a.document)}return o}function iy(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}var WU=ca&&"documentMode"in document&&11>=document.documentMode,kl=null,ay=null,ju=null,sy=!1;function tC(a,o,d){var m=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;sy||kl==null||kl!==Kf(m)||(m=kl,"selectionStart"in m&&iy(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),ju&&Su(ju,m)||(ju=m,m=$h(ay,"onSelect"),0<m.length&&(o=new Yf("onSelect","select",null,o,d),a.push({event:o,listeners:m}),o.target=kl)))}function ro(a,o){var d={};return d[a.toLowerCase()]=o.toLowerCase(),d["Webkit"+a]="webkit"+o,d["Moz"+a]="moz"+o,d}var Al={animationend:ro("Animation","AnimationEnd"),animationiteration:ro("Animation","AnimationIteration"),animationstart:ro("Animation","AnimationStart"),transitionrun:ro("Transition","TransitionRun"),transitionstart:ro("Transition","TransitionStart"),transitioncancel:ro("Transition","TransitionCancel"),transitionend:ro("Transition","TransitionEnd")},oy={},nC={};ca&&(nC=document.createElement("div").style,"AnimationEvent"in window||(delete Al.animationend.animation,delete Al.animationiteration.animation,delete Al.animationstart.animation),"TransitionEvent"in window||delete Al.transitionend.transition);function io(a){if(oy[a])return oy[a];if(!Al[a])return a;var o=Al[a],d;for(d in o)if(o.hasOwnProperty(d)&&d in nC)return oy[a]=o[d];return a}var rC=io("animationend"),iC=io("animationiteration"),aC=io("animationstart"),QU=io("transitionrun"),XU=io("transitionstart"),JU=io("transitioncancel"),sC=io("transitionend"),oC=new Map,ly="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(" ");ly.push("scrollEnd");function mi(a,o){oC.set(a,o),gn(o,[a])}var Xf=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Lr=[],El=0,cy=0;function Jf(){for(var a=El,o=cy=El=0;o<a;){var d=Lr[o];Lr[o++]=null;var m=Lr[o];Lr[o++]=null;var b=Lr[o];Lr[o++]=null;var j=Lr[o];if(Lr[o++]=null,m!==null&&b!==null){var k=m.pending;k===null?b.next=b:(b.next=k.next,k.next=b),m.pending=b}j!==0&&lC(d,b,j)}}function eh(a,o,d,m){Lr[El++]=a,Lr[El++]=o,Lr[El++]=d,Lr[El++]=m,cy|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function uy(a,o,d,m){return eh(a,o,d,m),th(a)}function ao(a,o){return eh(a,null,null,o),th(a)}function lC(a,o,d){a.lanes|=d;var m=a.alternate;m!==null&&(m.lanes|=d);for(var b=!1,j=a.return;j!==null;)j.childLanes|=d,m=j.alternate,m!==null&&(m.childLanes|=d),j.tag===22&&(a=j.stateNode,a===null||a._visibility&1||(b=!0)),a=j,j=j.return;return a.tag===3?(j=a.stateNode,b&&o!==null&&(b=31-ye(d),a=j.hiddenUpdates,m=a[b],m===null?a[b]=[o]:m.push(o),o.lane=d|536870912),j):null}function th(a){if(50<Hu)throw Hu=0,b0=null,Error(r(185));for(var o=a.return;o!==null;)a=o,o=a.return;return a.tag===3?a.stateNode:null}var Tl={};function e6(a,o,d,m){this.tag=a,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nr(a,o,d,m){return new e6(a,o,d,m)}function dy(a){return a=a.prototype,!(!a||!a.isReactComponent)}function ua(a,o){var d=a.alternate;return d===null?(d=Nr(a.tag,o,a.key,a.mode),d.elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=o,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=a.flags&65011712,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,o=a.dependencies,d.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d.refCleanup=a.refCleanup,d}function cC(a,o){a.flags&=65011714;var d=a.alternate;return d===null?(a.childLanes=0,a.lanes=o,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=d.childLanes,a.lanes=d.lanes,a.child=d.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=d.memoizedProps,a.memoizedState=d.memoizedState,a.updateQueue=d.updateQueue,a.type=d.type,o=d.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),a}function nh(a,o,d,m,b,j){var k=0;if(m=a,typeof a=="function")dy(a)&&(k=1);else if(typeof a=="string")k=aB(a,d,Y.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case R:return a=Nr(31,d,o,b),a.elementType=R,a.lanes=j,a;case w:return so(d.children,b,j,o);case N:k=8,b|=24;break;case C:return a=Nr(12,d,o,b|2),a.elementType=C,a.lanes=j,a;case P:return a=Nr(13,d,o,b),a.elementType=P,a.lanes=j,a;case z:return a=Nr(19,d,o,b),a.elementType=z,a.lanes=j,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case A:k=10;break e;case E:k=9;break e;case O:k=11;break e;case _:k=14;break e;case T:k=16,m=null;break e}k=29,d=Error(r(130,a===null?"null":typeof a,"")),m=null}return o=Nr(k,d,o,b),o.elementType=a,o.type=m,o.lanes=j,o}function so(a,o,d,m){return a=Nr(7,a,m,o),a.lanes=d,a}function fy(a,o,d){return a=Nr(6,a,null,o),a.lanes=d,a}function uC(a){var o=Nr(18,null,null,0);return o.stateNode=a,o}function hy(a,o,d){return o=Nr(4,a.children!==null?a.children:[],a.key,o),o.lanes=d,o.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},o}var dC=new WeakMap;function $r(a,o){if(typeof a=="object"&&a!==null){var d=dC.get(a);return d!==void 0?d:(o={value:a,source:o,stack:Fe(o)},dC.set(a,o),o)}return{value:a,source:o,stack:Fe(o)}}var Pl=[],zl=0,rh=null,Nu=0,Ur=[],Br=0,Qa=null,Ii=1,Li="";function da(a,o){Pl[zl++]=Nu,Pl[zl++]=rh,rh=a,Nu=o}function fC(a,o,d){Ur[Br++]=Ii,Ur[Br++]=Li,Ur[Br++]=Qa,Qa=a;var m=Ii;a=Li;var b=32-ye(m)-1;m&=~(1<<b),d+=1;var j=32-ye(o)+b;if(30<j){var k=b-b%5;j=(m&(1<<k)-1).toString(32),m>>=k,b-=k,Ii=1<<32-ye(o)+b|d<<b|m,Li=j+a}else Ii=1<<j|d<<b|m,Li=a}function py(a){a.return!==null&&(da(a,1),fC(a,1,0))}function my(a){for(;a===rh;)rh=Pl[--zl],Pl[zl]=null,Nu=Pl[--zl],Pl[zl]=null;for(;a===Qa;)Qa=Ur[--Br],Ur[Br]=null,Li=Ur[--Br],Ur[Br]=null,Ii=Ur[--Br],Ur[Br]=null}function hC(a,o){Ur[Br++]=Ii,Ur[Br++]=Li,Ur[Br++]=Qa,Ii=o.id,Li=o.overflow,Qa=a}var Tn=null,Tt=null,ct=!1,Xa=null,qr=!1,gy=Error(r(519));function Ja(a){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Cu($r(o,a)),gy}function pC(a){var o=a.stateNode,d=a.type,m=a.memoizedProps;switch(o[Dt]=a,o[Qt]=m,d){case"dialog":it("cancel",o),it("close",o);break;case"iframe":case"object":case"embed":it("load",o);break;case"video":case"audio":for(d=0;d<Vu.length;d++)it(Vu[d],o);break;case"source":it("error",o);break;case"img":case"image":case"link":it("error",o),it("load",o);break;case"details":it("toggle",o);break;case"input":it("invalid",o),_N(o,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":it("invalid",o);break;case"textarea":it("invalid",o),AN(o,m.value,m.defaultValue,m.children)}d=m.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||o.textContent===""+d||m.suppressHydrationWarning===!0||T_(o.textContent,d)?(m.popover!=null&&(it("beforetoggle",o),it("toggle",o)),m.onScroll!=null&&it("scroll",o),m.onScrollEnd!=null&&it("scrollend",o),m.onClick!=null&&(o.onclick=la),o=!0):o=!1,o||Ja(a,!0)}function mC(a){for(Tn=a.return;Tn;)switch(Tn.tag){case 5:case 31:case 13:qr=!1;return;case 27:case 3:qr=!0;return;default:Tn=Tn.return}}function Ml(a){if(a!==Tn)return!1;if(!ct)return mC(a),ct=!0,!1;var o=a.tag,d;if((d=o!==3&&o!==27)&&((d=o===5)&&(d=a.type,d=!(d!=="form"&&d!=="button")||M0(a.type,a.memoizedProps)),d=!d),d&&Tt&&Ja(a),mC(a),o===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Tt=U_(a)}else if(o===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Tt=U_(a)}else o===27?(o=Tt,hs(a.type)?(a=$0,$0=null,Tt=a):Tt=o):Tt=Tn?Kr(a.stateNode.nextSibling):null;return!0}function oo(){Tt=Tn=null,ct=!1}function vy(){var a=Xa;return a!==null&&(pr===null?pr=a:pr.push.apply(pr,a),Xa=null),a}function Cu(a){Xa===null?Xa=[a]:Xa.push(a)}var yy=D(null),lo=null,fa=null;function es(a,o,d){ae(yy,o._currentValue),o._currentValue=d}function ha(a){a._currentValue=yy.current,G(yy)}function by(a,o,d){for(;a!==null;){var m=a.alternate;if((a.childLanes&o)!==o?(a.childLanes|=o,m!==null&&(m.childLanes|=o)):m!==null&&(m.childLanes&o)!==o&&(m.childLanes|=o),a===d)break;a=a.return}}function xy(a,o,d,m){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var j=b.dependencies;if(j!==null){var k=b.child;j=j.firstContext;e:for(;j!==null;){var M=j;j=b;for(var U=0;U<o.length;U++)if(M.context===o[U]){j.lanes|=d,M=j.alternate,M!==null&&(M.lanes|=d),by(j.return,d,a),m||(k=null);break e}j=M.next}}else if(b.tag===18){if(k=b.return,k===null)throw Error(r(341));k.lanes|=d,j=k.alternate,j!==null&&(j.lanes|=d),by(k,d,a),k=null}else k=b.child;if(k!==null)k.return=b;else for(k=b;k!==null;){if(k===a){k=null;break}if(b=k.sibling,b!==null){b.return=k.return,k=b;break}k=k.return}b=k}}function Rl(a,o,d,m){a=null;for(var b=o,j=!1;b!==null;){if(!j){if((b.flags&524288)!==0)j=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var k=b.alternate;if(k===null)throw Error(r(387));if(k=k.memoizedProps,k!==null){var M=b.type;jr(b.pendingProps.value,k.value)||(a!==null?a.push(M):a=[M])}}else if(b===xe.current){if(k=b.alternate,k===null)throw Error(r(387));k.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(Xu):a=[Xu])}b=b.return}a!==null&&xy(o,a,d,m),o.flags|=262144}function ih(a){for(a=a.firstContext;a!==null;){if(!jr(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function co(a){lo=a,fa=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Pn(a){return gC(lo,a)}function ah(a,o){return lo===null&&co(a),gC(a,o)}function gC(a,o){var d=o._currentValue;if(o={context:o,memoizedValue:d,next:null},fa===null){if(a===null)throw Error(r(308));fa=o,a.dependencies={lanes:0,firstContext:o},a.flags|=524288}else fa=fa.next=o;return d}var t6=typeof AbortController<"u"?AbortController:function(){var a=[],o=this.signal={aborted:!1,addEventListener:function(d,m){a.push(m)}};this.abort=function(){o.aborted=!0,a.forEach(function(d){return d()})}},n6=e.unstable_scheduleCallback,r6=e.unstable_NormalPriority,un={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wy(){return{controller:new t6,data:new Map,refCount:0}}function Ou(a){a.refCount--,a.refCount===0&&n6(r6,function(){a.controller.abort()})}var _u=null,Sy=0,Dl=0,Il=null;function i6(a,o){if(_u===null){var d=_u=[];Sy=0,Dl=C0(),Il={status:"pending",value:void 0,then:function(m){d.push(m)}}}return Sy++,o.then(vC,vC),o}function vC(){if(--Sy===0&&_u!==null){Il!==null&&(Il.status="fulfilled");var a=_u;_u=null,Dl=0,Il=null;for(var o=0;o<a.length;o++)(0,a[o])()}}function a6(a,o){var d=[],m={status:"pending",value:null,reason:null,then:function(b){d.push(b)}};return a.then(function(){m.status="fulfilled",m.value=o;for(var b=0;b<d.length;b++)(0,d[b])(o)},function(b){for(m.status="rejected",m.reason=b,b=0;b<d.length;b++)(0,d[b])(void 0)}),m}var yC=H.S;H.S=function(a,o){t_=nt(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&i6(a,o),yC!==null&&yC(a,o)};var uo=D(null);function jy(){var a=uo.current;return a!==null?a:Ot.pooledCache}function sh(a,o){o===null?ae(uo,uo.current):ae(uo,o.pool)}function bC(){var a=jy();return a===null?null:{parent:un._currentValue,pool:a}}var Ll=Error(r(460)),Ny=Error(r(474)),oh=Error(r(542)),lh={then:function(){}};function xC(a){return a=a.status,a==="fulfilled"||a==="rejected"}function wC(a,o,d){switch(d=a[d],d===void 0?a.push(o):d!==o&&(o.then(la,la),o=d),o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,jC(a),a;default:if(typeof o.status=="string")o.then(la,la);else{if(a=Ot,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=o,a.status="pending",a.then(function(m){if(o.status==="pending"){var b=o;b.status="fulfilled",b.value=m}},function(m){if(o.status==="pending"){var b=o;b.status="rejected",b.reason=m}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw a=o.reason,jC(a),a}throw ho=o,Ll}}function fo(a){try{var o=a._init;return o(a._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(ho=d,Ll):d}}var ho=null;function SC(){if(ho===null)throw Error(r(459));var a=ho;return ho=null,a}function jC(a){if(a===Ll||a===oh)throw Error(r(483))}var $l=null,ku=0;function ch(a){var o=ku;return ku+=1,$l===null&&($l=[]),wC($l,a,o)}function Au(a,o){o=o.props.ref,a.ref=o!==void 0?o:null}function uh(a,o){throw o.$$typeof===v?Error(r(525)):(a=Object.prototype.toString.call(o),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":a)))}function NC(a){function o(Z,K){if(a){var X=Z.deletions;X===null?(Z.deletions=[K],Z.flags|=16):X.push(K)}}function d(Z,K){if(!a)return null;for(;K!==null;)o(Z,K),K=K.sibling;return null}function m(Z){for(var K=new Map;Z!==null;)Z.key!==null?K.set(Z.key,Z):K.set(Z.index,Z),Z=Z.sibling;return K}function b(Z,K){return Z=ua(Z,K),Z.index=0,Z.sibling=null,Z}function j(Z,K,X){return Z.index=X,a?(X=Z.alternate,X!==null?(X=X.index,X<K?(Z.flags|=67108866,K):X):(Z.flags|=67108866,K)):(Z.flags|=1048576,K)}function k(Z){return a&&Z.alternate===null&&(Z.flags|=67108866),Z}function M(Z,K,X,ce){return K===null||K.tag!==6?(K=fy(X,Z.mode,ce),K.return=Z,K):(K=b(K,X),K.return=Z,K)}function U(Z,K,X,ce){var $e=X.type;return $e===w?se(Z,K,X.props.children,ce,X.key):K!==null&&(K.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===T&&fo($e)===K.type)?(K=b(K,X.props),Au(K,X),K.return=Z,K):(K=nh(X.type,X.key,X.props,null,Z.mode,ce),Au(K,X),K.return=Z,K)}function J(Z,K,X,ce){return K===null||K.tag!==4||K.stateNode.containerInfo!==X.containerInfo||K.stateNode.implementation!==X.implementation?(K=hy(X,Z.mode,ce),K.return=Z,K):(K=b(K,X.children||[]),K.return=Z,K)}function se(Z,K,X,ce,$e){return K===null||K.tag!==7?(K=so(X,Z.mode,ce,$e),K.return=Z,K):(K=b(K,X),K.return=Z,K)}function de(Z,K,X){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=fy(""+K,Z.mode,X),K.return=Z,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case y:return X=nh(K.type,K.key,K.props,null,Z.mode,X),Au(X,K),X.return=Z,X;case S:return K=hy(K,Z.mode,X),K.return=Z,K;case T:return K=fo(K),de(Z,K,X)}if(ge(K)||L(K))return K=so(K,Z.mode,X,null),K.return=Z,K;if(typeof K.then=="function")return de(Z,ch(K),X);if(K.$$typeof===A)return de(Z,ah(Z,K),X);uh(Z,K)}return null}function ee(Z,K,X,ce){var $e=K!==null?K.key:null;if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return $e!==null?null:M(Z,K,""+X,ce);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case y:return X.key===$e?U(Z,K,X,ce):null;case S:return X.key===$e?J(Z,K,X,ce):null;case T:return X=fo(X),ee(Z,K,X,ce)}if(ge(X)||L(X))return $e!==null?null:se(Z,K,X,ce,null);if(typeof X.then=="function")return ee(Z,K,ch(X),ce);if(X.$$typeof===A)return ee(Z,K,ah(Z,X),ce);uh(Z,X)}return null}function re(Z,K,X,ce,$e){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Z=Z.get(X)||null,M(K,Z,""+ce,$e);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case y:return Z=Z.get(ce.key===null?X:ce.key)||null,U(K,Z,ce,$e);case S:return Z=Z.get(ce.key===null?X:ce.key)||null,J(K,Z,ce,$e);case T:return ce=fo(ce),re(Z,K,X,ce,$e)}if(ge(ce)||L(ce))return Z=Z.get(X)||null,se(K,Z,ce,$e,null);if(typeof ce.then=="function")return re(Z,K,X,ch(ce),$e);if(ce.$$typeof===A)return re(Z,K,X,ah(K,ce),$e);uh(K,ce)}return null}function Ae(Z,K,X,ce){for(var $e=null,dt=null,Me=K,Qe=K=0,lt=null;Me!==null&&Qe<X.length;Qe++){Me.index>Qe?(lt=Me,Me=null):lt=Me.sibling;var ft=ee(Z,Me,X[Qe],ce);if(ft===null){Me===null&&(Me=lt);break}a&&Me&&ft.alternate===null&&o(Z,Me),K=j(ft,K,Qe),dt===null?$e=ft:dt.sibling=ft,dt=ft,Me=lt}if(Qe===X.length)return d(Z,Me),ct&&da(Z,Qe),$e;if(Me===null){for(;Qe<X.length;Qe++)Me=de(Z,X[Qe],ce),Me!==null&&(K=j(Me,K,Qe),dt===null?$e=Me:dt.sibling=Me,dt=Me);return ct&&da(Z,Qe),$e}for(Me=m(Me);Qe<X.length;Qe++)lt=re(Me,Z,Qe,X[Qe],ce),lt!==null&&(a&<.alternate!==null&&Me.delete(lt.key===null?Qe:lt.key),K=j(lt,K,Qe),dt===null?$e=lt:dt.sibling=lt,dt=lt);return a&&Me.forEach(function(ys){return o(Z,ys)}),ct&&da(Z,Qe),$e}function Ue(Z,K,X,ce){if(X==null)throw Error(r(151));for(var $e=null,dt=null,Me=K,Qe=K=0,lt=null,ft=X.next();Me!==null&&!ft.done;Qe++,ft=X.next()){Me.index>Qe?(lt=Me,Me=null):lt=Me.sibling;var ys=ee(Z,Me,ft.value,ce);if(ys===null){Me===null&&(Me=lt);break}a&&Me&&ys.alternate===null&&o(Z,Me),K=j(ys,K,Qe),dt===null?$e=ys:dt.sibling=ys,dt=ys,Me=lt}if(ft.done)return d(Z,Me),ct&&da(Z,Qe),$e;if(Me===null){for(;!ft.done;Qe++,ft=X.next())ft=de(Z,ft.value,ce),ft!==null&&(K=j(ft,K,Qe),dt===null?$e=ft:dt.sibling=ft,dt=ft);return ct&&da(Z,Qe),$e}for(Me=m(Me);!ft.done;Qe++,ft=X.next())ft=re(Me,Z,Qe,ft.value,ce),ft!==null&&(a&&ft.alternate!==null&&Me.delete(ft.key===null?Qe:ft.key),K=j(ft,K,Qe),dt===null?$e=ft:dt.sibling=ft,dt=ft);return a&&Me.forEach(function(gB){return o(Z,gB)}),ct&&da(Z,Qe),$e}function Ct(Z,K,X,ce){if(typeof X=="object"&&X!==null&&X.type===w&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case y:e:{for(var $e=X.key;K!==null;){if(K.key===$e){if($e=X.type,$e===w){if(K.tag===7){d(Z,K.sibling),ce=b(K,X.props.children),ce.return=Z,Z=ce;break e}}else if(K.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===T&&fo($e)===K.type){d(Z,K.sibling),ce=b(K,X.props),Au(ce,X),ce.return=Z,Z=ce;break e}d(Z,K);break}else o(Z,K);K=K.sibling}X.type===w?(ce=so(X.props.children,Z.mode,ce,X.key),ce.return=Z,Z=ce):(ce=nh(X.type,X.key,X.props,null,Z.mode,ce),Au(ce,X),ce.return=Z,Z=ce)}return k(Z);case S:e:{for($e=X.key;K!==null;){if(K.key===$e)if(K.tag===4&&K.stateNode.containerInfo===X.containerInfo&&K.stateNode.implementation===X.implementation){d(Z,K.sibling),ce=b(K,X.children||[]),ce.return=Z,Z=ce;break e}else{d(Z,K);break}else o(Z,K);K=K.sibling}ce=hy(X,Z.mode,ce),ce.return=Z,Z=ce}return k(Z);case T:return X=fo(X),Ct(Z,K,X,ce)}if(ge(X))return Ae(Z,K,X,ce);if(L(X)){if($e=L(X),typeof $e!="function")throw Error(r(150));return X=$e.call(X),Ue(Z,K,X,ce)}if(typeof X.then=="function")return Ct(Z,K,ch(X),ce);if(X.$$typeof===A)return Ct(Z,K,ah(Z,X),ce);uh(Z,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(X=""+X,K!==null&&K.tag===6?(d(Z,K.sibling),ce=b(K,X),ce.return=Z,Z=ce):(d(Z,K),ce=fy(X,Z.mode,ce),ce.return=Z,Z=ce),k(Z)):d(Z,K)}return function(Z,K,X,ce){try{ku=0;var $e=Ct(Z,K,X,ce);return $l=null,$e}catch(Me){if(Me===Ll||Me===oh)throw Me;var dt=Nr(29,Me,null,Z.mode);return dt.lanes=ce,dt.return=Z,dt}}}var po=NC(!0),CC=NC(!1),ts=!1;function Cy(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Oy(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function ns(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function rs(a,o,d){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(mt&2)!==0){var b=m.pending;return b===null?o.next=o:(o.next=b.next,b.next=o),m.pending=o,o=th(a),lC(a,null,d),o}return eh(a,m,o,d),th(a)}function Eu(a,o,d){if(o=o.updateQueue,o!==null&&(o=o.shared,(d&4194048)!==0)){var m=o.lanes;m&=a.pendingLanes,d|=m,o.lanes=d,Bf(a,d)}}function _y(a,o){var d=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,d===m)){var b=null,j=null;if(d=d.firstBaseUpdate,d!==null){do{var k={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};j===null?b=j=k:j=j.next=k,d=d.next}while(d!==null);j===null?b=j=o:j=j.next=o}else b=j=o;d={baseState:m.baseState,firstBaseUpdate:b,lastBaseUpdate:j,shared:m.shared,callbacks:m.callbacks},a.updateQueue=d;return}a=d.lastBaseUpdate,a===null?d.firstBaseUpdate=o:a.next=o,d.lastBaseUpdate=o}var ky=!1;function Tu(){if(ky){var a=Il;if(a!==null)throw a}}function Pu(a,o,d,m){ky=!1;var b=a.updateQueue;ts=!1;var j=b.firstBaseUpdate,k=b.lastBaseUpdate,M=b.shared.pending;if(M!==null){b.shared.pending=null;var U=M,J=U.next;U.next=null,k===null?j=J:k.next=J,k=U;var se=a.alternate;se!==null&&(se=se.updateQueue,M=se.lastBaseUpdate,M!==k&&(M===null?se.firstBaseUpdate=J:M.next=J,se.lastBaseUpdate=U))}if(j!==null){var de=b.baseState;k=0,se=J=U=null,M=j;do{var ee=M.lane&-536870913,re=ee!==M.lane;if(re?(ot&ee)===ee:(m&ee)===ee){ee!==0&&ee===Dl&&(ky=!0),se!==null&&(se=se.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Ae=a,Ue=M;ee=o;var Ct=d;switch(Ue.tag){case 1:if(Ae=Ue.payload,typeof Ae=="function"){de=Ae.call(Ct,de,ee);break e}de=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=Ue.payload,ee=typeof Ae=="function"?Ae.call(Ct,de,ee):Ae,ee==null)break e;de=g({},de,ee);break e;case 2:ts=!0}}ee=M.callback,ee!==null&&(a.flags|=64,re&&(a.flags|=8192),re=b.callbacks,re===null?b.callbacks=[ee]:re.push(ee))}else re={lane:ee,tag:M.tag,payload:M.payload,callback:M.callback,next:null},se===null?(J=se=re,U=de):se=se.next=re,k|=ee;if(M=M.next,M===null){if(M=b.shared.pending,M===null)break;re=M,M=re.next,re.next=null,b.lastBaseUpdate=re,b.shared.pending=null}}while(!0);se===null&&(U=de),b.baseState=U,b.firstBaseUpdate=J,b.lastBaseUpdate=se,j===null&&(b.shared.lanes=0),ls|=k,a.lanes=k,a.memoizedState=de}}function OC(a,o){if(typeof a!="function")throw Error(r(191,a));a.call(o)}function _C(a,o){var d=a.callbacks;if(d!==null)for(a.callbacks=null,a=0;a<d.length;a++)OC(d[a],o)}var Ul=D(null),dh=D(0);function kC(a,o){a=Sa,ae(dh,a),ae(Ul,o),Sa=a|o.baseLanes}function Ay(){ae(dh,Sa),ae(Ul,Ul.current)}function Ey(){Sa=dh.current,G(Ul),G(dh)}var Cr=D(null),Fr=null;function is(a){var o=a.alternate;ae(rn,rn.current&1),ae(Cr,a),Fr===null&&(o===null||Ul.current!==null||o.memoizedState!==null)&&(Fr=a)}function Ty(a){ae(rn,rn.current),ae(Cr,a),Fr===null&&(Fr=a)}function AC(a){a.tag===22?(ae(rn,rn.current),ae(Cr,a),Fr===null&&(Fr=a)):as()}function as(){ae(rn,rn.current),ae(Cr,Cr.current)}function Or(a){G(Cr),Fr===a&&(Fr=null),G(rn)}var rn=D(0);function fh(a){for(var o=a;o!==null;){if(o.tag===13){var d=o.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||I0(d)||L0(d)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var pa=0,Ye=null,jt=null,dn=null,hh=!1,Bl=!1,mo=!1,ph=0,zu=0,ql=null,s6=0;function Xt(){throw Error(r(321))}function Py(a,o){if(o===null)return!1;for(var d=0;d<o.length&&d<a.length;d++)if(!jr(a[d],o[d]))return!1;return!0}function zy(a,o,d,m,b,j){return pa=j,Ye=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,H.H=a===null||a.memoizedState===null?fO:Zy,mo=!1,j=d(m,b),mo=!1,Bl&&(j=TC(o,d,m,b)),EC(a),j}function EC(a){H.H=Du;var o=jt!==null&&jt.next!==null;if(pa=0,dn=jt=Ye=null,hh=!1,zu=0,ql=null,o)throw Error(r(300));a===null||fn||(a=a.dependencies,a!==null&&ih(a)&&(fn=!0))}function TC(a,o,d,m){Ye=a;var b=0;do{if(Bl&&(ql=null),zu=0,Bl=!1,25<=b)throw Error(r(301));if(b+=1,dn=jt=null,a.updateQueue!=null){var j=a.updateQueue;j.lastEffect=null,j.events=null,j.stores=null,j.memoCache!=null&&(j.memoCache.index=0)}H.H=hO,j=o(d,m)}while(Bl);return j}function o6(){var a=H.H,o=a.useState()[0];return o=typeof o.then=="function"?Mu(o):o,a=a.useState()[0],(jt!==null?jt.memoizedState:null)!==a&&(Ye.flags|=1024),o}function My(){var a=ph!==0;return ph=0,a}function Ry(a,o,d){o.updateQueue=a.updateQueue,o.flags&=-2053,a.lanes&=~d}function Dy(a){if(hh){for(a=a.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}hh=!1}pa=0,dn=jt=Ye=null,Bl=!1,zu=ph=0,ql=null}function Jn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dn===null?Ye.memoizedState=dn=a:dn=dn.next=a,dn}function an(){if(jt===null){var a=Ye.alternate;a=a!==null?a.memoizedState:null}else a=jt.next;var o=dn===null?Ye.memoizedState:dn.next;if(o!==null)dn=o,jt=a;else{if(a===null)throw Ye.alternate===null?Error(r(467)):Error(r(310));jt=a,a={memoizedState:jt.memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},dn===null?Ye.memoizedState=dn=a:dn=dn.next=a}return dn}function mh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Mu(a){var o=zu;return zu+=1,ql===null&&(ql=[]),a=wC(ql,a,o),o=Ye,(dn===null?o.memoizedState:dn.next)===null&&(o=o.alternate,H.H=o===null||o.memoizedState===null?fO:Zy),a}function gh(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Mu(a);if(a.$$typeof===A)return Pn(a)}throw Error(r(438,String(a)))}function Iy(a){var o=null,d=Ye.updateQueue;if(d!==null&&(o=d.memoCache),o==null){var m=Ye.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(o={data:m.data.map(function(b){return b.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),d===null&&(d=mh(),Ye.updateQueue=d),d.memoCache=o,d=o.data[o.index],d===void 0)for(d=o.data[o.index]=Array(a),m=0;m<a;m++)d[m]=B;return o.index++,d}function ma(a,o){return typeof o=="function"?o(a):o}function vh(a){var o=an();return Ly(o,jt,a)}function Ly(a,o,d){var m=a.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=d;var b=a.baseQueue,j=m.pending;if(j!==null){if(b!==null){var k=b.next;b.next=j.next,j.next=k}o.baseQueue=b=j,m.pending=null}if(j=a.baseState,b===null)a.memoizedState=j;else{o=b.next;var M=k=null,U=null,J=o,se=!1;do{var de=J.lane&-536870913;if(de!==J.lane?(ot&de)===de:(pa&de)===de){var ee=J.revertLane;if(ee===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),de===Dl&&(se=!0);else if((pa&ee)===ee){J=J.next,ee===Dl&&(se=!0);continue}else de={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},U===null?(M=U=de,k=j):U=U.next=de,Ye.lanes|=ee,ls|=ee;de=J.action,mo&&d(j,de),j=J.hasEagerState?J.eagerState:d(j,de)}else ee={lane:de,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},U===null?(M=U=ee,k=j):U=U.next=ee,Ye.lanes|=de,ls|=de;J=J.next}while(J!==null&&J!==o);if(U===null?k=j:U.next=M,!jr(j,a.memoizedState)&&(fn=!0,se&&(d=Il,d!==null)))throw d;a.memoizedState=j,a.baseState=k,a.baseQueue=U,m.lastRenderedState=j}return b===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function $y(a){var o=an(),d=o.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=a;var m=d.dispatch,b=d.pending,j=o.memoizedState;if(b!==null){d.pending=null;var k=b=b.next;do j=a(j,k.action),k=k.next;while(k!==b);jr(j,o.memoizedState)||(fn=!0),o.memoizedState=j,o.baseQueue===null&&(o.baseState=j),d.lastRenderedState=j}return[j,m]}function PC(a,o,d){var m=Ye,b=an(),j=ct;if(j){if(d===void 0)throw Error(r(407));d=d()}else d=o();var k=!jr((jt||b).memoizedState,d);if(k&&(b.memoizedState=d,fn=!0),b=b.queue,qy(RC.bind(null,m,b,a),[a]),b.getSnapshot!==o||k||dn!==null&&dn.memoizedState.tag&1){if(m.flags|=2048,Fl(9,{destroy:void 0},MC.bind(null,m,b,d,o),null),Ot===null)throw Error(r(349));j||(pa&127)!==0||zC(m,o,d)}return d}function zC(a,o,d){a.flags|=16384,a={getSnapshot:o,value:d},o=Ye.updateQueue,o===null?(o=mh(),Ye.updateQueue=o,o.stores=[a]):(d=o.stores,d===null?o.stores=[a]:d.push(a))}function MC(a,o,d,m){o.value=d,o.getSnapshot=m,DC(o)&&IC(a)}function RC(a,o,d){return d(function(){DC(o)&&IC(a)})}function DC(a){var o=a.getSnapshot;a=a.value;try{var d=o();return!jr(a,d)}catch{return!0}}function IC(a){var o=ao(a,2);o!==null&&mr(o,a,2)}function Uy(a){var o=Jn();if(typeof a=="function"){var d=a;if(a=d(),mo){Rr(!0);try{d()}finally{Rr(!1)}}}return o.memoizedState=o.baseState=a,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:a},o}function LC(a,o,d,m){return a.baseState=d,Ly(a,jt,typeof m=="function"?m:ma)}function l6(a,o,d,m,b){if(xh(a))throw Error(r(485));if(a=o.action,a!==null){var j={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){j.listeners.push(k)}};H.T!==null?d(!0):j.isTransition=!1,m(j),d=o.pending,d===null?(j.next=o.pending=j,$C(o,j)):(j.next=d.next,o.pending=d.next=j)}}function $C(a,o){var d=o.action,m=o.payload,b=a.state;if(o.isTransition){var j=H.T,k={};H.T=k;try{var M=d(b,m),U=H.S;U!==null&&U(k,M),UC(a,o,M)}catch(J){By(a,o,J)}finally{j!==null&&k.types!==null&&(j.types=k.types),H.T=j}}else try{j=d(b,m),UC(a,o,j)}catch(J){By(a,o,J)}}function UC(a,o,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(m){BC(a,o,m)},function(m){return By(a,o,m)}):BC(a,o,d)}function BC(a,o,d){o.status="fulfilled",o.value=d,qC(o),a.state=d,o=a.pending,o!==null&&(d=o.next,d===o?a.pending=null:(d=d.next,o.next=d,$C(a,d)))}function By(a,o,d){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do o.status="rejected",o.reason=d,qC(o),o=o.next;while(o!==m)}a.action=null}function qC(a){a=a.listeners;for(var o=0;o<a.length;o++)(0,a[o])()}function FC(a,o){return o}function KC(a,o){if(ct){var d=Ot.formState;if(d!==null){e:{var m=Ye;if(ct){if(Tt){t:{for(var b=Tt,j=qr;b.nodeType!==8;){if(!j){b=null;break t}if(b=Kr(b.nextSibling),b===null){b=null;break t}}j=b.data,b=j==="F!"||j==="F"?b:null}if(b){Tt=Kr(b.nextSibling),m=b.data==="F!";break e}}Ja(m)}m=!1}m&&(o=d[0])}}return d=Jn(),d.memoizedState=d.baseState=o,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:FC,lastRenderedState:o},d.queue=m,d=cO.bind(null,Ye,m),m.dispatch=d,m=Uy(!1),j=Vy.bind(null,Ye,!1,m.queue),m=Jn(),b={state:o,dispatch:null,action:a,pending:null},m.queue=b,d=l6.bind(null,Ye,b,j,d),b.dispatch=d,m.memoizedState=a,[o,d,!1]}function HC(a){var o=an();return GC(o,jt,a)}function GC(a,o,d){if(o=Ly(a,o,FC)[0],a=vh(ma)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var m=Mu(o)}catch(k){throw k===Ll?oh:k}else m=o;o=an();var b=o.queue,j=b.dispatch;return d!==o.memoizedState&&(Ye.flags|=2048,Fl(9,{destroy:void 0},c6.bind(null,b,d),null)),[m,j,a]}function c6(a,o){a.action=o}function VC(a){var o=an(),d=jt;if(d!==null)return GC(o,d,a);an(),o=o.memoizedState,d=an();var m=d.queue.dispatch;return d.memoizedState=a,[o,m,!1]}function Fl(a,o,d,m){return a={tag:a,create:d,deps:m,inst:o,next:null},o=Ye.updateQueue,o===null&&(o=mh(),Ye.updateQueue=o),d=o.lastEffect,d===null?o.lastEffect=a.next=a:(m=d.next,d.next=a,a.next=m,o.lastEffect=a),a}function ZC(){return an().memoizedState}function yh(a,o,d,m){var b=Jn();Ye.flags|=a,b.memoizedState=Fl(1|o,{destroy:void 0},d,m===void 0?null:m)}function bh(a,o,d,m){var b=an();m=m===void 0?null:m;var j=b.memoizedState.inst;jt!==null&&m!==null&&Py(m,jt.memoizedState.deps)?b.memoizedState=Fl(o,j,d,m):(Ye.flags|=a,b.memoizedState=Fl(1|o,j,d,m))}function YC(a,o){yh(8390656,8,a,o)}function qy(a,o){bh(2048,8,a,o)}function u6(a){Ye.flags|=4;var o=Ye.updateQueue;if(o===null)o=mh(),Ye.updateQueue=o,o.events=[a];else{var d=o.events;d===null?o.events=[a]:d.push(a)}}function WC(a){var o=an().memoizedState;return u6({ref:o,nextImpl:a}),function(){if((mt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function QC(a,o){return bh(4,2,a,o)}function XC(a,o){return bh(4,4,a,o)}function JC(a,o){if(typeof o=="function"){a=a();var d=o(a);return function(){typeof d=="function"?d():o(null)}}if(o!=null)return a=a(),o.current=a,function(){o.current=null}}function eO(a,o,d){d=d!=null?d.concat([a]):null,bh(4,4,JC.bind(null,o,a),d)}function Fy(){}function tO(a,o){var d=an();o=o===void 0?null:o;var m=d.memoizedState;return o!==null&&Py(o,m[1])?m[0]:(d.memoizedState=[a,o],a)}function nO(a,o){var d=an();o=o===void 0?null:o;var m=d.memoizedState;if(o!==null&&Py(o,m[1]))return m[0];if(m=a(),mo){Rr(!0);try{a()}finally{Rr(!1)}}return d.memoizedState=[m,o],m}function Ky(a,o,d){return d===void 0||(pa&1073741824)!==0&&(ot&261930)===0?a.memoizedState=o:(a.memoizedState=d,a=r_(),Ye.lanes|=a,ls|=a,d)}function rO(a,o,d,m){return jr(d,o)?d:Ul.current!==null?(a=Ky(a,d,m),jr(a,o)||(fn=!0),a):(pa&42)===0||(pa&1073741824)!==0&&(ot&261930)===0?(fn=!0,a.memoizedState=d):(a=r_(),Ye.lanes|=a,ls|=a,o)}function iO(a,o,d,m,b){var j=ie.p;ie.p=j!==0&&8>j?j:8;var k=H.T,M={};H.T=M,Vy(a,!1,o,d);try{var U=b(),J=H.S;if(J!==null&&J(M,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var se=a6(U,m);Ru(a,o,se,Ar(a))}else Ru(a,o,m,Ar(a))}catch(de){Ru(a,o,{then:function(){},status:"rejected",reason:de},Ar())}finally{ie.p=j,k!==null&&M.types!==null&&(k.types=M.types),H.T=k}}function d6(){}function Hy(a,o,d,m){if(a.tag!==5)throw Error(r(476));var b=aO(a).queue;iO(a,b,o,pe,d===null?d6:function(){return sO(a),d(m)})}function aO(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:pe},next:null};var d={};return o.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:d},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function sO(a){var o=aO(a);o.next===null&&(o=a.alternate.memoizedState),Ru(a,o.next.queue,{},Ar())}function Gy(){return Pn(Xu)}function oO(){return an().memoizedState}function lO(){return an().memoizedState}function f6(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var d=Ar();a=ns(d);var m=rs(o,a,d);m!==null&&(mr(m,o,d),Eu(m,o,d)),o={cache:wy()},a.payload=o;return}o=o.return}}function h6(a,o,d){var m=Ar();d={lane:m,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},xh(a)?uO(o,d):(d=uy(a,o,d,m),d!==null&&(mr(d,a,m),dO(d,o,m)))}function cO(a,o,d){var m=Ar();Ru(a,o,d,m)}function Ru(a,o,d,m){var b={lane:m,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(xh(a))uO(o,b);else{var j=a.alternate;if(a.lanes===0&&(j===null||j.lanes===0)&&(j=o.lastRenderedReducer,j!==null))try{var k=o.lastRenderedState,M=j(k,d);if(b.hasEagerState=!0,b.eagerState=M,jr(M,k))return eh(a,o,b,0),Ot===null&&Jf(),!1}catch{}if(d=uy(a,o,b,m),d!==null)return mr(d,a,m),dO(d,o,m),!0}return!1}function Vy(a,o,d,m){if(m={lane:2,revertLane:C0(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},xh(a)){if(o)throw Error(r(479))}else o=uy(a,d,m,2),o!==null&&mr(o,a,2)}function xh(a){var o=a.alternate;return a===Ye||o!==null&&o===Ye}function uO(a,o){Bl=hh=!0;var d=a.pending;d===null?o.next=o:(o.next=d.next,d.next=o),a.pending=o}function dO(a,o,d){if((d&4194048)!==0){var m=o.lanes;m&=a.pendingLanes,d|=m,o.lanes=d,Bf(a,d)}}var Du={readContext:Pn,use:gh,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useLayoutEffect:Xt,useInsertionEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useSyncExternalStore:Xt,useId:Xt,useHostTransitionStatus:Xt,useFormState:Xt,useActionState:Xt,useOptimistic:Xt,useMemoCache:Xt,useCacheRefresh:Xt};Du.useEffectEvent=Xt;var fO={readContext:Pn,use:gh,useCallback:function(a,o){return Jn().memoizedState=[a,o===void 0?null:o],a},useContext:Pn,useEffect:YC,useImperativeHandle:function(a,o,d){d=d!=null?d.concat([a]):null,yh(4194308,4,JC.bind(null,o,a),d)},useLayoutEffect:function(a,o){return yh(4194308,4,a,o)},useInsertionEffect:function(a,o){yh(4,2,a,o)},useMemo:function(a,o){var d=Jn();o=o===void 0?null:o;var m=a();if(mo){Rr(!0);try{a()}finally{Rr(!1)}}return d.memoizedState=[m,o],m},useReducer:function(a,o,d){var m=Jn();if(d!==void 0){var b=d(o);if(mo){Rr(!0);try{d(o)}finally{Rr(!1)}}}else b=o;return m.memoizedState=m.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},m.queue=a,a=a.dispatch=h6.bind(null,Ye,a),[m.memoizedState,a]},useRef:function(a){var o=Jn();return a={current:a},o.memoizedState=a},useState:function(a){a=Uy(a);var o=a.queue,d=cO.bind(null,Ye,o);return o.dispatch=d,[a.memoizedState,d]},useDebugValue:Fy,useDeferredValue:function(a,o){var d=Jn();return Ky(d,a,o)},useTransition:function(){var a=Uy(!1);return a=iO.bind(null,Ye,a.queue,!0,!1),Jn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,d){var m=Ye,b=Jn();if(ct){if(d===void 0)throw Error(r(407));d=d()}else{if(d=o(),Ot===null)throw Error(r(349));(ot&127)!==0||zC(m,o,d)}b.memoizedState=d;var j={value:d,getSnapshot:o};return b.queue=j,YC(RC.bind(null,m,j,a),[a]),m.flags|=2048,Fl(9,{destroy:void 0},MC.bind(null,m,j,d,o),null),d},useId:function(){var a=Jn(),o=Ot.identifierPrefix;if(ct){var d=Li,m=Ii;d=(m&~(1<<32-ye(m)-1)).toString(32)+d,o="_"+o+"R_"+d,d=ph++,0<d&&(o+="H"+d.toString(32)),o+="_"}else d=s6++,o="_"+o+"r_"+d.toString(32)+"_";return a.memoizedState=o},useHostTransitionStatus:Gy,useFormState:KC,useActionState:KC,useOptimistic:function(a){var o=Jn();o.memoizedState=o.baseState=a;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=d,o=Vy.bind(null,Ye,!0,d),d.dispatch=o,[a,o]},useMemoCache:Iy,useCacheRefresh:function(){return Jn().memoizedState=f6.bind(null,Ye)},useEffectEvent:function(a){var o=Jn(),d={impl:a};return o.memoizedState=d,function(){if((mt&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},Zy={readContext:Pn,use:gh,useCallback:tO,useContext:Pn,useEffect:qy,useImperativeHandle:eO,useInsertionEffect:QC,useLayoutEffect:XC,useMemo:nO,useReducer:vh,useRef:ZC,useState:function(){return vh(ma)},useDebugValue:Fy,useDeferredValue:function(a,o){var d=an();return rO(d,jt.memoizedState,a,o)},useTransition:function(){var a=vh(ma)[0],o=an().memoizedState;return[typeof a=="boolean"?a:Mu(a),o]},useSyncExternalStore:PC,useId:oO,useHostTransitionStatus:Gy,useFormState:HC,useActionState:HC,useOptimistic:function(a,o){var d=an();return LC(d,jt,a,o)},useMemoCache:Iy,useCacheRefresh:lO};Zy.useEffectEvent=WC;var hO={readContext:Pn,use:gh,useCallback:tO,useContext:Pn,useEffect:qy,useImperativeHandle:eO,useInsertionEffect:QC,useLayoutEffect:XC,useMemo:nO,useReducer:$y,useRef:ZC,useState:function(){return $y(ma)},useDebugValue:Fy,useDeferredValue:function(a,o){var d=an();return jt===null?Ky(d,a,o):rO(d,jt.memoizedState,a,o)},useTransition:function(){var a=$y(ma)[0],o=an().memoizedState;return[typeof a=="boolean"?a:Mu(a),o]},useSyncExternalStore:PC,useId:oO,useHostTransitionStatus:Gy,useFormState:VC,useActionState:VC,useOptimistic:function(a,o){var d=an();return jt!==null?LC(d,jt,a,o):(d.baseState=a,[a,d.queue.dispatch])},useMemoCache:Iy,useCacheRefresh:lO};hO.useEffectEvent=WC;function Yy(a,o,d,m){o=a.memoizedState,d=d(m,o),d=d==null?o:g({},o,d),a.memoizedState=d,a.lanes===0&&(a.updateQueue.baseState=d)}var Wy={enqueueSetState:function(a,o,d){a=a._reactInternals;var m=Ar(),b=ns(m);b.payload=o,d!=null&&(b.callback=d),o=rs(a,b,m),o!==null&&(mr(o,a,m),Eu(o,a,m))},enqueueReplaceState:function(a,o,d){a=a._reactInternals;var m=Ar(),b=ns(m);b.tag=1,b.payload=o,d!=null&&(b.callback=d),o=rs(a,b,m),o!==null&&(mr(o,a,m),Eu(o,a,m))},enqueueForceUpdate:function(a,o){a=a._reactInternals;var d=Ar(),m=ns(d);m.tag=2,o!=null&&(m.callback=o),o=rs(a,m,d),o!==null&&(mr(o,a,d),Eu(o,a,d))}};function pO(a,o,d,m,b,j,k){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,j,k):o.prototype&&o.prototype.isPureReactComponent?!Su(d,m)||!Su(b,j):!0}function mO(a,o,d,m){a=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(d,m),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(d,m),o.state!==a&&Wy.enqueueReplaceState(o,o.state,null)}function go(a,o){var d=o;if("ref"in o){d={};for(var m in o)m!=="ref"&&(d[m]=o[m])}if(a=a.defaultProps){d===o&&(d=g({},d));for(var b in a)d[b]===void 0&&(d[b]=a[b])}return d}function gO(a){Xf(a)}function vO(a){console.error(a)}function yO(a){Xf(a)}function wh(a,o){try{var d=a.onUncaughtError;d(o.value,{componentStack:o.stack})}catch(m){setTimeout(function(){throw m})}}function bO(a,o,d){try{var m=a.onCaughtError;m(d.value,{componentStack:d.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Qy(a,o,d){return d=ns(d),d.tag=3,d.payload={element:null},d.callback=function(){wh(a,o)},d}function xO(a){return a=ns(a),a.tag=3,a}function wO(a,o,d,m){var b=d.type.getDerivedStateFromError;if(typeof b=="function"){var j=m.value;a.payload=function(){return b(j)},a.callback=function(){bO(o,d,m)}}var k=d.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(a.callback=function(){bO(o,d,m),typeof b!="function"&&(cs===null?cs=new Set([this]):cs.add(this));var M=m.stack;this.componentDidCatch(m.value,{componentStack:M!==null?M:""})})}function p6(a,o,d,m,b){if(d.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(o=d.alternate,o!==null&&Rl(o,d,b,!0),d=Cr.current,d!==null){switch(d.tag){case 31:case 13:return Fr===null?zh():d.alternate===null&&Jt===0&&(Jt=3),d.flags&=-257,d.flags|=65536,d.lanes=b,m===lh?d.flags|=16384:(o=d.updateQueue,o===null?d.updateQueue=new Set([m]):o.add(m),S0(a,m,b)),!1;case 22:return d.flags|=65536,m===lh?d.flags|=16384:(o=d.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([m])},d.updateQueue=o):(d=o.retryQueue,d===null?o.retryQueue=new Set([m]):d.add(m)),S0(a,m,b)),!1}throw Error(r(435,d.tag))}return S0(a,m,b),zh(),!1}if(ct)return o=Cr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=b,m!==gy&&(a=Error(r(422),{cause:m}),Cu($r(a,d)))):(m!==gy&&(o=Error(r(423),{cause:m}),Cu($r(o,d))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,m=$r(m,d),b=Qy(a.stateNode,m,b),_y(a,b),Jt!==4&&(Jt=2)),!1;var j=Error(r(520),{cause:m});if(j=$r(j,d),Ku===null?Ku=[j]:Ku.push(j),Jt!==4&&(Jt=2),o===null)return!0;m=$r(m,d),d=o;do{switch(d.tag){case 3:return d.flags|=65536,a=b&-b,d.lanes|=a,a=Qy(d.stateNode,m,a),_y(d,a),!1;case 1:if(o=d.type,j=d.stateNode,(d.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||j!==null&&typeof j.componentDidCatch=="function"&&(cs===null||!cs.has(j))))return d.flags|=65536,b&=-b,d.lanes|=b,b=xO(b),wO(b,a,d,m),_y(d,b),!1}d=d.return}while(d!==null);return!1}var Xy=Error(r(461)),fn=!1;function zn(a,o,d,m){o.child=a===null?CC(o,null,d,m):po(o,a.child,d,m)}function SO(a,o,d,m,b){d=d.render;var j=o.ref;if("ref"in m){var k={};for(var M in m)M!=="ref"&&(k[M]=m[M])}else k=m;return co(o),m=zy(a,o,d,k,j,b),M=My(),a!==null&&!fn?(Ry(a,o,b),ga(a,o,b)):(ct&&M&&py(o),o.flags|=1,zn(a,o,m,b),o.child)}function jO(a,o,d,m,b){if(a===null){var j=d.type;return typeof j=="function"&&!dy(j)&&j.defaultProps===void 0&&d.compare===null?(o.tag=15,o.type=j,NO(a,o,j,m,b)):(a=nh(d.type,null,m,o,o.mode,b),a.ref=o.ref,a.return=o,o.child=a)}if(j=a.child,!s0(a,b)){var k=j.memoizedProps;if(d=d.compare,d=d!==null?d:Su,d(k,m)&&a.ref===o.ref)return ga(a,o,b)}return o.flags|=1,a=ua(j,m),a.ref=o.ref,a.return=o,o.child=a}function NO(a,o,d,m,b){if(a!==null){var j=a.memoizedProps;if(Su(j,m)&&a.ref===o.ref)if(fn=!1,o.pendingProps=m=j,s0(a,b))(a.flags&131072)!==0&&(fn=!0);else return o.lanes=a.lanes,ga(a,o,b)}return Jy(a,o,d,m,b)}function CO(a,o,d,m){var b=m.children,j=a!==null?a.memoizedState:null;if(a===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((o.flags&128)!==0){if(j=j!==null?j.baseLanes|d:d,a!==null){for(m=o.child=a.child,b=0;m!==null;)b=b|m.lanes|m.childLanes,m=m.sibling;m=b&~j}else m=0,o.child=null;return OO(a,o,j,d,m)}if((d&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},a!==null&&sh(o,j!==null?j.cachePool:null),j!==null?kC(o,j):Ay(),AC(o);else return m=o.lanes=536870912,OO(a,o,j!==null?j.baseLanes|d:d,d,m)}else j!==null?(sh(o,j.cachePool),kC(o,j),as(),o.memoizedState=null):(a!==null&&sh(o,null),Ay(),as());return zn(a,o,b,d),o.child}function Iu(a,o){return a!==null&&a.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function OO(a,o,d,m,b){var j=jy();return j=j===null?null:{parent:un._currentValue,pool:j},o.memoizedState={baseLanes:d,cachePool:j},a!==null&&sh(o,null),Ay(),AC(o),a!==null&&Rl(a,o,m,!0),o.childLanes=b,null}function Sh(a,o){return o=Nh({mode:o.mode,children:o.children},a.mode),o.ref=a.ref,a.child=o,o.return=a,o}function _O(a,o,d){return po(o,a.child,null,d),a=Sh(o,o.pendingProps),a.flags|=2,Or(o),o.memoizedState=null,a}function m6(a,o,d){var m=o.pendingProps,b=(o.flags&128)!==0;if(o.flags&=-129,a===null){if(ct){if(m.mode==="hidden")return a=Sh(o,m),o.lanes=536870912,Iu(null,a);if(Ty(o),(a=Tt)?(a=$_(a,qr),a=a!==null&&a.data==="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:Qa!==null?{id:Ii,overflow:Li}:null,retryLane:536870912,hydrationErrors:null},d=uC(a),d.return=o,o.child=d,Tn=o,Tt=null)):a=null,a===null)throw Ja(o);return o.lanes=536870912,null}return Sh(o,m)}var j=a.memoizedState;if(j!==null){var k=j.dehydrated;if(Ty(o),b)if(o.flags&256)o.flags&=-257,o=_O(a,o,d);else if(o.memoizedState!==null)o.child=a.child,o.flags|=128,o=null;else throw Error(r(558));else if(fn||Rl(a,o,d,!1),b=(d&a.childLanes)!==0,fn||b){if(m=Ot,m!==null&&(k=hu(m,d),k!==0&&k!==j.retryLane))throw j.retryLane=k,ao(a,k),mr(m,a,k),Xy;zh(),o=_O(a,o,d)}else a=j.treeContext,Tt=Kr(k.nextSibling),Tn=o,ct=!0,Xa=null,qr=!1,a!==null&&hC(o,a),o=Sh(o,m),o.flags|=4096;return o}return a=ua(a.child,{mode:m.mode,children:m.children}),a.ref=o.ref,o.child=a,a.return=o,a}function jh(a,o){var d=o.ref;if(d===null)a!==null&&a.ref!==null&&(o.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(a===null||a.ref!==d)&&(o.flags|=4194816)}}function Jy(a,o,d,m,b){return co(o),d=zy(a,o,d,m,void 0,b),m=My(),a!==null&&!fn?(Ry(a,o,b),ga(a,o,b)):(ct&&m&&py(o),o.flags|=1,zn(a,o,d,b),o.child)}function kO(a,o,d,m,b,j){return co(o),o.updateQueue=null,d=TC(o,m,d,b),EC(a),m=My(),a!==null&&!fn?(Ry(a,o,j),ga(a,o,j)):(ct&&m&&py(o),o.flags|=1,zn(a,o,d,j),o.child)}function AO(a,o,d,m,b){if(co(o),o.stateNode===null){var j=Tl,k=d.contextType;typeof k=="object"&&k!==null&&(j=Pn(k)),j=new d(m,j),o.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,j.updater=Wy,o.stateNode=j,j._reactInternals=o,j=o.stateNode,j.props=m,j.state=o.memoizedState,j.refs={},Cy(o),k=d.contextType,j.context=typeof k=="object"&&k!==null?Pn(k):Tl,j.state=o.memoizedState,k=d.getDerivedStateFromProps,typeof k=="function"&&(Yy(o,d,k,m),j.state=o.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(k=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),k!==j.state&&Wy.enqueueReplaceState(j,j.state,null),Pu(o,m,j,b),Tu(),j.state=o.memoizedState),typeof j.componentDidMount=="function"&&(o.flags|=4194308),m=!0}else if(a===null){j=o.stateNode;var M=o.memoizedProps,U=go(d,M);j.props=U;var J=j.context,se=d.contextType;k=Tl,typeof se=="object"&&se!==null&&(k=Pn(se));var de=d.getDerivedStateFromProps;se=typeof de=="function"||typeof j.getSnapshotBeforeUpdate=="function",M=o.pendingProps!==M,se||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(M||J!==k)&&mO(o,j,m,k),ts=!1;var ee=o.memoizedState;j.state=ee,Pu(o,m,j,b),Tu(),J=o.memoizedState,M||ee!==J||ts?(typeof de=="function"&&(Yy(o,d,de,m),J=o.memoizedState),(U=ts||pO(o,d,U,m,ee,J,k))?(se||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount()),typeof j.componentDidMount=="function"&&(o.flags|=4194308)):(typeof j.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=m,o.memoizedState=J),j.props=m,j.state=J,j.context=k,m=U):(typeof j.componentDidMount=="function"&&(o.flags|=4194308),m=!1)}else{j=o.stateNode,Oy(a,o),k=o.memoizedProps,se=go(d,k),j.props=se,de=o.pendingProps,ee=j.context,J=d.contextType,U=Tl,typeof J=="object"&&J!==null&&(U=Pn(J)),M=d.getDerivedStateFromProps,(J=typeof M=="function"||typeof j.getSnapshotBeforeUpdate=="function")||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(k!==de||ee!==U)&&mO(o,j,m,U),ts=!1,ee=o.memoizedState,j.state=ee,Pu(o,m,j,b),Tu();var re=o.memoizedState;k!==de||ee!==re||ts||a!==null&&a.dependencies!==null&&ih(a.dependencies)?(typeof M=="function"&&(Yy(o,d,M,m),re=o.memoizedState),(se=ts||pO(o,d,se,m,ee,re,U)||a!==null&&a.dependencies!==null&&ih(a.dependencies))?(J||typeof j.UNSAFE_componentWillUpdate!="function"&&typeof j.componentWillUpdate!="function"||(typeof j.componentWillUpdate=="function"&&j.componentWillUpdate(m,re,U),typeof j.UNSAFE_componentWillUpdate=="function"&&j.UNSAFE_componentWillUpdate(m,re,U)),typeof j.componentDidUpdate=="function"&&(o.flags|=4),typeof j.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof j.componentDidUpdate!="function"||k===a.memoizedProps&&ee===a.memoizedState||(o.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||k===a.memoizedProps&&ee===a.memoizedState||(o.flags|=1024),o.memoizedProps=m,o.memoizedState=re),j.props=m,j.state=re,j.context=U,m=se):(typeof j.componentDidUpdate!="function"||k===a.memoizedProps&&ee===a.memoizedState||(o.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||k===a.memoizedProps&&ee===a.memoizedState||(o.flags|=1024),m=!1)}return j=m,jh(a,o),m=(o.flags&128)!==0,j||m?(j=o.stateNode,d=m&&typeof d.getDerivedStateFromError!="function"?null:j.render(),o.flags|=1,a!==null&&m?(o.child=po(o,a.child,null,b),o.child=po(o,null,d,b)):zn(a,o,d,b),o.memoizedState=j.state,a=o.child):a=ga(a,o,b),a}function EO(a,o,d,m){return oo(),o.flags|=256,zn(a,o,d,m),o.child}var e0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function t0(a){return{baseLanes:a,cachePool:bC()}}function n0(a,o,d){return a=a!==null?a.childLanes&~d:0,o&&(a|=kr),a}function TO(a,o,d){var m=o.pendingProps,b=!1,j=(o.flags&128)!==0,k;if((k=j)||(k=a!==null&&a.memoizedState===null?!1:(rn.current&2)!==0),k&&(b=!0,o.flags&=-129),k=(o.flags&32)!==0,o.flags&=-33,a===null){if(ct){if(b?is(o):as(),(a=Tt)?(a=$_(a,qr),a=a!==null&&a.data!=="&"?a:null,a!==null&&(o.memoizedState={dehydrated:a,treeContext:Qa!==null?{id:Ii,overflow:Li}:null,retryLane:536870912,hydrationErrors:null},d=uC(a),d.return=o,o.child=d,Tn=o,Tt=null)):a=null,a===null)throw Ja(o);return L0(a)?o.lanes=32:o.lanes=536870912,null}var M=m.children;return m=m.fallback,b?(as(),b=o.mode,M=Nh({mode:"hidden",children:M},b),m=so(m,b,d,null),M.return=o,m.return=o,M.sibling=m,o.child=M,m=o.child,m.memoizedState=t0(d),m.childLanes=n0(a,k,d),o.memoizedState=e0,Iu(null,m)):(is(o),r0(o,M))}var U=a.memoizedState;if(U!==null&&(M=U.dehydrated,M!==null)){if(j)o.flags&256?(is(o),o.flags&=-257,o=i0(a,o,d)):o.memoizedState!==null?(as(),o.child=a.child,o.flags|=128,o=null):(as(),M=m.fallback,b=o.mode,m=Nh({mode:"visible",children:m.children},b),M=so(M,b,d,null),M.flags|=2,m.return=o,M.return=o,m.sibling=M,o.child=m,po(o,a.child,null,d),m=o.child,m.memoizedState=t0(d),m.childLanes=n0(a,k,d),o.memoizedState=e0,o=Iu(null,m));else if(is(o),L0(M)){if(k=M.nextSibling&&M.nextSibling.dataset,k)var J=k.dgst;k=J,m=Error(r(419)),m.stack="",m.digest=k,Cu({value:m,source:null,stack:null}),o=i0(a,o,d)}else if(fn||Rl(a,o,d,!1),k=(d&a.childLanes)!==0,fn||k){if(k=Ot,k!==null&&(m=hu(k,d),m!==0&&m!==U.retryLane))throw U.retryLane=m,ao(a,m),mr(k,a,m),Xy;I0(M)||zh(),o=i0(a,o,d)}else I0(M)?(o.flags|=192,o.child=a.child,o=null):(a=U.treeContext,Tt=Kr(M.nextSibling),Tn=o,ct=!0,Xa=null,qr=!1,a!==null&&hC(o,a),o=r0(o,m.children),o.flags|=4096);return o}return b?(as(),M=m.fallback,b=o.mode,U=a.child,J=U.sibling,m=ua(U,{mode:"hidden",children:m.children}),m.subtreeFlags=U.subtreeFlags&65011712,J!==null?M=ua(J,M):(M=so(M,b,d,null),M.flags|=2),M.return=o,m.return=o,m.sibling=M,o.child=m,Iu(null,m),m=o.child,M=a.child.memoizedState,M===null?M=t0(d):(b=M.cachePool,b!==null?(U=un._currentValue,b=b.parent!==U?{parent:U,pool:U}:b):b=bC(),M={baseLanes:M.baseLanes|d,cachePool:b}),m.memoizedState=M,m.childLanes=n0(a,k,d),o.memoizedState=e0,Iu(a.child,m)):(is(o),d=a.child,a=d.sibling,d=ua(d,{mode:"visible",children:m.children}),d.return=o,d.sibling=null,a!==null&&(k=o.deletions,k===null?(o.deletions=[a],o.flags|=16):k.push(a)),o.child=d,o.memoizedState=null,d)}function r0(a,o){return o=Nh({mode:"visible",children:o},a.mode),o.return=a,a.child=o}function Nh(a,o){return a=Nr(22,a,null,o),a.lanes=0,a}function i0(a,o,d){return po(o,a.child,null,d),a=r0(o,o.pendingProps.children),a.flags|=2,o.memoizedState=null,a}function PO(a,o,d){a.lanes|=o;var m=a.alternate;m!==null&&(m.lanes|=o),by(a.return,o,d)}function a0(a,o,d,m,b,j){var k=a.memoizedState;k===null?a.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:m,tail:d,tailMode:b,treeForkCount:j}:(k.isBackwards=o,k.rendering=null,k.renderingStartTime=0,k.last=m,k.tail=d,k.tailMode=b,k.treeForkCount=j)}function zO(a,o,d){var m=o.pendingProps,b=m.revealOrder,j=m.tail;m=m.children;var k=rn.current,M=(k&2)!==0;if(M?(k=k&1|2,o.flags|=128):k&=1,ae(rn,k),zn(a,o,m,d),m=ct?Nu:0,!M&&a!==null&&(a.flags&128)!==0)e:for(a=o.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&PO(a,d,o);else if(a.tag===19)PO(a,d,o);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(b){case"forwards":for(d=o.child,b=null;d!==null;)a=d.alternate,a!==null&&fh(a)===null&&(b=d),d=d.sibling;d=b,d===null?(b=o.child,o.child=null):(b=d.sibling,d.sibling=null),a0(o,!1,b,d,j,m);break;case"backwards":case"unstable_legacy-backwards":for(d=null,b=o.child,o.child=null;b!==null;){if(a=b.alternate,a!==null&&fh(a)===null){o.child=b;break}a=b.sibling,b.sibling=d,d=b,b=a}a0(o,!0,d,null,j,m);break;case"together":a0(o,!1,null,null,void 0,m);break;default:o.memoizedState=null}return o.child}function ga(a,o,d){if(a!==null&&(o.dependencies=a.dependencies),ls|=o.lanes,(d&o.childLanes)===0)if(a!==null){if(Rl(a,o,d,!1),(d&o.childLanes)===0)return null}else return null;if(a!==null&&o.child!==a.child)throw Error(r(153));if(o.child!==null){for(a=o.child,d=ua(a,a.pendingProps),o.child=d,d.return=o;a.sibling!==null;)a=a.sibling,d=d.sibling=ua(a,a.pendingProps),d.return=o;d.sibling=null}return o.child}function s0(a,o){return(a.lanes&o)!==0?!0:(a=a.dependencies,!!(a!==null&&ih(a)))}function g6(a,o,d){switch(o.tag){case 3:Se(o,o.stateNode.containerInfo),es(o,un,a.memoizedState.cache),oo();break;case 27:case 5:le(o);break;case 4:Se(o,o.stateNode.containerInfo);break;case 10:es(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Ty(o),null;break;case 13:var m=o.memoizedState;if(m!==null)return m.dehydrated!==null?(is(o),o.flags|=128,null):(d&o.child.childLanes)!==0?TO(a,o,d):(is(o),a=ga(a,o,d),a!==null?a.sibling:null);is(o);break;case 19:var b=(a.flags&128)!==0;if(m=(d&o.childLanes)!==0,m||(Rl(a,o,d,!1),m=(d&o.childLanes)!==0),b){if(m)return zO(a,o,d);o.flags|=128}if(b=o.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),ae(rn,rn.current),m)break;return null;case 22:return o.lanes=0,CO(a,o,d,o.pendingProps);case 24:es(o,un,a.memoizedState.cache)}return ga(a,o,d)}function MO(a,o,d){if(a!==null)if(a.memoizedProps!==o.pendingProps)fn=!0;else{if(!s0(a,d)&&(o.flags&128)===0)return fn=!1,g6(a,o,d);fn=(a.flags&131072)!==0}else fn=!1,ct&&(o.flags&1048576)!==0&&fC(o,Nu,o.index);switch(o.lanes=0,o.tag){case 16:e:{var m=o.pendingProps;if(a=fo(o.elementType),o.type=a,typeof a=="function")dy(a)?(m=go(a,m),o.tag=1,o=AO(null,o,a,m,d)):(o.tag=0,o=Jy(null,o,a,m,d));else{if(a!=null){var b=a.$$typeof;if(b===O){o.tag=11,o=SO(null,o,a,m,d);break e}else if(b===_){o.tag=14,o=jO(null,o,a,m,d);break e}}throw o=he(a)||a,Error(r(306,o,""))}}return o;case 0:return Jy(a,o,o.type,o.pendingProps,d);case 1:return m=o.type,b=go(m,o.pendingProps),AO(a,o,m,b,d);case 3:e:{if(Se(o,o.stateNode.containerInfo),a===null)throw Error(r(387));m=o.pendingProps;var j=o.memoizedState;b=j.element,Oy(a,o),Pu(o,m,null,d);var k=o.memoizedState;if(m=k.cache,es(o,un,m),m!==j.cache&&xy(o,[un],d,!0),Tu(),m=k.element,j.isDehydrated)if(j={element:m,isDehydrated:!1,cache:k.cache},o.updateQueue.baseState=j,o.memoizedState=j,o.flags&256){o=EO(a,o,m,d);break e}else if(m!==b){b=$r(Error(r(424)),o),Cu(b),o=EO(a,o,m,d);break e}else for(a=o.stateNode.containerInfo,a.nodeType===9?a=a.body:a=a.nodeName==="HTML"?a.ownerDocument.body:a,Tt=Kr(a.firstChild),Tn=o,ct=!0,Xa=null,qr=!0,d=CC(o,null,m,d),o.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(oo(),m===b){o=ga(a,o,d);break e}zn(a,o,m,d)}o=o.child}return o;case 26:return jh(a,o),a===null?(d=H_(o.type,null,o.pendingProps,null))?o.memoizedState=d:ct||(d=o.type,a=o.pendingProps,m=Uh(oe.current).createElement(d),m[Dt]=o,m[Qt]=a,Mn(m,d,a),cn(m),o.stateNode=m):o.memoizedState=H_(o.type,a.memoizedProps,o.pendingProps,a.memoizedState),null;case 27:return le(o),a===null&&ct&&(m=o.stateNode=q_(o.type,o.pendingProps,oe.current),Tn=o,qr=!0,b=Tt,hs(o.type)?($0=b,Tt=Kr(m.firstChild)):Tt=b),zn(a,o,o.pendingProps.children,d),jh(a,o),a===null&&(o.flags|=4194304),o.child;case 5:return a===null&&ct&&((b=m=Tt)&&(m=G6(m,o.type,o.pendingProps,qr),m!==null?(o.stateNode=m,Tn=o,Tt=Kr(m.firstChild),qr=!1,b=!0):b=!1),b||Ja(o)),le(o),b=o.type,j=o.pendingProps,k=a!==null?a.memoizedProps:null,m=j.children,M0(b,j)?m=null:k!==null&&M0(b,k)&&(o.flags|=32),o.memoizedState!==null&&(b=zy(a,o,o6,null,null,d),Xu._currentValue=b),jh(a,o),zn(a,o,m,d),o.child;case 6:return a===null&&ct&&((a=d=Tt)&&(d=V6(d,o.pendingProps,qr),d!==null?(o.stateNode=d,Tn=o,Tt=null,a=!0):a=!1),a||Ja(o)),null;case 13:return TO(a,o,d);case 4:return Se(o,o.stateNode.containerInfo),m=o.pendingProps,a===null?o.child=po(o,null,m,d):zn(a,o,m,d),o.child;case 11:return SO(a,o,o.type,o.pendingProps,d);case 7:return zn(a,o,o.pendingProps,d),o.child;case 8:return zn(a,o,o.pendingProps.children,d),o.child;case 12:return zn(a,o,o.pendingProps.children,d),o.child;case 10:return m=o.pendingProps,es(o,o.type,m.value),zn(a,o,m.children,d),o.child;case 9:return b=o.type._context,m=o.pendingProps.children,co(o),b=Pn(b),m=m(b),o.flags|=1,zn(a,o,m,d),o.child;case 14:return jO(a,o,o.type,o.pendingProps,d);case 15:return NO(a,o,o.type,o.pendingProps,d);case 19:return zO(a,o,d);case 31:return m6(a,o,d);case 22:return CO(a,o,d,o.pendingProps);case 24:return co(o),m=Pn(un),a===null?(b=jy(),b===null&&(b=Ot,j=wy(),b.pooledCache=j,j.refCount++,j!==null&&(b.pooledCacheLanes|=d),b=j),o.memoizedState={parent:m,cache:b},Cy(o),es(o,un,b)):((a.lanes&d)!==0&&(Oy(a,o),Pu(o,null,null,d),Tu()),b=a.memoizedState,j=o.memoizedState,b.parent!==m?(b={parent:m,cache:m},o.memoizedState=b,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=b),es(o,un,m)):(m=j.cache,es(o,un,m),m!==b.cache&&xy(o,[un],d,!0))),zn(a,o,o.pendingProps.children,d),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function va(a){a.flags|=4}function o0(a,o,d,m,b){if((o=(a.mode&32)!==0)&&(o=!1),o){if(a.flags|=16777216,(b&335544128)===b)if(a.stateNode.complete)a.flags|=8192;else if(o_())a.flags|=8192;else throw ho=lh,Ny}else a.flags&=-16777217}function RO(a,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!W_(o))if(o_())a.flags|=8192;else throw ho=lh,Ny}function Ch(a,o){o!==null&&(a.flags|=4),a.flags&16384&&(o=a.tag!==22?$f():536870912,a.lanes|=o,Vl|=o)}function Lu(a,o){if(!ct)switch(a.tailMode){case"hidden":o=a.tail;for(var d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?a.tail=null:d.sibling=null;break;case"collapsed":d=a.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?o||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function Pt(a){var o=a.alternate!==null&&a.alternate.child===a.child,d=0,m=0;if(o)for(var b=a.child;b!==null;)d|=b.lanes|b.childLanes,m|=b.subtreeFlags&65011712,m|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)d|=b.lanes|b.childLanes,m|=b.subtreeFlags,m|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=m,a.childLanes=d,o}function v6(a,o,d){var m=o.pendingProps;switch(my(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(o),null;case 1:return Pt(o),null;case 3:return d=o.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),o.memoizedState.cache!==m&&(o.flags|=2048),ha(un),Q(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(a===null||a.child===null)&&(Ml(o)?va(o):a===null||a.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,vy())),Pt(o),null;case 26:var b=o.type,j=o.memoizedState;return a===null?(va(o),j!==null?(Pt(o),RO(o,j)):(Pt(o),o0(o,b,null,m,d))):j?j!==a.memoizedState?(va(o),Pt(o),RO(o,j)):(Pt(o),o.flags&=-16777217):(a=a.memoizedProps,a!==m&&va(o),Pt(o),o0(o,b,a,m,d)),null;case 27:if(je(o),d=oe.current,b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==m&&va(o);else{if(!m){if(o.stateNode===null)throw Error(r(166));return Pt(o),null}a=Y.current,Ml(o)?pC(o):(a=q_(b,m,d),o.stateNode=a,va(o))}return Pt(o),null;case 5:if(je(o),b=o.type,a!==null&&o.stateNode!=null)a.memoizedProps!==m&&va(o);else{if(!m){if(o.stateNode===null)throw Error(r(166));return Pt(o),null}if(j=Y.current,Ml(o))pC(o);else{var k=Uh(oe.current);switch(j){case 1:j=k.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:j=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":j=k.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":j=k.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":j=k.createElement("div"),j.innerHTML="<script><\/script>",j=j.removeChild(j.firstChild);break;case"select":j=typeof m.is=="string"?k.createElement("select",{is:m.is}):k.createElement("select"),m.multiple?j.multiple=!0:m.size&&(j.size=m.size);break;default:j=typeof m.is=="string"?k.createElement(b,{is:m.is}):k.createElement(b)}}j[Dt]=o,j[Qt]=m;e:for(k=o.child;k!==null;){if(k.tag===5||k.tag===6)j.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===o)break e;for(;k.sibling===null;){if(k.return===null||k.return===o)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}o.stateNode=j;e:switch(Mn(j,b,m),b){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&va(o)}}return Pt(o),o0(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,d),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==m&&va(o);else{if(typeof m!="string"&&o.stateNode===null)throw Error(r(166));if(a=oe.current,Ml(o)){if(a=o.stateNode,d=o.memoizedProps,m=null,b=Tn,b!==null)switch(b.tag){case 27:case 5:m=b.memoizedProps}a[Dt]=o,a=!!(a.nodeValue===d||m!==null&&m.suppressHydrationWarning===!0||T_(a.nodeValue,d)),a||Ja(o,!0)}else a=Uh(a).createTextNode(m),a[Dt]=o,o.stateNode=a}return Pt(o),null;case 31:if(d=o.memoizedState,a===null||a.memoizedState!==null){if(m=Ml(o),d!==null){if(a===null){if(!m)throw Error(r(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[Dt]=o}else oo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Pt(o),a=!1}else d=vy(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=d),a=!0;if(!a)return o.flags&256?(Or(o),o):(Or(o),null);if((o.flags&128)!==0)throw Error(r(558))}return Pt(o),null;case 13:if(m=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=Ml(o),m!==null&&m.dehydrated!==null){if(a===null){if(!b)throw Error(r(318));if(b=o.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[Dt]=o}else oo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Pt(o),b=!1}else b=vy(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return o.flags&256?(Or(o),o):(Or(o),null)}return Or(o),(o.flags&128)!==0?(o.lanes=d,o):(d=m!==null,a=a!==null&&a.memoizedState!==null,d&&(m=o.child,b=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(b=m.alternate.memoizedState.cachePool.pool),j=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(j=m.memoizedState.cachePool.pool),j!==b&&(m.flags|=2048)),d!==a&&d&&(o.child.flags|=8192),Ch(o,o.updateQueue),Pt(o),null);case 4:return Q(),a===null&&A0(o.stateNode.containerInfo),Pt(o),null;case 10:return ha(o.type),Pt(o),null;case 19:if(G(rn),m=o.memoizedState,m===null)return Pt(o),null;if(b=(o.flags&128)!==0,j=m.rendering,j===null)if(b)Lu(m,!1);else{if(Jt!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(j=fh(a),j!==null){for(o.flags|=128,Lu(m,!1),a=j.updateQueue,o.updateQueue=a,Ch(o,a),o.subtreeFlags=0,a=d,d=o.child;d!==null;)cC(d,a),d=d.sibling;return ae(rn,rn.current&1|2),ct&&da(o,m.treeForkCount),o.child}a=a.sibling}m.tail!==null&&nt()>Eh&&(o.flags|=128,b=!0,Lu(m,!1),o.lanes=4194304)}else{if(!b)if(a=fh(j),a!==null){if(o.flags|=128,b=!0,a=a.updateQueue,o.updateQueue=a,Ch(o,a),Lu(m,!0),m.tail===null&&m.tailMode==="hidden"&&!j.alternate&&!ct)return Pt(o),null}else 2*nt()-m.renderingStartTime>Eh&&d!==536870912&&(o.flags|=128,b=!0,Lu(m,!1),o.lanes=4194304);m.isBackwards?(j.sibling=o.child,o.child=j):(a=m.last,a!==null?a.sibling=j:o.child=j,m.last=j)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=nt(),a.sibling=null,d=rn.current,ae(rn,b?d&1|2:d&1),ct&&da(o,m.treeForkCount),a):(Pt(o),null);case 22:case 23:return Or(o),Ey(),m=o.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(o.flags|=8192):m&&(o.flags|=8192),m?(d&536870912)!==0&&(o.flags&128)===0&&(Pt(o),o.subtreeFlags&6&&(o.flags|=8192)):Pt(o),d=o.updateQueue,d!==null&&Ch(o,d.retryQueue),d=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),m=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),m!==d&&(o.flags|=2048),a!==null&&G(uo),null;case 24:return d=null,a!==null&&(d=a.memoizedState.cache),o.memoizedState.cache!==d&&(o.flags|=2048),ha(un),Pt(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function y6(a,o){switch(my(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return ha(un),Q(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return je(o),null;case 31:if(o.memoizedState!==null){if(Or(o),o.alternate===null)throw Error(r(340));oo()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(Or(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(r(340));oo()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return G(rn),null;case 4:return Q(),null;case 10:return ha(o.type),null;case 22:case 23:return Or(o),Ey(),a!==null&&G(uo),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return ha(un),null;case 25:return null;default:return null}}function DO(a,o){switch(my(o),o.tag){case 3:ha(un),Q();break;case 26:case 27:case 5:je(o);break;case 4:Q();break;case 31:o.memoizedState!==null&&Or(o);break;case 13:Or(o);break;case 19:G(rn);break;case 10:ha(o.type);break;case 22:case 23:Or(o),Ey(),a!==null&&G(uo);break;case 24:ha(un)}}function $u(a,o){try{var d=o.updateQueue,m=d!==null?d.lastEffect:null;if(m!==null){var b=m.next;d=b;do{if((d.tag&a)===a){m=void 0;var j=d.create,k=d.inst;m=j(),k.destroy=m}d=d.next}while(d!==b)}}catch(M){yt(o,o.return,M)}}function ss(a,o,d){try{var m=o.updateQueue,b=m!==null?m.lastEffect:null;if(b!==null){var j=b.next;m=j;do{if((m.tag&a)===a){var k=m.inst,M=k.destroy;if(M!==void 0){k.destroy=void 0,b=o;var U=d,J=M;try{J()}catch(se){yt(b,U,se)}}}m=m.next}while(m!==j)}}catch(se){yt(o,o.return,se)}}function IO(a){var o=a.updateQueue;if(o!==null){var d=a.stateNode;try{_C(o,d)}catch(m){yt(a,a.return,m)}}}function LO(a,o,d){d.props=go(a.type,a.memoizedProps),d.state=a.memoizedState;try{d.componentWillUnmount()}catch(m){yt(a,o,m)}}function Uu(a,o){try{var d=a.ref;if(d!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof d=="function"?a.refCleanup=d(m):d.current=m}}catch(b){yt(a,o,b)}}function $i(a,o){var d=a.ref,m=a.refCleanup;if(d!==null)if(typeof m=="function")try{m()}catch(b){yt(a,o,b)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(b){yt(a,o,b)}else d.current=null}function $O(a){var o=a.type,d=a.memoizedProps,m=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":d.autoFocus&&m.focus();break e;case"img":d.src?m.src=d.src:d.srcSet&&(m.srcset=d.srcSet)}}catch(b){yt(a,a.return,b)}}function l0(a,o,d){try{var m=a.stateNode;U6(m,a.type,d,o),m[Qt]=o}catch(b){yt(a,a.return,b)}}function UO(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&hs(a.type)||a.tag===4}function c0(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||UO(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&hs(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function u0(a,o,d){var m=a.tag;if(m===5||m===6)a=a.stateNode,o?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(a,o):(o=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,o.appendChild(a),d=d._reactRootContainer,d!=null||o.onclick!==null||(o.onclick=la));else if(m!==4&&(m===27&&hs(a.type)&&(d=a.stateNode,o=null),a=a.child,a!==null))for(u0(a,o,d),a=a.sibling;a!==null;)u0(a,o,d),a=a.sibling}function Oh(a,o,d){var m=a.tag;if(m===5||m===6)a=a.stateNode,o?d.insertBefore(a,o):d.appendChild(a);else if(m!==4&&(m===27&&hs(a.type)&&(d=a.stateNode),a=a.child,a!==null))for(Oh(a,o,d),a=a.sibling;a!==null;)Oh(a,o,d),a=a.sibling}function BO(a){var o=a.stateNode,d=a.memoizedProps;try{for(var m=a.type,b=o.attributes;b.length;)o.removeAttributeNode(b[0]);Mn(o,m,d),o[Dt]=a,o[Qt]=d}catch(j){yt(a,a.return,j)}}var ya=!1,hn=!1,d0=!1,qO=typeof WeakSet=="function"?WeakSet:Set,Nn=null;function b6(a,o){if(a=a.containerInfo,P0=Vh,a=eC(a),iy(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var m=d.getSelection&&d.getSelection();if(m&&m.rangeCount!==0){d=m.anchorNode;var b=m.anchorOffset,j=m.focusNode;m=m.focusOffset;try{d.nodeType,j.nodeType}catch{d=null;break e}var k=0,M=-1,U=-1,J=0,se=0,de=a,ee=null;t:for(;;){for(var re;de!==d||b!==0&&de.nodeType!==3||(M=k+b),de!==j||m!==0&&de.nodeType!==3||(U=k+m),de.nodeType===3&&(k+=de.nodeValue.length),(re=de.firstChild)!==null;)ee=de,de=re;for(;;){if(de===a)break t;if(ee===d&&++J===b&&(M=k),ee===j&&++se===m&&(U=k),(re=de.nextSibling)!==null)break;de=ee,ee=de.parentNode}de=re}d=M===-1||U===-1?null:{start:M,end:U}}else d=null}d=d||{start:0,end:0}}else d=null;for(z0={focusedElem:a,selectionRange:d},Vh=!1,Nn=o;Nn!==null;)if(o=Nn,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,Nn=a;else for(;Nn!==null;){switch(o=Nn,j=o.alternate,a=o.flags,o.tag){case 0:if((a&4)!==0&&(a=o.updateQueue,a=a!==null?a.events:null,a!==null))for(d=0;d<a.length;d++)b=a[d],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&j!==null){a=void 0,d=o,b=j.memoizedProps,j=j.memoizedState,m=d.stateNode;try{var Ae=go(d.type,b);a=m.getSnapshotBeforeUpdate(Ae,j),m.__reactInternalSnapshotBeforeUpdate=a}catch(Ue){yt(d,d.return,Ue)}}break;case 3:if((a&1024)!==0){if(a=o.stateNode.containerInfo,d=a.nodeType,d===9)D0(a);else if(d===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":D0(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=o.sibling,a!==null){a.return=o.return,Nn=a;break}Nn=o.return}}function FO(a,o,d){var m=d.flags;switch(d.tag){case 0:case 11:case 15:xa(a,d),m&4&&$u(5,d);break;case 1:if(xa(a,d),m&4)if(a=d.stateNode,o===null)try{a.componentDidMount()}catch(k){yt(d,d.return,k)}else{var b=go(d.type,o.memoizedProps);o=o.memoizedState;try{a.componentDidUpdate(b,o,a.__reactInternalSnapshotBeforeUpdate)}catch(k){yt(d,d.return,k)}}m&64&&IO(d),m&512&&Uu(d,d.return);break;case 3:if(xa(a,d),m&64&&(a=d.updateQueue,a!==null)){if(o=null,d.child!==null)switch(d.child.tag){case 27:case 5:o=d.child.stateNode;break;case 1:o=d.child.stateNode}try{_C(a,o)}catch(k){yt(d,d.return,k)}}break;case 27:o===null&&m&4&&BO(d);case 26:case 5:xa(a,d),o===null&&m&4&&$O(d),m&512&&Uu(d,d.return);break;case 12:xa(a,d);break;case 31:xa(a,d),m&4&&GO(a,d);break;case 13:xa(a,d),m&4&&VO(a,d),m&64&&(a=d.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(d=k6.bind(null,d),Z6(a,d))));break;case 22:if(m=d.memoizedState!==null||ya,!m){o=o!==null&&o.memoizedState!==null||hn,b=ya;var j=hn;ya=m,(hn=o)&&!j?wa(a,d,(d.subtreeFlags&8772)!==0):xa(a,d),ya=b,hn=j}break;case 30:break;default:xa(a,d)}}function KO(a){var o=a.alternate;o!==null&&(a.alternate=null,KO(o)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(o=a.stateNode,o!==null&&wl(o)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var It=null,dr=!1;function ba(a,o,d){for(d=d.child;d!==null;)HO(a,o,d),d=d.sibling}function HO(a,o,d){if(qe&&typeof qe.onCommitFiberUnmount=="function")try{qe.onCommitFiberUnmount(En,d)}catch{}switch(d.tag){case 26:hn||$i(d,o),ba(a,o,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:hn||$i(d,o);var m=It,b=dr;hs(d.type)&&(It=d.stateNode,dr=!1),ba(a,o,d),Yu(d.stateNode),It=m,dr=b;break;case 5:hn||$i(d,o);case 6:if(m=It,b=dr,It=null,ba(a,o,d),It=m,dr=b,It!==null)if(dr)try{(It.nodeType===9?It.body:It.nodeName==="HTML"?It.ownerDocument.body:It).removeChild(d.stateNode)}catch(j){yt(d,o,j)}else try{It.removeChild(d.stateNode)}catch(j){yt(d,o,j)}break;case 18:It!==null&&(dr?(a=It,I_(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,d.stateNode),tc(a)):I_(It,d.stateNode));break;case 4:m=It,b=dr,It=d.stateNode.containerInfo,dr=!0,ba(a,o,d),It=m,dr=b;break;case 0:case 11:case 14:case 15:ss(2,d,o),hn||ss(4,d,o),ba(a,o,d);break;case 1:hn||($i(d,o),m=d.stateNode,typeof m.componentWillUnmount=="function"&&LO(d,o,m)),ba(a,o,d);break;case 21:ba(a,o,d);break;case 22:hn=(m=hn)||d.memoizedState!==null,ba(a,o,d),hn=m;break;default:ba(a,o,d)}}function GO(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{tc(a)}catch(d){yt(o,o.return,d)}}}function VO(a,o){if(o.memoizedState===null&&(a=o.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{tc(a)}catch(d){yt(o,o.return,d)}}function x6(a){switch(a.tag){case 31:case 13:case 19:var o=a.stateNode;return o===null&&(o=a.stateNode=new qO),o;case 22:return a=a.stateNode,o=a._retryCache,o===null&&(o=a._retryCache=new qO),o;default:throw Error(r(435,a.tag))}}function _h(a,o){var d=x6(a);o.forEach(function(m){if(!d.has(m)){d.add(m);var b=A6.bind(null,a,m);m.then(b,b)}})}function fr(a,o){var d=o.deletions;if(d!==null)for(var m=0;m<d.length;m++){var b=d[m],j=a,k=o,M=k;e:for(;M!==null;){switch(M.tag){case 27:if(hs(M.type)){It=M.stateNode,dr=!1;break e}break;case 5:It=M.stateNode,dr=!1;break e;case 3:case 4:It=M.stateNode.containerInfo,dr=!0;break e}M=M.return}if(It===null)throw Error(r(160));HO(j,k,b),It=null,dr=!1,j=b.alternate,j!==null&&(j.return=null),b.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)ZO(o,a),o=o.sibling}var gi=null;function ZO(a,o){var d=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:fr(o,a),hr(a),m&4&&(ss(3,a,a.return),$u(3,a),ss(5,a,a.return));break;case 1:fr(o,a),hr(a),m&512&&(hn||d===null||$i(d,d.return)),m&64&&ya&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(d=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=d===null?m:d.concat(m))));break;case 26:var b=gi;if(fr(o,a),hr(a),m&512&&(hn||d===null||$i(d,d.return)),m&4){var j=d!==null?d.memoizedState:null;if(m=a.memoizedState,d===null)if(m===null)if(a.stateNode===null){e:{m=a.type,d=a.memoizedProps,b=b.ownerDocument||b;t:switch(m){case"title":j=b.getElementsByTagName("title")[0],(!j||j[Ri]||j[Dt]||j.namespaceURI==="http://www.w3.org/2000/svg"||j.hasAttribute("itemprop"))&&(j=b.createElement(m),b.head.insertBefore(j,b.querySelector("head > title"))),Mn(j,m,d),j[Dt]=a,cn(j),m=j;break e;case"link":var k=Z_("link","href",b).get(m+(d.href||""));if(k){for(var M=0;M<k.length;M++)if(j=k[M],j.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&j.getAttribute("rel")===(d.rel==null?null:d.rel)&&j.getAttribute("title")===(d.title==null?null:d.title)&&j.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){k.splice(M,1);break t}}j=b.createElement(m),Mn(j,m,d),b.head.appendChild(j);break;case"meta":if(k=Z_("meta","content",b).get(m+(d.content||""))){for(M=0;M<k.length;M++)if(j=k[M],j.getAttribute("content")===(d.content==null?null:""+d.content)&&j.getAttribute("name")===(d.name==null?null:d.name)&&j.getAttribute("property")===(d.property==null?null:d.property)&&j.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&j.getAttribute("charset")===(d.charSet==null?null:d.charSet)){k.splice(M,1);break t}}j=b.createElement(m),Mn(j,m,d),b.head.appendChild(j);break;default:throw Error(r(468,m))}j[Dt]=a,cn(j),m=j}a.stateNode=m}else Y_(b,a.type,a.stateNode);else a.stateNode=V_(b,m,a.memoizedProps);else j!==m?(j===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):j.count--,m===null?Y_(b,a.type,a.stateNode):V_(b,m,a.memoizedProps)):m===null&&a.stateNode!==null&&l0(a,a.memoizedProps,d.memoizedProps)}break;case 27:fr(o,a),hr(a),m&512&&(hn||d===null||$i(d,d.return)),d!==null&&m&4&&l0(a,a.memoizedProps,d.memoizedProps);break;case 5:if(fr(o,a),hr(a),m&512&&(hn||d===null||$i(d,d.return)),a.flags&32){b=a.stateNode;try{Nl(b,"")}catch(Ae){yt(a,a.return,Ae)}}m&4&&a.stateNode!=null&&(b=a.memoizedProps,l0(a,b,d!==null?d.memoizedProps:b)),m&1024&&(d0=!0);break;case 6:if(fr(o,a),hr(a),m&4){if(a.stateNode===null)throw Error(r(162));m=a.memoizedProps,d=a.stateNode;try{d.nodeValue=m}catch(Ae){yt(a,a.return,Ae)}}break;case 3:if(Fh=null,b=gi,gi=Bh(o.containerInfo),fr(o,a),gi=b,hr(a),m&4&&d!==null&&d.memoizedState.isDehydrated)try{tc(o.containerInfo)}catch(Ae){yt(a,a.return,Ae)}d0&&(d0=!1,YO(a));break;case 4:m=gi,gi=Bh(a.stateNode.containerInfo),fr(o,a),hr(a),gi=m;break;case 12:fr(o,a),hr(a);break;case 31:fr(o,a),hr(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,_h(a,m)));break;case 13:fr(o,a),hr(a),a.child.flags&8192&&a.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Ah=nt()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,_h(a,m)));break;case 22:b=a.memoizedState!==null;var U=d!==null&&d.memoizedState!==null,J=ya,se=hn;if(ya=J||b,hn=se||U,fr(o,a),hn=se,ya=J,hr(a),m&8192)e:for(o=a.stateNode,o._visibility=b?o._visibility&-2:o._visibility|1,b&&(d===null||U||ya||hn||vo(a)),d=null,o=a;;){if(o.tag===5||o.tag===26){if(d===null){U=d=o;try{if(j=U.stateNode,b)k=j.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{M=U.stateNode;var de=U.memoizedProps.style,ee=de!=null&&de.hasOwnProperty("display")?de.display:null;M.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(Ae){yt(U,U.return,Ae)}}}else if(o.tag===6){if(d===null){U=o;try{U.stateNode.nodeValue=b?"":U.memoizedProps}catch(Ae){yt(U,U.return,Ae)}}}else if(o.tag===18){if(d===null){U=o;try{var re=U.stateNode;b?L_(re,!0):L_(U.stateNode,!1)}catch(Ae){yt(U,U.return,Ae)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===a)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;d===o&&(d=null),o=o.return}d===o&&(d=null),o.sibling.return=o.return,o=o.sibling}m&4&&(m=a.updateQueue,m!==null&&(d=m.retryQueue,d!==null&&(m.retryQueue=null,_h(a,d))));break;case 19:fr(o,a),hr(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,_h(a,m)));break;case 30:break;case 21:break;default:fr(o,a),hr(a)}}function hr(a){var o=a.flags;if(o&2){try{for(var d,m=a.return;m!==null;){if(UO(m)){d=m;break}m=m.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var b=d.stateNode,j=c0(a);Oh(a,j,b);break;case 5:var k=d.stateNode;d.flags&32&&(Nl(k,""),d.flags&=-33);var M=c0(a);Oh(a,M,k);break;case 3:case 4:var U=d.stateNode.containerInfo,J=c0(a);u0(a,J,U);break;default:throw Error(r(161))}}catch(se){yt(a,a.return,se)}a.flags&=-3}o&4096&&(a.flags&=-4097)}function YO(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var o=a;YO(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),a=a.sibling}}function xa(a,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)FO(a,o.alternate,o),o=o.sibling}function vo(a){for(a=a.child;a!==null;){var o=a;switch(o.tag){case 0:case 11:case 14:case 15:ss(4,o,o.return),vo(o);break;case 1:$i(o,o.return);var d=o.stateNode;typeof d.componentWillUnmount=="function"&&LO(o,o.return,d),vo(o);break;case 27:Yu(o.stateNode);case 26:case 5:$i(o,o.return),vo(o);break;case 22:o.memoizedState===null&&vo(o);break;case 30:vo(o);break;default:vo(o)}a=a.sibling}}function wa(a,o,d){for(d=d&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var m=o.alternate,b=a,j=o,k=j.flags;switch(j.tag){case 0:case 11:case 15:wa(b,j,d),$u(4,j);break;case 1:if(wa(b,j,d),m=j,b=m.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(J){yt(m,m.return,J)}if(m=j,b=m.updateQueue,b!==null){var M=m.stateNode;try{var U=b.shared.hiddenCallbacks;if(U!==null)for(b.shared.hiddenCallbacks=null,b=0;b<U.length;b++)OC(U[b],M)}catch(J){yt(m,m.return,J)}}d&&k&64&&IO(j),Uu(j,j.return);break;case 27:BO(j);case 26:case 5:wa(b,j,d),d&&m===null&&k&4&&$O(j),Uu(j,j.return);break;case 12:wa(b,j,d);break;case 31:wa(b,j,d),d&&k&4&&GO(b,j);break;case 13:wa(b,j,d),d&&k&4&&VO(b,j);break;case 22:j.memoizedState===null&&wa(b,j,d),Uu(j,j.return);break;case 30:break;default:wa(b,j,d)}o=o.sibling}}function f0(a,o){var d=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),a=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(a=o.memoizedState.cachePool.pool),a!==d&&(a!=null&&a.refCount++,d!=null&&Ou(d))}function h0(a,o){a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Ou(a))}function vi(a,o,d,m){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)WO(a,o,d,m),o=o.sibling}function WO(a,o,d,m){var b=o.flags;switch(o.tag){case 0:case 11:case 15:vi(a,o,d,m),b&2048&&$u(9,o);break;case 1:vi(a,o,d,m);break;case 3:vi(a,o,d,m),b&2048&&(a=null,o.alternate!==null&&(a=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==a&&(o.refCount++,a!=null&&Ou(a)));break;case 12:if(b&2048){vi(a,o,d,m),a=o.stateNode;try{var j=o.memoizedProps,k=j.id,M=j.onPostCommit;typeof M=="function"&&M(k,o.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(U){yt(o,o.return,U)}}else vi(a,o,d,m);break;case 31:vi(a,o,d,m);break;case 13:vi(a,o,d,m);break;case 23:break;case 22:j=o.stateNode,k=o.alternate,o.memoizedState!==null?j._visibility&2?vi(a,o,d,m):Bu(a,o):j._visibility&2?vi(a,o,d,m):(j._visibility|=2,Kl(a,o,d,m,(o.subtreeFlags&10256)!==0||!1)),b&2048&&f0(k,o);break;case 24:vi(a,o,d,m),b&2048&&h0(o.alternate,o);break;default:vi(a,o,d,m)}}function Kl(a,o,d,m,b){for(b=b&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var j=a,k=o,M=d,U=m,J=k.flags;switch(k.tag){case 0:case 11:case 15:Kl(j,k,M,U,b),$u(8,k);break;case 23:break;case 22:var se=k.stateNode;k.memoizedState!==null?se._visibility&2?Kl(j,k,M,U,b):Bu(j,k):(se._visibility|=2,Kl(j,k,M,U,b)),b&&J&2048&&f0(k.alternate,k);break;case 24:Kl(j,k,M,U,b),b&&J&2048&&h0(k.alternate,k);break;default:Kl(j,k,M,U,b)}o=o.sibling}}function Bu(a,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var d=a,m=o,b=m.flags;switch(m.tag){case 22:Bu(d,m),b&2048&&f0(m.alternate,m);break;case 24:Bu(d,m),b&2048&&h0(m.alternate,m);break;default:Bu(d,m)}o=o.sibling}}var qu=8192;function Hl(a,o,d){if(a.subtreeFlags&qu)for(a=a.child;a!==null;)QO(a,o,d),a=a.sibling}function QO(a,o,d){switch(a.tag){case 26:Hl(a,o,d),a.flags&qu&&a.memoizedState!==null&&sB(d,gi,a.memoizedState,a.memoizedProps);break;case 5:Hl(a,o,d);break;case 3:case 4:var m=gi;gi=Bh(a.stateNode.containerInfo),Hl(a,o,d),gi=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=qu,qu=16777216,Hl(a,o,d),qu=m):Hl(a,o,d));break;default:Hl(a,o,d)}}function XO(a){var o=a.alternate;if(o!==null&&(a=o.child,a!==null)){o.child=null;do o=a.sibling,a.sibling=null,a=o;while(a!==null)}}function Fu(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var m=o[d];Nn=m,e_(m,a)}XO(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)JO(a),a=a.sibling}function JO(a){switch(a.tag){case 0:case 11:case 15:Fu(a),a.flags&2048&&ss(9,a,a.return);break;case 3:Fu(a);break;case 12:Fu(a);break;case 22:var o=a.stateNode;a.memoizedState!==null&&o._visibility&2&&(a.return===null||a.return.tag!==13)?(o._visibility&=-3,kh(a)):Fu(a);break;default:Fu(a)}}function kh(a){var o=a.deletions;if((a.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var m=o[d];Nn=m,e_(m,a)}XO(a)}for(a=a.child;a!==null;){switch(o=a,o.tag){case 0:case 11:case 15:ss(8,o,o.return),kh(o);break;case 22:d=o.stateNode,d._visibility&2&&(d._visibility&=-3,kh(o));break;default:kh(o)}a=a.sibling}}function e_(a,o){for(;Nn!==null;){var d=Nn;switch(d.tag){case 0:case 11:case 15:ss(8,d,o);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var m=d.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Ou(d.memoizedState.cache)}if(m=d.child,m!==null)m.return=d,Nn=m;else e:for(d=a;Nn!==null;){m=Nn;var b=m.sibling,j=m.return;if(KO(m),m===d){Nn=null;break e}if(b!==null){b.return=j,Nn=b;break e}Nn=j}}}var w6={getCacheForType:function(a){var o=Pn(un),d=o.data.get(a);return d===void 0&&(d=a(),o.data.set(a,d)),d},cacheSignal:function(){return Pn(un).controller.signal}},S6=typeof WeakMap=="function"?WeakMap:Map,mt=0,Ot=null,rt=null,ot=0,vt=0,_r=null,os=!1,Gl=!1,p0=!1,Sa=0,Jt=0,ls=0,yo=0,m0=0,kr=0,Vl=0,Ku=null,pr=null,g0=!1,Ah=0,t_=0,Eh=1/0,Th=null,cs=null,vn=0,us=null,Zl=null,ja=0,v0=0,y0=null,n_=null,Hu=0,b0=null;function Ar(){return(mt&2)!==0&&ot!==0?ot&-ot:H.T!==null?C0():wt()}function r_(){if(kr===0)if((ot&536870912)===0||ct){var a=sa;sa<<=1,(sa&3932160)===0&&(sa=262144),kr=a}else kr=536870912;return a=Cr.current,a!==null&&(a.flags|=32),kr}function mr(a,o,d){(a===Ot&&(vt===2||vt===9)||a.cancelPendingCommit!==null)&&(Yl(a,0),ds(a,ot,kr,!1)),to(a,d),((mt&2)===0||a!==Ot)&&(a===Ot&&((mt&2)===0&&(yo|=d),Jt===4&&ds(a,ot,kr,!1)),Ui(a))}function i_(a,o,d){if((mt&6)!==0)throw Error(r(327));var m=!d&&(o&127)===0&&(o&a.expiredLanes)===0||Mi(a,o),b=m?C6(a,o):w0(a,o,!0),j=m;do{if(b===0){Gl&&!m&&ds(a,o,0,!1);break}else{if(d=a.current.alternate,j&&!j6(d)){b=w0(a,o,!1),j=!1;continue}if(b===2){if(j=o,a.errorRecoveryDisabledLanes&j)var k=0;else k=a.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){o=k;e:{var M=a;b=Ku;var U=M.current.memoizedState.isDehydrated;if(U&&(Yl(M,k).flags|=256),k=w0(M,k,!1),k!==2){if(p0&&!U){M.errorRecoveryDisabledLanes|=j,yo|=j,b=4;break e}j=pr,pr=b,j!==null&&(pr===null?pr=j:pr.push.apply(pr,j))}b=k}if(j=!1,b!==2)continue}}if(b===1){Yl(a,0),ds(a,o,0,!0);break}e:{switch(m=a,j=b,j){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:ds(m,o,kr,!os);break e;case 2:pr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(b=Ah+300-nt(),10<b)){if(ds(m,o,kr,!os),bl(m,0,!0)!==0)break e;ja=o,m.timeoutHandle=R_(a_.bind(null,m,d,pr,Th,g0,o,kr,yo,Vl,os,j,"Throttled",-0,0),b);break e}a_(m,d,pr,Th,g0,o,kr,yo,Vl,os,j,null,-0,0)}}break}while(!0);Ui(a)}function a_(a,o,d,m,b,j,k,M,U,J,se,de,ee,re){if(a.timeoutHandle=-1,de=o.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:la},QO(o,j,de);var Ae=(j&62914560)===j?Ah-nt():(j&4194048)===j?t_-nt():0;if(Ae=oB(de,Ae),Ae!==null){ja=j,a.cancelPendingCommit=Ae(h_.bind(null,a,o,j,d,m,b,k,M,U,se,de,null,ee,re)),ds(a,j,k,!J);return}}h_(a,o,j,d,m,b,k,M,U)}function j6(a){for(var o=a;;){var d=o.tag;if((d===0||d===11||d===15)&&o.flags&16384&&(d=o.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var m=0;m<d.length;m++){var b=d[m],j=b.getSnapshot;b=b.value;try{if(!jr(j(),b))return!1}catch{return!1}}if(d=o.child,o.subtreeFlags&16384&&d!==null)d.return=o,o=d;else{if(o===a)break;for(;o.sibling===null;){if(o.return===null||o.return===a)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function ds(a,o,d,m){o&=~m0,o&=~yo,a.suspendedLanes|=o,a.pingedLanes&=~o,m&&(a.warmLanes|=o),m=a.expirationTimes;for(var b=o;0<b;){var j=31-ye(b),k=1<<j;m[j]=-1,b&=~k}d!==0&&Uf(a,d,o)}function Ph(){return(mt&6)===0?(Gu(0),!1):!0}function x0(){if(rt!==null){if(vt===0)var a=rt.return;else a=rt,fa=lo=null,Dy(a),$l=null,ku=0,a=rt;for(;a!==null;)DO(a.alternate,a),a=a.return;rt=null}}function Yl(a,o){var d=a.timeoutHandle;d!==-1&&(a.timeoutHandle=-1,F6(d)),d=a.cancelPendingCommit,d!==null&&(a.cancelPendingCommit=null,d()),ja=0,x0(),Ot=a,rt=d=ua(a.current,null),ot=o,vt=0,_r=null,os=!1,Gl=Mi(a,o),p0=!1,Vl=kr=m0=yo=ls=Jt=0,pr=Ku=null,g0=!1,(o&8)!==0&&(o|=o&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=o;0<m;){var b=31-ye(m),j=1<<b;o|=a[b],m&=~j}return Sa=o,Jf(),d}function s_(a,o){Ye=null,H.H=Du,o===Ll||o===oh?(o=SC(),vt=3):o===Ny?(o=SC(),vt=4):vt=o===Xy?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,_r=o,rt===null&&(Jt=1,wh(a,$r(o,a.current)))}function o_(){var a=Cr.current;return a===null?!0:(ot&4194048)===ot?Fr===null:(ot&62914560)===ot||(ot&536870912)!==0?a===Fr:!1}function l_(){var a=H.H;return H.H=Du,a===null?Du:a}function c_(){var a=H.A;return H.A=w6,a}function zh(){Jt=4,os||(ot&4194048)!==ot&&Cr.current!==null||(Gl=!0),(ls&134217727)===0&&(yo&134217727)===0||Ot===null||ds(Ot,ot,kr,!1)}function w0(a,o,d){var m=mt;mt|=2;var b=l_(),j=c_();(Ot!==a||ot!==o)&&(Th=null,Yl(a,o)),o=!1;var k=Jt;e:do try{if(vt!==0&&rt!==null){var M=rt,U=_r;switch(vt){case 8:x0(),k=6;break e;case 3:case 2:case 9:case 6:Cr.current===null&&(o=!0);var J=vt;if(vt=0,_r=null,Wl(a,M,U,J),d&&Gl){k=0;break e}break;default:J=vt,vt=0,_r=null,Wl(a,M,U,J)}}N6(),k=Jt;break}catch(se){s_(a,se)}while(!0);return o&&a.shellSuspendCounter++,fa=lo=null,mt=m,H.H=b,H.A=j,rt===null&&(Ot=null,ot=0,Jf()),k}function N6(){for(;rt!==null;)u_(rt)}function C6(a,o){var d=mt;mt|=2;var m=l_(),b=c_();Ot!==a||ot!==o?(Th=null,Eh=nt()+500,Yl(a,o)):Gl=Mi(a,o);e:do try{if(vt!==0&&rt!==null){o=rt;var j=_r;t:switch(vt){case 1:vt=0,_r=null,Wl(a,o,j,1);break;case 2:case 9:if(xC(j)){vt=0,_r=null,d_(o);break}o=function(){vt!==2&&vt!==9||Ot!==a||(vt=7),Ui(a)},j.then(o,o);break e;case 3:vt=7;break e;case 4:vt=5;break e;case 7:xC(j)?(vt=0,_r=null,d_(o)):(vt=0,_r=null,Wl(a,o,j,7));break;case 5:var k=null;switch(rt.tag){case 26:k=rt.memoizedState;case 5:case 27:var M=rt;if(k?W_(k):M.stateNode.complete){vt=0,_r=null;var U=M.sibling;if(U!==null)rt=U;else{var J=M.return;J!==null?(rt=J,Mh(J)):rt=null}break t}}vt=0,_r=null,Wl(a,o,j,5);break;case 6:vt=0,_r=null,Wl(a,o,j,6);break;case 8:x0(),Jt=6;break e;default:throw Error(r(462))}}O6();break}catch(se){s_(a,se)}while(!0);return fa=lo=null,H.H=m,H.A=b,mt=d,rt!==null?0:(Ot=null,ot=0,Jf(),Jt)}function O6(){for(;rt!==null&&!Ke();)u_(rt)}function u_(a){var o=MO(a.alternate,a,Sa);a.memoizedProps=a.pendingProps,o===null?Mh(a):rt=o}function d_(a){var o=a,d=o.alternate;switch(o.tag){case 15:case 0:o=kO(d,o,o.pendingProps,o.type,void 0,ot);break;case 11:o=kO(d,o,o.pendingProps,o.type.render,o.ref,ot);break;case 5:Dy(o);default:DO(d,o),o=rt=cC(o,Sa),o=MO(d,o,Sa)}a.memoizedProps=a.pendingProps,o===null?Mh(a):rt=o}function Wl(a,o,d,m){fa=lo=null,Dy(o),$l=null,ku=0;var b=o.return;try{if(p6(a,b,o,d,ot)){Jt=1,wh(a,$r(d,a.current)),rt=null;return}}catch(j){if(b!==null)throw rt=b,j;Jt=1,wh(a,$r(d,a.current)),rt=null;return}o.flags&32768?(ct||m===1?a=!0:Gl||(ot&536870912)!==0?a=!1:(os=a=!0,(m===2||m===9||m===3||m===6)&&(m=Cr.current,m!==null&&m.tag===13&&(m.flags|=16384))),f_(o,a)):Mh(o)}function Mh(a){var o=a;do{if((o.flags&32768)!==0){f_(o,os);return}a=o.return;var d=v6(o.alternate,o,Sa);if(d!==null){rt=d;return}if(o=o.sibling,o!==null){rt=o;return}rt=o=a}while(o!==null);Jt===0&&(Jt=5)}function f_(a,o){do{var d=y6(a.alternate,a);if(d!==null){d.flags&=32767,rt=d;return}if(d=a.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!o&&(a=a.sibling,a!==null)){rt=a;return}rt=a=d}while(a!==null);Jt=6,rt=null}function h_(a,o,d,m,b,j,k,M,U){a.cancelPendingCommit=null;do Rh();while(vn!==0);if((mt&6)!==0)throw Error(r(327));if(o!==null){if(o===a.current)throw Error(r(177));if(j=o.lanes|o.childLanes,j|=cy,Uv(a,d,j,k,M,U),a===Ot&&(rt=Ot=null,ot=0),Zl=o,us=a,ja=d,v0=j,y0=b,n_=m,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,E6(cr,function(){return y_(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||m){m=H.T,H.T=null,b=ie.p,ie.p=2,k=mt,mt|=4;try{b6(a,o,d)}finally{mt=k,ie.p=b,H.T=m}}vn=1,p_(),m_(),g_()}}function p_(){if(vn===1){vn=0;var a=us,o=Zl,d=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||d){d=H.T,H.T=null;var m=ie.p;ie.p=2;var b=mt;mt|=4;try{ZO(o,a);var j=z0,k=eC(a.containerInfo),M=j.focusedElem,U=j.selectionRange;if(k!==M&&M&&M.ownerDocument&&JN(M.ownerDocument.documentElement,M)){if(U!==null&&iy(M)){var J=U.start,se=U.end;if(se===void 0&&(se=J),"selectionStart"in M)M.selectionStart=J,M.selectionEnd=Math.min(se,M.value.length);else{var de=M.ownerDocument||document,ee=de&&de.defaultView||window;if(ee.getSelection){var re=ee.getSelection(),Ae=M.textContent.length,Ue=Math.min(U.start,Ae),Ct=U.end===void 0?Ue:Math.min(U.end,Ae);!re.extend&&Ue>Ct&&(k=Ct,Ct=Ue,Ue=k);var Z=XN(M,Ue),K=XN(M,Ct);if(Z&&K&&(re.rangeCount!==1||re.anchorNode!==Z.node||re.anchorOffset!==Z.offset||re.focusNode!==K.node||re.focusOffset!==K.offset)){var X=de.createRange();X.setStart(Z.node,Z.offset),re.removeAllRanges(),Ue>Ct?(re.addRange(X),re.extend(K.node,K.offset)):(X.setEnd(K.node,K.offset),re.addRange(X))}}}}for(de=[],re=M;re=re.parentNode;)re.nodeType===1&&de.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<de.length;M++){var ce=de[M];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Vh=!!P0,z0=P0=null}finally{mt=b,ie.p=m,H.T=d}}a.current=o,vn=2}}function m_(){if(vn===2){vn=0;var a=us,o=Zl,d=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||d){d=H.T,H.T=null;var m=ie.p;ie.p=2;var b=mt;mt|=4;try{FO(a,o.alternate,o)}finally{mt=b,ie.p=m,H.T=d}}vn=3}}function g_(){if(vn===4||vn===3){vn=0,Ft();var a=us,o=Zl,d=ja,m=n_;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?vn=5:(vn=0,Zl=us=null,v_(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(cs=null),be(d),o=o.stateNode,qe&&typeof qe.onCommitFiberRoot=="function")try{qe.onCommitFiberRoot(En,o,void 0,(o.current.flags&128)===128)}catch{}if(m!==null){o=H.T,b=ie.p,ie.p=2,H.T=null;try{for(var j=a.onRecoverableError,k=0;k<m.length;k++){var M=m[k];j(M.value,{componentStack:M.stack})}}finally{H.T=o,ie.p=b}}(ja&3)!==0&&Rh(),Ui(a),b=a.pendingLanes,(d&261930)!==0&&(b&42)!==0?a===b0?Hu++:(Hu=0,b0=a):Hu=0,Gu(0)}}function v_(a,o){(a.pooledCacheLanes&=o)===0&&(o=a.pooledCache,o!=null&&(a.pooledCache=null,Ou(o)))}function Rh(){return p_(),m_(),g_(),y_()}function y_(){if(vn!==5)return!1;var a=us,o=v0;v0=0;var d=be(ja),m=H.T,b=ie.p;try{ie.p=32>d?32:d,H.T=null,d=y0,y0=null;var j=us,k=ja;if(vn=0,Zl=us=null,ja=0,(mt&6)!==0)throw Error(r(331));var M=mt;if(mt|=4,JO(j.current),WO(j,j.current,k,d),mt=M,Gu(0,!1),qe&&typeof qe.onPostCommitFiberRoot=="function")try{qe.onPostCommitFiberRoot(En,j)}catch{}return!0}finally{ie.p=b,H.T=m,v_(a,o)}}function b_(a,o,d){o=$r(d,o),o=Qy(a.stateNode,o,2),a=rs(a,o,2),a!==null&&(to(a,2),Ui(a))}function yt(a,o,d){if(a.tag===3)b_(a,a,d);else for(;o!==null;){if(o.tag===3){b_(o,a,d);break}else if(o.tag===1){var m=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(cs===null||!cs.has(m))){a=$r(d,a),d=xO(2),m=rs(o,d,2),m!==null&&(wO(d,m,o,a),to(m,2),Ui(m));break}}o=o.return}}function S0(a,o,d){var m=a.pingCache;if(m===null){m=a.pingCache=new S6;var b=new Set;m.set(o,b)}else b=m.get(o),b===void 0&&(b=new Set,m.set(o,b));b.has(d)||(p0=!0,b.add(d),a=_6.bind(null,a,o,d),o.then(a,a))}function _6(a,o,d){var m=a.pingCache;m!==null&&m.delete(o),a.pingedLanes|=a.suspendedLanes&d,a.warmLanes&=~d,Ot===a&&(ot&d)===d&&(Jt===4||Jt===3&&(ot&62914560)===ot&&300>nt()-Ah?(mt&2)===0&&Yl(a,0):m0|=d,Vl===ot&&(Vl=0)),Ui(a)}function x_(a,o){o===0&&(o=$f()),a=ao(a,o),a!==null&&(to(a,o),Ui(a))}function k6(a){var o=a.memoizedState,d=0;o!==null&&(d=o.retryLane),x_(a,d)}function A6(a,o){var d=0;switch(a.tag){case 31:case 13:var m=a.stateNode,b=a.memoizedState;b!==null&&(d=b.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(o),x_(a,d)}function E6(a,o){return fe(a,o)}var Dh=null,Ql=null,j0=!1,Ih=!1,N0=!1,fs=0;function Ui(a){a!==Ql&&a.next===null&&(Ql===null?Dh=Ql=a:Ql=Ql.next=a),Ih=!0,j0||(j0=!0,P6())}function Gu(a,o){if(!N0&&Ih){N0=!0;do for(var d=!1,m=Dh;m!==null;){if(a!==0){var b=m.pendingLanes;if(b===0)var j=0;else{var k=m.suspendedLanes,M=m.pingedLanes;j=(1<<31-ye(42|a)+1)-1,j&=b&~(k&~M),j=j&201326741?j&201326741|1:j?j|2:0}j!==0&&(d=!0,N_(m,j))}else j=ot,j=bl(m,m===Ot?j:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(j&3)===0||Mi(m,j)||(d=!0,N_(m,j));m=m.next}while(d);N0=!1}}function T6(){w_()}function w_(){Ih=j0=!1;var a=0;fs!==0&&q6()&&(a=fs);for(var o=nt(),d=null,m=Dh;m!==null;){var b=m.next,j=S_(m,o);j===0?(m.next=null,d===null?Dh=b:d.next=b,b===null&&(Ql=d)):(d=m,(a!==0||(j&3)!==0)&&(Ih=!0)),m=b}vn!==0&&vn!==5||Gu(a),fs!==0&&(fs=0)}function S_(a,o){for(var d=a.suspendedLanes,m=a.pingedLanes,b=a.expirationTimes,j=a.pendingLanes&-62914561;0<j;){var k=31-ye(j),M=1<<k,U=b[k];U===-1?((M&d)===0||(M&m)!==0)&&(b[k]=Lf(M,o)):U<=o&&(a.expiredLanes|=M),j&=~M}if(o=Ot,d=ot,d=bl(a,a===o?d:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,d===0||a===o&&(vt===2||vt===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&Ge(m),a.callbackNode=null,a.callbackPriority=0;if((d&3)===0||Mi(a,d)){if(o=d&-d,o===a.callbackPriority)return o;switch(m!==null&&Ge(m),be(d)){case 2:case 8:d=Rt;break;case 32:d=cr;break;case 268435456:d=Js;break;default:d=cr}return m=j_.bind(null,a),d=fe(d,m),a.callbackPriority=o,a.callbackNode=d,o}return m!==null&&m!==null&&Ge(m),a.callbackPriority=2,a.callbackNode=null,2}function j_(a,o){if(vn!==0&&vn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var d=a.callbackNode;if(Rh()&&a.callbackNode!==d)return null;var m=ot;return m=bl(a,a===Ot?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(i_(a,m,o),S_(a,nt()),a.callbackNode!=null&&a.callbackNode===d?j_.bind(null,a):null)}function N_(a,o){if(Rh())return null;i_(a,o,!0)}function P6(){K6(function(){(mt&6)!==0?fe(Je,T6):w_()})}function C0(){if(fs===0){var a=Dl;a===0&&(a=Ha,Ha<<=1,(Ha&261888)===0&&(Ha=256)),fs=a}return fs}function C_(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Hf(""+a)}function O_(a,o){var d=o.ownerDocument.createElement("input");return d.name=o.name,d.value=o.value,a.id&&d.setAttribute("form",a.id),o.parentNode.insertBefore(d,o),a=new FormData(a),d.parentNode.removeChild(d),a}function z6(a,o,d,m,b){if(o==="submit"&&d&&d.stateNode===b){var j=C_((b[Qt]||null).action),k=m.submitter;k&&(o=(o=k[Qt]||null)?C_(o.formAction):k.getAttribute("formAction"),o!==null&&(j=o,k=null));var M=new Yf("action","action",null,m,b);a.push({event:M,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(fs!==0){var U=k?O_(b,k):new FormData(b);Hy(d,{pending:!0,data:U,method:b.method,action:j},null,U)}}else typeof j=="function"&&(M.preventDefault(),U=k?O_(b,k):new FormData(b),Hy(d,{pending:!0,data:U,method:b.method,action:j},j,U))},currentTarget:b}]})}}for(var O0=0;O0<ly.length;O0++){var _0=ly[O0],M6=_0.toLowerCase(),R6=_0[0].toUpperCase()+_0.slice(1);mi(M6,"on"+R6)}mi(rC,"onAnimationEnd"),mi(iC,"onAnimationIteration"),mi(aC,"onAnimationStart"),mi("dblclick","onDoubleClick"),mi("focusin","onFocus"),mi("focusout","onBlur"),mi(QU,"onTransitionRun"),mi(XU,"onTransitionStart"),mi(JU,"onTransitionCancel"),mi(sC,"onTransitionEnd"),Xn("onMouseEnter",["mouseout","mouseover"]),Xn("onMouseLeave",["mouseout","mouseover"]),Xn("onPointerEnter",["pointerout","pointerover"]),Xn("onPointerLeave",["pointerout","pointerover"]),gn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gn("onBeforeInput",["compositionend","keypress","textInput","paste"]),gn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vu="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(" "),D6=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vu));function __(a,o){o=(o&4)!==0;for(var d=0;d<a.length;d++){var m=a[d],b=m.event;m=m.listeners;e:{var j=void 0;if(o)for(var k=m.length-1;0<=k;k--){var M=m[k],U=M.instance,J=M.currentTarget;if(M=M.listener,U!==j&&b.isPropagationStopped())break e;j=M,b.currentTarget=J;try{j(b)}catch(se){Xf(se)}b.currentTarget=null,j=U}else for(k=0;k<m.length;k++){if(M=m[k],U=M.instance,J=M.currentTarget,M=M.listener,U!==j&&b.isPropagationStopped())break e;j=M,b.currentTarget=J;try{j(b)}catch(se){Xf(se)}b.currentTarget=null,j=U}}}}function it(a,o){var d=o[Fn];d===void 0&&(d=o[Fn]=new Set);var m=a+"__bubble";d.has(m)||(k_(o,a,2,!1),d.add(m))}function k0(a,o,d){var m=0;o&&(m|=4),k_(d,a,m,o)}var Lh="_reactListening"+Math.random().toString(36).slice(2);function A0(a){if(!a[Lh]){a[Lh]=!0,st.forEach(function(d){d!=="selectionchange"&&(D6.has(d)||k0(d,!1,a),k0(d,!0,a))});var o=a.nodeType===9?a:a.ownerDocument;o===null||o[Lh]||(o[Lh]=!0,k0("selectionchange",!1,o))}}function k_(a,o,d,m){switch(rk(o)){case 2:var b=uB;break;case 8:b=dB;break;default:b=K0}d=b.bind(null,o,d,a),b=void 0,!Yv||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(b=!0),m?b!==void 0?a.addEventListener(o,d,{capture:!0,passive:b}):a.addEventListener(o,d,!0):b!==void 0?a.addEventListener(o,d,{passive:b}):a.addEventListener(o,d,!1)}function E0(a,o,d,m,b){var j=m;if((o&1)===0&&(o&2)===0&&m!==null)e:for(;;){if(m===null)return;var k=m.tag;if(k===3||k===4){var M=m.stateNode.containerInfo;if(M===b)break;if(k===4)for(k=m.return;k!==null;){var U=k.tag;if((U===3||U===4)&&k.stateNode.containerInfo===b)return;k=k.return}for(;M!==null;){if(k=Za(M),k===null)return;if(U=k.tag,U===5||U===6||U===26||U===27){m=j=k;continue e}M=M.parentNode}}m=m.return}zN(function(){var J=j,se=Vv(d),de=[];e:{var ee=oC.get(a);if(ee!==void 0){var re=Yf,Ae=a;switch(a){case"keypress":if(Vf(d)===0)break e;case"keydown":case"keyup":re=AU;break;case"focusin":Ae="focus",re=Jv;break;case"focusout":Ae="blur",re=Jv;break;case"beforeblur":case"afterblur":re=Jv;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=DN;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=vU;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=PU;break;case rC:case iC:case aC:re=xU;break;case sC:re=MU;break;case"scroll":case"scrollend":re=mU;break;case"wheel":re=DU;break;case"copy":case"cut":case"paste":re=SU;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=LN;break;case"toggle":case"beforetoggle":re=LU}var Ue=(o&4)!==0,Ct=!Ue&&(a==="scroll"||a==="scrollend"),Z=Ue?ee!==null?ee+"Capture":null:ee;Ue=[];for(var K=J,X;K!==null;){var ce=K;if(X=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||X===null||Z===null||(ce=mu(K,Z),ce!=null&&Ue.push(Zu(K,ce,X))),Ct)break;K=K.return}0<Ue.length&&(ee=new re(ee,Ae,null,d,se),de.push({event:ee,listeners:Ue}))}}if((o&7)===0){e:{if(ee=a==="mouseover"||a==="pointerover",re=a==="mouseout"||a==="pointerout",ee&&d!==Gv&&(Ae=d.relatedTarget||d.fromElement)&&(Za(Ae)||Ae[Sr]))break e;if((re||ee)&&(ee=se.window===se?se:(ee=se.ownerDocument)?ee.defaultView||ee.parentWindow:window,re?(Ae=d.relatedTarget||d.toElement,re=J,Ae=Ae?Za(Ae):null,Ae!==null&&(Ct=s(Ae),Ue=Ae.tag,Ae!==Ct||Ue!==5&&Ue!==27&&Ue!==6)&&(Ae=null)):(re=null,Ae=J),re!==Ae)){if(Ue=DN,ce="onMouseLeave",Z="onMouseEnter",K="mouse",(a==="pointerout"||a==="pointerover")&&(Ue=LN,ce="onPointerLeave",Z="onPointerEnter",K="pointer"),Ct=re==null?ee:Di(re),X=Ae==null?ee:Di(Ae),ee=new Ue(ce,K+"leave",re,d,se),ee.target=Ct,ee.relatedTarget=X,ce=null,Za(se)===J&&(Ue=new Ue(Z,K+"enter",Ae,d,se),Ue.target=X,Ue.relatedTarget=Ct,ce=Ue),Ct=ce,re&&Ae)t:{for(Ue=I6,Z=re,K=Ae,X=0,ce=Z;ce;ce=Ue(ce))X++;ce=0;for(var $e=K;$e;$e=Ue($e))ce++;for(;0<X-ce;)Z=Ue(Z),X--;for(;0<ce-X;)K=Ue(K),ce--;for(;X--;){if(Z===K||K!==null&&Z===K.alternate){Ue=Z;break t}Z=Ue(Z),K=Ue(K)}Ue=null}else Ue=null;re!==null&&A_(de,ee,re,Ue,!1),Ae!==null&&Ct!==null&&A_(de,Ct,Ae,Ue,!0)}}e:{if(ee=J?Di(J):window,re=ee.nodeName&&ee.nodeName.toLowerCase(),re==="select"||re==="input"&&ee.type==="file")var dt=GN;else if(KN(ee))if(VN)dt=ZU;else{dt=GU;var Me=HU}else re=ee.nodeName,!re||re.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?J&&Hv(J.elementType)&&(dt=GN):dt=VU;if(dt&&(dt=dt(a,J))){HN(de,dt,d,se);break e}Me&&Me(a,ee,J),a==="focusout"&&J&&ee.type==="number"&&J.memoizedProps.value!=null&&Kv(ee,"number",ee.value)}switch(Me=J?Di(J):window,a){case"focusin":(KN(Me)||Me.contentEditable==="true")&&(kl=Me,ay=J,ju=null);break;case"focusout":ju=ay=kl=null;break;case"mousedown":sy=!0;break;case"contextmenu":case"mouseup":case"dragend":sy=!1,tC(de,d,se);break;case"selectionchange":if(WU)break;case"keydown":case"keyup":tC(de,d,se)}var Qe;if(ty)e:{switch(a){case"compositionstart":var lt="onCompositionStart";break e;case"compositionend":lt="onCompositionEnd";break e;case"compositionupdate":lt="onCompositionUpdate";break e}lt=void 0}else _l?qN(a,d)&&(lt="onCompositionEnd"):a==="keydown"&&d.keyCode===229&&(lt="onCompositionStart");lt&&($N&&d.locale!=="ko"&&(_l||lt!=="onCompositionStart"?lt==="onCompositionEnd"&&_l&&(Qe=MN()):(Wa=se,Wv="value"in Wa?Wa.value:Wa.textContent,_l=!0)),Me=$h(J,lt),0<Me.length&&(lt=new IN(lt,a,null,d,se),de.push({event:lt,listeners:Me}),Qe?lt.data=Qe:(Qe=FN(d),Qe!==null&&(lt.data=Qe)))),(Qe=UU?BU(a,d):qU(a,d))&&(lt=$h(J,"onBeforeInput"),0<lt.length&&(Me=new IN("onBeforeInput","beforeinput",null,d,se),de.push({event:Me,listeners:lt}),Me.data=Qe)),z6(de,a,J,d,se)}__(de,o)})}function Zu(a,o,d){return{instance:a,listener:o,currentTarget:d}}function $h(a,o){for(var d=o+"Capture",m=[];a!==null;){var b=a,j=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||j===null||(b=mu(a,d),b!=null&&m.unshift(Zu(a,b,j)),b=mu(a,o),b!=null&&m.push(Zu(a,b,j))),a.tag===3)return m;a=a.return}return[]}function I6(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function A_(a,o,d,m,b){for(var j=o._reactName,k=[];d!==null&&d!==m;){var M=d,U=M.alternate,J=M.stateNode;if(M=M.tag,U!==null&&U===m)break;M!==5&&M!==26&&M!==27||J===null||(U=J,b?(J=mu(d,j),J!=null&&k.unshift(Zu(d,J,U))):b||(J=mu(d,j),J!=null&&k.push(Zu(d,J,U)))),d=d.return}k.length!==0&&a.push({event:o,listeners:k})}var L6=/\r\n?/g,$6=/\u0000|\uFFFD/g;function E_(a){return(typeof a=="string"?a:""+a).replace(L6,`
|
|
9
|
+
`).replace($6,"")}function T_(a,o){return o=E_(o),E_(a)===o}function Nt(a,o,d,m,b,j){switch(d){case"children":typeof m=="string"?o==="body"||o==="textarea"&&m===""||Nl(a,m):(typeof m=="number"||typeof m=="bigint")&&o!=="body"&&Nl(a,""+m);break;case"className":Ff(a,"class",m);break;case"tabIndex":Ff(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Ff(a,d,m);break;case"style":TN(a,m,j);break;case"data":if(o!=="object"){Ff(a,"data",m);break}case"src":case"href":if(m===""&&(o!=="a"||d!=="href")){a.removeAttribute(d);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(d);break}m=Hf(""+m),a.setAttribute(d,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(d,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof j=="function"&&(d==="formAction"?(o!=="input"&&Nt(a,o,"name",b.name,b,null),Nt(a,o,"formEncType",b.formEncType,b,null),Nt(a,o,"formMethod",b.formMethod,b,null),Nt(a,o,"formTarget",b.formTarget,b,null)):(Nt(a,o,"encType",b.encType,b,null),Nt(a,o,"method",b.method,b,null),Nt(a,o,"target",b.target,b,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(d);break}m=Hf(""+m),a.setAttribute(d,m);break;case"onClick":m!=null&&(a.onclick=la);break;case"onScroll":m!=null&&it("scroll",a);break;case"onScrollEnd":m!=null&&it("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(d=m.__html,d!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}d=Hf(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(d,""+m):a.removeAttribute(d);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(d,""):a.removeAttribute(d);break;case"capture":case"download":m===!0?a.setAttribute(d,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(d,m):a.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(d,m):a.removeAttribute(d);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(d):a.setAttribute(d,m);break;case"popover":it("beforetoggle",a),it("toggle",a),qf(a,"popover",m);break;case"xlinkActuate":oa(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":oa(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":oa(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":oa(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":oa(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":oa(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":oa(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":oa(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":oa(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":qf(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=hU.get(d)||d,qf(a,d,m))}}function T0(a,o,d,m,b,j){switch(d){case"style":TN(a,m,j);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(d=m.__html,d!=null){if(b.children!=null)throw Error(r(60));a.innerHTML=d}}break;case"children":typeof m=="string"?Nl(a,m):(typeof m=="number"||typeof m=="bigint")&&Nl(a,""+m);break;case"onScroll":m!=null&&it("scroll",a);break;case"onScrollEnd":m!=null&&it("scrollend",a);break;case"onClick":m!=null&&(a.onclick=la);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!St.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(b=d.endsWith("Capture"),o=d.slice(2,b?d.length-7:void 0),j=a[Qt]||null,j=j!=null?j[d]:null,typeof j=="function"&&a.removeEventListener(o,j,b),typeof m=="function")){typeof j!="function"&&j!==null&&(d in a?a[d]=null:a.hasAttribute(d)&&a.removeAttribute(d)),a.addEventListener(o,m,b);break e}d in a?a[d]=m:m===!0?a.setAttribute(d,""):qf(a,d,m)}}}function Mn(a,o,d){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":it("error",a),it("load",a);var m=!1,b=!1,j;for(j in d)if(d.hasOwnProperty(j)){var k=d[j];if(k!=null)switch(j){case"src":m=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Nt(a,o,j,k,d,null)}}b&&Nt(a,o,"srcSet",d.srcSet,d,null),m&&Nt(a,o,"src",d.src,d,null);return;case"input":it("invalid",a);var M=j=k=b=null,U=null,J=null;for(m in d)if(d.hasOwnProperty(m)){var se=d[m];if(se!=null)switch(m){case"name":b=se;break;case"type":k=se;break;case"checked":U=se;break;case"defaultChecked":J=se;break;case"value":j=se;break;case"defaultValue":M=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,o));break;default:Nt(a,o,m,se,d,null)}}_N(a,j,M,U,J,k,b,!1);return;case"select":it("invalid",a),m=k=j=null;for(b in d)if(d.hasOwnProperty(b)&&(M=d[b],M!=null))switch(b){case"value":j=M;break;case"defaultValue":k=M;break;case"multiple":m=M;default:Nt(a,o,b,M,d,null)}o=j,d=k,a.multiple=!!m,o!=null?jl(a,!!m,o,!1):d!=null&&jl(a,!!m,d,!0);return;case"textarea":it("invalid",a),j=b=m=null;for(k in d)if(d.hasOwnProperty(k)&&(M=d[k],M!=null))switch(k){case"value":m=M;break;case"defaultValue":b=M;break;case"children":j=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(91));break;default:Nt(a,o,k,M,d,null)}AN(a,m,b,j);return;case"option":for(U in d)d.hasOwnProperty(U)&&(m=d[U],m!=null)&&(U==="selected"?a.selected=m&&typeof m!="function"&&typeof m!="symbol":Nt(a,o,U,m,d,null));return;case"dialog":it("beforetoggle",a),it("toggle",a),it("cancel",a),it("close",a);break;case"iframe":case"object":it("load",a);break;case"video":case"audio":for(m=0;m<Vu.length;m++)it(Vu[m],a);break;case"image":it("error",a),it("load",a);break;case"details":it("toggle",a);break;case"embed":case"source":case"link":it("error",a),it("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in d)if(d.hasOwnProperty(J)&&(m=d[J],m!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Nt(a,o,J,m,d,null)}return;default:if(Hv(o)){for(se in d)d.hasOwnProperty(se)&&(m=d[se],m!==void 0&&T0(a,o,se,m,d,void 0));return}}for(M in d)d.hasOwnProperty(M)&&(m=d[M],m!=null&&Nt(a,o,M,m,d,null))}function U6(a,o,d,m){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,j=null,k=null,M=null,U=null,J=null,se=null;for(re in d){var de=d[re];if(d.hasOwnProperty(re)&&de!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":U=de;default:m.hasOwnProperty(re)||Nt(a,o,re,null,m,de)}}for(var ee in m){var re=m[ee];if(de=d[ee],m.hasOwnProperty(ee)&&(re!=null||de!=null))switch(ee){case"type":j=re;break;case"name":b=re;break;case"checked":J=re;break;case"defaultChecked":se=re;break;case"value":k=re;break;case"defaultValue":M=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,o));break;default:re!==de&&Nt(a,o,ee,re,m,de)}}Fv(a,k,M,U,J,se,j,b);return;case"select":re=k=M=ee=null;for(j in d)if(U=d[j],d.hasOwnProperty(j)&&U!=null)switch(j){case"value":break;case"multiple":re=U;default:m.hasOwnProperty(j)||Nt(a,o,j,null,m,U)}for(b in m)if(j=m[b],U=d[b],m.hasOwnProperty(b)&&(j!=null||U!=null))switch(b){case"value":ee=j;break;case"defaultValue":M=j;break;case"multiple":k=j;default:j!==U&&Nt(a,o,b,j,m,U)}o=M,d=k,m=re,ee!=null?jl(a,!!d,ee,!1):!!m!=!!d&&(o!=null?jl(a,!!d,o,!0):jl(a,!!d,d?[]:"",!1));return;case"textarea":re=ee=null;for(M in d)if(b=d[M],d.hasOwnProperty(M)&&b!=null&&!m.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:Nt(a,o,M,null,m,b)}for(k in m)if(b=m[k],j=d[k],m.hasOwnProperty(k)&&(b!=null||j!=null))switch(k){case"value":ee=b;break;case"defaultValue":re=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==j&&Nt(a,o,k,b,m,j)}kN(a,ee,re);return;case"option":for(var Ae in d)ee=d[Ae],d.hasOwnProperty(Ae)&&ee!=null&&!m.hasOwnProperty(Ae)&&(Ae==="selected"?a.selected=!1:Nt(a,o,Ae,null,m,ee));for(U in m)ee=m[U],re=d[U],m.hasOwnProperty(U)&&ee!==re&&(ee!=null||re!=null)&&(U==="selected"?a.selected=ee&&typeof ee!="function"&&typeof ee!="symbol":Nt(a,o,U,ee,m,re));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 Ue in d)ee=d[Ue],d.hasOwnProperty(Ue)&&ee!=null&&!m.hasOwnProperty(Ue)&&Nt(a,o,Ue,null,m,ee);for(J in m)if(ee=m[J],re=d[J],m.hasOwnProperty(J)&&ee!==re&&(ee!=null||re!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(r(137,o));break;default:Nt(a,o,J,ee,m,re)}return;default:if(Hv(o)){for(var Ct in d)ee=d[Ct],d.hasOwnProperty(Ct)&&ee!==void 0&&!m.hasOwnProperty(Ct)&&T0(a,o,Ct,void 0,m,ee);for(se in m)ee=m[se],re=d[se],!m.hasOwnProperty(se)||ee===re||ee===void 0&&re===void 0||T0(a,o,se,ee,m,re);return}}for(var Z in d)ee=d[Z],d.hasOwnProperty(Z)&&ee!=null&&!m.hasOwnProperty(Z)&&Nt(a,o,Z,null,m,ee);for(de in m)ee=m[de],re=d[de],!m.hasOwnProperty(de)||ee===re||ee==null&&re==null||Nt(a,o,de,ee,m,re)}function P_(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function B6(){if(typeof performance.getEntriesByType=="function"){for(var a=0,o=0,d=performance.getEntriesByType("resource"),m=0;m<d.length;m++){var b=d[m],j=b.transferSize,k=b.initiatorType,M=b.duration;if(j&&M&&P_(k)){for(k=0,M=b.responseEnd,m+=1;m<d.length;m++){var U=d[m],J=U.startTime;if(J>M)break;var se=U.transferSize,de=U.initiatorType;se&&P_(de)&&(U=U.responseEnd,k+=se*(U<M?1:(M-J)/(U-J)))}if(--m,o+=8*(j+k)/(b.duration/1e3),a++,10<a)break}}if(0<a)return o/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var P0=null,z0=null;function Uh(a){return a.nodeType===9?a:a.ownerDocument}function z_(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function M_(a,o){if(a===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&o==="foreignObject"?0:a}function M0(a,o){return a==="textarea"||a==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var R0=null;function q6(){var a=window.event;return a&&a.type==="popstate"?a===R0?!1:(R0=a,!0):(R0=null,!1)}var R_=typeof setTimeout=="function"?setTimeout:void 0,F6=typeof clearTimeout=="function"?clearTimeout:void 0,D_=typeof Promise=="function"?Promise:void 0,K6=typeof queueMicrotask=="function"?queueMicrotask:typeof D_<"u"?function(a){return D_.resolve(null).then(a).catch(H6)}:R_;function H6(a){setTimeout(function(){throw a})}function hs(a){return a==="head"}function I_(a,o){var d=o,m=0;do{var b=d.nextSibling;if(a.removeChild(d),b&&b.nodeType===8)if(d=b.data,d==="/$"||d==="/&"){if(m===0){a.removeChild(b),tc(o);return}m--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")m++;else if(d==="html")Yu(a.ownerDocument.documentElement);else if(d==="head"){d=a.ownerDocument.head,Yu(d);for(var j=d.firstChild;j;){var k=j.nextSibling,M=j.nodeName;j[Ri]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&j.rel.toLowerCase()==="stylesheet"||d.removeChild(j),j=k}}else d==="body"&&Yu(a.ownerDocument.body);d=b}while(d);tc(o)}function L_(a,o){var d=a;a=0;do{var m=d.nextSibling;if(d.nodeType===1?o?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(o?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),m&&m.nodeType===8)if(d=m.data,d==="/$"){if(a===0)break;a--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||a++;d=m}while(d)}function D0(a){var o=a.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var d=o;switch(o=o.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":D0(d),wl(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}a.removeChild(d)}}function G6(a,o,d,m){for(;a.nodeType===1;){var b=d;if(a.nodeName.toLowerCase()!==o.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[Ri])switch(o){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(j=a.getAttribute("rel"),j==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(j!==b.rel||a.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||a.getAttribute("title")!==(b.title==null?null:b.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(j=a.getAttribute("src"),(j!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&j&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(o==="input"&&a.type==="hidden"){var j=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===j)return a}else return a;if(a=Kr(a.nextSibling),a===null)break}return null}function V6(a,o,d){if(o==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!d||(a=Kr(a.nextSibling),a===null))return null;return a}function $_(a,o){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!o||(a=Kr(a.nextSibling),a===null))return null;return a}function I0(a){return a.data==="$?"||a.data==="$~"}function L0(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function Z6(a,o){var d=a.ownerDocument;if(a.data==="$~")a._reactRetry=o;else if(a.data!=="$?"||d.readyState!=="loading")o();else{var m=function(){o(),d.removeEventListener("DOMContentLoaded",m)};d.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function Kr(a){for(;a!=null;a=a.nextSibling){var o=a.nodeType;if(o===1||o===3)break;if(o===8){if(o=a.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return a}var $0=null;function U_(a){a=a.nextSibling;for(var o=0;a;){if(a.nodeType===8){var d=a.data;if(d==="/$"||d==="/&"){if(o===0)return Kr(a.nextSibling);o--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||o++}a=a.nextSibling}return null}function B_(a){a=a.previousSibling;for(var o=0;a;){if(a.nodeType===8){var d=a.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(o===0)return a;o--}else d!=="/$"&&d!=="/&"||o++}a=a.previousSibling}return null}function q_(a,o,d){switch(o=Uh(d),a){case"html":if(a=o.documentElement,!a)throw Error(r(452));return a;case"head":if(a=o.head,!a)throw Error(r(453));return a;case"body":if(a=o.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Yu(a){for(var o=a.attributes;o.length;)a.removeAttributeNode(o[0]);wl(a)}var Hr=new Map,F_=new Set;function Bh(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Na=ie.d;ie.d={f:Y6,r:W6,D:Q6,C:X6,L:J6,m:eB,X:nB,S:tB,M:rB};function Y6(){var a=Na.f(),o=Ph();return a||o}function W6(a){var o=pi(a);o!==null&&o.tag===5&&o.type==="form"?sO(o):Na.r(a)}var Xl=typeof document>"u"?null:document;function K_(a,o,d){var m=Xl;if(m&&typeof o=="string"&&o){var b=Ir(o);b='link[rel="'+a+'"][href="'+b+'"]',typeof d=="string"&&(b+='[crossorigin="'+d+'"]'),F_.has(b)||(F_.add(b),a={rel:a,crossOrigin:d,href:o},m.querySelector(b)===null&&(o=m.createElement("link"),Mn(o,"link",a),cn(o),m.head.appendChild(o)))}}function Q6(a){Na.D(a),K_("dns-prefetch",a,null)}function X6(a,o){Na.C(a,o),K_("preconnect",a,o)}function J6(a,o,d){Na.L(a,o,d);var m=Xl;if(m&&a&&o){var b='link[rel="preload"][as="'+Ir(o)+'"]';o==="image"&&d&&d.imageSrcSet?(b+='[imagesrcset="'+Ir(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(b+='[imagesizes="'+Ir(d.imageSizes)+'"]')):b+='[href="'+Ir(a)+'"]';var j=b;switch(o){case"style":j=Jl(a);break;case"script":j=ec(a)}Hr.has(j)||(a=g({rel:"preload",href:o==="image"&&d&&d.imageSrcSet?void 0:a,as:o},d),Hr.set(j,a),m.querySelector(b)!==null||o==="style"&&m.querySelector(Wu(j))||o==="script"&&m.querySelector(Qu(j))||(o=m.createElement("link"),Mn(o,"link",a),cn(o),m.head.appendChild(o)))}}function eB(a,o){Na.m(a,o);var d=Xl;if(d&&a){var m=o&&typeof o.as=="string"?o.as:"script",b='link[rel="modulepreload"][as="'+Ir(m)+'"][href="'+Ir(a)+'"]',j=b;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":j=ec(a)}if(!Hr.has(j)&&(a=g({rel:"modulepreload",href:a},o),Hr.set(j,a),d.querySelector(b)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Qu(j)))return}m=d.createElement("link"),Mn(m,"link",a),cn(m),d.head.appendChild(m)}}}function tB(a,o,d){Na.S(a,o,d);var m=Xl;if(m&&a){var b=Ya(m).hoistableStyles,j=Jl(a);o=o||"default";var k=b.get(j);if(!k){var M={loading:0,preload:null};if(k=m.querySelector(Wu(j)))M.loading=5;else{a=g({rel:"stylesheet",href:a,"data-precedence":o},d),(d=Hr.get(j))&&U0(a,d);var U=k=m.createElement("link");cn(U),Mn(U,"link",a),U._p=new Promise(function(J,se){U.onload=J,U.onerror=se}),U.addEventListener("load",function(){M.loading|=1}),U.addEventListener("error",function(){M.loading|=2}),M.loading|=4,qh(k,o,m)}k={type:"stylesheet",instance:k,count:1,state:M},b.set(j,k)}}}function nB(a,o){Na.X(a,o);var d=Xl;if(d&&a){var m=Ya(d).hoistableScripts,b=ec(a),j=m.get(b);j||(j=d.querySelector(Qu(b)),j||(a=g({src:a,async:!0},o),(o=Hr.get(b))&&B0(a,o),j=d.createElement("script"),cn(j),Mn(j,"link",a),d.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},m.set(b,j))}}function rB(a,o){Na.M(a,o);var d=Xl;if(d&&a){var m=Ya(d).hoistableScripts,b=ec(a),j=m.get(b);j||(j=d.querySelector(Qu(b)),j||(a=g({src:a,async:!0,type:"module"},o),(o=Hr.get(b))&&B0(a,o),j=d.createElement("script"),cn(j),Mn(j,"link",a),d.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},m.set(b,j))}}function H_(a,o,d,m){var b=(b=oe.current)?Bh(b):null;if(!b)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(o=Jl(d.href),d=Ya(b).hoistableStyles,m=d.get(o),m||(m={type:"style",instance:null,count:0,state:null},d.set(o,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){a=Jl(d.href);var j=Ya(b).hoistableStyles,k=j.get(a);if(k||(b=b.ownerDocument||b,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},j.set(a,k),(j=b.querySelector(Wu(a)))&&!j._p&&(k.instance=j,k.state.loading=5),Hr.has(a)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},Hr.set(a,d),j||iB(b,a,d,k.state))),o&&m===null)throw Error(r(528,""));return k}if(o&&m!==null)throw Error(r(529,""));return null;case"script":return o=d.async,d=d.src,typeof d=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=ec(d),d=Ya(b).hoistableScripts,m=d.get(o),m||(m={type:"script",instance:null,count:0,state:null},d.set(o,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Jl(a){return'href="'+Ir(a)+'"'}function Wu(a){return'link[rel="stylesheet"]['+a+"]"}function G_(a){return g({},a,{"data-precedence":a.precedence,precedence:null})}function iB(a,o,d,m){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?m.loading=1:(o=a.createElement("link"),m.preload=o,o.addEventListener("load",function(){return m.loading|=1}),o.addEventListener("error",function(){return m.loading|=2}),Mn(o,"link",d),cn(o),a.head.appendChild(o))}function ec(a){return'[src="'+Ir(a)+'"]'}function Qu(a){return"script[async]"+a}function V_(a,o,d){if(o.count++,o.instance===null)switch(o.type){case"style":var m=a.querySelector('style[data-href~="'+Ir(d.href)+'"]');if(m)return o.instance=m,cn(m),m;var b=g({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),cn(m),Mn(m,"style",b),qh(m,d.precedence,a),o.instance=m;case"stylesheet":b=Jl(d.href);var j=a.querySelector(Wu(b));if(j)return o.state.loading|=4,o.instance=j,cn(j),j;m=G_(d),(b=Hr.get(b))&&U0(m,b),j=(a.ownerDocument||a).createElement("link"),cn(j);var k=j;return k._p=new Promise(function(M,U){k.onload=M,k.onerror=U}),Mn(j,"link",m),o.state.loading|=4,qh(j,d.precedence,a),o.instance=j;case"script":return j=ec(d.src),(b=a.querySelector(Qu(j)))?(o.instance=b,cn(b),b):(m=d,(b=Hr.get(j))&&(m=g({},d),B0(m,b)),a=a.ownerDocument||a,b=a.createElement("script"),cn(b),Mn(b,"link",m),a.head.appendChild(b),o.instance=b);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(m=o.instance,o.state.loading|=4,qh(m,d.precedence,a));return o.instance}function qh(a,o,d){for(var m=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=m.length?m[m.length-1]:null,j=b,k=0;k<m.length;k++){var M=m[k];if(M.dataset.precedence===o)j=M;else if(j!==b)break}j?j.parentNode.insertBefore(a,j.nextSibling):(o=d.nodeType===9?d.head:d,o.insertBefore(a,o.firstChild))}function U0(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.title==null&&(a.title=o.title)}function B0(a,o){a.crossOrigin==null&&(a.crossOrigin=o.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=o.referrerPolicy),a.integrity==null&&(a.integrity=o.integrity)}var Fh=null;function Z_(a,o,d){if(Fh===null){var m=new Map,b=Fh=new Map;b.set(d,m)}else b=Fh,m=b.get(d),m||(m=new Map,b.set(d,m));if(m.has(a))return m;for(m.set(a,null),d=d.getElementsByTagName(a),b=0;b<d.length;b++){var j=d[b];if(!(j[Ri]||j[Dt]||a==="link"&&j.getAttribute("rel")==="stylesheet")&&j.namespaceURI!=="http://www.w3.org/2000/svg"){var k=j.getAttribute(o)||"";k=a+k;var M=m.get(k);M?M.push(j):m.set(k,[j])}}return m}function Y_(a,o,d){a=a.ownerDocument||a,a.head.insertBefore(d,o==="title"?a.querySelector("head > title"):null)}function aB(a,o,d){if(d===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(a=o.disabled,typeof o.precedence=="string"&&a==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function W_(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function sB(a,o,d,m){if(d.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var b=Jl(m.href),j=o.querySelector(Wu(b));if(j){o=j._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=Kh.bind(a),o.then(a,a)),d.state.loading|=4,d.instance=j,cn(j);return}j=o.ownerDocument||o,m=G_(m),(b=Hr.get(b))&&U0(m,b),j=j.createElement("link"),cn(j);var k=j;k._p=new Promise(function(M,U){k.onload=M,k.onerror=U}),Mn(j,"link",m),d.instance=j}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(d,o),(o=d.state.preload)&&(d.state.loading&3)===0&&(a.count++,d=Kh.bind(a),o.addEventListener("load",d),o.addEventListener("error",d))}}var q0=0;function oB(a,o){return a.stylesheets&&a.count===0&&Gh(a,a.stylesheets),0<a.count||0<a.imgCount?function(d){var m=setTimeout(function(){if(a.stylesheets&&Gh(a,a.stylesheets),a.unsuspend){var j=a.unsuspend;a.unsuspend=null,j()}},6e4+o);0<a.imgBytes&&q0===0&&(q0=62500*B6());var b=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Gh(a,a.stylesheets),a.unsuspend)){var j=a.unsuspend;a.unsuspend=null,j()}},(a.imgBytes>q0?50:800)+o);return a.unsuspend=d,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(b)}}:null}function Kh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Gh(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Hh=null;function Gh(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Hh=new Map,o.forEach(lB,a),Hh=null,Kh.call(a))}function lB(a,o){if(!(o.state.loading&4)){var d=Hh.get(a);if(d)var m=d.get(null);else{d=new Map,Hh.set(a,d);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),j=0;j<b.length;j++){var k=b[j];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(d.set(k.dataset.precedence,k),m=k)}m&&d.set(null,m)}b=o.instance,k=b.getAttribute("data-precedence"),j=d.get(k)||m,j===m&&d.set(null,b),d.set(k,b),this.count++,m=Kh.bind(this),b.addEventListener("load",m),b.addEventListener("error",m),j?j.parentNode.insertBefore(b,j.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),o.state.loading|=4}}var Xu={$$typeof:A,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function cB(a,o,d,m,b,j,k,M,U){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=xl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xl(0),this.hiddenUpdates=xl(null),this.identifierPrefix=m,this.onUncaughtError=b,this.onCaughtError=j,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function Q_(a,o,d,m,b,j,k,M,U,J,se,de){return a=new cB(a,o,d,k,U,J,se,de,M),o=1,j===!0&&(o|=24),j=Nr(3,null,null,o),a.current=j,j.stateNode=a,o=wy(),o.refCount++,a.pooledCache=o,o.refCount++,j.memoizedState={element:m,isDehydrated:d,cache:o},Cy(j),a}function X_(a){return a?(a=Tl,a):Tl}function J_(a,o,d,m,b,j){b=X_(b),m.context===null?m.context=b:m.pendingContext=b,m=ns(o),m.payload={element:d},j=j===void 0?null:j,j!==null&&(m.callback=j),d=rs(a,m,o),d!==null&&(mr(d,a,o),Eu(d,a,o))}function ek(a,o){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var d=a.retryLane;a.retryLane=d!==0&&d<o?d:o}}function F0(a,o){ek(a,o),(a=a.alternate)&&ek(a,o)}function tk(a){if(a.tag===13||a.tag===31){var o=ao(a,67108864);o!==null&&mr(o,a,67108864),F0(a,67108864)}}function nk(a){if(a.tag===13||a.tag===31){var o=Ar();o=F(o);var d=ao(a,o);d!==null&&mr(d,a,o),F0(a,o)}}var Vh=!0;function uB(a,o,d,m){var b=H.T;H.T=null;var j=ie.p;try{ie.p=2,K0(a,o,d,m)}finally{ie.p=j,H.T=b}}function dB(a,o,d,m){var b=H.T;H.T=null;var j=ie.p;try{ie.p=8,K0(a,o,d,m)}finally{ie.p=j,H.T=b}}function K0(a,o,d,m){if(Vh){var b=H0(m);if(b===null)E0(a,o,m,Zh,d),ik(a,m);else if(hB(b,a,o,d,m))m.stopPropagation();else if(ik(a,m),o&4&&-1<fB.indexOf(a)){for(;b!==null;){var j=pi(b);if(j!==null)switch(j.tag){case 3:if(j=j.stateNode,j.current.memoizedState.isDehydrated){var k=zi(j.pendingLanes);if(k!==0){var M=j;for(M.pendingLanes|=2,M.entangledLanes|=2;k;){var U=1<<31-ye(k);M.entanglements[1]|=U,k&=~U}Ui(j),(mt&6)===0&&(Eh=nt()+500,Gu(0))}}break;case 31:case 13:M=ao(j,2),M!==null&&mr(M,j,2),Ph(),F0(j,2)}if(j=H0(m),j===null&&E0(a,o,m,Zh,d),j===b)break;b=j}b!==null&&m.stopPropagation()}else E0(a,o,m,null,d)}}function H0(a){return a=Vv(a),G0(a)}var Zh=null;function G0(a){if(Zh=null,a=Za(a),a!==null){var o=s(a);if(o===null)a=null;else{var d=o.tag;if(d===13){if(a=l(o),a!==null)return a;a=null}else if(d===31){if(a=c(o),a!==null)return a;a=null}else if(d===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;a=null}else o!==a&&(a=null)}}return Zh=a,null}function rk(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Xe()){case Je:return 2;case Rt:return 8;case cr:case Ka:return 32;case Js:return 268435456;default:return 32}default:return 32}}var V0=!1,ps=null,ms=null,gs=null,Ju=new Map,ed=new Map,vs=[],fB="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 ik(a,o){switch(a){case"focusin":case"focusout":ps=null;break;case"dragenter":case"dragleave":ms=null;break;case"mouseover":case"mouseout":gs=null;break;case"pointerover":case"pointerout":Ju.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":ed.delete(o.pointerId)}}function td(a,o,d,m,b,j){return a===null||a.nativeEvent!==j?(a={blockedOn:o,domEventName:d,eventSystemFlags:m,nativeEvent:j,targetContainers:[b]},o!==null&&(o=pi(o),o!==null&&tk(o)),a):(a.eventSystemFlags|=m,o=a.targetContainers,b!==null&&o.indexOf(b)===-1&&o.push(b),a)}function hB(a,o,d,m,b){switch(o){case"focusin":return ps=td(ps,a,o,d,m,b),!0;case"dragenter":return ms=td(ms,a,o,d,m,b),!0;case"mouseover":return gs=td(gs,a,o,d,m,b),!0;case"pointerover":var j=b.pointerId;return Ju.set(j,td(Ju.get(j)||null,a,o,d,m,b)),!0;case"gotpointercapture":return j=b.pointerId,ed.set(j,td(ed.get(j)||null,a,o,d,m,b)),!0}return!1}function ak(a){var o=Za(a.target);if(o!==null){var d=s(o);if(d!==null){if(o=d.tag,o===13){if(o=l(d),o!==null){a.blockedOn=o,Wt(a.priority,function(){nk(d)});return}}else if(o===31){if(o=c(d),o!==null){a.blockedOn=o,Wt(a.priority,function(){nk(d)});return}}else if(o===3&&d.stateNode.current.memoizedState.isDehydrated){a.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Yh(a){if(a.blockedOn!==null)return!1;for(var o=a.targetContainers;0<o.length;){var d=H0(a.nativeEvent);if(d===null){d=a.nativeEvent;var m=new d.constructor(d.type,d);Gv=m,d.target.dispatchEvent(m),Gv=null}else return o=pi(d),o!==null&&tk(o),a.blockedOn=d,!1;o.shift()}return!0}function sk(a,o,d){Yh(a)&&d.delete(o)}function pB(){V0=!1,ps!==null&&Yh(ps)&&(ps=null),ms!==null&&Yh(ms)&&(ms=null),gs!==null&&Yh(gs)&&(gs=null),Ju.forEach(sk),ed.forEach(sk)}function Wh(a,o){a.blockedOn===o&&(a.blockedOn=null,V0||(V0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,pB)))}var Qh=null;function ok(a){Qh!==a&&(Qh=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Qh===a&&(Qh=null);for(var o=0;o<a.length;o+=3){var d=a[o],m=a[o+1],b=a[o+2];if(typeof m!="function"){if(G0(m||d)===null)continue;break}var j=pi(d);j!==null&&(a.splice(o,3),o-=3,Hy(j,{pending:!0,data:b,method:d.method,action:m},m,b))}}))}function tc(a){function o(U){return Wh(U,a)}ps!==null&&Wh(ps,a),ms!==null&&Wh(ms,a),gs!==null&&Wh(gs,a),Ju.forEach(o),ed.forEach(o);for(var d=0;d<vs.length;d++){var m=vs[d];m.blockedOn===a&&(m.blockedOn=null)}for(;0<vs.length&&(d=vs[0],d.blockedOn===null);)ak(d),d.blockedOn===null&&vs.shift();if(d=(a.ownerDocument||a).$$reactFormReplay,d!=null)for(m=0;m<d.length;m+=3){var b=d[m],j=d[m+1],k=b[Qt]||null;if(typeof j=="function")k||ok(d);else if(k){var M=null;if(j&&j.hasAttribute("formAction")){if(b=j,k=j[Qt]||null)M=k.formAction;else if(G0(b)!==null)continue}else M=k.action;typeof M=="function"?d[m+1]=M:(d.splice(m,3),m-=3),ok(d)}}}function lk(){function a(j){j.canIntercept&&j.info==="react-transition"&&j.intercept({handler:function(){return new Promise(function(k){return b=k})},focusReset:"manual",scroll:"manual"})}function o(){b!==null&&(b(),b=null),m||setTimeout(d,20)}function d(){if(!m&&!navigation.transition){var j=navigation.currentEntry;j&&j.url!=null&&navigation.navigate(j.url,{state:j.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,b=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(d,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),b!==null&&(b(),b=null)}}}function Z0(a){this._internalRoot=a}Xh.prototype.render=Z0.prototype.render=function(a){var o=this._internalRoot;if(o===null)throw Error(r(409));var d=o.current,m=Ar();J_(d,m,a,o,null,null)},Xh.prototype.unmount=Z0.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var o=a.containerInfo;J_(a.current,2,null,a,null,null),Ph(),o[Sr]=null}};function Xh(a){this._internalRoot=a}Xh.prototype.unstable_scheduleHydration=function(a){if(a){var o=wt();a={blockedOn:null,target:a,priority:o};for(var d=0;d<vs.length&&o!==0&&o<vs[d].priority;d++);vs.splice(d,0,a),d===0&&ak(a)}};var ck=t.version;if(ck!=="19.2.4")throw Error(r(527,ck,"19.2.4"));ie.findDOMNode=function(a){var o=a._reactInternals;if(o===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=h(o),a=a!==null?p(a):null,a=a===null?null:a.stateNode,a};var mB={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{En=Jh.inject(mB),qe=Jh}catch{}}return rd.createRoot=function(a,o){if(!i(a))throw Error(r(299));var d=!1,m="",b=gO,j=vO,k=yO;return o!=null&&(o.unstable_strictMode===!0&&(d=!0),o.identifierPrefix!==void 0&&(m=o.identifierPrefix),o.onUncaughtError!==void 0&&(b=o.onUncaughtError),o.onCaughtError!==void 0&&(j=o.onCaughtError),o.onRecoverableError!==void 0&&(k=o.onRecoverableError)),o=Q_(a,1,!1,null,null,d,m,null,b,j,k,lk),a[Sr]=o.current,A0(a),new Z0(o)},rd.hydrateRoot=function(a,o,d){if(!i(a))throw Error(r(299));var m=!1,b="",j=gO,k=vO,M=yO,U=null;return d!=null&&(d.unstable_strictMode===!0&&(m=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onUncaughtError!==void 0&&(j=d.onUncaughtError),d.onCaughtError!==void 0&&(k=d.onCaughtError),d.onRecoverableError!==void 0&&(M=d.onRecoverableError),d.formState!==void 0&&(U=d.formState)),o=Q_(a,1,!0,o,d??null,m,b,U,j,k,M,lk),o.context=X_(null),d=o.current,m=Ar(),m=F(m),b=ns(m),b.callback=null,rs(d,b,m),d=m,o.current.lanes=d,to(o,d),Ui(o),a[Sr]=o.current,A0(a),new Xh(o)},rd.version="19.2.4",rd}var bk;function CB(){if(bk)return Q0.exports;bk=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(),Q0.exports=NB(),Q0.exports}var OB=CB(),ll=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(){}},_B={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},kB=class{#t=_B;#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)}},Eo=new kB;function AB(e){setTimeout(e,0)}var Yo=typeof window>"u"||"Deno"in globalThis;function Gn(){}function EB(e,t){return typeof e=="function"?e(t):e}function aw(e){return typeof e=="number"&&e>=0&&e!==1/0}function cM(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zs(e,t){return typeof e=="function"?e(t):e}function Xr(e,t){return typeof e=="function"?e(t):e}function xk(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==$S(l,t.options))return!1}else if(!Md(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||s&&!s(t))}function wk(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Wo(t.options.mutationKey)!==Wo(s))return!1}else if(!Md(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function $S(e,t){return(t?.queryKeyHashFn||Wo)(e)}function Wo(e){return JSON.stringify(e,(t,n)=>sw(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Md(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Md(e[n],t[n])):!1}var TB=Object.prototype.hasOwnProperty;function US(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Sk(e)&&Sk(t);if(!r&&!(sw(e)&&sw(t)))return t;const s=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,f=r?new Array(c):{};let h=0;for(let p=0;p<c;p++){const g=r?p:l[p],v=e[g],y=t[g];if(v===y){f[g]=v,(r?p<s:TB.call(e,g))&&h++;continue}if(v===null||y===null||typeof v!="object"||typeof y!="object"){f[g]=y;continue}const S=US(v,y,n+1);f[g]=S,S===v&&h++}return s===c&&h===s?e:f}function Rd(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 Sk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function sw(e){if(!jk(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!jk(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function jk(e){return Object.prototype.toString.call(e)==="[object Object]"}function PB(e){return new Promise(t=>{Eo.setTimeout(t,e)})}function ow(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?US(e,t):t}function zB(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function MB(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var BS=Symbol();function uM(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===BS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function qS(e,t){return typeof e=="function"?e(...t):!!e}function RB(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 DB=class extends ll{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Yo&&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"}},FS=new DB;function lw(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var IB=AB;function LB(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=IB;const s=c=>{t?e.push(c):i(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},batchCalls:c=>(...f)=>{s(()=>{c(...f)})},schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var nn=LB(),$B=class extends ll{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Yo&&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}},nm=new $B;function UB(e){return Math.min(1e3*2**e,3e4)}function dM(e){return(e??"online")==="online"?nm.isOnline():!0}var cw=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function fM(e){let t=!1,n=0,r;const i=lw(),s=()=>i.status!=="pending",l=w=>{if(!s()){const N=new cw(w);v(N),e.onCancel?.(N)}},c=()=>{t=!0},f=()=>{t=!1},h=()=>FS.isFocused()&&(e.networkMode==="always"||nm.isOnline())&&e.canRun(),p=()=>dM(e.networkMode)&&e.canRun(),g=w=>{s()||(r?.(),i.resolve(w))},v=w=>{s()||(r?.(),i.reject(w))},y=()=>new Promise(w=>{r=N=>{(s()||h())&&w(N)},e.onPause?.()}).then(()=>{r=void 0,s()||e.onContinue?.()}),S=()=>{if(s())return;let w;const N=n===0?e.initialPromise:void 0;try{w=N??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(g).catch(C=>{if(s())return;const E=e.retry??(Yo?0:3),A=e.retryDelay??UB,O=typeof A=="function"?A(n,C):A,P=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,C);if(t||!P){v(C);return}n++,e.onFail?.(n,C),PB(O).then(()=>h()?void 0:y()).then(()=>{t?v(C):S()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:f,canStart:p,start:()=>(p()?S():y().then(S),i)}}var hM=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),aw(this.gcTime)&&(this.#t=Eo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Yo?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Eo.clearTimeout(this.#t),this.#t=void 0)}},BB=class extends hM{#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=Ck(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=Ck(this.options);t.data!==void 0&&(this.setState(Nk(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=ow(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(Gn).catch(Gn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Xr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===BS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>zs(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:!cM(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const c=uM(this.options,t),h=(()=>{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,h,this):c(h)},l=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(c),c})();this.options.behavior?.onFetch(l,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#s({type:"fetch",meta:l.fetchOptions?.meta}),this.#r=fM({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:c=>{c instanceof cw&&c.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(c,f)=>{this.#s({type:"failed",failureCount:c,error:f})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof cw){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,...pM(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Nk(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),nn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function pM(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:dM(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Nk(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ck(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var KS=class extends ll{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=lw(),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),Ok(this.#e,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return uw(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return uw(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 Xr(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&&!Rd(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&_k(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||Xr(this.options.enabled,this.#e)!==Xr(t.enabled,this.#e)||zs(this.options.staleTime,this.#e)!==zs(t.staleTime,this.#e))&&this.#g();const i=this.#v();r&&(this.#e!==n||Xr(this.options.enabled,this.#e)!==Xr(t.enabled,this.#e)||i!==this.#l)&&this.#y(i)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return FB(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(Gn)),t}#g(){this.#x();const e=zs(this.options.staleTime,this.#e);if(Yo||this.#i.isStale||!aw(e))return;const n=cM(this.#i.dataUpdatedAt,e)+1;this.#c=Eo.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#l=e,!(Yo||Xr(this.options.enabled,this.#e)===!1||!aw(this.#l)||this.#l===0)&&(this.#u=Eo.setInterval(()=>{(this.options.refetchIntervalInBackground||FS.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#c&&(Eo.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Eo.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,i=this.#i,s=this.#r,l=this.#a,f=e!==n?e.state:this.#n,{state:h}=e;let p={...h},g=!1,v;if(t._optimisticResults){const T=this.hasListeners(),R=!T&&Ok(e,t),B=T&&_k(e,n,t,r);(R||B)&&(p={...p,...pM(h.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:y,errorUpdatedAt:S,status:w}=p;v=p.data;let N=!1;if(t.placeholderData!==void 0&&v===void 0&&w==="pending"){let T;i?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(T=i.data,N=!0):T=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,T!==void 0&&(w="success",v=ow(i?.data,T,t),g=!0)}if(t.select&&v!==void 0&&!N)if(i&&v===s?.data&&t.select===this.#p)v=this.#d;else try{this.#p=t.select,v=t.select(v),v=ow(i?.data,v,t),this.#d=v,this.#s=null}catch(T){this.#s=T}this.#s&&(y=this.#s,v=this.#d,S=Date.now(),w="error");const C=p.fetchStatus==="fetching",E=w==="pending",A=w==="error",O=E&&C,P=v!==void 0,_={status:w,fetchStatus:p.fetchStatus,isPending:E,isSuccess:w==="success",isError:A,isInitialLoading:O,isLoading:O,data:v,dataUpdatedAt:p.dataUpdatedAt,error:y,errorUpdatedAt:S,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!E,isLoadingError:A&&!P,isPaused:p.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:A&&P,isStale:HS(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Xr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const T=_.data!==void 0,R=_.status==="error"&&!T,B=ne=>{R?ne.reject(_.error):T&&ne.resolve(_.data)},$=()=>{const ne=this.#o=_.promise=lw();B(ne)},L=this.#o;switch(L.status){case"pending":e.queryHash===n.queryHash&&B(L);break;case"fulfilled":(R||_.data!==L.value)&&$();break;case"rejected":(!R||_.error!==L.reason)&&$();break}}return _}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#a=this.options,this.#r.data!==void 0&&(this.#f=this.#e),Rd(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#h.size)return!0;const s=new Set(i??this.#h);return this.options.throwOnError&&s.add("error"),Object.keys(this.#i).some(l=>{const c=l;return this.#i[c]!==e[c]&&s.has(c)})};this.#j({listeners:n()})}#S(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#j(e){nn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function qB(e,t){return Xr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ok(e,t){return qB(e,t)||e.state.data!==void 0&&uw(e,t,t.refetchOnMount)}function uw(e,t,n){if(Xr(t.enabled,e)!==!1&&zs(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&HS(e,t)}return!1}function _k(e,t,n,r){return(e!==t||Xr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&HS(e,n)}function HS(e,t){return Xr(t.enabled,e)!==!1&&e.isStaleByTime(zs(t.staleTime,e))}function FB(e,t){return!Rd(e.getCurrentResult(),t)}function kk(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},f=0;const h=async()=>{let p=!1;const g=S=>{RB(S,()=>t.signal,()=>p=!0)},v=uM(t.options,t.fetchOptions),y=async(S,w,N)=>{if(p)return Promise.reject();if(w==null&&S.pages.length)return Promise.resolve(S);const E=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:w,direction:N?"backward":"forward",meta:t.options.meta};return g(z),z})(),A=await v(E),{maxPages:O}=t.options,P=N?MB:zB;return{pages:P(S.pages,A,O),pageParams:P(S.pageParams,w,O)}};if(i&&s.length){const S=i==="backward",w=S?KB:Ak,N={pages:s,pageParams:l},C=w(r,N);c=await y(N,C,S)}else{const S=e??s.length;do{const w=f===0?l[0]??r.initialPageParam:Ak(r,c);if(f>0&&w==null)break;c=await y(c,w),f++}while(f<S)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=h}}}function Ak(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 KB(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var HB=class extends hM{#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||mM(),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=fM({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,l)=>{this.#r({type:"failed",failureCount:s,error:l})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const l=await this.options.onMutate?.(e,n);l!==this.state.context&&this.#r({type:"pending",context:l,variables:e,isPaused:i})}const s=await this.#i.start();return await this.#n.config.onSuccess?.(s,e,this.state.context,this,n),await this.options.onSuccess?.(s,e,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,e,this.state.context,n),this.#r({type:"success",data:s}),s}catch(s){try{await this.#n.config.onError?.(s,e,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onError?.(s,e,this.state.context,n)}catch(l){Promise.reject(l)}try{await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,s,e,this.state.context,n)}catch(l){Promise.reject(l)}throw this.#r({type:"error",error:s}),s}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),nn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function mM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var gM=class extends ll{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 HB({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=ep(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=ep(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=ep(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=ep(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){nn.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>wk(t,n))}findAll(e={}){return this.getAll().filter(t=>wk(e,t))}notify(e){nn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return nn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Gn))))}};function ep(e){return e.options.scope?.id}var GB=class extends ll{#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),Rd(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Wo(n.mutationKey)!==Wo(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??mM();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){nn.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#e.variables,r=this.#e.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,r,i)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(t.data,null,n,r,i)}catch(s){Promise.reject(s)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,r,i)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(void 0,t.error,n,r,i)}catch(s){Promise.reject(s)}}}this.listeners.forEach(n=>{n(this.#e)})})}};function Ek(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function VB(e,t,n){const r=e.slice(0);return r[t]=n,r}var ZB=class extends ll{#t;#e;#n;#i;#r;#a;#o;#s;#p;#d=[];constructor(e,t,n){super(),this.#t=e,this.#i=n,this.#n=[],this.#r=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#r.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#r.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#i=t,nn.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const i=r.map(p=>p.observer),s=i.map(p=>p.getCurrentResult()),l=n.length!==i.length,c=i.some((p,g)=>p!==n[g]),f=l||c,h=f?!0:s.some((p,g)=>{const v=this.#e[g];return!v||!Rd(p,v)});!f&&!h||(f&&(this.#d=r,this.#r=i),this.#e=s,this.hasListeners()&&(f&&(Ek(n,i).forEach(p=>{p.destroy()}),Ek(i,n).forEach(p=>{p.subscribe(g=>{this.#l(p,g)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,t){const n=this.#u(e),r=n.map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions)),i=n.map(s=>s.defaultedQueryOptions.queryHash);return[r,s=>this.#c(s??r,t,i),()=>this.#f(r,n)]}#f(e,t){return t.map((n,r)=>{const i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,s=>{t.forEach(l=>{l.observer.trackProp(s)})})})}#c(e,t,n){if(t){const r=this.#p,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((s,l)=>s!==r[l]));return(!this.#a||this.#e!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#e,n!==void 0&&(this.#p=n),this.#a=US(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#r.forEach(r=>{const i=r.options.queryHash;if(!i)return;const s=t.get(i);s?s.push(r):t.set(i,[r])});const n=[];return e.forEach(r=>{const i=this.#t.defaultQueryOptions(r),l=t.get(i.queryHash)?.shift()??new KS(this.#t,i);n.push({defaultedQueryOptions:i,observer:l})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=VB(this.#e,n,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#e,this.#d),n=this.#c(t,this.#i?.combine);e!==n&&nn.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},YB=class extends ll{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??$S(r,t);let s=this.get(i);return s||(s=new BB({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){nn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>xk(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>xk(e,n)):t}notify(e){nn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){nn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){nn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},WB=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new YB,this.#e=e.mutationCache||new gM,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=FS.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=nm.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(zs(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#t.get(r.queryHash)?.state.data,l=EB(t,s);if(l!==void 0)return this.#t.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return nn.batch(()=>this.#t.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;nn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return nn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=nn.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Gn).catch(Gn)}invalidateQueries(e,t={}){return nn.batch(()=>(this.#t.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=nn.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Gn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Gn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(zs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Gn).catch(Gn)}fetchInfiniteQuery(e){return e.behavior=kk(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Gn).catch(Gn)}ensureInfiniteQueryData(e){return e.behavior=kk(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return nm.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(Wo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{Md(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Wo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Md(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=$S(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===BS&&(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()}},vM=x.createContext(void 0),Hs=e=>{const t=x.useContext(vM);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},QB=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(vM.Provider,{value:e,children:t})),yM=x.createContext(!1),bM=()=>x.useContext(yM);yM.Provider;function XB(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var JB=x.createContext(XB()),xM=()=>x.useContext(JB),wM=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?qS(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},SM=e=>{x.useEffect(()=>{e.clearReset()},[e])},jM=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||qS(n,[e.error,r])),NM=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))}},e8=(e,t)=>e.isLoading&&e.isFetching&&!t,dw=(e,t)=>e?.suspense&&t.isPending,fw=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function t8({queries:e,...t},n){const r=Hs(),i=bM(),s=xM(),l=x.useMemo(()=>e.map(w=>{const N=r.defaultQueryOptions(w);return N._optimisticResults=i?"isRestoring":"optimistic",N}),[e,r,i]);l.forEach(w=>{NM(w);const N=r.getQueryCache().get(w.queryHash);wM(w,s,N)}),SM(s);const[c]=x.useState(()=>new ZB(r,l,t)),[f,h,p]=c.getOptimisticResult(l,t.combine),g=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(w=>g?c.subscribe(nn.batchCalls(w)):Gn,[c,g]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),x.useEffect(()=>{c.setQueries(l,t)},[l,t,c]);const y=f.some((w,N)=>dw(l[N],w))?f.flatMap((w,N)=>{const C=l[N];if(C&&dw(C,w)){const E=new KS(r,C);return fw(C,E,s)}return[]}):[];if(y.length>0)throw Promise.all(y);const S=f.find((w,N)=>{const C=l[N];return C&&jM({result:w,errorResetBoundary:s,throwOnError:C.throwOnError,query:r.getQueryCache().get(C.queryHash),suspense:C.suspense})});if(S?.error)throw S.error;return h(p())}function n8(e,t,n){const r=bM(),i=xM(),s=Hs(),l=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const c=s.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",NM(l),wM(l,i,c),SM(i);const f=!s.getQueryCache().get(l.queryHash),[h]=x.useState(()=>new t(s,l)),p=h.getOptimisticResult(l),g=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(v=>{const y=g?h.subscribe(nn.batchCalls(v)):Gn;return h.updateResult(),y},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(l)},[l,h]),dw(l,p))throw fw(l,h,i);if(jM({result:p,errorResetBoundary:i,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw p.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(l,p),l.experimental_prefetchInRender&&!Yo&&e8(p,r)&&(f?fw(l,h,i):c?.promise)?.catch(Gn).finally(()=>{h.updateResult()}),l.notifyOnChangeProps?p:h.trackResult(p)}function Uo(e,t){return n8(e,KS)}function uf(e,t){const n=Hs(),[r]=x.useState(()=>new GB(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(l=>r.subscribe(nn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=x.useCallback((l,c)=>{r.mutate(l,c).catch(Gn)},[r]);if(i.error&&qS(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var tp=typeof window<"u"?x.useLayoutEffect:x.useEffect;function tb(e){const t=x.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function r8(e,t,n={},r={}){x.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([s])=>{t(s)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function i8(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}var a8=!1;function Dd(e){return e[e.length-1]}function s8(e){return typeof e=="function"}function ks(e,t){return s8(e)?e(t):e}var o8=Object.prototype.hasOwnProperty,Tk=Object.prototype.propertyIsEnumerable,l8=()=>Object.create(null),bo=(e,t)=>To(e,t,l8);function To(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,s=Mk(e)&&Mk(i);if(!s&&!(rm(e)&&rm(i)))return i;const l=s?e:Pk(e);if(!l)return i;const c=s?i:Pk(i);if(!c)return i;const f=l.length,h=c.length,p=s?new Array(h):n();let g=0;for(let v=0;v<h;v++){const y=s?v:c[v],S=e[y],w=i[y];if(S===w){p[y]=S,(s?v<f:o8.call(e,y))&&g++;continue}if(S===null||w===null||typeof S!="object"||typeof w!="object"){p[y]=w;continue}const N=To(S,w,n,r+1);p[y]=N,N===S&&g++}return f===h&&g===f?e:p}function Pk(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!Tk.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(!Tk.call(e,i))return!1;r.push(i)}return r}function rm(e){if(!zk(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!zk(n)||!n.hasOwnProperty("isPrototypeOf"))}function zk(e){return Object.prototype.toString.call(e)==="[object Object]"}function Mk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Bo(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(!Bo(e[r],t[r],n))return!1;return!0}if(rm(e)&&rm(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!Bo(e[l],t[l],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let s=0;for(const l in t)if((!r||t[l]!==void 0)&&(s++,s>i||!Bo(e[l],t[l],n)))return!1;return i===s}return!1}function Pc(e){let t,n;const r=new Promise((i,s)=>{t=i,n=s});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function Id(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function c8(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Rk(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 c8(t)}var u8=["http:","https:","mailto:","tel:"];function im(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function id(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+=Rk(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+Rk(n?e.slice(n):e);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}function d8(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function am(e){const t=new Map;let n,r;const i=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const l=t.get(s);if(l)return i(l),l.value},set(s,l){if(t.size>=e&&n){const f=n;t.delete(f.key),f.next&&(n=f.next,f.next.prev=void 0),f===r&&(r=void 0)}const c=t.get(s);if(c)c.value=l,i(c);else{const f={key:s,value:l,prev:r};r&&(r.next=f),r=f,n||(n=f),t.set(s,f)}},clear(){t.clear(),n=void 0,r=void 0}}}var f8="Invariant failed";function Us(e,t){if(!e)throw new Error(f8)}var Po=4,CM=5;function h8(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 GS(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,s=e.substring(t,i);if(!s||!s.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(s==="$"){const c=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=c,n[4]=c,n[5]=c,n}if(s.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=h8(s);if(l){const[c,f]=l,h=s.charCodeAt(c+1);if(h===45){if(c+2<s.length&&s.charCodeAt(c+2)===36){const p=c+3,g=f;if(p<g)return n[0]=3,n[1]=t+c,n[2]=t+p,n[3]=t+g,n[4]=t+f+1,n[5]=i,n}}else if(h===36){const p=c+1,g=c+2;return g===f?(n[0]=2,n[1]=t+c,n[2]=t+p,n[3]=t+g,n[4]=t+f+1,n[5]=e.length,n):(n[0]=1,n[1]=t+c,n[2]=t+g,n[3]=t+f,n[4]=t+f+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function wg(e,t,n,r,i,s,l){l?.(n);let c=r;{const f=n.fullPath??n.from,h=f.length,p=n.options?.caseSensitive??e,g=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;c<h;){const y=GS(f,c,t);let S;const w=c,N=y[5];switch(c=N+1,s++,y[0]){case 0:{const C=f.substring(y[2],y[3]);if(p){const E=i.static?.get(C);if(E)S=E;else{i.static??=new Map;const A=zo(n.fullPath??n.from);A.parent=i,A.depth=s,S=A,i.static.set(C,A)}}else{const E=C.toLowerCase(),A=i.staticInsensitive?.get(E);if(A)S=A;else{i.staticInsensitive??=new Map;const O=zo(n.fullPath??n.from);O.parent=i,O.depth=s,S=O,i.staticInsensitive.set(E,O)}}break}case 1:{const C=f.substring(w,y[1]),E=f.substring(y[4],N),A=p&&!!(C||E),O=C?A?C:C.toLowerCase():void 0,P=E?A?E:E.toLowerCase():void 0,z=!g&&i.dynamic?.find(_=>!_.skipOnParamError&&_.caseSensitive===A&&_.prefix===O&&_.suffix===P);if(z)S=z;else{const _=rb(1,n.fullPath??n.from,A,O,P);S=_,_.depth=s,_.parent=i,i.dynamic??=[],i.dynamic.push(_)}break}case 3:{const C=f.substring(w,y[1]),E=f.substring(y[4],N),A=p&&!!(C||E),O=C?A?C:C.toLowerCase():void 0,P=E?A?E:E.toLowerCase():void 0,z=!g&&i.optional?.find(_=>!_.skipOnParamError&&_.caseSensitive===A&&_.prefix===O&&_.suffix===P);if(z)S=z;else{const _=rb(3,n.fullPath??n.from,A,O,P);S=_,_.parent=i,_.depth=s,i.optional??=[],i.optional.push(_)}break}case 2:{const C=f.substring(w,y[1]),E=f.substring(y[4],N),A=p&&!!(C||E),O=C?A?C:C.toLowerCase():void 0,P=E?A?E:E.toLowerCase():void 0,z=rb(2,n.fullPath??n.from,A,O,P);S=z,z.parent=i,z.depth=s,i.wildcard??=[],i.wildcard.push(z)}}i=S}if(g&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const y=zo(n.fullPath??n.from);y.kind=CM,y.parent=i,s++,y.depth=s,i.pathless??=[],i.pathless.push(y),i=y}const v=(n.path||!n.children)&&!n.isRoot;if(v&&f.endsWith("/")){const y=zo(n.fullPath??n.from);y.kind=Po,y.parent=i,s++,y.depth=s,i.index=y,i=y}i.parse=n.options?.params?.parse??null,i.skipOnParamError=g,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,v&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const f of n.children)wg(e,t,f,c,i,s,l)}function nb(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 js(e){if(e.pathless)for(const t of e.pathless)js(t);if(e.static)for(const t of e.static.values())js(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())js(t);if(e.dynamic?.length){e.dynamic.sort(nb);for(const t of e.dynamic)js(t)}if(e.optional?.length){e.optional.sort(nb);for(const t of e.optional)js(t)}if(e.wildcard?.length){e.wildcard.sort(nb);for(const t of e.wildcard)js(t)}}function zo(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 rb(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 p8(e,t){const n=zo("/"),r=new Uint16Array(6);for(const i of e)wg(!1,r,i,1,n,0);js(n),t.masksTree=n,t.flatCache=am(1e3)}function m8(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=VS(e,t.masksTree);return t.flatCache.set(e,r),r}function g8(e,t,n,r,i){e||="/",r||="/";const s=t?`case\0${e}`:e;let l=i.singleCache.get(s);return l||(l=zo("/"),wg(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(s,l)),VS(r,l,n)}function v8(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||="/";let s;try{s=VS(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)s=null;else throw l}return s&&(s.branch=x8(s.route)),t.matchCache.set(r,s),s}function y8(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function b8(e,t=!1,n){const r=zo(e.fullPath),i=new Uint16Array(6),s={},l={};let c=0;return wg(t,i,e,1,r,0,f=>{if(n?.(f,c),Us(!(f.id in s),`Duplicate routes found with id: ${String(f.id)}`),s[f.id]=f,c!==0&&f.path){const h=y8(f.fullPath);(!l[h]||f.fullPath.endsWith("/"))&&(l[h]=f)}c++}),js(r),{processedTree:{segmentTree:r,singleCache:am(1e3),matchCache:am(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:l}}function VS(e,t,n=!1){const r=e.split("/"),i=S8(e,r,t,n);if(!i)return null;const[s]=OM(e,r,i);return{route:i.node.route,rawParams:s,parsedParams:i.parsedParams}}function OM(e,t,n){const r=w8(n.node);let i=null;const s=Object.create(null);let l=n.extract?.part??0,c=n.extract?.node??0,f=n.extract?.path??0,h=n.extract?.segment??0;for(;c<r.length;l++,c++,f++,h++){const p=r[c];if(p.kind===Po)break;if(p.kind===CM){h--,l--,f--;continue}const g=t[l],v=f;if(g&&(f+=g.length),p.kind===1){i??=n.node.fullPath.split("/");const y=i[h],S=p.prefix?.length??0;if(y.charCodeAt(S)===123){const w=p.suffix?.length??0,N=y.substring(S+2,y.length-w-1),C=g.substring(S,g.length-w);s[N]=decodeURIComponent(C)}else{const w=y.substring(1);s[w]=decodeURIComponent(g)}}else if(p.kind===3){if(n.skipped&1<<c){l--,f=v-1;continue}i??=n.node.fullPath.split("/");const y=i[h],S=p.prefix?.length??0,w=p.suffix?.length??0,N=y.substring(S+3,y.length-w-1),C=p.suffix||p.prefix?g.substring(S,g.length-w):g;C&&(s[N]=decodeURIComponent(C))}else if(p.kind===2){const y=p,S=e.substring(v+(y.prefix?.length??0),e.length-(y.suffix?.length??0)),w=decodeURIComponent(S);s["*"]=w,s._splat=w;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:l,node:c,path:f,segment:h}]}function x8(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function w8(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function S8(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Dd(t),s=i&&e!=="/",l=t.length-(i?1:0),c=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let f=null,h=null,p=null;for(;c.length;){const g=c.pop(),{node:v,index:y,skipped:S,depth:w,statics:N,dynamics:C,optionals:E}=g;let{extract:A,rawParams:O,parsedParams:P}=g;if(v.skipOnParamError){if(!ib(e,t,g))continue;O=g.rawParams,A=g.extract,P=g.parsedParams}r&&v.route&&v.kind!==Po&&ad(h,g)&&(h=g);const z=y===l;if(z&&(v.route&&!s&&ad(p,g)&&(p=g),!v.optional&&!v.wildcard&&!v.index&&!v.pathless))continue;const _=z?void 0:t[y];let T;if(z&&v.index){const R={node:v.index,index:y,skipped:S,depth:w+1,statics:N,dynamics:C,optionals:E,extract:A,rawParams:O,parsedParams:P};let B=!0;if(v.index.skipOnParamError&&(ib(e,t,R)||(B=!1)),B){if(N===l&&!C&&!E&&!S)return R;ad(p,R)&&(p=R)}}if(v.wildcard&&ad(f,g))for(const R of v.wildcard){const{prefix:B,suffix:$}=R;if(B&&(z||!(R.caseSensitive?_:T??=_.toLowerCase()).startsWith(B)))continue;if($){if(z)continue;const ne=t.slice(y).join("/").slice(-$.length);if((R.caseSensitive?ne:ne.toLowerCase())!==$)continue}const L={node:R,index:l,skipped:S,depth:w,statics:N,dynamics:C,optionals:E,extract:A,rawParams:O,parsedParams:P};if(!(R.skipOnParamError&&!ib(e,t,L))){f=L;break}}if(v.optional){const R=S|1<<w,B=w+1;for(let $=v.optional.length-1;$>=0;$--){const L=v.optional[$];c.push({node:L,index:y,skipped:R,depth:B,statics:N,dynamics:C,optionals:E,extract:A,rawParams:O,parsedParams:P})}if(!z)for(let $=v.optional.length-1;$>=0;$--){const L=v.optional[$],{prefix:ne,suffix:he}=L;if(ne||he){const ge=L.caseSensitive?_:T??=_.toLowerCase();if(ne&&!ge.startsWith(ne)||he&&!ge.endsWith(he))continue}c.push({node:L,index:y+1,skipped:S,depth:B,statics:N,dynamics:C,optionals:E+1,extract:A,rawParams:O,parsedParams:P})}}if(!z&&v.dynamic&&_)for(let R=v.dynamic.length-1;R>=0;R--){const B=v.dynamic[R],{prefix:$,suffix:L}=B;if($||L){const ne=B.caseSensitive?_:T??=_.toLowerCase();if($&&!ne.startsWith($)||L&&!ne.endsWith(L))continue}c.push({node:B,index:y+1,skipped:S,depth:w+1,statics:N,dynamics:C+1,optionals:E,extract:A,rawParams:O,parsedParams:P})}if(!z&&v.staticInsensitive){const R=v.staticInsensitive.get(T??=_.toLowerCase());R&&c.push({node:R,index:y+1,skipped:S,depth:w+1,statics:N+1,dynamics:C,optionals:E,extract:A,rawParams:O,parsedParams:P})}if(!z&&v.static){const R=v.static.get(_);R&&c.push({node:R,index:y+1,skipped:S,depth:w+1,statics:N+1,dynamics:C,optionals:E,extract:A,rawParams:O,parsedParams:P})}if(v.pathless){const R=w+1;for(let B=v.pathless.length-1;B>=0;B--){const $=v.pathless[B];c.push({node:$,index:y,skipped:S,depth:R,statics:N,dynamics:C,optionals:E,extract:A,rawParams:O,parsedParams:P})}}}if(p&&f)return ad(f,p)?p:f;if(p)return p;if(f)return f;if(r&&h){let g=h.index;for(let y=0;y<h.index;y++)g+=t[y].length;const v=g===e.length?"/":e.slice(g);return h.rawParams??=Object.create(null),h.rawParams["**"]=decodeURIComponent(v),h}return null}function ib(e,t,n){try{const[r,i]=OM(e,t,n);n.rawParams=r,n.extract=i;const s=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,s),!0}catch{return null}}function ad(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===Po)>(e.node.kind===Po)||t.node.kind===Po==(e.node.kind===Po)&&t.depth>e.depth))):!0}function $p(e){return ZS(e.filter(t=>t!==void 0).join("/"))}function ZS(e){return e.replace(/\/{2,}/g,"/")}function _M(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Ms(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function kM(e){return Ms(_M(e))}function sm(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function j8(e,t,n){return sm(e,n)===sm(t,n)}function N8({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),s=!i&&t===".";let l;if(r){l=i?t:s?e:e+"\0"+t;const g=r.get(l);if(g)return g}let c;if(s)c=e.split("/");else if(i)c=t.split("/");else{for(c=e.split("/");c.length>1&&Dd(c)==="";)c.pop();const g=t.split("/");for(let v=0,y=g.length;v<y;v++){const S=g[v];S===""?v?v===y-1&&c.push(S):c=[S]:S===".."?c.pop():S==="."||c.push(S)}}c.length>1&&(Dd(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));let f,h="";for(let g=0;g<c.length;g++){g>0&&(h+="/");const v=c[g];if(!v)continue;f=GS(v,0,f);const y=f[0];if(y===0){h+=v;continue}const S=f[5],w=v.substring(0,f[1]),N=v.substring(f[4],S),C=v.substring(f[2],f[3]);y===1?h+=w||N?`${w}{$${C}}${N}`:`$${C}`:y===2?h+=w||N?`${w}{$}${N}`:"$":h+=`${w}{-$${C}}${N}`}h=ZS(h);const p=h||"/";return l&&r&&r.set(l,p),p}function C8(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return i=>i.replace(r,s=>t.get(s)??s)}function ab(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=>Ik(i,n)).join("/"):Ik(r,n)}function Dk({path:e,params:t,decoder:n,...r}){let i=!1;const s=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:i};const l=e.length;let c=0,f,h="";for(;c<l;){const p=c;f=GS(e,p,f);const g=f[5];if(c=g+1,p===g)continue;const v=f[0];if(v===0){h+="/"+e.substring(p,g);continue}if(v===2){const y=t._splat;s._splat=y,s["*"]=y;const S=e.substring(p,f[1]),w=e.substring(f[4],g);if(!y){i=!0,(S||w)&&(h+="/"+S+w);continue}const N=ab("_splat",t,n);h+="/"+S+N+w;continue}if(v===1){const y=e.substring(f[2],f[3]);!i&&!(y in t)&&(i=!0),s[y]=t[y];const S=e.substring(p,f[1]),w=e.substring(f[4],g),N=ab(y,t,n)??"undefined";h+="/"+S+N+w;continue}if(v===3){const y=e.substring(f[2],f[3]),S=t[y];if(S==null)continue;s[y]=S;const w=e.substring(p,f[1]),N=e.substring(f[4],g),C=ab(y,t,n)??"";h+="/"+w+C+N;continue}}return e.endsWith("/")&&(h+="/"),{usedParams:s,interpolatedPath:h||"/",isMissingParams:i}}function Ik(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function rr(e){return!!e?.isNotFound}function O8(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var hw="tsr-scroll-restoration-v1_3",_8=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function k8(){const e=O8();if(!e)return null;const t=e.getItem(hw);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=ks(r,n)||n;try{e.setItem(hw,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var np=k8(),A8=e=>e.state.__TSR_key||e.href;function E8(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 om=!1;function T8({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:s}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(h){console.error(h);return}const c=t||window.history.state?.__TSR_key,f=l[c];om=!0;e:{if(r&&f&&Object.keys(f).length>0){for(const g in f){const v=f[g];if(g==="window")window.scrollTo({top:v.scrollY,left:v.scrollX,behavior:n});else if(g){const y=document.querySelector(g);y&&(y.scrollLeft=v.scrollX,y.scrollTop=v.scrollY)}}break e}const h=(s??window.location).hash.split("#",2)[1];if(h){const g=window.history.state?.__hashScrollIntoViewOptions??!0;if(g){const v=document.getElementById(h);v&&v.scrollIntoView(g)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),i)for(const g of i){if(g==="window")continue;const v=typeof g=="function"?g():document.querySelector(g);v&&v.scrollTo(p)}}om=!1}function P8(e,t){if(!np||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!np))return;e.isScrollRestorationSetup=!0,om=!1;const n=e.options.getScrollRestorationKey||A8;window.history.scrollRestoration="manual";const r=i=>{if(om||!e.isScrollRestoring)return;let s="";if(i.target===document||i.target===window)s="window";else{const c=i.target.getAttribute("data-scroll-restoration-id");c?s=`[data-scroll-restoration-id="${c}"]`:s=E8(i.target)}const l=n(e.state.location);np.set(c=>{const f=c[l]||={},h=f[s]||={};if(s==="window")h.scrollX=window.scrollX||0,h.scrollY=window.scrollY||0;else if(s){const p=document.querySelector(s);p&&(h.scrollX=p.scrollLeft||0,h.scrollY=p.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",_8(r,100),!0),e.subscribe("onRendered",i=>{const s=n(i.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(T8({storageKey:hw,key:s,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&np.set(l=>(l[s]||={},l)))})}function z8(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 M8(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 sb(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function R8(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,i]of t.entries()){const s=n[r];s==null?n[r]=sb(i):Array.isArray(s)?s.push(sb(i)):n[r]=[s,sb(i)]}return n}var D8=L8(JSON.parse),I8=$8(JSON.stringify,JSON.parse);function L8(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=R8(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function $8(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const s=M8(i,r);return s?`?${s}`:""}}var qo="__root__";function YS(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 gr(e){return e instanceof Response&&!!e.options}function U8(e){return{input:({url:t})=>{for(const n of e)t=pw(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=AM(e[n],t);return t}}}function B8(e){const t=kM(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),s=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const c=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return c===i?l.pathname="/":c.startsWith(s)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=$p(["/",t,l.pathname]),l)}}function pw(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 AM(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 $t=(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))($t||{});function EM({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:s,checkDirty:l,shallowPropagate:c};function r(h,p,g){const v=p.depsTail;if(v!==void 0&&v.dep===h)return;const y=v!==void 0?v.nextDep:p.deps;if(y!==void 0&&y.dep===h){y.version=g,p.depsTail=y;return}const S=h.subsTail;if(S!==void 0&&S.version===g&&S.sub===p)return;const w=p.depsTail=h.subsTail={version:g,dep:h,sub:p,prevDep:v,nextDep:y,prevSub:S,nextSub:void 0};y!==void 0&&(y.prevDep=w),v!==void 0?v.nextDep=w:p.deps=w,S!==void 0?S.nextSub=w:h.subs=w}function i(h,p=h.sub){const g=h.dep,v=h.prevDep,y=h.nextDep,S=h.nextSub,w=h.prevSub;return y!==void 0?y.prevDep=v:p.depsTail=v,v!==void 0?v.nextDep=y:p.deps=y,S!==void 0?S.prevSub=w:g.subsTail=w,w!==void 0?w.nextSub=S:(g.subs=S)===void 0&&n(g),y}function s(h){let p=h.nextSub,g;e:do{const v=h.sub;let y=v.flags;if(y&60?y&12?y&4?!(y&48)&&f(h,v)?(v.flags=y|40,y&=1):y=0:v.flags=y&-9|32:y=0:v.flags=y|32,y&2&&t(v),y&1){const S=v.subs;if(S!==void 0){const w=(h=S).nextSub;w!==void 0&&(g={value:p,prev:g},p=w);continue}}if((h=p)!==void 0){p=h.nextSub;continue}for(;g!==void 0;)if(h=g.value,g=g.prev,h!==void 0){p=h.nextSub;continue e}break}while(!0)}function l(h,p){let g,v=0,y=!1;e:do{const S=h.dep,w=S.flags;if(p.flags&16)y=!0;else if((w&17)===17){if(e(S)){const N=S.subs;N.nextSub!==void 0&&c(N),y=!0}}else if((w&33)===33){(h.nextSub!==void 0||h.prevSub!==void 0)&&(g={value:h,prev:g}),h=S.deps,p=S,++v;continue}if(!y){const N=h.nextDep;if(N!==void 0){h=N;continue}}for(;v--;){const N=p.subs,C=N.nextSub!==void 0;if(C?(h=g.value,g=g.prev):h=N,y){if(e(p)){C&&c(N),p=h.sub;continue}y=!1}else p.flags&=-33;p=h.sub;const E=h.nextDep;if(E!==void 0){h=E;continue e}}return y}while(!0)}function c(h){do{const p=h.sub,g=p.flags;(g&48)===32&&(p.flags=g|16,(g&6)===2&&t(p))}while((h=h.nextSub)!==void 0)}function f(h,p){let g=p.depsTail;for(;g!==void 0;){if(g===h)return!0;g=g.prevDep}return!1}}let WS=0,xo=0,kd=0;const _a=[],{link:Eye,unlink:TM,propagate:Tye,checkDirty:q8,shallowPropagate:Pye}=EM({update(e){return e.depsTail!==void 0?G8(e):V8(e)},notify(e){let t=kd,n=t;do if(_a[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(kd=t;n<--t;){const r=_a[n];_a[n++]=_a[t],_a[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Sg(e)):W8.call(e)}});function F8(){return WS}function K8(){++WS}function H8(){--WS||Y8()}function G8(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Sg(e)}}function V8(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Z8(e){const t=e.flags;if(t&16||t&32&&q8(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Sg(e)}}else e.flags=2}function Y8(){try{for(;xo<kd;){const e=_a[xo];_a[xo++]=void 0,Z8(e)}}finally{for(;xo<kd;){const e=_a[xo];_a[xo++]=void 0,e.flags|=10}xo=0,kd=0}}function W8(){this.depsTail=void 0,this.flags=0,Sg(this);const e=this.subs;e!==void 0&&TM(e)}function Sg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=TM(n,e)}function QS(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 mw=[];let Up=0;const{link:Lk,unlink:Q8,propagate:X8,checkDirty:PM,shallowPropagate:$k}=EM({update(e){return e._update()},notify(e){mw[gw++]=e,e.flags&=~$t.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=$t.Mutable|$t.Dirty,lm(e))}});let rp=0,gw=0,Ki;function lm(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=Q8(n,e)}function zM(){if(!(F8()>0)){for(;rp<gw;){const e=mw[rp];mw[rp++]=void 0,e.notify()}rp=0,gw=0}}function MM(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?$t.None:$t.Mutable,get(){return Ki!==void 0&&Lk(i,Ki,Up),i._snapshot},subscribe(s){const l=QS(s),c={current:!1},f=J8(()=>{i.get(),c.current?l.next?.(i._snapshot):c.current=!0});return{unsubscribe:()=>{f.stop()}}},_update(s){const l=Ki,c=Object.is;if(n)Ki=i,++Up,i.depsTail=void 0;else if(s===void 0)return!1;n&&(i.flags=$t.Mutable|$t.RecursedCheck);try{const f=i._snapshot,h=typeof s=="function"?s(f):s===void 0&&n?r(f):s;return f===void 0||!c(f,h)?(i._snapshot=h,!0):!1}finally{Ki=l,n&&(i.flags&=~$t.RecursedCheck),lm(i)}}};return n?(i.flags=$t.Mutable|$t.Dirty,i.get=function(){const s=i.flags;if(s&$t.Dirty||s&$t.Pending&&PM(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&$k(l)}}else s&$t.Pending&&(i.flags=s&~$t.Pending);return Ki!==void 0&&Lk(i,Ki,Up),i._snapshot}):i.set=function(s){if(i._update(s)){const l=i.subs;l!==void 0&&(X8(l),$k(l),zM())}},i}function J8(e){const t=()=>{const r=Ki;Ki=n,++Up,n.depsTail=void 0,n.flags=$t.Watching|$t.RecursedCheck;try{return e()}finally{Ki=r,n.flags&=~$t.RecursedCheck,lm(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:$t.Watching|$t.RecursedCheck,notify(){const r=this.flags;r&$t.Dirty||r&$t.Pending&&PM(this.deps,this)?t():this.flags=$t.Watching},stop(){this.flags=$t.None,this.depsTail=void 0,lm(this)}};return t(),n}class eq{constructor(t){this.atom=MM(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(QS(t))}}class tq{constructor(t){this.atom=MM(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(QS(t))}}function nq(e){return typeof e=="function"?new tq(e):new eq(e)}function rq(e){try{K8(),e()}finally{H8(),zM()}}function Ad(e){let t;return rq(()=>{t=e()}),t}var vw=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},jg=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Fo=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let s=0;s<=i;s++){const l=e.matches[s];if(!l)continue;const c=e.router.getMatch(l.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},Uk=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),i=r>=0?r:0;let s=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=i);for(let l=s;l>=0;l--){const c=e.matches[l];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return l}return n?s:i},As=(e,t,n)=>{if(!(!gr(n)&&!rr(n)))throw gr(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:gr(n)?"redirected":r.status==="pending"?"success":r.status,context:Fo(e,t.index),isFetching:!1,error:n})),rr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),gr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},RM=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Bk=(e,t,n)=>{const r=Fo(e,n);e.updateMatch(t,i=>({...i,context:r}))},sd=(e,t,n,r)=>{const{id:i,routeId:s}=e.matches[t],l=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,As(e,e.router.getMatch(i),n);try{l.options.onError?.(n)}catch(c){n=c,As(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&&!gr(n)&&!rr(n)&&(e.serialError??=n)},DM=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!jg(e,t)&&(n.options.loader||n.options.beforeLoad||LM(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const s=setTimeout(()=>{vw(e)},i);r._nonReactive.pendingTimeout=s}},iq=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;DM(e,t,n,r);const i=()=>{const s=e.router.getMatch(t);s.preload&&(s.status==="redirected"||s.status==="notFound")&&As(e,s,s.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},aq=(e,t,n,r)=>{const i=e.router.getMatch(t);let s=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Pc(()=>{s?.resolve(),s=void 0});const{paramsError:l,searchError:c}=i;l&&sd(e,n,l,"PARSE_PARAMS"),c&&sd(e,n,c,"VALIDATE_SEARCH"),DM(e,t,r,i);const f=new AbortController;let h=!1;const p=()=>{h||(h=!0,e.updateMatch(t,O=>({...O,isFetching:"beforeLoad",fetchCount:O.fetchCount+1,abortController:f})))},g=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,O=>({...O,isFetching:!1}))};if(!r.options.beforeLoad){Ad(()=>{p(),g()});return}i._nonReactive.beforeLoadPromise=Pc();const v={...Fo(e,n,!1),...i.__routeContext},{search:y,params:S,cause:w}=i,N=jg(e,t),C={search:y,abortController:f,params:S,preload:N,context:v,location:e.location,navigate:O=>e.router.navigate({...O,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:N?"preload":w,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},E=O=>{if(O===void 0){Ad(()=>{p(),g()});return}(gr(O)||rr(O))&&(p(),sd(e,n,O,"BEFORE_LOAD")),Ad(()=>{p(),e.updateMatch(t,P=>({...P,__beforeLoadContext:O})),g()})};let A;try{if(A=r.options.beforeLoad(C),Id(A))return p(),A.catch(O=>{sd(e,n,O,"BEFORE_LOAD")}).then(E)}catch(O){p(),sd(e,n,O,"BEFORE_LOAD")}E(A)},sq=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],s=()=>c(),l=()=>aq(e,n,t,i),c=()=>{if(RM(e,n))return;const f=iq(e,n,i);return Id(f)?f.then(l):l()};return s()},oq=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([s,l,c])=>({meta:s?.meta,links:s?.links,headScripts:s?.scripts,headers:c,scripts:l,styles:s?.styles}))},IM=(e,t,n,r,i)=>{const s=t[r-1],{params:l,loaderDeps:c,abortController:f,cause:h}=e.router.getMatch(n),p=Fo(e,r),g=jg(e,n);return{params:l,deps:c,preload:!!g,parentMatchPromise:s,abortController:f,context:p,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:g?"preload":h,route:i,...e.router.options.additionalContext}},qk=async(e,t,n,r,i)=>{try{const s=e.router.getMatch(n);try{(!(a8??e.router.isServer)||s.ssr===!0)&&Ld(i);const l=i.options.loader,c=typeof l=="function"?l:l?.handler,f=c?.(IM(e,t,n,r,i)),h=!!c&&Id(f);if((h||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(n,g=>({...g,isFetching:"loader"})),c){const g=h?await f:f;As(e,e.router.getMatch(n),g),g!==void 0&&e.updateMatch(n,v=>({...v,loaderData:g}))}i._lazyPromise&&await i._lazyPromise;const p=s._nonReactive.minPendingPromise;p&&await p,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,g=>({...g,error:void 0,context:Fo(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let c=l;if(c?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,h=>({...h,status:h.status==="pending"?"success":h.status,isFetching:!1,context:Fo(e,r)}));return}const f=s._nonReactive.minPendingPromise;f&&await f,rr(l)&&await i.options.notFoundComponent?.preload?.(),As(e,e.router.getMatch(n),l);try{i.options.onError?.(l)}catch(h){c=h,As(e,e.router.getMatch(n),h)}!gr(c)&&!rr(c)&&await Ld(i,["errorComponent"]),e.updateMatch(n,h=>({...h,error:c,context:Fo(e,r),status:"error",isFetching:!1}))}}catch(s){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),As(e,l,s)}},lq=async(e,t,n)=>{async function r(y,S,w,N,C){const E=Date.now()-S.updatedAt,A=y?C.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:C.options.staleTime??e.router.options.defaultStaleTime??0,O=C.options.shouldReload,P=typeof O=="function"?O(IM(e,t,i,n,C)):O,{status:z,invalid:_}=N,T=E>A&&(!!e.forceStaleReload||N.cause==="enter"||w!==void 0&&w!==N.id);l=z==="success"&&(_||(P??T)),y&&C.options.preload===!1||(l&&!e.sync&&p?(c=!0,(async()=>{try{await qk(e,t,i,n,C);const R=e.router.getMatch(i);R._nonReactive.loaderPromise?.resolve(),R._nonReactive.loadPromise?.resolve(),R._nonReactive.loaderPromise=void 0,R._nonReactive.loadPromise=void 0}catch(R){gr(R)&&await e.router.navigate(R.options)}})()):z!=="success"||l?await qk(e,t,i,n,C):Bk(e,i,n))}const{id:i,routeId:s}=e.matches[n];let l=!1,c=!1;const f=e.router.looseRoutesById[s],h=f.options.loader,p=((typeof h=="function"?void 0:h?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(RM(e,i)){if(!e.router.getMatch(i))return e.matches[n];Bk(e,i,n)}else{const y=e.router.getMatch(i),S=e.router.state.matches[n]?.routeId===s?e.router.state.matches[n].id:e.router.state.matches.find(N=>N.routeId===s)?.id,w=jg(e,i);if(y._nonReactive.loaderPromise){if(y.status==="success"&&!e.sync&&!y.preload&&p)return y;await y._nonReactive.loaderPromise;const N=e.router.getMatch(i),C=N._nonReactive.error||N.error;C&&As(e,N,C),N.status==="pending"&&await r(w,y,S,N,f)}else{const N=w&&!e.router.state.matches.some(E=>E.id===i),C=e.router.getMatch(i);C._nonReactive.loaderPromise=Pc(),N!==C.preload&&e.updateMatch(i,E=>({...E,preload:N})),await r(w,y,S,C,f)}}const g=e.router.getMatch(i);c||(g._nonReactive.loaderPromise?.resolve(),g._nonReactive.loadPromise?.resolve(),g._nonReactive.loadPromise=void 0),clearTimeout(g._nonReactive.pendingTimeout),g._nonReactive.pendingTimeout=void 0,c||(g._nonReactive.loaderPromise=void 0),g._nonReactive.dehydrated=void 0;const v=c?g.isFetching:!1;return v!==g.isFetching||g.invalid!==!1?(e.updateMatch(i,y=>({...y,isFetching:v,invalid:!1})),e.router.getMatch(i)):g};async function Fk(e){const t=e,n=[];t.router.state.matches.some(v=>v._forcePending)&&vw(t);let r;for(let v=0;v<t.matches.length;v++){try{const y=sq(t,v);Id(y)&&await y}catch(y){if(gr(y))throw y;if(rr(y))r=y;else if(!t.preload)throw y;break}if(t.serialError)break}const i=t.firstBadMatchIndex??t.matches.length,s=r&&!t.preload?Uk(t,r):void 0,l=r&&t.preload?0:s!==void 0?Math.min(s+1,i):i;let c,f;for(let v=0;v<l;v++)n.push(lq(t,n,v));try{await Promise.all(n)}catch{const v=await Promise.allSettled(n);for(const y of v){if(y.status!=="rejected")continue;const S=y.reason;if(gr(S))throw S;rr(S)?c??=S:f??=S}if(f!==void 0)throw f}const h=c??(r&&!t.preload?r:void 0);let p=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!h&&r&&t.preload)return t.matches;if(h){const v=Uk(t,h);Us(v!==void 0);const y=t.matches[v],S=t.router.looseRoutesById[y.routeId],w=t.router.options?.defaultNotFoundComponent;!S.options.notFoundComponent&&w&&(S.options.notFoundComponent=w),h.routeId=y.routeId;const N=y.routeId===t.router.routeTree.id;t.updateMatch(y.id,C=>({...C,...N?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:h},isFetching:!1})),p=v,await Ld(S,["notFoundComponent"])}else if(!t.preload){const v=t.matches[0];v.globalNotFound||t.router.getMatch(v.id)?.globalNotFound&&t.updateMatch(v.id,y=>({...y,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const v=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Ld(v,["errorComponent"])}for(let v=0;v<=p;v++){const{id:y,routeId:S}=t.matches[v],w=t.router.looseRoutesById[S];try{const N=oq(t,y,w);if(N){const C=await N;t.updateMatch(y,E=>({...E,...C}))}}catch(N){console.error(`Error executing head for route ${S}:`,N)}}const g=vw(t);if(Id(g)&&await g,h)throw h;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Kk(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Ld(e,t=Bp){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...s}=r.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Bp?(()=>{if(e._componentsPromise===void 0){const r=Kk(e,Bp);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Kk(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function LM(e){for(const t of Bp)if(e.options[t]?.preload)return!0;return!1}var Bp=["component","errorComponent","pendingComponent","notFoundComponent"],Rs="__TSR_index",Hk="popstate",Gk="beforeunload";function cq(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},s=async({task:l,navigateOpts:c,...f})=>{if(c?.ignoreBlocker??!1){l();return}const h=e.getBlockers?.()??[],p=f.type==="PUSH"||f.type==="REPLACE";if(typeof document<"u"&&h.length&&p)for(const g of h){const v=cm(f.path,f.state);if(await g.blockerFn({currentLocation:t,nextLocation:v,action:f.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,c,f)=>{const h=t.state[Rs];c=Vk(h+1,c),s({task:()=>{e.pushState(l,c),r({type:"PUSH"})},navigateOpts:f,type:"PUSH",path:l,state:c})},replace:(l,c,f)=>{const h=t.state[Rs];c=Vk(h,c),s({task:()=>{e.replaceState(l,c),r({type:"REPLACE"})},navigateOpts:f,type:"REPLACE",path:l,state:c})},go:(l,c)=>{s({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:c,type:"GO"})},back:l=>{s({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{s({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Rs]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,l]),()=>{const f=e.getBlockers?.()??[];e.setBlockers?.(f.filter(h=>h!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Vk(e,t){t||(t={});const n=XS();return{...t,key:n,__TSR_key:n,[Rs]:e}}function uq(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const s=()=>i,l=T=>i=T,c=(T=>T),f=(()=>cm(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const T=XS();t.history.replaceState({[Rs]:0,key:T,__TSR_key:T},"")}let h=f(),p,g=!1,v=!1,y=!1,S=!1;const w=()=>h;let N,C;const E=()=>{N&&(_._ignoreSubscribers=!0,(N.isPush?t.history.pushState:t.history.replaceState)(N.state,"",N.href),_._ignoreSubscribers=!1,N=void 0,C=void 0,p=void 0)},A=(T,R,B)=>{const $=c(R);C||(p=h),h=cm(R,B),N={href:$,state:B,isPush:N?.isPush||T==="push"},C||(C=Promise.resolve().then(()=>E()))},O=T=>{h=f(),_.notify({type:T})},P=async()=>{if(v){v=!1;return}const T=f(),R=T.state[Rs]-h.state[Rs],B=R===1,$=R===-1,L=!B&&!$||g;g=!1;const ne=L?"GO":$?"BACK":"FORWARD",he=L?{type:"GO",index:R}:{type:$?"BACK":"FORWARD"};if(y)y=!1;else{const ge=s();if(typeof document<"u"&&ge.length){for(const H of ge)if(await H.blockerFn({currentLocation:h,nextLocation:T,action:ne})){v=!0,t.history.go(1),_.notify(he);return}}}h=f(),_.notify(he)},z=T=>{if(S){S=!1;return}let R=!1;const B=s();if(typeof document<"u"&&B.length)for(const $ of B){const L=$.enableBeforeUnload??!0;if(L===!0){R=!0;break}if(typeof L=="function"&&L()===!0){R=!0;break}}if(R)return T.preventDefault(),T.returnValue=""},_=cq({getLocation:w,getLength:()=>t.history.length,pushState:(T,R)=>A("push",T,R),replaceState:(T,R)=>A("replace",T,R),back:T=>(T&&(y=!0),S=!0,t.history.back()),forward:T=>{T&&(y=!0),S=!0,t.history.forward()},go:T=>{g=!0,t.history.go(T)},createHref:T=>c(T),flush:E,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Gk,z,{capture:!0}),t.removeEventListener(Hk,P)},onBlocked:()=>{p&&h!==p&&(h=p)},getBlockers:s,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(Gk,z,{capture:!0}),t.addEventListener(Hk,P),t.history.pushState=function(...T){const R=n.apply(t.history,T);return _._ignoreSubscribers||O("PUSH"),R},t.history.replaceState=function(...T){const R=r.apply(t.history,T);return _._ignoreSubscribers||O("REPLACE"),R},_}function dq(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function cm(e,t){const n=dq(e),r=n.indexOf("#"),i=n.indexOf("?"),s=XS();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||{[Rs]:0,key:s,__TSR_key:s}}}function XS(){return(Math.random()+1).toString(36).substring(7)}function Ko(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 fq(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var hq=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=t=>t(),this.update=t=>{const n=this.options,r=this.basepath??n?.basepath??"/",i=this.basepath===void 0,s=n?.rewrite;if(this.options={...n,...t},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=C8(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=uq()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let h;this.resolvePathCache=am(1e3),h=this.buildRouteTree(),this.setRoutes(h)}!this.__store&&this.latestLocation&&(this.__store=nq(mq(this.latestLocation)),P8(this));let l=!1;const c=this.options.basepath??"/",f=this.options.rewrite;if(i||r!==c||s!==f){this.basepath=c;const h=[],p=kM(c);p&&p!=="/"&&h.push(B8({basepath:c})),f&&h.push(f),this.rewrite=h.length===0?void 0:h.length===1?h[0]:U8(h),this.history&&this.updateLatestLocation(),l=!0}l&&this.__store&&this.__store.setState(h=>({...h,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=b8(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&p8(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,n)=>{const r={eventType:t,fn:n};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=t=>{this.subscribers.forEach(n=>{n.eventType===t.type&&n.fn(t)})},this.parseLocation=(t,n)=>{const r=({pathname:c,search:f,hash:h,href:p,state:g})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const N=this.options.parseSearch(f),C=this.options.stringifySearch(N);return{href:c+C+h,publicHref:p,pathname:id(c).path,external:!1,searchStr:C,search:bo(n?.search,N),hash:id(h.slice(1)).path,state:To(n?.state,g)}}const v=new URL(p,this.origin),y=pw(this.rewrite,v),S=this.options.parseSearch(y.search),w=this.options.stringifySearch(S);return y.search=w,{href:y.href.replace(y.origin,""),publicHref:p,pathname:id(y.pathname).path,external:!!this.rewrite&&y.origin!==this.origin,searchStr:w,search:bo(n?.search,S),hash:id(y.hash.slice(1)).path,state:To(n?.state,g)}},i=r(t),{__tempLocation:s,__tempKey:l}=i.state;if(s&&(!l||l===this.tempLocationKey)){const c=r(s);return c.state.key=i.state.key,c.state.__TSR_key=i.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:i}}return i},this.resolvePathWithBase=(t,n)=>N8({base:t,to:ZS(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=>gq({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const n=this.getMatch(t);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(r=>r.status==="pending"),n=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...n]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=t=>{const n=(i={})=>{const s=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,l=this.matchRoutesLightweight(s);i.from;const c=i.unsafeRelative==="path"?s.pathname:i.from??l.fullPath,f=this.resolvePathWithBase(c,"."),h=l.search,p=Object.assign(Object.create(null),l.params),g=i.to?this.resolvePathWithBase(f,`${i.to}`):this.resolvePathWithBase(f,"."),v=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?p:Object.assign(p,ks(i.params,p)),y=this.getMatchedRoutes(g);let S=y.matchedRoutes;if((!y.foundRoute||y.foundRoute.path!=="/"&&y.routeParams["**"])&&this.options.notFoundRoute&&(S=[...S,this.options.notFoundRoute]),Object.keys(v).length>0)for(const R of S){const B=R.options.params?.stringify??R.options.stringifyParams;if(B)try{Object.assign(v,B(v))}catch{}}const w=t.leaveParams?g:id(Dk({path:g,params:v,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let N=h;if(t._includeValidateSearch&&this.options.search?.strict){const R={};S.forEach(B=>{if(B.options.validateSearch)try{Object.assign(R,qp(B.options.validateSearch,{...R,...N}))}catch{}}),N=R}N=vq({search:N,dest:i,destRoutes:S,_includeValidateSearch:t._includeValidateSearch}),N=bo(h,N);const C=this.options.stringifySearch(N),E=i.hash===!0?s.hash:i.hash?ks(i.hash,s.hash):void 0,A=E?`#${E}`:"";let O=i.state===!0?s.state:i.state?ks(i.state,s.state):{};O=To(s.state,O);const P=`${w}${C}${A}`;let z,_,T=!1;if(this.rewrite){const R=new URL(P,this.origin),B=AM(this.rewrite,R);z=R.href.replace(R.origin,""),B.origin!==this.origin?(_=B.href,T=!0):_=B.pathname+B.search+B.hash}else z=d8(P),_=z;return{publicHref:_,href:z,pathname:w,search:N,searchStr:C,state:O,hash:E??"",external:T,unmaskOnReload:i.unmaskOnReload}},r=(i={},s)=>{const l=n(i);let c=s?n(s):void 0;if(!c){const f=Object.create(null);if(this.options.routeMasks){const h=m8(l.pathname,this.processedTree);if(h){Object.assign(f,h.rawParams);const{from:p,params:g,...v}=h.route,y=g===!1||g===null?Object.create(null):(g??!0)===!0?f:Object.assign(f,ks(g,f));s={from:t.from,...v,params:y},c=n(s)}}}return c&&(l.maskedLocation=c),l};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:n,...r})=>{const i=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(h=>{r.state[h]=this.latestLocation.state[h]});const f=Bo(r.state,this.latestLocation.state);return c.forEach(h=>{delete r.state[h]}),f},s=Ms(this.latestLocation.href)===Ms(r.href);let l=this.commitLocationPromise;if(this.commitLocationPromise=Pc(()=>{l?.resolve(),l=void 0}),s&&i())this.load();else{let{maskedLocation:c,hashScrollIntoView:f,...h}=r;c&&(h={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[r.replace?"replace":"push"](h.publicHref,h.state,{ignoreBlocker:n})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:n,hashScrollIntoView:r,viewTransition:i,ignoreBlocker:s,href:l,...c}={})=>{if(l){const p=this.history.location.state.__TSR_index,g=cm(l,{__TSR_index:t?p:p+1}),v=new URL(g.pathname,this.origin);c.to=pw(this.rewrite,v).pathname,c.search=this.options.parseSearch(g.search),c.hash=g.hash.slice(1)}const f=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const h=this.commitLocation({...f,viewTransition:i,replace:t,resetScroll:n,hashScrollIntoView:r,ignoreBlocker:s});return Promise.resolve().then(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),h},this.navigate=async({to:t,reloadDocument:n,href:r,publicHref:i,...s})=>{let l=!1;if(r)try{new URL(`${r}`),l=!0}catch{}if(l&&!n&&(n=!0),n){if(t!==void 0||!r){const f=this.buildLocation({to:t,...s});r=r??f.publicHref,i=i??f.publicHref}const c=!l&&i?i:r;if(im(c,this.protocolAllowlist))return Promise.resolve();if(!s.ignoreBlocker){const f=this.history.getBlockers?.()??[];for(const h of f)if(h?.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return s.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...s,href:r,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:n.cachedMatches.filter(r=>!t.some(i=>i.id===r.id))}))},this.load=async t=>{let n,r,i;const s=this.state.resolvedLocation??this.state.location;for(i=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad();const f=this.latestLocation,h=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Ko({resolvedLocation:h,location:f})}),this.emit({type:"onBeforeLoad",...Ko({resolvedLocation:h,location:f})}),await Fk({router:this,sync:t?.sync,forceStaleReload:s.href===f.href,matches:this.state.pendingMatches,location:f,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],g=[],v=[],y=[];Ad(()=>{this.__store.setState(S=>{const w=S.matches,N=S.pendingMatches||S.matches;return p=w.filter(C=>!N.some(E=>E.id===C.id)),g=w.filter(C=>!N.some(E=>E.routeId===C.routeId)),v=N.filter(C=>!w.some(E=>E.routeId===C.routeId)),y=N.filter(C=>w.some(E=>E.routeId===C.routeId)),{...S,isLoading:!1,loadedAt:Date.now(),matches:N,pendingMatches:void 0,cachedMatches:[...S.cachedMatches,...p.filter(C=>C.status!=="error"&&C.status!=="notFound"&&C.status!=="redirected")]}}),this.clearExpiredCache()}),[[g,"onLeave"],[v,"onEnter"],[y,"onStay"]].forEach(([S,w])=>{S.forEach(N=>{this.looseRoutesById[N.routeId].options[w]?.(N)})})})})}})}catch(f){gr(f)?(n=f,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):rr(f)&&(r=f),this.__store.setState(h=>({...h,statusCode:n?n.status:r?404:h.matches.some(p=>p.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),c()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(c=>c.status==="error")&&(l=500),l!==void 0&&this.__store.setState(c=>({...c,statusCode:l}))},this.startViewTransition=t=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,s=this.state.resolvedLocation,l=typeof n.types=="function"?n.types(Ko({resolvedLocation:s,location:i})):n.types;if(l===!1){t();return}r={update:t,types:l}}else r=t;document.startViewTransition(r)}else t()},this.updateMatch=(t,n)=>{this.startTransition(()=>{const r=this.state.pendingMatches?.some(i=>i.id===t)?"pendingMatches":this.state.matches.some(i=>i.id===t)?"matches":this.state.cachedMatches.some(i=>i.id===t)?"cachedMatches":"";r&&(r==="cachedMatches"?this.__store.setState(i=>({...i,cachedMatches:fq(i.cachedMatches.map(s=>s.id===t?n(s):s))})):this.__store.setState(i=>({...i,[r]:i[r]?.map(s=>s.id===t?n(s):s)})))})},this.getMatch=t=>{const n=r=>r.id===t;return this.state.cachedMatches.find(n)??this.state.pendingMatches?.find(n)??this.state.matches.find(n)},this.invalidate=t=>{const n=r=>t?.filter?.(r)??!0?{...r,invalid:!0,...t?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r;return this.__store.setState(r=>({...r,matches:r.matches.map(n),cachedMatches:r.cachedMatches.map(n),pendingMatches:r.pendingMatches?.map(n)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const n=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const r=t.options._builtLocation??this.buildLocation(t.options),i=this.getParsedLocationHref(r);t.options.href=i,t.headers.set("Location",i)}else if(n)try{const r=new URL(n);if(this.origin&&r.origin===this.origin){const i=r.pathname+r.search+r.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}if(t.options.href&&!t.options._builtLocation&&im(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=Ld,this.preloadRoute=async t=>{const n=t._builtLocation??this.buildLocation(t);let r=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:t});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(l=>l.id)),s=new Set([...i,...this.state.cachedMatches.map(l=>l.id)]);Ad(()=>{r.forEach(l=>{s.has(l.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,l]}))})});try{return r=await Fk({router:this,matches:r,location:n,preload:!0,updateMatch:(l,c)=>{i.has(l)?r=r.map(f=>f.id===l?c(f):f):this.updateMatch(l,c)}}),r}catch(l){if(gr(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:n});rr(l)||console.error(l);return}},this.matchRoute=(t,n)=>{const r={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(r);if(n?.pending&&this.state.status!=="pending")return!1;const s=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=g8(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,s.pathname,this.processedTree);return!l||t.params&&!Bo(l.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?Bo(s.search,i.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??I8,parseSearch:e.parseSearch??D8,protocolAllowlist:e.protocolAllowlist??u8}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:s}=n;let{matchedRoutes:l}=n,c=!1;(r?r.path!=="/"&&i["**"]:Ms(e.pathname))&&(this.options.notFoundRoute?l=[...l,this.options.notFoundRoute]:c=!0);const f=c?bq(this.options.notFoundMode,l):void 0,h=new Array(l.length),p=new Map(this.state.matches.map(g=>[g.routeId,g]));for(let g=0;g<l.length;g++){const v=l[g],y=h[g-1];let S,w,N;{const ne=y?.search??e.search,he=y?._strictSearch??void 0;try{const ge=qp(v.options.validateSearch,{...ne})??void 0;S={...ne,...ge},w={...he,...ge},N=void 0}catch(ge){let H=ge;if(ge instanceof um||(H=new um(ge.message,{cause:ge})),t?.throwOnError)throw H;S=ne,w={},N=H}}const C=v.options.loaderDeps?.({search:S})??"",E=C?JSON.stringify(C):"",{interpolatedPath:A,usedParams:O}=Dk({path:v.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),P=v.id+A+E,z=this.getMatch(P),_=p.get(v.id),T=z?._strictParams??O;let R;if(!z)try{Zk(v,O,s,T)}catch(ne){if(rr(ne)||gr(ne)?R=ne:R=new pq(ne.message,{cause:ne}),t?.throwOnError)throw R}Object.assign(i,T);const B=_?"stay":"enter";let $;if(z)$={...z,cause:B,params:_?.params??i,_strictParams:T,search:bo(_?_.search:z.search,S),_strictSearch:w};else{const ne=v.options.loader||v.options.beforeLoad||v.lazyFn||LM(v)?"pending":"success";$={id:P,ssr:v.options.ssr,index:g,routeId:v.id,params:_?.params??i,_strictParams:T,pathname:A,updatedAt:Date.now(),search:_?bo(_.search,S):S,_strictSearch:w,searchError:void 0,status:ne,isFetching:!1,error:void 0,paramsError:R,__routeContext:void 0,_nonReactive:{loadPromise:Pc()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:B,loaderDeps:_?To(_.loaderDeps,C):C,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:v.options.staticData||{},fullPath:v.fullPath}}t?.preload||($.globalNotFound=f===v.id),$.searchError=N;const L=this.getParentContext(y);$.context={...L,...$.__routeContext,...$.__beforeLoadContext},h[g]=$}for(let g=0;g<h.length;g++){const v=h[g],y=this.looseRoutesById[v.routeId],S=this.getMatch(v.id),w=p.get(v.routeId);if(v.params=w?bo(w.params,i):i,!S){const N=h[g-1],C=this.getParentContext(N);if(y.options.context){const E={deps:v.loaderDeps,params:v.params,context:C??{},location:e,navigate:A=>this.navigate({...A,_fromLocation:e}),buildLocation:this.buildLocation,cause:v.cause,abortController:v.abortController,preload:!!v.preload,matches:h,routeId:y.id};v.__routeContext=y.options.context(E)??void 0}v.context={...C,...v.__routeContext,...v.__beforeLoadContext}}}return h}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=Dd(t),s={...e.search};for(const h of t)try{Object.assign(s,qp(h.options.validateSearch,s))}catch{}const l=Dd(this.state.matches),c=l&&l.routeId===i.id&&e.pathname===this.state.location.pathname;let f;if(c)f=l.params;else{const h=Object.assign(Object.create(null),n);for(const p of t)try{Zk(p,n,r??{},h)}catch{}f=h}return{matchedRoutes:t,fullPath:i.fullPath,search:s,params:f}}},um=class extends Error{},pq=class extends Error{};function mq(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function qp(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new um("Async validation not supported");if(n.issues)throw new um(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 gq({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=Ms(e);let s,l;const c=v8(i,n,!0);return c&&(s=c.route,Object.assign(r,c.rawParams),l=Object.assign(Object.create(null),c.parsedParams)),{matchedRoutes:c?.branch||[t.__root__],routeParams:r,foundRoute:s,parsedParams:l}}function vq({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return yq(n)(e,t,r??!1)}function yq(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const s=({search:l,next:c})=>{let f=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(f=i.options.preSearchFilters.reduce((p,g)=>g(p),l));const h=c(f);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((p,g)=>g(p),h):h};t.middlewares.push(s)}if(i.options.validateSearch){const s=({search:l,next:c})=>{const f=c(l);if(!t._includeValidateSearch)return f;try{return{...f,...qp(i.options.validateSearch,f)??void 0}}catch{return f}};t.middlewares.push(s)}}const n=({search:i})=>{const s=t.dest;return s.search?s.search===!0?i:ks(s.search,i):{}};t.middlewares.push(n);const r=(i,s,l)=>{if(i>=l.length)return s;const c=l[i];return c({search:s,next:h=>r(i+1,h,l)})};return function(s,l,c){return t.dest=l,t._includeValidateSearch=c,r(0,s,t.middlewares)}}function bq(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 qo}function Zk(e,t,n,r){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const s in t)s in n&&(r[s]=n[s]);else{const s=i(r);Object.assign(r,s)}}var xq="Error preloading route! ☝️",$M=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=qo:this.parentRoute||Us(!1);let i=r?qo:n?.path;i&&i!=="/"&&(i=_M(i));const s=n?.id||i;let l=r?qo:$p([this.parentRoute.id==="__root__"?"":this.parentRoute.id,s]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=$p(["/",l]));const c=l==="__root__"?"/":$p([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=c,this._to=Ms(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=>YS({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.")}},wq=class extends $M{constructor(e){super(e)}};function JS(e){const t=e.errorComponent??e1;return u.jsx(Sq,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?x.createElement(t,{error:n,reset:r}):e.children})}var Sq=class extends x.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}};function e1({error:e}){const[t,n]=x.useState(!1);return u.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[u.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),u.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),u.jsx("div",{style:{height:".25rem"}}),t?u.jsx("div",{children:u.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?u.jsx("code",{children:e.message}):null})}):null]})}function jq({children:e,fallback:t=null}){return UM()?u.jsx(wi.Fragment,{children:e}):u.jsx(wi.Fragment,{children:t})}function UM(){return wi.useSyncExternalStore(Nq,()=>!0,()=>!1)}function Nq(){return()=>{}}var BM=x.createContext(null);function ci(e){const t=x.useContext(BM);return e?.warn,t}var ob={exports:{}},lb={},cb={exports:{}},ub={};var Yk;function Cq(){if(Yk)return ub;Yk=1;var e=Vc();function t(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,s=e.useLayoutEffect,l=e.useDebugValue;function c(g,v){var y=v(),S=r({inst:{value:y,getSnapshot:v}}),w=S[0].inst,N=S[1];return s(function(){w.value=y,w.getSnapshot=v,f(w)&&N({inst:w})},[g,y,v]),i(function(){return f(w)&&N({inst:w}),g(function(){f(w)&&N({inst:w})})},[g]),l(y),y}function f(g){var v=g.getSnapshot;g=g.value;try{var y=v();return!n(g,y)}catch{return!0}}function h(g,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return ub.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,ub}var Wk;function Oq(){return Wk||(Wk=1,cb.exports=Cq()),cb.exports}var Qk;function _q(){if(Qk)return lb;Qk=1;var e=Vc(),t=Oq();function n(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,l=e.useEffect,c=e.useMemo,f=e.useDebugValue;return lb.useSyncExternalStoreWithSelector=function(h,p,g,v,y){var S=s(null);if(S.current===null){var w={hasValue:!1,value:null};S.current=w}else w=S.current;S=c(function(){function C(z){if(!E){if(E=!0,A=z,z=v(z),y!==void 0&&w.hasValue){var _=w.value;if(y(_,z))return O=_}return O=z}if(_=O,r(A,z))return _;var T=v(z);return y!==void 0&&y(_,T)?(A=z,_):(A=z,O=T)}var E=!1,A,O,P=g===void 0?null:g;return[function(){return C(p())},P===null?void 0:function(){return C(P())}]},[p,g,v,y]);var N=i(h,S[0],S[1]);return l(function(){w.hasValue=!0,w.value=N},[N]),f(N),N},lb}var Xk;function kq(){return Xk||(Xk=1,ob.exports=_q()),ob.exports}var qM=kq();function Aq(e,t){return e===t}function Eq(e,t,n=Aq){const r=x.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(l);return c},[e]),i=x.useCallback(()=>e?.get(),[e]);return qM.useSyncExternalStoreWithSelector(r,i,i,t,n)}function br(e){const t=ci({warn:e?.router===void 0}),n=e?.router||t,r=x.useRef(void 0);return Eq(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const s=To(r.current,e.select(i));return r.current=s,s}return e.select(i)}return i})}var Ng=x.createContext(void 0),Tq=x.createContext(void 0);function Gs(e){const t=x.useContext(e.from?Tq:Ng);return br({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(Us(!((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 t1(e){return Gs({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function n1(e){const{select:t,...n}=e;return Gs({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Cg(e){return Gs({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 Og(e){return Gs({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Vs(e){const t=ci();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function r1(e){return Gs({...e,select:t=>e.select?e.select(t.context):t.context})}var cl=lM();const Pq=Ks(cl);function zq(e,t){const n=ci(),r=i8(t),{activeProps:i,inactiveProps:s,activeOptions:l,to:c,preload:f,preloadDelay:h,hashScrollIntoView:p,replace:g,startTransition:v,resetScroll:y,viewTransition:S,children:w,target:N,disabled:C,style:E,className:A,onClick:O,onBlur:P,onFocus:z,onMouseEnter:_,onMouseLeave:T,onTouchStart:R,ignoreBlocker:B,params:$,search:L,hash:ne,state:he,mask:ge,reloadDocument:H,unsafeRelative:ie,from:pe,_fromLocation:we,...q}=e,D=UM(),G=br({select:Xe=>{const Je=Xe.matches[Xe.matches.length-1];return{search:Je?.search,hash:Xe.location.hash,path:Je?.pathname}},structuralSharing:!0}),ae=e.from,Y=x.useMemo(()=>({...e,from:ae}),[n,G,ae,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),W=x.useMemo(()=>n.buildLocation({...Y}),[n,Y]),oe=W.maskedLocation?W.maskedLocation.publicHref:W.publicHref,xe=W.maskedLocation?W.maskedLocation.external:W.external,Se=x.useMemo(()=>$q(oe,xe,n.history,C),[C,xe,oe,n.history]),Q=x.useMemo(()=>{if(Se?.external)return im(Se.href,n.protocolAllowlist)?void 0:Se.href;if(!Uq(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),im(c,n.protocolAllowlist)?void 0:c}catch{}},[c,Se,n.protocolAllowlist]),le=br({select:Xe=>{if(Q)return!1;if(l?.exact){if(!j8(Xe.location.pathname,W.pathname,n.basepath))return!1}else{const Je=sm(Xe.location.pathname,n.basepath),Rt=sm(W.pathname,n.basepath);if(!(Je.startsWith(Rt)&&(Je.length===Rt.length||Je[Rt.length]==="/")))return!1}return(l?.includeSearch??!0)&&!Bo(Xe.location.search,W.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?D&&Xe.location.hash===W.hash:!0}}),je=le?ks(i,{})??Mq:db,V=le?db:ks(s,{})??db,De=[A,je.className,V.className].filter(Boolean).join(" "),Ee=(E||je.style||V.style)&&{...E,...je.style,...V.style},[tt,ve]=x.useState(!1),Le=x.useRef(!1),Fe=e.reloadDocument||Q?!1:f??n.options.defaultPreload,Be=h??n.options.defaultPreloadDelay??0,fe=x.useCallback(()=>{n.preloadRoute({...Y,_builtLocation:W}).catch(Xe=>{console.warn(Xe),console.warn(xq)})},[n,Y,W]);r8(r,x.useCallback(Xe=>{Xe?.isIntersecting&&fe()},[fe]),Lq,{disabled:!!C||Fe!=="viewport"}),x.useEffect(()=>{Le.current||!C&&Fe==="render"&&(fe(),Le.current=!0)},[C,fe,Fe]);const Ge=Xe=>{const Je=Xe.currentTarget.getAttribute("target"),Rt=N!==void 0?N:Je;if(!C&&!Bq(Xe)&&!Xe.defaultPrevented&&(!Rt||Rt==="_self")&&Xe.button===0){Xe.preventDefault(),cl.flushSync(()=>{ve(!0)});const cr=n.subscribe("onResolved",()=>{cr(),ve(!1)});n.navigate({...Y,replace:g,resetScroll:y,hashScrollIntoView:p,startTransition:v,viewTransition:S,ignoreBlocker:B})}};if(Q)return{...q,ref:r,href:Q,...w&&{children:w},...N&&{target:N},...C&&{disabled:C},...E&&{style:E},...A&&{className:A},...O&&{onClick:O},...P&&{onBlur:P},...z&&{onFocus:z},..._&&{onMouseEnter:_},...T&&{onMouseLeave:T},...R&&{onTouchStart:R}};const Ke=Xe=>{if(C||Fe!=="intent")return;if(!Be){fe();return}const Je=Xe.currentTarget;if(od.has(Je))return;const Rt=setTimeout(()=>{od.delete(Je),fe()},Be);od.set(Je,Rt)},Ft=Xe=>{C||Fe!=="intent"||fe()},nt=Xe=>{if(C||!Fe||!Be)return;const Je=Xe.currentTarget,Rt=od.get(Je);Rt&&(clearTimeout(Rt),od.delete(Je))};return{...q,...je,...V,href:Se?.href,ref:r,onClick:nc([O,Ge]),onBlur:nc([P,nt]),onFocus:nc([z,Ke]),onMouseEnter:nc([_,Ke]),onMouseLeave:nc([T,nt]),onTouchStart:nc([R,Ft]),disabled:!!C,target:N,...Ee&&{style:Ee},...De&&{className:De},...C&&Rq,...le&&Dq,...D&&tt&&Iq}}var db={},Mq={className:"active"},Rq={role:"link","aria-disabled":!0},Dq={"data-status":"active","aria-current":"page"},Iq={"data-transitioning":"transitioning"},od=new WeakMap,Lq={rootMargin:"100px"},nc=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function $q(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function Uq(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Lt=x.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...s}=zq(r,t),l=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){const{disabled:c,...f}=s;return x.createElement("a",f,l)}return x.createElement(n,s,l)});function Bq(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var qq=class extends $M{constructor(e){super(e),this.useMatch=t=>Gs({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>r1({...t,from:this.id}),this.useSearch=t=>Og({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Cg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>n1({...t,from:this.id}),this.useLoaderData=t=>t1({...t,from:this.id}),this.useNavigate=()=>Vs({from:this.fullPath}),this.Link=wi.forwardRef((t,n)=>u.jsx(Lt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function ui(e){return new qq(e)}function Fq(){return e=>Hq(e)}var Kq=class extends wq{constructor(e){super(e),this.useMatch=t=>Gs({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>r1({...t,from:this.id}),this.useSearch=t=>Og({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Cg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>n1({...t,from:this.id}),this.useLoaderData=t=>t1({...t,from:this.id}),this.useNavigate=()=>Vs({from:this.fullPath}),this.Link=wi.forwardRef((t,n)=>u.jsx(Lt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Hq(e){return new Kq(e)}function Jk(e){return typeof e=="object"?new eA(e,{silent:!0}).createRoute(e):new eA(e,{silent:!0}).createRoute}var eA=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=ui(n);return r.isRoot=!1,r},this.silent=t?.silent}},tA=class{constructor(e){this.useMatch=t=>Gs({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>r1({...t,from:this.options.id}),this.useSearch=t=>Og({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Cg({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>n1({...t,from:this.options.id}),this.useLoaderData=t=>t1({...t,from:this.options.id}),this.useNavigate=()=>Vs({from:ci().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function nA(e){return typeof e=="object"?new tA(e):t=>new tA({id:e,...t})}function Gq(e){const t=br({select:n=>`not-found-${n.location.pathname}-${n.status}`});return u.jsx(JS,{getResetKey:()=>t,onCatch:(n,r)=>{if(rr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(rr(n))return e.fallback?.(n);throw n},children:e.children})}function Vq(){return u.jsx("p",{children:"Not Found"})}function mc(e){return u.jsx(u.Fragment,{children:e.children})}function FM(e,t,n){return t.options.notFoundComponent?u.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?u.jsx(e.options.defaultNotFoundComponent,{...n}):u.jsx(Vq,{})}function Zq(){return ci().isScrollRestoring,null}var KM=x.memo(function({matchId:t}){const n=ci(),r=br({select:S=>{const w=S.matches.findIndex(C=>C.id===t),N=S.matches[w];return Us(N),{routeId:N.routeId,ssr:N.ssr,_displayPending:N._displayPending,resetKey:S.loadedAt,parentRouteId:S.matches[w-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],s=i.options.pendingComponent??n.options.defaultPendingComponent,l=s?u.jsx(s,{}):null,c=i.options.errorComponent??n.options.defaultErrorComponent,f=i.options.onCatch??n.options.defaultOnCatch,h=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",g=(!i.isRoot||i.options.wrapInSuspense||p)&&(i.options.wrapInSuspense??s??(i.options.errorComponent?.preload||p))?x.Suspense:mc,v=c?JS:mc,y=h?Gq:mc;return u.jsxs(i.isRoot?i.options.shellComponent??mc:mc,{children:[u.jsx(Ng.Provider,{value:t,children:u.jsx(g,{fallback:l,children:u.jsx(v,{getResetKey:()=>r.resetKey,errorComponent:c||e1,onCatch:(S,w)=>{if(rr(S))throw S;f?.(S,w)},children:u.jsx(y,{fallback:S=>{if(!h||S.routeId&&S.routeId!==r.routeId||!S.routeId&&!i.isRoot)throw S;return x.createElement(h,S)},children:p||r._displayPending?u.jsx(jq,{fallback:l,children:u.jsx(rA,{matchId:t})}):u.jsx(rA,{matchId:t})})})})}),r.parentRouteId===qo&&n.options.scrollRestoration?u.jsxs(u.Fragment,{children:[u.jsx(Yq,{}),u.jsx(Zq,{})]}):null]})});function Yq(){const e=ci(),t=x.useRef(void 0);return u.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Ko(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var rA=x.memo(function({matchId:t}){const n=ci(),{match:r,key:i,routeId:s}=br({select:f=>{const h=f.matches.find(v=>v.id===t),p=h.routeId,g=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:p,match:{id:h.id,status:h.status,error:h.error,_forcePending:h._forcePending,_displayPending:h._displayPending}}},structuralSharing:!0}),l=n.routesById[s],c=x.useMemo(()=>{const f=l.options.component??n.options.defaultComponent;return f?u.jsx(f,{},i):u.jsx(i1,{})},[i,l.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const f=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(f){const h=n.getMatch(r.id);if(h&&!h._nonReactive.minPendingPromise){const p=Pc();h._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),h._nonReactive.minPendingPromise=void 0},f)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return Us(rr(r.error)),FM(n,l,r.error);if(r.status==="redirected")throw Us(gr(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return c}),i1=x.memo(function(){const t=ci(),n=x.useContext(Ng),r=br({select:h=>h.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],s=br({select:h=>{const p=h.matches.find(g=>g.id===n);return Us(p),p.globalNotFound}}),l=br({select:h=>{const p=h.matches;return p[p.findIndex(g=>g.id===n)+1]?.id}}),c=t.options.defaultPendingComponent?u.jsx(t.options.defaultPendingComponent,{}):null;if(s)return FM(t,i,void 0);if(!l)return null;const f=u.jsx(KM,{matchId:l});return r===qo?u.jsx(x.Suspense,{fallback:c,children:f}):f});function Wq(){const e=ci(),t=x.useRef({router:e,mounted:!1}),[n,r]=x.useState(!1),{hasPendingMatches:i,isLoading:s}=br({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(v=>v.status==="pending")}),structuralSharing:!0}),l=tb(s),c=s||n||i,f=tb(c),h=s||i,p=tb(h);return e.startTransition=g=>{r(!0),x.startTransition(()=>{g(),r(!1)})},x.useEffect(()=>{const g=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ms(e.latestLocation.publicHref)!==Ms(v.publicHref)&&e.commitLocation({...v,replace:!0}),()=>{g()}},[e,e.history]),tp(()=>{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(v){console.error(v)}})()},[e]),tp(()=>{l&&!s&&e.emit({type:"onLoad",...Ko(e.state)})},[l,e,s]),tp(()=>{p&&!h&&e.emit({type:"onBeforeRouteMount",...Ko(e.state)})},[h,p,e]),tp(()=>{if(f&&!c){const g=Ko(e.state);e.emit({type:"onResolved",...g}),e.__store.setState(v=>({...v,status:"idle",resolvedLocation:v.location})),g.hrefChanged&&z8(e)}},[c,f,e]),null}function Qq(){const e=ci(),t=e.routesById[qo].options.pendingComponent??e.options.defaultPendingComponent,n=t?u.jsx(t,{}):null,r=u.jsxs(typeof document<"u"&&e.ssr?mc:x.Suspense,{fallback:n,children:[u.jsx(Wq,{}),u.jsx(Xq,{})]});return e.options.InnerWrap?u.jsx(e.options.InnerWrap,{children:r}):r}function Xq(){const e=ci(),t=br({select:i=>i.matches[0]?.id}),n=br({select:i=>i.loadedAt}),r=t?u.jsx(KM,{matchId:t}):null;return u.jsx(Ng.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:u.jsx(JS,{getResetKey:()=>n,errorComponent:e1,onCatch:void 0,children:r})})}var Jq=e=>new e9(e),e9=class extends hq{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=Jk,globalThis.createLazyFileRoute=nA):typeof window<"u"&&(window.createFileRoute=Jk,window.createLazyFileRoute=nA);function t9({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(BM.Provider,{value:e,children:t});return e.options.Wrap?u.jsx(e.options.Wrap,{children:r}):r}function n9({router:e,...t}){return u.jsx(t9,{router:e,...t,children:u.jsx(Qq,{})})}function r9(e){return br({select:t=>t.location})}class $d extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function i9(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const a9=i9();function s9(){return""}function iA(){return!!s9()}async function Ce(e,t){const n=await fetch(`${a9}${e}`,{...t,credentials:t?.credentials??"same-origin",headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const r=await n.text();let i=`API ${n.status}: ${n.statusText}`,s;if(r)try{const l=JSON.parse(r);typeof l.error=="string"?i=l.error:l.error?.message?(i=l.error.message,s=l.error.code):l.message&&(i=l.message)}catch{i=r}throw new $d(i,n.status,s)}if(n.status!==204)return n.json()}function HM(){return Ce("/projects")}function GM(e){return Ce(`/projects/${encodeURIComponent(e)}`)}function VM(){return Ce("/runs")}function zc(e){return Ce(`/runs/${encodeURIComponent(e)}`)}function o9(e){return Ce(`/projects/${encodeURIComponent(e)}/keywords`)}function ZM(e){return Ce(`/projects/${encodeURIComponent(e)}/competitors`)}function YM(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const r=n.toString();return Ce(`/projects/${encodeURIComponent(e)}/timeline${r?`?${r}`:""}`)}function _g(e,t){return Ce(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function l9(e,t){return Ce(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function c9(e,t){return Ce(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function WM(e,t){return Ce(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function aA(e,t){const n=await GM(e);return _g(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 u9(e,t){const n=await GM(e);return _g(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 d9(e,t){const n={};return t?.location&&(n.location=t.location),t?.allLocations&&(n.allLocations=!0),t?.noLocation&&(n.noLocation=!0),Ce(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function f9(e,t){return Ce(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function h9(e,t){await Ce(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function p9(e,t){return Ce(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function m9(e){await Ce(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function g9(e){return Ce(`/projects/${encodeURIComponent(e)}/export`)}function a1(){return Ce("/settings")}function v9(){return Ce("/session")}function y9(e){return Ce("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function b9(e){return Ce("/session",{method:"POST",body:JSON.stringify({password:e})})}function x9(e,t){return Ce(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function w9(e){return Ce("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function S9(e){try{return await Ce(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof $d&&t.statusCode===404)return null;throw t}}function sA(e,t){return Ce(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function j9(e){await Ce(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function N9(e){return Ce(`/projects/${encodeURIComponent(e)}/notifications`)}function C9(e,t){return Ce(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function O9(e,t){await Ce(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function _9(e,t){return Ce(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function k9(e,t,n){return Ce(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function A9(e){return Ce("/apply",{method:"POST",body:JSON.stringify(e)})}function E9(e){return Ce("/runs",{method:"POST",body:JSON.stringify(e??{})})}function QM(e){return Ce(`/projects/${encodeURIComponent(e)}/google/connections`)}function T9(e,t){return Ce(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function P9(e,t){return Ce(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function z9(e){return Ce(`/projects/${encodeURIComponent(e)}/google/properties`)}function M9(e,t,n){return Ce(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function R9(e,t,n){return Ce(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function XM(e,t){return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function D9(e,t){const n=new URLSearchParams;t?.startDate&&n.set("startDate",t.startDate),t?.endDate&&n.set("endDate",t.endDate),t?.query&&n.set("query",t.query),t?.page&&n.set("page",t.page),t?.limit!==void 0&&n.set("limit",String(t.limit));const r=n.toString()?`?${n.toString()}`:"";return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/performance${r}`)}function I9(e,t){return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function L9(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 Ce(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${r}`)}function $9(e){return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function s1(e){return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function U9(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function B9(e,t){return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function q9(e){return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function F9(e){return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function oA(){return Ce("/cdp/status")}function K9(e,t){return Ce("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function lA(e,t){return Ce(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function JM(e){return Ce(`/projects/${encodeURIComponent(e)}/bing/status`)}function H9(e,t){return Ce(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function G9(e){return Ce(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function V9(e){return Ce(`/projects/${encodeURIComponent(e)}/bing/sites`)}function Z9(e,t){return Ce(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function o1(e){return Ce(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function eR(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Ce(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function tR(e,t){return Ce(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function cA(e,t){return Ce(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function Y9(e){return Ce(`/projects/${encodeURIComponent(e)}/bing/performance`)}function W9(e){return Ce("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function Q9(e,t){const n=t?`?window=${t}`:"";return Ce(`/projects/${encodeURIComponent(e)}/analytics/metrics${n}`)}function X9(e,t){const n=t?`?window=${t}`:"";return Ce(`/projects/${encodeURIComponent(e)}/analytics/gaps${n}`)}function J9(e,t){const n=t?`?window=${t}`:"";return Ce(`/projects/${encodeURIComponent(e)}/analytics/sources${n}`)}function uA(e){return Ce(`/projects/${encodeURIComponent(e)}/ga/status`)}function dA(e,t){return Ce(`/projects/${encodeURIComponent(e)}/ga/traffic`)}function nR(e,t){return Ce(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function eF(e,t){return Ce(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function fA(e){return Ce(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history`)}function hA(e){return Ce(`/projects/${encodeURIComponent(e)}/ga/session-history`)}function tF(e){return Ce(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function nF(e,t){const n=t?`?runId=${encodeURIComponent(t)}`:"";return Ce(`/projects/${encodeURIComponent(e)}/insights${n}`)}async function rF(e,t){try{const n=await fetch(e);if(!n.ok)return{label:t,state:"error",detail:`HTTP ${n.status}`};const r=await n.json(),i=typeof r.version=="string"?r.version:"unknown",s=typeof r.databaseUrlConfigured=="boolean"?r.databaseUrlConfigured:void 0,l=typeof r.lastHeartbeatAt=="string"?r.lastHeartbeatAt:void 0,c=[i,s===!1?"database not configured":"database configured",l?`heartbeat ${l}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:c,version:i,databaseConfigured:s,lastHeartbeatAt:l}}catch(n){return{label:t,state:"error",detail:n instanceof Error?n.message:"unreachable"}}}const iF=6e3,aF=5,sF=180;let Vn=[],oF=0;const yw=new Set,bw=new Map,xw=new Map;function dm(){const e=[...Vn];for(const t of yw)t(e)}function l1(e){const t=bw.get(e);t&&(clearTimeout(t),bw.delete(e));const n=xw.get(e);n&&(clearTimeout(n),xw.delete(e))}function rR(e){l1(e);const t=Vn.length;Vn=Vn.filter(n=>n.id!==e),Vn.length!==t&&dm()}function pA(e){l1(e.id),bw.set(e.id,setTimeout(()=>{ww(e.id)},e.durationMs))}function lF(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function at(e,t="negative",n=iF){const r=lF(e,t,n),i={id:String(++oF),title:r.title,detail:r.detail,tone:r.tone??t,durationMs:r.durationMs??n,dedupeKey:r.dedupeKey,cta:r.cta,state:"open"};if(r.dedupeKey){const s=Vn.find(l=>l.dedupeKey===r.dedupeKey);if(s){if((r.dedupeMode??"drop")==="drop")return s.id;const l={...s,title:i.title,detail:i.detail,tone:i.tone,durationMs:i.durationMs,cta:i.cta,state:"open"};return Vn=Vn.map(c=>c.id===s.id?l:c),dm(),pA(l),s.id}}return Vn.length>=aF&&rR(Vn[0].id),Vn=[...Vn,i],dm(),pA(i),i.id}function ww(e){const t=Vn.find(n=>n.id===e);!t||t.state==="closing"||(l1(e),Vn=Vn.map(n=>n.id===e?{...n,state:"closing"}:n),dm(),xw.set(e,setTimeout(()=>{rR(e)},sF)))}function cF(e){return yw.add(e),()=>{yw.delete(e)}}function mA(){return Vn}function uF(){return new WB({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new gM({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||at({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const dF=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fF=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),gA=e=>{const t=fF(e);return t.charAt(0).toUpperCase()+t.slice(1)},iR=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),hF=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var pF={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 mF=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:l,...c},f)=>x.createElement("svg",{ref:f,...pF,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:iR("lucide",i),...!s&&!hF(c)&&{"aria-hidden":"true"},...c},[...l.map(([h,p])=>x.createElement(h,p)),...Array.isArray(s)?s:[s]]));const Bn=(e,t)=>{const n=x.forwardRef(({className:r,...i},s)=>x.createElement(mF,{ref:s,iconNode:t,className:iR(`lucide-${dF(gA(e))}`,`lucide-${e}`,r),...i}));return n.displayName=gA(e),n};const gF=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],kg=Bn("chevron-right",gF);const vF=[["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"}]],yF=Bn("download",vF);const bF=[["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"}]],xF=Bn("github",bF);const wF=[["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"}]],SF=Bn("globe",wF);const jF=[["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"}]],NF=Bn("layout-dashboard",jF);const CF=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],OF=Bn("menu",CF);const _F=[["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"}]],kF=Bn("play",_F);const AF=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],vA=Bn("plus",AF);const EF=[["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"}]],yA=Bn("refresh-cw",EF);const TF=[["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"}]],PF=Bn("rocket",TF);const zF=[["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"}]],MF=Bn("rotate-ccw",zF);const RF=[["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"}]],DF=Bn("settings",RF);const IF=[["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"}]],LF=Bn("trash-2",IF);const $F=[["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"}]],UF=Bn("triangle-alert",$F);const BF=[["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"}]],qF=Bn("unplug",BF);const FF=[["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"}]],KF=Bn("upload",FF);const HF=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ag=Bn("x",HF);var Es=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(Es||{});const GF={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},ip={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"};function VF(e){const t=e.match(/^(\[.*?\])\s*(.+)/);if(t){const n=t[1],r=t[2],i=r.indexOf("{");if(i>=0){const s=r.slice(0,i).trim(),l=r.slice(i);try{const c=JSON.parse(l);return`${n} ${s}
|
|
10
|
+
|
|
11
|
+
${JSON.stringify(c,null,2)}`}catch{}}return`${n}
|
|
12
|
+
${r}`}try{const n=JSON.parse(e);return JSON.stringify(n,null,2)}catch{return e}}function Eg(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function xi(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function bA(e){return e===null?"Unknown":e?"Pass":"Fail"}function Sw(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function ZF(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function YF(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 fb(e,t,n){const r=n==="UTC"?"UTC":n.split("/").pop()?.replace(/_/g," ")??n;if(!e)return`Custom: ${t} · ${r}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${r}`;const i=e.match(/^daily(?:@(\d+))?$/);if(i){const l=i[1]?parseInt(i[1]):6;return`Every day at ${Sw(l)} · ${r}`}const s=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(s){const l={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},c=s[2]?parseInt(s[2]):6;return`Every ${l[s[1]]} at ${Sw(c)} · ${r}`}return`${e} · ${r}`}const aR="canonry.run-tracker",jw=new Set;let xA=!1,WF=0,Tg={runs:{},batches:{}};function QF(){const e=Qo();for(const t of jw)t(e)}function XF(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function JF(){typeof window>"u"||window.sessionStorage.setItem(aR,JSON.stringify(Tg))}function sR(){xA||(xA=!0,!(typeof window>"u")&&(Tg=XF(window.sessionStorage.getItem(aR))))}function Pg(e){Tg=e,JF(),QF()}function Qo(){return sR(),Tg}function eK(e){return sR(),jw.add(e),()=>{jw.delete(e)}}function oR(e){const t=Qo();Pg({...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 wA(e){const t=Qo();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;Pg({...t,runs:r})}function tK(e){const t=Qo(),n=`batch_${Date.now()}_${++WF}`;return Pg({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function nK(e){const t=Qo();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;Pg({...t,batches:r})}function rK(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function iK(e,t){let n=0,r=0,i=0,s=0,l=0;for(const c of e){const f=t[c]?.status;f==="completed"?n+=1:f==="partial"?r+=1:f==="failed"?i+=1:f==="cancelled"?s+=1:l+=1}return{completed:n,partial:r,failed:i,cancelled:s,pending:l,finished:l===0}}function SA(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function c1(...e){return t=>{let n=!1;const r=e.map(i=>{const s=SA(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():SA(e[i],null)}}}}function ul(...e){return x.useCallback(c1(...e),e)}var aK=Symbol.for("react.lazy"),fm=xg[" use ".trim().toString()];function sK(e){return typeof e=="object"&&e!==null&&"then"in e}function lR(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===aK&&"_payload"in e&&sK(e._payload)}function oK(e){const t=cK(e),n=x.forwardRef((r,i)=>{let{children:s,...l}=r;lR(s)&&typeof fm=="function"&&(s=fm(s._payload));const c=x.Children.toArray(s),f=c.find(dK);if(f){const h=f.props.children,p=c.map(g=>g===f?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...l,ref:i,children:x.isValidElement(h)?x.cloneElement(h,void 0,p):null})}return u.jsx(t,{...l,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var lK=oK("Slot");function cK(e){const t=x.forwardRef((n,r)=>{let{children:i,...s}=n;if(lR(i)&&typeof fm=="function"&&(i=fm(i._payload)),x.isValidElement(i)){const l=hK(i),c=fK(s,i.props);return i.type!==x.Fragment&&(c.ref=r?c1(r,l):l),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uK=Symbol("radix.slottable");function dK(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uK}function fK(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...c)=>{const f=s(...c);return i(...c),f}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function hK(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 cR(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=cR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function gt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=cR(e))&&(r&&(r+=" "),r+=t);return r}const jA=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,NA=gt,uR=(e,t)=>n=>{var r;if(t?.variants==null)return NA(e,n?.class,n?.className);const{variants:i,defaultVariants:s}=t,l=Object.keys(i).map(h=>{const p=n?.[h],g=s?.[h];if(p===null)return null;const v=jA(p)||jA(g);return i[h][v]}),c=n&&Object.entries(n).reduce((h,p)=>{let[g,v]=p;return v===void 0||(h[g]=v),h},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:g,className:v,...y}=p;return Object.entries(y).every(S=>{let[w,N]=S;return Array.isArray(N)?N.includes({...s,...c}[w]):{...s,...c}[w]===N})?[...h,g,v]:h},[]);return NA(e,l,f,n?.class,n?.className)},pK=(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},mK=(e,t)=>({classGroupId:e,validator:t}),dR=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),hm="-",CA=[],gK="arbitrary..",vK=e=>{const t=bK(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return yK(l);const c=l.split(hm),f=c[0]===""&&c.length>1?1:0;return fR(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=r[l],h=n[l];return f?h?pK(h,f):f:h||CA}return n[l]||CA}}},fR=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],s=n.nextPart.get(i);if(s){const h=fR(e,t+1,s);if(h)return h}const l=n.validators;if(l===null)return;const c=t===0?e.join(hm):e.slice(t).join(hm),f=l.length;for(let h=0;h<f;h++){const p=l[h];if(p.validator(c))return p.classGroupId}},yK=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?gK+r:void 0})(),bK=e=>{const{theme:t,classGroups:n}=e;return xK(n,t)},xK=(e,t)=>{const n=dR();for(const r in e){const i=e[r];u1(i,n,r,t)}return n},u1=(e,t,n,r)=>{const i=e.length;for(let s=0;s<i;s++){const l=e[s];wK(l,t,n,r)}},wK=(e,t,n,r)=>{if(typeof e=="string"){SK(e,t,n);return}if(typeof e=="function"){jK(e,t,n,r);return}NK(e,t,n,r)},SK=(e,t,n)=>{const r=e===""?t:hR(t,e);r.classGroupId=n},jK=(e,t,n,r)=>{if(CK(e)){u1(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(mK(n,e))},NK=(e,t,n,r)=>{const i=Object.entries(e),s=i.length;for(let l=0;l<s;l++){const[c,f]=i[l];u1(f,hR(t,c),n,r)}},hR=(e,t)=>{let n=e;const r=t.split(hm),i=r.length;for(let s=0;s<i;s++){const l=r[s];let c=n.nextPart.get(l);c||(c=dR(),n.nextPart.set(l,c)),n=c}return n},CK=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,OK=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(s,l)=>{n[s]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=r[s])!==void 0)return i(s,l),l},set(s,l){s in n?n[s]=l:i(s,l)}}},Nw="!",OA=":",_K=[],_A=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),kK=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let l=0,c=0,f=0,h;const p=i.length;for(let w=0;w<p;w++){const N=i[w];if(l===0&&c===0){if(N===OA){s.push(i.slice(f,w)),f=w+1;continue}if(N==="/"){h=w;continue}}N==="["?l++:N==="]"?l--:N==="("?c++:N===")"&&c--}const g=s.length===0?i:i.slice(f);let v=g,y=!1;g.endsWith(Nw)?(v=g.slice(0,-1),y=!0):g.startsWith(Nw)&&(v=g.slice(1),y=!0);const S=h&&h>f?h-f:void 0;return _A(s,y,v,S)};if(t){const i=t+OA,s=r;r=l=>l.startsWith(i)?s(l.slice(i.length)):_A(_K,!1,l,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},AK=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let s=0;s<n.length;s++){const l=n[s],c=l[0]==="[",f=t.has(l);c||f?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(l)):i.push(l)}return i.length>0&&(i.sort(),r.push(...i)),r}},EK=e=>({cache:OK(e.cacheSize),parseClassName:kK(e),sortModifiers:AK(e),...vK(e)}),TK=/\s+/,PK=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=t,l=[],c=e.trim().split(TK);let f="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:g,modifiers:v,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:w}=n(p);if(g){f=p+(f.length>0?" "+f:f);continue}let N=!!w,C=r(N?S.substring(0,w):S);if(!C){if(!N){f=p+(f.length>0?" "+f:f);continue}if(C=r(S),!C){f=p+(f.length>0?" "+f:f);continue}N=!1}const E=v.length===0?"":v.length===1?v[0]:s(v).join(":"),A=y?E+Nw:E,O=A+C;if(l.indexOf(O)>-1)continue;l.push(O);const P=i(C,N);for(let z=0;z<P.length;++z){const _=P[z];l.push(A+_)}f=p+(f.length>0?" "+f:f)}return f},zK=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=pR(n))&&(i&&(i+=" "),i+=r);return i},pR=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=pR(e[r]))&&(n&&(n+=" "),n+=t);return n},MK=(e,...t)=>{let n,r,i,s;const l=f=>{const h=t.reduce((p,g)=>g(p),e());return n=EK(h),r=n.cache.get,i=n.cache.set,s=c,c(f)},c=f=>{const h=r(f);if(h)return h;const p=PK(f,n);return i(f,p),p};return s=l,(...f)=>s(zK(...f))},RK=[],yn=e=>{const t=n=>n[e]||RK;return t.isThemeGetter=!0,t},mR=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,gR=/^\((?:(\w[\w-]*):)?(.+)\)$/i,DK=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,IK=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,LK=/\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$/,$K=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,UK=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,BK=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bs=e=>DK.test(e),et=e=>!!e&&!Number.isNaN(Number(e)),xs=e=>!!e&&Number.isInteger(Number(e)),hb=e=>e.endsWith("%")&&et(e.slice(0,-1)),Ca=e=>IK.test(e),vR=()=>!0,qK=e=>LK.test(e)&&!$K.test(e),d1=()=>!1,FK=e=>UK.test(e),KK=e=>BK.test(e),HK=e=>!Te(e)&&!Pe(e),GK=e=>Zs(e,xR,d1),Te=e=>mR.test(e),wo=e=>Zs(e,wR,qK),kA=e=>Zs(e,eH,et),VK=e=>Zs(e,jR,vR),ZK=e=>Zs(e,SR,d1),AA=e=>Zs(e,yR,d1),YK=e=>Zs(e,bR,KK),ap=e=>Zs(e,NR,FK),Pe=e=>gR.test(e),ld=e=>dl(e,wR),WK=e=>dl(e,SR),EA=e=>dl(e,yR),QK=e=>dl(e,xR),XK=e=>dl(e,bR),sp=e=>dl(e,NR,!0),JK=e=>dl(e,jR,!0),Zs=(e,t,n)=>{const r=mR.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},dl=(e,t,n=!1)=>{const r=gR.exec(e);return r?r[1]?t(r[1]):n:!1},yR=e=>e==="position"||e==="percentage",bR=e=>e==="image"||e==="url",xR=e=>e==="length"||e==="size"||e==="bg-size",wR=e=>e==="length",eH=e=>e==="number",SR=e=>e==="family-name",jR=e=>e==="number"||e==="weight",NR=e=>e==="shadow",tH=()=>{const e=yn("color"),t=yn("font"),n=yn("text"),r=yn("font-weight"),i=yn("tracking"),s=yn("leading"),l=yn("breakpoint"),c=yn("container"),f=yn("spacing"),h=yn("radius"),p=yn("shadow"),g=yn("inset-shadow"),v=yn("text-shadow"),y=yn("drop-shadow"),S=yn("blur"),w=yn("perspective"),N=yn("aspect"),C=yn("ease"),E=yn("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...O(),Pe,Te],z=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],T=()=>[Pe,Te,f],R=()=>[bs,"full","auto",...T()],B=()=>[xs,"none","subgrid",Pe,Te],$=()=>["auto",{span:["full",xs,Pe,Te]},xs,Pe,Te],L=()=>[xs,"auto",Pe,Te],ne=()=>["auto","min","max","fr",Pe,Te],he=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ge=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...T()],ie=()=>[bs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],pe=()=>[bs,"screen","full","dvw","lvw","svw","min","max","fit",...T()],we=()=>[bs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],q=()=>[e,Pe,Te],D=()=>[...O(),EA,AA,{position:[Pe,Te]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ae=()=>["auto","cover","contain",QK,GK,{size:[Pe,Te]}],Y=()=>[hb,ld,wo],W=()=>["","none","full",h,Pe,Te],oe=()=>["",et,ld,wo],xe=()=>["solid","dashed","dotted","double"],Se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[et,hb,EA,AA],le=()=>["","none",S,Pe,Te],je=()=>["none",et,Pe,Te],V=()=>["none",et,Pe,Te],De=()=>[et,Pe,Te],Ee=()=>[bs,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ca],breakpoint:[Ca],color:[vR],container:[Ca],"drop-shadow":[Ca],ease:["in","out","in-out"],font:[HK],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ca],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ca],shadow:[Ca],spacing:["px",et],text:[Ca],"text-shadow":[Ca],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",bs,Te,Pe,N]}],container:["container"],columns:[{columns:[et,Te,Pe,c]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{"inset-s":R(),start:R()}],end:[{"inset-e":R(),end:R()}],"inset-bs":[{"inset-bs":R()}],"inset-be":[{"inset-be":R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[xs,"auto",Pe,Te]}],basis:[{basis:[bs,"full","auto",c,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[et,bs,"auto","initial","none",Te]}],grow:[{grow:["",et,Pe,Te]}],shrink:[{shrink:["",et,Pe,Te]}],order:[{order:[xs,"first","last","none",Pe,Te]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:$()}],"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":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...he(),"normal"]}],"justify-items":[{"justify-items":[...ge(),"normal"]}],"justify-self":[{"justify-self":["auto",...ge()]}],"align-content":[{content:["normal",...he()]}],"align-items":[{items:[...ge(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ge(),{baseline:["","last"]}]}],"place-content":[{"place-content":he()}],"place-items":[{"place-items":[...ge(),"baseline"]}],"place-self":[{"place-self":["auto",...ge()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:ie()}],"inline-size":[{inline:["auto",...pe()]}],"min-inline-size":[{"min-inline":["auto",...pe()]}],"max-inline-size":[{"max-inline":["none",...pe()]}],"block-size":[{block:["auto",...we()]}],"min-block-size":[{"min-block":["auto",...we()]}],"max-block-size":[{"max-block":["none",...we()]}],w:[{w:[c,"screen",...ie()]}],"min-w":[{"min-w":[c,"screen","none",...ie()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...ie()]}],h:[{h:["screen","lh",...ie()]}],"min-h":[{"min-h":["screen","lh","none",...ie()]}],"max-h":[{"max-h":["screen","lh",...ie()]}],"font-size":[{text:["base",n,ld,wo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,JK,VK]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",hb,Te]}],"font-family":[{font:[WK,ZK,t]}],"font-features":[{"font-features":[Te]}],"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,Pe,Te]}],"line-clamp":[{"line-clamp":[et,"none",Pe,kA]}],leading:[{leading:[s,...T()]}],"list-image":[{"list-image":["none",Pe,Te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Pe,Te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[et,"from-font","auto",Pe,wo]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[et,"auto",Pe,Te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe,Te]}],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",Pe,Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xs,Pe,Te],radial:["",Pe,Te],conic:[xs,Pe,Te]},XK,YK]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-bs":[{"border-bs":q()}],"border-color-be":[{"border-be":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[et,Pe,Te]}],"outline-w":[{outline:["",et,ld,wo]}],"outline-color":[{outline:q()}],shadow:[{shadow:["","none",p,sp,ap]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",g,sp,ap]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[et,wo]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":q()}],"text-shadow":[{"text-shadow":["none",v,sp,ap]}],"text-shadow-color":[{"text-shadow":q()}],opacity:[{opacity:[et,Pe,Te]}],"mix-blend":[{"mix-blend":[...Se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Se()}],"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":[et]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":q()}],"mask-image-linear-to-color":[{"mask-linear-to":q()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":q()}],"mask-image-t-to-color":[{"mask-t-to":q()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":q()}],"mask-image-r-to-color":[{"mask-r-to":q()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":q()}],"mask-image-b-to-color":[{"mask-b-to":q()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":q()}],"mask-image-l-to-color":[{"mask-l-to":q()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":q()}],"mask-image-x-to-color":[{"mask-x-to":q()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":q()}],"mask-image-y-to-color":[{"mask-y-to":q()}],"mask-image-radial":[{"mask-radial":[Pe,Te]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":q()}],"mask-image-radial-to-color":[{"mask-radial-to":q()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[et]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":q()}],"mask-image-conic-to-color":[{"mask-conic-to":q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Pe,Te]}],filter:[{filter:["","none",Pe,Te]}],blur:[{blur:le()}],brightness:[{brightness:[et,Pe,Te]}],contrast:[{contrast:[et,Pe,Te]}],"drop-shadow":[{"drop-shadow":["","none",y,sp,ap]}],"drop-shadow-color":[{"drop-shadow":q()}],grayscale:[{grayscale:["",et,Pe,Te]}],"hue-rotate":[{"hue-rotate":[et,Pe,Te]}],invert:[{invert:["",et,Pe,Te]}],saturate:[{saturate:[et,Pe,Te]}],sepia:[{sepia:["",et,Pe,Te]}],"backdrop-filter":[{"backdrop-filter":["","none",Pe,Te]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[et,Pe,Te]}],"backdrop-contrast":[{"backdrop-contrast":[et,Pe,Te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",et,Pe,Te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[et,Pe,Te]}],"backdrop-invert":[{"backdrop-invert":["",et,Pe,Te]}],"backdrop-opacity":[{"backdrop-opacity":[et,Pe,Te]}],"backdrop-saturate":[{"backdrop-saturate":[et,Pe,Te]}],"backdrop-sepia":[{"backdrop-sepia":["",et,Pe,Te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Pe,Te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[et,"initial",Pe,Te]}],ease:[{ease:["linear","initial",C,Pe,Te]}],delay:[{delay:[et,Pe,Te]}],animate:[{animate:["none",E,Pe,Te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Pe,Te]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:V()}],"scale-x":[{"scale-x":V()}],"scale-y":[{"scale-y":V()}],"scale-z":[{"scale-z":V()}],"scale-3d":["scale-3d"],skew:[{skew:De()}],"skew-x":[{"skew-x":De()}],"skew-y":[{"skew-y":De()}],transform:[{transform:[Pe,Te,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"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",Pe,Te]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Pe,Te]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[et,ld,wo,kA]}],stroke:[{stroke:["none",...q()]}],"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"]}},nH=MK(tH);function di(...e){return nH(gt(e))}const rH=uR("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-zinc-50 text-black hover:bg-zinc-200",secondary:"border border-zinc-800 bg-zinc-950 text-zinc-100 hover:bg-zinc-900",ghost:"text-zinc-400 hover:bg-zinc-900 hover:text-zinc-50",outline:"border border-zinc-800 bg-transparent text-zinc-100 hover:bg-zinc-900",destructive:"bg-rose-600 text-white hover:bg-rose-700"},size:{default:"h-9 px-4",sm:"h-8 px-3 text-xs",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),me=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const l=r?lK:"button";return u.jsx(l,{ref:s,className:di(rH({variant:t,size:n,className:e})),...i})});me.displayName="Button";const iH=uR("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 CR({className:e,variant:t,...n}){return u.jsx("div",{className:di(iH({variant:t}),e),...n})}function TA({compact:e=!1}){return u.jsxs(Lt,{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 Ud({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 pm(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function OR(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 aH(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 sH(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function bt({tone:e,children:t}){const n=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return u.jsx(CR,{variant:n,children:t})}function zg({status:e}){return u.jsx(bt,{tone:OR(e),children:Eg(e)})}function Ds(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function oH(e,t){const n=x.createContext(t),r=s=>{const{children:l,...c}=s,f=x.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:f,children:l})};r.displayName=e+"Provider";function i(s){const l=x.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function lH(e,t=[]){let n=[];function r(s,l){const c=x.createContext(l),f=n.length;n=[...n,l];const h=g=>{const{scope:v,children:y,...S}=g,w=v?.[e]?.[f]||c,N=x.useMemo(()=>S,Object.values(S));return u.jsx(w.Provider,{value:N,children:y})};h.displayName=s+"Provider";function p(g,v){const y=v?.[e]?.[f]||c,S=x.useContext(y);if(S)return S;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[h,p]}const i=()=>{const s=n.map(l=>x.createContext(l));return function(c){const f=c?.[e]||s;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return i.scopeName=e,[r,cH(i,...t)]}function cH(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const l=r.reduce((c,{useScope:f,scopeName:h})=>{const g=f(s)[`__scope${h}`];return{...c,...g}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Bd=globalThis?.document?x.useLayoutEffect:()=>{},uH=xg[" useId ".trim().toString()]||(()=>{}),dH=0;function pb(e){const[t,n]=x.useState(uH());return Bd(()=>{n(r=>r??String(dH++))},[e]),e||(t?`radix-${t}`:"")}var fH=xg[" useInsertionEffect ".trim().toString()]||Bd;function hH({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,l]=pH({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:i;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const g=p.current;g!==c&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const h=x.useCallback(p=>{if(c){const g=mH(p)?p(e):p;g!==e&&l.current?.(g)}else s(p)},[c,e,s,l]);return[f,h]}function pH({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),s=x.useRef(t);return fH(()=>{s.current=t},[t]),x.useEffect(()=>{i.current!==n&&(s.current?.(n),i.current=n)},[n,i]),[n,r,s]}function mH(e){return typeof e=="function"}function _R(e){const t=gH(e),n=x.forwardRef((r,i)=>{const{children:s,...l}=r,c=x.Children.toArray(s),f=c.find(yH);if(f){const h=f.props.children,p=c.map(g=>g===f?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...l,ref:i,children:x.isValidElement(h)?x.cloneElement(h,void 0,p):null})}return u.jsx(t,{...l,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function gH(e){const t=x.forwardRef((n,r)=>{const{children:i,...s}=n;if(x.isValidElement(i)){const l=xH(i),c=bH(s,i.props);return i.type!==x.Fragment&&(c.ref=r?c1(r,l):l),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vH=Symbol("radix.slottable");function yH(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vH}function bH(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...c)=>{const f=s(...c);return i(...c),f}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function xH(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 wH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$a=wH.reduce((e,t)=>{const n=_R(`Primitive.${t}`),r=x.forwardRef((i,s)=>{const{asChild:l,...c}=i,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(f,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function SH(e,t){e&&cl.flushSync(()=>e.dispatchEvent(t))}function qd(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function jH(e,t=globalThis?.document){const n=qd(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var NH="DismissableLayer",Cw="dismissableLayer.update",CH="dismissableLayer.pointerDownOutside",OH="dismissableLayer.focusOutside",PA,kR=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),AR=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...f}=e,h=x.useContext(kR),[p,g]=x.useState(null),v=p?.ownerDocument??globalThis?.document,[,y]=x.useState({}),S=ul(t,_=>g(_)),w=Array.from(h.layers),[N]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=w.indexOf(N),E=p?w.indexOf(p):-1,A=h.layersWithOutsidePointerEventsDisabled.size>0,O=E>=C,P=AH(_=>{const T=_.target,R=[...h.branches].some(B=>B.contains(T));!O||R||(i?.(_),l?.(_),_.defaultPrevented||c?.())},v),z=EH(_=>{const T=_.target;[...h.branches].some(B=>B.contains(T))||(s?.(_),l?.(_),_.defaultPrevented||c?.())},v);return jH(_=>{E===h.layers.size-1&&(r?.(_),!_.defaultPrevented&&c&&(_.preventDefault(),c()))},v),x.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(PA=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),zA(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=PA)}},[p,v,n,h]),x.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),zA())},[p,h]),x.useEffect(()=>{const _=()=>y({});return document.addEventListener(Cw,_),()=>document.removeEventListener(Cw,_)},[]),u.jsx($a.div,{...f,ref:S,style:{pointerEvents:A?O?"auto":"none":void 0,...e.style},onFocusCapture:Ds(e.onFocusCapture,z.onFocusCapture),onBlurCapture:Ds(e.onBlurCapture,z.onBlurCapture),onPointerDownCapture:Ds(e.onPointerDownCapture,P.onPointerDownCapture)})});AR.displayName=NH;var _H="DismissableLayerBranch",kH=x.forwardRef((e,t)=>{const n=x.useContext(kR),r=x.useRef(null),i=ul(t,r);return x.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),u.jsx($a.div,{...e,ref:i})});kH.displayName=_H;function AH(e,t=globalThis?.document){const n=qd(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const s=c=>{if(c.target&&!r.current){let f=function(){ER(CH,n,h,{discrete:!0})};const h={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=f,t.addEventListener("click",i.current,{once:!0})):f()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function EH(e,t=globalThis?.document){const n=qd(e),r=x.useRef(!1);return x.useEffect(()=>{const i=s=>{s.target&&!r.current&&ER(OH,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function zA(){const e=new CustomEvent(Cw);document.dispatchEvent(e)}function ER(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?SH(i,s):i.dispatchEvent(s)}var mb="focusScope.autoFocusOnMount",gb="focusScope.autoFocusOnUnmount",MA={bubbles:!1,cancelable:!0},TH="FocusScope",TR=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,f]=x.useState(null),h=qd(i),p=qd(s),g=x.useRef(null),v=ul(t,w=>f(w)),y=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let w=function(A){if(y.paused||!c)return;const O=A.target;c.contains(O)?g.current=O:Ss(g.current,{select:!0})},N=function(A){if(y.paused||!c)return;const O=A.relatedTarget;O!==null&&(c.contains(O)||Ss(g.current,{select:!0}))},C=function(A){if(document.activeElement===document.body)for(const P of A)P.removedNodes.length>0&&Ss(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",N);const E=new MutationObserver(C);return c&&E.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",N),E.disconnect()}}},[r,c,y.paused]),x.useEffect(()=>{if(c){DA.add(y);const w=document.activeElement;if(!c.contains(w)){const C=new CustomEvent(mb,MA);c.addEventListener(mb,h),c.dispatchEvent(C),C.defaultPrevented||(PH(IH(PR(c)),{select:!0}),document.activeElement===w&&Ss(c))}return()=>{c.removeEventListener(mb,h),setTimeout(()=>{const C=new CustomEvent(gb,MA);c.addEventListener(gb,p),c.dispatchEvent(C),C.defaultPrevented||Ss(w??document.body,{select:!0}),c.removeEventListener(gb,p),DA.remove(y)},0)}}},[c,h,p,y]);const S=x.useCallback(w=>{if(!n&&!r||y.paused)return;const N=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,C=document.activeElement;if(N&&C){const E=w.currentTarget,[A,O]=zH(E);A&&O?!w.shiftKey&&C===O?(w.preventDefault(),n&&Ss(A,{select:!0})):w.shiftKey&&C===A&&(w.preventDefault(),n&&Ss(O,{select:!0})):C===E&&w.preventDefault()}},[n,r,y.paused]);return u.jsx($a.div,{tabIndex:-1,...l,ref:v,onKeyDown:S})});TR.displayName=TH;function PH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ss(r,{select:t}),document.activeElement!==n)return}function zH(e){const t=PR(e),n=RA(t,e),r=RA(t.reverse(),e);return[n,r]}function PR(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 RA(e,t){for(const n of e)if(!MH(n,{upTo:t}))return n}function MH(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 RH(e){return e instanceof HTMLInputElement&&"select"in e}function Ss(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&RH(e)&&t&&e.select()}}var DA=DH();function DH(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=IA(e,t),e.unshift(t)},remove(t){e=IA(e,t),e[0]?.resume()}}}function IA(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function IH(e){return e.filter(t=>t.tagName!=="A")}var LH="Portal",zR=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,s]=x.useState(!1);Bd(()=>s(!0),[]);const l=n||i&&globalThis?.document?.body;return l?Pq.createPortal(u.jsx($a.div,{...r,ref:t}),l):null});zR.displayName=LH;function $H(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Mg=e=>{const{present:t,children:n}=e,r=UH(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),s=ul(r.ref,BH(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:s}):null};Mg.displayName="Presence";function UH(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),s=x.useRef("none"),l=e?"mounted":"unmounted",[c,f]=$H(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=op(r.current);s.current=c==="mounted"?h:"none"},[c]),Bd(()=>{const h=r.current,p=i.current;if(p!==e){const v=s.current,y=op(h);e?f("MOUNT"):y==="none"||h?.display==="none"?f("UNMOUNT"):f(p&&v!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),Bd(()=>{if(t){let h;const p=t.ownerDocument.defaultView??window,g=y=>{const w=op(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&w&&(f("ANIMATION_END"),!i.current)){const N=t.style.animationFillMode;t.style.animationFillMode="forwards",h=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=N)})}},v=y=>{y.target===t&&(s.current=op(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(h),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function op(e){return e?.animationName||"none"}function BH(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 vb=0;function qH(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??LA()),document.body.insertAdjacentElement("beforeend",e[1]??LA()),vb++,()=>{vb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),vb--}},[])}function LA(){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 Gi=function(){return Gi=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Gi.apply(this,arguments)};function MR(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 FH(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Fp="right-scroll-bar-position",Kp="width-before-scroll-bar",KH="with-scroll-bars-hidden",HH="--removed-body-scroll-bar-size";function yb(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function GH(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var VH=typeof window<"u"?x.useLayoutEffect:x.useEffect,$A=new WeakMap;function ZH(e,t){var n=GH(null,function(r){return e.forEach(function(i){return yb(i,r)})});return VH(function(){var r=$A.get(n);if(r){var i=new Set(r),s=new Set(e),l=n.current;i.forEach(function(c){s.has(c)||yb(c,null)}),s.forEach(function(c){i.has(c)||yb(c,l)})}$A.set(n,e)},[e]),n}function YH(e){return e}function WH(e,t){t===void 0&&(t=YH);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var l=t(s,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(s){for(r=!0;n.length;){var l=n;n=[],l.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(s),l=n}var f=function(){var p=l;l=[],p.forEach(s)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(p){l.push(p),h()},filter:function(p){return l=l.filter(p),n}}}};return i}function QH(e){e===void 0&&(e={});var t=WH(null);return t.options=Gi({async:!0,ssr:!1},e),t}var RR=function(e){var t=e.sideCar,n=MR(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,Gi({},n))};RR.isSideCarExport=!0;function XH(e,t){return e.useMedium(t),RR}var DR=QH(),bb=function(){},Rg=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:bb,onWheelCapture:bb,onTouchMoveCapture:bb}),i=r[0],s=r[1],l=e.forwardProps,c=e.children,f=e.className,h=e.removeScrollBar,p=e.enabled,g=e.shards,v=e.sideCar,y=e.noRelative,S=e.noIsolation,w=e.inert,N=e.allowPinchZoom,C=e.as,E=C===void 0?"div":C,A=e.gapMode,O=MR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=v,z=ZH([n,t]),_=Gi(Gi({},O),i);return x.createElement(x.Fragment,null,p&&x.createElement(P,{sideCar:DR,removeScrollBar:h,shards:g,noRelative:y,noIsolation:S,inert:w,setCallbacks:s,allowPinchZoom:!!N,lockRef:n,gapMode:A}),l?x.cloneElement(x.Children.only(c),Gi(Gi({},_),{ref:z})):x.createElement(E,Gi({},_,{className:f,ref:z}),c))});Rg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Rg.classNames={fullWidth:Kp,zeroRight:Fp};var JH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function e7(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=JH();return t&&e.setAttribute("nonce",t),e}function t7(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function n7(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var r7=function(){var e=0,t=null;return{add:function(n){e==0&&(t=e7())&&(t7(t,n),n7(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},i7=function(){var e=r7();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},IR=function(){var e=i7(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},a7={left:0,top:0,right:0,gap:0},xb=function(e){return parseInt(e||"",10)||0},s7=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[xb(n),xb(r),xb(i)]},o7=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return a7;var t=s7(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])}},l7=IR(),Cc="data-scroll-locked",c7=function(e,t,n,r){var i=e.left,s=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
13
|
+
.`.concat(KH,` {
|
|
14
|
+
overflow: hidden `).concat(r,`;
|
|
15
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
16
|
+
}
|
|
17
|
+
body[`).concat(Cc,`] {
|
|
18
|
+
overflow: hidden `).concat(r,`;
|
|
19
|
+
overscroll-behavior: contain;
|
|
20
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
21
|
+
padding-left: `.concat(i,`px;
|
|
22
|
+
padding-top: `).concat(s,`px;
|
|
23
|
+
padding-right: `).concat(l,`px;
|
|
24
|
+
margin-left:0;
|
|
25
|
+
margin-top:0;
|
|
26
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
27
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.`).concat(Fp,` {
|
|
31
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.`).concat(Kp,` {
|
|
35
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.`).concat(Fp," .").concat(Fp,` {
|
|
39
|
+
right: 0 `).concat(r,`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.`).concat(Kp," .").concat(Kp,` {
|
|
43
|
+
margin-right: 0 `).concat(r,`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
body[`).concat(Cc,`] {
|
|
47
|
+
`).concat(HH,": ").concat(c,`px;
|
|
48
|
+
}
|
|
49
|
+
`)},UA=function(){var e=parseInt(document.body.getAttribute(Cc)||"0",10);return isFinite(e)?e:0},u7=function(){x.useEffect(function(){return document.body.setAttribute(Cc,(UA()+1).toString()),function(){var e=UA()-1;e<=0?document.body.removeAttribute(Cc):document.body.setAttribute(Cc,e.toString())}},[])},d7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;u7();var s=x.useMemo(function(){return o7(i)},[i]);return x.createElement(l7,{styles:c7(s,!t,i,n?"":"!important")})},Ow=!1;if(typeof window<"u")try{var lp=Object.defineProperty({},"passive",{get:function(){return Ow=!0,!0}});window.addEventListener("test",lp,lp),window.removeEventListener("test",lp,lp)}catch{Ow=!1}var rc=Ow?{passive:!1}:!1,f7=function(e){return e.tagName==="TEXTAREA"},LR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!f7(e)&&n[t]==="visible")},h7=function(e){return LR(e,"overflowY")},p7=function(e){return LR(e,"overflowX")},BA=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=$R(e,r);if(i){var s=UR(e,r),l=s[1],c=s[2];if(l>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},m7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},g7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},$R=function(e,t){return e==="v"?h7(t):p7(t)},UR=function(e,t){return e==="v"?m7(t):g7(t)},v7=function(e,t){return e==="h"&&t==="rtl"?-1:1},y7=function(e,t,n,r,i){var s=v7(e,window.getComputedStyle(t).direction),l=s*r,c=n.target,f=t.contains(c),h=!1,p=l>0,g=0,v=0;do{if(!c)break;var y=UR(e,c),S=y[0],w=y[1],N=y[2],C=w-N-s*S;(S||C)&&$R(e,c)&&(g+=C,v+=S);var E=c.parentNode;c=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(p&&Math.abs(g)<1||!p&&Math.abs(v)<1)&&(h=!0),h},cp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qA=function(e){return[e.deltaX,e.deltaY]},FA=function(e){return e&&"current"in e?e.current:e},b7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},x7=function(e){return`
|
|
50
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
51
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
52
|
+
`)},w7=0,ic=[];function S7(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(w7++)[0],s=x.useState(IR)[0],l=x.useRef(e);x.useEffect(function(){l.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=FH([e.lockRef.current],(e.shards||[]).map(FA),!0).filter(Boolean);return w.forEach(function(N){return N.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=x.useCallback(function(w,N){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var C=cp(w),E=n.current,A="deltaX"in w?w.deltaX:E[0]-C[0],O="deltaY"in w?w.deltaY:E[1]-C[1],P,z=w.target,_=Math.abs(A)>Math.abs(O)?"h":"v";if("touches"in w&&_==="h"&&z.type==="range")return!1;var T=window.getSelection(),R=T&&T.anchorNode,B=R?R===z||R.contains(z):!1;if(B)return!1;var $=BA(_,z);if(!$)return!0;if($?P=_:(P=_==="v"?"h":"v",$=BA(_,z)),!$)return!1;if(!r.current&&"changedTouches"in w&&(A||O)&&(r.current=P),!P)return!0;var L=r.current||P;return y7(L,N,w,L==="h"?A:O)},[]),f=x.useCallback(function(w){var N=w;if(!(!ic.length||ic[ic.length-1]!==s)){var C="deltaY"in N?qA(N):cp(N),E=t.current.filter(function(P){return P.name===N.type&&(P.target===N.target||N.target===P.shadowParent)&&b7(P.delta,C)})[0];if(E&&E.should){N.cancelable&&N.preventDefault();return}if(!E){var A=(l.current.shards||[]).map(FA).filter(Boolean).filter(function(P){return P.contains(N.target)}),O=A.length>0?c(N,A[0]):!l.current.noIsolation;O&&N.cancelable&&N.preventDefault()}}},[]),h=x.useCallback(function(w,N,C,E){var A={name:w,delta:N,target:C,should:E,shadowParent:j7(C)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(O){return O!==A})},1)},[]),p=x.useCallback(function(w){n.current=cp(w),r.current=void 0},[]),g=x.useCallback(function(w){h(w.type,qA(w),w.target,c(w,e.lockRef.current))},[]),v=x.useCallback(function(w){h(w.type,cp(w),w.target,c(w,e.lockRef.current))},[]);x.useEffect(function(){return ic.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",f,rc),document.addEventListener("touchmove",f,rc),document.addEventListener("touchstart",p,rc),function(){ic=ic.filter(function(w){return w!==s}),document.removeEventListener("wheel",f,rc),document.removeEventListener("touchmove",f,rc),document.removeEventListener("touchstart",p,rc)}},[]);var y=e.removeScrollBar,S=e.inert;return x.createElement(x.Fragment,null,S?x.createElement(s,{styles:x7(i)}):null,y?x.createElement(d7,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function j7(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const N7=XH(DR,S7);var BR=x.forwardRef(function(e,t){return x.createElement(Rg,Gi({},e,{ref:t,sideCar:N7}))});BR.classNames=Rg.classNames;var C7=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ac=new WeakMap,up=new WeakMap,dp={},wb=0,qR=function(e){return e&&(e.host||qR(e.parentNode))},O7=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=qR(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})},_7=function(e,t,n,r){var i=O7(t,Array.isArray(e)?e:[e]);dp[n]||(dp[n]=new WeakMap);var s=dp[n],l=[],c=new Set,f=new Set(i),h=function(g){!g||c.has(g)||(c.add(g),h(g.parentNode))};i.forEach(h);var p=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(v){if(c.has(v))p(v);else try{var y=v.getAttribute(r),S=y!==null&&y!=="false",w=(ac.get(v)||0)+1,N=(s.get(v)||0)+1;ac.set(v,w),s.set(v,N),l.push(v),w===1&&S&&up.set(v,!0),N===1&&v.setAttribute(n,"true"),S||v.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",v,C)}})};return p(t),c.clear(),wb++,function(){l.forEach(function(g){var v=ac.get(g)-1,y=s.get(g)-1;ac.set(g,v),s.set(g,y),v||(up.has(g)||g.removeAttribute(r),up.delete(g)),y||g.removeAttribute(n)}),wb--,wb||(ac=new WeakMap,ac=new WeakMap,up=new WeakMap,dp={})}},k7=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=C7(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),_7(r,i,n,"aria-hidden")):function(){return null}},Dg="Dialog",[FR]=lH(Dg),[A7,Ai]=FR(Dg),KR=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:l=!0}=e,c=x.useRef(null),f=x.useRef(null),[h,p]=hH({prop:r,defaultProp:i??!1,onChange:s,caller:Dg});return u.jsx(A7,{scope:t,triggerRef:c,contentRef:f,contentId:pb(),titleId:pb(),descriptionId:pb(),open:h,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(g=>!g),[p]),modal:l,children:n})};KR.displayName=Dg;var HR="DialogTrigger",E7=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ai(HR,n),s=ul(t,i.triggerRef);return u.jsx($a.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":p1(i.open),...r,ref:s,onClick:Ds(e.onClick,i.onOpenToggle)})});E7.displayName=HR;var f1="DialogPortal",[T7,GR]=FR(f1,{forceMount:void 0}),VR=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=Ai(f1,t);return u.jsx(T7,{scope:t,forceMount:n,children:x.Children.map(r,l=>u.jsx(Mg,{present:n||s.open,children:u.jsx(zR,{asChild:!0,container:i,children:l})}))})};VR.displayName=f1;var mm="DialogOverlay",ZR=x.forwardRef((e,t)=>{const n=GR(mm,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Ai(mm,e.__scopeDialog);return s.modal?u.jsx(Mg,{present:r||s.open,children:u.jsx(z7,{...i,ref:t})}):null});ZR.displayName=mm;var P7=_R("DialogOverlay.RemoveScroll"),z7=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ai(mm,n);return u.jsx(BR,{as:P7,allowPinchZoom:!0,shards:[i.contentRef],children:u.jsx($a.div,{"data-state":p1(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Xo="DialogContent",YR=x.forwardRef((e,t)=>{const n=GR(Xo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Ai(Xo,e.__scopeDialog);return u.jsx(Mg,{present:r||s.open,children:s.modal?u.jsx(M7,{...i,ref:t}):u.jsx(R7,{...i,ref:t})})});YR.displayName=Xo;var M7=x.forwardRef((e,t)=>{const n=Ai(Xo,e.__scopeDialog),r=x.useRef(null),i=ul(t,n.contentRef,r);return x.useEffect(()=>{const s=r.current;if(s)return k7(s)},[]),u.jsx(WR,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ds(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ds(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&s.preventDefault()}),onFocusOutside:Ds(e.onFocusOutside,s=>s.preventDefault())})}),R7=x.forwardRef((e,t)=>{const n=Ai(Xo,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return u.jsx(WR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=s.target;n.triggerRef.current?.contains(l)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),WR=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=e,c=Ai(Xo,n),f=x.useRef(null),h=ul(t,f);return qH(),u.jsxs(u.Fragment,{children:[u.jsx(TR,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:u.jsx(AR,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":p1(c.open),...l,ref:h,onDismiss:()=>c.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(D7,{titleId:c.titleId}),u.jsx(L7,{contentRef:f,descriptionId:c.descriptionId})]})]})}),h1="DialogTitle",QR=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ai(h1,n);return u.jsx($a.h2,{id:i.titleId,...r,ref:t})});QR.displayName=h1;var XR="DialogDescription",JR=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ai(XR,n);return u.jsx($a.p,{id:i.descriptionId,...r,ref:t})});JR.displayName=XR;var eD="DialogClose",tD=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ai(eD,n);return u.jsx($a.button,{type:"button",...r,ref:t,onClick:Ds(e.onClick,()=>i.onOpenChange(!1))})});tD.displayName=eD;function p1(e){return e?"open":"closed"}var nD="DialogTitleWarning",[zye,rD]=oH(nD,{contentName:Xo,titleName:h1,docsSlug:"dialog"}),D7=({titleId:e})=>{const t=rD(nD),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
53
|
+
|
|
54
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
55
|
+
|
|
56
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},I7="DialogDescriptionWarning",L7=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${rD(I7).contentName}}.`;return x.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},iD=KR,aD=VR,m1=ZR,g1=YR,v1=QR,sD=JR,oD=tD;const $7=iD,U7=aD,lD=x.forwardRef(({className:e,...t},n)=>u.jsx(m1,{ref:n,className:di("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));lD.displayName=m1.displayName;const B7=400,q7=1200,F7=720,cD=x.forwardRef(({className:e,children:t,...n},r)=>{const[i,s]=x.useState(F7),l=x.useRef(!1),c=x.useRef(0),f=x.useRef(0),h=x.useCallback(v=>{l.current=!0,c.current=v.clientX,f.current=i,v.target.setPointerCapture(v.pointerId),v.preventDefault()},[i]),p=x.useCallback(v=>{if(!l.current)return;const y=c.current-v.clientX,S=Math.min(q7,Math.max(B7,f.current+y));s(S)},[]),g=x.useCallback(()=>{l.current=!1},[]);return u.jsxs(U7,{children:[u.jsx(lD,{}),u.jsxs(g1,{ref:r,className:di("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${i}px, 100vw)`},...n,children:[u.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:h,onPointerMove:p,onPointerUp:g}),t,u.jsxs(oD,{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(Ag,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});cD.displayName=g1.displayName;const K7=({className:e,...t})=>u.jsx("div",{className:di("flex flex-col gap-1.5 pr-10",e),...t}),uD=x.forwardRef(({className:e,...t},n)=>u.jsx(v1,{ref:n,className:di("text-lg font-medium text-zinc-50",e),...t}));uD.displayName=v1.displayName;const dD=x.forwardRef(({className:e,...t},n)=>u.jsx(sD,{ref:n,className:di("text-sm text-zinc-500",e),...t}));dD.displayName=sD.displayName;function H7({title:e,subtitle:t,children:n,open:r,onClose:i}){return u.jsx($7,{open:r,onOpenChange:s=>s?void 0:i(),children:u.jsxs(cD,{children:[u.jsxs(K7,{className:"drawer-head",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),u.jsx(uD,{id:"drawer-title",children:e}),u.jsx(dD,{className:"sr-only",children:t})]}),u.jsx("div",{className:"drawer-body",children:n})]})})}function ue(e,t,n){function r(c,f){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:f,constr:l,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,f);const h=l.prototype,p=Object.keys(h);for(let g=0;g<p.length;g++){const v=p[g];v in c||(c[v]=h[v].bind(c))}}const i=n?.Parent??Object;class s extends i{}Object.defineProperty(s,"name",{value:e});function l(c){var f;const h=n?.Parent?new s:this;r(h,c),(f=h._zod).deferred??(f.deferred=[]);for(const p of h._zod.deferred)p();return h}return Object.defineProperty(l,"init",{value:r}),Object.defineProperty(l,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class Oc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class fD extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const hD={};function Bs(e){return hD}function pD(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 _w(e,t){return typeof t=="bigint"?t.toString():t}function y1(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function b1(e){return e==null}function x1(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function G7(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const f=r.match(/\d?e-(\d?)/);f?.[1]&&(i=Number.parseInt(f[1]))}const s=n>i?n:i,l=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return l%c/10**s}const KA=Symbol("evaluating");function xt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==KA)return r===void 0&&(r=KA,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function fl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ys(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function HA(e){return JSON.stringify(e)}function V7(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const mD="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function gm(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Z7=y1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Mc(e){if(gm(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(gm(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function gD(e){return Mc(e)?{...e}:Array.isArray(e)?[...e]:e}const Y7=new Set(["string","number","symbol"]);function Rc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ws(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Ie(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 W7(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Q7={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 X7(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Ys(e._zod.def,{get shape(){const l={};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(l[c]=n.shape[c])}return fl(this,"shape",l),l},checks:[]});return Ws(e,s)}function J7(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Ys(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete l[c]}return fl(this,"shape",l),l},checks:[]});return Ws(e,s)}function eG(e,t){if(!Mc(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(s,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Ys(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return fl(this,"shape",s),s}});return Ws(e,i)}function tG(e,t){if(!Mc(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ys(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return fl(this,"shape",r),r}});return Ws(e,n)}function nG(e,t){const n=Ys(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return fl(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Ws(e,n)}function rG(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=Ys(t._zod.def,{get shape(){const c=t._zod.def.shape,f={...c};if(n)for(const h in n){if(!(h in c))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(f[h]=e?new e({type:"optional",innerType:c[h]}):c[h])}else for(const h in c)f[h]=e?new e({type:"optional",innerType:c[h]}):c[h];return fl(this,"shape",f),f},checks:[]});return Ws(t,l)}function iG(e,t,n){const r=Ys(t._zod.def,{get shape(){const i=t._zod.def.shape,s={...i};if(n)for(const l in n){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(s[l]=new e({type:"nonoptional",innerType:i[l]}))}else for(const l in i)s[l]=new e({type:"nonoptional",innerType:i[l]});return fl(this,"shape",s),s}});return Ws(t,r)}function vc(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 yc(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function fp(e){return typeof e=="string"?e:e?.message}function qs(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=fp(e.inst?._zod.def?.error?.(e))??fp(t?.error?.(e))??fp(n.customError?.(e))??fp(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function w1(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Fd(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const vD=(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,_w,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},yD=ue("$ZodError",vD),bD=ue("$ZodError",vD,{Parent:Error});function aG(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 sG(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(l=>r({issues:l}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let l=n,c=0;for(;c<s.path.length;){const f=s.path[c];c===s.path.length-1?(l[f]=l[f]||{_errors:[]},l[f]._errors.push(t(s))):l[f]=l[f]||{_errors:[]},l=l[f],c++}}};return r(e),n}const S1=e=>(t,n,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},s);if(l instanceof Promise)throw new Oc;if(l.issues.length){const c=new(i?.Err??e)(l.issues.map(f=>qs(f,s,Bs())));throw mD(c,i?.callee),c}return l.value},j1=e=>async(t,n,r,i)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},s);if(l instanceof Promise&&(l=await l),l.issues.length){const c=new(i?.Err??e)(l.issues.map(f=>qs(f,s,Bs())));throw mD(c,i?.callee),c}return l.value},Ig=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Oc;return s.issues.length?{success:!1,error:new(e??yD)(s.issues.map(l=>qs(l,i,Bs())))}:{success:!0,data:s.value}},oG=Ig(bD),Lg=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(l=>qs(l,i,Bs())))}:{success:!0,data:s.value}},lG=Lg(bD),cG=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return S1(e)(t,n,i)},uG=e=>(t,n,r)=>S1(e)(t,n,r),dG=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return j1(e)(t,n,i)},fG=e=>async(t,n,r)=>j1(e)(t,n,r),hG=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ig(e)(t,n,i)},pG=e=>(t,n,r)=>Ig(e)(t,n,r),mG=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Lg(e)(t,n,i)},gG=e=>async(t,n,r)=>Lg(e)(t,n,r),vG=/^[cC][^\s-]{8,}$/,yG=/^[0-9a-z]+$/,bG=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xG=/^[0-9a-vA-V]{20}$/,wG=/^[A-Za-z0-9]{27}$/,SG=/^[a-zA-Z0-9_-]{21}$/,jG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,NG=/^([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})$/,GA=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)$/,CG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,OG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function _G(){return new RegExp(OG,"u")}const kG=/^(?:(?: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])$/,AG=/^(([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}|:))$/,EG=/^((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])$/,TG=/^(([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])$/,PG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xD=/^[A-Za-z0-9_-]*$/,zG=/^\+[1-9]\d{6,14}$/,wD="(?:(?:\\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])))",MG=new RegExp(`^${wD}$`);function SD(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 RG(e){return new RegExp(`^${SD(e)}$`)}function DG(e){const t=SD({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(`^${wD}T(?:${r})$`)}const IG=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},LG=/^-?\d+$/,jD=/^-?\d+(?:\.\d+)?$/,$G=/^(?:true|false)$/i,UG=/^[^A-Z]*$/,BG=/^[^a-z]*$/,wr=ue("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ND={number:"number",bigint:"bigint",object:"date"},CD=ue("$ZodCheckLessThan",(e,t)=>{wr.init(e,t);const n=ND[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),OD=ue("$ZodCheckGreaterThan",(e,t)=>{wr.init(e,t);const n=ND[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),qG=ue("$ZodCheckMultipleOf",(e,t)=>{wr.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):G7(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})}}),FG=ue("$ZodCheckNumberFormat",(e,t)=>{wr.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,s]=Q7[t.format];e._zod.onattach.push(l=>{const c=l._zod.bag;c.format=t.format,c.minimum=i,c.maximum=s,n&&(c.pattern=LG)}),e._zod.check=l=>{const c=l.value;if(n){if(!Number.isInteger(c)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<i&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),c>s&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),KG=ue("$ZodCheckMaxLength",(e,t)=>{var n;wr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!b1(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const l=w1(i);r.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),HG=ue("$ZodCheckMinLength",(e,t)=>{var n;wr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!b1(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const l=w1(i);r.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),GG=ue("$ZodCheckLengthEquals",(e,t)=>{var n;wr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!b1(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,s=i.length;if(s===t.length)return;const l=w1(i),c=s>t.length;r.issues.push({origin:l,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),$g=ue("$ZodCheckStringFormat",(e,t)=>{var n,r;wr.init(e,t),e._zod.onattach.push(i=>{const s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),VG=ue("$ZodCheckRegex",(e,t)=>{$g.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})}}),ZG=ue("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=UG),$g.init(e,t)}),YG=ue("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=BG),$g.init(e,t)}),WG=ue("$ZodCheckIncludes",(e,t)=>{wr.init(e,t);const n=Rc(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),QG=ue("$ZodCheckStartsWith",(e,t)=>{wr.init(e,t);const n=new RegExp(`^${Rc(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})}}),XG=ue("$ZodCheckEndsWith",(e,t)=>{wr.init(e,t);const n=new RegExp(`.*${Rc(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})}}),JG=ue("$ZodCheckOverwrite",(e,t)=>{wr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class eV{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
57
|
+
`).filter(l=>l),i=Math.min(...r.map(l=>l.length-l.trimStart().length)),s=r.map(l=>l.slice(i)).map(l=>" ".repeat(this.indent*2)+l);for(const l of s)this.content.push(l)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,i.join(`
|
|
58
|
+
`))}}const tV={major:4,minor:3,patch:6},Gt=ue("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tV;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const s of i._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(l,c,f)=>{let h=vc(l),p;for(const g of c){if(g._zod.def.when){if(!g._zod.def.when(l))continue}else if(h)continue;const v=l.issues.length,y=g._zod.check(l);if(y instanceof Promise&&f?.async===!1)throw new Oc;if(p||y instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await y,l.issues.length!==v&&(h||(h=vc(l,v)))});else{if(l.issues.length===v)continue;h||(h=vc(l,v))}}return p?p.then(()=>l):l},s=(l,c,f)=>{if(vc(l))return l.aborted=!0,l;const h=i(c,r,f);if(h instanceof Promise){if(f.async===!1)throw new Oc;return h.then(p=>e._zod.parse(p,f))}return e._zod.parse(h,f)};e._zod.run=(l,c)=>{if(c.skipChecks)return e._zod.parse(l,c);if(c.direction==="backward"){const h=e._zod.parse({value:l.value,issues:[]},{...c,skipChecks:!0});return h instanceof Promise?h.then(p=>s(p,l,c)):s(h,l,c)}const f=e._zod.parse(l,c);if(f instanceof Promise){if(c.async===!1)throw new Oc;return f.then(h=>i(h,r,c))}return i(f,r,c)}}xt(e,"~standard",()=>({validate:i=>{try{const s=oG(e,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return lG(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),N1=ue("$ZodString",(e,t)=>{Gt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??IG(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}}),Bt=ue("$ZodStringFormat",(e,t)=>{$g.init(e,t),N1.init(e,t)}),nV=ue("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=NG),Bt.init(e,t)}),rV=ue("$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=GA(r))}else t.pattern??(t.pattern=GA());Bt.init(e,t)}),iV=ue("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=CG),Bt.init(e,t)}),aV=ue("$ZodURL",(e,t)=>{Bt.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})}}}),sV=ue("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=_G()),Bt.init(e,t)}),oV=ue("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=SG),Bt.init(e,t)}),lV=ue("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=vG),Bt.init(e,t)}),cV=ue("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=yG),Bt.init(e,t)}),uV=ue("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bG),Bt.init(e,t)}),dV=ue("$ZodXID",(e,t)=>{t.pattern??(t.pattern=xG),Bt.init(e,t)}),fV=ue("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=wG),Bt.init(e,t)}),hV=ue("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=DG(t)),Bt.init(e,t)}),pV=ue("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=MG),Bt.init(e,t)}),mV=ue("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RG(t)),Bt.init(e,t)}),gV=ue("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=jG),Bt.init(e,t)}),vV=ue("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=kG),Bt.init(e,t),e._zod.bag.format="ipv4"}),yV=ue("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=AG),Bt.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})}}}),bV=ue("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=EG),Bt.init(e,t)}),xV=ue("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=TG),Bt.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,s]=r;if(!s)throw new Error;const l=Number(s);if(`${l}`!==s)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function _D(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const wV=ue("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=PG),Bt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{_D(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function SV(e){if(!xD.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return _D(n)}const jV=ue("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=xD),Bt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{SV(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),NV=ue("$ZodE164",(e,t)=>{t.pattern??(t.pattern=zG),Bt.init(e,t)});function CV(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 OV=ue("$ZodJWT",(e,t)=>{Bt.init(e,t),e._zod.check=n=>{CV(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),kD=ue("$ZodNumber",(e,t)=>{Gt.init(e,t),e._zod.pattern=e._zod.bag.pattern??jD,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),n}}),_V=ue("$ZodNumberFormat",(e,t)=>{FG.init(e,t),kD.init(e,t)}),kV=ue("$ZodBoolean",(e,t)=>{Gt.init(e,t),e._zod.pattern=$G,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}}),AV=ue("$ZodUnknown",(e,t)=>{Gt.init(e,t),e._zod.parse=n=>n}),EV=ue("$ZodNever",(e,t)=>{Gt.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function VA(e,t,n){e.issues.length&&t.issues.push(...yc(n,e.issues)),t.value[n]=e.value}const TV=ue("$ZodArray",(e,t)=>{Gt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const s=[];for(let l=0;l<i.length;l++){const c=i[l],f=t.element._zod.run({value:c,issues:[]},r);f instanceof Promise?s.push(f.then(h=>VA(h,n,l))):VA(f,n,l)}return s.length?Promise.all(s).then(()=>n):n}});function vm(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...yc(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function AD(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=W7(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function ED(e,t,n,r,i,s){const l=[],c=i.keySet,f=i.catchall._zod,h=f.def.type,p=f.optout==="optional";for(const g in t){if(c.has(g))continue;if(h==="never"){l.push(g);continue}const v=f.run({value:t[g],issues:[]},r);v instanceof Promise?e.push(v.then(y=>vm(y,n,g,t,p))):vm(v,n,g,t,p)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const PV=ue("$ZodObject",(e,t)=>{if(Gt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const f={...c};return Object.defineProperty(t,"shape",{value:f}),f}})}const r=y1(()=>AD(t));xt(e._zod,"propValues",()=>{const c=t.shape,f={};for(const h in c){const p=c[h]._zod;if(p.values){f[h]??(f[h]=new Set);for(const g of p.values)f[h].add(g)}}return f});const i=gm,s=t.catchall;let l;e._zod.parse=(c,f)=>{l??(l=r.value);const h=c.value;if(!i(h))return c.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),c;c.value={};const p=[],g=l.shape;for(const v of l.keys){const y=g[v],S=y._zod.optout==="optional",w=y._zod.run({value:h[v],issues:[]},f);w instanceof Promise?p.push(w.then(N=>vm(N,c,v,h,S))):vm(w,c,v,h,S)}return s?ED(p,h,c,f,r.value,e):p.length?Promise.all(p).then(()=>c):c}}),zV=ue("$ZodObjectJIT",(e,t)=>{PV.init(e,t);const n=e._zod.parse,r=y1(()=>AD(t)),i=v=>{const y=new eV(["shape","payload","ctx"]),S=r.value,w=A=>{const O=HA(A);return`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`};y.write("const input = payload.value;");const N=Object.create(null);let C=0;for(const A of S.keys)N[A]=`key_${C++}`;y.write("const newResult = {};");for(const A of S.keys){const O=N[A],P=HA(A),_=v[A]?._zod?.optout==="optional";y.write(`const ${O} = ${w(A)};`),_?y.write(`
|
|
59
|
+
if (${O}.issues.length) {
|
|
60
|
+
if (${P} in input) {
|
|
61
|
+
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
62
|
+
...iss,
|
|
63
|
+
path: iss.path ? [${P}, ...iss.path] : [${P}]
|
|
64
|
+
})));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (${O}.value === undefined) {
|
|
69
|
+
if (${P} in input) {
|
|
70
|
+
newResult[${P}] = undefined;
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
newResult[${P}] = ${O}.value;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
`):y.write(`
|
|
77
|
+
if (${O}.issues.length) {
|
|
78
|
+
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
79
|
+
...iss,
|
|
80
|
+
path: iss.path ? [${P}, ...iss.path] : [${P}]
|
|
81
|
+
})));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (${O}.value === undefined) {
|
|
85
|
+
if (${P} in input) {
|
|
86
|
+
newResult[${P}] = undefined;
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
newResult[${P}] = ${O}.value;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
`)}y.write("payload.value = newResult;"),y.write("return payload;");const E=y.compile();return(A,O)=>E(v,A,O)};let s;const l=gm,c=!hD.jitless,h=c&&Z7.value,p=t.catchall;let g;e._zod.parse=(v,y)=>{g??(g=r.value);const S=v.value;return l(S)?c&&h&&y?.async===!1&&y.jitless!==!0?(s||(s=i(t.shape)),v=s(v,y),p?ED([],S,v,y,g,e):v):n(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),v)}});function ZA(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const i=e.filter(s=>!vc(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(l=>qs(l,r,Bs())))}),t)}const MV=ue("$ZodUnion",(e,t)=>{Gt.init(e,t),xt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),xt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),xt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),xt(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>x1(s.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,s)=>{if(n)return r(i,s);let l=!1;const c=[];for(const f of t.options){const h=f._zod.run({value:i.value,issues:[]},s);if(h instanceof Promise)c.push(h),l=!0;else{if(h.issues.length===0)return h;c.push(h)}}return l?Promise.all(c).then(f=>ZA(f,i,e,s)):ZA(c,i,e,s)}}),RV=ue("$ZodIntersection",(e,t)=>{Gt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,s=t.left._zod.run({value:i,issues:[]},r),l=t.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||l instanceof Promise?Promise.all([s,l]).then(([f,h])=>YA(n,f,h)):YA(n,s,l)}});function kw(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(Mc(e)&&Mc(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),i={...e,...t};for(const s of r){const l=kw(e[s],t[s]);if(!l.valid)return{valid:!1,mergeErrorPath:[s,...l.mergeErrorPath]};i[s]=l.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],s=t[r],l=kw(i,s);if(!l.valid)return{valid:!1,mergeErrorPath:[r,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function YA(e,t,n){const r=new Map;let i;for(const c of t.issues)if(c.code==="unrecognized_keys"){i??(i=c);for(const f of c.keys)r.has(f)||r.set(f,{}),r.get(f).l=!0}else e.issues.push(c);for(const c of n.issues)if(c.code==="unrecognized_keys")for(const f of c.keys)r.has(f)||r.set(f,{}),r.get(f).r=!0;else e.issues.push(c);const s=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&i&&e.issues.push({...i,keys:s}),vc(e))return e;const l=kw(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const DV=ue("$ZodRecord",(e,t)=>{Gt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Mc(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const s=[],l=t.keyType._zod.values;if(l){n.value={};const c=new Set;for(const h of l)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){c.add(typeof h=="number"?h.toString():h);const p=t.valueType._zod.run({value:i[h],issues:[]},r);p instanceof Promise?s.push(p.then(g=>{g.issues.length&&n.issues.push(...yc(h,g.issues)),n.value[h]=g.value})):(p.issues.length&&n.issues.push(...yc(h,p.issues)),n.value[h]=p.value)}let f;for(const h in i)c.has(h)||(f=f??[],f.push(h));f&&f.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{n.value={};for(const c of Reflect.ownKeys(i)){if(c==="__proto__")continue;let f=t.keyType._zod.run({value:c,issues:[]},r);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&jD.test(c)&&f.issues.length){const g=t.keyType._zod.run({value:Number(c),issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(f=g)}if(f.issues.length){t.mode==="loose"?n.value[c]=i[c]:n.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(g=>qs(g,r,Bs())),input:c,path:[c],inst:e});continue}const p=t.valueType._zod.run({value:i[c],issues:[]},r);p instanceof Promise?s.push(p.then(g=>{g.issues.length&&n.issues.push(...yc(c,g.issues)),n.value[f.value]=g.value})):(p.issues.length&&n.issues.push(...yc(c,p.issues)),n.value[f.value]=p.value)}}return s.length?Promise.all(s).then(()=>n):n}}),IV=ue("$ZodEnum",(e,t)=>{Gt.init(e,t);const n=pD(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>Y7.has(typeof i)).map(i=>typeof i=="string"?Rc(i):i.toString()).join("|")})$`),e._zod.parse=(i,s)=>{const l=i.value;return r.has(l)||i.issues.push({code:"invalid_value",values:n,input:l,inst:e}),i}}),LV=ue("$ZodLiteral",(e,t)=>{if(Gt.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"?Rc(r):r?Rc(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),$V=ue("$ZodTransform",(e,t)=>{Gt.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new fD(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(n.value=l,n));if(i instanceof Promise)throw new Oc;return n.value=i,n}});function WA(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const TD=ue("$ZodOptional",(e,t)=>{Gt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",xt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),xt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${x1(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>WA(s,n.value)):WA(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),UV=ue("$ZodExactOptional",(e,t)=>{TD.init(e,t),xt(e._zod,"values",()=>t.innerType._zod.values),xt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),BV=ue("$ZodNullable",(e,t)=>{Gt.init(e,t),xt(e._zod,"optin",()=>t.innerType._zod.optin),xt(e._zod,"optout",()=>t.innerType._zod.optout),xt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${x1(n.source)}|null)$`):void 0}),xt(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)}),qV=ue("$ZodDefault",(e,t)=>{Gt.init(e,t),e._zod.optin="optional",xt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>QA(s,t)):QA(i,t)}});function QA(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const FV=ue("$ZodPrefault",(e,t)=>{Gt.init(e,t),e._zod.optin="optional",xt(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))}),KV=ue("$ZodNonOptional",(e,t)=>{Gt.init(e,t),xt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>XA(s,e)):XA(i,e)}});function XA(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 HV=ue("$ZodCatch",(e,t)=>{Gt.init(e,t),xt(e._zod,"optin",()=>t.innerType._zod.optin),xt(e._zod,"optout",()=>t.innerType._zod.optout),xt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(l=>qs(l,r,Bs()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>qs(s,r,Bs()))},input:n.value}),n.issues=[]),n)}}),GV=ue("$ZodPipe",(e,t)=>{Gt.init(e,t),xt(e._zod,"values",()=>t.in._zod.values),xt(e._zod,"optin",()=>t.in._zod.optin),xt(e._zod,"optout",()=>t.out._zod.optout),xt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(l=>hp(l,t.in,r)):hp(s,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(s=>hp(s,t.out,r)):hp(i,t.out,r)}});function hp(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const VV=ue("$ZodReadonly",(e,t)=>{Gt.init(e,t),xt(e._zod,"propValues",()=>t.innerType._zod.propValues),xt(e._zod,"values",()=>t.innerType._zod.values),xt(e._zod,"optin",()=>t.innerType?._zod?.optin),xt(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(JA):JA(i)}});function JA(e){return e.value=Object.freeze(e.value),e}const ZV=ue("$ZodCustom",(e,t)=>{wr.init(e,t),Gt.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(s=>eE(s,n,r,e));eE(i,n,r,e)}});function eE(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(Fd(i))}}var tE;class YV{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 WV(){return new YV}(tE=globalThis).__zod_globalRegistry??(tE.__zod_globalRegistry=WV());const Sd=globalThis.__zod_globalRegistry;function QV(e,t){return new e({type:"string",...Ie(t)})}function XV(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ie(t)})}function nE(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ie(t)})}function JV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ie(t)})}function eZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ie(t)})}function tZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ie(t)})}function nZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ie(t)})}function rZ(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ie(t)})}function iZ(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ie(t)})}function aZ(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ie(t)})}function sZ(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ie(t)})}function oZ(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ie(t)})}function lZ(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ie(t)})}function cZ(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ie(t)})}function uZ(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ie(t)})}function dZ(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ie(t)})}function fZ(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ie(t)})}function hZ(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ie(t)})}function pZ(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ie(t)})}function mZ(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ie(t)})}function gZ(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ie(t)})}function vZ(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ie(t)})}function yZ(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ie(t)})}function bZ(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ie(t)})}function xZ(e,t){return new e({type:"string",format:"date",check:"string_format",...Ie(t)})}function wZ(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ie(t)})}function SZ(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ie(t)})}function jZ(e,t){return new e({type:"number",checks:[],...Ie(t)})}function NZ(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ie(t)})}function CZ(e,t){return new e({type:"boolean",...Ie(t)})}function OZ(e){return new e({type:"unknown"})}function _Z(e,t){return new e({type:"never",...Ie(t)})}function rE(e,t){return new CD({check:"less_than",...Ie(t),value:e,inclusive:!1})}function Sb(e,t){return new CD({check:"less_than",...Ie(t),value:e,inclusive:!0})}function iE(e,t){return new OD({check:"greater_than",...Ie(t),value:e,inclusive:!1})}function jb(e,t){return new OD({check:"greater_than",...Ie(t),value:e,inclusive:!0})}function aE(e,t){return new qG({check:"multiple_of",...Ie(t),value:e})}function PD(e,t){return new KG({check:"max_length",...Ie(t),maximum:e})}function ym(e,t){return new HG({check:"min_length",...Ie(t),minimum:e})}function zD(e,t){return new GG({check:"length_equals",...Ie(t),length:e})}function kZ(e,t){return new VG({check:"string_format",format:"regex",...Ie(t),pattern:e})}function AZ(e){return new ZG({check:"string_format",format:"lowercase",...Ie(e)})}function EZ(e){return new YG({check:"string_format",format:"uppercase",...Ie(e)})}function TZ(e,t){return new WG({check:"string_format",format:"includes",...Ie(t),includes:e})}function PZ(e,t){return new QG({check:"string_format",format:"starts_with",...Ie(t),prefix:e})}function zZ(e,t){return new XG({check:"string_format",format:"ends_with",...Ie(t),suffix:e})}function Zc(e){return new JG({check:"overwrite",tx:e})}function MZ(e){return Zc(t=>t.normalize(e))}function RZ(){return Zc(e=>e.trim())}function DZ(){return Zc(e=>e.toLowerCase())}function IZ(){return Zc(e=>e.toUpperCase())}function LZ(){return Zc(e=>V7(e))}function $Z(e,t,n){return new e({type:"array",element:t,...Ie(n)})}function UZ(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ie(n)})}function BZ(e){const t=qZ(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Fd(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(Fd(i))}},e(n.value,n)));return t}function qZ(e,t){const n=new wr({check:"custom",...Ie(t)});return n._zod.check=e,n}function MD(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??Sd,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 pn(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const c=e._zod.toJSONSchema?.();if(c)l.schema=c;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,p);else{const v=l.schema,y=t.processors[i.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);y(e,t,v,p)}const g=e._zod.parent;g&&(l.ref||(l.ref=g),pn(g,t,p),t.seen.get(g).isParent=!0)}const f=t.metadataRegistry.get(e);return f&&Object.assign(l.schema,f),t.io==="input"&&er(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((r=l.schema).default??(r.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function RD(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const l of e.seen.entries()){const c=e.metadataRegistry.get(l[0])?.id;if(c){const f=r.get(c);if(f&&f!==l[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,l[0])}}const i=l=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=e.external.registry.get(l[0])?.id,v=e.external.uri??(S=>S);if(g)return{ref:v(g)};const y=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=y,{defId:y,ref:`${v("__shared")}#/${c}/${y}`}}if(l[1]===n)return{ref:"#"};const h=`#/${c}/`,p=l[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:h+p}},s=l=>{if(l[1].schema.$ref)return;const c=l[1],{ref:f,defId:h}=i(l);c.def={...c.schema},h&&(c.defId=h);const p=c.schema;for(const g in p)delete p[g];p.$ref=f};if(e.cycles==="throw")for(const l of e.seen.entries()){const c=l[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
93
|
+
|
|
94
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const c=l[1];if(t===l[0]){s(l);continue}if(e.external){const h=e.external.registry.get(l[0])?.id;if(t!==l[0]&&h){s(l);continue}}if(e.metadataRegistry.get(l[0])?.id){s(l);continue}if(c.cycle){s(l);continue}if(c.count>1&&e.reused==="ref"){s(l);continue}}}function DD(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const c=e.seen.get(l);if(c.ref===null)return;const f=c.def??c.schema,h={...f},p=c.ref;if(c.ref=null,p){r(p);const v=e.seen.get(p),y=v.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(y)):Object.assign(f,y),Object.assign(f,h),l._zod.parent===p)for(const w in f)w==="$ref"||w==="allOf"||w in h||delete f[w];if(y.$ref&&v.def)for(const w in f)w==="$ref"||w==="allOf"||w in v.def&&JSON.stringify(f[w])===JSON.stringify(v.def[w])&&delete f[w]}const g=l._zod.parent;if(g&&g!==p){r(g);const v=e.seen.get(g);if(v?.schema.$ref&&(f.$ref=v.schema.$ref,v.def))for(const y in f)y==="$ref"||y==="allOf"||y in v.def&&JSON.stringify(f[y])===JSON.stringify(v.def[y])&&delete f[y]}e.override({zodSchema:l,jsonSchema:f,path:c.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(l)}Object.assign(i,n.def??n.schema);const s=e.external?.defs??{};for(const l of e.seen.entries()){const c=l[1];c.def&&c.defId&&(s[c.defId]=c.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{const l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:bm(t,"input",e.processors),output:bm(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function er(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return er(r.element,n);if(r.type==="set")return er(r.valueType,n);if(r.type==="lazy")return er(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return er(r.innerType,n);if(r.type==="intersection")return er(r.left,n)||er(r.right,n);if(r.type==="record"||r.type==="map")return er(r.keyType,n)||er(r.valueType,n);if(r.type==="pipe")return er(r.in,n)||er(r.out,n);if(r.type==="object"){for(const i in r.shape)if(er(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(er(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(er(i,n))return!0;return!!(r.rest&&er(r.rest,n))}return!1}const FZ=(e,t={})=>n=>{const r=MD({...n,processors:t});return pn(e,r),RD(r,e),DD(r,e)},bm=(e,t,n={})=>r=>{const{libraryOptions:i,target:s}=r??{},l=MD({...i??{},target:s,io:t,processors:n});return pn(e,l),RD(l,e),DD(l,e)},KZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},HZ=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:s,maximum:l,format:c,patterns:f,contentEncoding:h}=e._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof l=="number"&&(i.maxLength=l),c&&(i.format=KZ[c]??c,i.format===""&&delete i.format,c==="time"&&delete i.format),h&&(i.contentEncoding=h),f&&f.size>0){const p=[...f];p.length===1?i.pattern=p[0].source:p.length>1&&(i.allOf=[...p.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},GZ=(e,t,n,r)=>{const i=n,{minimum:s,maximum:l,format:c,multipleOf:f,exclusiveMaximum:h,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 s=="number"&&(i.minimum=s,typeof p=="number"&&t.target!=="draft-04"&&(p>=s?delete i.minimum:delete i.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=h,i.exclusiveMaximum=!0):i.exclusiveMaximum=h),typeof l=="number"&&(i.maximum=l,typeof h=="number"&&t.target!=="draft-04"&&(h<=l?delete i.maximum:delete i.exclusiveMaximum)),typeof f=="number"&&(i.multipleOf=f)},VZ=(e,t,n,r)=>{n.type="boolean"},ZZ=(e,t,n,r)=>{n.not={}},YZ=(e,t,n,r)=>{},WZ=(e,t,n,r)=>{const i=e._zod.def,s=pD(i.entries);s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),n.enum=s},QZ=(e,t,n,r)=>{const i=e._zod.def,s=[];for(const l of i.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(l))}else s.push(l);if(s.length!==0)if(s.length===1){const l=s[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else s.every(l=>typeof l=="number")&&(n.type="number"),s.every(l=>typeof l=="string")&&(n.type="string"),s.every(l=>typeof l=="boolean")&&(n.type="boolean"),s.every(l=>l===null)&&(n.type="null"),n.enum=s},XZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},JZ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},eY=(e,t,n,r)=>{const i=n,s=e._zod.def,{minimum:l,maximum:c}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof c=="number"&&(i.maxItems=c),i.type="array",i.items=pn(s.element,t,{...r,path:[...r.path,"items"]})},tY=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="object",i.properties={};const l=s.shape;for(const h in l)i.properties[h]=pn(l[h],t,{...r,path:[...r.path,"properties",h]});const c=new Set(Object.keys(l)),f=new Set([...c].filter(h=>{const p=s.shape[h]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));f.size>0&&(i.required=Array.from(f)),s.catchall?._zod.def.type==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=pn(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},nY=(e,t,n,r)=>{const i=e._zod.def,s=i.inclusive===!1,l=i.options.map((c,f)=>pn(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",f]}));s?n.oneOf=l:n.anyOf=l},rY=(e,t,n,r)=>{const i=e._zod.def,s=pn(i.left,t,{...r,path:[...r.path,"allOf",0]}),l=pn(i.right,t,{...r,path:[...r.path,"allOf",1]}),c=h=>"allOf"in h&&Object.keys(h).length===1,f=[...c(s)?s.allOf:[s],...c(l)?l.allOf:[l]];n.allOf=f},iY=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="object";const l=s.keyType,f=l._zod.bag?.patterns;if(s.mode==="loose"&&f&&f.size>0){const p=pn(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const g of f)i.patternProperties[g.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=pn(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=pn(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const h=l._zod.values;if(h){const p=[...h].filter(g=>typeof g=="string"||typeof g=="number");p.length>0&&(i.required=p)}},aY=(e,t,n,r)=>{const i=e._zod.def,s=pn(i.innerType,t,r),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=i.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},sY=(e,t,n,r)=>{const i=e._zod.def;pn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},oY=(e,t,n,r)=>{const i=e._zod.def;pn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},lY=(e,t,n,r)=>{const i=e._zod.def;pn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},cY=(e,t,n,r)=>{const i=e._zod.def;pn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType;let l;try{l=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},uY=(e,t,n,r)=>{const i=e._zod.def,s=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;pn(s,t,r);const l=t.seen.get(e);l.ref=s},dY=(e,t,n,r)=>{const i=e._zod.def;pn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.readOnly=!0},ID=(e,t,n,r)=>{const i=e._zod.def;pn(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},fY=ue("ZodISODateTime",(e,t)=>{hV.init(e,t),Zt.init(e,t)});function hY(e){return bZ(fY,e)}const pY=ue("ZodISODate",(e,t)=>{pV.init(e,t),Zt.init(e,t)});function mY(e){return xZ(pY,e)}const gY=ue("ZodISOTime",(e,t)=>{mV.init(e,t),Zt.init(e,t)});function vY(e){return wZ(gY,e)}const yY=ue("ZodISODuration",(e,t)=>{gV.init(e,t),Zt.init(e,t)});function bY(e){return SZ(yY,e)}const xY=(e,t)=>{yD.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>sG(e,n)},flatten:{value:n=>aG(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,_w,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,_w,2)}},isEmpty:{get(){return e.issues.length===0}}})},fi=ue("ZodError",xY,{Parent:Error}),wY=S1(fi),SY=j1(fi),jY=Ig(fi),NY=Lg(fi),CY=cG(fi),OY=uG(fi),_Y=dG(fi),kY=fG(fi),AY=hG(fi),EY=pG(fi),TY=mG(fi),PY=gG(fi),Vt=ue("ZodType",(e,t)=>(Gt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:bm(e,"input"),output:bm(e,"output")}}),e.toJSONSchema=FZ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ys(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)=>Ws(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>wY(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>jY(e,n,r),e.parseAsync=async(n,r)=>SY(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>NY(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>CY(e,n,r),e.decode=(n,r)=>OY(e,n,r),e.encodeAsync=async(n,r)=>_Y(e,n,r),e.decodeAsync=async(n,r)=>kY(e,n,r),e.safeEncode=(n,r)=>AY(e,n,r),e.safeDecode=(n,r)=>EY(e,n,r),e.safeEncodeAsync=async(n,r)=>TY(e,n,r),e.safeDecodeAsync=async(n,r)=>PY(e,n,r),e.refine=(n,r)=>e.check(OW(n,r)),e.superRefine=n=>e.check(_W(n)),e.overwrite=n=>e.check(Zc(n)),e.optional=()=>lE(e),e.exactOptional=()=>hW(e),e.nullable=()=>cE(e),e.nullish=()=>lE(cE(e)),e.nonoptional=n=>bW(e,n),e.array=()=>_e(e),e.or=n=>aW([e,n]),e.and=n=>oW(e,n),e.transform=n=>uE(e,dW(n)),e.default=n=>gW(e,n),e.prefault=n=>yW(e,n),e.catch=n=>wW(e,n),e.pipe=n=>uE(e,n),e.readonly=()=>NW(e),e.describe=n=>{const r=e.clone();return Sd.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Sd.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Sd.get(e);const r=e.clone();return Sd.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),LD=ue("_ZodString",(e,t)=>{N1.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(r,i,s)=>HZ(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(kZ(...r)),e.includes=(...r)=>e.check(TZ(...r)),e.startsWith=(...r)=>e.check(PZ(...r)),e.endsWith=(...r)=>e.check(zZ(...r)),e.min=(...r)=>e.check(ym(...r)),e.max=(...r)=>e.check(PD(...r)),e.length=(...r)=>e.check(zD(...r)),e.nonempty=(...r)=>e.check(ym(1,...r)),e.lowercase=r=>e.check(AZ(r)),e.uppercase=r=>e.check(EZ(r)),e.trim=()=>e.check(RZ()),e.normalize=(...r)=>e.check(MZ(...r)),e.toLowerCase=()=>e.check(DZ()),e.toUpperCase=()=>e.check(IZ()),e.slugify=()=>e.check(LZ())}),zY=ue("ZodString",(e,t)=>{N1.init(e,t),LD.init(e,t),e.email=n=>e.check(XV(MY,n)),e.url=n=>e.check(rZ(RY,n)),e.jwt=n=>e.check(yZ(WY,n)),e.emoji=n=>e.check(iZ(DY,n)),e.guid=n=>e.check(nE(sE,n)),e.uuid=n=>e.check(JV(pp,n)),e.uuidv4=n=>e.check(eZ(pp,n)),e.uuidv6=n=>e.check(tZ(pp,n)),e.uuidv7=n=>e.check(nZ(pp,n)),e.nanoid=n=>e.check(aZ(IY,n)),e.guid=n=>e.check(nE(sE,n)),e.cuid=n=>e.check(sZ(LY,n)),e.cuid2=n=>e.check(oZ($Y,n)),e.ulid=n=>e.check(lZ(UY,n)),e.base64=n=>e.check(mZ(VY,n)),e.base64url=n=>e.check(gZ(ZY,n)),e.xid=n=>e.check(cZ(BY,n)),e.ksuid=n=>e.check(uZ(qY,n)),e.ipv4=n=>e.check(dZ(FY,n)),e.ipv6=n=>e.check(fZ(KY,n)),e.cidrv4=n=>e.check(hZ(HY,n)),e.cidrv6=n=>e.check(pZ(GY,n)),e.e164=n=>e.check(vZ(YY,n)),e.datetime=n=>e.check(hY(n)),e.date=n=>e.check(mY(n)),e.time=n=>e.check(vY(n)),e.duration=n=>e.check(bY(n))});function I(e){return QV(zY,e)}const Zt=ue("ZodStringFormat",(e,t)=>{Bt.init(e,t),LD.init(e,t)}),MY=ue("ZodEmail",(e,t)=>{iV.init(e,t),Zt.init(e,t)}),sE=ue("ZodGUID",(e,t)=>{nV.init(e,t),Zt.init(e,t)}),pp=ue("ZodUUID",(e,t)=>{rV.init(e,t),Zt.init(e,t)}),RY=ue("ZodURL",(e,t)=>{aV.init(e,t),Zt.init(e,t)}),DY=ue("ZodEmoji",(e,t)=>{sV.init(e,t),Zt.init(e,t)}),IY=ue("ZodNanoID",(e,t)=>{oV.init(e,t),Zt.init(e,t)}),LY=ue("ZodCUID",(e,t)=>{lV.init(e,t),Zt.init(e,t)}),$Y=ue("ZodCUID2",(e,t)=>{cV.init(e,t),Zt.init(e,t)}),UY=ue("ZodULID",(e,t)=>{uV.init(e,t),Zt.init(e,t)}),BY=ue("ZodXID",(e,t)=>{dV.init(e,t),Zt.init(e,t)}),qY=ue("ZodKSUID",(e,t)=>{fV.init(e,t),Zt.init(e,t)}),FY=ue("ZodIPv4",(e,t)=>{vV.init(e,t),Zt.init(e,t)}),KY=ue("ZodIPv6",(e,t)=>{yV.init(e,t),Zt.init(e,t)}),HY=ue("ZodCIDRv4",(e,t)=>{bV.init(e,t),Zt.init(e,t)}),GY=ue("ZodCIDRv6",(e,t)=>{xV.init(e,t),Zt.init(e,t)}),VY=ue("ZodBase64",(e,t)=>{wV.init(e,t),Zt.init(e,t)}),ZY=ue("ZodBase64URL",(e,t)=>{jV.init(e,t),Zt.init(e,t)}),YY=ue("ZodE164",(e,t)=>{NV.init(e,t),Zt.init(e,t)}),WY=ue("ZodJWT",(e,t)=>{OV.init(e,t),Zt.init(e,t)}),$D=ue("ZodNumber",(e,t)=>{kD.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(r,i,s)=>GZ(e,r,i),e.gt=(r,i)=>e.check(iE(r,i)),e.gte=(r,i)=>e.check(jb(r,i)),e.min=(r,i)=>e.check(jb(r,i)),e.lt=(r,i)=>e.check(rE(r,i)),e.lte=(r,i)=>e.check(Sb(r,i)),e.max=(r,i)=>e.check(Sb(r,i)),e.int=r=>e.check(oE(r)),e.safe=r=>e.check(oE(r)),e.positive=r=>e.check(iE(0,r)),e.nonnegative=r=>e.check(jb(0,r)),e.negative=r=>e.check(rE(0,r)),e.nonpositive=r=>e.check(Sb(0,r)),e.multipleOf=(r,i)=>e.check(aE(r,i)),e.step=(r,i)=>e.check(aE(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 Oe(e){return jZ($D,e)}const QY=ue("ZodNumberFormat",(e,t)=>{_V.init(e,t),$D.init(e,t)});function oE(e){return NZ(QY,e)}const XY=ue("ZodBoolean",(e,t)=>{kV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>VZ(e,n,r)});function Ht(e){return CZ(XY,e)}const JY=ue("ZodUnknown",(e,t)=>{AV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>YZ()});function xm(){return OZ(JY)}const eW=ue("ZodNever",(e,t)=>{EV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ZZ(e,n,r)});function tW(e){return _Z(eW,e)}const nW=ue("ZodArray",(e,t)=>{TV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>eY(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(ym(n,r)),e.nonempty=n=>e.check(ym(1,n)),e.max=(n,r)=>e.check(PD(n,r)),e.length=(n,r)=>e.check(zD(n,r)),e.unwrap=()=>e.element});function _e(e,t){return $Z(nW,e,t)}const rW=ue("ZodObject",(e,t)=>{zV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>tY(e,n,r,i),xt(e,"shape",()=>t.shape),e.keyof=()=>At(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:xm()}),e.loose=()=>e.clone({...e._zod.def,catchall:xm()}),e.strict=()=>e.clone({...e._zod.def,catchall:tW()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>eG(e,n),e.safeExtend=n=>tG(e,n),e.merge=n=>nG(e,n),e.pick=n=>X7(e,n),e.omit=n=>J7(e,n),e.partial=(...n)=>rG(UD,e,n[0]),e.required=(...n)=>iG(BD,e,n[0])});function Ne(e,t){const n={type:"object",shape:e??{},...Ie(t)};return new rW(n)}const iW=ue("ZodUnion",(e,t)=>{MV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>nY(e,n,r,i),e.options=t.options});function aW(e,t){return new iW({type:"union",options:e,...Ie(t)})}const sW=ue("ZodIntersection",(e,t)=>{RV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>rY(e,n,r,i)});function oW(e,t){return new sW({type:"intersection",left:e,right:t})}const lW=ue("ZodRecord",(e,t)=>{DV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>iY(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function df(e,t,n){return new lW({type:"record",keyType:e,valueType:t,...Ie(n)})}const Aw=ue("ZodEnum",(e,t)=>{IV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(r,i,s)=>WZ(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const s={};for(const l of r)if(n.has(l))s[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new Aw({...t,checks:[],...Ie(i),entries:s})},e.exclude=(r,i)=>{const s={...t.entries};for(const l of r)if(n.has(l))delete s[l];else throw new Error(`Key ${l} not found in enum`);return new Aw({...t,checks:[],...Ie(i),entries:s})}});function At(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Aw({type:"enum",entries:n,...Ie(t)})}const cW=ue("ZodLiteral",(e,t)=>{LV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>QZ(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 Kd(e,t){return new cW({type:"literal",values:Array.isArray(e)?e:[e],...Ie(t)})}const uW=ue("ZodTransform",(e,t)=>{$V.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>JZ(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new fD(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Fd(s,n.value,t));else{const l=s;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(Fd(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n)):(n.value=i,n)}});function dW(e){return new uW({type:"transform",transform:e})}const UD=ue("ZodOptional",(e,t)=>{TD.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ID(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function lE(e){return new UD({type:"optional",innerType:e})}const fW=ue("ZodExactOptional",(e,t)=>{UV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ID(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function hW(e){return new fW({type:"optional",innerType:e})}const pW=ue("ZodNullable",(e,t)=>{BV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>aY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function cE(e){return new pW({type:"nullable",innerType:e})}const mW=ue("ZodDefault",(e,t)=>{qV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>oY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gW(e,t){return new mW({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():gD(t)}})}const vW=ue("ZodPrefault",(e,t)=>{FV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function yW(e,t){return new vW({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():gD(t)}})}const BD=ue("ZodNonOptional",(e,t)=>{KV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>sY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function bW(e,t){return new BD({type:"nonoptional",innerType:e,...Ie(t)})}const xW=ue("ZodCatch",(e,t)=>{HV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>cY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function wW(e,t){return new xW({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const SW=ue("ZodPipe",(e,t)=>{GV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uY(e,n,r,i),e.in=t.in,e.out=t.out});function uE(e,t){return new SW({type:"pipe",in:e,out:t})}const jW=ue("ZodReadonly",(e,t)=>{VV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dY(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function NW(e){return new jW({type:"readonly",innerType:e})}const CW=ue("ZodCustom",(e,t)=>{ZV.init(e,t),Vt.init(e,t),e._zod.processJSONSchema=(n,r,i)=>XZ(e,n)});function OW(e,t={}){return UZ(CW,e,t)}function _W(e){return BZ(e)}Ne({maxConcurrency:Oe().int().positive(),maxRequestsPerMinute:Oe().int().positive(),maxRequestsPerDay:Oe().int().positive()});const Yc=I().min(1);I().min(1);const C1=Ne({label:I().min(1),city:I().min(1),region:I().min(1),country:I().length(2),timezone:I().optional()}),qD=At(["citation.lost","citation.gained","run.completed","run.failed"]);Ne({id:I(),projectId:I(),channel:Kd("webhook"),url:I().url(),urlDisplay:I(),urlHost:I(),events:_e(qD),enabled:Ht().default(!0),webhookSecret:I().optional(),createdAt:I(),updatedAt:I()});const FD=At(["cli","api","config-file"]);function kW(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 AW(e,t){return t?e.some(n=>n.label===t):!0}Ne({displayName:I().min(1),canonicalDomain:I().min(1),ownedDomains:_e(I().min(1)).optional(),country:I().length(2),language:I().min(2),tags:_e(I()).optional(),labels:df(I(),I()).optional(),providers:_e(Yc).optional(),locations:_e(C1).optional(),defaultLocation:I().nullable().optional(),configSource:FD.optional()});Ne({id:I(),name:I(),displayName:I().optional(),canonicalDomain:I(),ownedDomains:_e(I()).default([]),country:I().length(2),language:I().min(2),tags:_e(I()).default([]),labels:df(I(),I()).default({}),locations:_e(C1).default([]),defaultLocation:I().nullable().optional(),configSource:FD.default("cli"),configRevision:Oe().int().positive().default(1),createdAt:I().optional(),updatedAt:I().optional()});function Ew(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function EW(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],n=new Set,r=[];for(const i of t){const s=i.trim();if(!s)continue;const l=Ew(s);n.has(l)||(n.add(l),r.push(s))}return r}const TW=Ne({name:I().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:df(I(),I()).optional().default({})}),PW=Ne({preset:I().optional(),cron:I().optional(),timezone:I().optional().default("UTC"),providers:_e(Yc).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),zW=Ne({channel:Kd("webhook"),url:I().url(),events:_e(qD).min(1)}),MW=Ne({gsc:Ne({propertyUrl:I()}).optional(),syncSchedule:Ne({preset:I().optional(),cron:I().optional()}).optional()}).optional(),RW=Ne({displayName:I().min(1),canonicalDomain:I().min(1),ownedDomains:_e(I().min(1)).optional().default([]),country:I().length(2),language:I().min(2),keywords:_e(I().min(1)).optional().default([]),competitors:_e(I().min(1)).optional().default([]),providers:_e(Yc).optional().default([]),locations:_e(C1).optional().default([]),defaultLocation:I().optional(),schedule:PW,notifications:_e(zW).optional().default([]),google:MW}).superRefine((e,t)=>{const n=kW(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),AW(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});Ne({apiVersion:Kd("canonry/v1"),kind:Kd("Project"),metadata:TW,spec:RW});const DW=At(["gsc","ga4"]);Ne({id:I(),domain:I(),connectionType:DW,propertyId:I().nullable().optional(),sitemapUrl:I().nullable().optional(),scopes:_e(I()).default([]),createdAt:I(),updatedAt:I()});Ne({date:I(),query:I(),page:I(),country:I().nullable().optional(),device:I().nullable().optional(),clicks:Oe(),impressions:Oe(),ctr:Oe(),position:Oe()});const Tw=Ne({id:I(),url:I(),indexingState:I().nullable().optional(),verdict:I().nullable().optional(),coverageState:I().nullable().optional(),pageFetchState:I().nullable().optional(),robotsTxtState:I().nullable().optional(),crawlTime:I().nullable().optional(),lastCrawlResult:I().nullable().optional(),isMobileFriendly:Ht().nullable().optional(),richResults:_e(I()).default([]),inspectedAt:I()});At(["stable","reindexed","deindexed","still-missing","new"]);const IW=Ne({url:I(),previousState:I().nullable(),currentState:I().nullable(),transitionDate:I()}),LW=Ne({reason:I(),count:Oe(),urls:_e(Tw).default([])});Ne({summary:Ne({total:Oe(),indexed:Oe(),notIndexed:Oe(),deindexed:Oe(),percentage:Oe()}),lastInspectedAt:I().nullable(),indexed:_e(Tw).default([]),notIndexed:_e(Tw).default([]),deindexed:_e(IW).default([]),reasonGroups:_e(LW).default([])});Ne({url:I(),type:At(["URL_UPDATED","URL_DELETED"]),notifiedAt:I()});Ne({url:I(),type:At(["URL_UPDATED","URL_DELETED"]),notifiedAt:I(),status:At(["success","error"]),error:I().optional()});Ne({date:I(),indexed:Oe(),notIndexed:Oe(),reasonBreakdown:df(I(),Oe()).default({})});Ne({id:I(),domain:I(),siteUrl:I().nullable().optional(),createdAt:I(),updatedAt:I()});const Nb=Ne({id:I(),url:I(),httpCode:Oe().nullable().optional(),inIndex:Ht().nullable().optional(),lastCrawledDate:I().nullable().optional(),inIndexDate:I().nullable().optional(),inspectedAt:I(),documentSize:Oe().nullable().optional(),anchorCount:Oe().nullable().optional(),discoveryDate:I().nullable().optional()});Ne({summary:Ne({total:Oe(),indexed:Oe(),notIndexed:Oe(),unknown:Oe().optional(),percentage:Oe()}),lastInspectedAt:I().nullable(),indexed:_e(Nb).default([]),notIndexed:_e(Nb).default([]),unknown:_e(Nb).default([]).optional()});Ne({query:I(),impressions:Oe(),clicks:Oe(),ctr:Oe(),averagePosition:Oe()});Ne({url:I(),status:At(["success","error"]),submittedAt:I(),error:I().optional()});const Wc=At(["live","staging"]);Ne({projectName:I(),url:I(),stagingUrl:I().optional(),username:I(),defaultEnv:Wc,createdAt:I(),updatedAt:I()});const dE=Ne({url:I(),reachable:Ht(),pageCount:Oe().nullable().optional(),version:I().nullable().optional(),error:I().nullable().optional(),plugins:_e(I()).optional(),authenticatedUser:Ne({id:Oe(),slug:I()}).nullable().optional()});Ne({connected:Ht(),projectName:I(),defaultEnv:Wc,live:dE.nullable(),staging:dE.nullable(),adminUrl:I().nullable().optional()});const $W=Ne({id:Oe(),slug:I(),title:I(),status:I(),modifiedAt:I().nullable().optional(),link:I().nullable().optional()}),KD=Ne({title:I().nullable(),description:I().nullable(),noindex:Ht().nullable(),writable:Ht().default(!1),writeTargets:_e(I()).default([])}),UW=Ne({type:I(),json:df(I(),xm())}),BW=$W.extend({env:Wc,content:I(),seo:KD,schemaBlocks:_e(UW).default([])}),fE=BW.extend({contentHash:I(),contentSnippet:I()}),HD=Ne({manualRequired:Kd(!0),targetUrl:I(),adminUrl:I().nullable().optional(),content:I(),nextSteps:_e(I()).default([])}),qW=Ne({slug:I(),severity:At(["high","medium","low"]),code:At(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:I()});Ne({slug:I(),title:I(),status:I(),wordCount:Oe(),seo:KD,schemaPresent:Ht(),issues:_e(qW).default([])});const FW=Ne({slug:I(),status:At(["applied","skipped","manual"]),error:I().optional(),manualAssist:HD.optional()});Ne({env:Wc,strategy:At(["plugin","manual"]),results:_e(FW)});const KW=Ne({slug:I(),status:At(["deployed","stripped","skipped","failed"]),schemasInjected:_e(I()).optional(),manualAssist:HD.optional(),error:I().optional()});Ne({env:Wc,results:_e(KW)});const HW=Ne({slug:I(),title:I(),canonrySchemas:_e(I()),thirdPartySchemas:_e(I()),hasCanonrySchema:Ht()});Ne({env:Wc,pages:_e(HW)});const GW=Ne({name:I(),status:At(["completed","skipped","failed"]),summary:I().optional(),error:I().optional()});Ne({projectName:I(),steps:_e(GW)});Ne({slug:I(),live:fE,staging:fE,hasDifferences:Ht(),differences:Ne({title:Ht(),slug:Ht(),content:Ht(),seoTitle:Ht(),seoDescription:Ht(),noindex:Ht(),schema:Ht()})});const GD=At(["queued","running","completed","partial","failed","cancelled"]),tn=GD.enum,VD=At(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),ei=VD.enum,ZD=At(["manual","scheduled","config-apply"]),Hp=ZD.enum,YD=At(["cited","not-cited"]);YD.enum;const WD=At(["visible","not-visible"]);WD.enum;const QD=At(["new","cited","lost","emerging","not-cited"]);QD.enum;Ne({id:I(),projectId:I(),kind:VD,status:GD,trigger:ZD.default("manual"),location:I().nullable().optional(),startedAt:I().nullable().optional(),finishedAt:I().nullable().optional(),error:I().nullable().optional(),createdAt:I()});const XD=Ne({uri:I(),title:I()});Ne({id:I(),runId:I(),keywordId:I(),keyword:I().optional(),provider:Yc,citationState:YD,answerMentioned:Ht().optional(),visibilityState:WD.optional(),transition:QD.optional(),answerText:I().nullable().optional(),citedDomains:_e(I()).default([]),competitorOverlap:_e(I()).default([]),recommendedCompetitors:_e(I()).default([]),matchedTerms:_e(I()).default([]),groundingSources:_e(XD).default([]),searchQueries:_e(I()).default([]),model:I().nullable().optional(),location:I().nullable().optional(),createdAt:I()});Ne({id:I(),projectId:I().nullable().optional(),actor:I(),action:I(),entityType:I(),entityId:I().nullable().optional(),diff:xm().optional(),createdAt:I()});const VW=At(["yes","no","unknown","not-mentioned"]);Ne({companyName:I().min(1),domain:I().min(1),phrases:_e(I().min(1)).optional().default([]),competitors:_e(I().min(1)).optional().default([])});const ZW=Ne({name:I(),count:Oe().int().nonnegative()}),YW=Ne({id:I(),name:I(),weight:Oe(),score:Oe(),grade:I(),status:At(["pass","partial","fail"]),findings:_e(Ne({type:I(),message:I()})).default([]),recommendations:_e(I()).default([])}),WW=Ne({url:I(),finalUrl:I(),auditedAt:I(),overallScore:Oe(),overallGrade:I(),summary:I(),factors:_e(YW).default([])}),QW=Ne({industry:I(),summary:I(),services:_e(I()).default([]),categoryTerms:_e(I()).default([])}),XW=Ne({provider:I(),displayName:I(),model:I().nullable().optional(),mentioned:Ht(),cited:Ht(),describedAccurately:VW,accuracyNotes:I().nullable().optional(),incorrectClaims:_e(I()).default([]),recommendedCompetitors:_e(I()).default([]),citedDomains:_e(I()).default([]),groundingSources:_e(XD).default([]),searchQueries:_e(I()).default([]),answerText:I(),error:I().nullable().optional()}),JW=Ne({phrase:I(),providerResults:_e(XW).default([])}),eQ=Ne({totalQueries:Oe().int().nonnegative(),totalProviders:Oe().int().nonnegative(),totalComparisons:Oe().int().nonnegative(),mentionCount:Oe().int().nonnegative(),citationCount:Oe().int().nonnegative(),topCompetitors:_e(ZW).default([]),visibilityGap:I(),whatThisMeans:_e(I()).default([]),recommendedActions:_e(I()).default([])});Ne({companyName:I(),domain:I(),homepageUrl:I(),generatedAt:I(),phrases:_e(I()).default([]),competitors:_e(I()).default([]),profile:QW,audit:WW,queryResults:_e(JW).default([]),summary:eQ});Ne({id:I(),projectId:I(),cronExpr:I(),preset:I().nullable().optional(),timezone:I().default("UTC"),enabled:Ht().default(!0),providers:_e(Yc).default([]),lastRunAt:I().nullable().optional(),nextRunAt:I().nullable().optional(),createdAt:I(),updatedAt:I()});Ne({preset:I().optional(),cron:I().optional(),timezone:I().optional().default("UTC"),enabled:Ht().optional().default(!0),providers:_e(Yc).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const tQ=At(["answer","citation"]),Ts=tQ.enum;Ne({id:I(),projectId:I(),propertyId:I(),clientEmail:I(),connected:Ht(),createdAt:I(),updatedAt:I()});Ne({date:I(),landingPage:I(),sessions:Oe(),organicSessions:Oe(),users:Oe()});const JD=At(["session","first_user","manual_utm"]),nQ=Ne({source:I(),medium:I(),sessions:Oe(),users:Oe(),sourceDimension:JD}),rQ=Ne({source:I(),medium:I(),sessions:Oe(),users:Oe(),channelGroup:I()});Ne({totalSessions:Oe(),totalOrganicSessions:Oe(),totalUsers:Oe(),topPages:_e(Ne({landingPage:I(),sessions:Oe(),organicSessions:Oe(),users:Oe()})),aiReferrals:_e(nQ),aiSessionsDeduped:Oe(),aiUsersDeduped:Oe(),socialReferrals:_e(rQ),socialSessions:Oe(),socialUsers:Oe(),organicSharePct:Oe(),aiSharePct:Oe(),socialSharePct:Oe(),lastSyncedAt:I().nullable()});Ne({date:I(),source:I(),medium:I(),sessions:Oe(),users:Oe(),sourceDimension:JD});Ne({date:I(),source:I(),medium:I(),sessions:Oe(),users:Oe(),channelGroup:I()});Ne({date:I(),sessions:Oe(),organicSessions:Oe(),users:Oe()});function hE(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}function Ln({text:e}){const[t,n]=x.useState(null),r=x.useRef(null),i=x.useCallback(()=>{if(!r.current)return;const l=r.current.getBoundingClientRect();n({top:l.top,left:l.left+l.width/2})},[]),s=x.useCallback(()=>n(null),[]);return u.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:i,onMouseLeave:s,onFocus:i,onBlur:s,children:[u.jsxs("svg",{ref:r,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[u.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),u.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),t!==null&&cl.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 pE(e,t){const n=iQ(t),r=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(h=>h.startsWith("**")&&h.endsWith("**")?{type:"bold",value:h.slice(2,-2)}:{type:"text",value:h}),i=n.flatMap(h=>h.terms).filter(h=>h.trim().length>1);if(i.length===0)return r.map((h,p)=>h.type==="bold"?wi.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},h.value):h.value).filter(Boolean);const l=[...i].sort((h,p)=>p.length-h.length).map(h=>h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${l.join("|")})`,"gi"),f=new Map;for(const h of n)for(const p of h.terms){const g=p.toLowerCase();f.has(g)||f.set(g,h.className)}return r.flatMap((h,p)=>h.value.split(c).map((v,y)=>{if(!v)return null;if(y%2===1){const w=f.get(v.toLowerCase())??"answer-highlight";return h.type==="bold"?wi.createElement("mark",{key:`hl-${p}-${y}`,className:w},wi.createElement("strong",{className:"text-zinc-200 font-semibold"},v)):wi.createElement("mark",{key:`hl-${p}-${y}`,className:w},v)}return h.type==="bold"?wi.createElement("strong",{key:`b-${p}-${y}`,className:"text-zinc-200 font-semibold"},v):v})).filter(Boolean)}function iQ(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Cb(e,t){switch(e){case"new":return"First observation";case"emerging":return"First visibility";case"lost":return"Lost since last run";default:return t==="visible"?"Visible in latest run":t==="pending"?"Awaiting first run":"Not visible in latest run"}}function aQ({evidence:e,project:t,onClose:n}){const[r,i]=x.useState(!1),[s,l]=x.useState("mentions"),[c,f]=x.useState(-1),[h,p]=x.useState(null),[g,v]=x.useState(!1),[y,S]=x.useState({}),w=EW(t.project),N=new Set(w.map(Ew)),C=e.runHistory,E=C.length>1,[A,O]=x.useState(null),P=x.useRef(!1);x.useEffect(()=>{if(P.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const Y=C.at(-1);Y&&(P.current=!0,zc(Y.runId).then(W=>{const oe=W.snapshots.find(xe=>xe.keyword===e.keyword&&xe.provider===e.provider);oe&&O({citationState:oe.citationState,answerMentioned:oe.answerMentioned,visibilityState:oe.visibilityState,visibilityTransition:Y.visibilityTransition,provider:oe.provider,model:oe.model??e.model,answerSnippet:oe.answerText??e.answerSnippet,citedDomains:oe.citedDomains??e.citedDomains,competitorDomains:oe.competitorOverlap??e.competitorDomains,recommendedCompetitors:oe.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:oe.matchedTerms??e.matchedTerms??[],groundingSources:oe.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,C]);const z=c>=0&&h!==null,_=z?h:A||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:C.at(-1)?.visibilityTransition,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,recommendedCompetitors:e.recommendedCompetitors??[],matchedTerms:e.matchedTerms??[],groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},T=_.visibilityState==="pending"||_.citationState==="pending",R=T?!1:_.visibilityState!=null?_.visibilityState==="visible":_.answerMentioned!=null?_.answerMentioned:_.citationState==="cited"||_.citationState==="emerging",B=_.answerMentioned!=null||_.visibilityState!=null||_.recommendedCompetitors.length>0,$=_.citedDomains.length>0||_.groundingSources.length>0||_.evidenceUrls.length>0,L=t.project.displayName||t.project.name,ne=[...w.map(Ew),L,L.split(" ").slice(0,2).join(" "),..._.matchedTerms].filter(Y=>Y.trim().length>2),he=[..._.competitorDomains.flatMap(Y=>{const W=Y.split(".")[0];return W&&W.length>=4?[W]:[]}),..._.recommendedCompetitors].filter(Y=>Y.trim().length>2),ge=[{terms:ne,className:"answer-highlight-brand"},...he.length>0?[{terms:he,className:"answer-highlight-competitor"}]:[]],H=T?"pending":_.visibilityTransition==="lost"?"lost":R?"cited":"not-cited",ie=x.useRef(0),pe=x.useCallback(async Y=>{const W=++ie.current;if(Y===-1||Y===C.length-1){f(-1),p(null),i(!1);return}f(Y),i(!1);const oe=C[Y],xe=`${oe.runId}::${e.keyword}::${e.provider}`;if(y[xe]){p(y[xe]);return}v(!0);try{const Se=await zc(oe.runId);if(W!==ie.current)return;const Q=Se.snapshots.find(je=>je.keyword===e.keyword&&je.provider===e.provider)??Se.snapshots.find(je=>je.keyword===e.keyword),le=Q?{citationState:Q.citationState,answerMentioned:Q.answerMentioned,visibilityState:Q.visibilityState,visibilityTransition:oe.visibilityTransition,provider:Q.provider,model:Q.model??null,answerSnippet:Q.answerText??"",citedDomains:Q.citedDomains,competitorDomains:Q.competitorOverlap,recommendedCompetitors:Q.recommendedCompetitors??[],matchedTerms:Q.matchedTerms??[],groundingSources:Q.groundingSources,evidenceUrls:[],changeLabel:Cb(oe.visibilityTransition,oe.visibilityState),summary:""}:{citationState:oe.citationState,answerMentioned:oe.answerMentioned,visibilityState:oe.visibilityState,visibilityTransition:oe.visibilityTransition,provider:e.provider,model:oe.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Cb(oe.visibilityTransition,oe.visibilityState),summary:"Snapshot data not available for this run."};S(je=>({...je,[xe]:le})),p(le)}catch{if(W!==ie.current)return;p({citationState:oe.citationState,answerMentioned:oe.answerMentioned,visibilityState:oe.visibilityState,visibilityTransition:oe.visibilityTransition,provider:e.provider,model:oe.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Cb(oe.visibilityTransition,oe.visibilityState),summary:"Failed to load historical run data."})}finally{W===ie.current&&v(!1)}},[C,e.keyword,e.provider,y]),q=(z||e.historyScope!=="provider")&&_.model?`${_.provider} (${_.model}) · ${_.changeLabel.toLowerCase()}`:`${_.provider} · ${_.changeLabel.toLowerCase()}`,D=!z&&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(" · "):"",G=R?{label:"Visible in answer",title:"Your brand or domain is mentioned in this answer",meta:q}:_.visibilityTransition==="lost"?{label:"Visibility lost",title:"Your brand no longer appears in this answer",meta:q}:T?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not visible in answer",title:"Your brand or domain was not mentioned in this answer",meta:q},ae=()=>{if(!_.answerSnippet)return null;const Y=_.answerSnippet.split(`
|
|
95
|
+
`),W=[];let oe=[],xe=0;const Se=()=>{if(oe.length===0)return;const Q=oe.join(" ").trim();Q&&W.push(u.jsx("p",{className:W.length>0?"mt-2.5":"",children:pE(Q,ge)},xe++)),oe=[]};for(const Q of Y){const le=Q.trim();if(/^[-\u2013\u2014]{3,}$/.test(le)){Se(),W.push(u.jsx("hr",{className:"border-zinc-800/60 my-3"},xe++));continue}const je=le.match(/^(#{1,3})\s+(.+)$/);if(je){Se();const V=je[1].length,De=je[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||je[2],Ee=V===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":V===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";W.push(u.jsx("p",{className:Ee,children:pE(De,ge)},xe++));continue}if(le===""){Se();continue}oe.push(le)}return Se(),W};return u.jsx(iD,{open:!0,onOpenChange:Y=>{Y||n()},children:u.jsxs(aD,{children:[u.jsx(m1,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),u.jsxs(g1,{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," ","·"," ",_.provider||"All providers"]}),u.jsx(v1,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),u.jsxs(oD,{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(Ag,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]}),E&&u.jsxs("div",{className:"evidence-modal-timeline",children:[u.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),u.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:C.map((Y,W)=>{const oe=c===-1&&W===C.length-1||c===W,xe=Y.visibilityState??(Y.answerMentioned?"visible":"not-visible"),Se=Y.visibilityTransition??xe,Q=xe==="visible"?"bg-emerald-400":Se==="emerging"?"bg-amber-400":Se==="lost"?"bg-rose-400":"bg-zinc-600",je=new Date(Y.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),V=!!(Y.model&&W>0&&C[W-1]?.model&&C[W-1].model!==Y.model);return u.jsxs("button",{type:"button",className:`evidence-run-dot ${oe?"evidence-run-dot--selected":""}`,onClick:()=>pe(W===C.length-1?-1:W),"aria-label":[`Run ${je}: ${xe}`,Y.model?`model ${Y.model}`:null,V?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":oe,children:[u.jsx("span",{className:`size-2 rounded-full ${Q} ${V?"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:je})]},W)})}),c>=0&&c<C.length&&u.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(C[c].createdAt).toLocaleString()," ","—"," ",u.jsx("span",{className:"capitalize",children:C[c].visibilityState??(C[c].answerMentioned?"visible":"not-visible")}),u.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>pe(-1),children:["←"," Back to latest"]})]}),!z&&(e.modelTransitions?.length??0)>0&&u.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(Y=>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:`${Y.fromModel??"unknown"} -> ${Y.toModel??"unknown"} on ${new Date(Y.createdAt).toLocaleDateString()}`},`${Y.runId}:${Y.toModel??"unknown"}`))})]}),u.jsxs("div",{className:"evidence-modal-body",children:[g&&u.jsxs("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:["Loading historical run data","…"]}),!g&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"evidence-modal-main",children:[u.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${H}`,children:[u.jsx("p",{className:`evidence-position-label evidence-position-label--${H}`,children:G.label}),u.jsx("p",{className:`evidence-position-title evidence-position-title--${H}`,children:G.title}),u.jsx("p",{className:"evidence-position-meta",children:G.meta}),D&&u.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:D})]}),_.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:ae()}),_.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"})]}),!_.answerSnippet&&!g&&u.jsx("div",{className:"rounded-lg border border-zinc-800/40 bg-zinc-900/20 px-4 py-8 text-center text-zinc-600 text-sm",children:"No answer text recorded for this run"}),!z&&e.relatedTechnicalSignals.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"drawer-section-label",children:R?"Why you're visible":"What to fix"}),u.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((Y,W)=>u.jsxs("div",{className:"action-item",children:[u.jsx("svg",{className:`action-item-icon ${R?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:R?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:Y})]},W))})]}),_.summary&&u.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:_.summary})]}),u.jsxs("div",{className:"evidence-modal-sidebar",children:[(B||$)&&u.jsxs("div",{className:"sidebar-tabs",children:[u.jsx("button",{className:`sidebar-tab ${s==="mentions"?"sidebar-tab--active":""}`,onClick:()=>l("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),u.jsx("button",{className:`sidebar-tab ${s==="sources"?"sidebar-tab--active":""}`,onClick:()=>l("sources"),type:"button",title:"Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.",children:"Sources"})]}),s==="mentions"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsxs("div",{className:"drawer-section-label flex items-center",children:[u.jsx("span",{children:"Answer visibility"}),u.jsx(Ln,{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--${R?"visible":"not-visible"}`,children:[u.jsx("span",{className:"mention-status-icon",children:T?"…":R?"✓":"—"}),u.jsx("span",{className:"mention-status-label",children:T?"Pending":R?"Visible":"Not visible"})]}),_.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:_.matchedTerms.map(Y=>u.jsx("span",{className:"mention-chip mention-chip--brand",children:Y},Y))})]}),!T&&!R&&_.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:ne.map(Y=>u.jsx("span",{className:"mention-chip mention-chip--muted",children:Y},Y))}),u.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(_.recommendedCompetitors.length>0||_.competitorDomains.length>0)&&u.jsxs("div",{children:[u.jsxs("div",{className:"drawer-section-label flex items-center",children:[u.jsx("span",{children:"Competitors in answer"}),u.jsx(Ln,{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 Y=_.competitorDomains.map(xe=>xe.replace(/^www\./,"")),W=new Set(Y.map(xe=>hE(xe.replace(/\.[^.]+$/,""))));return[..._.recommendedCompetitors.filter(xe=>!W.has(hE(xe))),...Y].map(xe=>u.jsx("span",{className:"mention-chip mention-chip--competitor",children:xe},xe))})()})]})]}),s==="sources"&&u.jsxs(u.Fragment,{children:[_.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(Ln,{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:_.citedDomains.map((Y,W)=>{const oe=Y.toLowerCase().replace(/^www\./,""),xe=N.has(oe),Se=!xe&&_.competitorDomains.some(le=>le.toLowerCase().replace(/^www\./,"")===oe),Q=xe?"you":Se?"competitor":"other";return u.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${Q}`,children:[u.jsxs("span",{className:"citation-leaderboard-rank",children:["#",W+1]}),u.jsx("span",{className:"citation-leaderboard-domain",children:Y}),xe&&u.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),Se&&u.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},Y)})})]}),_.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 (",_.groundingSources.length,")"]}),u.jsx(Ln,{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:_.groundingSources.map((Y,W)=>u.jsx("li",{className:"truncate text-sm",children:u.jsx("a",{href:Y.uri,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Y.title||Y.uri})},W))})]}),_.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:_.evidenceUrls.map(Y=>u.jsx("li",{className:"truncate text-sm",children:u.jsx("a",{href:Y,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Y})},Y))})]}),_.citedDomains.length===0&&_.groundingSources.length===0&&_.evidenceUrls.length===0&&u.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",z?"for this run":"yet"]})]}),!B&&!$&&u.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",z?"for this run":"yet"]})]})]})]})]})]})})}function bi(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 Ob=[{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 Ug(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 sQ=Ug({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"}),oQ=Ug({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"}),lQ=Ug({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"}),cQ=Ug({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"}),uQ=[{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:bi(["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:bi(["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:bi(["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:bi(["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:bi(["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:bi(["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:bi(["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:bi(["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:bi(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Ob[0],Ob[1],bi(["cited","cited","cited","cited","cited"]),Ob[2],2/7,bi(["not-cited","not-cited","not-cited","cited"]);function dQ(e,t){return e.projects.find(n=>n.project.id===t)}function fQ(e,t){return e.runs.find(n=>n.id===t)}function hQ(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 pQ={regression:"negative",gain:"positive",opportunity:"caution"},mQ={regression:"lost",gain:"emerging",opportunity:"not-cited"},gQ={regression:"Regression",gain:"Gain",opportunity:"Opportunity"};function vQ(e){return{id:e.id,tone:pQ[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??gQ[e.type],affectedPhrases:[{keyword:e.keyword,evidenceId:"",provider:e.provider,citationState:mQ[e.type]}]}}function yQ(e){return e.filter(t=>!t.dismissed).map(vQ)}function eI(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 Pw(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function bQ(e,t){if(!e)return"Waiting";if(!t)return"Running";const n=new Date(t).getTime()-new Date(e).getTime();if(n<1e3)return"<1s";const r=Math.floor(n/1e3);if(r<60)return`${r}s`;const i=Math.floor(r/60),s=r%60;return`${i}m ${s}s`}function O1(e){switch(e){case ei["answer-visibility"]:return"Answer visibility sweep";case ei["gsc-sync"]:return"GSC sync";case ei["inspect-sitemap"]:return"Sitemap inspection";case ei["site-audit"]:return"Site audit"}}function xQ(e){return e===Hp.manual?"Manual":e===Hp.scheduled?"Scheduled":e===Hp["config-apply"]?"Config apply":e}function _1(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:O1(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Pw(e.startedAt):Pw(e.createdAt),duration:bQ(e.startedAt,e.finishedAt),statusDetail:e.error?tI(e.error):wQ(e),summary:SQ(e),triggerLabel:xQ(e.trigger)}}function tI(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 wQ(e){switch(e.status){case tn.queued:return"Waiting for execution slot.";case tn.running:return"Provider queries in progress.";case tn.completed:return"All key phrases checked.";case tn.partial:return"Run completed with some key phrases skipped.";case tn.failed:return e.error?tI(e.error):"Run failed.";case tn.cancelled:return"Run was cancelled.";default:return""}}function SQ(e){const t=O1(e.kind);switch(e.status){case tn.queued:return`${t} queued`;case tn.running:return`${t} in progress`;case tn.completed:return`${t} completed`;case tn.partial:return`${t} partially completed`;case tn.failed:return`${t} failed`;case tn.cancelled:return`${t} cancelled`;default:return e.status}}function nI(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const s of e){const l=s.keyword??s.id;t.has(l)||t.set(l,!1),s.citationState==="cited"&&t.set(l,!0)}const n=t.size,r=[...t.values()].filter(Boolean).length;return{score:n>0?Math.round(r/n*100):0,citedCount:r,totalCount:n}}function rI(e){return e>=70?"positive":e>=40?"caution":"negative"}function jQ(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function NQ(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function CQ(e){if(e.length===0)return{label:"Gap Key Phrases",value:"No data",delta:"Run a sweep first",tone:"neutral",description:"Run a visibility sweep to identify key phrases where competitors are cited and your domain is not.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[]};const t=new Map;for(const s of e){const l=s.keywordId,c=t.get(l)??{cited:!1,competitorOverlap:new Set};s.citationState==="cited"&&(c.cited=!0);for(const f of s.competitorOverlap)c.competitorOverlap.add(f);t.set(l,c)}const n=t.size,r=[...t.values()].filter(s=>!s.cited&&s.competitorOverlap.size>0).length,i=r===1?"key phrase":"key phrases";return{label:"Gap Key Phrases",value:`${r}`,delta:`${r} of ${n} key phrases at risk`,tone:NQ(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 OQ(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 _Q(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function kQ(e,t){const n=OQ(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:_Q(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 iI(e,t){if(e.length===0||t.length===0)return{label:"None",count:0};const n=new Set(t);let r=0;for(const s of e)s.competitorOverlap.some(l=>n.has(l))&&r++;const i=r/e.length;return i>=.5?{label:"High",count:r}:i>=.2?{label:"Moderate",count:r}:{label:"Low",count:r}}function AQ(e,t,n,r){const i=[];let s=0;const l=new Set;if(n){const c=new Map;for(const v of n.snapshots)if(v.keyword){const y=`${v.keyword}::${v.provider}`;c.set(y,v)}const f=new Set(n.snapshots.map(v=>v.provider)),h=new Set(t.flatMap(v=>Object.keys(v.providerRuns??{}))),p=[...new Set([...f,...h])].sort(),g=p.length>0?p:["gemini"];for(const v of t){if(v.runs.length===0)continue;l.add(v.keyword);const y=v.runs.at(-1),S=y?.transition??"not-cited";for(const w of g){const N=c.get(`${v.keyword}::${w}`),C=(v.providerRuns?.[w]?.length??0)>0;if(!N&&!C)continue;const E=N?.model??null,A=E?`${w}:${E}`:null,O=A?v.modelRuns?.[A]:void 0,P=v.providerRuns?.[w],z=(P?.length?P:null)??(O?.length?O:null),_=P?.length?"provider":O?.length?"model":"keyword",T=z?z.at(-1).transition:S,R=z?z.at(-1).visibilityTransition??(z.at(-1).visibilityState==="visible"?"visible":"not-visible"):y?.visibilityTransition??(y?.visibilityState==="visible"?"visible":"not-visible"),B=z?.at(-1)?.citationState,$=z?.at(-1)?.visibilityState,L=N?T==="lost"?"lost":T==="emerging"?"emerging":N.citationState==="cited"?"cited":"not-cited":B==="cited"?"cited":"not-cited",ne=N?.visibilityState??($==="visible"?"visible":$==="pending"?"pending":"not-visible"),he=zw(z||v.runs),ge=mE(z||v.runs),H=EQ(v,w),ie=(z??v.runs).map(D=>({runId:D.runId,citationState:D.citationState,createdAt:D.createdAt,model:H.get(D.runId)??null,answerMentioned:D.answerMentioned,visibilityState:D.visibilityState,visibilityTransition:D.visibilityTransition})),pe=TQ(ie),we=_==="provider"&&pe.length<=1?"model":_,q=PQ(ie);i.push({id:`evidence_${e}_${s++}`,keyword:v.keyword,provider:N?.provider??w,model:N?.model??null,location:N?.location??null,citationState:L,answerMentioned:N?.answerMentioned,visibilityState:ne,visibilityChangeLabel:gE(R,ge,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:gE(T,he),answerSnippet:N?.answerText??"",citedDomains:N?.citedDomains??[],evidenceUrls:[],competitorDomains:N?.competitorOverlap??[],recommendedCompetitors:N?.recommendedCompetitors??[],matchedTerms:N?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:N?.groundingSources??[],summary:zQ(ne,R,v.keyword),runHistory:ie,historyScope:we,modelsSeen:pe,modelTransitions:q})}}}for(const c of r)l.has(c.keyword)||i.push({id:`evidence_${e}_${s++}`,keyword:c.keyword,provider:"",model:null,location:null,citationState:"pending",visibilityState:"pending",visibilityChangeLabel:"Awaiting first run",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${c.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return i}function EQ(e,t){const n=new Map,r=`${t}:`;for(const[i,s]of Object.entries(e.modelRuns??{})){if(!i.startsWith(r))continue;const l=i.slice(r.length),c=l==="unknown"?null:l;for(const f of s)n.set(f.runId,c)}return n}function TQ(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function PQ(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 zw(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 mE(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 gE(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?`${cd(r.positive)} in latest run`:`${cd(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return cd(r.first);case"not-cited":case"not-visible":return t<=1?`${cd(r.negative)} in latest run`:`${cd(r.negative)} across ${t} runs`;default:return e}}function cd(e){return e.charAt(0).toUpperCase()+e.slice(1)}function zQ(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 vE(e,t){const n=new Set(t),r=new Map;for(const i of e)if(i.keyword)for(const s of i.competitorOverlap){if(!n.has(s))continue;const l=r.get(s)??new Set;l.add(i.keyword),r.set(s,l)}return r}const _b=3;function MQ(e){const{evidence:t,timeline:n,latestSnapshots:r,previousSnapshots:i,trackedCompetitors:s}=e,l=[],c=[],f=new Set;for(const C of t)C.citationState==="lost"&&(f.has(C.keyword)||(f.add(C.keyword),c.push({keyword:C.keyword,evidenceId:C.id,provider:C.provider,citationState:"lost"})));c.length>0&&l.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${c.length} key phrase${c.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:c});const h=vE(r,s),p=vE(i,s);for(const C of s){const E=h.get(C)??new Set,A=p.get(C)??new Set,O=[...E].filter(P=>!A.has(P));O.length>0&&l.push({id:`insight_comp_gained_${C}`,tone:"negative",title:`${C} appeared on ${O.length} key phrase${O.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:O.map(P=>{const z=t.find(_=>_.keyword===P);return{keyword:P,evidenceId:z?.id??"",citationState:"cited"}})})}const g=new Map;for(const C of n){const E=C.runs.at(-1);E&&g.set(C.keyword,{transition:E.transition,citationState:E.citationState})}const v=[],y=[],S=new Set;for(const[C,{transition:E,citationState:A}]of g){if(!(E==="emerging"||E==="new"&&A==="cited"))continue;S.add(C);const P=t.find(z=>z.keyword===C&&(z.citationState==="emerging"||z.citationState==="cited"));v.push({keyword:C,evidenceId:P?.id??"",provider:P?.provider,citationState:"emerging"})}for(const C of t)C.citationState==="emerging"&&(S.has(C.keyword)||y.push({keyword:C.keyword,evidenceId:C.id,provider:C.provider,citationState:"emerging"}));if(y.length>0){const C=new Set(y.map(E=>E.keyword)).size;l.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${C} key phrase${C>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:y})}v.length>0&&l.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${S.size} key phrase${S.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:v});const w=new Set(t.map(C=>C.keyword)),N=[];for(const C of n){if(!w.has(C.keyword)||C.runs.length<_b||C.runs.at(-1)?.citationState!=="not-cited")continue;if(zw(C.runs)>=_b){const O=t.find(P=>P.keyword===C.keyword);N.push({keyword:C.keyword,evidenceId:O?.id??"",citationState:"not-cited"})}}N.length>0&&l.push({id:"insight_persistent_gap",tone:"caution",title:`${N.length} key phrase${N.length>1?"s":""} uncited for ${_b}+ runs`,detail:"These key phrases have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:N});for(const C of s){const E=h.get(C)??new Set,O=[...p.get(C)??new Set].filter(P=>!E.has(P));O.length>0&&l.push({id:`insight_comp_lost_${C}`,tone:"neutral",title:`${C} dropped from ${O.length} key phrase${O.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:O.map(P=>{const z=t.find(_=>_.keyword===P);return{keyword:P,evidenceId:z?.id??"",citationState:"not-cited"}})})}return l.length===0&&l.push({id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}),l}function RQ(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 DQ(e,t){if(t.length===0){const f=new Set(e.filter(h=>h.citationState==="cited").map(h=>h.keyword)).size;return{gained:f,lost:0,tone:f>0?"positive":"neutral",hasPreviousRun:!1}}const n=f=>{const h=new Set;for(const p of f)p.citationState==="cited"&&p.keyword&&h.add(p.keyword);return h},r=n(e),i=n(t);let s=0,l=0;for(const f of r)i.has(f)||s++;for(const f of i)r.has(f)||l++;const c=l>s?"negative":s>l?"positive":"neutral";return{gained:s,lost:l,tone:c,hasPreviousRun:!0}}function IQ(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(f=>f.kind===ei["answer-visibility"])??e[0],r=n.status===tn.completed?"Healthy":n.status===tn.running?"Running":n.status===tn.queued?"Queued":n.status===tn.partial?"Partial":"Failed",i=n.status===tn.completed?"positive":n.status===tn.failed?"negative":n.status===tn.partial?"caution":"neutral",s=e.filter(f=>f.kind===ei["answer-visibility"]).length,l=e.length-s,c=l>0?`${s} ${s===1?"sweep":"sweeps"} · ${l} ${l===1?"sync":"syncs"}`:`${e.length} total runs`;return{label:"Run Status",value:r,delta:c,tone:i,description:`Latest: ${O1(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 LQ(e){const t=eI(e.project),n=AQ(t.name,e.timeline,e.latestRunDetail,e.keywords),r=e.runs.filter(_=>_.kind===ei["answer-visibility"]).sort((_,T)=>T.createdAt.localeCompare(_.createdAt))[0],i=r&&e.latestRunDetail?.id===r.id?e.latestRunDetail.snapshots:[],s=nI(i),l=CQ(i),c=kQ(e.gscCoverage,e.bingCoverage),f=iI(i,e.competitors.map(_=>_.domain)),h=MQ({evidence:n,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(_=>_.domain)}),p=e.dbInsights!=null?yQ(e.dbInsights):null,g=p!=null?RQ(h,p):h,v=[...e.runs].sort((_,T)=>T.createdAt.localeCompare(_.createdAt)),y=v.find(_=>_.kind===ei["answer-visibility"]),S=v.find(_=>_.kind!==ei["answer-visibility"]);if(y&&S){const _=new Date(S.createdAt).getTime()-new Date(y.createdAt).getTime(),T=1440*60*1e3;_>T&&g.push({id:"insight_stale_visibility",tone:"caution",title:"Stale visibility data",detail:`Last visibility sweep was ${Pw(y.createdAt)}, but integration syncs have run since. Run a new sweep for current metrics.`,actionLabel:"Stale",affectedPhrases:[]})}const w=v.map(_=>_1(_,e.project.displayName||e.project.name)),N=new Map;for(const _ of i){const T=_.provider||"gemini",R=_.model??null,B=`${T}::${R??"unknown"}`,$=N.get(B)??{provider:T,model:R,cited:0,total:0};$.total++,_.citationState==="cited"&&$.cited++,N.set(B,$)}const C=[...N.values()].sort((_,T)=>_.provider.localeCompare(T.provider)||(_.model??"").localeCompare(T.model??"")).map(({provider:_,model:T,cited:R,total:B})=>({provider:_,model:T,score:B>0?Math.round(R/B*100):0,cited:R,total:B})),E=e.project.providers.filter(_=>!_.startsWith("cdp:")),A=new Set(i.map(_=>_.provider)),O=E.filter(_=>A.has(_)).length,P=i.length>0&&E.length>1&&O<E.length,z=P?`${O} of ${E.length} providers`:void 0;return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:i.length>0?`${s.score}`:"No data",delta:i.length>0?`${s.citedCount} of ${s.totalCount} key phrases visible`:"Run a sweep first",tone:i.length>0?P?"caution":rI(s.score):"neutral",description:i.length>0?`${s.citedCount} of ${s.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:z},keywordCounts:{cited:s.citedCount,total:s.totalCount},gapKeyPhrases:l,indexCoverage:c,providerScores:C,competitorPressure:{label:"Competitor Pressure",value:f.label,delta:f.count>0?`${f.count} overlapping citations`:"No overlap detected",tone:jQ(f.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:IQ(v),movementSummary:DQ(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:g,visibilityEvidence:n,competitors:e.competitors.map((_,T)=>{const R=new Set;for(const he of i)(he.competitorOverlap.includes(_.domain)||he.citedDomains.includes(_.domain))&&he.keyword&&R.add(he.keyword);const B=[...R],$=new Set(i.map(he=>he.keyword).filter(Boolean)),L=$.size>0?B.length/$.size:0,ne=L>=.5?"High":L>=.2?"Moderate":B.length>0?"Low":"None";return{id:_.id||`comp_${T}`,domain:_.domain,citationCount:B.length,totalKeywords:$.size,pressureLabel:ne,citedKeywords:B,movement:"",notes:""}}),recentRuns:w.slice(0,5)}}function $Q(e){const t=eI(e.project),n=e.runs.filter(S=>S.kind===ei["answer-visibility"]).sort((S,w)=>w.createdAt.localeCompare(S.createdAt))[0],r=n&&e.latestRunDetail?.id===n.id?e.latestRunDetail.snapshots:[],i=nI(r),s=iI(r,e.competitors.map(S=>S.domain)),l=[...e.runs].sort((S,w)=>w.createdAt.localeCompare(S.createdAt)),c=l.find(S=>S.kind===ei["answer-visibility"])??l[0],f=e.project.displayName||e.project.name,h=c?_1(c,f):{id:"none",projectId:e.project.id,projectName:f,kind:ei["answer-visibility"],kindLabel:"No runs yet",status:tn.queued,trigger:Hp.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""},p=e.project.providers.filter(S=>!S.startsWith("cdp:")),g=new Set(r.map(S=>S.provider)),v=p.filter(S=>g.has(S)).length,y=r.length>0&&p.length>1&&v<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?y?"caution":rI(i.score):"neutral",providerCoverage:y?`${v} of ${p.length} providers`:void 0,lastRun:h,insight:r.length>0?`${i.citedCount} of ${i.totalCount} key phrases visible across ${new Set(r.map(S=>S.provider)).size} provider${new Set(r.map(S=>S.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:s.label}}function UQ(e,t){const n=[],r=[],i=[];for(const l of e){r.push(LQ(l)),i.push($Q(l));const c=[...l.runs].sort((f,h)=>h.createdAt.localeCompare(f.createdAt));for(const f of c)n.push(_1(f,l.project.displayName||l.project.name))}n.sort((l,c)=>c.createdAt.localeCompare(l.createdAt));const s=e.length>0;return{portfolioOverview:{projects:i,attentionItems:s?BQ(r):[{id:"attention_setup",tone:"neutral",title:"No projects yet",detail:"Create your first project using the setup wizard, CLI, or API.",actionLabel:"Open setup",href:"/setup"}],recentRuns:n.slice(0,5),systemHealth:[{id:"api",label:"API",tone:"positive",detail:"Connected",meta:"Real-time data"},{id:"provider",label:"Gemini",tone:"positive",detail:"Configured",meta:"Provider active"}],lastUpdatedAt:new Date().toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),...s?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small key phrase set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:r,runs:n,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},keywordImportState:{mode:"paste",keywordCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:s,ctaLabel:s?"Trigger run":"Create a project first",summary:s?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(l=>({name:l.name,displayName:l.displayName,keyUrl:l.keyUrl,modelHint:l.modelHint,model:l.model,state:l.configured?"ready":"needs-config",detail:l.configured?"Provider is configured.":"API key is missing.",quota:l.quota})),google:{state:t?.google?.configured?"ready":"needs-config",detail:t?.google?.configured?"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard.":"Google OAuth client ID and client secret are not configured yet."},bing:{state:t?.bing?.configured?"ready":"needs-config",detail:t?.bing?.configured?"Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.":"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}}}function BQ(e){const t=[];for(const n of e){const r=n.visibilityEvidence.filter(s=>s.citationState==="lost");r.length>0&&t.push({id:`attention_${n.project.id}_lost`,tone:"negative",title:`${n.project.displayName||n.project.name} lost citations`,detail:`${r.length} key phrase${r.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${n.project.id}`});const i=n.recentRuns.filter(s=>s.status===tn.running||s.status===tn.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 ti={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"]},aI=x.createContext(null);aI.Provider;function ff(){return x.useContext(aI)}function hl(e){const n=ff()?.dashboard??null,r=Uo({queryKey:ti.projects.all,queryFn:HM,enabled:!n}),i=Uo({queryKey:ti.runs.all,queryFn:VM,enabled:!n,refetchInterval:S=>S.state.data?.some(C=>C.status==="running"||C.status==="queued")?3e3:!1}),s=Uo({queryKey:ti.settings,queryFn:()=>a1().catch(()=>null),enabled:!n}),l=r.data??[],c=i.data??[],f=t8({queries:l.map(S=>{const w=c.filter(C=>C.projectId===S.id),N=w.filter(C=>(C.status==="completed"||C.status==="partial")&&C.kind==="answer-visibility").sort((C,E)=>E.createdAt.localeCompare(C.createdAt));return{queryKey:ti.projects.detail(S.id,N[0]?.id),queryFn:async()=>{const C=N[0]?.id,[E,A,O,P,z,_,T,R]=await Promise.all([o9(S.name).catch(()=>[]),ZM(S.name).catch(()=>[]),YM(S.name).catch(()=>[]),C?zc(C).catch(()=>null):Promise.resolve(null),N[1]?zc(N[1].id).catch(()=>null):Promise.resolve(null),s1(S.name).catch(()=>null),o1(S.name).catch(()=>null),C?nF(S.name,C).catch(()=>null):Promise.resolve(null)]);return{project:S,runs:w,keywords:E,competitors:A,timeline:O,latestRunDetail:P,previousRunDetail:z,gscCoverage:_,bingCoverage:T,dbInsights:R}},enabled:!n&&r.isSuccess&&i.isSuccess}})}),h=f.every(S=>S.isSuccess),p=x.useMemo(()=>{if(n)return n;if(!r.data||!i.data||l.length>0&&!h)return null;const S=f.map(w=>w.data).filter(w=>w!=null);return UQ(S,s.data??null)},[n,r.data,i.data,s.data,h,f,l.length]),g=!n&&(r.isError||i.isError),v=!n&&!p&&!g,y=x.useCallback(async()=>{await Promise.all([r.refetch(),i.refetch(),s.refetch()])},[r.refetch,i.refetch,s.refetch]);return{dashboard:p,isLoading:v,isError:g,refetch:y}}function qQ(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const yE=qQ(),Mw=yE==="/"?"":yE.replace(/\/$/,"");async function FQ(){const e=Mw?`${Mw}/health`:"/health",t=await rF(e,"API"),n=t.state==="ok"?{label:"Runner",state:"ok",detail:"In-process job runner"}:{label:"Runner",state:t.state,detail:"Depends on API"};return{apiStatus:t,workerStatus:n}}function Bg(e,t){return Uo({queryKey:ti.health,queryFn:FQ,enabled:e,refetchInterval:15e3,initialData:t})}function KQ(e){return Uo({queryKey:ti.runs.detail(e??""),queryFn:()=>zc(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function Qc(){const e=Vs(),t=Og({strict:!1}),n=br({select:f=>f.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:f=>e({to:n,from:Ci.to,search:h=>({...h,runId:f,evidenceId:void 0})}),openEvidence:f=>e({to:n,from:Ci.to,search:h=>({...h,evidenceId:f,runId:void 0})}),closeDrawer:()=>e({to:n,from:Ci.to,search:f=>({...f,runId:void 0,evidenceId:void 0})})}}const HQ={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function GQ(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function VQ(){const e=x.useSyncExternalStore(cF,mA,mA),t=Vs(),{openRun:n}=Qc(),r=x.useCallback(s=>{ww(s)},[]),i=x.useCallback(s=>{s.cta&&(s.cta.intent==="open-run-drawer"?n(s.cta.runId):t({to:"/runs"}),ww(s.id))},[t,n]);return e.length===0?null:u.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(s=>u.jsxs("section",{role:s.tone==="negative"?"alert":"status","aria-live":s.tone==="negative"?"assertive":"polite","data-state":s.state,className:`toast-card ${HQ[s.tone]}`,children:[u.jsxs("div",{className:"toast-copy",children:[u.jsx("p",{className:"toast-title",children:s.title}),s.detail?u.jsx("p",{className:"toast-detail",children:s.detail}):null,s.cta?u.jsx("button",{type:"button",className:"toast-action",onClick:()=>i(s),"aria-label":GQ(s),children:s.cta.label}):null]}),u.jsx("button",{type:"button",onClick:()=>r(s.id),className:"toast-dismiss","aria-label":"Dismiss",children:u.jsx(Ag,{className:"size-3.5"})})]},s.id))})}const bE=[{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"}],xE=e=>({label:e,state:"checking",detail:"Checking service health"}),ZQ={apiStatus:xE("API"),workerStatus:xE("Worker")};function YQ(e){return e==="gsc-sync"?"GSC sync":e==="inspect-sitemap"?"Sitemap inspection":"Visibility sweep"}function WQ(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function QQ(e){const t=YQ(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function XQ(e,t){return e.error?`${t}: ${e.error}`:e.location?`${t} · ${e.location}`:t}function JQ(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function eX(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 tX(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function nX(){const e=x.useSyncExternalStore(eK,Qo,Qo),t=Object.keys(e.runs).length>0||Object.keys(e.batches).length>0,n=Uo({queryKey:ti.runs.all,queryFn:VM,enabled:t}),r=Uo({queryKey:ti.projects.all,queryFn:HM,enabled:t}),i=x.useRef({}),s=x.useCallback(()=>{n.refetch()},[n.refetch]);return x.useEffect(()=>{t&&s()},[t,s]),x.useEffect(()=>{if(!t||typeof window>"u")return;const l=()=>{document.visibilityState==="visible"&&s()};return window.addEventListener("focus",s),document.addEventListener("visibilitychange",l),()=>{window.removeEventListener("focus",s),document.removeEventListener("visibilitychange",l)}},[t,s]),x.useEffect(()=>{const l=n.data??[],c=r.data??[],f=Object.fromEntries(l.map(p=>[p.id,p])),h=Object.fromEntries(l.map(p=>[p.id,p.status]));for(const p of Object.values(e.runs)){const g=f[p.runId];if(!g||!rK(g.status)||(i.current[g.id]??p.lastAnnouncedStatus)===g.status)continue;if(p.sourceAction==="run-all"){wA(g.id);continue}const y=JQ(g.projectId,p.projectLabel,c);at({title:QQ(g),detail:XQ(g,y),tone:WQ(g.status),dedupeKey:`run:${g.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:g.id}}),wA(g.id)}for(const p of Object.values(e.batches)){const g=iK(p.runIds,f);g.finished&&(at({title:"Run-all batch finished",detail:eX(g,p.skippedCount),tone:tX(g),dedupeKey:`batch:${p.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),nK(p.batchId))}i.current=h},[r.data,n.data,e]),null}function rX(){const e=ff(),{dashboard:t,isLoading:n,refetch:r}=hl(),l=Bg(!e,e?.health).data??e?.health??ZQ,c=r9(),{runId:f,evidenceId:h,closeDrawer:p}=Qc(),[g,v]=x.useState(!1),y=KQ(f),S=y.data??null,w=y.isLoading;x.useEffect(()=>{S&&S.status!=="running"&&S.status!=="queued"&&r()},[S?.status,r]),x.useEffect(()=>{v(!1)},[c.pathname]),x.useEffect(()=>{if(typeof window>"u"||!f&&!h)return;const O=P=>{P.key==="Escape"&&p()};return window.addEventListener("keydown",O),()=>{window.removeEventListener("keydown",O)}},[f,h,p]);const N=t??e?.dashboard??null,C=f&&N?fQ(N,f):void 0,E=h&&N?hQ(N,h):void 0,A=(()=>{const O=c.pathname;if(O==="/")return"Portfolio";if(O==="/projects")return"Projects";if(O==="/runs")return"Runs";if(O==="/settings")return"Settings";if(O==="/setup")return"Setup";if(O.startsWith("/projects/")){const z=O.split("/").filter(Boolean)[1];if(z&&N){const _=N.projects.find(T=>T.project.id===z);if(_)return _.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(TA,{})}),u.jsxs("nav",{className:"sidebar-nav",children:[u.jsxs(Lt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(NF,{className:"sidebar-icon"}),u.jsx("span",{children:"Overview"})]}),u.jsxs(Lt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[u.jsx(SF,{className:"sidebar-icon"}),u.jsx("span",{children:"Projects"})]}),u.jsxs(Lt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(kF,{className:"sidebar-icon"}),u.jsx("span",{children:"Runs"})]}),u.jsxs(Lt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(DF,{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(O=>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+O*15}%`}})]},O))]}):N&&N.projects.length>0?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"sidebar-section-title",children:"Projects"}),N.projects.map(O=>{const P=O.visibilitySummary.tone;return u.jsxs(Lt,{to:"/projects/$projectId",params:{projectId:O.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:O.project.name})]},O.project.id)})]}):n?null:u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"sidebar-section-title",children:"Resources"}),u.jsxs(Lt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[u.jsx(PF,{className:"sidebar-icon"}),u.jsx("span",{children:"Setup"})]})]})]}),u.jsx("div",{className:"sidebar-footer",children:bE.map(O=>u.jsx("a",{className:"sidebar-footer-link",href:O.href,target:"_blank",rel:"noopener noreferrer",children:O.label},O.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(TA,{compact:!0})}),u.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[u.jsx(Lt,{to:"/",children:"Home"}),u.jsx(kg,{className:"breadcrumb-sep size-3"}),u.jsx("span",{className:"breadcrumb-current",children:A})]})]}),u.jsxs("div",{className:"topbar-actions",children:[u.jsxs("div",{className:"health-pill-row",children:[u.jsxs("span",{className:`health-pill health-pill-${l.apiStatus.state}`,children:["API ",l.apiStatus.state==="ok"?"ok":l.apiStatus.state]}),u.jsxs("span",{className:`health-pill health-pill-${l.workerStatus.state}`,children:["Worker ",l.workerStatus.state==="ok"?"ok":l.workerStatus.state]})]}),u.jsxs(me,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":g,"aria-controls":"mobile-nav",onClick:()=>v(O=>!O),children:[u.jsx(OF,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),u.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${g?"mobile-nav-open":""}`,children:[u.jsxs(me,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>v(!1),children:[u.jsx(Ag,{className:"size-5"}),u.jsx("span",{className:"sr-only",children:"Close navigation"})]}),u.jsx(Lt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),u.jsx(Lt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),u.jsx(Lt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),u.jsx(Lt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),N&&N.projects.length>0?u.jsxs("div",{className:"mobile-nav-section",children:[u.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),N.projects.map(O=>u.jsx(Lt,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"mobile-nav-link",children:O.project.name},O.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(O=>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"})]},O))}),u.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(O=>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))})]},O))})]}):u.jsx(i1,{})}),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(xF,{className:"size-3.5"}),u.jsx("span",{children:"Canonry"})]}),u.jsx("div",{className:"footer-links",children:bE.map(O=>u.jsx("a",{href:O.href,target:"_blank",rel:"noopener noreferrer",children:O.label},O.href))})]})]}),C?u.jsxs(H7,{open:C!==void 0,title:C.summary,subtitle:`${C.projectName} · ${C.kindLabel}`,onClose:p,children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[u.jsx(zg,{status:C.status}),u.jsx("span",{className:"text-zinc-400",children:C.startedAt}),u.jsx("span",{className:"text-zinc-500",children:C.duration}),u.jsx("span",{className:"text-zinc-600",children:C.triggerLabel})]}),C.status==="failed"&&C.statusDetail&&u.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:C.statusDetail}),u.jsxs("div",{className:"mt-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),w?u.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):S&&S.snapshots.length>0?u.jsxs("div",{className:"space-y-2",children:[S.snapshots.map(O=>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:O.keyword??"Unknown key phrase"}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(Ud,{provider:O.provider}),u.jsx(CR,{variant:O.citationState==="cited"?"success":"neutral",children:O.citationState})]})]}),O.model&&u.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:O.model}),O.citedDomains.length>0&&u.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[u.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",O.citedDomains.join(", ")]}),O.competitorOverlap.length>0&&u.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",O.competitorOverlap.join(", ")]}),O.groundingSources&&O.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:[O.groundingSources.length," grounding source",O.groundingSources.length!==1?"s":""]}),u.jsx("ul",{className:"mt-1 space-y-0.5",children:O.groundingSources.map((P,z)=>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})},z))})]}),O.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:O.answerText})]})]},O.id)),S.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..."]})]}):S&&S.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..."]}):S&&S.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..."]}):S&&S.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:VF(S.error)})]}):u.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?u.jsx(aQ,{evidence:E.evidence,project:E.project,onClose:p}):null,u.jsx(nX,{}),u.jsx(VQ,{})]})}class iX extends x.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("[ErrorBoundary]",t,n.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?u.jsx("div",{className:"page-container",children:u.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[u.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:u.jsx(UF,{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(me,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[u.jsx(MF,{className:"size-3.5 mr-1.5"}),"Try again"]}),u.jsx(me,{variant:"secondary",size:"sm",onClick:()=>{const t=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=t||"/"},children:"Go home"})]})]})}):this.props.children}}const He=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:di("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}));He.displayName="Card";const Rw=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:di("flex flex-col gap-1.5 p-5",e),...t}));Rw.displayName="CardHeader";const Dw=x.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:di("font-medium tracking-tight text-zinc-50",e),...t}));Dw.displayName="CardTitle";const Iw=x.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:di("text-sm text-zinc-500",e),...t}));Iw.displayName="CardDescription";const Gp=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:di("p-5 pt-0",e),...t}));Gp.displayName="CardContent";function aX({points:e,tone:t}){const n=x.useId();if(e.length===0)return null;const r=42,i=132,s=5,l=Math.min(...e),f=Math.max(...e)-l||1,h=i-s*2,p=r-s*2,g=e.map((v,y)=>{const S=s+y/Math.max(e.length-1,1)*h,w=s+(1-(v-l)/f)*p;return`${S},${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:s,y:s,width:h,height:p,rx:"8"})})}),u.jsx("line",{className:"sparkline-guide",x1:s,x2:i-s,y1:r-s,y2:r-s}),u.jsx("polyline",{clipPath:`url(#${n})`,points:g,vectorEffect:"non-scaling-stroke"})]})}function sX(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function oX(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:pm(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:pm(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const i=n.providerStatuses.filter(f=>f.state==="ready").length,s=n.providerStatuses.length,l=i>0,c=n.providerStatuses.filter(f=>f.state==="ready").map(f=>sX(f)).join(" · ");return{...r,label:"Providers",tone:l?"positive":"caution",detail:`${i} of ${s} configured`,meta:c||"None configured"}})}function lX(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 cX(e,t,n){const r=lX(t,n),i=structuredClone(e);return i.healthChecks=i.healthChecks.map(s=>{if(s.id==="api")return{...s,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(s.id==="worker")return{...s,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const l=n.providerStatuses.some(c=>c.state==="ready");return{...s,detail:l?"At least one provider configured.":"No providers configured.",state:l?"ready":"attention"}}),i.launchState.enabled=r===void 0,i.launchState.blockedReason=r,i.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",i}function uX({project:e}){return u.jsxs(Lt,{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," · ",Eg(e.lastRun.status)]})]})}),u.jsx("div",{className:"project-row-chart",children:u.jsx(aX,{points:e.trend,tone:OR(e.lastRun.status)})}),u.jsx("span",{className:"project-row-link",children:u.jsx(kg,{className:"h-4 w-4 text-zinc-500"})})]})}function dX(){const e=ff(),{dashboard:t,isLoading:n}=hl(),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=Bg(!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=oX(i.systemHealth,c,r.settings),{openRun:h}=Qc();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(uX,{project:p},p.project.id))}):u.jsxs(He,{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(me,{size:"sm",asChild:!0,children:u.jsx(Lt,{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(Lt,{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:()=>h(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(zg,{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:f.map(p=>u.jsxs(He,{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(bt,{tone:p.tone,children:p.label})]}),u.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const k1=Symbol.for("yaml.alias"),Lw=Symbol.for("yaml.document"),Is=Symbol.for("yaml.map"),sI=Symbol.for("yaml.pair"),Qi=Symbol.for("yaml.scalar"),Xc=Symbol.for("yaml.seq"),si=Symbol.for("yaml.node.type"),pl=e=>!!e&&typeof e=="object"&&e[si]===k1,qg=e=>!!e&&typeof e=="object"&&e[si]===Lw,hf=e=>!!e&&typeof e=="object"&&e[si]===Is,ln=e=>!!e&&typeof e=="object"&&e[si]===sI,Et=e=>!!e&&typeof e=="object"&&e[si]===Qi,pf=e=>!!e&&typeof e=="object"&&e[si]===Xc;function sn(e){if(e&&typeof e=="object")switch(e[si]){case Is:case Xc:return!0}return!1}function on(e){if(e&&typeof e=="object")switch(e[si]){case k1:case Is:case Qi:case Xc:return!0}return!1}const oI=e=>(Et(e)||sn(e))&&!!e.anchor,Oo=Symbol("break visit"),fX=Symbol("skip children"),Ed=Symbol("remove node");function Jc(e,t){const n=hX(t);qg(e)?bc(null,e.contents,n,Object.freeze([e]))===Ed&&(e.contents=null):bc(null,e,n,Object.freeze([]))}Jc.BREAK=Oo;Jc.SKIP=fX;Jc.REMOVE=Ed;function bc(e,t,n,r){const i=pX(e,t,n,r);if(on(i)||ln(i))return mX(e,r,i),bc(e,i,n,r);if(typeof i!="symbol"){if(sn(t)){r=Object.freeze(r.concat(t));for(let s=0;s<t.items.length;++s){const l=bc(s,t.items[s],n,r);if(typeof l=="number")s=l-1;else{if(l===Oo)return Oo;l===Ed&&(t.items.splice(s,1),s-=1)}}}else if(ln(t)){r=Object.freeze(r.concat(t));const s=bc("key",t.key,n,r);if(s===Oo)return Oo;s===Ed&&(t.key=null);const l=bc("value",t.value,n,r);if(l===Oo)return Oo;l===Ed&&(t.value=null)}}return i}function hX(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 pX(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(hf(t))return n.Map?.(e,t,r);if(pf(t))return n.Seq?.(e,t,r);if(ln(t))return n.Pair?.(e,t,r);if(Et(t))return n.Scalar?.(e,t,r);if(pl(t))return n.Alias?.(e,t,r)}function mX(e,t,n){const r=t[t.length-1];if(sn(r))r.items[e]=n;else if(ln(r))e==="key"?r.key=n:r.value=n;else if(qg(r))r.contents=n;else{const i=pl(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const gX={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},vX=e=>e.replace(/[!,[\]{}]/g,t=>gX[t]);class tr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},tr.defaultYaml,t),this.tags=Object.assign({},tr.defaultTags,n)}clone(){const t=new tr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new tr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:tr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},tr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:tr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},tr.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[s,l]=r;return this.tags[s]=l,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const l=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,l),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const l=t.slice(2,-1);return l==="!"||l==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),l)}const[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(l){return n(String(l)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+vX(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&&on(t.contents)){const s={};Jc(t.contents,(l,c)=>{on(c)&&c.tag&&(s[c.tag]=!0)}),i=Object.keys(s)}else i=[];for(const[s,l]of r)s==="!!"&&l==="tag:yaml.org,2002:"||(!t||i.some(c=>c.startsWith(l)))&&n.push(`%TAG ${s} ${l}`);return n.join(`
|
|
96
|
+
`)}}tr.defaultYaml={explicit:!1,version:"1.2"};tr.defaultTags={"!!":"tag:yaml.org,2002:"};function lI(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 cI(e){const t=new Set;return Jc(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function uI(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function yX(e,t){const n=[],r=new Map;let i=null;return{onAnchor:s=>{n.push(s),i??(i=cI(e));const l=uI(t,i);return i.add(l),l},setAnchors:()=>{for(const s of n){const l=r.get(s);if(typeof l=="object"&&l.anchor&&(Et(l.node)||sn(l.node)))l.node.anchor=l.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=s,c}}},sourceObjects:r}}function xc(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i<s;++i){const l=r[i],c=xc(e,r,String(i),l);c===void 0?delete r[i]:c!==l&&(r[i]=c)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const s=r.get(i),l=xc(e,r,i,s);l===void 0?r.delete(i):l!==s&&r.set(i,l)}else if(r instanceof Set)for(const i of Array.from(r)){const s=xc(e,r,i,i);s===void 0?r.delete(i):s!==i&&(r.delete(i),r.add(s))}else for(const[i,s]of Object.entries(r)){const l=xc(e,r,i,s);l===void 0?delete r[i]:l!==s&&(r[i]=l)}return e.call(t,n,r)}function ai(e,t,n){if(Array.isArray(e))return e.map((r,i)=>ai(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!oI(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=s=>{r.res=s,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}class A1{constructor(t){Object.defineProperty(this,si,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!qg(t))throw new TypeError("A document argument is required");const l={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=ai(this,"",l);if(typeof i=="function")for(const{count:f,res:h}of l.anchors.values())i(h,f);return typeof s=="function"?xc(s,{"":c},"",c):c}}class E1 extends A1{constructor(t){super(k1),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=[],Jc(t,{Node:(s,l)=>{(pl(l)||oI(l))&&r.push(l)}}),n&&(n.aliasResolveCache=r));let i;for(const s of r){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:s}=n,l=this.resolve(i,n);if(!l){const f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let c=r.get(l);if(c||(ai(l,null,n),c=r.get(l)),c?.res===void 0){const f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(s>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Vp(i,l,r)),c.count*c.aliasCount>s)){const f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return c.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(lI(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${i} `}return i}}function Vp(e,t,n){if(pl(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(sn(t)){let r=0;for(const i of t.items){const s=Vp(e,i,n);s>r&&(r=s)}return r}else if(ln(t)){const r=Vp(e,t.key,n),i=Vp(e,t.value,n);return Math.max(r,i)}return 1}const dI=e=>!e||typeof e!="function"&&typeof e!="object";class Ze extends A1{constructor(t){super(Qi),this.value=t}toJSON(t,n){return n?.keep?this.value:ai(this.value,t,n)}toString(){return String(this.value)}}Ze.BLOCK_FOLDED="BLOCK_FOLDED";Ze.BLOCK_LITERAL="BLOCK_LITERAL";Ze.PLAIN="PLAIN";Ze.QUOTE_DOUBLE="QUOTE_DOUBLE";Ze.QUOTE_SINGLE="QUOTE_SINGLE";const bX="tag:yaml.org,2002:";function xX(e,t,n){if(t){const r=n.filter(s=>s.tag===t),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function Hd(e,t,n){if(qg(e)&&(e=e.contents),on(e))return e;if(ln(e)){const g=n.schema[Is].createNode?.(n.schema,null,n);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:s,schema:l,sourceObjects:c}=n;let f;if(r&&e&&typeof e=="object"){if(f=c.get(e),f)return f.anchor??(f.anchor=i(e)),new E1(f.anchor);f={anchor:null,node:null},c.set(e,f)}t?.startsWith("!!")&&(t=bX+t.slice(2));let h=xX(e,t,l.tags);if(!h){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new Ze(e);return f&&(f.node=g),g}h=e instanceof Map?l[Is]:Symbol.iterator in Object(e)?l[Xc]:l[Is]}s&&(s(h),delete n.onTagObj);const p=h?.createNode?h.createNode(n.schema,e,n):typeof h?.nodeClass?.from=="function"?h.nodeClass.from(n.schema,e,n):new Ze(e);return t?p.tag=t:h.default||(p.tag=h.tag),f&&(f.node=p),p}function wm(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const s=t[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const l=[];l[s]=r,r=l}else r=new Map([[s,r]])}return Hd(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 jd=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class fI extends A1{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=>on(r)||ln(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(jd(t))this.add(n);else{const[r,...i]=t,s=this.get(r,!0);if(sn(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,wm(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(sn(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t,s=this.get(r,!0);return i.length===0?!n&&Et(s)?s.value:s:sn(s)?s.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!ln(n))return!1;const r=n.value;return r==null||t&&Et(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 sn(i)?i.hasIn(r):!1}setIn(t,n){const[r,...i]=t;if(i.length===0)this.set(r,n);else{const s=this.get(r,!0);if(sn(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,wm(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const wX=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Aa(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Mo=(e,t,n)=>e.endsWith(`
|
|
97
|
+
`)?Aa(n,t):n.includes(`
|
|
98
|
+
`)?`
|
|
99
|
+
`+Aa(n,t):(e.endsWith(" ")?"":" ")+n,hI="flow",$w="block",Zp="quoted";function Fg(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:l,onOverflow:c}={}){if(!i||i<0)return e;i<s&&(s=0);const f=Math.max(1+s,1+i-t.length);if(e.length<=f)return e;const h=[],p={};let g=i-t.length;typeof r=="number"&&(r>i-Math.max(2,s)?h.push(0):g=i-r);let v,y,S=!1,w=-1,N=-1,C=-1;n===$w&&(w=wE(e,w,t.length),w!==-1&&(g=w+f));for(let A;A=e[w+=1];){if(n===Zp&&A==="\\"){switch(N=w,e[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}C=w}if(A===`
|
|
100
|
+
`)n===$w&&(w=wE(e,w,t.length)),g=w+t.length+f,v=void 0;else{if(A===" "&&y&&y!==" "&&y!==`
|
|
101
|
+
`&&y!==" "){const O=e[w+1];O&&O!==" "&&O!==`
|
|
102
|
+
`&&O!==" "&&(v=w)}if(w>=g)if(v)h.push(v),g=v+f,v=void 0;else if(n===Zp){for(;y===" "||y===" ";)y=A,A=e[w+=1],S=!0;const O=w>C+1?w-2:N-1;if(p[O])return e;h.push(O),p[O]=!0,g=O+f,v=void 0}else S=!0}y=A}if(S&&c&&c(),h.length===0)return e;l&&l();let E=e.slice(0,h[0]);for(let A=0;A<h.length;++A){const O=h[A],P=h[A+1]||e.length;O===0?E=`
|
|
103
|
+
${t}${e.slice(0,P)}`:(n===Zp&&p[O]&&(E+=`${e[O]}\\`),E+=`
|
|
104
|
+
${t}${e.slice(O+1,P)}`)}return E}function wE(e,t,n){let r=t,i=t+1,s=e[i];for(;s===" "||s===" ";)if(t<i+n)s=e[++t];else{do s=e[++t];while(s&&s!==`
|
|
105
|
+
`);r=t,i=t+1,s=e[i]}return r}const Kg=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Hg=e=>/^(%|---|\.\.\.)/m.test(e);function SX(e,t,n){if(!t||t<0)return!1;const r=t-n,i=e.length;if(i<=r)return!1;for(let s=0,l=0;s<i;++s)if(e[s]===`
|
|
106
|
+
`){if(s-l>r)return!0;if(l=s+1,i-l<=r)return!1}return!0}function Td(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(Hg(e)?" ":"");let l="",c=0;for(let f=0,h=n[f];h;h=n[++f])if(h===" "&&n[f+1]==="\\"&&n[f+2]==="n"&&(l+=n.slice(c,f)+"\\ ",f+=1,c=f,h="\\"),h==="\\")switch(n[f+1]){case"u":{l+=n.slice(c,f);const p=n.substr(f+2,4);switch(p){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:p.substr(0,2)==="00"?l+="\\x"+p.substr(2):l+=n.substr(f,6)}f+=5,c=f+1}break;case"n":if(r||n[f+2]==='"'||n.length<i)f+=1;else{for(l+=n.slice(c,f)+`
|
|
107
|
+
|
|
108
|
+
`;n[f+2]==="\\"&&n[f+3]==="n"&&n[f+4]!=='"';)l+=`
|
|
109
|
+
`,f+=2;l+=s,n[f+2]===" "&&(l+="\\"),f+=1,c=f+1}break;default:f+=1}return l=c?l+n.slice(c):n,r?l:Fg(l,s,Zp,Kg(t,!1))}function Uw(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
110
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return Td(e,t);const n=t.indent||(Hg(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
111
|
+
${n}`)+"'";return t.implicitKey?r:Fg(r,n,hI,Kg(t,!1))}function wc(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=Td;else{const i=e.includes('"'),s=e.includes("'");i&&!s?r=Uw:s&&!i?r=Td:r=n?Uw:Td}return r(e,t)}let Bw;try{Bw=new RegExp(`(^|(?<!
|
|
112
|
+
))
|
|
113
|
+
+(?!
|
|
114
|
+
|$)`,"g")}catch{Bw=/\n+(?!\n|$)/g}function Yp({comment:e,type:t,value:n},r,i,s){const{blockQuote:l,commentString:c,lineWidth:f}=r.options;if(!l||/\n[\t ]+$/.test(n))return wc(n,r);const h=r.indent||(r.forceBlockIndent||Hg(n)?" ":""),p=l==="literal"?!0:l==="folded"||t===Ze.BLOCK_FOLDED?!1:t===Ze.BLOCK_LITERAL?!0:!SX(n,f,h.length);if(!n)return p?`|
|
|
115
|
+
`:`>
|
|
116
|
+
`;let g,v;for(v=n.length;v>0;--v){const P=n[v-1];if(P!==`
|
|
117
|
+
`&&P!==" "&&P!==" ")break}let y=n.substring(v);const S=y.indexOf(`
|
|
118
|
+
`);S===-1?g="-":n===y||S!==y.length-1?(g="+",s&&s()):g="",y&&(n=n.slice(0,-y.length),y[y.length-1]===`
|
|
119
|
+
`&&(y=y.slice(0,-1)),y=y.replace(Bw,`$&${h}`));let w=!1,N,C=-1;for(N=0;N<n.length;++N){const P=n[N];if(P===" ")w=!0;else if(P===`
|
|
120
|
+
`)C=N;else break}let E=n.substring(0,C<N?C+1:N);E&&(n=n.substring(E.length),E=E.replace(/\n+/g,`$&${h}`));let O=(w?h?"2":"1":"")+g;if(e&&(O+=" "+c(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const P=n.replace(/\n+/g,`
|
|
121
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`);let z=!1;const _=Kg(r,!0);l!=="folded"&&t!==Ze.BLOCK_FOLDED&&(_.onOverflow=()=>{z=!0});const T=Fg(`${E}${P}${y}`,h,$w,_);if(!z)return`>${O}
|
|
122
|
+
${h}${T}`}return n=n.replace(/\n+/g,`$&${h}`),`|${O}
|
|
123
|
+
${h}${E}${n}${y}`}function jX(e,t,n,r){const{type:i,value:s}=e,{actualString:l,implicitKey:c,indent:f,indentStep:h,inFlow:p}=t;if(c&&s.includes(`
|
|
124
|
+
`)||p&&/[[\]{},]/.test(s))return wc(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return c||p||!s.includes(`
|
|
125
|
+
`)?wc(s,t):Yp(e,t,n,r);if(!c&&!p&&i!==Ze.PLAIN&&s.includes(`
|
|
126
|
+
`))return Yp(e,t,n,r);if(Hg(s)){if(f==="")return t.forceBlockIndent=!0,Yp(e,t,n,r);if(c&&f===h)return wc(s,t)}const g=s.replace(/\n+/g,`$&
|
|
127
|
+
${f}`);if(l){const v=w=>w.default&&w.tag!=="tag:yaml.org,2002:str"&&w.test?.test(g),{compat:y,tags:S}=t.doc.schema;if(S.some(v)||y?.some(v))return wc(s,t)}return c?g:Fg(g,f,hI,Kg(t,!1))}function T1(e,t,n,r){const{implicitKey:i,inFlow:s}=t,l=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==Ze.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(c=Ze.QUOTE_DOUBLE);const f=p=>{switch(p){case Ze.BLOCK_FOLDED:case Ze.BLOCK_LITERAL:return i||s?wc(l.value,t):Yp(l,t,n,r);case Ze.QUOTE_DOUBLE:return Td(l.value,t);case Ze.QUOTE_SINGLE:return Uw(l.value,t);case Ze.PLAIN:return jX(l,t,n,r);default:return null}};let h=f(c);if(h===null){const{defaultKeyType:p,defaultStringType:g}=t.options,v=i&&p||g;if(h=f(v),h===null)throw new Error(`Unsupported default string type ${v}`)}return h}function pI(e,t){const n=Object.assign({blockQuote:!0,commentString:wX,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 NX(e,t){if(t.tag){const i=e.filter(s=>s.tag===t.tag);if(i.length>0)return i.find(s=>s.format===t.format)??i[0]}let n,r;if(Et(t)){r=t.value;let i=e.filter(s=>s.identify?.(r));if(i.length>1){const s=i.filter(l=>l.test);s.length>0&&(i=s)}n=i.find(s=>s.format===t.format)??i.find(s=>!s.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function CX(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],s=(Et(e)||sn(e))&&e.anchor;s&&lI(s)&&(n.add(s),i.push(`&${s}`));const l=e.tag??(t.default?null:t.tag);return l&&i.push(r.directives.tagString(l)),i.join(" ")}function Dc(e,t,n,r){if(ln(e))return e.toString(t,n,r);if(pl(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const s=on(e)?e:t.doc.createNode(e,{onTagObj:f=>i=f});i??(i=NX(t.doc.schema.tags,s));const l=CX(s,i,t);l.length>0&&(t.indentAtStart=(t.indentAtStart??0)+l.length+1);const c=typeof i.stringify=="function"?i.stringify(s,t,n,r):Et(s)?T1(s,t,n,r):s.toString(t,n,r);return l?Et(s)||c[0]==="{"||c[0]==="["?`${l} ${c}`:`${l}
|
|
128
|
+
${t.indent}${c}`:c}function OX({key:e,value:t},n,r,i){const{allNullValues:s,doc:l,indent:c,indentStep:f,options:{commentString:h,indentSeq:p,simpleKeys:g}}=n;let v=on(e)&&e.comment||null;if(g){if(v)throw new Error("With simple keys, key nodes cannot have comments");if(sn(e)||!on(e)&&typeof e=="object"){const _="With simple keys, collection cannot be used as a key value";throw new Error(_)}}let y=!g&&(!e||v&&t==null&&!n.inFlow||sn(e)||(Et(e)?e.type===Ze.BLOCK_FOLDED||e.type===Ze.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!y&&(g||!s),indent:c+f});let S=!1,w=!1,N=Dc(e,n,()=>S=!0,()=>w=!0);if(!y&&!n.inFlow&&N.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");y=!0}if(n.inFlow){if(s||t==null)return S&&r&&r(),N===""?"?":y?`? ${N}`:N}else if(s&&!g||t==null&&y)return N=`? ${N}`,v&&!S?N+=Mo(N,n.indent,h(v)):w&&i&&i(),N;S&&(v=null),y?(v&&(N+=Mo(N,n.indent,h(v))),N=`? ${N}
|
|
129
|
+
${c}:`):(N=`${N}:`,v&&(N+=Mo(N,n.indent,h(v))));let C,E,A;on(t)?(C=!!t.spaceBefore,E=t.commentBefore,A=t.comment):(C=!1,E=null,A=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!y&&!v&&Et(t)&&(n.indentAtStart=N.length+1),w=!1,!p&&f.length>=2&&!n.inFlow&&!y&&pf(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let O=!1;const P=Dc(t,n,()=>O=!0,()=>w=!0);let z=" ";if(v||C||E){if(z=C?`
|
|
130
|
+
`:"",E){const _=h(E);z+=`
|
|
131
|
+
${Aa(_,n.indent)}`}P===""&&!n.inFlow?z===`
|
|
132
|
+
`&&A&&(z=`
|
|
133
|
+
|
|
134
|
+
`):z+=`
|
|
135
|
+
${n.indent}`}else if(!y&&sn(t)){const _=P[0],T=P.indexOf(`
|
|
136
|
+
`),R=T!==-1,B=n.inFlow??t.flow??t.items.length===0;if(R||!B){let $=!1;if(R&&(_==="&"||_==="!")){let L=P.indexOf(" ");_==="&"&&L!==-1&&L<T&&P[L+1]==="!"&&(L=P.indexOf(" ",L+1)),(L===-1||T<L)&&($=!0)}$||(z=`
|
|
137
|
+
${n.indent}`)}}else(P===""||P[0]===`
|
|
138
|
+
`)&&(z="");return N+=z+P,n.inFlow?O&&r&&r():A&&!O?N+=Mo(N,n.indent,h(A)):w&&i&&i(),N}function _X(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const mp="<<",Pa={identify:e=>e===mp||typeof e=="symbol"&&e.description===mp,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ze(Symbol(mp)),{addToJSMap:mI}),stringify:()=>mp},kX=(e,t)=>(Pa.identify(t)||Et(t)&&(!t.type||t.type===Ze.PLAIN)&&Pa.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Pa.tag&&n.default);function mI(e,t,n){if(n=e&&pl(n)?n.resolve(e.doc):n,pf(n))for(const r of n.items)kb(e,t,r);else if(Array.isArray(n))for(const r of n)kb(e,t,r);else kb(e,t,n)}function kb(e,t,n){const r=e&&pl(n)?n.resolve(e.doc):n;if(!hf(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[s,l]of i)t instanceof Map?t.has(s)||t.set(s,l):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:l,writable:!0,enumerable:!0,configurable:!0});return t}function gI(e,t,{key:n,value:r}){if(on(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(kX(e,n))mI(e,t,r);else{const i=ai(n,"",e);if(t instanceof Map)t.set(i,ai(r,i,e));else if(t instanceof Set)t.add(i);else{const s=AX(n,i,e),l=ai(r,s,e);s in t?Object.defineProperty(t,s,{value:l,writable:!0,enumerable:!0,configurable:!0}):t[s]=l}}return t}function AX(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(on(e)&&n?.doc){const r=pI(n.doc,{});r.anchors=new Set;for(const s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=e.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),_X(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function P1(e,t,n){const r=Hd(e,void 0,n),i=Hd(t,void 0,n);return new ir(r,i)}class ir{constructor(t,n=null){Object.defineProperty(this,si,{value:sI}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return on(n)&&(n=n.clone(t)),on(r)&&(r=r.clone(t)),new ir(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return gI(n,r,this)}toString(t,n,r){return t?.doc?OX(this,t,n,r):JSON.stringify(this)}}function vI(e,t,n){return(t.inFlow??e.flow?TX:EX)(e,t,n)}function EX({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:l,onComment:c}){const{indent:f,options:{commentString:h}}=n,p=Object.assign({},n,{indent:s,type:null});let g=!1;const v=[];for(let S=0;S<t.length;++S){const w=t[S];let N=null;if(on(w))!g&&w.spaceBefore&&v.push(""),Sm(n,v,w.commentBefore,g),w.comment&&(N=w.comment);else if(ln(w)){const E=on(w.key)?w.key:null;E&&(!g&&E.spaceBefore&&v.push(""),Sm(n,v,E.commentBefore,g))}g=!1;let C=Dc(w,p,()=>N=null,()=>g=!0);N&&(C+=Mo(C,s,h(N))),g&&N&&(g=!1),v.push(r+C)}let y;if(v.length===0)y=i.start+i.end;else{y=v[0];for(let S=1;S<v.length;++S){const w=v[S];y+=w?`
|
|
139
|
+
${f}${w}`:`
|
|
140
|
+
`}}return e?(y+=`
|
|
141
|
+
`+Aa(h(e),f),c&&c()):g&&l&&l(),y}function TX({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:s,flowCollectionPadding:l,options:{commentString:c}}=t;r+=s;const f=Object.assign({},t,{indent:r,inFlow:!0,type:null});let h=!1,p=0;const g=[];for(let S=0;S<e.length;++S){const w=e[S];let N=null;if(on(w))w.spaceBefore&&g.push(""),Sm(t,g,w.commentBefore,!1),w.comment&&(N=w.comment);else if(ln(w)){const E=on(w.key)?w.key:null;E&&(E.spaceBefore&&g.push(""),Sm(t,g,E.commentBefore,!1),E.comment&&(h=!0));const A=on(w.value)?w.value:null;A?(A.comment&&(N=A.comment),A.commentBefore&&(h=!0)):w.value==null&&E?.comment&&(N=E.comment)}N&&(h=!0);let C=Dc(w,f,()=>N=null);S<e.length-1&&(C+=","),N&&(C+=Mo(C,r,c(N))),!h&&(g.length>p||C.includes(`
|
|
142
|
+
`))&&(h=!0),g.push(C),p=g.length}const{start:v,end:y}=n;if(g.length===0)return v+y;if(!h){const S=g.reduce((w,N)=>w+N.length+2,2);h=t.options.lineWidth>0&&S>t.options.lineWidth}if(h){let S=v;for(const w of g)S+=w?`
|
|
143
|
+
${s}${i}${w}`:`
|
|
144
|
+
`;return`${S}
|
|
145
|
+
${i}${y}`}else return`${v}${l}${g.join(" ")}${l}${y}`}function Sm({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const s=Aa(t(r),e);n.push(s.trimStart())}}function Ro(e,t){const n=Et(t)?t.value:t;for(const r of e)if(ln(r)&&(r.key===t||r.key===n||Et(r.key)&&r.key.value===n))return r}class Jr extends fI{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Is,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:s}=r,l=new this(t),c=(f,h)=>{if(typeof s=="function")h=s.call(n,f,h);else if(Array.isArray(s)&&!s.includes(f))return;(h!==void 0||i)&&l.items.push(P1(f,h,r))};if(n instanceof Map)for(const[f,h]of n)c(f,h);else if(n&&typeof n=="object")for(const f of Object.keys(n))c(f,n[f]);return typeof t.sortMapEntries=="function"&&l.items.sort(t.sortMapEntries),l}add(t,n){let r;ln(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new ir(t,t?.value):r=new ir(t.key,t.value);const i=Ro(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Et(i.value)&&dI(r.value)?i.value.value=r.value:i.value=r.value}else if(s){const l=this.items.findIndex(c=>s(r,c)<0);l===-1?this.items.push(r):this.items.splice(l,0,r)}else this.items.push(r)}delete(t){const n=Ro(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Ro(this.items,t)?.value;return(!n&&Et(i)?i.value:i)??void 0}has(t){return!!Ro(this.items,t)}set(t,n){this.add(new ir(t,n),!0)}toJSON(t,n,r){const i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(const s of this.items)gI(n,i,s);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!ln(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})),vI(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const eu={collection:"map",default:!0,nodeClass:Jr,tag:"tag:yaml.org,2002:map",resolve(e,t){return hf(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Jr.from(e,t,n)};class Jo extends fI{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Xc,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=gp(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=gp(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Et(i)?i.value:i}has(t){const n=gp(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=gp(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];Et(i)&&dI(n)?i.value=n:this.items[r]=n}toJSON(t,n){const r=[];n?.onCreate&&n.onCreate(r);let i=0;for(const s of this.items)r.push(ai(s,String(i++),n));return r}toString(t,n,r){return t?vI(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n)){let l=0;for(let c of n){if(typeof i=="function"){const f=n instanceof Set?c:String(l++);c=i.call(n,f,c)}s.items.push(Hd(c,void 0,r))}}return s}}function gp(e){let t=Et(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const tu={collection:"seq",default:!0,nodeClass:Jo,tag:"tag:yaml.org,2002:seq",resolve(e,t){return pf(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Jo.from(e,t,n)},Gg={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),T1(e,t,n,r)}},Vg={identify:e=>e==null,createNode:()=>new Ze(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ze(null),stringify:({source:e},t)=>typeof e=="string"&&Vg.test.test(e)?e:t.options.nullStr},z1={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ze(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&z1.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 Ei({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let l=s.indexOf(".");l<0&&(l=s.length,s+=".");let c=t-(s.length-l-1);for(;c-- >0;)s+="0"}return s}const yI={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:Ei},bI={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():Ei(e)}},xI={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 Ze(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Ei},Zg=e=>typeof e=="bigint"||Number.isInteger(e),M1=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function wI(e,t,n){const{value:r}=e;return Zg(r)&&r>=0?n+r.toString(t):Ei(e)}const SI={identify:e=>Zg(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>M1(e,2,8,n),stringify:e=>wI(e,8,"0o")},jI={identify:Zg,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>M1(e,0,10,n),stringify:Ei},NI={identify:e=>Zg(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>M1(e,2,16,n),stringify:e=>wI(e,16,"0x")},PX=[eu,tu,Gg,Vg,z1,SI,jI,NI,yI,bI,xI];function SE(e){return typeof e=="bigint"||Number.isInteger(e)}const vp=({value:e})=>JSON.stringify(e),zX=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:vp},{identify:e=>e==null,createNode:()=>new Ze(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:vp},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:vp},{identify:SE,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})=>SE(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:vp}],MX={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},RX=[eu,tu].concat(zX,MX),R1={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,i,s){if(!n)return"";const l=n;let c;if(typeof btoa=="function"){let f="";for(let h=0;h<l.length;++h)f+=String.fromCharCode(l[h]);c=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Ze.BLOCK_LITERAL),t!==Ze.QUOTE_DOUBLE){const f=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),h=Math.ceil(c.length/f),p=new Array(h);for(let g=0,v=0;g<h;++g,v+=f)p[g]=c.substr(v,f);c=p.join(t===Ze.BLOCK_LITERAL?`
|
|
146
|
+
`:" ")}return T1({comment:e,type:t,value:c},r,i,s)}};function CI(e,t){if(pf(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!ln(r)){if(hf(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new ir(new Ze(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
|
|
147
|
+
${i.key.commentBefore}`:r.commentBefore),r.comment){const s=i.value??i.key;s.comment=s.comment?`${r.comment}
|
|
148
|
+
${s.comment}`:r.comment}r=i}e.items[n]=ln(r)?r:new ir(r)}}else t("Expected a sequence for this tag");return e}function OI(e,t,n){const{replacer:r}=n,i=new Jo(e);i.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let l of t){typeof r=="function"&&(l=r.call(t,String(s++),l));let c,f;if(Array.isArray(l))if(l.length===2)c=l[0],f=l[1];else throw new TypeError(`Expected [key, value] tuple: ${l}`);else if(l&&l instanceof Object){const h=Object.keys(l);if(h.length===1)c=h[0],f=l[c];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else c=l;i.items.push(P1(c,f,n))}return i}const D1={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:CI,createNode:OI};class _c extends Jo{constructor(){super(),this.add=Jr.prototype.add.bind(this),this.delete=Jr.prototype.delete.bind(this),this.get=Jr.prototype.get.bind(this),this.has=Jr.prototype.has.bind(this),this.set=Jr.prototype.set.bind(this),this.tag=_c.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n?.onCreate&&n.onCreate(r);for(const i of this.items){let s,l;if(ln(i)?(s=ai(i.key,"",n),l=ai(i.value,s,n)):s=ai(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,l)}return r}static from(t,n,r){const i=OI(t,n,r),s=new this;return s.items=i.items,s}}_c.tag="tag:yaml.org,2002:omap";const I1={collection:"seq",identify:e=>e instanceof Map,nodeClass:_c,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=CI(e,t),r=[];for(const{key:i}of n.items)Et(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new _c,n)},createNode:(e,t,n)=>_c.from(e,t,n)};function _I({value:e,source:t},n){return t&&(e?kI:AI).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const kI={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 Ze(!0),stringify:_I},AI={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 Ze(!1),stringify:_I},DX={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:Ei},IX={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():Ei(e)}},LX={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 Ze(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:Ei},mf=e=>typeof e=="bigint"||Number.isInteger(e);function Yg(e,t,n,{intAsBigInt:r}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const l=BigInt(e);return i==="-"?BigInt(-1)*l:l}const s=parseInt(e,n);return i==="-"?-1*s:s}function L1(e,t,n){const{value:r}=e;if(mf(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return Ei(e)}const $X={identify:mf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Yg(e,2,2,n),stringify:e=>L1(e,2,"0b")},UX={identify:mf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Yg(e,1,8,n),stringify:e=>L1(e,8,"0")},BX={identify:mf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Yg(e,0,10,n),stringify:Ei},qX={identify:mf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Yg(e,2,16,n),stringify:e=>L1(e,16,"0x")};class kc extends Jr{constructor(t){super(t),this.tag=kc.tag}add(t){let n;ln(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new ir(t.key,null):n=new ir(t,null),Ro(this.items,n.key)||this.items.push(n)}get(t,n){const r=Ro(this.items,t);return!n&&ln(r)?Et(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=Ro(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new ir(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let l of n)typeof i=="function"&&(l=i.call(n,l,l)),s.items.push(P1(l,null,r));return s}}kc.tag="tag:yaml.org,2002:set";const $1={collection:"map",identify:e=>e instanceof Set,nodeClass:kc,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>kc.from(e,t,n),resolve(e,t){if(hf(e)){if(e.hasAllNullValues(!0))return Object.assign(new kc,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function U1(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=l=>t?BigInt(l):Number(l),s=r.replace(/_/g,"").split(":").reduce((l,c)=>l*i(60)+i(c),i(0));return n==="-"?i(-1)*s:s}function EI(e){let{value:t}=e,n=l=>l;if(typeof t=="bigint")n=l=>BigInt(l);else if(isNaN(t)||!isFinite(t))return Ei(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),s=[t%i];return t<60?s.unshift(0):(t=(t-s[0])/i,s.unshift(t%i),t>=60&&(t=(t-s[0])/i,s.unshift(t))),r+s.map(l=>String(l).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const TI={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})=>U1(e,n),stringify:EI},PI={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=>U1(e,!1),stringify:EI},Wg={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(Wg.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,s,l,c]=t.map(Number),f=t[7]?Number((t[7]+"00").substr(1,3)):0;let h=Date.UTC(n,r-1,i,s||0,l||0,c||0,f);const p=t[8];if(p&&p!=="Z"){let g=U1(p,!1);Math.abs(g)<30&&(g*=60),h-=6e4*g}return new Date(h)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},jE=[eu,tu,Gg,Vg,kI,AI,$X,UX,BX,qX,DX,IX,LX,R1,Pa,I1,D1,$1,TI,PI,Wg],NE=new Map([["core",PX],["failsafe",[eu,tu,Gg]],["json",RX],["yaml11",jE],["yaml-1.1",jE]]),CE={binary:R1,bool:z1,float:xI,floatExp:bI,floatNaN:yI,floatTime:PI,int:jI,intHex:NI,intOct:SI,intTime:TI,map:eu,merge:Pa,null:Vg,omap:I1,pairs:D1,seq:tu,set:$1,timestamp:Wg},FX={"tag:yaml.org,2002:binary":R1,"tag:yaml.org,2002:merge":Pa,"tag:yaml.org,2002:omap":I1,"tag:yaml.org,2002:pairs":D1,"tag:yaml.org,2002:set":$1,"tag:yaml.org,2002:timestamp":Wg};function Ab(e,t,n){const r=NE.get(t);if(r&&!e)return n&&!r.includes(Pa)?r.concat(Pa):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const s=Array.from(NE.keys()).filter(l=>l!=="yaml11").map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)i=i.concat(s);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(Pa)),i.reduce((s,l)=>{const c=typeof l=="string"?CE[l]:l;if(!c){const f=JSON.stringify(l),h=Object.keys(CE).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${h}`)}return s.includes(c)||s.push(c),s},[])}const KX=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class B1{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:l,toStringDefaults:c}){this.compat=Array.isArray(t)?Ab(t,"compat"):t?Ab(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?FX:{},this.tags=Ab(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,Is,{value:eu}),Object.defineProperty(this,Qi,{value:Gg}),Object.defineProperty(this,Xc,{value:tu}),this.sortMapEntries=typeof l=="function"?l:l===!0?KX:null}clone(){const t=Object.create(B1.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function HX(e,t){const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const f=e.directives.toString(e);f?(n.push(f),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const i=pI(e,t),{commentString:s}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const f=s(e.commentBefore);n.unshift(Aa(f,""))}let l=!1,c=null;if(e.contents){if(on(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=s(e.contents.commentBefore);n.push(Aa(p,""))}i.forceBlockIndent=!!e.comment,c=e.contents.comment}const f=c?void 0:()=>l=!0;let h=Dc(e.contents,i,()=>c=null,f);c&&(h+=Mo(h,"",s(c))),(h[0]==="|"||h[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${h}`:n.push(h)}else n.push(Dc(e.contents,i));if(e.directives?.docEnd)if(e.comment){const f=s(e.comment);f.includes(`
|
|
149
|
+
`)?(n.push("..."),n.push(Aa(f,""))):n.push(`... ${f}`)}else n.push("...");else{let f=e.comment;f&&l&&(f=f.replace(/^\n+/,"")),f&&((!l||c)&&n[n.length-1]!==""&&n.push(""),n.push(Aa(s(f),"")))}return n.join(`
|
|
150
|
+
`)+`
|
|
151
|
+
`}class Qg{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,si,{value:Lw});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:l}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(l=this.directives.yaml.version)):this.directives=new tr({version:l}),this.setSchema(l,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(Qg.prototype,{[si]:{value:Lw}});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=on(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){sc(this.contents)&&this.contents.add(t)}addIn(t,n){sc(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=cI(this);t.anchor=!n||r.has(n)?uI(n||"a",r):n}return new E1(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const N=E=>typeof E=="number"||E instanceof String||E instanceof Number,C=n.filter(N).map(String);C.length>0&&(n=n.concat(C)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:l,flow:c,keepUndefined:f,onTagObj:h,tag:p}=r??{},{onAnchor:g,setAnchors:v,sourceObjects:y}=yX(this,l||"a"),S={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:g,onTagObj:h,replacer:i,schema:this.schema,sourceObjects:y},w=Hd(t,p,S);return c&&sn(w)&&(w.flow=!0),v(),w}createPair(t,n,r={}){const i=this.createNode(t,null,r),s=this.createNode(n,null,r);return new ir(i,s)}delete(t){return sc(this.contents)?this.contents.delete(t):!1}deleteIn(t){return jd(t)?this.contents==null?!1:(this.contents=null,!0):sc(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return sn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return jd(t)?!n&&Et(this.contents)?this.contents.value:this.contents:sn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return sn(this.contents)?this.contents.has(t):!1}hasIn(t){return jd(t)?this.contents!==void 0:sn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=wm(this.schema,[t],n):sc(this.contents)&&this.contents.set(t,n)}setIn(t,n){jd(t)?this.contents=n:this.contents==null?this.contents=wm(this.schema,Array.from(t),n):sc(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 tr({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 tr({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 B1(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:l}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},f=ai(this.contents,n??"",c);if(typeof s=="function")for(const{count:h,res:p}of c.anchors.values())s(p,h);return typeof l=="function"?xc(l,{"":f},"",f):f}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return HX(this,t)}}function sc(e){if(sn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class zI extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class yp extends zI{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class GX extends zI{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const OE=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,l=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&l.length>80){const c=Math.min(s-39,l.length-79);l="…"+l.substring(c),s-=c-1}if(l.length>80&&(l=l.substring(0,79)+"…"),r>1&&/^ *$/.test(l.substring(0,s))){let c=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`…
|
|
152
|
+
`),l=c+l}if(/[^ ]/.test(l)){let c=1;const f=n.linePos[1];f?.line===r&&f.col>i&&(c=Math.max(1,Math.min(f.col-i,80-s)));const h=" ".repeat(s)+"^".repeat(c);n.message+=`:
|
|
153
|
+
|
|
154
|
+
${l}
|
|
155
|
+
${h}
|
|
156
|
+
`}};function Ic(e,{flow:t,indicator:n,next:r,offset:i,onError:s,parentIndent:l,startOnNewline:c}){let f=!1,h=c,p=c,g="",v="",y=!1,S=!1,w=null,N=null,C=null,E=null,A=null,O=null,P=null;for(const T of e)switch(S&&(T.type!=="space"&&T.type!=="newline"&&T.type!=="comma"&&s(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S=!1),w&&(h&&T.type!=="comment"&&T.type!=="newline"&&s(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),T.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&T.source.includes(" ")&&(w=T),p=!0;break;case"comment":{p||s(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const R=T.source.substring(1)||" ";g?g+=v+R:g=R,v="",h=!1;break}case"newline":h?g?g+=T.source:(!O||n!=="seq-item-ind")&&(f=!0):v+=T.source,h=!0,y=!0,(N||C)&&(E=T),p=!0;break;case"anchor":N&&s(T,"MULTIPLE_ANCHORS","A node can have at most one anchor"),T.source.endsWith(":")&&s(T.offset+T.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),N=T,P??(P=T.offset),h=!1,p=!1,S=!0;break;case"tag":{C&&s(T,"MULTIPLE_TAGS","A node can have at most one tag"),C=T,P??(P=T.offset),h=!1,p=!1,S=!0;break}case n:(N||C)&&s(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`),O&&s(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${t??"collection"}`),O=T,h=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){A&&s(T,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),A=T,h=!1,p=!1;break}default:s(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),h=!1,p=!1}const z=e[e.length-1],_=z?z.offset+z.source.length:i;return S&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w&&(h&&w.indent<=l||r?.type==="block-map"||r?.type==="block-seq")&&s(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:A,found:O,spaceBefore:f,comment:g,hasNewline:y,anchor:N,tag:C,newlineAfterProp:E,end:_,start:P??_}}function Gd(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
157
|
+
`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(Gd(t.key)||Gd(t.value))return!0}return!1;default:return!0}}function qw(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Gd(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function MI(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(s,l)=>s===l||Et(s)&&Et(l)&&s.value===l.value;return t.some(s=>i(s.key,n))}const _E="All mapping items must start at the same column";function VX({composeNode:e,composeEmptyNode:t},n,r,i,s){const l=s?.nodeClass??Jr,c=new l(n.schema);n.atRoot&&(n.atRoot=!1);let f=r.offset,h=null;for(const p of r.items){const{start:g,key:v,sep:y,value:S}=p,w=Ic(g,{indicator:"explicit-key-ind",next:v??y?.[0],offset:f,onError:i,parentIndent:r.indent,startOnNewline:!0}),N=!w.found;if(N){if(v&&(v.type==="block-seq"?i(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==r.indent&&i(f,"BAD_INDENT",_E)),!w.anchor&&!w.tag&&!y){h=w.end,w.comment&&(c.comment?c.comment+=`
|
|
158
|
+
`+w.comment:c.comment=w.comment);continue}(w.newlineAfterProp||Gd(v))&&i(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else w.found?.indent!==r.indent&&i(f,"BAD_INDENT",_E);n.atKey=!0;const C=w.end,E=v?e(n,v,w,i):t(n,C,g,null,w,i);n.schema.compat&&qw(r.indent,v,i),n.atKey=!1,MI(n,c.items,E)&&i(C,"DUPLICATE_KEY","Map keys must be unique");const A=Ic(y??[],{indicator:"map-value-ind",next:S,offset:E.range[2],onError:i,parentIndent:r.indent,startOnNewline:!v||v.type==="block-scalar"});if(f=A.end,A.found){N&&(S?.type==="block-map"&&!A.hasNewline&&i(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<A.found.offset-1024&&i(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const O=S?e(n,S,A,i):t(n,f,y,null,A,i);n.schema.compat&&qw(r.indent,S,i),f=O.range[2];const P=new ir(E,O);n.options.keepSourceTokens&&(P.srcToken=p),c.items.push(P)}else{N&&i(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),A.comment&&(E.comment?E.comment+=`
|
|
159
|
+
`+A.comment:E.comment=A.comment);const O=new ir(E);n.options.keepSourceTokens&&(O.srcToken=p),c.items.push(O)}}return h&&h<f&&i(h,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,f,h??f],c}function ZX({composeNode:e,composeEmptyNode:t},n,r,i,s){const l=s?.nodeClass??Jo,c=new l(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset,h=null;for(const{start:p,value:g}of r.items){const v=Ic(p,{indicator:"seq-item-ind",next:g,offset:f,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!v.found)if(v.anchor||v.tag||g)g?.type==="block-seq"?i(v.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{h=v.end,v.comment&&(c.comment=v.comment);continue}const y=g?e(n,g,v,i):t(n,v.end,p,null,v,i);n.schema.compat&&qw(r.indent,g,i),f=y.range[2],c.items.push(y)}return c.range=[r.offset,f,h??f],c}function gf(e,t,n,r){let i="";if(e){let s=!1,l="";for(const c of e){const{source:f,type:h}=c;switch(h){case"space":s=!0;break;case"comment":{n&&!s&&r(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=f.substring(1)||" ";i?i+=l+p:i=p,l="";break}case"newline":i&&(l+=f),s=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}t+=f.length}}return{comment:i,offset:t}}const Eb="Block collections are not allowed within flow collections",Tb=e=>e&&(e.type==="block-map"||e.type==="block-seq");function YX({composeNode:e,composeEmptyNode:t},n,r,i,s){const l=r.start.source==="{",c=l?"flow map":"flow sequence",f=s?.nodeClass??(l?Jr:Jo),h=new f(n.schema);h.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let g=r.offset+r.start.source.length;for(let N=0;N<r.items.length;++N){const C=r.items[N],{start:E,key:A,sep:O,value:P}=C,z=Ic(E,{flow:c,indicator:"explicit-key-ind",next:A??O?.[0],offset:g,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!z.found){if(!z.anchor&&!z.tag&&!O&&!P){N===0&&z.comma?i(z.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):N<r.items.length-1&&i(z.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),z.comment&&(h.comment?h.comment+=`
|
|
160
|
+
`+z.comment:h.comment=z.comment),g=z.end;continue}!l&&n.options.strict&&Gd(A)&&i(A,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(N===0)z.comma&&i(z.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(z.comma||i(z.start,"MISSING_CHAR",`Missing , between ${c} items`),z.comment){let _="";e:for(const T of E)switch(T.type){case"comma":case"space":break;case"comment":_=T.source.substring(1);break e;default:break e}if(_){let T=h.items[h.items.length-1];ln(T)&&(T=T.value??T.key),T.comment?T.comment+=`
|
|
161
|
+
`+_:T.comment=_,z.comment=z.comment.substring(_.length+1)}}if(!l&&!O&&!z.found){const _=P?e(n,P,z,i):t(n,z.end,O,null,z,i);h.items.push(_),g=_.range[2],Tb(P)&&i(_.range,"BLOCK_IN_FLOW",Eb)}else{n.atKey=!0;const _=z.end,T=A?e(n,A,z,i):t(n,_,E,null,z,i);Tb(A)&&i(T.range,"BLOCK_IN_FLOW",Eb),n.atKey=!1;const R=Ic(O??[],{flow:c,indicator:"map-value-ind",next:P,offset:T.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(R.found){if(!l&&!z.found&&n.options.strict){if(O)for(const L of O){if(L===R.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}}z.start<R.found.offset-1024&&i(R.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(R.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const B=P?e(n,P,R,i):R.found?t(n,R.end,O,null,R,i):null;B?Tb(P)&&i(B.range,"BLOCK_IN_FLOW",Eb):R.comment&&(T.comment?T.comment+=`
|
|
162
|
+
`+R.comment:T.comment=R.comment);const $=new ir(T,B);if(n.options.keepSourceTokens&&($.srcToken=C),l){const L=h;MI(n,L.items,T)&&i(_,"DUPLICATE_KEY","Map keys must be unique"),L.items.push($)}else{const L=new Jr(n.schema);L.flow=!0,L.items.push($);const ne=(B??T).range;L.range=[T.range[0],ne[1],ne[2]],h.items.push(L)}g=B?B.range[2]:R.end}}const v=l?"}":"]",[y,...S]=r.end;let w=g;if(y?.source===v)w=y.offset+y.source.length;else{const N=c[0].toUpperCase()+c.substring(1),C=p?`${N} must end with a ${v}`:`${N} in block collection must be sufficiently indented and end with a ${v}`;i(g,p?"MISSING_CHAR":"BAD_INDENT",C),y&&y.source.length!==1&&S.unshift(y)}if(S.length>0){const N=gf(S,w,n.options.strict,i);N.comment&&(h.comment?h.comment+=`
|
|
163
|
+
`+N.comment:h.comment=N.comment),h.range=[r.offset,w,N.offset]}else h.range=[r.offset,w,w];return h}function Pb(e,t,n,r,i,s){const l=n.type==="block-map"?VX(e,t,n,r,s):n.type==="block-seq"?ZX(e,t,n,r,s):YX(e,t,n,r,s),c=l.constructor;return i==="!"||i===c.tagName?(l.tag=c.tagName,l):(i&&(l.tag=i),l)}function WX(e,t,n,r,i){const s=r.tag,l=s?t.directives.tagName(s.source,v=>i(s,"TAG_RESOLVE_FAILED",v)):null;if(n.type==="block-seq"){const{anchor:v,newlineAfterProp:y}=r,S=v&&s?v.offset>s.offset?v:s:v??s;S&&(!y||y.offset<S.offset)&&i(S,"MISSING_CHAR","Missing newline after block sequence props")}const c=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!l||l==="!"||l===Jr.tagName&&c==="map"||l===Jo.tagName&&c==="seq")return Pb(e,t,n,i,l);let f=t.schema.tags.find(v=>v.tag===l&&v.collection===c);if(!f){const v=t.schema.knownTags[l];if(v?.collection===c)t.schema.tags.push(Object.assign({},v,{default:!1})),f=v;else return v?i(s,"BAD_COLLECTION_TYPE",`${v.tag} used for ${c} collection, but expects ${v.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),Pb(e,t,n,i,l)}const h=Pb(e,t,n,i,l,f),p=f.resolve?.(h,v=>i(s,"TAG_RESOLVE_FAILED",v),t.options)??h,g=on(p)?p:new Ze(p);return g.range=h.range,g.tag=l,f?.format&&(g.format=f.format),g}function QX(e,t,n){const r=t.offset,i=XX(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const s=i.mode===">"?Ze.BLOCK_FOLDED:Ze.BLOCK_LITERAL,l=t.source?JX(t.source):[];let c=l.length;for(let w=l.length-1;w>=0;--w){const N=l[w][1];if(N===""||N==="\r")c=w;else break}if(c===0){const w=i.chomp==="+"&&l.length>0?`
|
|
164
|
+
`.repeat(Math.max(1,l.length-1)):"";let N=r+i.length;return t.source&&(N+=t.source.length),{value:w,type:s,comment:i.comment,range:[r,N,N]}}let f=t.indent+i.indent,h=t.offset+i.length,p=0;for(let w=0;w<c;++w){const[N,C]=l[w];if(C===""||C==="\r")i.indent===0&&N.length>f&&(f=N.length);else{N.length<f&&n(h+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(f=N.length),p=w,f===0&&!e.atRoot&&n(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=N.length+C.length+1}for(let w=l.length-1;w>=c;--w)l[w][0].length>f&&(c=w+1);let g="",v="",y=!1;for(let w=0;w<p;++w)g+=l[w][0].slice(f)+`
|
|
165
|
+
`;for(let w=p;w<c;++w){let[N,C]=l[w];h+=N.length+C.length+1;const E=C[C.length-1]==="\r";if(E&&(C=C.slice(0,-1)),C&&N.length<f){const O=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(h-C.length-(E?2:1),"BAD_INDENT",O),N=""}s===Ze.BLOCK_LITERAL?(g+=v+N.slice(f)+C,v=`
|
|
166
|
+
`):N.length>f||C[0]===" "?(v===" "?v=`
|
|
167
|
+
`:!y&&v===`
|
|
168
|
+
`&&(v=`
|
|
169
|
+
|
|
170
|
+
`),g+=v+N.slice(f)+C,v=`
|
|
171
|
+
`,y=!0):C===""?v===`
|
|
172
|
+
`?g+=`
|
|
173
|
+
`:v=`
|
|
174
|
+
`:(g+=v+C,v=" ",y=!1)}switch(i.chomp){case"-":break;case"+":for(let w=c;w<l.length;++w)g+=`
|
|
175
|
+
`+l[w][0].slice(f);g[g.length-1]!==`
|
|
176
|
+
`&&(g+=`
|
|
177
|
+
`);break;default:g+=`
|
|
178
|
+
`}const S=r+i.length+t.source.length;return{value:g,type:s,comment:i.comment,range:[r,S,S]}}function XX({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],s=i[0];let l=0,c="",f=-1;for(let v=1;v<i.length;++v){const y=i[v];if(!c&&(y==="-"||y==="+"))c=y;else{const S=Number(y);!l&&S?l=S:f===-1&&(f=e+v)}}f!==-1&&r(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let h=!1,p="",g=i.length;for(let v=1;v<t.length;++v){const y=t[v];switch(y.type){case"space":h=!0;case"newline":g+=y.source.length;break;case"comment":n&&!h&&r(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=y.source.length,p=y.source.substring(1);break;case"error":r(y,"UNEXPECTED_TOKEN",y.message),g+=y.source.length;break;default:{const S=`Unexpected token in block scalar header: ${y.type}`;r(y,"UNEXPECTED_TOKEN",S);const w=y.source;w&&typeof w=="string"&&(g+=w.length)}}}return{mode:s,indent:l,chomp:c,comment:p,length:g}}function JX(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let l=1;l<t.length;l+=2)s.push([t[l],t[l+1]]);return s}function eJ(e,t,n){const{offset:r,type:i,source:s,end:l}=e;let c,f;const h=(v,y,S)=>n(r+v,y,S);switch(i){case"scalar":c=Ze.PLAIN,f=tJ(s,h);break;case"single-quoted-scalar":c=Ze.QUOTE_SINGLE,f=nJ(s,h);break;case"double-quoted-scalar":c=Ze.QUOTE_DOUBLE,f=rJ(s,h);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}const p=r+s.length,g=gf(l,p,t,n);return{value:f,type:c,comment:g.comment,range:[r,p,g.offset]}}function tJ(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}`),RI(e)}function nJ(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),RI(e.slice(1,-1)).replace(/''/g,"'")}function RI(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
179
|
+
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
180
|
+
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],s=" ",l=t.lastIndex;for(n.lastIndex=l;r=n.exec(e);)r[1]===""?s===`
|
|
181
|
+
`?i+=s:s=`
|
|
182
|
+
`:(i+=s+r[1],s=" "),l=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=l,r=c.exec(e),i+s+(r?.[1]??"")}function rJ(e,t){let n="";for(let r=1;r<e.length-1;++r){const i=e[r];if(!(i==="\r"&&e[r+1]===`
|
|
183
|
+
`))if(i===`
|
|
184
|
+
`){const{fold:s,offset:l}=iJ(e,r);n+=s,r=l}else if(i==="\\"){let s=e[++r];const l=aJ[s];if(l)n+=l;else if(s===`
|
|
185
|
+
`)for(s=e[r+1];s===" "||s===" ";)s=e[++r+1];else if(s==="\r"&&e[r+1]===`
|
|
186
|
+
`)for(s=e[++r+1];s===" "||s===" ";)s=e[++r+1];else if(s==="x"||s==="u"||s==="U"){const c={x:2,u:4,U:8}[s];n+=sJ(e,r+1,c,t),r+=c}else{const c=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(i===" "||i===" "){const s=r;let l=e[r+1];for(;l===" "||l===" ";)l=e[++r+1];l!==`
|
|
187
|
+
`&&!(l==="\r"&&e[r+2]===`
|
|
188
|
+
`)&&(n+=r>s?e.slice(s,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function iJ(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
|
|
189
|
+
`||r==="\r")&&!(r==="\r"&&e[t+2]!==`
|
|
190
|
+
`);)r===`
|
|
191
|
+
`&&(n+=`
|
|
192
|
+
`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const aJ={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
193
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function sJ(e,t,n,r){const i=e.substr(t,n),l=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(l)){const c=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}return String.fromCodePoint(l)}function DI(e,t,n,r){const{value:i,type:s,comment:l,range:c}=t.type==="block-scalar"?QX(e,t,r):eJ(t,e.options.strict,r),f=n?e.directives.tagName(n.source,g=>r(n,"TAG_RESOLVE_FAILED",g)):null;let h;e.options.stringKeys&&e.atKey?h=e.schema[Qi]:f?h=oJ(e.schema,i,f,n,r):t.type==="scalar"?h=lJ(e,i,t,r):h=e.schema[Qi];let p;try{const g=h.resolve(i,v=>r(n??t,"TAG_RESOLVE_FAILED",v),e.options);p=Et(g)?g:new Ze(g)}catch(g){const v=g instanceof Error?g.message:String(g);r(n??t,"TAG_RESOLVE_FAILED",v),p=new Ze(i)}return p.range=c,p.source=i,s&&(p.type=s),f&&(p.tag=f),h.format&&(p.format=h.format),l&&(p.comment=l),p}function oJ(e,t,n,r,i){if(n==="!")return e[Qi];const s=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)s.push(c);else return c;for(const c of s)if(c.test?.test(t))return c;const l=e.knownTags[n];return l&&!l.collection?(e.tags.push(Object.assign({},l,{default:!1,test:void 0})),l):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Qi])}function lJ({atKey:e,directives:t,schema:n},r,i,s){const l=n.tags.find(c=>(c.default===!0||e&&c.default==="key")&&c.test?.test(r))||n[Qi];if(n.compat){const c=n.compat.find(f=>f.default&&f.test?.test(r))??n[Qi];if(l.tag!==c.tag){const f=t.tagString(l.tag),h=t.tagString(c.tag),p=`Value may be parsed as either ${f} or ${h}`;s(i,"TAG_RESOLVE_FAILED",p,!0)}}return l}function cJ(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 uJ={composeNode:II,composeEmptyNode:q1};function II(e,t,n,r){const i=e.atKey,{spaceBefore:s,comment:l,anchor:c,tag:f}=n;let h,p=!0;switch(t.type){case"alias":h=dJ(e,t,r),(c||f)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":h=DI(e,t,f,r),c&&(h.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":h=WX(uJ,e,t,n,r),c&&(h.anchor=c.source.substring(1));break;default:{const g=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",g),h=q1(e,t.offset,void 0,null,n,r),p=!1}}return c&&h.anchor===""&&r(c,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!Et(h)||typeof h.value!="string"||h.tag&&h.tag!=="tag:yaml.org,2002:str")&&r(f??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(h.spaceBefore=!0),l&&(t.type==="scalar"&&t.source===""?h.comment=l:h.commentBefore=l),e.options.keepSourceTokens&&p&&(h.srcToken=t),h}function q1(e,t,n,r,{spaceBefore:i,comment:s,anchor:l,tag:c,end:f},h){const p={type:"scalar",offset:cJ(t,n,r),indent:-1,source:""},g=DI(e,p,c,h);return l&&(g.anchor=l.source.substring(1),g.anchor===""&&h(l,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(g.spaceBefore=!0),s&&(g.comment=s,g.range[2]=f),g}function dJ({options:e},{offset:t,source:n,end:r},i){const s=new E1(n.substring(1));s.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const l=t+n.length,c=gf(r,l,e.strict,i);return s.range=[t,l,c.offset],c.comment&&(s.comment=c.comment),s}function fJ(e,t,{offset:n,start:r,value:i,end:s},l){const c=Object.assign({_directives:t},e),f=new Qg(void 0,c),h={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},p=Ic(r,{indicator:"doc-start",next:i??s?.[0],offset:n,onError:l,parentIndent:0,startOnNewline:!0});p.found&&(f.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&l(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=i?II(h,i,p,l):q1(h,p.end,r,null,p,l);const g=f.contents.range[2],v=gf(s,g,!1,l);return v.comment&&(f.comment=v.comment),f.range=[n,g,v.offset],f}function ud(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 kE(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){const s=e[i];switch(s[0]){case"#":t+=(t===""?"":r?`
|
|
194
|
+
|
|
195
|
+
`:`
|
|
196
|
+
`)+(s.substring(1)||" "),n=!0,r=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class hJ{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{const l=ud(n);s?this.warnings.push(new GX(l,r,i)):this.errors.push(new yp(l,r,i))},this.directives=new tr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=kE(this.prelude);if(r){const s=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
197
|
+
${r}`:r;else if(i||t.directives.docStart||!s)t.commentBefore=r;else if(sn(s)&&!s.flow&&s.items.length>0){let l=s.items[0];ln(l)&&(l=l.key);const c=l.commentBefore;l.commentBefore=c?`${r}
|
|
198
|
+
${c}`:r}else{const l=s.commentBefore;s.commentBefore=l?`${r}
|
|
199
|
+
${l}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:kE(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const i of t)yield*this.next(i);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,i)=>{const s=ud(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=fJ(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 yp(ud(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 yp(ud(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=gf(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
|
|
200
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new yp(ud(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 Qg(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 LI="\uFEFF",$I="",UI="",Fw="";function pJ(e){switch(e){case LI:return"byte-order-mark";case $I:return"doc-mode";case UI:return"flow-error-end";case Fw:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
201
|
+
`:case`\r
|
|
202
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function yi(e){switch(e){case void 0:case" ":case`
|
|
203
|
+
`:case"\r":case" ":return!0;default:return!1}}const AE=new Set("0123456789ABCDEFabcdef"),mJ=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),bp=new Set(",[]{}"),gJ=new Set(` ,[]{}
|
|
204
|
+
\r `),zb=e=>!e||gJ.has(e);class vJ{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
|
|
205
|
+
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
206
|
+
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const i=this.buffer[r+t+1];if(i===`
|
|
207
|
+
`||!i&&!this.atEnd)return t+r+1}return n===`
|
|
208
|
+
`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&yi(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
|
|
209
|
+
`,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===LI&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const s=t[r-1];if(s===" "||s===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const s=t[n-1];if(s===" "||s===" ")n-=1;else break}const i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield $I,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==="...")&&yi(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&&!yi(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===":")&&yi(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(zb),"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("..."))&&yi(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield UI,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(zb),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const l=this.charAt(1);if(this.flowKey||yi(l)||l===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let i=r.indexOf(`
|
|
210
|
+
`,this.pos);if(i!==-1){for(;i!==-1;){const s=this.continueScalar(i+1);if(s===-1)break;i=r.indexOf(`
|
|
211
|
+
`,s)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>yi(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":n+=1;break;case`
|
|
212
|
+
`:t=s,n=0;break;case"\r":{const l=this.buffer[s+1];if(!l&&!this.atEnd)return this.setNext("block-scalar");if(l===`
|
|
213
|
+
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const s=this.continueScalar(t+1);if(s===-1)break;t=this.buffer.indexOf(`
|
|
214
|
+
`,s)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
215
|
+
`;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let s=t-1,l=this.buffer[s];l==="\r"&&(l=this.buffer[--s]);const c=s;for(;l===" ";)l=this.buffer[--s];if(l===`
|
|
216
|
+
`&&s>=this.pos&&s+1+n>c)t=s;else break}while(!0);return yield Fw,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){const s=this.buffer[r+1];if(yi(s)||t&&bp.has(s))break;n=r}else if(yi(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===`
|
|
217
|
+
`?(r+=1,i=`
|
|
218
|
+
`,s=this.buffer[r+1]):n=r),s==="#"||t&&bp.has(s))break;if(i===`
|
|
219
|
+
`){const l=this.continueScalar(r+1);if(l===-1)break;r=Math.max(r,l-2)}}else{if(t&&bp.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Fw,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(zb))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(yi(n)||t&&bp.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(;!yi(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(mJ.has(n))n=this.buffer[++t];else if(n==="%"&&AE.has(this.buffer[t+1])&&AE.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
|
|
220
|
+
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
221
|
+
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class yJ{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const s=n+r>>1;this.lineStarts[s]<t?n=s+1:r=s}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const i=this.lineStarts[n-1];return{line:n,col:t-i+1}}}}function Ns(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function EE(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 BI(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 xp(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 oc(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 TE(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Ns(t.start,"explicit-key-ind")&&!Ns(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,BI(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 bJ{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 vJ,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=pJ(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"&&TE(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&&EE(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{EE(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=xp(this.peek(2)),r=oc(n);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const s={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
222
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
223
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let s=[];if(i&&n.sep&&!n.value){const l=[];for(let c=0;c<n.sep.length;++c){const f=n.sep[c];switch(f.type){case"newline":l.push(c);break;case"space":break;case"comment":f.indent>t.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(s=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(s.push(this.sourceToken),t.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(s.push(this.sourceToken),t.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ns(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(BI(n.key)&&!Ns(n.sep,"newline")){const l=oc(n.start),c=n.key,f=n.sep;f.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:f}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(Ns(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=oc(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:s,key:null,sep:[this.sourceToken]}):Ns(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);i||n.value?(t.items.push({start:s,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ns(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:s});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Ns(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=xp(r),s=oc(i);TE(t);const l=t.end.splice(1,t.end.length);l.push(this.sourceToken);const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
224
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
225
|
+
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=xp(t),r=oc(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=xp(t),r=oc(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 xJ(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new yJ||null,prettyErrors:t}}function wJ(e,t={}){const{lineCounter:n,prettyErrors:r}=xJ(t),i=new bJ(n?.addNewLine),s=new hJ(t),l=Array.from(s.compose(i.parse(e)));if(r&&n)for(const c of l)c.errors.forEach(OE(e,n)),c.warnings.forEach(OE(e,n));return l.length>0?l:Object.assign([],{empty:!0},s.streamInfo())}function SJ({onApplied:e}){const[t,n]=x.useState(""),[r,i]=x.useState(!1),[s,l]=x.useState([]),[c,f]=x.useState([]),h=async()=>{if(!t.trim())return;i(!0),l([]),f([]);const p=wJ(t),g=[],v=[];for(let y=0;y<p.length;y++){const S=p[y];if(S.errors.length>0){g.push(`Document ${y+1}: ${S.errors[0]?.message}`);continue}const w=S.toJSON();if(!(!w||typeof w!="object"))try{const N=await A9(w);v.push(`Applied "${N.displayName||N.name}" (revision ${N.configRevision})`)}catch(N){g.push(`Document ${y+1}: ${N instanceof Error?N.message:String(N)}`)}}l(v),f(g),i(!1),v.length>0&&(at({title:"YAML applied",detail:`Applied ${v.length} document${v.length===1?"":"s"} successfully.`,tone:g.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return u.jsxs("section",{className:"mt-8",children:[u.jsx("div",{className:"page-section-divider"}),u.jsx("div",{className:"section-head mt-6",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),u.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),u.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",u.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",u.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),u.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
|
|
226
|
+
kind: Project
|
|
227
|
+
metadata:
|
|
228
|
+
name: my-project
|
|
229
|
+
spec:
|
|
230
|
+
canonicalDomain: example.com
|
|
231
|
+
country: US
|
|
232
|
+
language: en
|
|
233
|
+
keywords: []`,value:t,onChange:p=>n(p.target.value)}),s.length>0&&u.jsx("ul",{className:"mt-2 space-y-1",children:s.map((p,g)=>u.jsx("li",{className:"text-emerald-400 text-sm",children:p},g))}),c.length>0&&u.jsx("ul",{className:"mt-2 space-y-1",children:c.map((p,g)=>u.jsx("li",{className:"text-rose-400 text-sm",children:p},g))}),u.jsx("div",{className:"mt-3",children:u.jsx(me,{type:"button",disabled:!t.trim()||r,onClick:h,children:r?"Applying...":"Apply"})})]})}function jJ(){const{dashboard:e,isLoading:t,refetch:n}=hl();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(_=>u.jsx("div",{className:"skeleton-text-sm w-16"},_))}),[1,2,3].map(_=>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"})]},_))]})]});const r=e.projects,i=Vs(),[s,l]=x.useState(!1),[c,f]=x.useState(""),[h,p]=x.useState(""),[g,v]=x.useState(""),[y,S]=x.useState("US"),[w,N]=x.useState("en"),[C,E]=x.useState(!1),[A,O]=x.useState(null),P=c.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),z=async()=>{if(!(!P||!g)){E(!0),O(null);try{const _=await _g(P,{displayName:h||c,canonicalDomain:g,country:y,language:w});at({title:"Project created",detail:`${_.displayName||_.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${_.name}`,dedupeMode:"drop"}),n(),f(""),p(""),v(""),S("US"),N("en"),l(!1),i({to:"/projects/$projectId",params:{projectId:_.id}})}catch(_){O(_ instanceof Error?_.message:"Failed to create project")}finally{E(!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(me,{type:"button",onClick:()=>l(_=>!_),children:[u.jsx(vA,{className:"size-4 mr-1.5"}),"Add project"]})})]}),s?u.jsxs(He,{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:_=>f(_.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:h,onChange:_=>p(_.target.value)})]})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),u.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:g,onChange:_=>v(_.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:y,onChange:_=>S(_.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:_=>N(_.target.value.toLowerCase())})]})]})]}),A?u.jsx("p",{className:"text-rose-400 text-sm mt-3",children:A}):null,u.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[u.jsx(me,{type:"button",disabled:!P||!g||C,onClick:z,children:C?"Creating...":"Create project"}),u.jsx(me,{type:"button",variant:"ghost",onClick:()=>l(!1),children:"Cancel"})]})]}):null,r.length>0?u.jsx("div",{className:"data-table-wrapper",children:u.jsxs("table",{className:"data-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Name"}),u.jsx("th",{children:"Domain"}),u.jsx("th",{children:"Visibility"}),u.jsx("th",{children:"Last run"}),u.jsx("th",{className:"text-right",children:"Country"})]})}),u.jsx("tbody",{children:r.map(_=>{const T=_.recentRuns[0];return u.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:_.project.id}}),children:[u.jsxs("td",{children:[u.jsx(Lt,{to:"/projects/$projectId",params:{projectId:_.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:R=>R.stopPropagation(),children:_.project.displayName||_.project.name}),u.jsx("p",{className:"text-[11px] text-zinc-500",children:_.project.name})]}),u.jsx("td",{className:"text-zinc-400",children:_.project.canonicalDomain}),u.jsx("td",{children:u.jsx(bt,{tone:_.visibilitySummary.tone,children:_.visibilitySummary.value})}),u.jsx("td",{className:"text-zinc-500 text-sm",children:T?u.jsx(zg,{status:T.status}):u.jsx("span",{className:"text-zinc-600",children:"No runs"})}),u.jsx("td",{className:"text-right text-zinc-500",children:_.project.country})]},_.project.id)})})]})}):s?null:u.jsxs(He,{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(me,{type:"button",onClick:()=>l(!0),children:[u.jsx(vA,{className:"size-4 mr-1.5"}),"Add project"]})]}),u.jsx(SJ,{onApplied:()=>{n()}})]})}function Kw({state:e}){return u.jsx(bt,{tone:aH(e),children:Eg(e)})}function qI({run:e}){const{openRun:t}=Qc();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(zg,{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(me,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function FI({value:e,label:t,delta:n,tone:r,description:i,tooltip:s,isNumeric:l=!0,progress:c,providerCoverage:f}){const g=2*Math.PI*48,v=Number.parseInt(e,10),y=typeof c=="number"&&Number.isFinite(c)?Math.min(Math.max(c,0),1):l&&!Number.isNaN(v)?Math.min(v/100,1):.5,S=g*(1-y);return u.jsxs("div",{className:"score-gauge",children:[u.jsxs("div",{className:"gauge-ring-wrapper",children:[u.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[u.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),u.jsx("circle",{className:`gauge-fill gauge-fill-${r}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:g,strokeDashoffset:S,transform:"rotate(-90 60 60)"})]}),u.jsx("div",{className:"gauge-center",children:u.jsx("span",{className:l?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),u.jsxs("p",{className:"gauge-label",children:[t,s&&u.jsx(Ln,{text:s})]}),u.jsx("p",{className:"gauge-delta",children:n}),f&&u.jsx("p",{className:"gauge-provider-coverage",children:f}),u.jsx("p",{className:"gauge-description",children:i})]})}function PE({history:e,maxDots:t=12}){const n=e.slice(-t);if(n.length===0)return u.jsx("span",{className:"text-[11px] text-zinc-600",children:"No data"});const r={cited:"bg-emerald-400","not-cited":"bg-zinc-600",lost:"bg-rose-400",emerging:"bg-amber-400 ring-1 ring-amber-300/60"},i=new Date(n[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),s=new Date(n[n.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:i}),u.jsx("div",{className:"flex items-center gap-[3px]",title:`${n.length} runs`,children:n.map((l,c)=>u.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[l.citationState]??"bg-zinc-700"} ${l.model&&c>0&&n[c-1]?.model&&n[c-1].model!==l.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[l.citationState,new Date(l.createdAt).toLocaleDateString(),l.model?`model ${l.model}`:null,l.model&&c>0&&n[c-1]?.model&&n[c-1].model!==l.model?"model changed":null].filter(Boolean).join(" — ")},c))}),u.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:s})]})}function NJ(e){const t=new Map;for(const r of e)for(const i of r.runHistory){const s=t.get(i.createdAt);s?s.states.push(i.citationState):t.set(i.createdAt,{states:[i.citationState],runId:i.runId})}return[...t.entries()].sort(([r],[i])=>r.localeCompare(i)).map(([r,{states:i,runId:s}])=>({runId:s,createdAt:r,citationState:i.includes("cited")?"cited":i.includes("emerging")?"emerging":"not-cited"}))}function CJ({evidence:e}){const{openEvidence:t}=Qc(),[n,r]=x.useState(new Set),i=x.useMemo(()=>{const l=new Map;for(const c of e){const f=l.get(c.keyword)??[];l.set(c.keyword,[...f,c])}return[...l.entries()].map(([c,f])=>({phrase:c,items:f}))},[e]),s=l=>{r(c=>{const f=new Set(c);return f.has(l)?f.delete(l):f.add(l),f})};return u.jsx("div",{className:"evidence-table-wrap",children:u.jsxs("table",{className:"evidence-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{style:{width:"2rem"}}),u.jsx("th",{children:"Key Phrase"}),u.jsx("th",{children:"Status"}),u.jsx("th",{children:"Citation History"}),u.jsx("th",{children:"Change"}),u.jsx("th",{})]})}),u.jsx("tbody",{children:i.map(({phrase:l,items:c})=>{const f=n.has(l),h=c.map(S=>S.citationState),p=h.includes("cited")?"cited":h.includes("emerging")?"emerging":h.includes("lost")?"lost":h.every(S=>S==="pending")?"pending":"not-cited",g=NJ(c),v=c.filter(S=>S.citationState==="cited"||S.citationState==="emerging").length,y=(()=>{if(g.length===0)return"Awaiting first run";if(g.length===1)return"First observation";const S=g[g.length-1].citationState,w=g[g.length-2].citationState;if(w!=="cited"&&S==="cited")return"Newly cited";if(w==="cited"&&S!=="cited")return"Lost since last run";let N=0;for(let C=g.length-1;C>=0&&g[C].citationState===S;C--)N++;return S==="cited"?N<=1?"Cited in latest run":`Cited for ${N} runs`:N<=1?"Not cited in latest run":`Not cited across ${N} runs`})();return u.jsxs(x.Fragment,{children:[u.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>s(l),"aria-expanded":f,children:[u.jsx("td",{children:u.jsx(kg,{size:14,className:`transition-transform duration-150 text-zinc-500 ${f?"rotate-90":""}`})}),u.jsx("td",{className:"evidence-keyword-cell",children:u.jsxs("div",{children:[u.jsx("span",{className:"font-medium text-zinc-100",children:l}),u.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:c.map(S=>u.jsx(Ud,{provider:S.provider},S.id))})]})}),u.jsx("td",{children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Kw,{state:p}),u.jsxs("span",{className:"text-[11px] text-zinc-500",children:[v,"/",c.length]})]})}),u.jsx("td",{children:u.jsx(PE,{history:g})}),u.jsx("td",{className:"evidence-change-cell",children:y}),u.jsx("td",{})]}),f&&c.map(S=>u.jsxs("tr",{className:"bg-zinc-900/30",children:[u.jsx("td",{}),u.jsx("td",{className:"evidence-keyword-cell pl-5",children:u.jsx(Ud,{provider:S.provider})}),u.jsx("td",{children:u.jsx(Kw,{state:S.citationState})}),u.jsx("td",{children:u.jsx(PE,{history:S.runHistory})}),u.jsx("td",{className:"evidence-change-cell",children:S.changeLabel}),u.jsx("td",{children:u.jsx(me,{variant:"ghost",size:"sm",type:"button",onClick:w=>{w.stopPropagation(),t(S.id)},children:"View"})})]},S.id))]},l)})})]})})}function OJ({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(bt,{tone:sH(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 zE({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:s,coverageValue:l,note:c,updatedAt:f,active:h,onClick:p}){return u.jsxs("button",{type:"button",onClick:p,className:`surface-card w-full text-left transition-colors ${h?"border-zinc-200 bg-zinc-900/50":"hover:border-zinc-700 hover:bg-zinc-900/40"}`,children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),u.jsx("h3",{children:t})]}),u.jsx(bt,{tone:r,children:n})]}),u.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:i}),u.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:s})]}),u.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),u.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:l})]})]}),u.jsxs("div",{className:"mt-3 flex flex-col gap-1 text-xs text-zinc-500 sm:flex-row sm:items-center sm:justify-between",children:[u.jsx("span",{children:c}),u.jsx("span",{children:f?`Updated ${xi(f)}`:"No recent sync yet"})]})]})}function wp({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 _J=["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 F1(e){if(typeof e!="string")return!1;var t=_J;return t.includes(e)}var kJ=["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"],AJ=new Set(kJ);function KI(e){return typeof e!="string"?!1:AJ.has(e)}function HI(e){return typeof e=="string"&&e.startsWith("data-")}function Oi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(KI(n)||HI(n))&&(t[n]=e[n]);return t}function Xg(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Oi(t)}return typeof e=="object"&&!Array.isArray(e)?Oi(e):null}function xr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(KI(n)||HI(n)||F1(n))&&(t[n]=e[n]);return t}function EJ(e){return e==null?null:x.isValidElement(e)?xr(e.props):typeof e=="object"&&!Array.isArray(e)?xr(e):null}var TJ=["children","width","height","viewBox","className","style","title","desc"];function Hw(){return Hw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hw.apply(null,arguments)}function PJ(e,t){if(e==null)return{};var n,r,i=zJ(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zJ(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 K1=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:s,className:l,style:c,title:f,desc:h}=e,p=PJ(e,TJ),g=s||{width:r,height:i,x:0,y:0},v=gt("recharts-surface",l);return x.createElement("svg",Hw({},xr(p),{className:v,width:r,height:i,style:c,viewBox:"".concat(g.x," ").concat(g.y," ").concat(g.width," ").concat(g.height),ref:t}),x.createElement("title",null,f),x.createElement("desc",null,h),n)}),MJ=["children","className"];function Gw(){return Gw=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},Gw.apply(null,arguments)}function RJ(e,t){if(e==null)return{};var n,r,i=DJ(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function DJ(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 _i=x.forwardRef((e,t)=>{var{children:n,className:r}=e,i=RJ(e,MJ),s=gt("recharts-layer",r);return x.createElement("g",Gw({className:s},xr(i),{ref:t}),n)}),GI=x.createContext(null),IJ=()=>x.useContext(GI);function kt(e){return function(){return e}}const VI=Math.cos,jm=Math.sin,Ti=Math.sqrt,Nm=Math.PI,Jg=2*Nm,Vw=Math.PI,Zw=2*Vw,_o=1e-6,LJ=Zw-_o;function ZI(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function $J(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ZI;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class UJ{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?ZI:$J(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+l}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let l=this._x1,c=this._y1,f=r-t,h=i-n,p=l-t,g=c-n,v=p*p+g*g;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(v>_o)if(!(Math.abs(g*f-h*p)>_o)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let y=r-l,S=i-c,w=f*f+h*h,N=y*y+S*S,C=Math.sqrt(w),E=Math.sqrt(v),A=s*Math.tan((Vw-Math.acos((w+v-N)/(2*C*E)))/2),O=A/E,P=A/C;Math.abs(O-1)>_o&&this._append`L${t+O*p},${n+O*g}`,this._append`A${s},${s},0,0,${+(g*y>p*S)},${this._x1=t+P*f},${this._y1=n+P*h}`}}arc(t,n,r,i,s,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),f=r*Math.sin(i),h=t+c,p=n+f,g=1^l,v=l?i-s:s-i;this._x1===null?this._append`M${h},${p}`:(Math.abs(this._x1-h)>_o||Math.abs(this._y1-p)>_o)&&this._append`L${h},${p}`,r&&(v<0&&(v=v%Zw+Zw),v>LJ?this._append`A${r},${r},0,1,${g},${t-c},${n-f}A${r},${r},0,1,${g},${this._x1=h},${this._y1=p}`:v>_o&&this._append`A${r},${r},0,${+(v>=Vw)},${g},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function H1(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 UJ(t)}function G1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function YI(e){this._context=e}YI.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 ev(e){return new YI(e)}function WI(e){return e[0]}function QI(e){return e[1]}function XI(e,t){var n=kt(!0),r=null,i=ev,s=null,l=H1(c);e=typeof e=="function"?e:e===void 0?WI:kt(e),t=typeof t=="function"?t:t===void 0?QI:kt(t);function c(f){var h,p=(f=G1(f)).length,g,v=!1,y;for(r==null&&(s=i(y=l())),h=0;h<=p;++h)!(h<p&&n(g=f[h],h,f))===v&&((v=!v)?s.lineStart():s.lineEnd()),v&&s.point(+e(g,h,f),+t(g,h,f));if(y)return s=null,y+""||null}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:kt(+f),c):e},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:kt(+f),c):t},c.defined=function(f){return arguments.length?(n=typeof f=="function"?f:kt(!!f),c):n},c.curve=function(f){return arguments.length?(i=f,r!=null&&(s=i(r)),c):i},c.context=function(f){return arguments.length?(f==null?r=s=null:s=i(r=f),c):r},c}function Sp(e,t,n){var r=null,i=kt(!0),s=null,l=ev,c=null,f=H1(h);e=typeof e=="function"?e:e===void 0?WI:kt(+e),t=typeof t=="function"?t:kt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?QI:kt(+n);function h(g){var v,y,S,w=(g=G1(g)).length,N,C=!1,E,A=new Array(w),O=new Array(w);for(s==null&&(c=l(E=f())),v=0;v<=w;++v){if(!(v<w&&i(N=g[v],v,g))===C)if(C=!C)y=v,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),S=v-1;S>=y;--S)c.point(A[S],O[S]);c.lineEnd(),c.areaEnd()}C&&(A[v]=+e(N,v,g),O[v]=+t(N,v,g),c.point(r?+r(N,v,g):A[v],n?+n(N,v,g):O[v]))}if(E)return c=null,E+""||null}function p(){return XI().defined(i).curve(l).context(s)}return h.x=function(g){return arguments.length?(e=typeof g=="function"?g:kt(+g),r=null,h):e},h.x0=function(g){return arguments.length?(e=typeof g=="function"?g:kt(+g),h):e},h.x1=function(g){return arguments.length?(r=g==null?null:typeof g=="function"?g:kt(+g),h):r},h.y=function(g){return arguments.length?(t=typeof g=="function"?g:kt(+g),n=null,h):t},h.y0=function(g){return arguments.length?(t=typeof g=="function"?g:kt(+g),h):t},h.y1=function(g){return arguments.length?(n=g==null?null:typeof g=="function"?g:kt(+g),h):n},h.lineX0=h.lineY0=function(){return p().x(e).y(t)},h.lineY1=function(){return p().x(e).y(n)},h.lineX1=function(){return p().x(r).y(t)},h.defined=function(g){return arguments.length?(i=typeof g=="function"?g:kt(!!g),h):i},h.curve=function(g){return arguments.length?(l=g,s!=null&&(c=l(s)),h):l},h.context=function(g){return arguments.length?(g==null?s=c=null:c=l(s=g),h):s},h}class JI{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 BJ(e){return new JI(e,!0)}function qJ(e){return new JI(e,!1)}const V1={draw(e,t){const n=Ti(t/Nm);e.moveTo(n,0),e.arc(0,0,n,0,Jg)}},FJ={draw(e,t){const n=Ti(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()}},eL=Ti(1/3),KJ=eL*2,HJ={draw(e,t){const n=Ti(t/KJ),r=n*eL;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},GJ={draw(e,t){const n=Ti(t),r=-n/2;e.rect(r,r,n,n)}},VJ=.8908130915292852,tL=jm(Nm/10)/jm(7*Nm/10),ZJ=jm(Jg/10)*tL,YJ=-VI(Jg/10)*tL,WJ={draw(e,t){const n=Ti(t*VJ),r=ZJ*n,i=YJ*n;e.moveTo(0,-n),e.lineTo(r,i);for(let s=1;s<5;++s){const l=Jg*s/5,c=VI(l),f=jm(l);e.lineTo(f*n,-c*n),e.lineTo(c*r-f*i,f*r+c*i)}e.closePath()}},Mb=Ti(3),QJ={draw(e,t){const n=-Ti(t/(Mb*3));e.moveTo(0,n*2),e.lineTo(-Mb*n,-n),e.lineTo(Mb*n,-n),e.closePath()}},Gr=-.5,Vr=Ti(3)/2,Yw=1/Ti(12),XJ=(Yw/2+1)*3,JJ={draw(e,t){const n=Ti(t/XJ),r=n/2,i=n*Yw,s=r,l=n*Yw+n,c=-s,f=l;e.moveTo(r,i),e.lineTo(s,l),e.lineTo(c,f),e.lineTo(Gr*r-Vr*i,Vr*r+Gr*i),e.lineTo(Gr*s-Vr*l,Vr*s+Gr*l),e.lineTo(Gr*c-Vr*f,Vr*c+Gr*f),e.lineTo(Gr*r+Vr*i,Gr*i-Vr*r),e.lineTo(Gr*s+Vr*l,Gr*l-Vr*s),e.lineTo(Gr*c+Vr*f,Gr*f-Vr*c),e.closePath()}};function eee(e,t){let n=null,r=H1(i);e=typeof e=="function"?e:kt(e||V1),t=typeof t=="function"?t:kt(t===void 0?64:+t);function i(){let s;if(n||(n=s=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:kt(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:kt(+s),i):t},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function Cm(){}function Om(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 nL(e){this._context=e}nL.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:Om(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:Om(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tee(e){return new nL(e)}function rL(e){this._context=e}rL.prototype={areaStart:Cm,areaEnd:Cm,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:Om(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function nee(e){return new rL(e)}function iL(e){this._context=e}iL.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:Om(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ree(e){return new iL(e)}function aL(e){this._context=e}aL.prototype={areaStart:Cm,areaEnd:Cm,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 iee(e){return new aL(e)}function ME(e){return e<0?-1:1}function RE(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),c=(s*i+l*r)/(r+i);return(ME(s)+ME(l))*Math.min(Math.abs(s),Math.abs(l),.5*Math.abs(c))||0}function DE(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Rb(e,t,n){var r=e._x0,i=e._y0,s=e._x1,l=e._y1,c=(s-r)/3;e._context.bezierCurveTo(r+c,i+c*t,s-c,l-c*n,s,l)}function _m(e){this._context=e}_m.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:Rb(this,this._t0,DE(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,Rb(this,DE(this,n=RE(this,e,t)),n);break;default:Rb(this,this._t0,n=RE(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function sL(e){this._context=new oL(e)}(sL.prototype=Object.create(_m.prototype)).point=function(e,t){_m.prototype.point.call(this,t,e)};function oL(e){this._context=e}oL.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function aee(e){return new _m(e)}function see(e){return new sL(e)}function lL(e){this._context=e}lL.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=IE(e),i=IE(t),s=0,l=1;l<n;++s,++l)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[l],t[l]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function IE(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),l=new Array(n);for(i[0]=0,s[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(l[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function oee(e){return new lL(e)}function tv(e,t){this._context=e,this._t=t}tv.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 lee(e){return new tv(e,.5)}function cee(e){return new tv(e,0)}function uee(e){return new tv(e,1)}function el(e,t){if((l=e.length)>1)for(var n=1,r,i,s=e[t[0]],l,c=s.length;n<l;++n)for(i=s,s=e[t[n]],r=0;r<c;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Ww(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function dee(e,t){return e[t]}function fee(e){const t=[];return t.key=e,t}function hee(){var e=kt([]),t=Ww,n=el,r=dee;function i(s){var l=Array.from(e.apply(this,arguments),fee),c,f=l.length,h=-1,p;for(const g of s)for(c=0,++h;c<f;++c)(l[c][h]=[0,+r(g,l[c].key,h,s)]).data=g;for(c=0,p=G1(t(l));c<f;++c)l[p[c]].index=c;return n(l,p),l}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:kt(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:kt(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?Ww:typeof s=="function"?s:kt(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??el,i):n},i}function pee(e,t){if((r=e.length)>0){for(var n,r,i=0,s=e[0].length,l;i<s;++i){for(l=n=0;n<r;++n)l+=e[n][i][1]||0;if(l)for(n=0;n<r;++n)e[n][i][1]/=l}el(e,t)}}function mee(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,s=r.length;n<s;++n){for(var l=0,c=0;l<i;++l)c+=e[l][n][1]||0;r[n][1]+=r[n][0]=-c/2}el(e,t)}}function gee(e,t){if(!(!((l=e.length)>0)||!((s=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,s,l;r<s;++r){for(var c=0,f=0,h=0;c<l;++c){for(var p=e[t[c]],g=p[r][1]||0,v=p[r-1][1]||0,y=(g-v)/2,S=0;S<c;++S){var w=e[t[S]],N=w[r][1]||0,C=w[r-1][1]||0;y+=N-C}f+=g,h+=y*g}i[r-1][1]+=i[r-1][0]=n,f&&(n-=h/f)}i[r-1][1]+=i[r-1][0]=n,el(e,t)}}var Db={},Ib={},LE;function vee(){return LE||(LE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(Ib)),Ib}var Lb={},$E;function cL(){return $E||($E=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})(Lb)),Lb}var $b={},UE;function Z1(){return UE||(UE=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})($b)),$b}var Ub={},Bb={},BE;function yee(){return BE||(BE=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})(Bb)),Bb}var qE;function Y1(){return qE||(qE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yee(),n=Z1();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const s=[],l=i.length;if(l===0)return s;let c=0,f="",h="",p=!1;for(i.charCodeAt(0)===46&&(s.push(""),c++);c<l;){const g=i[c];h?g==="\\"&&c+1<l?(c++,f+=i[c]):g===h?h="":f+=g:p?g==='"'||g==="'"?h=g:g==="]"?(p=!1,s.push(f),f=""):f+=g:g==="["?(p=!0,f&&(s.push(f),f="")):g==="."?f&&(s.push(f),f=""):f+=g,c++}return f&&s.push(f),s}e.toPath=r})(Ub)),Ub}var FE;function W1(){return FE||(FE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vee(),n=cL(),r=Z1(),i=Y1();function s(c,f,h){if(c==null)return h;switch(typeof f){case"string":{if(t.isUnsafeProperty(f))return h;const p=c[f];return p===void 0?n.isDeepKey(f)?s(c,i.toPath(f),h):h:p}case"number":case"symbol":{typeof f=="number"&&(f=r.toKey(f));const p=c[f];return p===void 0?h:p}default:{if(Array.isArray(f))return l(c,f,h);if(Object.is(f?.valueOf(),-0)?f="-0":f=String(f),t.isUnsafeProperty(f))return h;const p=c[f];return p===void 0?h:p}}}function l(c,f,h){if(f.length===0)return h;let p=c;for(let g=0;g<f.length;g++){if(p==null||t.isUnsafeProperty(f[g]))return h;p=p[f[g]]}return p===void 0?h:p}e.get=s})(Db)),Db}var qb,KE;function bee(){return KE||(KE=1,qb=W1().get),qb}var xee=bee();const nv=Ks(xee);var wee=4;function Ps(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wee,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Dn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,s,l)=>{var c=n[l-1];return typeof c=="string"?i+c+s:c!==void 0?i+Ps(c)+s:i+s},"")}var ni=e=>e===0?0:e>0?1:-1,Xi=e=>typeof e=="number"&&e!=+e,tl=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,ze=e=>(typeof e=="number"||e instanceof Number)&&!Xi(e),oi=e=>ze(e)||typeof e=="string",See=0,Vd=e=>{var t=++See;return"".concat(e||"").concat(t)},Fs=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ze(t)&&typeof t!="string")return r;var s;if(tl(t)){if(n==null)return r;var l=t.indexOf("%");s=n*parseFloat(t.slice(0,l))/100}else s=+t;return Xi(s)&&(s=r),i&&n!=null&&s>n&&(s=n),s},uL=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 Hi(e,t,n){return ze(e)&&ze(t)?Ps(e+n*(t-e)):t}function dL(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):nv(r,t))===n)}var Un=e=>e===null||typeof e>"u",vf=e=>Un(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function vr(e){return e!=null}function nu(){}var jee=["type","size","sizeType"];function Qw(){return Qw=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},Qw.apply(null,arguments)}function HE(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 GE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HE(Object(n),!0).forEach(function(r){Nee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nee(e,t,n){return(t=Cee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cee(e){var t=Oee(e,"string");return typeof t=="symbol"?t:t+""}function Oee(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 _ee(e,t){if(e==null)return{};var n,r,i=kee(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kee(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 fL={symbolCircle:V1,symbolCross:FJ,symbolDiamond:HJ,symbolSquare:GJ,symbolStar:WJ,symbolTriangle:QJ,symbolWye:JJ},Aee=Math.PI/180,Eee=e=>{var t="symbol".concat(vf(e));return fL[t]||V1},Tee=(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*Aee;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}},Pee=(e,t)=>{fL["symbol".concat(vf(e))]=t},hL=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=_ee(e,jee),s=GE(GE({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var c=()=>{var v=Eee(l),y=eee().type(v).size(Tee(n,r,l)),S=y();if(S!==null)return S},{className:f,cx:h,cy:p}=s,g=xr(s);return ze(h)&&ze(p)&&ze(n)?x.createElement("path",Qw({},g,{className:gt("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:c()})):null};hL.registerSymbol=Pee;var pL=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,Q1=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(x.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{F1(i)&&typeof n[i]=="function"&&(r[i]=(s=>n[i](n,s)))}),r},zee=(e,t,n)=>r=>(e(t,n,r),null),mL=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var s=e[i];F1(i)&&typeof s=="function"&&(r||(r={}),r[i]=zee(s,t,n))}),r};function VE(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 Mee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VE(Object(n),!0).forEach(function(r){Ree(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ree(e,t,n){return(t=Dee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dee(e){var t=Iee(e,"string");return typeof t=="symbol"?t:t+""}function Iee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sr(e,t){var n=Mee({},e),r=t,i=Object.keys(t),s=i.reduce((l,c)=>(l[c]===void 0&&r[c]!==void 0&&(l[c]=r[c]),l),n);return s}function km(){return km=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},km.apply(null,arguments)}function ZE(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 gL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZE(Object(n),!0).forEach(function(r){Lee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lee(e,t,n){return(t=$ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $ee(e){var t=Uee(e,"string");return typeof t=="symbol"?t:t+""}function Uee(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 Qr=32,Bee={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function qee(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Fee(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Qr/2,s=Qr/6,l=Qr/3,c=t.inactive?r:t.color,f=n??t.type;if(f==="none")return null;if(f==="plainline")return x.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:qee(t.payload),x1:0,y1:i,x2:Qr,y2:i,className:"recharts-legend-icon"});if(f==="line")return x.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
|
|
234
|
+
A`).concat(s,",").concat(s,",0,1,1,").concat(2*l,",").concat(i,`
|
|
235
|
+
H`).concat(Qr,"M").concat(2*l,",").concat(i,`
|
|
236
|
+
A`).concat(s,",").concat(s,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(f==="rect")return x.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Qr/8,"h").concat(Qr,"v").concat(Qr*3/4,"h").concat(-Qr,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var h=gL({},t);return delete h.legendIcon,x.cloneElement(t.legendIcon,h)}return x.createElement(hL,{fill:c,cx:i,cy:i,size:Qr,sizeType:"diameter",type:f})}function Kee(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:s,iconType:l,labelStyle:c}=e,f={x:0,y:0,width:Qr,height:Qr},h={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((g,v)=>{var y=g.formatter||i,S=gt({"recharts-legend-item":!0,["legend-item-".concat(v)]:!0,inactive:g.inactive});if(g.type==="none")return null;var w=typeof c=="object"?gL({},c):{};w.color=g.inactive?s:w.color||g.color;var N=y?y(g.value,g,v):g.value;return x.createElement("li",km({className:S,style:h,key:"legend-item-".concat(v)},mL(e,g,v)),x.createElement(K1,{width:n,height:n,viewBox:f,style:p,"aria-label":"".concat(g.value," legend icon")},x.createElement(Fee,{data:g,iconType:l,inactiveColor:s})),x.createElement("span",{className:"recharts-legend-item-text",style:w},N))})}var Hee=e=>{var t=sr(e,Bee),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var s={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return x.createElement("ul",{className:"recharts-default-legend",style:s},x.createElement(Kee,km({},t,{payload:n})))},Fb={},Kb={},YE;function Gee(){return YE||(YE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let s=0;s<n.length;s++){const l=n[s],c=r(l,s,n);i.has(c)||i.set(c,l)}return Array.from(i.values())}e.uniqBy=t})(Kb)),Kb}var Hb={},WE;function Vee(){return WE||(WE=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})(Hb)),Hb}var Gb={},QE;function vL(){return QE||(QE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(Gb)),Gb}var Vb={},Zb={},Yb={},XE;function Zee(){return XE||(XE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(Yb)),Yb}var JE;function yL(){return JE||(JE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Zee();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(Zb)),Zb}var Wb={},eT;function Yee(){return eT||(eT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(Wb)),Wb}var tT;function Wee(){return tT||(tT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yL(),n=Yee();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(Vb)),Vb}var Qb={},Xb={},nT;function Qee(){return nT||(nT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=W1();function n(r){return function(i){return t.get(i,r)}}e.property=n})(Xb)),Xb}var Jb={},ex={},tx={},nx={},rT;function bL(){return rT||(rT=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})(nx)),nx}var rx={},iT;function xL(){return iT||(iT=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})(rx)),rx}var ix={},aT;function wL(){return aT||(aT=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})(ix)),ix}var sT;function Xee(){return sT||(sT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bL(),n=xL(),r=wL();function i(p,g,v){return typeof v!="function"?i(p,g,()=>{}):s(p,g,function y(S,w,N,C,E,A){const O=v(S,w,N,C,E,A);return O!==void 0?!!O:s(S,w,y,A)},new Map)}function s(p,g,v,y){if(g===p)return!0;switch(typeof g){case"object":return l(p,g,v,y);case"function":return Object.keys(g).length>0?s(p,{...g},v,y):r.isEqualsSameValueZero(p,g);default:return t.isObject(p)?typeof g=="string"?g==="":!0:r.isEqualsSameValueZero(p,g)}}function l(p,g,v,y){if(g==null)return!0;if(Array.isArray(g))return f(p,g,v,y);if(g instanceof Map)return c(p,g,v,y);if(g instanceof Set)return h(p,g,v,y);const S=Object.keys(g);if(p==null||n.isPrimitive(p))return S.length===0;if(S.length===0)return!0;if(y?.has(g))return y.get(g)===p;y?.set(g,p);try{for(let w=0;w<S.length;w++){const N=S[w];if(!n.isPrimitive(p)&&!(N in p)||g[N]===void 0&&p[N]!==void 0||g[N]===null&&p[N]!==null||!v(p[N],g[N],N,p,g,y))return!1}return!0}finally{y?.delete(g)}}function c(p,g,v,y){if(g.size===0)return!0;if(!(p instanceof Map))return!1;for(const[S,w]of g.entries()){const N=p.get(S);if(v(N,w,S,p,g,y)===!1)return!1}return!0}function f(p,g,v,y){if(g.length===0)return!0;if(!Array.isArray(p))return!1;const S=new Set;for(let w=0;w<g.length;w++){const N=g[w];let C=!1;for(let E=0;E<p.length;E++){if(S.has(E))continue;const A=p[E];let O=!1;if(v(A,N,w,p,g,y)&&(O=!0),O){S.add(E),C=!0;break}}if(!C)return!1}return!0}function h(p,g,v,y){return g.size===0?!0:p instanceof Set?f([...p],[...g],v,y):!1}e.isMatchWith=i,e.isSetMatch=h})(tx)),tx}var oT;function SL(){return oT||(oT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Xee();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(ex)),ex}var ax={},sx={},ox={},lT;function Jee(){return lT||(lT=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})(ox)),ox}var lx={},cT;function X1(){return cT||(cT=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})(lx)),lx}var cx={},uT;function jL(){return uT||(uT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",s="[object Arguments]",l="[object Symbol]",c="[object Date]",f="[object Map]",h="[object Set]",p="[object Array]",g="[object Function]",v="[object ArrayBuffer]",y="[object Object]",S="[object Error]",w="[object DataView]",N="[object Uint8Array]",C="[object Uint8ClampedArray]",E="[object Uint16Array]",A="[object Uint32Array]",O="[object BigUint64Array]",P="[object Int8Array]",z="[object Int16Array]",_="[object Int32Array]",T="[object BigInt64Array]",R="[object Float32Array]",B="[object Float64Array]";e.argumentsTag=s,e.arrayBufferTag=v,e.arrayTag=p,e.bigInt64ArrayTag=T,e.bigUint64ArrayTag=O,e.booleanTag=i,e.dataViewTag=w,e.dateTag=c,e.errorTag=S,e.float32ArrayTag=R,e.float64ArrayTag=B,e.functionTag=g,e.int16ArrayTag=z,e.int32ArrayTag=_,e.int8ArrayTag=P,e.mapTag=f,e.numberTag=r,e.objectTag=y,e.regexpTag=t,e.setTag=h,e.stringTag=n,e.symbolTag=l,e.uint16ArrayTag=E,e.uint32ArrayTag=A,e.uint8ArrayTag=N,e.uint8ClampedArrayTag=C})(cx)),cx}var ux={},dT;function ete(){return dT||(dT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(ux)),ux}var fT;function NL(){return fT||(fT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Jee(),n=X1(),r=jL(),i=xL(),s=ete();function l(p,g){return c(p,void 0,p,new Map,g)}function c(p,g,v,y=new Map,S=void 0){const w=S?.(p,g,v,y);if(w!==void 0)return w;if(i.isPrimitive(p))return p;if(y.has(p))return y.get(p);if(Array.isArray(p)){const N=new Array(p.length);y.set(p,N);for(let C=0;C<p.length;C++)N[C]=c(p[C],C,v,y,S);return Object.hasOwn(p,"index")&&(N.index=p.index),Object.hasOwn(p,"input")&&(N.input=p.input),N}if(p instanceof Date)return new Date(p.getTime());if(p instanceof RegExp){const N=new RegExp(p.source,p.flags);return N.lastIndex=p.lastIndex,N}if(p instanceof Map){const N=new Map;y.set(p,N);for(const[C,E]of p)N.set(C,c(E,C,v,y,S));return N}if(p instanceof Set){const N=new Set;y.set(p,N);for(const C of p)N.add(c(C,void 0,v,y,S));return N}if(typeof Buffer<"u"&&Buffer.isBuffer(p))return p.subarray();if(s.isTypedArray(p)){const N=new(Object.getPrototypeOf(p)).constructor(p.length);y.set(p,N);for(let C=0;C<p.length;C++)N[C]=c(p[C],C,v,y,S);return N}if(p instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&p instanceof SharedArrayBuffer)return p.slice(0);if(p instanceof DataView){const N=new DataView(p.buffer.slice(0),p.byteOffset,p.byteLength);return y.set(p,N),f(N,p,v,y,S),N}if(typeof File<"u"&&p instanceof File){const N=new File([p],p.name,{type:p.type});return y.set(p,N),f(N,p,v,y,S),N}if(typeof Blob<"u"&&p instanceof Blob){const N=new Blob([p],{type:p.type});return y.set(p,N),f(N,p,v,y,S),N}if(p instanceof Error){const N=structuredClone(p);return y.set(p,N),N.message=p.message,N.name=p.name,N.stack=p.stack,N.cause=p.cause,N.constructor=p.constructor,f(N,p,v,y,S),N}if(p instanceof Boolean){const N=new Boolean(p.valueOf());return y.set(p,N),f(N,p,v,y,S),N}if(p instanceof Number){const N=new Number(p.valueOf());return y.set(p,N),f(N,p,v,y,S),N}if(p instanceof String){const N=new String(p.valueOf());return y.set(p,N),f(N,p,v,y,S),N}if(typeof p=="object"&&h(p)){const N=Object.create(Object.getPrototypeOf(p));return y.set(p,N),f(N,p,v,y,S),N}return p}function f(p,g,v=p,y,S){const w=[...Object.keys(g),...t.getSymbols(g)];for(let N=0;N<w.length;N++){const C=w[N],E=Object.getOwnPropertyDescriptor(p,C);(E==null||E.writable)&&(p[C]=c(g[C],C,v,y,S))}}function h(p){switch(n.getTag(p)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=l,e.cloneDeepWithImpl=c,e.copyProperties=f})(sx)),sx}var hT;function tte(){return hT||(hT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=NL();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(ax)),ax}var pT;function nte(){return pT||(pT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=SL(),n=tte();function r(i){return i=n.cloneDeep(i),s=>t.isMatch(s,i)}e.matches=r})(Jb)),Jb}var dx={},fx={},hx={},mT;function rte(){return mT||(mT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=NL(),n=X1(),r=jL();function i(s,l){return t.cloneDeepWith(s,(c,f,h,p)=>{const g=l?.(c,f,h,p);if(g!==void 0)return g;if(typeof s=="object"){if(n.getTag(s)===r.objectTag&&typeof s.constructor!="function"){const v={};return p.set(s,v),t.copyProperties(v,s,h,p),v}switch(Object.prototype.toString.call(s)){case r.numberTag:case r.stringTag:case r.booleanTag:{const v=new s.constructor(s?.valueOf());return t.copyProperties(v,s),v}case r.argumentsTag:{const v={};return t.copyProperties(v,s),v.length=s.length,v[Symbol.iterator]=s[Symbol.iterator],v}default:return}}})}e.cloneDeepWith=i})(hx)),hx}var gT;function ite(){return gT||(gT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rte();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(fx)),fx}var px={},mx={},vT;function CL(){return vT||(vT=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})(mx)),mx}var gx={},yT;function ate(){return yT||(yT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=X1();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(gx)),gx}var bT;function ste(){return bT||(bT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cL(),n=CL(),r=ate(),i=Y1();function s(l,c){let f;if(Array.isArray(c)?f=c:typeof c=="string"&&t.isDeepKey(c)&&l?.[c]==null?f=i.toPath(c):f=[c],f.length===0)return!1;let h=l;for(let p=0;p<f.length;p++){const g=f[p];if((h==null||!Object.hasOwn(h,g))&&!((Array.isArray(h)||r.isArguments(h))&&n.isIndex(g)&&g<h.length))return!1;h=h[g]}return!0}e.has=s})(px)),px}var xT;function ote(){return xT||(xT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=SL(),n=Z1(),r=ite(),i=W1(),s=ste();function l(c,f){switch(typeof c){case"object":{Object.is(c?.valueOf(),-0)&&(c="-0");break}case"number":{c=n.toKey(c);break}}return f=r.cloneDeep(f),function(h){const p=i.get(h,c);return p===void 0?s.has(h,c):f===void 0?p===void 0:t.isMatch(p,f)}}e.matchesProperty=l})(dx)),dx}var wT;function lte(){return wT||(wT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vL(),n=Qee(),r=nte(),i=ote();function s(l){if(l==null)return t.identity;switch(typeof l){case"function":return l;case"object":return Array.isArray(l)&&l.length===2?i.matchesProperty(l[0],l[1]):r.matches(l);case"string":case"symbol":case"number":return n.property(l)}}e.iteratee=s})(Qb)),Qb}var ST;function cte(){return ST||(ST=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Gee(),n=Vee(),r=vL(),i=Wee(),s=lte();function l(c,f=r.identity){return i.isArrayLikeObject(c)?t.uniqBy(Array.from(c),n.ary(s.iteratee(f),1)):[]}e.uniqBy=l})(Fb)),Fb}var vx,jT;function ute(){return jT||(jT=1,vx=cte().uniqBy),vx}var dte=ute();const NT=Ks(dte);function OL(e,t,n){return t===!0?NT(e,n):typeof t=="function"?NT(e,t):e}var J1=x.createContext(null),fte=e=>e,Yt=()=>{var e=x.useContext(J1);return e?e.store.dispatch:fte},Wp=()=>{},hte=()=>Wp,pte=(e,t)=>e===t;function Re(e){var t=x.useContext(J1),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Wp,[t,e]);return qM.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:hte,t?t.store.getState:Wp,t?t.store.getState:Wp,n,pte)}function mte(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function gte(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function vte(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 CT=e=>Array.isArray(e)?e:[e];function yte(e){const t=Array.isArray(e[0])?e[0]:e;return vte(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function bte(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var xte=class{constructor(e){this.value=e}deref(){return this.value}},wte=typeof WeakRef<"u"?WeakRef:xte,Ste=0,OT=1;function jp(){return{s:Ste,v:void 0,o:null,p:null}}function _L(e,t={}){let n=jp();const{resultEqualityCheck:r}=t;let i,s=0;function l(){let c=n;const{length:f}=arguments;for(let g=0,v=f;g<v;g++){const y=arguments[g];if(typeof y=="function"||typeof y=="object"&&y!==null){let S=c.o;S===null&&(c.o=S=new WeakMap);const w=S.get(y);w===void 0?(c=jp(),S.set(y,c)):c=w}else{let S=c.p;S===null&&(c.p=S=new Map);const w=S.get(y);w===void 0?(c=jp(),S.set(y,c)):c=w}}const h=c;let p;if(c.s===OT)p=c.v;else if(p=e.apply(null,arguments),s++,r){const g=i?.deref?.()??i;g!=null&&r(g,p)&&(p=g,s!==0&&s--),i=typeof p=="object"&&p!==null||typeof p=="function"?new wte(p):p}return h.s=OT,h.v=p,p}return l.clearCache=()=>{n=jp(),l.resetResultsCount()},l.resultsCount=()=>s,l.resetResultsCount=()=>{s=0},l}function jte(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let s=0,l=0,c,f={},h=i.pop();typeof h=="object"&&(f=h,h=i.pop()),mte(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const p={...n,...f},{memoize:g,memoizeOptions:v=[],argsMemoize:y=_L,argsMemoizeOptions:S=[]}=p,w=CT(v),N=CT(S),C=yte(i),E=g(function(){return s++,h.apply(null,arguments)},...w),A=y(function(){l++;const P=bte(C,arguments);return c=E.apply(null,P),c},...N);return Object.assign(A,{resultFunc:h,memoizedResultFunc:E,dependencies:C,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>c,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:g,argsMemoize:y})};return Object.assign(r,{withTypes:()=>r}),r}var te=jte(_L),Nte=Object.assign((e,t=te)=>{gte(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((l,c,f)=>(l[n[f]]=c,l),{}))},{withTypes:()=>Nte}),yx={},bx={},xx={},_T;function Cte(){return _T||(_T=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,s)=>{if(r!==i){const l=t(r),c=t(i);if(l===c&&l===0){if(r<i)return s==="desc"?1:-1;if(r>i)return s==="desc"?-1:1}return s==="desc"?c-l:l-c}return 0};e.compareValues=n})(xx)),xx}var wx={},Sx={},kT;function kL(){return kT||(kT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(Sx)),Sx}var AT;function Ote(){return AT||(AT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kL(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(s,l){return Array.isArray(s)?!1:typeof s=="number"||typeof s=="boolean"||s==null||t.isSymbol(s)?!0:typeof s=="string"&&(r.test(s)||!n.test(s))||l!=null&&Object.hasOwn(l,s)}e.isKey=i})(wx)),wx}var ET;function _te(){return ET||(ET=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Cte(),n=Ote(),r=Y1();function i(s,l,c,f){if(s==null)return[];c=f?void 0:c,Array.isArray(s)||(s=Object.values(s)),Array.isArray(l)||(l=l==null?[null]:[l]),l.length===0&&(l=[null]),Array.isArray(c)||(c=c==null?[]:[c]),c=c.map(y=>String(y));const h=(y,S)=>{let w=y;for(let N=0;N<S.length&&w!=null;++N)w=w[S[N]];return w},p=(y,S)=>S==null||y==null?S:typeof y=="object"&&"key"in y?Object.hasOwn(S,y.key)?S[y.key]:h(S,y.path):typeof y=="function"?y(S):Array.isArray(y)?h(S,y):typeof S=="object"?S[y]:S,g=l.map(y=>(Array.isArray(y)&&y.length===1&&(y=y[0]),y==null||typeof y=="function"||Array.isArray(y)||n.isKey(y)?y:{key:y,path:r.toPath(y)}));return s.map(y=>({original:y,criteria:g.map(S=>p(S,y))})).slice().sort((y,S)=>{for(let w=0;w<g.length;w++){const N=t.compareValues(y.criteria[w],S.criteria[w],c[w]);if(N!==0)return N}return 0}).map(y=>y.original)}e.orderBy=i})(bx)),bx}var jx={},TT;function kte(){return TT||(TT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],s=Math.floor(r),l=(c,f)=>{for(let h=0;h<c.length;h++){const p=c[h];Array.isArray(p)&&f<s?l(p,f+1):i.push(p)}};return l(n,0),i}e.flatten=t})(jx)),jx}var Nx={},PT;function AL(){return PT||(PT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=CL(),n=yL(),r=bL(),i=wL();function s(l,c,f){return r.isObject(f)&&(typeof c=="number"&&n.isArrayLike(f)&&t.isIndex(c)&&c<f.length||typeof c=="string"&&c in f)?i.isEqualsSameValueZero(f[c],l):!1}e.isIterateeCall=s})(Nx)),Nx}var zT;function Ate(){return zT||(zT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_te(),n=kte(),r=AL();function i(s,...l){const c=l.length;return c>1&&r.isIterateeCall(s,l[0],l[1])?l=[]:c>2&&r.isIterateeCall(l[0],l[1],l[2])&&(l=[l[0]]),t.orderBy(s,n.flatten(l),["asc"])}e.sortBy=i})(yx)),yx}var Cx,MT;function Ete(){return MT||(MT=1,Cx=Ate().sortBy),Cx}var Tte=Ete();const rv=Ks(Tte);var EL=e=>e.legend.settings,Pte=e=>e.legend.size,zte=e=>e.legend.payload,Mte=te([zte,EL],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?rv(r,n):r});function Rte(){return Re(Mte)}var Np=1;function TL(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=x.useState({height:0,left:0,top:0,width:0}),r=x.useCallback(i=>{if(i!=null){var s=i.getBoundingClientRect(),l={height:s.height,left:s.left,top:s.top,width:s.width};(Math.abs(l.height-t.height)>Np||Math.abs(l.left-t.left)>Np||Math.abs(l.top-t.top)>Np||Math.abs(l.width-t.width)>Np)&&n({height:l.height,left:l.left,top:l.top,width:l.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Rn(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 Dte=typeof Symbol=="function"&&Symbol.observable||"@@observable",RT=Dte,Ox=()=>Math.random().toString(36).substring(7).split("").join("."),Ite={INIT:`@@redux/INIT${Ox()}`,REPLACE:`@@redux/REPLACE${Ox()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ox()}`},Am=Ite;function ej(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 PL(e,t,n){if(typeof e!="function")throw new Error(Rn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Rn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Rn(1));return n(PL)(e,t)}let r=e,i=t,s=new Map,l=s,c=0,f=!1;function h(){l===s&&(l=new Map,s.forEach((N,C)=>{l.set(C,N)}))}function p(){if(f)throw new Error(Rn(3));return i}function g(N){if(typeof N!="function")throw new Error(Rn(4));if(f)throw new Error(Rn(5));let C=!0;h();const E=c++;return l.set(E,N),function(){if(C){if(f)throw new Error(Rn(6));C=!1,h(),l.delete(E),s=null}}}function v(N){if(!ej(N))throw new Error(Rn(7));if(typeof N.type>"u")throw new Error(Rn(8));if(typeof N.type!="string")throw new Error(Rn(17));if(f)throw new Error(Rn(9));try{f=!0,i=r(i,N)}finally{f=!1}return(s=l).forEach(E=>{E()}),N}function y(N){if(typeof N!="function")throw new Error(Rn(10));r=N,v({type:Am.REPLACE})}function S(){const N=g;return{subscribe(C){if(typeof C!="object"||C===null)throw new Error(Rn(11));function E(){const O=C;O.next&&O.next(p())}return E(),{unsubscribe:N(E)}},[RT](){return this}}}return v({type:Am.INIT}),{dispatch:v,subscribe:g,getState:p,replaceReducer:y,[RT]:S}}function Lte(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Am.INIT})>"u")throw new Error(Rn(12));if(typeof n(void 0,{type:Am.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Rn(13))})}function zL(e){const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const l=t[s];typeof e[l]=="function"&&(n[l]=e[l])}const r=Object.keys(n);let i;try{Lte(n)}catch(s){i=s}return function(l={},c){if(i)throw i;let f=!1;const h={};for(let p=0;p<r.length;p++){const g=r[p],v=n[g],y=l[g],S=v(y,c);if(typeof S>"u")throw c&&c.type,new Error(Rn(14));h[g]=S,f=f||S!==y}return f=f||r.length!==Object.keys(l).length,f?h:l}}function Em(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function $te(...e){return t=>(n,r)=>{const i=t(n,r);let s=()=>{throw new Error(Rn(15))};const l={getState:i.getState,dispatch:(f,...h)=>s(f,...h)},c=e.map(f=>f(l));return s=Em(...c)(i.dispatch),{...i,dispatch:s}}}function ML(e){return ej(e)&&"type"in e&&typeof e.type=="string"}var RL=Symbol.for("immer-nothing"),DT=Symbol.for("immer-draftable"),ar=Symbol.for("immer-state");function Si(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Tr=Object,Lc=Tr.getPrototypeOf,Tm="constructor",iv="prototype",Xw="configurable",Pm="enumerable",Qp="writable",Zd="value",Ra=e=>!!e&&!!e[ar];function ki(e){return e?DL(e)||sv(e)||!!e[DT]||!!e[Tm]?.[DT]||ov(e)||lv(e):!1}var Ute=Tr[iv][Tm].toString(),IT=new WeakMap;function DL(e){if(!e||!tj(e))return!1;const t=Lc(e);if(t===null||t===Tr[iv])return!0;const n=Tr.hasOwnProperty.call(t,Tm)&&t[Tm];if(n===Object)return!0;if(!gc(n))return!1;let r=IT.get(n);return r===void 0&&(r=Function.toString.call(n),IT.set(n,r)),r===Ute}function av(e,t,n=!0){yf(e)===0?(n?Reflect.ownKeys(e):Tr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function yf(e){const t=e[ar];return t?t.type_:sv(e)?1:ov(e)?2:lv(e)?3:0}var LT=(e,t,n=yf(e))=>n===2?e.has(t):Tr[iv].hasOwnProperty.call(e,t),Jw=(e,t,n=yf(e))=>n===2?e.get(t):e[t],zm=(e,t,n,r=yf(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Bte(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var sv=Array.isArray,ov=e=>e instanceof Map,lv=e=>e instanceof Set,tj=e=>typeof e=="object",gc=e=>typeof e=="function",_x=e=>typeof e=="boolean";function qte(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Oa=e=>e.copy_||e.base_,nj=e=>e.modified_?e.copy_:e.base_;function eS(e,t){if(ov(e))return new Map(e);if(lv(e))return new Set(e);if(sv(e))return Array[iv].slice.call(e);const n=DL(e);if(t===!0||t==="class_only"&&!n){const r=Tr.getOwnPropertyDescriptors(e);delete r[ar];let i=Reflect.ownKeys(r);for(let s=0;s<i.length;s++){const l=i[s],c=r[l];c[Qp]===!1&&(c[Qp]=!0,c[Xw]=!0),(c.get||c.set)&&(r[l]={[Xw]:!0,[Qp]:!0,[Pm]:c[Pm],[Zd]:e[l]})}return Tr.create(Lc(e),r)}else{const r=Lc(e);if(r!==null&&n)return{...e};const i=Tr.create(r);return Tr.assign(i,e)}}function rj(e,t=!1){return cv(e)||Ra(e)||!ki(e)||(yf(e)>1&&Tr.defineProperties(e,{set:Cp,add:Cp,clear:Cp,delete:Cp}),Tr.freeze(e),t&&av(e,(n,r)=>{rj(r,!0)},!1)),e}function Fte(){Si(2)}var Cp={[Zd]:Fte};function cv(e){return e===null||!tj(e)?!0:Tr.isFrozen(e)}var Mm="MapSet",tS="Patches",$T="ArrayMethods",IL={};function nl(e){const t=IL[e];return t||Si(0,e),t}var UT=e=>!!IL[e],Yd,LL=()=>Yd,Kte=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:UT(Mm)?nl(Mm):void 0,arrayMethodsPlugin_:UT($T)?nl($T):void 0});function BT(e,t){t&&(e.patchPlugin_=nl(tS),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function nS(e){rS(e),e.drafts_.forEach(Hte),e.drafts_=null}function rS(e){e===Yd&&(Yd=e.parent_)}var qT=e=>Yd=Kte(Yd,e);function Hte(e){const t=e[ar];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function FT(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[ar].modified_&&(nS(t),Si(4)),ki(e)&&(e=KT(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[ar].base_,e,t)}else e=KT(t,n);return Gte(t,e,!0),nS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==RL?e:void 0}function KT(e,t){if(cv(t))return t;const n=t[ar];if(!n)return Rm(t,e.handledSet_,e);if(!uv(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);BL(n,e)}return n.copy_}function Gte(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&rj(t,n)}function $L(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var uv=(e,t)=>e.scope_===t,Vte=[];function UL(e,t,n,r){const i=Oa(e),s=e.type_;if(r!==void 0&&Jw(i,r,s)===t){zm(i,r,n,s);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;av(i,(f,h)=>{if(Ra(h)){const p=c.get(h)||[];p.push(f),c.set(h,p)}})}const l=e.draftLocations_.get(t)??Vte;for(const c of l)zm(i,c,n,s)}function Zte(e,t,n){e.callbacks_.push(function(i){const s=t;if(!s||!uv(s,i))return;i.mapSetPlugin_?.fixSetContents(s);const l=nj(s);UL(e,s.draft_??s,l,n),BL(s,i)})}function BL(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)}$L(e)}}function Yte(e,t,n){const{scope_:r}=e;if(Ra(n)){const i=n[ar];uv(i,r)&&i.callbacks_.push(function(){Xp(e);const l=nj(i);UL(e,n,l,t)})}else ki(n)&&e.callbacks_.push(function(){const s=Oa(e);e.type_===3?s.has(n)&&Rm(n,r.handledSet_,r):Jw(s,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Rm(Jw(e.copy_,t,e.type_),r.handledSet_,r)})}function Rm(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Ra(e)||t.has(e)||!ki(e)||cv(e)||(t.add(e),av(e,(r,i)=>{if(Ra(i)){const s=i[ar];if(uv(s,n)){const l=nj(s);zm(e,r,l,e.type_),$L(s)}}else ki(i)&&Rm(i,t,n)})),e}function Wte(e,t){const n=sv(e),r={type_:n?1:0,scope_:t?t.scope_:LL(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,s=Dm;n&&(i=[r],s=Wd);const{revoke:l,proxy:c}=Proxy.revocable(i,s);return r.draft_=c,r.revoke_=l,[c,r]}var Dm={get(e,t){if(t===ar)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=Oa(e);if(!LT(i,t,e.type_))return Qte(e,i,t);const s=i[t];if(e.finalized_||!ki(s)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&qte(t))return s;if(s===kx(e.base_,t)){Xp(e);const l=e.type_===1?+t:t,c=aS(e.scope_,s,e,l);return e.copy_[l]=c}return s},has(e,t){return t in Oa(e)},ownKeys(e){return Reflect.ownKeys(Oa(e))},set(e,t,n){const r=qL(Oa(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=kx(Oa(e),t),s=i?.[ar];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Bte(n,i)&&(n!==void 0||LT(e.base_,t,e.type_)))return!0;Xp(e),iS(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),Yte(e,t,n)),!0},deleteProperty(e,t){return Xp(e),kx(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),iS(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Oa(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Qp]:!0,[Xw]:e.type_!==1||t!=="length",[Pm]:r[Pm],[Zd]:n[t]}},defineProperty(){Si(11)},getPrototypeOf(e){return Lc(e.base_)},setPrototypeOf(){Si(12)}},Wd={};for(let e in Dm){let t=Dm[e];Wd[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Wd.deleteProperty=function(e,t){return Wd.set.call(this,e,t,void 0)};Wd.set=function(e,t,n){return Dm.set.call(this,e[0],t,n,e[0])};function kx(e,t){const n=e[ar];return(n?Oa(n):e)[t]}function Qte(e,t,n){const r=qL(t,n);return r?Zd in r?r[Zd]:r.get?.call(e.draft_):void 0}function qL(e,t){if(!(t in e))return;let n=Lc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Lc(n)}}function iS(e){e.modified_||(e.modified_=!0,e.parent_&&iS(e.parent_))}function Xp(e){e.copy_||(e.assigned_=new Map,e.copy_=eS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Xte=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(gc(n)&&!gc(r)){const l=r;r=n;const c=this;return function(h=l,...p){return c.produce(h,g=>r.call(this,g,...p))}}gc(r)||Si(6),i!==void 0&&!gc(i)&&Si(7);let s;if(ki(n)){const l=qT(this),c=aS(l,n,void 0);let f=!0;try{s=r(c),f=!1}finally{f?nS(l):rS(l)}return BT(l,i),FT(s,l)}else if(!n||!tj(n)){if(s=r(n),s===void 0&&(s=n),s===RL&&(s=void 0),this.autoFreeze_&&rj(s,!0),i){const l=[],c=[];nl(tS).generateReplacementPatches_(n,s,{patches_:l,inversePatches_:c}),i(l,c)}return s}else Si(1,n)},this.produceWithPatches=(n,r)=>{if(gc(n))return(c,...f)=>this.produceWithPatches(c,h=>n(h,...f));let i,s;return[this.produce(n,r,(c,f)=>{i=c,s=f}),i,s]},_x(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),_x(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),_x(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){ki(t)||Si(8),Ra(t)&&(t=ri(t));const n=qT(this),r=aS(n,t,void 0);return r[ar].isManual_=!0,rS(n),r}finishDraft(t,n){const r=t&&t[ar];(!r||!r.isManual_)&&Si(9);const{scope_:i}=r;return BT(i,n),FT(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const s=n[r];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}r>-1&&(n=n.slice(r+1));const i=nl(tS).applyPatches_;return Ra(t)?i(t,n):this.produce(t,s=>i(s,n))}};function aS(e,t,n,r){const[i,s]=ov(t)?nl(Mm).proxyMap_(t,n):lv(t)?nl(Mm).proxySet_(t,n):Wte(t,n);return(n?.scope_??LL()).drafts_.push(i),s.callbacks_=n?.callbacks_??[],s.key_=r,n&&r!==void 0?Zte(n,s,r):s.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(s);const{patchPlugin_:h}=f;s.modified_&&h&&h.generatePatches_(s,[],f)}),i}function ri(e){return Ra(e)||Si(10,e),FL(e)}function FL(e){if(!ki(e)||cv(e))return e;const t=e[ar];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=eS(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=eS(e,!0);return av(n,(i,s)=>{zm(n,i,FL(s))},r),t&&(t.finalized_=!1),n}var Jte=new Xte,KL=Jte.produce;function HL(e){return({dispatch:n,getState:r})=>i=>s=>typeof s=="function"?s(n,r,e):i(s)}var ene=HL(),tne=HL,nne=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Em:Em.apply(null,arguments)};function zr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Pr(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=>ML(r)&&r.type===e,n}var GL=class Nd extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Nd.prototype)}static get[Symbol.species](){return Nd}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Nd(...t[0].concat(this)):new Nd(...t.concat(this))}};function HT(e){return ki(e)?KL(e,()=>{}):e}function Op(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function rne(e){return typeof e=="boolean"}var ine=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:s=!0}=t??{};let l=new GL;return n&&(rne(n)?l.push(ene):l.push(tne(n.extraArgument))),l},VL="RTK_autoBatch",zt=()=>e=>({payload:e,meta:{[VL]:!0}}),GT=e=>t=>{setTimeout(t,e)},ZL=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,s=!1,l=!1;const c=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:GT(10):e.type==="callback"?e.queueNotification:GT(e.timeout),h=()=>{l=!1,s&&(s=!1,c.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const g=()=>i&&p(),v=r.subscribe(g);return c.add(p),()=>{v(),c.delete(p)}},dispatch(p){try{return i=!p?.meta?.[VL],s=!i,s&&(l||(l=!0,f(h))),r.dispatch(p)}finally{i=!0}}})},ane=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new GL(e);return r&&i.push(ZL(typeof r=="object"?r:void 0)),i};function sne(e){const t=ine(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:s=void 0,enhancers:l=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(ej(n))c=zL(n);else throw new Error(Pr(1));let f;typeof r=="function"?f=r(t):f=t();let h=Em;i&&(h=nne({trace:!1,...typeof i=="object"&&i}));const p=$te(...f),g=ane(p);let v=typeof l=="function"?l(g):g();const y=h(...v);return PL(c,s,y)}function YL(e){const t={},n=[];let r;const i={addCase(s,l){const c=typeof s=="string"?s:s.type;if(!c)throw new Error(Pr(28));if(c in t)throw new Error(Pr(29));return t[c]=l,i},addAsyncThunk(s,l){return l.pending&&(t[s.pending.type]=l.pending),l.rejected&&(t[s.rejected.type]=l.rejected),l.fulfilled&&(t[s.fulfilled.type]=l.fulfilled),l.settled&&n.push({matcher:s.settled,reducer:l.settled}),i},addMatcher(s,l){return n.push({matcher:s,reducer:l}),i},addDefaultCase(s){return r=s,i}};return e(i),[t,n,r]}function one(e){return typeof e=="function"}function lne(e,t){let[n,r,i]=YL(t),s;if(one(e))s=()=>HT(e());else{const c=HT(e);s=()=>c}function l(c=s(),f){let h=[n[f.type],...r.filter(({matcher:p})=>p(f)).map(({reducer:p})=>p)];return h.filter(p=>!!p).length===0&&(h=[i]),h.reduce((p,g)=>{if(g)if(Ra(p)){const y=g(p,f);return y===void 0?p:y}else{if(ki(p))return KL(p,v=>g(v,f));{const v=g(p,f);if(v===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return p},c)}return l.getInitialState=s,l}var cne="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",une=(e=21)=>{let t="",n=e;for(;n--;)t+=cne[Math.random()*64|0];return t},dne=Symbol.for("rtk-slice-createasyncthunk");function fne(e,t){return`${e}/${t}`}function hne({creators:e}={}){const t=e?.asyncThunk?.[dne];return function(r){const{name:i,reducerPath:s=i}=r;if(!i)throw new Error(Pr(11));const l=(typeof r.reducers=="function"?r.reducers(mne()):r.reducers)||{},c=Object.keys(l),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(A,O){const P=typeof A=="string"?A:A.type;if(!P)throw new Error(Pr(12));if(P in f.sliceCaseReducersByType)throw new Error(Pr(13));return f.sliceCaseReducersByType[P]=O,h},addMatcher(A,O){return f.sliceMatchers.push({matcher:A,reducer:O}),h},exposeAction(A,O){return f.actionCreators[A]=O,h},exposeCaseReducer(A,O){return f.sliceCaseReducersByName[A]=O,h}};c.forEach(A=>{const O=l[A],P={reducerName:A,type:fne(i,A),createNotation:typeof r.reducers=="function"};vne(O)?bne(P,O,h,t):gne(P,O,h)});function p(){const[A={},O=[],P=void 0]=typeof r.extraReducers=="function"?YL(r.extraReducers):[r.extraReducers],z={...A,...f.sliceCaseReducersByType};return lne(r.initialState,_=>{for(let T in z)_.addCase(T,z[T]);for(let T of f.sliceMatchers)_.addMatcher(T.matcher,T.reducer);for(let T of O)_.addMatcher(T.matcher,T.reducer);P&&_.addDefaultCase(P)})}const g=A=>A,v=new Map,y=new WeakMap;let S;function w(A,O){return S||(S=p()),S(A,O)}function N(){return S||(S=p()),S.getInitialState()}function C(A,O=!1){function P(_){let T=_[A];return typeof T>"u"&&O&&(T=Op(y,P,N)),T}function z(_=g){const T=Op(v,O,()=>new WeakMap);return Op(T,_,()=>{const R={};for(const[B,$]of Object.entries(r.selectors??{}))R[B]=pne($,_,()=>Op(y,_,N),O);return R})}return{reducerPath:A,getSelectors:z,get selectors(){return z(P)},selectSlice:P}}const E={name:i,reducer:w,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:N,...C(s),injectInto(A,{reducerPath:O,...P}={}){const z=O??s;return A.inject({reducerPath:z,reducer:w},P),{...E,...C(z,!0)}}};return E}}function pne(e,t,n,r){function i(s,...l){let c=t(s);return typeof c>"u"&&r&&(c=n()),e(c,...l)}return i.unwrapped=e,i}var Wn=hne();function mne(){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 gne({type:e,reducerName:t,createNotation:n},r,i){let s,l;if("reducer"in r){if(n&&!yne(r))throw new Error(Pr(17));s=r.reducer,l=r.prepare}else s=r;i.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,l?zr(e,l):zr(e))}function vne(e){return e._reducerDefinitionType==="asyncThunk"}function yne(e){return e._reducerDefinitionType==="reducerWithPrepare"}function bne({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Pr(18));const{payloadCreator:s,fulfilled:l,pending:c,rejected:f,settled:h,options:p}=n,g=i(e,s,p);r.exposeAction(t,g),l&&r.addCase(g.fulfilled,l),c&&r.addCase(g.pending,c),f&&r.addCase(g.rejected,f),h&&r.addMatcher(g.settled,h),r.exposeCaseReducer(t,{fulfilled:l||_p,pending:c||_p,rejected:f||_p,settled:h||_p})}function _p(){}var xne="task",WL="listener",QL="completed",ij="cancelled",wne=`task-${ij}`,Sne=`task-${QL}`,sS=`${WL}-${ij}`,jne=`${WL}-${QL}`,dv=class{constructor(e){this.code=e,this.message=`${xne} ${ij} (reason: ${e})`}name="TaskAbortError";message},aj=(e,t)=>{if(typeof e!="function")throw new TypeError(Pr(32))},Im=()=>{},XL=(e,t=Im)=>(e.catch(t),e),JL=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Ho=e=>{if(e.aborted)throw new dv(e.reason)};function e$(e,t){let n=Im;return new Promise((r,i)=>{const s=()=>i(new dv(e.reason));if(e.aborted){s();return}n=JL(e,s),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Im})}var Nne=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof dv?"cancelled":"rejected",error:n}}finally{t?.()}},Lm=e=>t=>XL(e$(e,t).then(n=>(Ho(e),n))),t$=e=>{const t=Lm(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Ac}=Object,VT={},fv="listenerMiddleware",Cne=(e,t)=>{const n=r=>JL(e,()=>r.abort(e.reason));return(r,i)=>{aj(r);const s=new AbortController;n(s);const l=Nne(async()=>{Ho(e),Ho(s.signal);const c=await r({pause:Lm(s.signal),delay:t$(s.signal),signal:s.signal});return Ho(s.signal),c},()=>s.abort(Sne));return i?.autoJoin&&t.push(l.catch(Im)),{result:Lm(e)(l),cancel(){s.abort(wne)}}}},One=(e,t)=>{const n=async(r,i)=>{Ho(t);let s=()=>{};const c=[new Promise((f,h)=>{let p=e({predicate:r,effect:(g,v)=>{v.unsubscribe(),f([g,v.getState(),v.getOriginalState()])}});s=()=>{p(),h()}})];i!=null&&c.push(new Promise(f=>setTimeout(f,i,null)));try{const f=await e$(t,Promise.race(c));return Ho(t),f}finally{s()}};return(r,i)=>XL(n(r,i))},n$=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:s}=e;if(t)i=zr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Pr(21));return aj(s),{predicate:i,type:t,effect:s}},r$=Ac(e=>{const{type:t,predicate:n,effect:r}=n$(e);return{id:une(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Pr(22))}}},{withTypes:()=>r$}),ZT=(e,t)=>{const{type:n,effect:r,predicate:i}=n$(t);return Array.from(e.values()).find(s=>(typeof n=="string"?s.type===n:s.predicate===i)&&s.effect===r)},oS=e=>{e.pending.forEach(t=>{t.abort(sS)})},_ne=(e,t)=>()=>{for(const n of t.keys())oS(n);e.clear()},YT=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},i$=Ac(zr(`${fv}/add`),{withTypes:()=>i$}),kne=zr(`${fv}/removeAll`),a$=Ac(zr(`${fv}/remove`),{withTypes:()=>a$}),Ane=(...e)=>{console.error(`${fv}/error`,...e)},bf=(e={})=>{const t=new Map,n=new Map,r=y=>{const S=n.get(y)??0;n.set(y,S+1)},i=y=>{const S=n.get(y)??1;S===1?n.delete(y):n.set(y,S-1)},{extra:s,onError:l=Ane}=e;aj(l);const c=y=>(y.unsubscribe=()=>t.delete(y.id),t.set(y.id,y),S=>{y.unsubscribe(),S?.cancelActive&&oS(y)}),f=y=>{const S=ZT(t,y)??r$(y);return c(S)};Ac(f,{withTypes:()=>f});const h=y=>{const S=ZT(t,y);return S&&(S.unsubscribe(),y.cancelActive&&oS(S)),!!S};Ac(h,{withTypes:()=>h});const p=async(y,S,w,N)=>{const C=new AbortController,E=One(f,C.signal),A=[];try{y.pending.add(C),r(y),await Promise.resolve(y.effect(S,Ac({},w,{getOriginalState:N,condition:(O,P)=>E(O,P).then(Boolean),take:E,delay:t$(C.signal),pause:Lm(C.signal),extra:s,signal:C.signal,fork:Cne(C.signal,A),unsubscribe:y.unsubscribe,subscribe:()=>{t.set(y.id,y)},cancelActiveListeners:()=>{y.pending.forEach((O,P,z)=>{O!==C&&(O.abort(sS),z.delete(O))})},cancel:()=>{C.abort(sS),y.pending.delete(C)},throwIfCancelled:()=>{Ho(C.signal)}})))}catch(O){O instanceof dv||YT(l,O,{raisedBy:"effect"})}finally{await Promise.all(A),C.abort(jne),i(y),y.pending.delete(C)}},g=_ne(t,n);return{middleware:y=>S=>w=>{if(!ML(w))return S(w);if(i$.match(w))return f(w.payload);if(kne.match(w)){g();return}if(a$.match(w))return h(w.payload);let N=y.getState();const C=()=>{if(N===VT)throw new Error(Pr(23));return N};let E;try{if(E=S(w),t.size>0){const A=y.getState(),O=Array.from(t.values());for(const P of O){let z=!1;try{z=P.predicate(w,A,N)}catch(_){z=!1,YT(l,_,{raisedBy:"predicate"})}z&&p(P,w,y,C)}}}finally{N=VT}return E},startListening:f,stopListening:h,clearListeners:g}};function Pr(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 Ene={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},s$=Wn({name:"chartLayout",initialState:Ene,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,s;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(s=t.payload.left)!==null&&s!==void 0?s:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:Tne,setLayout:Pne,setChartSize:zne,setScale:Mne}=s$.actions,Rne=s$.reducer;function o$(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function We(e){return Number.isFinite(e)}function Ji(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function WT(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 Sc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WT(Object(n),!0).forEach(function(r){Dne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dne(e,t,n){return(t=Ine(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ine(e){var t=Lne(e,"string");return typeof t=="symbol"?t:t+""}function Lne(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 On(e,t,n){return Un(e)||Un(t)?n:oi(t)?nv(e,t,n):typeof t=="function"?t(e):n}var $ne=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:s,verticalAlign:l,layout:c}=t;if((c==="vertical"||c==="horizontal"&&l==="middle")&&s!=="center"&&ze(e[s]))return Sc(Sc({},e),{},{[s]:e[s]+(r||0)});if((c==="horizontal"||c==="vertical"&&s==="center")&&l!=="middle"&&ze(e[l]))return Sc(Sc({},e),{},{[l]:e[l]+(i||0)})}return e},na=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",l$=(e,t,n,r)=>{if(r)return e.map(c=>c.coordinate);var i,s,l=e.map(c=>(c.coordinate===t&&(i=!0),c.coordinate===n&&(s=!0),c.coordinate));return i||l.push(t),s||l.push(n),l},c$=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:s,scale:l,realScaleType:c,isCategorical:f,categoricalDomain:h,tickCount:p,ticks:g,niceTicks:v,axisType:y}=e;if(!l)return null;var S=c==="scaleBand"&&l.bandwidth?l.bandwidth()/2:2,w=i==="category"&&l.bandwidth?l.bandwidth()/S:0;if(w=y==="angleAxis"&&s&&s.length>=2?ni(s[0]-s[1])*2*w:w,g||v){var N=(g||v||[]).map((C,E)=>{var A=r?r.indexOf(C):C,O=l.map(A);return We(O)?{coordinate:O+w,value:C,offset:w,index:E}:null}).filter(vr);return N}return f&&h?h.map((C,E)=>{var A=l.map(C);return We(A)?{coordinate:A+w,value:C,index:E,offset:w}:null}).filter(vr):l.ticks&&p!=null?l.ticks(p).map((C,E)=>{var A=l.map(C);return We(A)?{coordinate:A+w,value:C,index:E,offset:w}:null}).filter(vr):l.domain().map((C,E)=>{var A=l.map(C);return We(A)?{coordinate:A+w,value:r?r[C]:C,index:E,offset:w}:null}).filter(vr)},Une=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var s=0,l=0,c=0;c<n;++c){var f=e[c],h=f?.[i];if(h!=null){var p=h[1],g=h[0],v=Xi(p)?g:p;v>=0?(h[0]=s,s+=v,h[1]=s):(h[0]=l,l+=v,h[1]=l)}}}},Bne=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var s=0,l=0;l<n;++l){var c=e[l],f=c?.[i];if(f!=null){var h=Xi(f[1])?f[0]:f[1];h>=0?(f[0]=s,s+=h,f[1]=s):(f[0]=0,f[1]=0)}}}},qne={sign:Une,expand:pee,none:el,silhouette:mee,wiggle:gee,positive:Bne},Fne=(e,t,n)=>{var r,i=(r=qne[n])!==null&&r!==void 0?r:el,s=hee().keys(t).value((c,f)=>Number(On(c,f,0))).order(Ww).offset(i),l=s(e);return l.forEach((c,f)=>{c.forEach((h,p)=>{var g=On(e[p],t[f],0);Array.isArray(g)&&g.length===2&&ze(g[0])&&ze(g[1])&&(h[0]=g[0],h[1]=g[1])})}),l};function Kne(e){return e==null?void 0:String(e)}function QT(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:s,dataKey:l}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Un(i[t.dataKey])){var c=dL(n,"value",i[t.dataKey]);if(c)return c.coordinate+r/2}return n!=null&&n[s]?n[s].coordinate+r/2:null}var f=On(i,Un(l)?t.dataKey:l),h=t.scale.map(f);return ze(h)?h:null}var Hne=e=>{var t=e.flat(2).filter(ze);return[Math.min(...t),Math.max(...t)]},Gne=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Vne=(e,t,n)=>{if(e!=null)return Gne(Object.keys(e).reduce((r,i)=>{var s=e[i];if(!s)return r;var{stackedData:l}=s,c=l.reduce((f,h)=>{var p=o$(h,t,n),g=Hne(p);return!We(g[0])||!We(g[1])?f:[Math.min(f[0],g[0]),Math.max(f[1],g[1])]},[1/0,-1/0]);return[Math.min(c[0],r[0]),Math.max(c[1],r[1])]},[1/0,-1/0]))},XT=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,JT=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,$m=(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=rv(t,p=>p.coordinate),s=1/0,l=1,c=i.length;l<c;l++){var f=i[l],h=i[l-1];s=Math.min((f?.coordinate||0)-(h?.coordinate||0),s)}return s===1/0?0:s}return n?void 0:0};function e2(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:s}=e;return Sc(Sc({},t),{},{dataKey:n,payload:r,value:i,name:s})}function u$(e,t){if(e)return String(e);if(typeof t=="string")return t}var Zne=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Yne=(e,t)=>t==="centric"?e.angle:e.radius,Ua=e=>e.layout.width,Ba=e=>e.layout.height,Wne=e=>e.layout.scale,d$=e=>e.layout.margin,hv=te(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),pv=te(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Qne="data-recharts-item-index",Xne="data-recharts-item-id",xf=60;function t2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?t2(Object(n),!0).forEach(function(r){Jne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jne(e,t,n){return(t=ere(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ere(e){var t=tre(e,"string");return typeof t=="symbol"?t:t+""}function tre(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 nre=e=>e.brush.height;function rre(e){var t=pv(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:xf;return n+i}return n},0)}function ire(e){var t=pv(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:xf;return n+i}return n},0)}function are(e){var t=hv(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function sre(e){var t=hv(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var qn=te([Ua,Ba,d$,nre,rre,ire,are,sre,EL,Pte],(e,t,n,r,i,s,l,c,f,h)=>{var p={left:(n.left||0)+i,right:(n.right||0)+s},g={top:(n.top||0)+l,bottom:(n.bottom||0)+c},v=kp(kp({},g),p),y=v.bottom;v.bottom+=r,v=$ne(v,f,h);var S=e-v.left-v.right,w=t-v.top-v.bottom;return kp(kp({brushBottom:y},v),{},{width:Math.max(S,0),height:Math.max(w,0)})}),ore=te(qn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),f$=te(Ua,Ba,(e,t)=>({x:0,y:0,width:e,height:t})),lre=x.createContext(null),or=()=>x.useContext(lre)!=null,mv=e=>e.brush,gv=te([mv,qn,d$],(e,t,n)=>({height:e.height,x:ze(e.x)?e.x:t.left,y:ze(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:ze(e.width)?e.width:t.width})),Ax={},Ex={},Tx={},n2;function cre(){return n2||(n2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:s}={}){let l,c=null;const f=s!=null&&s.includes("leading"),h=s==null||s.includes("trailing"),p=()=>{c!==null&&(n.apply(l,c),l=void 0,c=null)},g=()=>{h&&p(),w()};let v=null;const y=()=>{v!=null&&clearTimeout(v),v=setTimeout(()=>{v=null,g()},r)},S=()=>{v!==null&&(clearTimeout(v),v=null)},w=()=>{S(),l=void 0,c=null},N=()=>{p()},C=function(...E){if(i?.aborted)return;l=this,c=E;const A=v==null;y(),f&&A&&p()};return C.schedule=y,C.cancel=w,C.flush=N,i?.addEventListener("abort",w,{once:!0}),C}e.debounce=t})(Tx)),Tx}var r2;function ure(){return r2||(r2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cre();function n(r,i=0,s={}){typeof s!="object"&&(s={});const{leading:l=!1,trailing:c=!0,maxWait:f}=s,h=Array(2);l&&(h[0]="leading"),c&&(h[1]="trailing");let p,g=null;const v=t.debounce(function(...w){p=r.apply(this,w),g=null},i,{edges:h}),y=function(...w){return f!=null&&(g===null&&(g=Date.now()),Date.now()-g>=f)?(p=r.apply(this,w),g=Date.now(),v.cancel(),v.schedule(),p):(v.apply(this,w),p)},S=()=>(v.flush(),p);return y.cancel=v.cancel,y.flush=S,y}e.debounce=n})(Ex)),Ex}var i2;function dre(){return i2||(i2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ure();function n(r,i=0,s={}){const{leading:l=!0,trailing:c=!0}=s;return t.debounce(r,i,{leading:l,maxWait:i,trailing:c})}e.throttle=n})(Ax)),Ax}var Px,a2;function fre(){return a2||(a2=1,Px=dre().throttle),Px}var hre=fre();const pre=Ks(hre);var Um=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},Vi={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},h$=(e,t,n)=>{var{width:r=Vi.width,height:i=Vi.height,aspect:s,maxHeight:l}=n,c=tl(r)?e:Number(r),f=tl(i)?t:Number(i);return s&&s>0&&(c?f=c/s:f&&(c=f*s),l&&f!=null&&f>l&&(f=l)),{calculatedWidth:c,calculatedHeight:f}},mre={width:0,height:0,overflow:"visible"},gre={width:0,overflowX:"visible"},vre={height:0,overflowY:"visible"},yre={},bre=e=>{var{width:t,height:n}=e,r=tl(t),i=tl(n);return r&&i?mre:r?gre:i?vre:yre};function xre(e){var{width:t,height:n,aspect:r}=e,i=t,s=n;return i===void 0&&s===void 0?(i=Vi.width,s=Vi.height):i===void 0?i=r&&r>0?void 0:Vi.width:s===void 0&&(s=r&&r>0?void 0:Vi.height),{width:i,height:s}}function lS(){return lS=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},lS.apply(null,arguments)}function s2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function o2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s2(Object(n),!0).forEach(function(r){wre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wre(e,t,n){return(t=Sre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sre(e){var t=jre(e,"string");return typeof t=="symbol"?t:t+""}function jre(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 p$=x.createContext(Vi.initialDimension);function Nre(e){return Ji(e.width)&&Ji(e.height)}function m$(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return Nre(i)?x.createElement(p$.Provider,{value:i},t):null}var sj=()=>x.useContext(p$),Cre=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Vi.initialDimension,width:i,height:s,minWidth:l=Vi.minWidth,minHeight:c,maxHeight:f,children:h,debounce:p=Vi.debounce,id:g,className:v,onResize:y,style:S={}}=e,w=x.useRef(null),N=x.useRef();N.current=y,x.useImperativeHandle(t,()=>w.current);var[C,E]=x.useState({containerWidth:r.width,containerHeight:r.height}),A=x.useCallback((T,R)=>{E(B=>{var $=Math.round(T),L=Math.round(R);return B.containerWidth===$&&B.containerHeight===L?B:{containerWidth:$,containerHeight:L}})},[]);x.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return nu;var T=L=>{var ne,he=L[0];if(he!=null){var{width:ge,height:H}=he.contentRect;A(ge,H),(ne=N.current)===null||ne===void 0||ne.call(N,ge,H)}};p>0&&(T=pre(T,p,{trailing:!0,leading:!1}));var R=new ResizeObserver(T),{width:B,height:$}=w.current.getBoundingClientRect();return A(B,$),R.observe(w.current),()=>{R.disconnect()}},[A,p]);var{containerWidth:O,containerHeight:P}=C;Um(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:z,calculatedHeight:_}=h$(O,P,{width:i,height:s,aspect:n,maxHeight:f});return Um(z!=null&&z>0||_!=null&&_>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
237
|
+
please check the style of container, or the props width(%s) and height(%s),
|
|
238
|
+
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
239
|
+
height and width.`,z,_,i,s,l,c,n),x.createElement("div",{id:g?"".concat(g):void 0,className:gt("recharts-responsive-container",v),style:o2(o2({},S),{},{width:i,height:s,minWidth:l,minHeight:c,maxHeight:f}),ref:w},x.createElement("div",{style:bre({width:i,height:s})},x.createElement(m$,{width:z,height:_},h)))}),g$=x.forwardRef((e,t)=>{var n=sj();if(Ji(n.width)&&Ji(n.height))return e.children;var{width:r,height:i}=xre({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:s,calculatedHeight:l}=h$(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return ze(s)&&ze(l)?x.createElement(m$,{width:s,height:l},e.children):x.createElement(Cre,lS({},e,{width:r,height:i,ref:t}))});function oj(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 wf=()=>{var e,t=or(),n=Re(ore),r=Re(gv),i=(e=Re(mv))===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}},Ore={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},v$=()=>{var e;return(e=Re(qn))!==null&&e!==void 0?e:Ore},lj=()=>Re(Ua),cj=()=>Re(Ba),_re=()=>Re(e=>e.layout.margin),qt=e=>e.layout.layoutType,ru=()=>Re(qt),uj=()=>{var e=ru();if(e==="horizontal"||e==="vertical")return e},y$=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},kre=()=>{var e=ru();return e!==void 0},Sf=e=>{var t=Yt(),n=or(),{width:r,height:i}=e,s=sj(),l=r,c=i;return s&&(l=s.width>0?s.width:r,c=s.height>0?s.height:i),x.useEffect(()=>{!n&&Ji(l)&&Ji(c)&&t(zne({width:l,height:c}))},[t,n,l,c]),null},b$=Symbol.for("immer-nothing"),l2=Symbol.for("immer-draftable"),Mr=Symbol.for("immer-state");function ji(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Qd=Object.getPrototypeOf;function $c(e){return!!e&&!!e[Mr]}function rl(e){return e?x$(e)||Array.isArray(e)||!!e[l2]||!!e.constructor?.[l2]||jf(e)||yv(e):!1}var Are=Object.prototype.constructor.toString(),c2=new WeakMap;function x$(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=c2.get(n);return r===void 0&&(r=Function.toString.call(n),c2.set(n,r)),r===Are}function Bm(e,t,n=!0){vv(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 vv(e){const t=e[Mr];return t?t.type_:Array.isArray(e)?1:jf(e)?2:yv(e)?3:0}function cS(e,t){return vv(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function w$(e,t,n){const r=vv(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Ere(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function jf(e){return e instanceof Map}function yv(e){return e instanceof Set}function ko(e){return e.copy_||e.base_}function uS(e,t){if(jf(e))return new Map(e);if(yv(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=x$(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Mr];let i=Reflect.ownKeys(r);for(let s=0;s<i.length;s++){const l=i[s],c=r[l];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(r[l]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[l]})}return Object.create(Qd(e),r)}else{const r=Qd(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function dj(e,t=!1){return bv(e)||$c(e)||!rl(e)||(vv(e)>1&&Object.defineProperties(e,{set:Ap,add:Ap,clear:Ap,delete:Ap}),Object.freeze(e),t&&Object.values(e).forEach(n=>dj(n,!0))),e}function Tre(){ji(2)}var Ap={value:Tre};function bv(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Pre={};function il(e){const t=Pre[e];return t||ji(0,e),t}var Xd;function S$(){return Xd}function zre(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function u2(e,t){t&&(il("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function dS(e){fS(e),e.drafts_.forEach(Mre),e.drafts_=null}function fS(e){e===Xd&&(Xd=e.parent_)}function d2(e){return Xd=zre(Xd,e)}function Mre(e){const t=e[Mr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function f2(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Mr].modified_&&(dS(t),ji(4)),rl(e)&&(e=qm(t,e),t.parent_||Fm(t,e)),t.patches_&&il("Patches").generateReplacementPatches_(n[Mr].base_,e,t.patches_,t.inversePatches_)):e=qm(t,n,[]),dS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==b$?e:void 0}function qm(e,t,n){if(bv(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Mr];if(!i)return Bm(t,(s,l)=>h2(e,i,t,s,l,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Fm(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const s=i.copy_;let l=s,c=!1;i.type_===3&&(l=new Set(s),s.clear(),c=!0),Bm(l,(f,h)=>h2(e,i,s,f,h,n,c),r),Fm(e,s,!1),n&&e.patches_&&il("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function h2(e,t,n,r,i,s,l){if(i==null||typeof i!="object"&&!l)return;const c=bv(i);if(!(c&&!l)){if($c(i)){const f=s&&t&&t.type_!==3&&!cS(t.assigned_,r)?s.concat(r):void 0,h=qm(e,i,f);if(w$(n,r,h),$c(h))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(rl(i)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&c)return;qm(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(jf(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Fm(e,i)}}}function Fm(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&dj(t,n)}function Rre(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:S$(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,s=fj;n&&(i=[r],s=Jd);const{revoke:l,proxy:c}=Proxy.revocable(i,s);return r.draft_=c,r.revoke_=l,c}var fj={get(e,t){if(t===Mr)return e;const n=ko(e);if(!cS(n,t))return Dre(e,n,t);const r=n[t];return e.finalized_||!rl(r)?r:r===zx(e.base_,t)?(Mx(e),e.copy_[t]=pS(r,e)):r},has(e,t){return t in ko(e)},ownKeys(e){return Reflect.ownKeys(ko(e))},set(e,t,n){const r=j$(ko(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=zx(ko(e),t),s=i?.[Mr];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Ere(n,i)&&(n!==void 0||cS(e.base_,t)))return!0;Mx(e),hS(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 zx(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Mx(e),hS(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ko(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ji(11)},getPrototypeOf(e){return Qd(e.base_)},setPrototypeOf(){ji(12)}},Jd={};Bm(fj,(e,t)=>{Jd[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Jd.deleteProperty=function(e,t){return Jd.set.call(this,e,t,void 0)};Jd.set=function(e,t,n){return fj.set.call(this,e[0],t,n,e[0])};function zx(e,t){const n=e[Mr];return(n?ko(n):e)[t]}function Dre(e,t,n){const r=j$(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function j$(e,t){if(!(t in e))return;let n=Qd(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Qd(n)}}function hS(e){e.modified_||(e.modified_=!0,e.parent_&&hS(e.parent_))}function Mx(e){e.copy_||(e.copy_=uS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ire=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const s=n;n=t;const l=this;return function(f=s,...h){return l.produce(f,p=>n.call(this,p,...h))}}typeof n!="function"&&ji(6),r!==void 0&&typeof r!="function"&&ji(7);let i;if(rl(t)){const s=d2(this),l=pS(t,void 0);let c=!0;try{i=n(l),c=!1}finally{c?dS(s):fS(s)}return u2(s,r),f2(i,s)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===b$&&(i=void 0),this.autoFreeze_&&dj(i,!0),r){const s=[],l=[];il("Patches").generateReplacementPatches_(t,i,s,l),r(s,l)}return i}else ji(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...c)=>this.produceWithPatches(l,f=>t(f,...c));let r,i;return[this.produce(t,n,(l,c)=>{r=l,i=c}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){rl(e)||ji(8),$c(e)&&(e=Lre(e));const t=d2(this),n=pS(e,void 0);return n[Mr].isManual_=!0,fS(t),n}finishDraft(e,t){const n=e&&e[Mr];(!n||!n.isManual_)&&ji(9);const{scope_:r}=n;return u2(r,t),f2(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=il("Patches").applyPatches_;return $c(e)?r(e,t):this.produce(e,i=>r(i,t))}};function pS(e,t){const n=jf(e)?il("MapSet").proxyMap_(e,t):yv(e)?il("MapSet").proxySet_(e,t):Rre(e,t);return(t?t.scope_:S$()).drafts_.push(n),n}function Lre(e){return $c(e)||ji(10,e),N$(e)}function N$(e){if(!rl(e)||bv(e))return e;const t=e[Mr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=uS(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=uS(e,!0);return Bm(n,(i,s)=>{w$(n,i,N$(s))},r),t&&(t.finalized_=!1),n}var $re=new Ire;$re.produce;var Ure={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},C$=Wn({name:"legend",initialState:Ure,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=ri(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:zt()},removeLegendPayload:{reducer(e,t){var n=ri(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:zt()}}}),{setLegendSize:p2,setLegendSettings:Bre,addLegendPayload:qre,replaceLegendPayload:Fre,removeLegendPayload:Kre}=C$.actions,Hre=C$.reducer,Rx={exports:{}},Dx={};var m2;function Gre(){if(m2)return Dx;m2=1;var e=Vc();function t(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,s=e.useEffect,l=e.useMemo,c=e.useDebugValue;return Dx.useSyncExternalStoreWithSelector=function(f,h,p,g,v){var y=i(null);if(y.current===null){var S={hasValue:!1,value:null};y.current=S}else S=y.current;y=l(function(){function N(P){if(!C){if(C=!0,E=P,P=g(P),v!==void 0&&S.hasValue){var z=S.value;if(v(z,P))return A=z}return A=P}if(z=A,n(E,P))return z;var _=g(P);return v!==void 0&&v(z,_)?(E=P,z):(E=P,A=_)}var C=!1,E,A,O=p===void 0?null:p;return[function(){return N(h())},O===null?void 0:function(){return N(O())}]},[h,p,g,v]);var w=r(f,y[0],y[1]);return s(function(){S.hasValue=!0,S.value=w},[w]),c(w),w},Dx}var g2;function Vre(){return g2||(g2=1,Rx.exports=Gre()),Rx.exports}Vre();function Zre(e){e()}function Yre(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Zre(()=>{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 v2={notify(){},get:()=>[]};function Wre(e,t){let n,r=v2,i=0,s=!1;function l(w){p();const N=r.subscribe(w);let C=!1;return()=>{C||(C=!0,N(),g())}}function c(){r.notify()}function f(){S.onStateChange&&S.onStateChange()}function h(){return s}function p(){i++,n||(n=e.subscribe(f),r=Yre())}function g(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=v2)}function v(){s||(s=!0,p())}function y(){s&&(s=!1,g())}const S={addNestedSub:l,notifyNestedSubs:c,handleChangeWrapper:f,isSubscribed:h,trySubscribe:v,tryUnsubscribe:y,getListeners:()=>r};return S}var Qre=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Xre=Qre(),Jre=()=>typeof navigator<"u"&&navigator.product==="ReactNative",eie=Jre(),tie=()=>Xre||eie?x.useLayoutEffect:x.useEffect,nie=tie();function y2(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function rie(e,t){if(y2(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])||!y2(e[n[i]],t[n[i]]))return!1;return!0}var iie=Symbol.for("react-redux-context"),aie=typeof globalThis<"u"?globalThis:{};function sie(){if(!x.createContext)return{};const e=aie[iie]??=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var oie=sie();function lie(e){const{children:t,context:n,serverState:r,store:i}=e,s=x.useMemo(()=>{const f=Wre(i);return{store:i,subscription:f,getServerState:r?()=>r:void 0}},[i,r]),l=x.useMemo(()=>i.getState(),[i]);nie(()=>{const{subscription:f}=s;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),l!==i.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[s,l]);const c=n||oie;return x.createElement(c.Provider,{value:s},t)}var cie=lie,uie=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function die(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Nf(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(uie.has(r)){if(e[r]==null&&t[r]==null)continue;if(!rie(e[r],t[r]))return!1}else if(!die(e[r],t[r]))return!1;return!0}var fie=["contextPayload"];function mS(){return mS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mS.apply(null,arguments)}function b2(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 Uc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?b2(Object(n),!0).forEach(function(r){hie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hie(e,t,n){return(t=pie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pie(e){var t=mie(e,"string");return typeof t=="symbol"?t:t+""}function mie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gie(e,t){if(e==null)return{};var n,r,i=vie(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function vie(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 yie(e){return e.value}function bie(e){var{contextPayload:t}=e,n=gie(e,fie),r=OL(t,e.payloadUniqBy,yie),i=Uc(Uc({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content=="function"?x.createElement(e.content,i):x.createElement(Hee,i)}function xie(e,t,n,r,i,s){var{layout:l,align:c,verticalAlign:f}=t,h,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(c==="center"&&l==="vertical"?h={left:((r||0)-s.width)/2}:h=c==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(f==="middle"?p={top:((i||0)-s.height)/2}:p=f==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),Uc(Uc({},h),p)}function wie(e){var t=Yt();return x.useEffect(()=>{t(Bre(e))},[t,e]),null}function Sie(e){var t=Yt();return x.useEffect(()=>(t(p2(e)),()=>{t(p2({width:0,height:0}))}),[t,e]),null}function jie(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Nie={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Cie(e){var t=sr(e,Nie),n=Rte(),r=IJ(),i=_re(),{width:s,height:l,wrapperStyle:c,portal:f}=t,[h,p]=TL([n]),g=lj(),v=cj();if(g==null||v==null)return null;var y=g-(i?.left||0)-(i?.right||0),S=jie(t.layout,l,s,y),w=f?c:Uc(Uc({position:"absolute",width:S?.width||s||"auto",height:S?.height||l||"auto"},xie(c,t,i,g,v,h)),c),N=f??r;if(N==null||n==null)return null;var C=x.createElement("div",{className:"recharts-legend-wrapper",style:w,ref:p},x.createElement(wie,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!f&&x.createElement(Sie,{width:h.width,height:h.height}),x.createElement(bie,mS({},t,S,{margin:i,chartWidth:g,chartHeight:v,contextPayload:n})));return cl.createPortal(C,N)}var O$=x.memo(Cie,Nf);O$.displayName="Legend";function gS(){return gS=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},gS.apply(null,arguments)}function x2(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 dd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x2(Object(n),!0).forEach(function(r){Oie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Oie(e,t,n){return(t=_ie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _ie(e){var t=kie(e,"string");return typeof t=="symbol"?t:t+""}function kie(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 Aie(e){return Array.isArray(e)&&oi(e[0])&&oi(e[1])?e.join(" ~ "):e}var lc={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 Eie(e,t){return t==null?e:rv(e,t)}var Tie=e=>{var{separator:t=lc.separator,contentStyle:n,itemStyle:r,labelStyle:i=lc.labelStyle,payload:s,formatter:l,itemSorter:c,wrapperClassName:f,labelClassName:h,label:p,labelFormatter:g,accessibilityLayer:v=lc.accessibilityLayer}=e,y=()=>{if(s&&s.length){var P={padding:0,margin:0},z=Eie(s,c),_=z.map((T,R)=>{if(!T||T.type==="none")return null;var B=T.formatter||l||Aie,{value:$,name:L}=T,ne=$,he=L;if(B){var ge=B($,L,T,R,s);if(Array.isArray(ge))[ne,he]=ge;else if(ge!=null)ne=ge;else return null}var H=dd(dd({},lc.itemStyle),{},{color:T.color||lc.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(R),style:H},oi(he)?x.createElement("span",{className:"recharts-tooltip-item-name"},he):null,oi(he)?x.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,x.createElement("span",{className:"recharts-tooltip-item-value"},ne),x.createElement("span",{className:"recharts-tooltip-item-unit"},T.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:P},_)}return null},S=dd(dd({},lc.contentStyle),n),w=dd({margin:0},i),N=!Un(p),C=N?p:"",E=gt("recharts-default-tooltip",f),A=gt("recharts-tooltip-label",h);N&&g&&s!==void 0&&s!==null&&(C=g(p,s));var O=v?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",gS({className:E,style:S},O),x.createElement("p",{className:A,style:w},x.isValidElement(C)?C:"".concat(C)),y())},fd="recharts-tooltip-wrapper",Pie={visibility:"hidden"};function zie(e){var{coordinate:t,translateX:n,translateY:r}=e;return gt(fd,{["".concat(fd,"-right")]:ze(n)&&t&&ze(t.x)&&n>=t.x,["".concat(fd,"-left")]:ze(n)&&t&&ze(t.x)&&n<t.x,["".concat(fd,"-bottom")]:ze(r)&&t&&ze(t.y)&&r>=t.y,["".concat(fd,"-top")]:ze(r)&&t&&ze(t.y)&&r<t.y})}function w2(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:s,reverseDirection:l,tooltipDimension:c,viewBox:f,viewBoxDimension:h}=e;if(s&&ze(s[r]))return s[r];var p=n[r]-c-(i>0?i:0),g=n[r]+i;if(t[r])return l[r]?p:g;var v=f[r];if(v==null)return 0;if(l[r]){var y=p,S=v;return y<S?Math.max(g,v):Math.max(p,v)}if(h==null)return 0;var w=g+c,N=v+h;return w>N?Math.max(p,v):Math.max(g,v)}function Mie(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 Rie(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:s,reverseDirection:l,tooltipBox:c,useTranslate3d:f,viewBox:h}=e,p,g,v;return c.height>0&&c.width>0&&n?(g=w2({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:s,reverseDirection:l,tooltipDimension:c.width,viewBox:h,viewBoxDimension:h.width}),v=w2({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:s,reverseDirection:l,tooltipDimension:c.height,viewBox:h,viewBoxDimension:h.height}),p=Mie({translateX:g,translateY:v,useTranslate3d:f})):p=Pie,{cssProperties:p,cssClasses:zie({translateX:g,translateY:v,coordinate:n})}}var Die=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Cf={isSsr:Die()};function _$(){var[e,t]=x.useState(()=>Cf.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return x.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function S2(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 cc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?S2(Object(n),!0).forEach(function(r){Iie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Iie(e,t,n){return(t=Lie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lie(e){var t=$ie(e,"string");return typeof t=="symbol"?t:t+""}function $ie(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 Uie(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function Bie(e){var t,n,r,i,s,l,c=_$(),[f,h]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var S=w=>{if(w.key==="Escape"){var N,C,E,A;h({dismissed:!0,dismissedAtCoordinate:{x:(N=(C=e.coordinate)===null||C===void 0?void 0:C.x)!==null&&N!==void 0?N:0,y:(E=(A=e.coordinate)===null||A===void 0?void 0:A.y)!==null&&E!==void 0?E:0}})}};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),f.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==f.dismissedAtCoordinate.x||((s=(l=e.coordinate)===null||l===void 0?void 0:l.y)!==null&&s!==void 0?s:0)!==f.dismissedAtCoordinate.y)&&h(cc(cc({},f),{},{dismissed:!1}));var{cssClasses:p,cssProperties:g}=Rie({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}),v=e.hasPortalFromProps?{}:cc(cc({transition:Uie({prefersReducedMotion:c,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},g),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),y=cc(cc({},v),{},{visibility:!f.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return x.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:y,ref:e.innerRef},e.children)}var qie=x.memo(Bie),k$=()=>{var e;return(e=Re(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function vS(){return vS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vS.apply(null,arguments)}function j2(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 N2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j2(Object(n),!0).forEach(function(r){Fie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fie(e,t,n){return(t=Kie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kie(e){var t=Hie(e,"string");return typeof t=="symbol"?t:t+""}function Hie(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 C2={curveBasisClosed:nee,curveBasisOpen:ree,curveBasis:tee,curveBumpX:BJ,curveBumpY:qJ,curveLinearClosed:iee,curveLinear:ev,curveMonotoneX:aee,curveMonotoneY:see,curveNatural:oee,curveStep:lee,curveStepAfter:uee,curveStepBefore:cee},Km=e=>We(e.x)&&We(e.y),O2=e=>e.base!=null&&Km(e.base)&&Km(e),hd=e=>e.x,pd=e=>e.y,Gie=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(vf(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=C2["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return C2[n]||ev},_2={connectNulls:!1,type:"linear"},Vie=e=>{var{type:t=_2.type,points:n=[],baseLine:r,layout:i,connectNulls:s=_2.connectNulls}=e,l=Gie(t,i),c=s?n.filter(Km):n;if(Array.isArray(r)){var f,h=n.map((S,w)=>N2(N2({},S),{},{base:r[w]}));i==="vertical"?f=Sp().y(pd).x1(hd).x0(S=>S.base.x):f=Sp().x(hd).y1(pd).y0(S=>S.base.y);var p=f.defined(O2).curve(l),g=s?h.filter(O2):h;return p(g)}var v;i==="vertical"&&ze(r)?v=Sp().y(pd).x1(hd).x0(r):ze(r)?v=Sp().x(hd).y1(pd).y0(r):v=XI().x(hd).y(pd);var y=v.defined(Km).curve(l);return y(c)},Jp=e=>{var{className:t,points:n,path:r,pathRef:i}=e,s=ru();if((!n||!n.length)&&!r)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||s,connectNulls:e.connectNulls},c=n&&n.length?Vie(l):r;return x.createElement("path",vS({},Oi(e),Q1(e),{className:gt("recharts-curve",t),d:c===null?void 0:c,ref:i}))},Zie=["x","y","top","left","width","height","className"];function yS(){return yS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yS.apply(null,arguments)}function k2(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 Yie(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k2(Object(n),!0).forEach(function(r){Wie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wie(e,t,n){return(t=Qie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qie(e){var t=Xie(e,"string");return typeof t=="symbol"?t:t+""}function Xie(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 Jie(e,t){if(e==null)return{};var n,r,i=eae(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function eae(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 tae=(e,t,n,r,i,s)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(s,",").concat(t,"h").concat(n),nae=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:s=0,height:l=0,className:c}=e,f=Jie(e,Zie),h=Yie({x:t,y:n,top:r,left:i,width:s,height:l},f);return!ze(t)||!ze(n)||!ze(s)||!ze(l)||!ze(r)||!ze(i)?null:x.createElement("path",yS({},xr(h),{className:gt("recharts-cross",c),d:tae(t,n,s,l,r,i)}))};function rae(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 A2(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 E2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A2(Object(n),!0).forEach(function(r){iae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iae(e,t,n){return(t=aae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aae(e){var t=sae(e,"string");return typeof t=="symbol"?t:t+""}function sae(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 oae=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),lae=(e,t,n)=>e.map(r=>"".concat(oae(r)," ").concat(t,"ms ").concat(n)).join(","),cae=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),ef=(e,t)=>Object.keys(t).reduce((n,r)=>E2(E2({},n),{},{[r]:e(r,t[r])}),{});function T2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?T2(Object(n),!0).forEach(function(r){uae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uae(e,t,n){return(t=dae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dae(e){var t=fae(e,"string");return typeof t=="symbol"?t:t+""}function fae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hm=(e,t,n)=>e+(t-e)*n,bS=e=>{var{from:t,to:n}=e;return t!==n},A$=(e,t,n)=>{var r=ef((i,s)=>{if(bS(s)){var[l,c]=e(s.from,s.to,s.velocity);return wn(wn({},s),{},{from:l,velocity:c})}return s},t);return n<1?ef((i,s)=>bS(s)&&r[i]!=null?wn(wn({},s),{},{velocity:Hm(s.velocity,r[i].velocity,n),from:Hm(s.from,r[i].from,n)}):s,t):A$(e,r,n-1)};function hae(e,t,n,r,i,s){var l,c=r.reduce((v,y)=>wn(wn({},v),{},{[y]:{from:e[y],velocity:0,to:t[y]}}),{}),f=()=>ef((v,y)=>y.from,c),h=()=>!Object.values(c).filter(bS).length,p=null,g=v=>{l||(l=v);var y=v-l,S=y/n.dt;c=A$(n,c,S),i(wn(wn(wn({},e),t),f())),l=v,h()||(p=s.setTimeout(g))};return()=>(p=s.setTimeout(g),()=>{var v;(v=p)===null||v===void 0||v()})}function pae(e,t,n,r,i,s,l){var c=null,f=i.reduce((g,v)=>{var y=e[v],S=t[v];return y==null||S==null?g:wn(wn({},g),{},{[v]:[y,S]})},{}),h,p=g=>{h||(h=g);var v=(g-h)/r,y=ef((w,N)=>Hm(...N,n(v)),f);if(s(wn(wn(wn({},e),t),y)),v<1)c=l.setTimeout(p);else{var S=ef((w,N)=>Hm(...N,n(1)),f);s(wn(wn(wn({},e),t),S))}};return()=>(c=l.setTimeout(p),()=>{var g;(g=c)===null||g===void 0||g()})}const mae=(e,t,n,r,i,s)=>{var l=cae(e,t);return n==null?()=>(i(wn(wn({},e),t)),()=>{}):n.isStepper===!0?hae(e,t,n,l,i,s):pae(e,t,n,r,l,i,s)};var Gm=1e-4,E$=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],T$=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),P2=(e,t)=>n=>{var r=E$(e,t);return T$(r,n)},gae=(e,t)=>n=>{var r=E$(e,t),i=[...r.map((s,l)=>s*l).slice(1),0];return T$(i,n)},vae=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(s=>parseFloat(s));return[i[0],i[1],i[2],i[3]]},yae=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=vae(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},bae=(e,t,n,r)=>{var i=P2(e,n),s=P2(t,r),l=gae(e,n),c=h=>h>1?1:h<0?0:h,f=h=>{for(var p=h>1?1:h,g=p,v=0;v<8;++v){var y=i(g)-p,S=l(g);if(Math.abs(y-p)<Gm||S<Gm)return s(g);g=c(g-y/S)}return s(g)};return f.isStepper=!1,f},z2=function(){return bae(...yae(...arguments))},xae=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,s=(l,c,f)=>{var h=-(l-c)*n,p=f*r,g=f+(h-p)*i/1e3,v=f*i/1e3+l;return Math.abs(v-c)<Gm&&Math.abs(g)<Gm?[c,0]:[v,g]};return s.isStepper=!0,s.dt=i,s},wae=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return z2(e);case"spring":return xae();default:if(e.split("(")[0]==="cubic-bezier")return z2(e)}return typeof e=="function"?e:null};function Sae(e){var t,n=()=>null,r=!1,i=null,s=l=>{if(!r){if(Array.isArray(l)){if(!l.length)return;var c=l,[f,...h]=c;if(typeof f=="number"){i=e.setTimeout(s.bind(null,h),f);return}s(f),i=e.setTimeout(s.bind(null,h));return}typeof l=="string"&&(t=l,n(t)),typeof l=="object"&&(t=l,n(t)),typeof l=="function"&&l()}};return{stop:()=>{r=!0},start:l=>{r=!1,i&&(i(),i=null),s(l)},subscribe:l=>(n=l,()=>{n=()=>null}),getTimeoutController:()=>e}}class jae{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,s=l=>{l-r>=n?t(l):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(s))};return i=requestAnimationFrame(s),()=>{i!=null&&cancelAnimationFrame(i)}}}function Nae(){return Sae(new jae)}var Cae=x.createContext(Nae);function Oae(e,t){var n=x.useContext(Cae);return x.useMemo(()=>t??n(e),[e,t,n])}var _ae={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},M2={t:0},Ix={t:1};function P$(e){var t=sr(e,_ae),{isActive:n,canBegin:r,duration:i,easing:s,begin:l,onAnimationEnd:c,onAnimationStart:f,children:h}=t,p=_$(),g=n==="auto"?!Cf.isSsr&&!p:n,v=Oae(t.animationId,t.animationManager),[y,S]=x.useState(g?M2:Ix),w=x.useRef(null);return x.useEffect(()=>{g||S(Ix)},[g]),x.useEffect(()=>{if(!g||!r)return nu;var N=mae(M2,Ix,wae(s),i,S,v.getTimeoutController()),C=()=>{w.current=N()};return v.start([f,l,C,i,c]),()=>{v.stop(),w.current&&w.current(),c()}},[g,r,i,s,l,f,c,v]),h(y.t)}function z$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(Vd(t)),r=x.useRef(e);return r.current!==e&&(n.current=Vd(t),r.current=e),n.current}var kae=["radius"],Aae=["radius"],R2,D2,I2,L2,$2,U2,B2,q2,F2,K2;function H2(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 G2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H2(Object(n),!0).forEach(function(r){Eae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eae(e,t,n){return(t=Tae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tae(e){var t=Pae(e,"string");return typeof t=="symbol"?t:t+""}function Pae(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 Vm(){return Vm=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},Vm.apply(null,arguments)}function V2(e,t){if(e==null)return{};var n,r,i=zae(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zae(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 Bi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Z2=(e,t,n,r,i)=>{var s=Ps(n),l=Ps(r),c=Math.min(Math.abs(s)/2,Math.abs(l)/2),f=l>=0?1:-1,h=s>=0?1:-1,p=l>=0&&s>=0||l<0&&s<0?1:0,g;if(c>0&&Array.isArray(i)){for(var v=[0,0,0,0],y=0,S=4;y<S;y++){var w,N=(w=i[y])!==null&&w!==void 0?w:0;v[y]=N>c?c:N}g=Dn(R2||(R2=Bi(["M",",",""])),e,t+f*v[0]),v[0]>0&&(g+=Dn(D2||(D2=Bi(["A ",",",",0,0,",",",",",""])),v[0],v[0],p,e+h*v[0],t)),g+=Dn(I2||(I2=Bi(["L ",",",""])),e+n-h*v[1],t),v[1]>0&&(g+=Dn(L2||(L2=Bi(["A ",",",",0,0,",`,
|
|
240
|
+
`,",",""])),v[1],v[1],p,e+n,t+f*v[1])),g+=Dn($2||($2=Bi(["L ",",",""])),e+n,t+r-f*v[2]),v[2]>0&&(g+=Dn(U2||(U2=Bi(["A ",",",",0,0,",`,
|
|
241
|
+
`,",",""])),v[2],v[2],p,e+n-h*v[2],t+r)),g+=Dn(B2||(B2=Bi(["L ",",",""])),e+h*v[3],t+r),v[3]>0&&(g+=Dn(q2||(q2=Bi(["A ",",",",0,0,",`,
|
|
242
|
+
`,",",""])),v[3],v[3],p,e,t+r-f*v[3])),g+="Z"}else if(c>0&&i===+i&&i>0){var C=Math.min(c,i);g=Dn(F2||(F2=Bi(["M ",",",`
|
|
243
|
+
A `,",",",0,0,",",",",",`
|
|
244
|
+
L `,",",`
|
|
245
|
+
A `,",",",0,0,",",",",",`
|
|
246
|
+
L `,",",`
|
|
247
|
+
A `,",",",0,0,",",",",",`
|
|
248
|
+
L `,",",`
|
|
249
|
+
A `,",",",0,0,",",",","," Z"])),e,t+f*C,C,C,p,e+h*C,t,e+n-h*C,t,C,C,p,e+n,t+f*C,e+n,t+r-f*C,C,C,p,e+n-h*C,t+r,e+h*C,t+r,C,C,p,e,t+r-f*C)}else g=Dn(K2||(K2=Bi(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return g},Y2={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Mae=e=>{var t=sr(e,Y2),n=x.useRef(null),[r,i]=x.useState(-1);x.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var ie=n.current.getTotalLength();ie&&i(ie)}catch{}},[]);var{x:s,y:l,width:c,height:f,radius:h,className:p}=t,{animationEasing:g,animationDuration:v,animationBegin:y,isAnimationActive:S,isUpdateAnimationActive:w}=t,N=x.useRef(c),C=x.useRef(f),E=x.useRef(s),A=x.useRef(l),O=x.useMemo(()=>({x:s,y:l,width:c,height:f,radius:h}),[s,l,c,f,h]),P=z$(O,"rectangle-");if(s!==+s||l!==+l||c!==+c||f!==+f||c===0||f===0)return null;var z=gt("recharts-rectangle",p);if(!w){var _=xr(t),{radius:T}=_,R=V2(_,kae);return x.createElement("path",Vm({},R,{x:Ps(s),y:Ps(l),width:Ps(c),height:Ps(f),radius:typeof h=="number"?h:void 0,className:z,d:Z2(s,l,c,f,h)}))}var B=N.current,$=C.current,L=E.current,ne=A.current,he="0px ".concat(r===-1?1:r,"px"),ge="".concat(r,"px ").concat(r,"px"),H=lae(["strokeDasharray"],v,typeof g=="string"?g:Y2.animationEasing);return x.createElement(P$,{animationId:P,key:P,canBegin:r>0,duration:v,easing:g,isActive:w,begin:y},ie=>{var pe=Hi(B,c,ie),we=Hi($,f,ie),q=Hi(L,s,ie),D=Hi(ne,l,ie);n.current&&(N.current=pe,C.current=we,E.current=q,A.current=D);var G;S?ie>0?G={transition:H,strokeDasharray:ge}:G={strokeDasharray:he}:G={strokeDasharray:ge};var ae=xr(t),{radius:Y}=ae,W=V2(ae,Aae);return x.createElement("path",Vm({},W,{radius:typeof h=="number"?h:void 0,className:z,d:Z2(q,D,pe,we,h),ref:n,style:G2(G2({},G),t.style)}))})};function W2(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 Q2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W2(Object(n),!0).forEach(function(r){Rae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rae(e,t,n){return(t=Dae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dae(e){var t=Iae(e,"string");return typeof t=="symbol"?t:t+""}function Iae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zm=Math.PI/180,Lae=e=>e*180/Math.PI,$n=(e,t,n,r)=>({x:e+Math.cos(-Zm*r)*n,y:t+Math.sin(-Zm*r)*n}),$ae=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},Uae=(e,t)=>{var{x:n,y:r}=e,{x:i,y:s}=t;return Math.sqrt((n-i)**2+(r-s)**2)},Bae=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:s}=t,l=Uae({x:n,y:r},{x:i,y:s});if(l<=0)return{radius:l,angle:0};var c=(n-i)/l,f=Math.acos(c);return r>s&&(f=2*Math.PI-f),{radius:l,angle:Lae(f),angleInRadian:f}},qae=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),s=Math.min(r,i);return{startAngle:t-s*360,endAngle:n-s*360}},Fae=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),s=Math.floor(r/360),l=Math.min(i,s);return e+l*360},Kae=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:s}=Bae({x:n,y:r},t),{innerRadius:l,outerRadius:c}=t;if(i<l||i>c||i===0)return null;var{startAngle:f,endAngle:h}=qae(t),p=s,g;if(f<=h){for(;p>h;)p-=360;for(;p<f;)p+=360;g=p>=f&&p<=h}else{for(;p>f;)p-=360;for(;p<h;)p+=360;g=p>=h&&p<=f}return g?Q2(Q2({},t),{},{radius:i,angle:Fae(p,t)}):null};function M$(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:s}=e,l=$n(t,n,r,i),c=$n(t,n,r,s);return{points:[l,c],cx:t,cy:n,radius:r,startAngle:i,endAngle:s}}var X2,J2,eP,tP,nP,rP,iP;function xS(){return xS=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},xS.apply(null,arguments)}function Do(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Hae=(e,t)=>{var n=ni(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Ep=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:s,isExternal:l,cornerRadius:c,cornerIsExternal:f}=e,h=c*(l?1:-1)+r,p=Math.asin(c/h)/Zm,g=f?i:i+s*p,v=$n(t,n,h,g),y=$n(t,n,r,g),S=f?i-s*p:i,w=$n(t,n,h*Math.cos(p*Zm),S);return{center:v,circleTangency:y,lineTangency:w,theta:p}},R$=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:s,endAngle:l}=e,c=Hae(s,l),f=s+c,h=$n(t,n,i,s),p=$n(t,n,i,f),g=Dn(X2||(X2=Do(["M ",",",`
|
|
250
|
+
A `,",",`,0,
|
|
251
|
+
`,",",`,
|
|
252
|
+
`,",",`
|
|
253
|
+
`])),h.x,h.y,i,i,+(Math.abs(c)>180),+(s>f),p.x,p.y);if(r>0){var v=$n(t,n,r,s),y=$n(t,n,r,f);g+=Dn(J2||(J2=Do(["L ",",",`
|
|
254
|
+
A `,",",`,0,
|
|
255
|
+
`,",",`,
|
|
256
|
+
`,","," Z"])),y.x,y.y,r,r,+(Math.abs(c)>180),+(s<=f),v.x,v.y)}else g+=Dn(eP||(eP=Do(["L ",","," Z"])),t,n);return g},Gae=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:s,forceCornerRadius:l,cornerIsExternal:c,startAngle:f,endAngle:h}=e,p=ni(h-f),{circleTangency:g,lineTangency:v,theta:y}=Ep({cx:t,cy:n,radius:i,angle:f,sign:p,cornerRadius:s,cornerIsExternal:c}),{circleTangency:S,lineTangency:w,theta:N}=Ep({cx:t,cy:n,radius:i,angle:h,sign:-p,cornerRadius:s,cornerIsExternal:c}),C=c?Math.abs(f-h):Math.abs(f-h)-y-N;if(C<0)return l?Dn(tP||(tP=Do(["M ",",",`
|
|
257
|
+
a`,",",",0,0,1,",`,0
|
|
258
|
+
a`,",",",0,0,1,",`,0
|
|
259
|
+
`])),v.x,v.y,s,s,s*2,s,s,-s*2):R$({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:f,endAngle:h});var E=Dn(nP||(nP=Do(["M ",",",`
|
|
260
|
+
A`,",",",0,0,",",",",",`
|
|
261
|
+
A`,",",",0,",",",",",",",`
|
|
262
|
+
A`,",",",0,0,",",",",",`
|
|
263
|
+
`])),v.x,v.y,s,s,+(p<0),g.x,g.y,i,i,+(C>180),+(p<0),S.x,S.y,s,s,+(p<0),w.x,w.y);if(r>0){var{circleTangency:A,lineTangency:O,theta:P}=Ep({cx:t,cy:n,radius:r,angle:f,sign:p,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),{circleTangency:z,lineTangency:_,theta:T}=Ep({cx:t,cy:n,radius:r,angle:h,sign:-p,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),R=c?Math.abs(f-h):Math.abs(f-h)-P-T;if(R<0&&s===0)return"".concat(E,"L").concat(t,",").concat(n,"Z");E+=Dn(rP||(rP=Do(["L",",",`
|
|
264
|
+
A`,",",",0,0,",",",",",`
|
|
265
|
+
A`,",",",0,",",",",",",",`
|
|
266
|
+
A`,",",",0,0,",",",",","Z"])),_.x,_.y,s,s,+(p<0),z.x,z.y,r,r,+(R>180),+(p>0),A.x,A.y,s,s,+(p<0),O.x,O.y)}else E+=Dn(iP||(iP=Do(["L",",","Z"])),t,n);return E},Vae={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Zae=e=>{var t=sr(e,Vae),{cx:n,cy:r,innerRadius:i,outerRadius:s,cornerRadius:l,forceCornerRadius:c,cornerIsExternal:f,startAngle:h,endAngle:p,className:g}=t;if(s<i||h===p)return null;var v=gt("recharts-sector",g),y=s-i,S=Fs(l,y,0,!0),w;return S>0&&Math.abs(h-p)<360?w=Gae({cx:n,cy:r,innerRadius:i,outerRadius:s,cornerRadius:Math.min(S,y/2),forceCornerRadius:c,cornerIsExternal:f,startAngle:h,endAngle:p}):w=R$({cx:n,cy:r,innerRadius:i,outerRadius:s,startAngle:h,endAngle:p}),x.createElement("path",xS({},xr(t),{className:v,d:w}))};function Yae(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(pL(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:s,outerRadius:l,angle:c}=t,f=$n(r,i,s,c),h=$n(r,i,l,c);return[{x:f.x,y:f.y},{x:h.x,y:h.y}]}return M$(t)}}var Lx={},$x={},Ux={},aP;function Wae(){return aP||(aP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kL();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(Ux)),Ux}var sP;function Qae(){return sP||(sP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Wae();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})($x)),$x}var oP;function Xae(){return oP||(oP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=AL(),n=Qae();function r(i,s,l){l&&typeof l!="number"&&t.isIterateeCall(i,s,l)&&(s=l=void 0),i=n.toFinite(i),s===void 0?(s=i,i=0):s=n.toFinite(s),l=l===void 0?i<s?1:-1:n.toFinite(l);const c=Math.max(Math.ceil((s-i)/(l||1)),0),f=new Array(c);for(let h=0;h<c;h++)f[h]=i,i+=l;return f}e.range=r})(Lx)),Lx}var Bx,lP;function Jae(){return lP||(lP=1,Bx=Xae().range),Bx}var ese=Jae();const D$=Ks(ese);var Pi=e=>e.chartData,hj=te([Pi],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),xv=(e,t,n,r)=>r?hj(e):Pi(e),tse=(e,t,n)=>n?hj(e):Pi(e),nse=te([xv],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});te([hj],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var rse=te([Pi],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function Yi(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(We(t)&&We(n))return!0}return!1}function cP(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function I$(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,s;if(We(n))i=n;else if(typeof n=="function")return;if(We(r))s=r;else if(typeof r=="function")return;var l=[i,s];if(Yi(l))return l}}function ise(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Yi(r))return cP(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,s]=e,l,c;if(i==="auto")t!=null&&(l=Math.min(...t));else if(ze(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t?.[0]))}catch{}else if(typeof i=="string"&&XT.test(i)){var f=XT.exec(i);if(f==null||f[1]==null||t==null)l=void 0;else{var h=+f[1];l=t[0]-h}}else l=t?.[0];if(s==="auto")t!=null&&(c=Math.max(...t));else if(ze(s))c=s;else if(typeof s=="function")try{t!=null&&(c=s(t?.[1]))}catch{}else if(typeof s=="string"&&JT.test(s)){var p=JT.exec(s);if(p==null||p[1]==null||t==null)c=void 0;else{var g=+p[1];c=t[1]+g}}else c=t?.[1];var v=[l,c];if(Yi(v))return t==null?v:cP(v,t,n)}}}var iu=1e9,ase={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},mj,Ut=!0,li="[DecimalError] ",Go=li+"Invalid argument: ",pj=li+"Exponent out of range: ",au=Math.floor,Ao=Math.pow,sse=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Er,Cn=1e7,Mt=7,L$=9007199254740991,Ym=au(L$/Mt),ke={};ke.absoluteValue=ke.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ke.comparedTo=ke.cmp=function(e){var t,n,r,i,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(r=s.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return r===i?0:r>i^s.s<0?1:-1};ke.decimalPlaces=ke.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Mt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ke.dividedBy=ke.div=function(e){return za(this,new this.constructor(e))};ke.dividedToIntegerBy=ke.idiv=function(e){var t=this,n=t.constructor;return _t(za(t,new n(e),0,1),n.precision)};ke.equals=ke.eq=function(e){return!this.cmp(e)};ke.exponent=function(){return mn(this)};ke.greaterThan=ke.gt=function(e){return this.cmp(e)>0};ke.greaterThanOrEqualTo=ke.gte=function(e){return this.cmp(e)>=0};ke.isInteger=ke.isint=function(){return this.e>this.d.length-2};ke.isNegative=ke.isneg=function(){return this.s<0};ke.isPositive=ke.ispos=function(){return this.s>0};ke.isZero=function(){return this.s===0};ke.lessThan=ke.lt=function(e){return this.cmp(e)<0};ke.lessThanOrEqualTo=ke.lte=function(e){return this.cmp(e)<1};ke.logarithm=ke.log=function(e){var t,n=this,r=n.constructor,i=r.precision,s=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Er))throw Error(li+"NaN");if(n.s<1)throw Error(li+(n.s?"NaN":"-Infinity"));return n.eq(Er)?new r(0):(Ut=!1,t=za(tf(n,s),tf(e,s),s),Ut=!0,_t(t,i))};ke.minus=ke.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?B$(t,e):$$(t,(e.s=-e.s,e))};ke.modulo=ke.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(li+"NaN");return n.s?(Ut=!1,t=za(n,e,0,1).times(e),Ut=!0,n.minus(t)):_t(new r(n),i)};ke.naturalExponential=ke.exp=function(){return U$(this)};ke.naturalLogarithm=ke.ln=function(){return tf(this)};ke.negated=ke.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ke.plus=ke.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?$$(t,e):B$(t,(e.s=-e.s,e))};ke.precision=ke.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Go+e);if(t=mn(i)+1,r=i.d.length-1,n=r*Mt+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};ke.squareRoot=ke.sqrt=function(){var e,t,n,r,i,s,l,c=this,f=c.constructor;if(c.s<1){if(!c.s)return new f(0);throw Error(li+"NaN")}for(e=mn(c),Ut=!1,i=Math.sqrt(+c),i==0||i==1/0?(t=Zi(c.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=au((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new f(t)):r=new f(i.toString()),n=f.precision,i=l=n+3;;)if(s=r,r=s.plus(za(c,s,l+2)).times(.5),Zi(s.d).slice(0,l)===(t=Zi(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(_t(s,n+1,0),s.times(s).eq(c)){r=s;break}}else if(t!="9999")break;l+=4}return Ut=!0,_t(r,n)};ke.times=ke.mul=function(e){var t,n,r,i,s,l,c,f,h,p=this,g=p.constructor,v=p.d,y=(e=new g(e)).d;if(!p.s||!e.s)return new g(0);for(e.s*=p.s,n=p.e+e.e,f=v.length,h=y.length,f<h&&(s=v,v=y,y=s,l=f,f=h,h=l),s=[],l=f+h,r=l;r--;)s.push(0);for(r=h;--r>=0;){for(t=0,i=f+r;i>r;)c=s[i]+y[r]*v[i-r-1]+t,s[i--]=c%Cn|0,t=c/Cn|0;s[i]=(s[i]+t)%Cn|0}for(;!s[--l];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,Ut?_t(e,g.precision):e};ke.toDecimalPlaces=ke.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ea(e,0,iu),t===void 0?t=r.rounding:ea(t,0,8),_t(n,e+mn(n)+1,t))};ke.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=al(r,!0):(ea(e,0,iu),t===void 0?t=i.rounding:ea(t,0,8),r=_t(new i(r),e+1,t),n=al(r,!0,e+1)),n};ke.toFixed=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?al(i):(ea(e,0,iu),t===void 0?t=s.rounding:ea(t,0,8),r=_t(new s(i),e+mn(i)+1,t),n=al(r.abs(),!1,e+mn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ke.toInteger=ke.toint=function(){var e=this,t=e.constructor;return _t(new t(e),mn(e)+1,t.rounding)};ke.toNumber=function(){return+this};ke.toPower=ke.pow=function(e){var t,n,r,i,s,l,c=this,f=c.constructor,h=12,p=+(e=new f(e));if(!e.s)return new f(Er);if(c=new f(c),!c.s){if(e.s<1)throw Error(li+"Infinity");return c}if(c.eq(Er))return c;if(r=f.precision,e.eq(Er))return _t(c,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=c.s,l){if((n=p<0?-p:p)<=L$){for(i=new f(Er),t=Math.ceil(r/Mt+4),Ut=!1;n%2&&(i=i.times(c),dP(i.d,t)),n=au(n/2),n!==0;)c=c.times(c),dP(c.d,t);return Ut=!0,e.s<0?new f(Er).div(i):_t(i,r)}}else if(s<0)throw Error(li+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,Ut=!1,i=e.times(tf(c,r+h)),Ut=!0,i=U$(i),i.s=s,i};ke.toPrecision=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?(n=mn(i),r=al(i,n<=s.toExpNeg||n>=s.toExpPos)):(ea(e,1,iu),t===void 0?t=s.rounding:ea(t,0,8),i=_t(new s(i),e,t),n=mn(i),r=al(i,e<=n||n<=s.toExpNeg,e)),r};ke.toSignificantDigits=ke.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ea(e,1,iu),t===void 0?t=r.rounding:ea(t,0,8)),_t(new r(n),e,t)};ke.toString=ke.valueOf=ke.val=ke.toJSON=ke[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=mn(e),n=e.constructor;return al(e,t<=n.toExpNeg||t>=n.toExpPos)};function $$(e,t){var n,r,i,s,l,c,f,h,p=e.constructor,g=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),Ut?_t(t,g):t;if(f=e.d,h=t.d,l=e.e,i=t.e,f=f.slice(),s=l-i,s){for(s<0?(r=f,s=-s,c=h.length):(r=h,i=l,c=f.length),l=Math.ceil(g/Mt),c=l>c?l+1:c+1,s>c&&(s=c,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(c=f.length,s=h.length,c-s<0&&(s=c,r=h,h=f,f=r),n=0;s;)n=(f[--s]=f[s]+h[s]+n)/Cn|0,f[s]%=Cn;for(n&&(f.unshift(n),++i),c=f.length;f[--c]==0;)f.pop();return t.d=f,t.e=i,Ut?_t(t,g):t}function ea(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Go+e)}function Zi(e){var t,n,r,i=e.length-1,s="",l=e[0];if(i>0){for(s+=l,t=1;t<i;t++)r=e[t]+"",n=Mt-r.length,n&&(s+=Cs(n)),s+=r;l=e[t],r=l+"",n=Mt-r.length,n&&(s+=Cs(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return s+l}var za=(function(){function e(r,i){var s,l=0,c=r.length;for(r=r.slice();c--;)s=r[c]*i+l,r[c]=s%Cn|0,l=s/Cn|0;return l&&r.unshift(l),r}function t(r,i,s,l){var c,f;if(s!=l)f=s>l?1:-1;else for(c=f=0;c<s;c++)if(r[c]!=i[c]){f=r[c]>i[c]?1:-1;break}return f}function n(r,i,s){for(var l=0;s--;)r[s]-=l,l=r[s]<i[s]?1:0,r[s]=l*Cn+r[s]-i[s];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,s,l){var c,f,h,p,g,v,y,S,w,N,C,E,A,O,P,z,_,T,R=r.constructor,B=r.s==i.s?1:-1,$=r.d,L=i.d;if(!r.s)return new R(r);if(!i.s)throw Error(li+"Division by zero");for(f=r.e-i.e,_=L.length,P=$.length,y=new R(B),S=y.d=[],h=0;L[h]==($[h]||0);)++h;if(L[h]>($[h]||0)&&--f,s==null?E=s=R.precision:l?E=s+(mn(r)-mn(i))+1:E=s,E<0)return new R(0);if(E=E/Mt+2|0,h=0,_==1)for(p=0,L=L[0],E++;(h<P||p)&&E--;h++)A=p*Cn+($[h]||0),S[h]=A/L|0,p=A%L|0;else{for(p=Cn/(L[0]+1)|0,p>1&&(L=e(L,p),$=e($,p),_=L.length,P=$.length),O=_,w=$.slice(0,_),N=w.length;N<_;)w[N++]=0;T=L.slice(),T.unshift(0),z=L[0],L[1]>=Cn/2&&++z;do p=0,c=t(L,w,_,N),c<0?(C=w[0],_!=N&&(C=C*Cn+(w[1]||0)),p=C/z|0,p>1?(p>=Cn&&(p=Cn-1),g=e(L,p),v=g.length,N=w.length,c=t(g,w,v,N),c==1&&(p--,n(g,_<v?T:L,v))):(p==0&&(c=p=1),g=L.slice()),v=g.length,v<N&&g.unshift(0),n(w,g,N),c==-1&&(N=w.length,c=t(L,w,_,N),c<1&&(p++,n(w,_<N?T:L,N))),N=w.length):c===0&&(p++,w=[0]),S[h++]=p,c&&w[0]?w[N++]=$[O]||0:(w=[$[O]],N=1);while((O++<P||w[0]!==void 0)&&E--)}return S[0]||S.shift(),y.e=f,_t(y,l?s+mn(y)+1:s)}})();function U$(e,t){var n,r,i,s,l,c,f=0,h=0,p=e.constructor,g=p.precision;if(mn(e)>16)throw Error(pj+mn(e));if(!e.s)return new p(Er);for(Ut=!1,c=g,l=new p(.03125);e.abs().gte(.1);)e=e.times(l),h+=5;for(r=Math.log(Ao(2,h))/Math.LN10*2+5|0,c+=r,n=i=s=new p(Er),p.precision=c;;){if(i=_t(i.times(e),c),n=n.times(++f),l=s.plus(za(i,n,c)),Zi(l.d).slice(0,c)===Zi(s.d).slice(0,c)){for(;h--;)s=_t(s.times(s),c);return p.precision=g,t==null?(Ut=!0,_t(s,g)):s}s=l}}function mn(e){for(var t=e.e*Mt,n=e.d[0];n>=10;n/=10)t++;return t}function qx(e,t,n){if(t>e.LN10.sd())throw Ut=!0,n&&(e.precision=n),Error(li+"LN10 precision limit exceeded");return _t(new e(e.LN10),t)}function Cs(e){for(var t="";e--;)t+="0";return t}function tf(e,t){var n,r,i,s,l,c,f,h,p,g=1,v=10,y=e,S=y.d,w=y.constructor,N=w.precision;if(y.s<1)throw Error(li+(y.s?"NaN":"-Infinity"));if(y.eq(Er))return new w(0);if(t==null?(Ut=!1,h=N):h=t,y.eq(10))return t==null&&(Ut=!0),qx(w,h);if(h+=v,w.precision=h,n=Zi(S),r=n.charAt(0),s=mn(y),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)y=y.times(e),n=Zi(y.d),r=n.charAt(0),g++;s=mn(y),r>1?(y=new w("0."+n),s++):y=new w(r+"."+n.slice(1))}else return f=qx(w,h+2,N).times(s+""),y=tf(new w(r+"."+n.slice(1)),h-v).plus(f),w.precision=N,t==null?(Ut=!0,_t(y,N)):y;for(c=l=y=za(y.minus(Er),y.plus(Er),h),p=_t(y.times(y),h),i=3;;){if(l=_t(l.times(p),h),f=c.plus(za(l,new w(i),h)),Zi(f.d).slice(0,h)===Zi(c.d).slice(0,h))return c=c.times(2),s!==0&&(c=c.plus(qx(w,h+2,N).times(s+""))),c=za(c,new w(g),h),w.precision=N,t==null?(Ut=!0,_t(c,N)):c;c=f,i+=2}}function uP(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=au(n/Mt),e.d=[],r=(n+1)%Mt,n<0&&(r+=Mt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Mt;r<i;)e.d.push(+t.slice(r,r+=Mt));t=t.slice(r),r=Mt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Ut&&(e.e>Ym||e.e<-Ym))throw Error(pj+n)}else e.s=0,e.e=0,e.d=[0];return e}function _t(e,t,n){var r,i,s,l,c,f,h,p,g=e.d;for(l=1,s=g[0];s>=10;s/=10)l++;if(r=t-l,r<0)r+=Mt,i=t,h=g[p=0];else{if(p=Math.ceil((r+1)/Mt),s=g.length,p>=s)return e;for(h=s=g[p],l=1;s>=10;s/=10)l++;r%=Mt,i=r-Mt+l}if(n!==void 0&&(s=Ao(10,l-i-1),c=h/s%10|0,f=t<0||g[p+1]!==void 0||h%s,f=n<4?(c||f)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||f||n==6&&(r>0?i>0?h/Ao(10,l-i):0:g[p-1])%10&1||n==(e.s<0?8:7))),t<1||!g[0])return f?(s=mn(e),g.length=1,t=t-s-1,g[0]=Ao(10,(Mt-t%Mt)%Mt),e.e=au(-t/Mt)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(r==0?(g.length=p,s=1,p--):(g.length=p+1,s=Ao(10,Mt-r),g[p]=i>0?(h/Ao(10,l-i)%Ao(10,i)|0)*s:0),f)for(;;)if(p==0){(g[0]+=s)==Cn&&(g[0]=1,++e.e);break}else{if(g[p]+=s,g[p]!=Cn)break;g[p--]=0,s=1}for(r=g.length;g[--r]===0;)g.pop();if(Ut&&(e.e>Ym||e.e<-Ym))throw Error(pj+mn(e));return e}function B$(e,t){var n,r,i,s,l,c,f,h,p,g,v=e.constructor,y=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),Ut?_t(t,y):t;if(f=e.d,g=t.d,r=t.e,h=e.e,f=f.slice(),l=h-r,l){for(p=l<0,p?(n=f,l=-l,c=g.length):(n=g,r=h,c=f.length),i=Math.max(Math.ceil(y/Mt),c)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=f.length,c=g.length,p=i<c,p&&(c=i),i=0;i<c;i++)if(f[i]!=g[i]){p=f[i]<g[i];break}l=0}for(p&&(n=f,f=g,g=n,t.s=-t.s),c=f.length,i=g.length-c;i>0;--i)f[c++]=0;for(i=g.length;i>l;){if(f[--i]<g[i]){for(s=i;s&&f[--s]===0;)f[s]=Cn-1;--f[s],f[i]+=Cn}f[i]-=g[i]}for(;f[--c]===0;)f.pop();for(;f[0]===0;f.shift())--r;return f[0]?(t.d=f,t.e=r,Ut?_t(t,y):t):new v(0)}function al(e,t,n){var r,i=mn(e),s=Zi(e.d),l=s.length;return t?(n&&(r=n-l)>0?s=s.charAt(0)+"."+s.slice(1)+Cs(r):l>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+Cs(-i-1)+s,n&&(r=n-l)>0&&(s+=Cs(r))):i>=l?(s+=Cs(i+1-l),n&&(r=n-i-1)>0&&(s=s+"."+Cs(r))):((r=i+1)<l&&(s=s.slice(0,r)+"."+s.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(s+="."),s+=Cs(r))),e.s<0?"-"+s:s}function dP(e,t){if(e.length>t)return e.length=t,!0}function q$(e){var t,n,r;function i(s){var l=this;if(!(l instanceof i))return new i(s);if(l.constructor=i,s instanceof i){l.s=s.s,l.e=s.e,l.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(Go+s);if(s>0)l.s=1;else if(s<0)s=-s,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(s===~~s&&s<1e7){l.e=0,l.d=[s];return}return uP(l,s.toString())}else if(typeof s!="string")throw Error(Go+s);if(s.charCodeAt(0)===45?(s=s.slice(1),l.s=-1):l.s=1,sse.test(s))uP(l,s);else throw Error(Go+s)}if(i.prototype=ke,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=q$,i.config=i.set=ose,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 ose(e){if(!e||typeof e!="object")throw Error(li+"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(au(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Go+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Go+n+": "+r);return this}var mj=q$(ase);Er=new mj(1);const ut=mj;function F$(e){var t;return e===0?t=1:t=Math.floor(new ut(e).abs().log(10).toNumber())+1,t}function K$(e,t,n){for(var r=new ut(e),i=0,s=[];r.lt(t)&&i<1e5;)s.push(r.toNumber()),r=r.add(n),i++;return s}var H$=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},gj=(e,t,n)=>{if(e.lte(0))return new ut(0);var r=F$(e.toNumber()),i=new ut(10).pow(r),s=e.div(i),l=r!==1?.05:.1,c=new ut(Math.ceil(s.div(l).toNumber())).add(n).mul(l),f=c.mul(i);return t?new ut(f.toNumber()):new ut(Math.ceil(f.toNumber()))},G$=(e,t,n)=>{var r;if(e.lte(0))return new ut(0);var i=[1,2,2.5,5],s=e.toNumber(),l=Math.floor(new ut(s).abs().log(10).toNumber()),c=new ut(10).pow(l),f=e.div(c).toNumber(),h=i.findIndex(y=>y>=f-1e-10);if(h===-1&&(c=c.mul(10),h=0),h+=n,h>=i.length){var p=Math.floor(h/i.length);h%=i.length,c=c.mul(new ut(10).pow(p))}var g=(r=i[h])!==null&&r!==void 0?r:1,v=new ut(g).mul(c);return t?v:new ut(Math.ceil(v.toNumber()))},lse=(e,t,n)=>{var r=new ut(1),i=new ut(e);if(!i.isint()&&n){var s=Math.abs(e);s<1?(r=new ut(10).pow(F$(e)-1),i=new ut(Math.floor(i.div(r).toNumber())).mul(r)):s>1&&(i=new ut(Math.floor(e)))}else e===0?i=new ut(Math.floor((t-1)/2)):n||(i=new ut(Math.floor(e)));for(var l=Math.floor((t-1)/2),c=[],f=0;f<t;f++)c.push(i.add(new ut(f-l).mul(r)).toNumber());return c},V$=function(t,n,r,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:gj;if(!Number.isFinite((n-t)/(r-1)))return{step:new ut(0),tickMin:new ut(0),tickMax:new ut(0)};var c=l(new ut(n).sub(t).div(r-1),i,s),f;t<=0&&n>=0?f=new ut(0):(f=new ut(t).add(n).div(2),f=f.sub(new ut(f).mod(c)));var h=Math.ceil(f.sub(t).div(c).toNumber()),p=Math.ceil(new ut(n).sub(f).div(c).toNumber()),g=h+p+1;return g>r?V$(t,n,r,i,s+1,l):(g<r&&(p=n>0?p+(r-g):p,h=n>0?h:h+(r-g)),{step:c,tickMin:f.sub(new ut(h).mul(c)),tickMax:f.add(new ut(p).mul(c))})},fP=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(i,2),[f,h]=H$([n,r]);if(f===-1/0||h===1/0){var p=h===1/0?[f,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),h];return n>r?p.reverse():p}if(f===h)return lse(f,i,s);var g=l==="snap125"?G$:gj,{step:v,tickMin:y,tickMax:S}=V$(f,h,c,s,0,g),w=K$(y,S.add(new ut(.1).mul(v)),v);return n>r?w.reverse():w},hP=function(t,n){var[r,i]=t,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[c,f]=H$([r,i]);if(c===-1/0||f===1/0)return[r,i];if(c===f)return[c];var h=l==="snap125"?G$:gj,p=Math.max(n,2),g=h(new ut(f).sub(c).div(p-1),s,0),v=[...K$(new ut(c),new ut(f),g),f];return s===!1&&(v=v.map(y=>Math.round(y))),r>i?v.reverse():v},cse=e=>e.rootProps.barCategoryGap,wv=e=>e.rootProps.stackOffset,Z$=e=>e.rootProps.reverseStackOrder,vj=e=>e.options.chartName,yj=e=>e.rootProps.syncId,Y$=e=>e.rootProps.syncMethod,bj=e=>e.options.eventEmitter,use=e=>e.rootProps.baseValue,Yn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},So={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},qi={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Sv=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function jv(e,t,n){if(n!=="auto")return n;if(e!=null)return na(e,t)?"category":"number"}function pP(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 Wm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pP(Object(n),!0).forEach(function(r){dse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dse(e,t,n){return(t=fse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fse(e){var t=hse(e,"string");return typeof t=="symbol"?t:t+""}function hse(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 mP={allowDataOverflow:So.allowDataOverflow,allowDecimals:So.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:So.angleAxisId,includeHidden:!1,name:void 0,reversed:So.reversed,scale:So.scale,tick:So.tick,tickCount:void 0,ticks:void 0,type:So.type,unit:void 0,niceTicks:"auto"},gP={allowDataOverflow:qi.allowDataOverflow,allowDecimals:qi.allowDecimals,allowDuplicatedCategory:qi.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:qi.radiusAxisId,includeHidden:qi.includeHidden,name:void 0,reversed:qi.reversed,scale:qi.scale,tick:qi.tick,tickCount:qi.tickCount,ticks:void 0,type:qi.type,unit:void 0,niceTicks:"auto"},pse=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},xj=te([pse,y$],(e,t)=>{var n;if(e!=null)return e;var r=(n=jv(t,"angleAxis",mP.type))!==null&&n!==void 0?n:"category";return Wm(Wm({},mP),{},{type:r})}),mse=(e,t)=>e.polarAxis.radiusAxis[t],wj=te([mse,y$],(e,t)=>{var n;if(e!=null)return e;var r=(n=jv(t,"radiusAxis",gP.type))!==null&&n!==void 0?n:"category";return Wm(Wm({},gP),{},{type:r})}),Nv=e=>e.polarOptions,Sj=te([Ua,Ba,qn],$ae),W$=te([Nv,Sj],(e,t)=>{if(e!=null)return Fs(e.innerRadius,t,0)}),Q$=te([Nv,Sj],(e,t)=>{if(e!=null)return Fs(e.outerRadius,t,t*.8)}),gse=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},X$=te([Nv],gse);te([xj,X$],Sv);var J$=te([Sj,W$,Q$],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});te([wj,J$],Sv);var e5=te([qt,Nv,W$,Q$,Ua,Ba],(e,t,n,r,i,s)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:l,cy:c,startAngle:f,endAngle:h}=t;return{cx:Fs(l,i,i/2),cy:Fs(c,s,s/2),innerRadius:n,outerRadius:r,startAngle:f,endAngle:h,clockWise:!1}}}),_n=(e,t)=>t,Cv=(e,t,n)=>n;function jj(e){return e?.id}function t5(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:s}=n,l=new Map;return e.forEach(c=>{var f,h=(f=c.data)!==null&&f!==void 0?f:r;if(!(h==null||h.length===0)){var p=jj(c);h.forEach((g,v)=>{var y=s==null||i?v:String(On(g,s,null)),S=On(g,c.dataKey,0),w;l.has(y)?w=l.get(y):w={},Object.assign(w,{[p]:S}),l.set(y,w)})}}),Array.from(l.values())}function Nj(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Ov=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function _v(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function vse(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 kn=e=>{var t=qt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},su=e=>e.tooltip.settings.axisId;function Cj(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(s){function l(){return s.apply(this,arguments)}return l.toString=function(){return s.toString()},l})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(s){var l=i[0],c=i[1];return l<=c?s>=l&&s<=c:s>=c&&s<=l},bandwidth:n?()=>n.call(e):void 0,ticks:t?s=>t.call(e,s):void 0,map:(s,l)=>{var c=e(s);if(c!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var f=e.bandwidth();switch(l.position){case"middle":c+=f/2;break;case"end":c+=f;break}}return c}}}}}var yse=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Yi(t)){for(var n,r,i=0;i<t.length;i++){var s=t[i];We(s)&&((n===void 0||s<n)&&(n=s),(r===void 0||s>r)&&(r=s))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function Ls(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function bse(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Oj(e){let t,n,r;e.length!==2?(t=Ls,n=(c,f)=>Ls(e(c),f),r=(c,f)=>e(c)-f):(t=e===Ls||e===bse?e:xse,n=e,r=e);function i(c,f,h=0,p=c.length){if(h<p){if(t(f,f)!==0)return p;do{const g=h+p>>>1;n(c[g],f)<0?h=g+1:p=g}while(h<p)}return h}function s(c,f,h=0,p=c.length){if(h<p){if(t(f,f)!==0)return p;do{const g=h+p>>>1;n(c[g],f)<=0?h=g+1:p=g}while(h<p)}return h}function l(c,f,h=0,p=c.length){const g=i(c,f,h,p-1);return g>h&&r(c[g-1],f)>-r(c[g],f)?g-1:g}return{left:i,center:l,right:s}}function xse(){return 0}function n5(e){return e===null?NaN:+e}function*wse(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Sse=Oj(Ls),Of=Sse.right;Oj(n5).center;class vP extends Map{constructor(t,n=Cse){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(yP(this,t))}has(t){return super.has(yP(this,t))}set(t,n){return super.set(jse(this,t),n)}delete(t){return super.delete(Nse(this,t))}}function yP({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function jse({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Nse({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Cse(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Ose(e=Ls){if(e===Ls)return r5;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 r5(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const _se=Math.sqrt(50),kse=Math.sqrt(10),Ase=Math.sqrt(2);function Qm(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),l=s>=_se?10:s>=kse?5:s>=Ase?2:1;let c,f,h;return i<0?(h=Math.pow(10,-i)/l,c=Math.round(e*h),f=Math.round(t*h),c/h<e&&++c,f/h>t&&--f,h=-h):(h=Math.pow(10,i)*l,c=Math.round(e/h),f=Math.round(t/h),c*h<e&&++c,f*h>t&&--f),f<c&&.5<=n&&n<2?Qm(e,t,n*2):[c,f,h]}function wS(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,l]=r?Qm(t,e,n):Qm(e,t,n);if(!(s>=i))return[];const c=s-i+1,f=new Array(c);if(r)if(l<0)for(let h=0;h<c;++h)f[h]=(s-h)/-l;else for(let h=0;h<c;++h)f[h]=(s-h)*l;else if(l<0)for(let h=0;h<c;++h)f[h]=(i+h)/-l;else for(let h=0;h<c;++h)f[h]=(i+h)*l;return f}function SS(e,t,n){return t=+t,e=+e,n=+n,Qm(e,t,n)[2]}function jS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?SS(t,e,n):SS(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function bP(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function xP(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function i5(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?r5:Ose(i);r>n;){if(r-n>600){const f=r-n+1,h=t-n+1,p=Math.log(f),g=.5*Math.exp(2*p/3),v=.5*Math.sqrt(p*g*(f-g)/f)*(h-f/2<0?-1:1),y=Math.max(n,Math.floor(t-h*g/f+v)),S=Math.min(r,Math.floor(t+(f-h)*g/f+v));i5(e,t,y,S,i)}const s=e[t];let l=n,c=r;for(md(e,n,t),i(e[r],s)>0&&md(e,n,r);l<c;){for(md(e,l,c),++l,--c;i(e[l],s)<0;)++l;for(;i(e[c],s)>0;)--c}i(e[n],s)===0?md(e,n,c):(++c,md(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function md(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Ese(e,t,n){if(e=Float64Array.from(wse(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return xP(e);if(t>=1)return bP(e);var r,i=(r-1)*t,s=Math.floor(i),l=bP(i5(e,s).subarray(0,s+1)),c=xP(e.subarray(s+1));return l+(c-l)*(i-s)}}function Tse(e,t,n=n5){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,s=Math.floor(i),l=+n(e[s],s,e),c=+n(e[s+1],s+1,e);return l+(c-l)*(i-s)}}function Pse(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function hi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function qa(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 NS=Symbol("implicit");function _j(){var e=new vP,t=[],n=[],r=NS;function i(s){let l=e.get(s);if(l===void 0){if(r!==NS)return r;e.set(s,l=t.push(s)-1)}return n[l%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new vP;for(const l of s)e.has(l)||e.set(l,t.push(l)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return _j(t,n).unknown(r)},hi.apply(i,arguments),i}function kj(){var e=_j().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,l,c=!1,f=0,h=0,p=.5;delete e.unknown;function g(){var v=t().length,y=i<r,S=y?i:r,w=y?r:i;s=(w-S)/Math.max(1,v-f+h*2),c&&(s=Math.floor(s)),S+=(w-S-s*(v-f))*p,l=s*(1-f),c&&(S=Math.round(S),l=Math.round(l));var N=Pse(v).map(function(C){return S+s*C});return n(y?N.reverse():N)}return e.domain=function(v){return arguments.length?(t(v),g()):t()},e.range=function(v){return arguments.length?([r,i]=v,r=+r,i=+i,g()):[r,i]},e.rangeRound=function(v){return[r,i]=v,r=+r,i=+i,c=!0,g()},e.bandwidth=function(){return l},e.step=function(){return s},e.round=function(v){return arguments.length?(c=!!v,g()):c},e.padding=function(v){return arguments.length?(f=Math.min(1,h=+v),g()):f},e.paddingInner=function(v){return arguments.length?(f=Math.min(1,v),g()):f},e.paddingOuter=function(v){return arguments.length?(h=+v,g()):h},e.align=function(v){return arguments.length?(p=Math.max(0,Math.min(1,v)),g()):p},e.copy=function(){return kj(t(),[r,i]).round(c).paddingInner(f).paddingOuter(h).align(p)},hi.apply(g(),arguments)}function a5(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return a5(t())},e}function zse(){return a5(kj.apply(null,arguments).paddingInner(1))}function Aj(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function s5(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function _f(){}var nf=.7,Xm=1/nf,Ec="\\s*([+-]?\\d+)\\s*",rf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Wi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Mse=/^#([0-9a-f]{3,8})$/,Rse=new RegExp(`^rgb\\(${Ec},${Ec},${Ec}\\)$`),Dse=new RegExp(`^rgb\\(${Wi},${Wi},${Wi}\\)$`),Ise=new RegExp(`^rgba\\(${Ec},${Ec},${Ec},${rf}\\)$`),Lse=new RegExp(`^rgba\\(${Wi},${Wi},${Wi},${rf}\\)$`),$se=new RegExp(`^hsl\\(${rf},${Wi},${Wi}\\)$`),Use=new RegExp(`^hsla\\(${rf},${Wi},${Wi},${rf}\\)$`),wP={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};Aj(_f,af,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:SP,formatHex:SP,formatHex8:Bse,formatHsl:qse,formatRgb:jP,toString:jP});function SP(){return this.rgb().formatHex()}function Bse(){return this.rgb().formatHex8()}function qse(){return o5(this).formatHsl()}function jP(){return this.rgb().formatRgb()}function af(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Mse.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?NP(t):n===3?new yr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Tp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Tp(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=Rse.exec(e))?new yr(t[1],t[2],t[3],1):(t=Dse.exec(e))?new yr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ise.exec(e))?Tp(t[1],t[2],t[3],t[4]):(t=Lse.exec(e))?Tp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=$se.exec(e))?_P(t[1],t[2]/100,t[3]/100,1):(t=Use.exec(e))?_P(t[1],t[2]/100,t[3]/100,t[4]):wP.hasOwnProperty(e)?NP(wP[e]):e==="transparent"?new yr(NaN,NaN,NaN,0):null}function NP(e){return new yr(e>>16&255,e>>8&255,e&255,1)}function Tp(e,t,n,r){return r<=0&&(e=t=n=NaN),new yr(e,t,n,r)}function Fse(e){return e instanceof _f||(e=af(e)),e?(e=e.rgb(),new yr(e.r,e.g,e.b,e.opacity)):new yr}function CS(e,t,n,r){return arguments.length===1?Fse(e):new yr(e,t,n,r??1)}function yr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Aj(yr,CS,s5(_f,{brighter(e){return e=e==null?Xm:Math.pow(Xm,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?nf:Math.pow(nf,e),new yr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yr(Vo(this.r),Vo(this.g),Vo(this.b),Jm(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:CP,formatHex:CP,formatHex8:Kse,formatRgb:OP,toString:OP}));function CP(){return`#${Io(this.r)}${Io(this.g)}${Io(this.b)}`}function Kse(){return`#${Io(this.r)}${Io(this.g)}${Io(this.b)}${Io((isNaN(this.opacity)?1:this.opacity)*255)}`}function OP(){const e=Jm(this.opacity);return`${e===1?"rgb(":"rgba("}${Vo(this.r)}, ${Vo(this.g)}, ${Vo(this.b)}${e===1?")":`, ${e})`}`}function Jm(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Vo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Io(e){return e=Vo(e),(e<16?"0":"")+e.toString(16)}function _P(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ni(e,t,n,r)}function o5(e){if(e instanceof Ni)return new Ni(e.h,e.s,e.l,e.opacity);if(e instanceof _f||(e=af(e)),!e)return new Ni;if(e instanceof Ni)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),l=NaN,c=s-i,f=(s+i)/2;return c?(t===s?l=(n-r)/c+(n<r)*6:n===s?l=(r-t)/c+2:l=(t-n)/c+4,c/=f<.5?s+i:2-s-i,l*=60):c=f>0&&f<1?0:l,new Ni(l,c,f,e.opacity)}function Hse(e,t,n,r){return arguments.length===1?o5(e):new Ni(e,t,n,r??1)}function Ni(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Aj(Ni,Hse,s5(_f,{brighter(e){return e=e==null?Xm:Math.pow(Xm,e),new Ni(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?nf:Math.pow(nf,e),new Ni(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 yr(Fx(e>=240?e-240:e+120,i,r),Fx(e,i,r),Fx(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ni(kP(this.h),Pp(this.s),Pp(this.l),Jm(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=Jm(this.opacity);return`${e===1?"hsl(":"hsla("}${kP(this.h)}, ${Pp(this.s)*100}%, ${Pp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kP(e){return e=(e||0)%360,e<0?e+360:e}function Pp(e){return Math.max(0,Math.min(1,e||0))}function Fx(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 Ej=e=>()=>e;function Gse(e,t){return function(n){return e+n*t}}function Vse(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 Zse(e){return(e=+e)==1?l5:function(t,n){return n-t?Vse(t,n,e):Ej(isNaN(t)?n:t)}}function l5(e,t){var n=t-e;return n?Gse(e,n):Ej(isNaN(e)?t:e)}const AP=(function e(t){var n=Zse(t);function r(i,s){var l=n((i=CS(i)).r,(s=CS(s)).r),c=n(i.g,s.g),f=n(i.b,s.b),h=l5(i.opacity,s.opacity);return function(p){return i.r=l(p),i.g=c(p),i.b=f(p),i.opacity=h(p),i+""}}return r.gamma=e,r})(1);function Yse(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function Wse(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Qse(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),l;for(l=0;l<r;++l)i[l]=ou(e[l],t[l]);for(;l<n;++l)s[l]=t[l];return function(c){for(l=0;l<r;++l)s[l]=i[l](c);return s}}function Xse(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function eg(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Jse(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]=ou(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var OS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Kx=new RegExp(OS.source,"g");function eoe(e){return function(){return e}}function toe(e){return function(t){return e(t)+""}}function noe(e,t){var n=OS.lastIndex=Kx.lastIndex=0,r,i,s,l=-1,c=[],f=[];for(e=e+"",t=t+"";(r=OS.exec(e))&&(i=Kx.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),c[l]?c[l]+=s:c[++l]=s),(r=r[0])===(i=i[0])?c[l]?c[l]+=i:c[++l]=i:(c[++l]=null,f.push({i:l,x:eg(r,i)})),n=Kx.lastIndex;return n<t.length&&(s=t.slice(n),c[l]?c[l]+=s:c[++l]=s),c.length<2?f[0]?toe(f[0].x):eoe(t):(t=f.length,function(h){for(var p=0,g;p<t;++p)c[(g=f[p]).i]=g.x(h);return c.join("")})}function ou(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ej(t):(n==="number"?eg:n==="string"?(r=af(t))?(t=r,AP):noe:t instanceof af?AP:t instanceof Date?Xse:Wse(t)?Yse:Array.isArray(t)?Qse:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Jse:eg)(e,t)}function Tj(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function roe(e,t){t===void 0&&(t=e,e=ou);for(var n=0,r=t.length-1,i=t[0],s=new Array(r<0?0:r);n<r;)s[n]=e(i,i=t[++n]);return function(l){var c=Math.max(0,Math.min(r-1,Math.floor(l*=r)));return s[c](l-c)}}function ioe(e){return function(){return e}}function tg(e){return+e}var EP=[0,1];function nr(e){return e}function _S(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:ioe(isNaN(t)?NaN:.5)}function aoe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function soe(e,t,n){var r=e[0],i=e[1],s=t[0],l=t[1];return i<r?(r=_S(i,r),s=n(l,s)):(r=_S(r,i),s=n(s,l)),function(c){return s(r(c))}}function ooe(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),l=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<r;)i[l]=_S(e[l],e[l+1]),s[l]=n(t[l],t[l+1]);return function(c){var f=Of(e,c,1,r)-1;return s[f](i[f](c))}}function kf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function kv(){var e=EP,t=EP,n=ou,r,i,s,l=nr,c,f,h;function p(){var v=Math.min(e.length,t.length);return l!==nr&&(l=aoe(e[0],e[v-1])),c=v>2?ooe:soe,f=h=null,g}function g(v){return v==null||isNaN(v=+v)?s:(f||(f=c(e.map(r),t,n)))(r(l(v)))}return g.invert=function(v){return l(i((h||(h=c(t,e.map(r),eg)))(v)))},g.domain=function(v){return arguments.length?(e=Array.from(v,tg),p()):e.slice()},g.range=function(v){return arguments.length?(t=Array.from(v),p()):t.slice()},g.rangeRound=function(v){return t=Array.from(v),n=Tj,p()},g.clamp=function(v){return arguments.length?(l=v?!0:nr,p()):l!==nr},g.interpolate=function(v){return arguments.length?(n=v,p()):n},g.unknown=function(v){return arguments.length?(s=v,g):s},function(v,y){return r=v,i=y,p()}}function Pj(){return kv()(nr,nr)}function loe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ng(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 Bc(e){return e=ng(Math.abs(e)),e?e[1]:NaN}function coe(e,t){return function(n,r){for(var i=n.length,s=[],l=0,c=e[0],f=0;i>0&&c>0&&(f+c+1>r&&(c=Math.max(1,r-f)),s.push(n.substring(i-=c,i+c)),!((f+=c+1)>r));)c=e[l=(l+1)%e.length];return s.reverse().join(t)}}function uoe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var doe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function sf(e){if(!(t=doe.exec(e)))throw new Error("invalid format: "+e);var t;return new zj({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]})}sf.prototype=zj.prototype;function zj(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+""}zj.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 foe(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 rg;function hoe(e,t){var n=ng(e,t);if(!n)return rg=void 0,e.toPrecision(t);var r=n[0],i=n[1],s=i-(rg=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return s===l?r:s>l?r+new Array(s-l+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+ng(e,Math.max(0,t+s-1))[0]}function TP(e,t){var n=ng(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 PP={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:loe,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)=>TP(e*100,t),r:TP,s:hoe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function zP(e){return e}var MP=Array.prototype.map,RP=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function poe(e){var t=e.grouping===void 0||e.thousands===void 0?zP:coe(MP.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?zP:uoe(MP.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function h(g,v){g=sf(g);var y=g.fill,S=g.align,w=g.sign,N=g.symbol,C=g.zero,E=g.width,A=g.comma,O=g.precision,P=g.trim,z=g.type;z==="n"?(A=!0,z="g"):PP[z]||(O===void 0&&(O=12),P=!0,z="g"),(C||y==="0"&&S==="=")&&(C=!0,y="0",S="=");var _=(v&&v.prefix!==void 0?v.prefix:"")+(N==="$"?n:N==="#"&&/[boxX]/.test(z)?"0"+z.toLowerCase():""),T=(N==="$"?r:/[%p]/.test(z)?l:"")+(v&&v.suffix!==void 0?v.suffix:""),R=PP[z],B=/[defgprs%]/.test(z);O=O===void 0?6:/[gprs]/.test(z)?Math.max(1,Math.min(21,O)):Math.max(0,Math.min(20,O));function $(L){var ne=_,he=T,ge,H,ie;if(z==="c")he=R(L)+he,L="";else{L=+L;var pe=L<0||1/L<0;if(L=isNaN(L)?f:R(Math.abs(L),O),P&&(L=foe(L)),pe&&+L==0&&w!=="+"&&(pe=!1),ne=(pe?w==="("?w:c:w==="-"||w==="("?"":w)+ne,he=(z==="s"&&!isNaN(L)&&rg!==void 0?RP[8+rg/3]:"")+he+(pe&&w==="("?")":""),B){for(ge=-1,H=L.length;++ge<H;)if(ie=L.charCodeAt(ge),48>ie||ie>57){he=(ie===46?i+L.slice(ge+1):L.slice(ge))+he,L=L.slice(0,ge);break}}}A&&!C&&(L=t(L,1/0));var we=ne.length+L.length+he.length,q=we<E?new Array(E-we+1).join(y):"";switch(A&&C&&(L=t(q+L,q.length?E-he.length:1/0),q=""),S){case"<":L=ne+L+he+q;break;case"=":L=ne+q+L+he;break;case"^":L=q.slice(0,we=q.length>>1)+ne+L+he+q.slice(we);break;default:L=q+ne+L+he;break}return s(L)}return $.toString=function(){return g+""},$}function p(g,v){var y=Math.max(-8,Math.min(8,Math.floor(Bc(v)/3)))*3,S=Math.pow(10,-y),w=h((g=sf(g),g.type="f",g),{suffix:RP[8+y/3]});return function(N){return w(S*N)}}return{format:h,formatPrefix:p}}var zp,Mj,c5;moe({thousands:",",grouping:[3],currency:["$",""]});function moe(e){return zp=poe(e),Mj=zp.format,c5=zp.formatPrefix,zp}function goe(e){return Math.max(0,-Bc(Math.abs(e)))}function voe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Bc(t)/3)))*3-Bc(Math.abs(e)))}function yoe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Bc(t)-Bc(e))+1}function u5(e,t,n,r){var i=jS(e,t,n),s;switch(r=sf(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=voe(i,l))&&(r.precision=s),c5(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=yoe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=goe(i))&&(r.precision=s-(r.type==="%")*2);break}}return Mj(r)}function Qs(e){var t=e.domain;return e.ticks=function(n){var r=t();return wS(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return u5(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,l=r[i],c=r[s],f,h,p=10;for(c<l&&(h=l,l=c,c=h,h=i,i=s,s=h);p-- >0;){if(h=SS(l,c,n),h===f)return r[i]=l,r[s]=c,t(r);if(h>0)l=Math.floor(l/h)*h,c=Math.ceil(c/h)*h;else if(h<0)l=Math.ceil(l*h)/h,c=Math.floor(c*h)/h;else break;f=h}return e},e}function d5(){var e=Pj();return e.copy=function(){return kf(e,d5())},hi.apply(e,arguments),Qs(e)}function f5(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,tg),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return f5(e).unknown(t)},e=arguments.length?Array.from(e,tg):[0,1],Qs(n)}function h5(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],l;return s<i&&(l=n,n=r,r=l,l=i,i=s,s=l),e[n]=t.floor(i),e[r]=t.ceil(s),e}function DP(e){return Math.log(e)}function IP(e){return Math.exp(e)}function boe(e){return-Math.log(-e)}function xoe(e){return-Math.exp(-e)}function woe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Soe(e){return e===10?woe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function joe(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 LP(e){return(t,n)=>-e(-t,n)}function Rj(e){const t=e(DP,IP),n=t.domain;let r=10,i,s;function l(){return i=joe(r),s=Soe(r),n()[0]<0?(i=LP(i),s=LP(s),e(boe,xoe)):e(DP,IP),t}return t.base=function(c){return arguments.length?(r=+c,l()):r},t.domain=function(c){return arguments.length?(n(c),l()):n()},t.ticks=c=>{const f=n();let h=f[0],p=f[f.length-1];const g=p<h;g&&([h,p]=[p,h]);let v=i(h),y=i(p),S,w;const N=c==null?10:+c;let C=[];if(!(r%1)&&y-v<N){if(v=Math.floor(v),y=Math.ceil(y),h>0){for(;v<=y;++v)for(S=1;S<r;++S)if(w=v<0?S/s(-v):S*s(v),!(w<h)){if(w>p)break;C.push(w)}}else for(;v<=y;++v)for(S=r-1;S>=1;--S)if(w=v>0?S/s(-v):S*s(v),!(w<h)){if(w>p)break;C.push(w)}C.length*2<N&&(C=wS(h,p,N))}else C=wS(v,y,Math.min(y-v,N)).map(s);return g?C.reverse():C},t.tickFormat=(c,f)=>{if(c==null&&(c=10),f==null&&(f=r===10?"s":","),typeof f!="function"&&(!(r%1)&&(f=sf(f)).precision==null&&(f.trim=!0),f=Mj(f)),c===1/0)return f;const h=Math.max(1,r*c/t.ticks().length);return p=>{let g=p/s(Math.round(i(p)));return g*r<r-.5&&(g*=r),g<=h?f(p):""}},t.nice=()=>n(h5(n(),{floor:c=>s(Math.floor(i(c))),ceil:c=>s(Math.ceil(i(c)))})),t}function p5(){const e=Rj(kv()).domain([1,10]);return e.copy=()=>kf(e,p5()).base(e.base()),hi.apply(e,arguments),e}function $P(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function UP(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Dj(e){var t=1,n=e($P(t),UP(t));return n.constant=function(r){return arguments.length?e($P(t=+r),UP(t)):t},Qs(n)}function m5(){var e=Dj(kv());return e.copy=function(){return kf(e,m5()).constant(e.constant())},hi.apply(e,arguments)}function BP(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Noe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Coe(e){return e<0?-e*e:e*e}function Ij(e){var t=e(nr,nr),n=1;function r(){return n===1?e(nr,nr):n===.5?e(Noe,Coe):e(BP(n),BP(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Qs(t)}function Lj(){var e=Ij(kv());return e.copy=function(){return kf(e,Lj()).exponent(e.exponent())},hi.apply(e,arguments),e}function Ooe(){return Lj.apply(null,arguments).exponent(.5)}function qP(e){return Math.sign(e)*e*e}function _oe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function g5(){var e=Pj(),t=[0,1],n=!1,r;function i(s){var l=_oe(e(s));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(s){return e.invert(qP(s))},i.domain=function(s){return arguments.length?(e.domain(s),i):e.domain()},i.range=function(s){return arguments.length?(e.range((t=Array.from(s,tg)).map(qP)),i):t.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(n=!!s,i):n},i.clamp=function(s){return arguments.length?(e.clamp(s),i):e.clamp()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return g5(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},hi.apply(i,arguments),Qs(i)}function v5(){var e=[],t=[],n=[],r;function i(){var l=0,c=Math.max(1,t.length);for(n=new Array(c-1);++l<c;)n[l-1]=Tse(e,l/c);return s}function s(l){return l==null||isNaN(l=+l)?r:t[Of(n,l)]}return s.invertExtent=function(l){var c=t.indexOf(l);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},s.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let c of l)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(Ls),i()},s.range=function(l){return arguments.length?(t=Array.from(l),i()):t.slice()},s.unknown=function(l){return arguments.length?(r=l,s):r},s.quantiles=function(){return n.slice()},s.copy=function(){return v5().domain(e).range(t).unknown(r)},hi.apply(s,arguments)}function y5(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function l(f){return f!=null&&f<=f?i[Of(r,f,0,n)]:s}function c(){var f=-1;for(r=new Array(n);++f<n;)r[f]=((f+1)*t-(f-n)*e)/(n+1);return l}return l.domain=function(f){return arguments.length?([e,t]=f,e=+e,t=+t,c()):[e,t]},l.range=function(f){return arguments.length?(n=(i=Array.from(f)).length-1,c()):i.slice()},l.invertExtent=function(f){var h=i.indexOf(f);return h<0?[NaN,NaN]:h<1?[e,r[0]]:h>=n?[r[n-1],t]:[r[h-1],r[h]]},l.unknown=function(f){return arguments.length&&(s=f),l},l.thresholds=function(){return r.slice()},l.copy=function(){return y5().domain([e,t]).range(i).unknown(s)},hi.apply(Qs(l),arguments)}function b5(){var e=[.5],t=[0,1],n,r=1;function i(s){return s!=null&&s<=s?t[Of(e,s,0,r)]:n}return i.domain=function(s){return arguments.length?(e=Array.from(s),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var l=t.indexOf(s);return[e[l-1],e[l]]},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return b5().domain(e).range(t).unknown(n)},hi.apply(i,arguments)}const Hx=new Date,Gx=new Date;function Sn(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const l=i(s),c=i.ceil(s);return s-l<c-s?l:c},i.offset=(s,l)=>(t(s=new Date(+s),l==null?1:Math.floor(l)),s),i.range=(s,l,c)=>{const f=[];if(s=i.ceil(s),c=c==null?1:Math.floor(c),!(s<l)||!(c>0))return f;let h;do f.push(h=new Date(+s)),t(s,c),e(s);while(h<s&&s<l);return f},i.filter=s=>Sn(l=>{if(l>=l)for(;e(l),!s(l);)l.setTime(l-1)},(l,c)=>{if(l>=l)if(c<0)for(;++c<=0;)for(;t(l,-1),!s(l););else for(;--c>=0;)for(;t(l,1),!s(l););}),n&&(i.count=(s,l)=>(Hx.setTime(+s),Gx.setTime(+l),e(Hx),e(Gx),Math.floor(n(Hx,Gx))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?l=>r(l)%s===0:l=>i.count(0,l)%s===0):i)),i}const ig=Sn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ig.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Sn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ig);ig.range;const Ea=1e3,ii=Ea*60,Ta=ii*60,Da=Ta*24,$j=Da*7,FP=Da*30,Vx=Da*365,Lo=Sn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ea)},(e,t)=>(t-e)/Ea,e=>e.getUTCSeconds());Lo.range;const Uj=Sn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ea)},(e,t)=>{e.setTime(+e+t*ii)},(e,t)=>(t-e)/ii,e=>e.getMinutes());Uj.range;const Bj=Sn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ii)},(e,t)=>(t-e)/ii,e=>e.getUTCMinutes());Bj.range;const qj=Sn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ea-e.getMinutes()*ii)},(e,t)=>{e.setTime(+e+t*Ta)},(e,t)=>(t-e)/Ta,e=>e.getHours());qj.range;const Fj=Sn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ta)},(e,t)=>(t-e)/Ta,e=>e.getUTCHours());Fj.range;const Af=Sn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ii)/Da,e=>e.getDate()-1);Af.range;const Av=Sn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Da,e=>e.getUTCDate()-1);Av.range;const x5=Sn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Da,e=>Math.floor(e/Da));x5.range;function ml(e){return Sn(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())*ii)/$j)}const Ev=ml(0),ag=ml(1),koe=ml(2),Aoe=ml(3),qc=ml(4),Eoe=ml(5),Toe=ml(6);Ev.range;ag.range;koe.range;Aoe.range;qc.range;Eoe.range;Toe.range;function gl(e){return Sn(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)/$j)}const Tv=gl(0),sg=gl(1),Poe=gl(2),zoe=gl(3),Fc=gl(4),Moe=gl(5),Roe=gl(6);Tv.range;sg.range;Poe.range;zoe.range;Fc.range;Moe.range;Roe.range;const Kj=Sn(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());Kj.range;const Hj=Sn(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());Hj.range;const Ia=Sn(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());Ia.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Sn(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)});Ia.range;const La=Sn(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());La.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Sn(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)});La.range;function w5(e,t,n,r,i,s){const l=[[Lo,1,Ea],[Lo,5,5*Ea],[Lo,15,15*Ea],[Lo,30,30*Ea],[s,1,ii],[s,5,5*ii],[s,15,15*ii],[s,30,30*ii],[i,1,Ta],[i,3,3*Ta],[i,6,6*Ta],[i,12,12*Ta],[r,1,Da],[r,2,2*Da],[n,1,$j],[t,1,FP],[t,3,3*FP],[e,1,Vx]];function c(h,p,g){const v=p<h;v&&([h,p]=[p,h]);const y=g&&typeof g.range=="function"?g:f(h,p,g),S=y?y.range(h,+p+1):[];return v?S.reverse():S}function f(h,p,g){const v=Math.abs(p-h)/g,y=Oj(([,,N])=>N).right(l,v);if(y===l.length)return e.every(jS(h/Vx,p/Vx,g));if(y===0)return ig.every(Math.max(jS(h,p,g),1));const[S,w]=l[v/l[y-1][2]<l[y][2]/v?y-1:y];return S.every(w)}return[c,f]}const[Doe,Ioe]=w5(La,Hj,Tv,x5,Fj,Bj),[Loe,$oe]=w5(Ia,Kj,Ev,Af,qj,Uj);function Zx(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 Yx(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 gd(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Uoe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,l=e.shortDays,c=e.months,f=e.shortMonths,h=vd(i),p=yd(i),g=vd(s),v=yd(s),y=vd(l),S=yd(l),w=vd(c),N=yd(c),C=vd(f),E=yd(f),A={a:ie,A:pe,b:we,B:q,c:null,d:YP,e:YP,f:cle,g:ble,G:wle,H:sle,I:ole,j:lle,L:S5,m:ule,M:dle,p:D,q:G,Q:XP,s:JP,S:fle,u:hle,U:ple,V:mle,w:gle,W:vle,x:null,X:null,y:yle,Y:xle,Z:Sle,"%":QP},O={a:ae,A:Y,b:W,B:oe,c:null,d:WP,e:WP,f:Ole,g:Dle,G:Lle,H:jle,I:Nle,j:Cle,L:N5,m:_le,M:kle,p:xe,q:Se,Q:XP,s:JP,S:Ale,u:Ele,U:Tle,V:Ple,w:zle,W:Mle,x:null,X:null,y:Rle,Y:Ile,Z:$le,"%":QP},P={a:B,A:$,b:L,B:ne,c:he,d:VP,e:VP,f:nle,g:GP,G:HP,H:ZP,I:ZP,j:Xoe,L:tle,m:Qoe,M:Joe,p:R,q:Woe,Q:ile,s:ale,S:ele,u:Hoe,U:Goe,V:Voe,w:Koe,W:Zoe,x:ge,X:H,y:GP,Y:HP,Z:Yoe,"%":rle};A.x=z(n,A),A.X=z(r,A),A.c=z(t,A),O.x=z(n,O),O.X=z(r,O),O.c=z(t,O);function z(Q,le){return function(je){var V=[],De=-1,Ee=0,tt=Q.length,ve,Le,Fe;for(je instanceof Date||(je=new Date(+je));++De<tt;)Q.charCodeAt(De)===37&&(V.push(Q.slice(Ee,De)),(Le=KP[ve=Q.charAt(++De)])!=null?ve=Q.charAt(++De):Le=ve==="e"?" ":"0",(Fe=le[ve])&&(ve=Fe(je,Le)),V.push(ve),Ee=De+1);return V.push(Q.slice(Ee,De)),V.join("")}}function _(Q,le){return function(je){var V=gd(1900,void 0,1),De=T(V,Q,je+="",0),Ee,tt;if(De!=je.length)return null;if("Q"in V)return new Date(V.Q);if("s"in V)return new Date(V.s*1e3+("L"in V?V.L:0));if(le&&!("Z"in V)&&(V.Z=0),"p"in V&&(V.H=V.H%12+V.p*12),V.m===void 0&&(V.m="q"in V?V.q:0),"V"in V){if(V.V<1||V.V>53)return null;"w"in V||(V.w=1),"Z"in V?(Ee=Yx(gd(V.y,0,1)),tt=Ee.getUTCDay(),Ee=tt>4||tt===0?sg.ceil(Ee):sg(Ee),Ee=Av.offset(Ee,(V.V-1)*7),V.y=Ee.getUTCFullYear(),V.m=Ee.getUTCMonth(),V.d=Ee.getUTCDate()+(V.w+6)%7):(Ee=Zx(gd(V.y,0,1)),tt=Ee.getDay(),Ee=tt>4||tt===0?ag.ceil(Ee):ag(Ee),Ee=Af.offset(Ee,(V.V-1)*7),V.y=Ee.getFullYear(),V.m=Ee.getMonth(),V.d=Ee.getDate()+(V.w+6)%7)}else("W"in V||"U"in V)&&("w"in V||(V.w="u"in V?V.u%7:"W"in V?1:0),tt="Z"in V?Yx(gd(V.y,0,1)).getUTCDay():Zx(gd(V.y,0,1)).getDay(),V.m=0,V.d="W"in V?(V.w+6)%7+V.W*7-(tt+5)%7:V.w+V.U*7-(tt+6)%7);return"Z"in V?(V.H+=V.Z/100|0,V.M+=V.Z%100,Yx(V)):Zx(V)}}function T(Q,le,je,V){for(var De=0,Ee=le.length,tt=je.length,ve,Le;De<Ee;){if(V>=tt)return-1;if(ve=le.charCodeAt(De++),ve===37){if(ve=le.charAt(De++),Le=P[ve in KP?le.charAt(De++):ve],!Le||(V=Le(Q,je,V))<0)return-1}else if(ve!=je.charCodeAt(V++))return-1}return V}function R(Q,le,je){var V=h.exec(le.slice(je));return V?(Q.p=p.get(V[0].toLowerCase()),je+V[0].length):-1}function B(Q,le,je){var V=y.exec(le.slice(je));return V?(Q.w=S.get(V[0].toLowerCase()),je+V[0].length):-1}function $(Q,le,je){var V=g.exec(le.slice(je));return V?(Q.w=v.get(V[0].toLowerCase()),je+V[0].length):-1}function L(Q,le,je){var V=C.exec(le.slice(je));return V?(Q.m=E.get(V[0].toLowerCase()),je+V[0].length):-1}function ne(Q,le,je){var V=w.exec(le.slice(je));return V?(Q.m=N.get(V[0].toLowerCase()),je+V[0].length):-1}function he(Q,le,je){return T(Q,t,le,je)}function ge(Q,le,je){return T(Q,n,le,je)}function H(Q,le,je){return T(Q,r,le,je)}function ie(Q){return l[Q.getDay()]}function pe(Q){return s[Q.getDay()]}function we(Q){return f[Q.getMonth()]}function q(Q){return c[Q.getMonth()]}function D(Q){return i[+(Q.getHours()>=12)]}function G(Q){return 1+~~(Q.getMonth()/3)}function ae(Q){return l[Q.getUTCDay()]}function Y(Q){return s[Q.getUTCDay()]}function W(Q){return f[Q.getUTCMonth()]}function oe(Q){return c[Q.getUTCMonth()]}function xe(Q){return i[+(Q.getUTCHours()>=12)]}function Se(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var le=z(Q+="",A);return le.toString=function(){return Q},le},parse:function(Q){var le=_(Q+="",!1);return le.toString=function(){return Q},le},utcFormat:function(Q){var le=z(Q+="",O);return le.toString=function(){return Q},le},utcParse:function(Q){var le=_(Q+="",!0);return le.toString=function(){return Q},le}}}var KP={"-":"",_:" ",0:"0"},An=/^\s*\d+/,Boe=/^%/,qoe=/[\\^$*+?|[\]().{}]/g;function ht(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function Foe(e){return e.replace(qoe,"\\$&")}function vd(e){return new RegExp("^(?:"+e.map(Foe).join("|")+")","i")}function yd(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Koe(e,t,n){var r=An.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Hoe(e,t,n){var r=An.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Goe(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Voe(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Zoe(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function HP(e,t,n){var r=An.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function GP(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Yoe(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 Woe(e,t,n){var r=An.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Qoe(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function VP(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Xoe(e,t,n){var r=An.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ZP(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Joe(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ele(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function tle(e,t,n){var r=An.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function nle(e,t,n){var r=An.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function rle(e,t,n){var r=Boe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function ile(e,t,n){var r=An.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function ale(e,t,n){var r=An.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function YP(e,t){return ht(e.getDate(),t,2)}function sle(e,t){return ht(e.getHours(),t,2)}function ole(e,t){return ht(e.getHours()%12||12,t,2)}function lle(e,t){return ht(1+Af.count(Ia(e),e),t,3)}function S5(e,t){return ht(e.getMilliseconds(),t,3)}function cle(e,t){return S5(e,t)+"000"}function ule(e,t){return ht(e.getMonth()+1,t,2)}function dle(e,t){return ht(e.getMinutes(),t,2)}function fle(e,t){return ht(e.getSeconds(),t,2)}function hle(e){var t=e.getDay();return t===0?7:t}function ple(e,t){return ht(Ev.count(Ia(e)-1,e),t,2)}function j5(e){var t=e.getDay();return t>=4||t===0?qc(e):qc.ceil(e)}function mle(e,t){return e=j5(e),ht(qc.count(Ia(e),e)+(Ia(e).getDay()===4),t,2)}function gle(e){return e.getDay()}function vle(e,t){return ht(ag.count(Ia(e)-1,e),t,2)}function yle(e,t){return ht(e.getFullYear()%100,t,2)}function ble(e,t){return e=j5(e),ht(e.getFullYear()%100,t,2)}function xle(e,t){return ht(e.getFullYear()%1e4,t,4)}function wle(e,t){var n=e.getDay();return e=n>=4||n===0?qc(e):qc.ceil(e),ht(e.getFullYear()%1e4,t,4)}function Sle(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ht(t/60|0,"0",2)+ht(t%60,"0",2)}function WP(e,t){return ht(e.getUTCDate(),t,2)}function jle(e,t){return ht(e.getUTCHours(),t,2)}function Nle(e,t){return ht(e.getUTCHours()%12||12,t,2)}function Cle(e,t){return ht(1+Av.count(La(e),e),t,3)}function N5(e,t){return ht(e.getUTCMilliseconds(),t,3)}function Ole(e,t){return N5(e,t)+"000"}function _le(e,t){return ht(e.getUTCMonth()+1,t,2)}function kle(e,t){return ht(e.getUTCMinutes(),t,2)}function Ale(e,t){return ht(e.getUTCSeconds(),t,2)}function Ele(e){var t=e.getUTCDay();return t===0?7:t}function Tle(e,t){return ht(Tv.count(La(e)-1,e),t,2)}function C5(e){var t=e.getUTCDay();return t>=4||t===0?Fc(e):Fc.ceil(e)}function Ple(e,t){return e=C5(e),ht(Fc.count(La(e),e)+(La(e).getUTCDay()===4),t,2)}function zle(e){return e.getUTCDay()}function Mle(e,t){return ht(sg.count(La(e)-1,e),t,2)}function Rle(e,t){return ht(e.getUTCFullYear()%100,t,2)}function Dle(e,t){return e=C5(e),ht(e.getUTCFullYear()%100,t,2)}function Ile(e,t){return ht(e.getUTCFullYear()%1e4,t,4)}function Lle(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Fc(e):Fc.ceil(e),ht(e.getUTCFullYear()%1e4,t,4)}function $le(){return"+0000"}function QP(){return"%"}function XP(e){return+e}function JP(e){return Math.floor(+e/1e3)}var uc,O5,_5;Ule({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 Ule(e){return uc=Uoe(e),O5=uc.format,uc.parse,_5=uc.utcFormat,uc.utcParse,uc}function Ble(e){return new Date(e)}function qle(e){return e instanceof Date?+e:+new Date(+e)}function Gj(e,t,n,r,i,s,l,c,f,h){var p=Pj(),g=p.invert,v=p.domain,y=h(".%L"),S=h(":%S"),w=h("%I:%M"),N=h("%I %p"),C=h("%a %d"),E=h("%b %d"),A=h("%B"),O=h("%Y");function P(z){return(f(z)<z?y:c(z)<z?S:l(z)<z?w:s(z)<z?N:r(z)<z?i(z)<z?C:E:n(z)<z?A:O)(z)}return p.invert=function(z){return new Date(g(z))},p.domain=function(z){return arguments.length?v(Array.from(z,qle)):v().map(Ble)},p.ticks=function(z){var _=v();return e(_[0],_[_.length-1],z??10)},p.tickFormat=function(z,_){return _==null?P:h(_)},p.nice=function(z){var _=v();return(!z||typeof z.range!="function")&&(z=t(_[0],_[_.length-1],z??10)),z?v(h5(_,z)):p},p.copy=function(){return kf(p,Gj(e,t,n,r,i,s,l,c,f,h))},p}function Fle(){return hi.apply(Gj(Loe,$oe,Ia,Kj,Ev,Af,qj,Uj,Lo,O5).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Kle(){return hi.apply(Gj(Doe,Ioe,La,Hj,Tv,Av,Fj,Bj,Lo,_5).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Pv(){var e=0,t=1,n,r,i,s,l=nr,c=!1,f;function h(g){return g==null||isNaN(g=+g)?f:l(i===0?.5:(g=(s(g)-n)*i,c?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([e,t]=g,n=s(e=+e),r=s(t=+t),i=n===r?0:1/(r-n),h):[e,t]},h.clamp=function(g){return arguments.length?(c=!!g,h):c},h.interpolator=function(g){return arguments.length?(l=g,h):l};function p(g){return function(v){var y,S;return arguments.length?([y,S]=v,l=g(y,S),h):[l(0),l(1)]}}return h.range=p(ou),h.rangeRound=p(Tj),h.unknown=function(g){return arguments.length?(f=g,h):f},function(g){return s=g,n=g(e),r=g(t),i=n===r?0:1/(r-n),h}}function Xs(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function k5(){var e=Qs(Pv()(nr));return e.copy=function(){return Xs(e,k5())},qa.apply(e,arguments)}function A5(){var e=Rj(Pv()).domain([1,10]);return e.copy=function(){return Xs(e,A5()).base(e.base())},qa.apply(e,arguments)}function E5(){var e=Dj(Pv());return e.copy=function(){return Xs(e,E5()).constant(e.constant())},qa.apply(e,arguments)}function Vj(){var e=Ij(Pv());return e.copy=function(){return Xs(e,Vj()).exponent(e.exponent())},qa.apply(e,arguments)}function Hle(){return Vj.apply(null,arguments).exponent(.5)}function T5(){var e=[],t=nr;function n(r){if(r!=null&&!isNaN(r=+r))return t((Of(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(Ls),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,s)=>Ese(e,s/r))},n.copy=function(){return T5(t).domain(e)},qa.apply(n,arguments)}function zv(){var e=0,t=.5,n=1,r=1,i,s,l,c,f,h=nr,p,g=!1,v;function y(w){return isNaN(w=+w)?v:(w=.5+((w=+p(w))-s)*(r*w<r*s?c:f),h(g?Math.max(0,Math.min(1,w)):w))}y.domain=function(w){return arguments.length?([e,t,n]=w,i=p(e=+e),s=p(t=+t),l=p(n=+n),c=i===s?0:.5/(s-i),f=s===l?0:.5/(l-s),r=s<i?-1:1,y):[e,t,n]},y.clamp=function(w){return arguments.length?(g=!!w,y):g},y.interpolator=function(w){return arguments.length?(h=w,y):h};function S(w){return function(N){var C,E,A;return arguments.length?([C,E,A]=N,h=roe(w,[C,E,A]),y):[h(0),h(.5),h(1)]}}return y.range=S(ou),y.rangeRound=S(Tj),y.unknown=function(w){return arguments.length?(v=w,y):v},function(w){return p=w,i=w(e),s=w(t),l=w(n),c=i===s?0:.5/(s-i),f=s===l?0:.5/(l-s),r=s<i?-1:1,y}}function P5(){var e=Qs(zv()(nr));return e.copy=function(){return Xs(e,P5())},qa.apply(e,arguments)}function z5(){var e=Rj(zv()).domain([.1,1,10]);return e.copy=function(){return Xs(e,z5()).base(e.base())},qa.apply(e,arguments)}function M5(){var e=Dj(zv());return e.copy=function(){return Xs(e,M5()).constant(e.constant())},qa.apply(e,arguments)}function Zj(){var e=Ij(zv());return e.copy=function(){return Xs(e,Zj()).exponent(e.exponent())},qa.apply(e,arguments)}function Gle(){return Zj.apply(null,arguments).exponent(.5)}const R5=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:kj,scaleDiverging:P5,scaleDivergingLog:z5,scaleDivergingPow:Zj,scaleDivergingSqrt:Gle,scaleDivergingSymlog:M5,scaleIdentity:f5,scaleImplicit:NS,scaleLinear:d5,scaleLog:p5,scaleOrdinal:_j,scalePoint:zse,scalePow:Lj,scaleQuantile:v5,scaleQuantize:y5,scaleRadial:g5,scaleSequential:k5,scaleSequentialLog:A5,scaleSequentialPow:Vj,scaleSequentialQuantile:T5,scaleSequentialSqrt:Hle,scaleSequentialSymlog:E5,scaleSqrt:Ooe,scaleSymlog:m5,scaleThreshold:b5,scaleTime:Fle,scaleUtc:Kle,tickFormat:u5},Symbol.toStringTag,{value:"Module"}));function Vle(e){var t=R5;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(vf(e));if(n in t&&typeof t[n]=="function")return t[n]()}function ez(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=Vle(e);if(r!=null)return r.domain(t).range(n),r}}function Yj(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?ez(e.scale,n,r):ez(t,n,r)}function Zle(e){return"scale".concat(vf(e))}function Yle(e){return Zle(e)in R5}var D5=(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 Yle(r)?r:"point"}};function Wle(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var s=Math.floor((n+r)/2);(i?e[s]<t:e[s]>t)?n=s+1:r=s}return n}function I5(e,t){if(e){var n=t??e.domain(),r=n.map(s=>{var l;return(l=e(s))!==null&&l!==void 0?l:0}),i=e.range();if(!(n.length===0||i.length<2))return s=>{var l,c,f=Wle(r,s);if(f<=0)return n[0];if(f>=n.length)return n[n.length-1];var h=(l=r[f-1])!==null&&l!==void 0?l:0,p=(c=r[f])!==null&&c!==void 0?c:0;return Math.abs(s-h)<=Math.abs(s-p)?n[f-1]:n[f]}}}function Qle(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):I5(e,void 0)}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 og(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){Xle(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 Xle(e,t,n){return(t=Jle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jle(e){var t=ece(e,"string");return typeof t=="symbol"?t:t+""}function ece(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kS=[0,"auto"],bn={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"},L5=(e,t)=>e.cartesianAxis.xAxis[t],ra=(e,t)=>{var n=L5(e,t);return n??bn},xn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:kS,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:xf},$5=(e,t)=>e.cartesianAxis.yAxis[t],ia=(e,t)=>{var n=$5(e,t);return n??xn},tce={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:""},Wj=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??tce},lr=(e,t,n)=>{switch(t){case"xAxis":return ra(e,n);case"yAxis":return ia(e,n);case"zAxis":return Wj(e,n);case"angleAxis":return xj(e,n);case"radiusAxis":return wj(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},nce=(e,t,n)=>{switch(t){case"xAxis":return ra(e,n);case"yAxis":return ia(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Ef=(e,t,n)=>{switch(t){case"xAxis":return ra(e,n);case"yAxis":return ia(e,n);case"angleAxis":return xj(e,n);case"radiusAxis":return wj(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},U5=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function B5(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 q5=e=>e.graphicalItems.cartesianItems,rce=te([_n,Cv],B5),F5=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),lu=te([q5,lr,rce],F5,{memoizeOptions:{resultEqualityCheck:_v}}),K5=te([lu],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Nj)),H5=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),ice=te([lu],H5),G5=e=>e.map(t=>t.data).filter(Boolean).flat(1),ace=te([lu],e=>e.some(t=>!t.data)),V5=te([lu],G5,{memoizeOptions:{resultEqualityCheck:_v}}),Z5=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},Qj=te([V5,xv],Z5),sce=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:On(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:On(i,r)}))):e.map(r=>({value:r})),Y5=(e,t,n,r,i,s)=>{var{chartData:l=[],dataStartIndex:c,dataEndIndex:f}=r,h=sce(e,t,n);if(i&&t?.dataKey!=null&&s.length>0){var p=l.slice(c,f+1),g=p.map(v=>({value:On(v,t.dataKey)})).filter(v=>v.value!=null);return[...g,...h]}return h},Tf=te([Qj,lr,lu,xv,ace,V5],Y5);function Tc(e){if(oi(e)||e instanceof Date){var t=Number(e);if(We(t))return t}}function nz(e){if(Array.isArray(e)){var t=[Tc(e[0]),Tc(e[1])];return Yi(t)?t:void 0}var n=Tc(e);if(n!=null)return[n,n]}function ta(e){return e.map(Tc).filter(vr)}function oce(e,t){var n=Tc(e),r=Tc(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var lce=te([Tf],e=>e?.map(t=>t.value).sort(oce));function W5(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function cce(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!Xi(t))r=t;else if(Array.isArray(t)){var i=ta(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:ta(n.flatMap(s=>{var l=On(e,s.dataKey),c,f;if(Array.isArray(l)?[c,f]=l:c=f=l,!(!We(c)||!We(f)))return[r-c,r+f]}))}var jn=e=>{var t=kn(e),n=su(e);return Ef(e,t,n)},Kc=te([jn],e=>e?.dataKey),uce=te([K5,xv,jn],t5),Q5=(e,t,n,r)=>{var i={},s=t.reduce((l,c)=>{if(c.stackId==null)return l;var f=l[c.stackId];return f==null&&(f=[]),f.push(c),l[c.stackId]=f,l},i);return Object.fromEntries(Object.entries(s).map(l=>{var[c,f]=l,h=r?[...f].reverse():f,p=h.map(jj);return[c,{stackedData:Fne(e,p,n),graphicalItems:h}]}))},X5=te([uce,K5,wv,Z$],Q5),J5=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:s}=t;if(r==null&&n!=="zAxis"){var l=Vne(e,i,s);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},dce=te([lr],e=>e.allowDataOverflow),Xj=e=>{var t;if(e==null||!("domain"in e))return kS;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=ta(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:kS},e3=te([lr],Xj),t3=te([e3,dce],I$),fce=te([X5,Pi,_n,t3],J5,{memoizeOptions:{resultEqualityCheck:Ov}}),Jj=e=>e.errorBars,hce=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>W5(n,r)),lg=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var s=i.flat(),l=Math.min(...s),c=Math.max(...s);return[l,c]}},n3=function(t,n,r,i,s){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],c,f;if(r.length>0&&r.forEach(h=>{var p,g=h.data!=null?[...h.data]:l,v=(p=i[h.id])===null||p===void 0?void 0:p.filter(y=>W5(s,y));g.forEach(y=>{var S,w=On(y,(S=n.dataKey)!==null&&S!==void 0?S:h.dataKey),N=cce(y,w,v);if(N.length>=2){var C=Math.min(...N),E=Math.max(...N);(c==null||C<c)&&(c=C),(f==null||E>f)&&(f=E)}var A=nz(w);A!=null&&(c=c==null?A[0]:Math.min(c,A[0]),f=f==null?A[1]:Math.max(f,A[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(h=>{var p=nz(On(h,n.dataKey));p!=null&&(c=c==null?p[0]:Math.min(c,p[0]),f=f==null?p[1]:Math.max(f,p[1]))}),We(c)&&We(f))return[c,f]},pce=te([Qj,lr,ice,Jj,_n,nse],n3,{memoizeOptions:{resultEqualityCheck:Ov}});function mce(e){var{value:t}=e;if(oi(t)||t instanceof Date)return t}var gce=(e,t,n)=>{var r=e.map(mce).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&uL(r))?D$(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},r3=e=>e.referenceElements.dots,cu=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),vce=te([r3,_n,Cv],cu),i3=e=>e.referenceElements.areas,yce=te([i3,_n,Cv],cu),a3=e=>e.referenceElements.lines,bce=te([a3,_n,Cv],cu),s3=(e,t)=>{if(e!=null){var n=ta(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},xce=te(vce,_n,s3),o3=(e,t)=>{if(e!=null){var n=ta(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)]}},wce=te([yce,_n],o3);function Sce(e){var t;if(e.x!=null)return ta([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:ta(n)}function jce(e){var t;if(e.y!=null)return ta([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:ta(n)}var l3=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?Sce(r):jce(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Nce=te([bce,_n],l3),Cce=te(xce,Nce,wce,(e,t,n)=>lg(e,n,t)),c3=(e,t,n,r,i,s,l,c)=>{if(n!=null)return n;var f=l==="vertical"&&c==="xAxis"||l==="horizontal"&&c==="yAxis",h=f?lg(r,s,i):lg(s,i);return ise(t,h,e.allowDataOverflow)},Oce=te([lr,e3,t3,fce,pce,Cce,qt,_n],c3,{memoizeOptions:{resultEqualityCheck:Ov}}),_ce=[0,1],u3=(e,t,n,r,i,s,l)=>{if(!((e==null||n==null||n.length===0)&&l===void 0)){var{dataKey:c,type:f}=e,h=na(t,s);if(h&&c==null){var p;return D$(0,(p=n?.length)!==null&&p!==void 0?p:0)}return f==="category"?gce(r,e,h):i==="expand"&&!h?_ce:l}},eN=te([lr,qt,Qj,Tf,wv,_n,Oce],u3),uu=te([lr,U5,vj],D5),d3=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=Xj(t),s=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Yi(e)){if(s)return fP(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return hP(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(s&&Yi(e))return fP(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Yi(e))return hP(e,t.tickCount,t.allowDecimals,"adaptive")}}},tN=te([eN,Ef,uu],d3),f3=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&Yi(t)&&Array.isArray(n)&&n.length>0){var i,s,l=t[0],c=(i=n[0])!==null&&i!==void 0?i:0,f=t[1],h=(s=n[n.length-1])!==null&&s!==void 0?s:0;return[Math.min(l,c),Math.max(f,h)]}return t},kce=te([lr,eN,tN,_n],f3),Ace=te(Tf,lr,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(ta(e.map(g=>g.value))).sort((g,v)=>g-v),i=r[0],s=r[r.length-1];if(i==null||s==null)return 1/0;var l=s-i;if(l===0)return 1/0;for(var c=0;c<r.length-1;c++){var f=r[c],h=r[c+1];if(!(f==null||h==null)){var p=h-f;n=Math.min(n,p)}}return n/l}}),h3=te(Ace,qt,cse,qn,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!We(e))return 0;var s=t==="vertical"?r.height:r.width;if(i==="gap")return e*s/2;if(i==="no-gap"){var l=Fs(n,e*s),c=e*s/2;return c-l-(c-l)/s*l}return 0}),Ece=(e,t,n)=>{var r=ra(e,t);return r==null||typeof r.padding!="string"?0:h3(e,"xAxis",t,n,r.padding)},Tce=(e,t,n)=>{var r=ia(e,t);return r==null||typeof r.padding!="string"?0:h3(e,"yAxis",t,n,r.padding)},Pce=te(ra,Ece,(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}}),zce=te(ia,Tce,(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}}),Mce=te([qn,Pce,gv,mv,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:s}=r;return i?[s.left,n.width-s.right]:[e.left+t.left,e.left+e.width-t.right]}),Rce=te([qn,qt,zce,gv,mv,(e,t,n)=>n],(e,t,n,r,i,s)=>{var{padding:l}=i;return s?[r.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Pf=(e,t,n,r)=>{var i;switch(t){case"xAxis":return Mce(e,n,r);case"yAxis":return Rce(e,n,r);case"zAxis":return(i=Wj(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return X$(e);case"radiusAxis":return J$(e,n);default:return}},p3=te([lr,Pf],Sv),Dce=te([uu,kce],yse),nN=te([lr,uu,Dce,p3],Yj),m3=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:s}=n,l=na(e,r);if(l&&(i==="number"||s!=="auto"))return t.map(c=>c.value)}},rN=te([qt,Tf,Ef,_n],m3),Hc=te([nN],Cj);te([nN],Qle);te([nN,lce],I5);te([lu,Jj,_n],hce);function g3(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Mv=(e,t)=>t,Rv=(e,t,n)=>n,Ice=te(hv,Mv,Rv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(g3)),Lce=te(pv,Mv,Rv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(g3)),v3=(e,t)=>({width:e.width,height:t.height}),$ce=(e,t)=>{var n=typeof t.width=="number"?t.width:xf;return{width:n,height:e.height}},Uce=te(qn,ra,v3),Bce=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},qce=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},Fce=te(Ba,qn,Ice,Mv,Rv,(e,t,n,r,i)=>{var s={},l;return n.forEach(c=>{var f=v3(t,c);l==null&&(l=Bce(t,r,e));var h=r==="top"&&!i||r==="bottom"&&i;s[c.id]=l-Number(h)*f.height,l+=(h?-1:1)*f.height}),s}),Kce=te(Ua,qn,Lce,Mv,Rv,(e,t,n,r,i)=>{var s={},l;return n.forEach(c=>{var f=$ce(t,c);l==null&&(l=qce(t,r,e));var h=r==="left"&&!i||r==="right"&&i;s[c.id]=l-Number(h)*f.width,l+=(h?-1:1)*f.width}),s}),Hce=(e,t)=>{var n=ra(e,t);if(n!=null)return Fce(e,n.orientation,n.mirror)},Gce=te([qn,ra,Hce,(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}}}),Vce=(e,t)=>{var n=ia(e,t);if(n!=null)return Kce(e,n.orientation,n.mirror)},Zce=te([qn,ia,Vce,(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}}}),Yce=te(qn,ia,(e,t)=>{var n=typeof t.width=="number"?t.width:xf;return{width:n,height:e.height}}),y3=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:s,dataKey:l}=n,c=na(e,r),f=t.map(p=>p.value),h=f.filter(p=>p!=null);if(l&&c&&s==="category"&&i&&uL(h))return f}},iN=te([qt,Tf,lr,_n],y3),rz=te([qt,nce,uu,Hc,iN,rN,Pf,tN,_n],(e,t,n,r,i,s,l,c,f)=>{if(t!=null){var h=na(e,f);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:f,categoricalDomain:s,duplicateDomain:i,isCategorical:h,niceTicks:c,range:l,realScaleType:n,scale:r}}}),Wce=(e,t,n,r,i,s,l,c,f)=>{if(!(t==null||r==null)){var h=na(e,f),{type:p,ticks:g,tickCount:v}=t,y=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,S=p==="category"&&r.bandwidth?r.bandwidth()/y:0;S=f==="angleAxis"&&s!=null&&s.length>=2?ni(s[0]-s[1])*2*S:S;var w=g||i;return w?w.map((N,C)=>{var E=l?l.indexOf(N):N,A=r.map(E);return We(A)?{index:C,coordinate:A+S,value:N,offset:S}:null}).filter(vr):h&&c?c.map((N,C)=>{var E=r.map(N);return We(E)?{coordinate:E+S,value:N,index:C,offset:S}:null}).filter(vr):r.ticks?r.ticks(v).map((N,C)=>{var E=r.map(N);return We(E)?{coordinate:E+S,value:N,index:C,offset:S}:null}).filter(vr):r.domain().map((N,C)=>{var E=r.map(N);return We(E)?{coordinate:E+S,value:l?l[N]:N,index:C,offset:S}:null}).filter(vr)}},b3=te([qt,Ef,uu,Hc,tN,Pf,iN,rN,_n],Wce),Qce=(e,t,n,r,i,s,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var c=na(e,l),{tickCount:f}=t,h=0;return h=l==="angleAxis"&&r?.length>=2?ni(r[0]-r[1])*2*h:h,c&&s?s.map((p,g)=>{var v=n.map(p);return We(v)?{coordinate:v+h,value:p,index:g,offset:h}:null}).filter(vr):n.ticks?n.ticks(f).map((p,g)=>{var v=n.map(p);return We(v)?{coordinate:v+h,value:p,index:g,offset:h}:null}).filter(vr):n.domain().map((p,g)=>{var v=n.map(p);return We(v)?{coordinate:v+h,value:i?i[p]:p,index:g,offset:h}:null}).filter(vr)}},x3=te([qt,Ef,Hc,Pf,iN,rN,_n],Qce),w3=te(lr,Hc,(e,t)=>{if(!(e==null||t==null))return og(og({},e),{},{scale:t})}),Xce=te([lr,uu,eN,p3],Yj),Jce=te([Xce],Cj);te((e,t,n)=>Wj(e,n),Jce,(e,t)=>{if(!(e==null||t==null))return og(og({},e),{},{scale:t})});var eue=te([qt,hv,pv],(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}}),tue=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};te([tue],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var s of e){var l=Math.abs(s.coordinate-t);l<r&&(r=l,i=s)}return(n=i)===null||n===void 0?void 0:n.value}});var S3=e=>e.options.defaultTooltipEventType,j3=e=>e.options.validateTooltipEventTypes;function N3(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function zf(e,t){var n=S3(e),r=j3(e);return N3(t,n,r)}function nue(e){return Re(t=>zf(t,e))}var C3=(e,t)=>{var n,r=Number(t);if(!(Xi(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},rue=e=>e.tooltip.settings,_s={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},iue={itemInteraction:{click:_s,hover:_s},axisInteraction:{click:_s,hover:_s},keyboardInteraction:_s,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}},O3=Wn({name:"tooltip",initialState:iue,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:zt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ri(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:zt()},removeTooltipEntrySettings:{reducer(e,t){var n=ri(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:aue,replaceTooltipEntrySettings:sue,removeTooltipEntrySettings:oue,setTooltipSettingsState:lue,setActiveMouseOverItemIndex:cue,mouseLeaveItem:Rye,mouseLeaveChart:_3,setActiveClickItemIndex:Dye,setMouseOverAxisIndex:k3,setMouseClickAxisIndex:uue,setSyncInteraction:Cd,setKeyboardInteraction:cg}=O3.actions,due=O3.reducer;function iz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iz(Object(n),!0).forEach(function(r){fue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fue(e,t,n){return(t=hue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hue(e){var t=pue(e,"string");return typeof t=="symbol"?t:t+""}function pue(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 mue(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function gue(e){return e.index!=null}var A3=(e,t,n,r)=>{if(t==null)return _s;var i=mue(e,t,n);if(i==null)return _s;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var s=e.settings.active===!0;if(gue(i)){if(s)return Mp(Mp({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Mp(Mp({},_s),{},{coordinate:i.coordinate})};function vue(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 yue(e,t){var n=vue(e),r=t[0],i=t[1];if(n===void 0)return!1;var s=Math.min(r,i),l=Math.max(r,i);return n>=s&&n<=l}function bue(e,t,n){if(n==null||t==null)return!0;var r=On(e,t);return r==null||!Yi(n)?!0:yue(r,n)}var Pd=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var s=Number(i);if(!We(s))return i;var l=0,c=1/0;t.length>0&&(c=t.length-1);var f=Math.max(l,Math.min(s,c)),h=t[f];return h==null||bue(h,n,r)?String(f):null},E3=(e,t,n,r,i,s,l)=>{if(s!=null){var c=l[0],f=c?.getPosition(s);if(f!=null)return f;var h=i?.[Number(s)];if(h)return n==="horizontal"?{x:h.coordinate,y:(r.top+t)/2}:{x:(r.left+e)/2,y:h.coordinate}}},T3=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var s=e.tooltipItemPayloads[0];return s!=null?[s]:[]}return e.tooltipItemPayloads.filter(l=>{var c;return((c=l.settings)===null||c===void 0?void 0:c.graphicalItemId)===i})},P3=e=>e.options.tooltipPayloadSearcher,du=e=>e.tooltip;function az(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function sz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?az(Object(n),!0).forEach(function(r){xue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):az(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xue(e,t,n){return(t=wue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wue(e){var t=Sue(e,"string");return typeof t=="symbol"?t:t+""}function Sue(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 jue(e){if(typeof e=="string"||typeof e=="number")return e}function Nue(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Cue(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function oz(e){if(typeof e=="string")return e}function Oue(e){if(!(e==null||typeof e!="object")){var t="name"in e?jue(e.name):void 0,n="unit"in e?Nue(e.unit):void 0,r="dataKey"in e?Cue(e.dataKey):void 0,i="payload"in e?e.payload:void 0,s="color"in e?oz(e.color):void 0,l="fill"in e?oz(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:s,fill:l}}}function _ue(e,t){return e??t}var z3=(e,t,n,r,i,s,l)=>{if(!(t==null||s==null)){var{chartData:c,computedData:f,dataStartIndex:h,dataEndIndex:p}=n,g=[];return e.reduce((v,y)=>{var S,{dataDefinedOnItem:w,settings:N}=y,C=_ue(w,c),E=Array.isArray(C)?o$(C,h,p):C,A=(S=N?.dataKey)!==null&&S!==void 0?S:r,O=N?.nameKey,P;if(r&&Array.isArray(E)&&!Array.isArray(E[0])&&l==="axis"?P=dL(E,r,i):P=s(E,t,f,O),Array.isArray(P))P.forEach(_=>{var T,R,B=Oue(_),$=B?.name,L=B?.dataKey,ne=B?.payload,he=sz(sz({},N),{},{name:$,unit:B?.unit,color:(T=B?.color)!==null&&T!==void 0?T:N?.color,fill:(R=B?.fill)!==null&&R!==void 0?R:N?.fill});v.push(e2({tooltipEntrySettings:he,dataKey:L,payload:ne,value:On(ne,L),name:$==null?void 0:String($)}))});else{var z;v.push(e2({tooltipEntrySettings:N,dataKey:A,payload:P,value:On(P,A),name:(z=On(P,O))!==null&&z!==void 0?z:N?.name}))}return v},g)}},aN=te([jn,U5,vj],D5),kue=te([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Aue=te([kn,su],B5),vl=te([kue,jn,Aue],F5,{memoizeOptions:{resultEqualityCheck:_v}}),Eue=te([vl],e=>e.filter(Nj)),M3=te([vl],G5,{memoizeOptions:{resultEqualityCheck:_v}}),Tue=te([vl],e=>e.some(t=>!t.data)),sl=te([M3,Pi],Z5),Pue=te([Eue,Pi,jn],t5),sN=te([sl,jn,vl,Pi,Tue,M3],Y5),R3=te([jn],Xj),zue=te([jn],e=>e.allowDataOverflow),D3=te([R3,zue],I$),Mue=te([vl],e=>e.filter(Nj)),Rue=te([Pue,Mue,wv,Z$],Q5),Due=te([Rue,Pi,kn,D3],J5),Iue=te([vl],H5),Lue=te([sl,jn,Iue,Jj,kn,rse],n3,{memoizeOptions:{resultEqualityCheck:Ov}}),$ue=te([r3,kn,su],cu),Uue=te([$ue,kn],s3),Bue=te([i3,kn,su],cu),que=te([Bue,kn],o3),Fue=te([a3,kn,su],cu),Kue=te([Fue,kn],l3),Hue=te([Uue,Kue,que],lg),Gue=te([jn,R3,D3,Due,Lue,Hue,qt,kn],c3),Gc=te([jn,qt,sl,sN,wv,kn,Gue],u3),Vue=te([Gc,jn,aN],d3),Zue=te([jn,Gc,Vue,kn],f3),I3=e=>{var t=kn(e),n=su(e),r=!1;return Pf(e,t,n,r)},L3=te([jn,I3],Sv),Yue=te([jn,aN,Zue,L3],Yj),$3=te([Yue],Cj),Wue=te([qt,sN,jn,kn],y3),Que=te([qt,sN,jn,kn],m3),Xue=(e,t,n,r,i,s,l,c)=>{if(t){var{type:f}=t,h=na(e,c);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,g=f==="category"&&r.bandwidth?r.bandwidth()/p:0;return g=c==="angleAxis"&&i!=null&&i?.length>=2?ni(i[0]-i[1])*2*g:g,h&&l?l.map((v,y)=>{var S=r.map(v);return We(S)?{coordinate:S+g,value:v,index:y,offset:g}:null}).filter(vr):r.domain().map((v,y)=>{var S=r.map(v);return We(S)?{coordinate:S+g,value:s?s[v]:v,index:y,offset:g}:null}).filter(vr)}}},Fa=te([qt,jn,aN,$3,I3,Wue,Que,kn],Xue),oN=te([S3,j3,rue],(e,t,n)=>N3(n.shared,e,t)),U3=e=>e.tooltip.settings.trigger,lN=e=>e.tooltip.settings.defaultIndex,Mf=te([du,oN,U3,lN],A3),of=te([Mf,sl,Kc,Gc],Pd),B3=te([Fa,of],C3),Jue=te([Mf],e=>{if(e)return e.dataKey}),ede=te([Mf],e=>{if(e)return e.graphicalItemId}),q3=te([du,oN,U3,lN],T3),tde=te([Ua,Ba,qt,qn,Fa,lN,q3],E3),nde=te([Mf,tde],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),rde=te([Mf],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),ide=te([q3,of,Pi,Kc,B3,P3,oN],z3),ade=te([ide],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function lz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lz(Object(n),!0).forEach(function(r){sde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sde(e,t,n){return(t=ode(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ode(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 cde=()=>Re(jn),ude=()=>{var e=cde(),t=Re(Fa),n=Re($3);return $m(!e||!n?void 0:cz(cz({},e),{},{scale:n}),t)};function uz(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?uz(Object(n),!0).forEach(function(r){dde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dde(e,t,n){return(t=fde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fde(e){var t=hde(e,"string");return typeof t=="symbol"?t:t+""}function hde(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 pde=(e,t,n,r)=>{var i=t.find(s=>s&&s.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},mde=(e,t,n,r)=>{var i=t.find(h=>h&&h.index===n);if(i){if(e==="centric"){var s=i.coordinate,{radius:l}=r;return dc(dc(dc({},r),$n(r.cx,r.cy,l,s)),{},{angle:s,radius:l})}var c=i.coordinate,{angle:f}=r;return dc(dc(dc({},r),$n(r.cx,r.cy,c,f)),{},{angle:f,radius:c})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function gde(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var F3=(e,t,n,r,i)=>{var s,l=(s=t?.length)!==null&&s!==void 0?s:0;if(l<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var c=0;c<l;c++){var f,h,p,g,v,y=c>0?(f=n[c-1])===null||f===void 0?void 0:f.coordinate:(h=n[l-1])===null||h===void 0?void 0:h.coordinate,S=(p=n[c])===null||p===void 0?void 0:p.coordinate,w=c>=l-1?(g=n[0])===null||g===void 0?void 0:g.coordinate:(v=n[c+1])===null||v===void 0?void 0:v.coordinate,N=void 0;if(!(y==null||S==null||w==null))if(ni(S-y)!==ni(w-S)){var C=[];if(ni(w-S)===ni(i[1]-i[0])){N=w;var E=S+i[1]-i[0];C[0]=Math.min(E,(E+y)/2),C[1]=Math.max(E,(E+y)/2)}else{N=y;var A=w+i[1]-i[0];C[0]=Math.min(S,(A+S)/2),C[1]=Math.max(S,(A+S)/2)}var O=[Math.min(S,(N+S)/2),Math.max(S,(N+S)/2)];if(e>O[0]&&e<=O[1]||e>=C[0]&&e<=C[1]){var P;return(P=n[c])===null||P===void 0?void 0:P.index}}else{var z=Math.min(y,w),_=Math.max(y,w);if(e>(z+S)/2&&e<=(_+S)/2){var T;return(T=n[c])===null||T===void 0?void 0:T.index}}}else if(t)for(var R=0;R<l;R++){var B=t[R];if(B!=null){var $=t[R+1],L=t[R-1];if(R===0&&$!=null&&e<=(B.coordinate+$.coordinate)/2||R===l-1&&L!=null&&e>(B.coordinate+L.coordinate)/2||R>0&&R<l-1&&L!=null&&$!=null&&e>(B.coordinate+L.coordinate)/2&&e<=(B.coordinate+$.coordinate)/2)return B.index}}return-1},K3=()=>Re(vj),cN=(e,t)=>t,H3=(e,t,n)=>n,uN=(e,t,n,r)=>r,vde=te(Fa,e=>rv(e,t=>t.coordinate)),dN=te([du,cN,H3,uN],A3),fN=te([dN,sl,Kc,Gc],Pd),yde=(e,t,n)=>{if(t!=null){var r=du(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},G3=te([du,cN,H3,uN],T3),ug=te([Ua,Ba,qt,qn,Fa,uN,G3],E3),bde=te([dN,ug],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),V3=te([Fa,fN],C3),xde=te([G3,fN,Pi,Kc,V3,P3,cN],z3),wde=te([dN,fN],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Sde=(e,t,n,r,i,s,l)=>{if(!(!e||!n||!r||!i)&&gde(e,l)){var c=Zne(e,t),f=F3(c,s,i,n,r),h=pde(t,i,f,e);return{activeIndex:String(f),activeCoordinate:h}}},jde=(e,t,n,r,i,s,l)=>{if(!(!e||!r||!i||!s||!n)){var c=Kae(e,n);if(c){var f=Yne(c,t),h=F3(f,l,s,r,i),p=mde(t,s,h,c);return{activeIndex:String(h),activeCoordinate:p}}}},Nde=(e,t,n,r,i,s,l,c)=>{if(!(!e||!t||!r||!i||!s))return t==="horizontal"||t==="vertical"?Sde(e,t,r,i,s,l,c):jde(e,t,n,r,i,s,l)},Cde=te(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}}),Ode=te(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Yn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:vse}});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 fz(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){_de(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 _de(e,t,n){return(t=kde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kde(e){var t=Ade(e,"string");return typeof t=="symbol"?t:t+""}function Ade(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 Ede={},Tde={zIndexMap:Object.values(Yn).reduce((e,t)=>fz(fz({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Ede)},Pde=new Set(Object.values(Yn));function zde(e){return Pde.has(e)}var Z3=Wn({name:"zIndex",initialState:Tde,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&&!zde(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:Mde,unregisterZIndexPortal:Wx,registerZIndexPortalElement:Rde,unregisterZIndexPortalElement:Dde}=Z3.actions,Ide=Z3.reducer;function aa(e){var{zIndex:t,children:n}=e,r=kre(),i=r&&t!==void 0&&t!==0,s=or(),l=x.useRef(void 0),c=x.useRef(new Set),f=Yt(),h=Re(g=>Cde(g,t,s));if(x.useLayoutEffect(()=>{if(!i){var g=c.current;g.forEach(y=>{f(Wx({zIndex:y}))}),g.clear(),l.current=void 0;return}if(c.current.has(t)||(f(Mde({zIndex:t})),c.current.add(t)),h){l.current=h;var v=c.current;v.forEach(y=>{y!==t&&(f(Wx({zIndex:y})),v.delete(y))})}},[f,t,i,h]),x.useLayoutEffect(()=>{var g=c.current;return()=>{g.forEach(v=>{f(Wx({zIndex:v}))}),g.clear()}},[f]),!i)return n;var p=h??l.current;return p?cl.createPortal(n,p):null}function AS(){return AS=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},AS.apply(null,arguments)}function hz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hz(Object(n),!0).forEach(function(r){Lde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lde(e,t,n){return(t=$de(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $de(e){var t=Ude(e,"string");return typeof t=="symbol"?t:t+""}function Ude(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 Bde(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function qde(e){var t,{coordinate:n,payload:r,index:i,offset:s,tooltipAxisBandSize:l,layout:c,cursor:f,tooltipEventType:h,chartName:p}=e,g=n,v=r,y=i;if(!f||!g||p!=="ScatterChart"&&h!=="axis")return null;var S,w,N;if(p==="ScatterChart")S=g,w=nae,N=Yn.cursorLine;else if(p==="BarChart")S=rae(c,g,s,l),w=Mae,N=Yn.cursorRectangle;else if(c==="radial"&&pL(g)){var{cx:C,cy:E,radius:A,startAngle:O,endAngle:P}=M$(g);S={cx:C,cy:E,startAngle:O,endAngle:P,innerRadius:A,outerRadius:A},w=Zae,N=Yn.cursorLine}else S={points:Yae(c,g,s)},w=Jp,N=Yn.cursorLine;var z=typeof f=="object"&&"className"in f?f.className:void 0,_=Rp(Rp(Rp(Rp({stroke:"#ccc",pointerEvents:"none"},s),S),Xg(f)),{},{payload:v,payloadIndex:y,className:gt("recharts-tooltip-cursor",z)});return x.createElement(aa,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:N},x.createElement(Bde,{cursor:f,cursorComp:w,cursorProps:_}))}function Fde(e){var t=ude(),n=v$(),r=ru(),i=K3();return t==null||n==null||r==null||i==null?null:x.createElement(qde,AS({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var Y3=x.createContext(null),Kde=()=>x.useContext(Y3),Qx={exports:{}},pz;function Hde(){return pz||(pz=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(f,h,p){this.fn=f,this.context=h,this.once=p||!1}function s(f,h,p,g,v){if(typeof p!="function")throw new TypeError("The listener must be a function");var y=new i(p,g||f,v),S=n?n+h:h;return f._events[S]?f._events[S].fn?f._events[S]=[f._events[S],y]:f._events[S].push(y):(f._events[S]=y,f._eventsCount++),f}function l(f,h){--f._eventsCount===0?f._events=new r:delete f._events[h]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var h=[],p,g;if(this._eventsCount===0)return h;for(g in p=this._events)t.call(p,g)&&h.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(p)):h},c.prototype.listeners=function(h){var p=n?n+h:h,g=this._events[p];if(!g)return[];if(g.fn)return[g.fn];for(var v=0,y=g.length,S=new Array(y);v<y;v++)S[v]=g[v].fn;return S},c.prototype.listenerCount=function(h){var p=n?n+h:h,g=this._events[p];return g?g.fn?1:g.length:0},c.prototype.emit=function(h,p,g,v,y,S){var w=n?n+h:h;if(!this._events[w])return!1;var N=this._events[w],C=arguments.length,E,A;if(N.fn){switch(N.once&&this.removeListener(h,N.fn,void 0,!0),C){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,p),!0;case 3:return N.fn.call(N.context,p,g),!0;case 4:return N.fn.call(N.context,p,g,v),!0;case 5:return N.fn.call(N.context,p,g,v,y),!0;case 6:return N.fn.call(N.context,p,g,v,y,S),!0}for(A=1,E=new Array(C-1);A<C;A++)E[A-1]=arguments[A];N.fn.apply(N.context,E)}else{var O=N.length,P;for(A=0;A<O;A++)switch(N[A].once&&this.removeListener(h,N[A].fn,void 0,!0),C){case 1:N[A].fn.call(N[A].context);break;case 2:N[A].fn.call(N[A].context,p);break;case 3:N[A].fn.call(N[A].context,p,g);break;case 4:N[A].fn.call(N[A].context,p,g,v);break;default:if(!E)for(P=1,E=new Array(C-1);P<C;P++)E[P-1]=arguments[P];N[A].fn.apply(N[A].context,E)}}return!0},c.prototype.on=function(h,p,g){return s(this,h,p,g,!1)},c.prototype.once=function(h,p,g){return s(this,h,p,g,!0)},c.prototype.removeListener=function(h,p,g,v){var y=n?n+h:h;if(!this._events[y])return this;if(!p)return l(this,y),this;var S=this._events[y];if(S.fn)S.fn===p&&(!v||S.once)&&(!g||S.context===g)&&l(this,y);else{for(var w=0,N=[],C=S.length;w<C;w++)(S[w].fn!==p||v&&!S[w].once||g&&S[w].context!==g)&&N.push(S[w]);N.length?this._events[y]=N.length===1?N[0]:N:l(this,y)}return this},c.prototype.removeAllListeners=function(h){var p;return h?(p=n?n+h:h,this._events[p]&&l(this,p)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(Qx)),Qx.exports}var Gde=Hde();const Vde=Ks(Gde);var lf=new Vde,ES="recharts.syncEvent.tooltip",mz="recharts.syncEvent.brush",Zde=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Xi(n))return e[n]}},Yde={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},W3=Wn({name:"options",initialState:Yde,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Wde=W3.reducer,{createEventEmitter:Qde}=W3.actions;function Xde(e){return e.tooltip.syncInteraction}var Jde={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},Q3=Wn({name:"chartData",initialState:Jde,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:gz,setDataStartEndIndexes:efe,setComputedData:Iye}=Q3.actions,tfe=Q3.reducer,nfe=["x","y"];function vz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vz(Object(n),!0).forEach(function(r){rfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rfe(e,t,n){return(t=ife(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ife(e){var t=afe(e,"string");return typeof t=="symbol"?t:t+""}function afe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sfe(e,t){if(e==null)return{};var n,r,i=ofe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ofe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function lfe(){var e=Re(yj),t=Re(bj),n=Yt(),r=Re(Y$),i=Re(Fa),s=ru(),l=wf(),c=Re(f=>f.rootProps.className);x.useEffect(()=>{if(e==null)return nu;var f=(h,p,g)=>{if(t!==g&&e===h){if(p.payload.active===!1){n(Cd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var v;if(l&&p!==null&&p!==void 0&&(v=p.payload)!==null&&v!==void 0&&v.coordinate&&p.payload.sourceViewBox){var y=p.payload.coordinate,{x:S,y:w}=y,N=sfe(y,nfe),{x:C,y:E,width:A,height:O}=p.payload.sourceViewBox,P=fc(fc({},N),{},{x:l.x+(A?(S-C)/A:0)*l.width,y:l.y+(O?(w-E)/O:0)*l.height});n(fc(fc({},p),{},{payload:fc(fc({},p.payload),{},{coordinate:P})}))}else n(p);return}if(i!=null){var z;if(typeof r=="function"){var _={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},T=r(i,_);z=i[T]}else r==="value"&&(z=i.find(H=>String(H.value)===p.payload.label));var{coordinate:R}=p.payload;if(R==null||l==null){n(Cd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(z==null){n(Cd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:B,y:$}=R,L=Math.min(B,l.x+l.width),ne=Math.min($,l.y+l.height),he={x:s==="horizontal"?z.coordinate:L,y:s==="horizontal"?ne:z.coordinate},ge=Cd({active:p.payload.active,coordinate:he,dataKey:p.payload.dataKey,index:String(z.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(ge)}}};return lf.on(ES,f),()=>{lf.off(ES,f)}},[c,n,t,e,r,i,s,l])}function cfe(){var e=Re(yj),t=Re(bj),n=Yt();x.useEffect(()=>{if(e==null)return nu;var r=(i,s,l)=>{t!==l&&e===i&&n(efe(s))};return lf.on(mz,r),()=>{lf.off(mz,r)}},[n,t,e])}function ufe(){var e=Yt();x.useEffect(()=>{e(Qde())},[e]),lfe(),cfe()}function dfe(e,t,n,r,i,s){var l=Re(S=>yde(S,e,t)),c=Re(ede),f=Re(bj),h=Re(yj),p=Re(Y$),g=Re(Xde),v=g?.sourceViewBox!=null,y=wf();x.useEffect(()=>{if(!v&&h!=null&&f!=null){var S=Cd({active:s,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:y,graphicalItemId:c});lf.emit(ES,h,S,f)}},[v,n,l,c,i,r,f,h,p,s,y])}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 bz(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){ffe(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 ffe(e,t,n){return(t=hfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hfe(e){var t=pfe(e,"string");return typeof t=="symbol"?t:t+""}function pfe(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 mfe(e){return e.dataKey}function gfe(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(Tie,t)}var xz=[],vfe={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 X3(e){var t,n,r=sr(e,vfe),{active:i,allowEscapeViewBox:s,animationDuration:l,animationEasing:c,content:f,filterNull:h,isAnimationActive:p,offset:g,payloadUniqBy:v,position:y,reverseDirection:S,useTranslate3d:w,wrapperStyle:N,cursor:C,shared:E,trigger:A,defaultIndex:O,portal:P,axisId:z}=r,_=Yt(),T=typeof O=="number"?String(O):O;x.useEffect(()=>{_(lue({shared:E,trigger:A,axisId:z,active:i,defaultIndex:T}))},[_,E,A,z,i,T]);var R=wf(),B=k$(),$=nue(E),{activeIndex:L,isActive:ne}=(t=Re(Se=>wde(Se,$,A,T)))!==null&&t!==void 0?t:{},he=Re(Se=>xde(Se,$,A,T)),ge=Re(Se=>V3(Se,$,A,T)),H=Re(Se=>bde(Se,$,A,T)),ie=he,pe=Kde(),we=(n=i??ne)!==null&&n!==void 0?n:!1,[q,D]=TL([ie,we]),G=$==="axis"?ge:void 0;dfe($,A,H,G,L,we);var ae=P??pe;if(ae==null||R==null||$==null)return null;var Y=ie??xz;we||(Y=xz),h&&Y.length&&(Y=OL(Y.filter(Se=>Se.value!=null&&(Se.hide!==!0||r.includeHidden)),v,mfe));var W=Y.length>0,oe=bz(bz({},r),{},{payload:Y,label:G,active:we,activeIndex:L,coordinate:H,accessibilityLayer:B}),xe=x.createElement(qie,{allowEscapeViewBox:s,animationDuration:l,animationEasing:c,isAnimationActive:p,active:we,coordinate:H,hasPayload:W,offset:g,position:y,reverseDirection:S,useTranslate3d:w,viewBox:R,wrapperStyle:N,lastBoundingBox:q,innerRef:D,hasPortalFromProps:!!P},gfe(f,oe));return x.createElement(x.Fragment,null,cl.createPortal(xe,ae),we&&x.createElement(Fde,{cursor:C,tooltipEventType:$,coordinate:H,payload:Y,index:L}))}function yfe(e,t,n){return(t=bfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bfe(e){var t=xfe(e,"string");return typeof t=="symbol"?t:t+""}function xfe(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 wfe{constructor(t){yfe(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 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 Sfe(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){jfe(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 jfe(e,t,n){return(t=Nfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nfe(e){var t=Cfe(e,"string");return typeof t=="symbol"?t:t+""}function Cfe(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 Ofe={cacheSize:2e3,enableCache:!0},J3=Sfe({},Ofe),Sz=new wfe(J3.cacheSize),_fe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},jz="recharts_measurement_span";function kfe(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",s=t.fontStyle||"",l=t.letterSpacing||"",c=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(s,"|").concat(l,"|").concat(c)}var Nz=(e,t)=>{try{var n=document.getElementById(jz);n||(n=document.createElement("span"),n.setAttribute("id",jz),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,_fe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},zd=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Cf.isSsr)return{width:0,height:0};if(!J3.enableCache)return Nz(t,n);var r=kfe(t,n),i=Sz.get(r);if(i)return i;var s=Nz(t,n);return Sz.set(r,s),s},e4;function Afe(e,t,n){return(t=Efe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Efe(e){var t=Tfe(e,"string");return typeof t=="symbol"?t:t+""}function Tfe(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 Cz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Oz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Pfe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,zfe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Mfe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Rfe=["cm","mm","pt","pc","in","Q","px"];function Dfe(e){return Rfe.includes(e)}var jc="NaN";function Ife(e,t){return e*Mfe[t]}class In{static parse(t){var n,[,r,i]=(n=zfe.exec(t))!==null&&n!==void 0?n:[];return r==null?In.NaN:new In(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Xi(t)&&(this.unit=""),n!==""&&!Pfe.test(n)&&(this.num=NaN,this.unit=""),Dfe(n)&&(this.num=Ife(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new In(NaN,""):new In(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new In(NaN,""):new In(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new In(NaN,""):new In(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new In(NaN,""):new In(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Xi(this.num)}}e4=In;Afe(In,"NaN",new e4(NaN,""));function t4(e){if(e==null||e.includes(jc))return jc;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,s]=(n=Cz.exec(t))!==null&&n!==void 0?n:[],l=In.parse(r??""),c=In.parse(s??""),f=i==="*"?l.multiply(c):l.divide(c);if(f.isNaN())return jc;t=t.replace(Cz,f.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,[,p,g,v]=(h=Oz.exec(t))!==null&&h!==void 0?h:[],y=In.parse(p??""),S=In.parse(v??""),w=g==="+"?y.add(S):y.subtract(S);if(w.isNaN())return jc;t=t.replace(Oz,w.toString())}return t}var _z=/\(([^()]*)\)/;function Lfe(e){for(var t=e,n;(n=_z.exec(t))!=null;){var[,r]=n;t=t.replace(_z,t4(r))}return t}function $fe(e){var t=e.replace(/\s+/g,"");return t=Lfe(t),t=t4(t),t}function Ufe(e){try{return $fe(e)}catch{return jc}}function Xx(e){var t=Ufe(e.slice(5,-1));return t===jc?"":t}var Bfe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],qfe=["dx","dy","angle","className","breakAll"];function TS(){return TS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TS.apply(null,arguments)}function kz(e,t){if(e==null)return{};var n,r,i=Ffe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ffe(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 n4=/[ \f\n\r\t\v\u2028\u2029]+/,r4=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Un(t)||(n?i=t.toString().split(""):i=t.toString().split(n4));var s=i.map(c=>({word:c,width:zd(c,r).width})),l=n?0:zd(" ",r).width;return{wordsWithComputedWidth:s,spaceWidth:l}}catch{return null}};function i4(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function Kfe(e){return Un(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var a4=(e,t,n,r)=>e.reduce((i,s)=>{var{word:l,width:c}=s,f=i[i.length-1];if(f&&c!=null&&(t==null||r||f.width+c+n<Number(t)))f.words.push(l),f.width+=c+n;else{var h={words:[l],width:c};i.push(h)}return i},[]),s4=e=>e.reduce((t,n)=>t.width>n.width?t:n),Hfe="…",Az=(e,t,n,r,i,s,l,c)=>{var f=e.slice(0,t),h=r4({breakAll:n,style:r,children:f+Hfe});if(!h)return[!1,[]];var p=a4(h.wordsWithComputedWidth,s,l,c),g=p.length>i||s4(p).width>Number(s);return[g,p]},Gfe=(e,t,n,r,i)=>{var{maxLines:s,children:l,style:c,breakAll:f}=e,h=ze(s),p=String(l),g=a4(t,r,n,i);if(!h||i)return g;var v=g.length>s||s4(g).width>Number(r);if(!v)return g;for(var y=0,S=p.length-1,w=0,N;y<=S&&w<=p.length-1;){var C=Math.floor((y+S)/2),E=C-1,[A,O]=Az(p,E,f,c,s,r,n,i),[P]=Az(p,C,f,c,s,r,n,i);if(!A&&!P&&(y=C+1),A&&P&&(S=C-1),!A&&P){N=O;break}w++}return N||g},Ez=e=>{var t=Un(e)?[]:e.toString().split(n4);return[{words:t,width:void 0}]},Vfe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:s,maxLines:l}=e;if((t||n)&&!Cf.isSsr){var c,f,h=r4({breakAll:s,children:r,style:i});if(h){var{wordsWithComputedWidth:p,spaceWidth:g}=h;c=p,f=g}else return Ez(r);return Gfe({breakAll:s,children:r,maxLines:l,style:i},c,f,t,!!n)}return Ez(r)},o4="#808080",Zfe={angle:0,breakAll:!1,capHeight:"0.71em",fill:o4,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},hN=x.forwardRef((e,t)=>{var n=sr(e,Zfe),{x:r,y:i,lineHeight:s,capHeight:l,fill:c,scaleToFit:f,textAnchor:h,verticalAnchor:p}=n,g=kz(n,Bfe),v=x.useMemo(()=>Vfe({breakAll:g.breakAll,children:g.children,maxLines:g.maxLines,scaleToFit:f,style:g.style,width:g.width}),[g.breakAll,g.children,g.maxLines,f,g.style,g.width]),{dx:y,dy:S,angle:w,className:N,breakAll:C}=g,E=kz(g,qfe);if(!oi(r)||!oi(i)||v.length===0)return null;var A=Number(r)+(ze(y)?y:0),O=Number(i)+(ze(S)?S:0);if(!We(A)||!We(O))return null;var P;switch(p){case"start":P=Xx("calc(".concat(l,")"));break;case"middle":P=Xx("calc(".concat((v.length-1)/2," * -").concat(s," + (").concat(l," / 2))"));break;default:P=Xx("calc(".concat(v.length-1," * -").concat(s,")"));break}var z=[],_=v[0];if(f&&_!=null){var T=_.width,{width:R}=g;z.push("scale(".concat(ze(R)&&ze(T)?R/T:1,")"))}return w&&z.push("rotate(".concat(w,", ").concat(A,", ").concat(O,")")),z.length&&(E.transform=z.join(" ")),x.createElement("text",TS({},xr(E),{ref:t,x:A,y:O,className:gt("recharts-text",N),textAnchor:h,fill:c.includes("url")?o4:c}),v.map((B,$)=>{var L=B.words.join(C?"":" ");return x.createElement("tspan",{x:A,dy:$===0?P:s,key:"".concat(L,"-").concat($)},L)}))});hN.displayName="Text";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 Fi(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){Yfe(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 Yfe(e,t,n){return(t=Wfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wfe(e){var t=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)}var Xfe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:s,y:l,height:c,upperWidth:f,lowerWidth:h}=oj(t),p=s,g=s+(f-h)/2,v=(p+g)/2,y=(f+h)/2,S=p+f/2,w=c>=0?1:-1,N=w*r,C=w>0?"end":"start",E=w>0?"start":"end",A=f>=0?1:-1,O=A*r,P=A>0?"end":"start",z=A>0?"start":"end",_=i;if(n==="top"){var T={x:p+f/2,y:l-N,horizontalAnchor:"middle",verticalAnchor:C};return _&&(T.height=Math.max(l-_.y,0),T.width=f),T}if(n==="bottom"){var R={x:g+h/2,y:l+c+N,horizontalAnchor:"middle",verticalAnchor:E};return _&&(R.height=Math.max(_.y+_.height-(l+c),0),R.width=h),R}if(n==="left"){var B={x:v-O,y:l+c/2,horizontalAnchor:P,verticalAnchor:"middle"};return _&&(B.width=Math.max(B.x-_.x,0),B.height=c),B}if(n==="right"){var $={x:v+y+O,y:l+c/2,horizontalAnchor:z,verticalAnchor:"middle"};return _&&($.width=Math.max(_.x+_.width-$.x,0),$.height=c),$}var L=_?{width:y,height:c}:{};return n==="insideLeft"?Fi({x:v+O,y:l+c/2,horizontalAnchor:z,verticalAnchor:"middle"},L):n==="insideRight"?Fi({x:v+y-O,y:l+c/2,horizontalAnchor:P,verticalAnchor:"middle"},L):n==="insideTop"?Fi({x:p+f/2,y:l+N,horizontalAnchor:"middle",verticalAnchor:E},L):n==="insideBottom"?Fi({x:g+h/2,y:l+c-N,horizontalAnchor:"middle",verticalAnchor:C},L):n==="insideTopLeft"?Fi({x:p+O,y:l+N,horizontalAnchor:z,verticalAnchor:E},L):n==="insideTopRight"?Fi({x:p+f-O,y:l+N,horizontalAnchor:P,verticalAnchor:E},L):n==="insideBottomLeft"?Fi({x:g+O,y:l+c-N,horizontalAnchor:z,verticalAnchor:C},L):n==="insideBottomRight"?Fi({x:g+h-O,y:l+c-N,horizontalAnchor:P,verticalAnchor:C},L):n&&typeof n=="object"&&(ze(n.x)||tl(n.x))&&(ze(n.y)||tl(n.y))?Fi({x:s+Fs(n.x,y),y:l+Fs(n.y,c),horizontalAnchor:"end",verticalAnchor:"end"},L):Fi({x:S,y:l+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},L)},Jfe=["labelRef"],ehe=["content"];function Pz(e,t){if(e==null)return{};var n,r,i=the(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function the(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 zz(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?zz(Object(n),!0).forEach(function(r){nhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nhe(e,t,n){return(t=rhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rhe(e){var t=ihe(e,"string");return typeof t=="symbol"?t:t+""}function ihe(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 ka(){return ka=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},ka.apply(null,arguments)}var l4=x.createContext(null),c4=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:s,height:l,children:c}=e,f=x.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:s,height:l}),[t,n,r,i,s,l]);return x.createElement(l4.Provider,{value:f},c)},u4=()=>{var e=x.useContext(l4),t=wf();return e||(t?oj(t):void 0)},ahe=x.createContext(null),she=()=>{var e=x.useContext(ahe),t=Re(e5);return e||t},ohe=e=>{var{value:t,formatter:n}=e,r=Un(e.children)?t:e.children;return typeof n=="function"?n(r):r},pN=e=>e!=null&&typeof e=="function",lhe=(e,t)=>{var n=ni(t-e),r=Math.min(Math.abs(t-e),360);return n*r},che=(e,t,n,r,i)=>{var{offset:s,className:l}=e,{cx:c,cy:f,innerRadius:h,outerRadius:p,startAngle:g,endAngle:v,clockWise:y}=i,S=(h+p)/2,w=lhe(g,v),N=w>=0?1:-1,C,E;switch(t){case"insideStart":C=g+N*s,E=y;break;case"insideEnd":C=v-N*s,E=!y;break;case"end":C=v+N*s,E=y;break;default:throw new Error("Unsupported position ".concat(t))}E=w<=0?E:!E;var A=$n(c,f,S,C),O=$n(c,f,S,C+(E?1:-1)*359),P="M".concat(A.x,",").concat(A.y,`
|
|
267
|
+
A`).concat(S,",").concat(S,",0,1,").concat(E?0:1,`,
|
|
268
|
+
`).concat(O.x,",").concat(O.y),z=Un(e.id)?Vd("recharts-radial-line-"):e.id;return x.createElement("text",ka({},r,{dominantBaseline:"central",className:gt("recharts-radial-bar-label",l)}),x.createElement("defs",null,x.createElement("path",{id:z,d:P})),x.createElement("textPath",{xlinkHref:"#".concat(z)},n))},uhe=(e,t,n)=>{var{cx:r,cy:i,innerRadius:s,outerRadius:l,startAngle:c,endAngle:f}=e,h=(c+f)/2;if(n==="outside"){var{x:p,y:g}=$n(r,i,l+t,h);return{x:p,y:g,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 v=(s+l)/2,{x:y,y:S}=$n(r,i,v,h);return{x:y,y:S,textAnchor:"middle",verticalAnchor:"middle"}},em=e=>e!=null&&"cx"in e&&ze(e.cx),dhe={angle:0,offset:5,zIndex:Yn.label,position:"middle",textBreakAll:!1};function fhe(e){if(!em(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 Os(e){var t=sr(e,dhe),{viewBox:n,parentViewBox:r,position:i,value:s,children:l,content:c,className:f="",textBreakAll:h,labelRef:p}=t,g=she(),v=u4(),y=i==="center"?v:g??v,S,w,N;n==null?S=y:em(n)?S=n:S=oj(n);var C=fhe(S);if(!S||Un(s)&&Un(l)&&!x.isValidElement(c)&&typeof c!="function")return null;var E=Od(Od({},t),{},{viewBox:S});if(x.isValidElement(c)){var{labelRef:A}=E,O=Pz(E,Jfe);return x.cloneElement(c,O)}if(typeof c=="function"){var{content:P}=E,z=Pz(E,ehe);if(w=x.createElement(c,z),x.isValidElement(w))return w}else w=ohe(t);var _=xr(t);if(em(S)){if(i==="insideStart"||i==="insideEnd"||i==="end")return che(t,i,w,_,S);N=uhe(S,t.offset,t.position)}else{if(!C)return null;var T=Xfe({viewBox:C,position:i,offset:t.offset,parentViewBox:em(r)?void 0:r});N=Od(Od({x:T.x,y:T.y,textAnchor:T.horizontalAnchor,verticalAnchor:T.verticalAnchor},T.width!==void 0?{width:T.width}:{}),T.height!==void 0?{height:T.height}:{})}return x.createElement(aa,{zIndex:t.zIndex},x.createElement(hN,ka({ref:p,className:gt("recharts-label",f)},_,N,{textAnchor:i4(_.textAnchor)?_.textAnchor:N.textAnchor,breakAll:h}),w))}Os.displayName="Label";var hhe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(Os,ka({key:"label-implicit"},r)):oi(e)?x.createElement(Os,ka({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===Os?x.cloneElement(e,Od({key:"label-implicit"},r)):x.createElement(Os,ka({key:"label-implicit",content:e},r)):pN(e)?x.createElement(Os,ka({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(Os,ka({},e,{key:"label-implicit"},r)):null};function d4(e){var{label:t,labelRef:n}=e,r=u4();return hhe(t,r,n)||null}var phe=["valueAccessor"],mhe=["dataKey","clockWise","id","textBreakAll","zIndex"];function dg(){return dg=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},dg.apply(null,arguments)}function Mz(e,t){if(e==null)return{};var n,r,i=ghe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ghe(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 vhe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(Kfe(t))return t},f4=x.createContext(void 0),yhe=f4.Provider,h4=x.createContext(void 0);h4.Provider;function bhe(){return x.useContext(f4)}function xhe(){return x.useContext(h4)}function tm(e){var{valueAccessor:t=vhe}=e,n=Mz(e,phe),{dataKey:r,clockWise:i,id:s,textBreakAll:l,zIndex:c}=n,f=Mz(n,mhe),h=bhe(),p=xhe(),g=h||p;return!g||!g.length?null:x.createElement(aa,{zIndex:c??Yn.label},x.createElement(_i,{className:"recharts-label-list"},g.map((v,y)=>{var S,w=Un(r)?t(v,y):On(v.payload,r),N=Un(s)?{}:{id:"".concat(s,"-").concat(y)};return x.createElement(Os,dg({key:"label-".concat(y)},xr(v),f,N,{fill:(S=n.fill)!==null&&S!==void 0?S:v.fill,parentViewBox:v.parentViewBox,value:w,textBreakAll:l,viewBox:v.viewBox,index:y,zIndex:0}))})))}tm.displayName="LabelList";function whe(e){var{label:t}=e;return t?t===!0?x.createElement(tm,{key:"labelList-implicit"}):x.isValidElement(t)||pN(t)?x.createElement(tm,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(tm,dg({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function PS(){return PS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PS.apply(null,arguments)}var p4=e=>{var{cx:t,cy:n,r,className:i}=e,s=gt("recharts-dot",i);return ze(t)&&ze(n)&&ze(r)?x.createElement("circle",PS({},Oi(e),Q1(e),{className:s,cx:t,cy:n,r})):null},She={radiusAxis:{},angleAxis:{}},m4=Wn({name:"polarAxis",initialState:She,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:Lye,removeRadiusAxis:$ye,addAngleAxis:Uye,removeAngleAxis:Bye}=m4.actions,jhe=m4.reducer;function Nhe(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var g4=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function Che(e){var{tooltipEntrySettings:t}=e,n=Yt(),r=or(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(aue(t)):i.current!==t&&n(sue({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(oue(i.current)),i.current=null)},[n]),null}function Ohe(e){var{legendPayload:t}=e,n=Yt(),r=or(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(qre(t)):i.current!==t&&n(Fre({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(Kre(i.current)),i.current=null)},[n]),null}var Jx,_he=()=>{var[e]=x.useState(()=>Vd("uid-"));return e},khe=(Jx=xg.useId)!==null&&Jx!==void 0?Jx:_he;function Ahe(e,t){var n=khe();return t||(e?"".concat(e,"-").concat(n):n)}var Ehe=x.createContext(void 0),The=e=>{var{id:t,type:n,children:r}=e,i=Ahe("recharts-".concat(n),t);return x.createElement(Ehe.Provider,{value:i},r(i))},Phe={cartesianItems:[],polarItems:[]},v4=Wn({name:"graphicalItems",initialState:Phe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:zt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ri(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:zt()},removeCartesianGraphicalItem:{reducer(e,t){var n=ri(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=ri(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=ri(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:zt()}}}),{addCartesianGraphicalItem:zhe,replaceCartesianGraphicalItem:Mhe,removeCartesianGraphicalItem:Rhe,addPolarGraphicalItem:qye,removePolarGraphicalItem:Fye,replacePolarGraphicalItem:Kye}=v4.actions,Dhe=v4.reducer,Ihe=e=>{var t=Yt(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(zhe(e)):n.current!==e&&t(Mhe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(Rhe(n.current)),n.current=null)},[t]),null},Lhe=x.memo(Ihe),$he=["points"];function Rz(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 ew(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rz(Object(n),!0).forEach(function(r){Uhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uhe(e,t,n){return(t=Bhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bhe(e){var t=qhe(e,"string");return typeof t=="symbol"?t:t+""}function qhe(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 fg(){return fg=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},fg.apply(null,arguments)}function Fhe(e,t){if(e==null)return{};var n,r,i=Khe(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Khe(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 Hhe(e){var{option:t,dotProps:n,className:r}=e;if(x.isValidElement(t))return x.cloneElement(t,n);if(typeof t=="function")return t(n);var i=gt(r,typeof t!="boolean"?t.className:""),s=n??{},{points:l}=s,c=Fhe(s,$he);return x.createElement(p4,fg({},c,{className:i}))}function Ghe(e,t){return e==null?!1:t?!0:e.length===1}function Vhe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:s,baseProps:l,needClip:c,clipPathId:f,zIndex:h=Yn.scatter}=e;if(!Ghe(t,n))return null;var p=g4(n),g=EJ(n),v=t.map((S,w)=>{var N,C,E=ew(ew(ew({r:3},l),g),{},{index:w,cx:(N=S.x)!==null&&N!==void 0?N:void 0,cy:(C=S.y)!==null&&C!==void 0?C:void 0,dataKey:s,value:S.value,payload:S.payload,points:t});return x.createElement(Hhe,{key:"dot-".concat(w),option:n,dotProps:E,className:i})}),y={};return c&&f!=null&&(y.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(f,")")),x.createElement(aa,{zIndex:h},x.createElement(_i,fg({className:r},y),v))}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){Zhe(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 Zhe(e,t,n){return(t=Yhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yhe(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 y4=0,Qhe={xAxis:{},yAxis:{},zAxis:{}},b4=Wn({name:"cartesianAxis",initialState:Qhe,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 s,l=i.widthHistory||[];if(l.length===3&&l[0]===l[2]&&r===l[1]&&r!==i.width&&Math.abs(r-((s=l[0])!==null&&s!==void 0?s:0))<=1)return;var c=[...l,r].slice(-3);e.yAxis[n]=Iz(Iz({},i),{},{width:r,widthHistory:c})}}}}),{addXAxis:Xhe,replaceXAxis:Jhe,removeXAxis:epe,addYAxis:tpe,replaceYAxis:npe,removeYAxis:rpe,addZAxis:Hye,replaceZAxis:Gye,removeZAxis:Vye,updateYAxisWidth:ipe}=b4.actions,ape=b4.reducer,spe=te([qn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),ope=te([spe,Ua,Ba],(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)}}),mN=()=>Re(ope),lpe=()=>Re(ade);function Lz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lz(Object(n),!0).forEach(function(r){cpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cpe(e,t,n){return(t=upe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function upe(e){var t=dpe(e,"string");return typeof t=="symbol"?t:t+""}function dpe(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 fpe=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:s,clipPath:l}=e;if(i===!1||t.x==null||t.y==null)return null;var c={index:n,dataKey:s,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},f=tw(tw(tw({},c),Xg(i)),Q1(i)),h;return x.isValidElement(i)?h=x.cloneElement(i,f):typeof i=="function"?h=i(f):h=x.createElement(p4,f),x.createElement(_i,{className:"recharts-active-dot",clipPath:l},h)};function $z(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:s,zIndex:l=Yn.activeDot}=e,c=Re(of),f=lpe();if(t==null||f==null)return null;var h=t.find(p=>f.includes(p.payload));return Un(h)?null:x.createElement(aa,{zIndex:l},x.createElement(fpe,{point:h,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:s}))}var hpe=e=>{var{chartData:t}=e,n=Yt(),r=or();return x.useEffect(()=>r?()=>{}:(n(gz(t)),()=>{n(gz(void 0))}),[t,n,r]),null},Uz={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},x4=Wn({name:"brush",initialState:Uz,reducers:{setBrushSettings(e,t){return t.payload==null?Uz:t.payload}}}),{setBrushSettings:Zye}=x4.actions,ppe=x4.reducer,mpe=(e,t)=>{var{x:n,y:r}=e,{x:i,y:s}=t;return{x:Math.min(n,i),y:Math.min(r,s),width:Math.abs(i-n),height:Math.abs(s-r)}},gpe=e=>{var{x1:t,y1:n,x2:r,y2:i}=e;return mpe({x:t,y:n},{x:r,y:i})};function vpe(e){return(e%180+180)%180}var ype=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=vpe(i),l=s*Math.PI/180,c=Math.atan(r/n),f=l>c&&l<Math.PI-c?r/Math.sin(l):n/Math.cos(l);return Math.abs(f)},bpe={dots:[],areas:[],lines:[]},w4=Wn({name:"referenceElements",initialState:bpe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=ri(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=ri(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=ri(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:Yye,removeDot:Wye,addArea:Qye,removeArea:Xye,addLine:xpe,removeLine:wpe}=w4.actions,Spe=w4.reducer,S4=x.createContext(void 0),jpe=e=>{var{children:t}=e,[n]=x.useState("".concat(Vd("recharts"),"-clip")),r=mN();if(r==null)return null;var{x:i,y:s,width:l,height:c}=r;return x.createElement(S4.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:i,y:s,height:c,width:l}))),t)},Npe=()=>x.useContext(S4);class Cpe{constructor(t){var{x:n,y:r}=t;this.xAxisScale=n,this.yAxisScale=r}map(t,n){var r,i,{position:s}=n;return{x:(r=this.xAxisScale.map(t.x,{position:s}))!==null&&r!==void 0?r:0,y:(i=this.yAxisScale.map(t.y,{position:s}))!==null&&i!==void 0?i:0}}mapWithFallback(t,n){var r,i,{position:s,fallback:l}=n,c,f;return l==="rangeMin"?c=this.yAxisScale.rangeMin():l==="rangeMax"?c=this.yAxisScale.rangeMax():c=0,l==="rangeMin"?f=this.xAxisScale.rangeMin():l==="rangeMax"?f=this.xAxisScale.rangeMax():f=0,{x:(r=this.xAxisScale.map(t.x,{position:s}))!==null&&r!==void 0?r:f,y:(i=this.yAxisScale.map(t.y,{position:s}))!==null&&i!==void 0?i:c}}isInRange(t){var{x:n,y:r}=t,i=n==null||this.xAxisScale.isInRange(n),s=r==null||this.yAxisScale.isInRange(r);return i&&s}}function Bz(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 qz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bz(Object(n),!0).forEach(function(r){Ope(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ope(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=kpe(e,"string");return typeof t=="symbol"?t:t+""}function kpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hg(){return hg=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},hg.apply(null,arguments)}var Ape=(e,t)=>{var n;if(x.isValidElement(e))n=x.cloneElement(e,t);else if(typeof e=="function")n=e(t);else{if(!We(t.x1)||!We(t.y1)||!We(t.x2)||!We(t.y2))return null;n=x.createElement("line",hg({},t,{className:"recharts-reference-line-line"}))}return n},Epe=(e,t,n,r,i,s)=>{var{x:l,width:c}=s,f=i.map(e,{position:n});if(!We(f)||t==="discard"&&!i.isInRange(f))return null;var h=[{x:l+c,y:f},{x:l,y:f}];return r==="left"?h.reverse():h},Tpe=(e,t,n,r,i,s)=>{var{y:l,height:c}=s,f=i.map(e,{position:n});if(!We(f)||t==="discard"&&!i.isInRange(f))return null;var h=[{x:f,y:l+c},{x:f,y:l}];return r==="top"?h.reverse():h},Ppe=(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(s=>!r.isInRange(s))?null:i},zpe=(e,t,n,r,i,s,l)=>{var{x:c,y:f,segment:h,ifOverflow:p}=l,g=oi(c),v=oi(f);return v?Epe(f,p,r,s,t,n):g?Tpe(c,p,r,i,e,n):h!=null&&h.length===2?Ppe(h,p,r,new Cpe({x:e,y:t})):null};function Mpe(e){var t=Yt();return x.useEffect(()=>(t(xpe(e)),()=>{t(wpe(e))})),null}function Rpe(e){var{xAxisId:t,yAxisId:n,shape:r,className:i,ifOverflow:s}=e,l=or(),c=Npe(),f=Re(_=>ra(_,t)),h=Re(_=>ia(_,n)),p=Re(_=>Hc(_,"xAxis",t,l)),g=Re(_=>Hc(_,"yAxis",n,l)),v=wf();if(!c||!v||f==null||h==null||p==null||g==null)return null;var y=zpe(p,g,v,e.position,f.orientation,h.orientation,e);if(!y)return null;var S=y[0],w=y[1];if(S==null||w==null)return null;var{x:N,y:C}=S,{x:E,y:A}=w,O=s==="hidden"?"url(#".concat(c,")"):void 0,P=qz(qz({clipPath:O},xr(e)),{},{x1:N,y1:C,x2:E,y2:A}),z=gpe({x1:N,y1:C,x2:E,y2:A});return x.createElement(aa,{zIndex:e.zIndex},x.createElement(_i,{className:gt("recharts-reference-line",i)},Ape(r,P),x.createElement(c4,hg({},z,{lowerWidth:z.width,upperWidth:z.width}),x.createElement(d4,{label:e.label}),e.children)))}var Dpe={ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",label:!1,stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle",zIndex:Yn.line};function j4(e){var t=sr(e,Dpe);return x.createElement(x.Fragment,null,x.createElement(Mpe,{yAxisId:t.yAxisId,xAxisId:t.xAxisId,ifOverflow:t.ifOverflow,x:t.x,y:t.y,segment:t.segment}),x.createElement(Rpe,t))}j4.displayName="ReferenceLine";function N4(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 Ipe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return ype(r,n)}function Lpe(e,t,n){var r=n==="width",{x:i,y:s,width:l,height:c}=e;return t===1?{start:r?i:s,end:r?i+l:s+c}:{start:r?i+l:s+c,end:r?i:s}}function cf(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var s=n();return e*(t-e*s/2-r)>=0&&e*(t+e*s/2-i)<=0}function $pe(e,t){return N4(e,t+1)}function Upe(e,t,n,r,i){for(var s=(r||[]).slice(),{start:l,end:c}=t,f=0,h=1,p=l,g=function(){var S=r?.[f];if(S===void 0)return{v:N4(r,h)};var w=f,N,C=()=>(N===void 0&&(N=n(S,w)),N),E=S.coordinate,A=f===0||cf(e,E,C,p,c);A||(f=0,p=l,h+=1),A&&(p=E+e*(C()/2+i),f+=h)},v;h<=s.length;)if(v=g(),v)return v.v;return[]}function Bpe(e,t,n,r,i){var s=(r||[]).slice(),l=s.length;if(l===0)return[];for(var{start:c,end:f}=t,h=1;h<=l;h++){for(var p=(l-1)%h,g=c,v=!0,y=function(){var O=r[w];if(O==null)return 0;var P=w,z,_=()=>(z===void 0&&(z=n(O,P)),z),T=O.coordinate,R=w===p||cf(e,T,_,g,f);if(!R)return v=!1,1;R&&(g=T+e*(_()/2+i))},S,w=p;w<l&&(S=y(),!(S!==0&&S===1));w+=h);if(v){for(var N=[],C=p;C<l;C+=h){var E=r[C];E!=null&&N.push(E)}return N}}return[]}function Fz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Hn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fz(Object(n),!0).forEach(function(r){qpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qpe(e,t,n){return(t=Fpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fpe(e){var t=Kpe(e,"string");return typeof t=="symbol"?t:t+""}function Kpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hpe(e,t,n,r,i){for(var s=(r||[]).slice(),l=s.length,{start:c}=t,{end:f}=t,h=function(v){var y=s[v];if(y==null)return 1;var S=y,w,N=()=>(w===void 0&&(w=n(y,v)),w);if(v===l-1){var C=e*(S.coordinate+e*N()/2-f);s[v]=S=Hn(Hn({},S),{},{tickCoord:C>0?S.coordinate-C*e:S.coordinate})}else s[v]=S=Hn(Hn({},S),{},{tickCoord:S.coordinate});if(S.tickCoord!=null){var E=cf(e,S.tickCoord,N,c,f);E&&(f=S.tickCoord-e*(N()/2+i),s[v]=Hn(Hn({},S),{},{isShow:!0}))}},p=l-1;p>=0;p--)h(p);return s}function Gpe(e,t,n,r,i,s){var l=(r||[]).slice(),c=l.length,{start:f,end:h}=t;if(s){var p=r[c-1];if(p!=null){var g=n(p,c-1),v=e*(p.coordinate+e*g/2-h);if(l[c-1]=p=Hn(Hn({},p),{},{tickCoord:v>0?p.coordinate-v*e:p.coordinate}),p.tickCoord!=null){var y=cf(e,p.tickCoord,()=>g,f,h);y&&(h=p.tickCoord-e*(g/2+i),l[c-1]=Hn(Hn({},p),{},{isShow:!0}))}}}for(var S=s?c-1:c,w=function(E){var A=l[E];if(A==null)return 1;var O=A,P,z=()=>(P===void 0&&(P=n(A,E)),P);if(E===0){var _=e*(O.coordinate-e*z()/2-f);l[E]=O=Hn(Hn({},O),{},{tickCoord:_<0?O.coordinate-_*e:O.coordinate})}else l[E]=O=Hn(Hn({},O),{},{tickCoord:O.coordinate});if(O.tickCoord!=null){var T=cf(e,O.tickCoord,z,f,h);T&&(f=O.tickCoord+e*(z()/2+i),l[E]=Hn(Hn({},O),{},{isShow:!0}))}},N=0;N<S;N++)w(N);return l}function gN(e,t,n){var{tick:r,ticks:i,viewBox:s,minTickGap:l,orientation:c,interval:f,tickFormatter:h,unit:p,angle:g}=e;if(!i||!i.length||!r)return[];if(ze(f)||Cf.isSsr){var v;return(v=$pe(i,ze(f)?f:0))!==null&&v!==void 0?v:[]}var y=[],S=c==="top"||c==="bottom"?"width":"height",w=p&&S==="width"?zd(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},N=(P,z)=>{var _=typeof h=="function"?h(P.value,z):P.value;return S==="width"?Ipe(zd(_,{fontSize:t,letterSpacing:n}),w,g):zd(_,{fontSize:t,letterSpacing:n})[S]},C=i[0],E=i[1],A=i.length>=2&&C!=null&&E!=null?ni(E.coordinate-C.coordinate):1,O=Lpe(s,A,S);return f==="equidistantPreserveStart"?Upe(A,O,N,i,l):f==="equidistantPreserveEnd"?Bpe(A,O,N,i,l):(f==="preserveStart"||f==="preserveStartEnd"?y=Gpe(A,O,N,i,l,f==="preserveStartEnd"):y=Hpe(A,O,N,i,l),y.filter(P=>P.isShow))}var Vpe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:s=0}=e,l=0;if(t){Array.from(t).forEach(p=>{if(p){var g=p.getBoundingClientRect();g.width>l&&(l=g.width)}});var c=n?n.getBoundingClientRect().width:0,f=i+s,h=l+f+c+(n?r:0);return Math.round(h)}return 0},Zpe={xAxis:{},yAxis:{}},C4=Wn({name:"renderedTicks",initialState:Zpe,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:Ype,removeRenderedTicks:Wpe}=C4.actions,Qpe=C4.reducer,Xpe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function Jpe(e,t){if(e==null)return{};var n,r,i=eme(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function eme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ol(){return ol=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},ol.apply(null,arguments)}function Kz(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 en(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Kz(Object(n),!0).forEach(function(r){tme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tme(e,t,n){return(t=nme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nme(e){var t=rme(e,"string");return typeof t=="symbol"?t:t+""}function rme(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 Ma={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:Yn.axis};function ime(e){var{x:t,y:n,width:r,height:i,orientation:s,mirror:l,axisLine:c,otherSvgProps:f}=e;if(!c)return null;var h=en(en(en({},f),Oi(c)),{},{fill:"none"});if(s==="top"||s==="bottom"){var p=+(s==="top"&&!l||s==="bottom"&&l);h=en(en({},h),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var g=+(s==="left"&&!l||s==="right"&&l);h=en(en({},h),{},{x1:t+g*r,y1:n,x2:t+g*r,y2:n+i})}return x.createElement("line",ol({},h,{className:gt("recharts-cartesian-axis-line",nv(c,"className"))}))}function ame(e,t,n,r,i,s,l,c,f){var h,p,g,v,y,S,w=c?-1:1,N=e.tickSize||l,C=ze(e.tickCoord)?e.tickCoord:e.coordinate;switch(s){case"top":h=p=e.coordinate,v=n+ +!c*i,g=v-w*N,S=g-w*f,y=C;break;case"left":g=v=e.coordinate,p=t+ +!c*r,h=p-w*N,y=h-w*f,S=C;break;case"right":g=v=e.coordinate,p=t+ +c*r,h=p+w*N,y=h+w*f,S=C;break;default:h=p=e.coordinate,v=n+ +c*i,g=v+w*N,S=g+w*f,y=C;break}return{line:{x1:h,y1:g,x2:p,y2:v},tick:{x:y,y:S}}}function sme(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function ome(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function lme(e){var{option:t,tickProps:n,value:r}=e,i,s=gt(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))i=x.cloneElement(t,en(en({},n),{},{className:s}));else if(typeof t=="function")i=t(en(en({},n),{},{className:s}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=gt(l,Nhe(t))),i=x.createElement(hN,ol({},n,{className:l}),r)}return i}function cme(e){var{ticks:t,axisType:n,axisId:r}=e,i=Yt();return x.useEffect(()=>{if(r==null||n==null)return nu;var s=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(Ype({ticks:s,axisId:r,axisType:n})),()=>{i(Wpe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var ume=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:s,tickFormatter:l,unit:c,padding:f,tickTextProps:h,orientation:p,mirror:g,x:v,y,width:S,height:w,tickSize:N,tickMargin:C,fontSize:E,letterSpacing:A,getTicksConfig:O,events:P,axisType:z,axisId:_}=e,T=gN(en(en({},O),{},{ticks:n}),E,A),R=Oi(O),B=Xg(r),$=i4(R.textAnchor)?R.textAnchor:sme(p,g),L=ome(p,g),ne={};typeof i=="object"&&(ne=i);var he=en(en({},R),{},{fill:"none"},ne),ge=T.map(pe=>en({entry:pe},ame(pe,v,y,S,w,p,N,g,C))),H=ge.map(pe=>{var{entry:we,line:q}=pe;return x.createElement(_i,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(we.value,"-").concat(we.coordinate,"-").concat(we.tickCoord)},i&&x.createElement("line",ol({},he,q,{className:gt("recharts-cartesian-axis-tick-line",nv(i,"className"))})))}),ie=ge.map((pe,we)=>{var q,D,{entry:G,tick:ae}=pe,Y=en(en(en(en({verticalAnchor:L},R),{},{textAnchor:$,stroke:"none",fill:s},ae),{},{index:we,payload:G,visibleTicksCount:T.length,tickFormatter:l,padding:f},h),{},{angle:(q=(D=h?.angle)!==null&&D!==void 0?D:R.angle)!==null&&q!==void 0?q:0}),W=en(en({},Y),B);return x.createElement(_i,ol({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(G.value,"-").concat(G.coordinate,"-").concat(G.tickCoord)},mL(P,G,we)),r&&x.createElement(lme,{option:r,tickProps:W,value:"".concat(typeof l=="function"?l(G.value,we):G.value).concat(c||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(z,"-ticks")},x.createElement(cme,{ticks:T,axisId:_,axisType:z}),ie.length>0&&x.createElement(aa,{zIndex:Yn.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(z,"-tick-labels"),ref:t},ie)),H.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(z,"-tick-lines")},H))}),dme=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:s,hide:l,ticks:c,axisType:f,axisId:h}=e,p=Jpe(e,Xpe),[g,v]=x.useState(""),[y,S]=x.useState(""),w=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var C;return Vpe({ticks:w.current,label:(C=e.labelRef)===null||C===void 0?void 0:C.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var N=x.useCallback(C=>{if(C){var E=C.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=E;var A=E[0];if(A){var O=window.getComputedStyle(A),P=O.fontSize,z=O.letterSpacing;(P!==g||z!==y)&&(v(P),S(z))}}},[g,y]);return l||r!=null&&r<=0||i!=null&&i<=0?null:x.createElement(aa,{zIndex:e.zIndex},x.createElement(_i,{className:gt("recharts-cartesian-axis",s)},x.createElement(ime,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Oi(e)}),x.createElement(ume,{ref:N,axisType:f,events:p,fontSize:g,getTicksConfig:e,height:e.height,letterSpacing:y,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:c,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:h}),x.createElement(c4,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(d4,{label:e.label,labelRef:e.labelRef}),e.children)))}),vN=x.forwardRef((e,t)=>{var n=sr(e,Ma);return x.createElement(dme,ol({},n,{ref:t}))});vN.displayName="CartesianAxis";var fme=["x1","y1","x2","y2","key"],hme=["offset"],pme=["xAxisId","yAxisId"],mme=["xAxisId","yAxisId"];function Hz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hz(Object(n),!0).forEach(function(r){gme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gme(e,t,n){return(t=vme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vme(e){var t=yme(e,"string");return typeof t=="symbol"?t:t+""}function yme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $o(){return $o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$o.apply(null,arguments)}function pg(e,t){if(e==null)return{};var n,r,i=bme(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var xme=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:s,height:l,ry:c}=e;return x.createElement("rect",{x:r,y:i,ry:c,width:s,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function O4(e){var{option:t,lineItemProps:n}=e,r;if(x.isValidElement(t))r=x.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:s,y1:l,x2:c,y2:f,key:h}=n,p=pg(n,fme),g=(i=Oi(p))!==null&&i!==void 0?i:{},{offset:v}=g,y=pg(g,hme);r=x.createElement("line",$o({},y,{x1:s,y1:l,x2:c,y2:f,fill:"none",key:h}))}return r}function wme(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:s,yAxisId:l}=e,c=pg(e,pme),f=i.map((h,p)=>{var g=Zn(Zn({},c),{},{x1:t,y1:h,x2:t+n,y2:h,key:"line-".concat(p),index:p});return x.createElement(O4,{key:"line-".concat(p),option:r,lineItemProps:g})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},f)}function Sme(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:s,yAxisId:l}=e,c=pg(e,mme),f=i.map((h,p)=>{var g=Zn(Zn({},c),{},{x1:h,y1:t,x2:h,y2:t+n,key:"line-".concat(p),index:p});return x.createElement(O4,{option:r,lineItemProps:g,key:"line-".concat(p)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},f)}function jme(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:s,height:l,horizontalPoints:c,horizontal:f=!0}=e;if(!f||!t||!t.length||c==null)return null;var h=c.map(g=>Math.round(g+i-i)).sort((g,v)=>g-v);i!==h[0]&&h.unshift(0);var p=h.map((g,v)=>{var y=h[v+1],S=y==null,w=S?i+l-g:y-g;if(w<=0)return null;var N=v%t.length;return x.createElement("rect",{key:"react-".concat(v),y:g,x:r,height:w,width:s,stroke:"none",fill:t[N],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function Nme(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:s,width:l,height:c,verticalPoints:f}=e;if(!t||!n||!n.length)return null;var h=f.map(g=>Math.round(g+i-i)).sort((g,v)=>g-v);i!==h[0]&&h.unshift(0);var p=h.map((g,v)=>{var y=h[v+1],S=y==null,w=S?i+l-g:y-g;if(w<=0)return null;var N=v%n.length;return x.createElement("rect",{key:"react-".concat(v),x:g,y:s,width:w,height:c,stroke:"none",fill:n[N],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var Cme=(e,t)=>{var{xAxis:n,width:r,height:i,offset:s}=e;return l$(gN(Zn(Zn(Zn({},Ma),n),{},{ticks:c$(n),viewBox:{x:0,y:0,width:r,height:i}})),s.left,s.left+s.width,t)},Ome=(e,t)=>{var{yAxis:n,width:r,height:i,offset:s}=e;return l$(gN(Zn(Zn(Zn({},Ma),n),{},{ticks:c$(n),viewBox:{x:0,y:0,width:r,height:i}})),s.top,s.top+s.height,t)},_me={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Yn.grid};function _4(e){var t=lj(),n=cj(),r=v$(),i=Zn(Zn({},sr(e,_me)),{},{x:ze(e.x)?e.x:r.left,y:ze(e.y)?e.y:r.top,width:ze(e.width)?e.width:r.width,height:ze(e.height)?e.height:r.height}),{xAxisId:s,yAxisId:l,x:c,y:f,width:h,height:p,syncWithTicks:g,horizontalValues:v,verticalValues:y}=i,S=or(),w=Re(R=>rz(R,"xAxis",s,S)),N=Re(R=>rz(R,"yAxis",l,S));if(!Ji(h)||!Ji(p)||!ze(c)||!ze(f))return null;var C=i.verticalCoordinatesGenerator||Cme,E=i.horizontalCoordinatesGenerator||Ome,{horizontalPoints:A,verticalPoints:O}=i;if((!A||!A.length)&&typeof E=="function"){var P=v&&v.length,z=E({yAxis:N?Zn(Zn({},N),{},{ticks:P?v:N.ticks}):void 0,width:t??h,height:n??p,offset:r},P?!0:g);Um(Array.isArray(z),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof z,"]")),Array.isArray(z)&&(A=z)}if((!O||!O.length)&&typeof C=="function"){var _=y&&y.length,T=C({xAxis:w?Zn(Zn({},w),{},{ticks:_?y:w.ticks}):void 0,width:t??h,height:n??p,offset:r},_?!0:g);Um(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof T,"]")),Array.isArray(T)&&(O=T)}return x.createElement(aa,{zIndex:i.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(xme,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(jme,$o({},i,{horizontalPoints:A})),x.createElement(Nme,$o({},i,{verticalPoints:O})),x.createElement(wme,$o({},i,{offset:r,horizontalPoints:A,xAxis:w,yAxis:N})),x.createElement(Sme,$o({},i,{offset:r,verticalPoints:O,xAxis:w,yAxis:N}))))}_4.displayName="CartesianGrid";var kme={},k4=Wn({name:"errorBars",initialState:kme,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(s=>s.dataKey===r.dataKey&&s.direction===r.direction?i:s))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:Jye,replaceErrorBar:e0e,removeErrorBar:t0e}=k4.actions,Ame=k4.reducer;function A4(e,t){var n,r,i=Re(h=>ra(h,e)),s=Re(h=>ia(h,t)),l=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:bn.allowDataOverflow,c=(r=s?.allowDataOverflow)!==null&&r!==void 0?r:xn.allowDataOverflow,f=l||c;return{needClip:f,needClipX:l,needClipY:c}}function Eme(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=mN(),{needClipX:s,needClipY:l,needClip:c}=A4(t,n);if(!c||!i)return null;var{x:f,y:h,width:p,height:g}=i;return x.createElement("clipPath",{id:"clipPath-".concat(r)},x.createElement("rect",{x:s?f:f-p/2,y:l?h:h-g/2,width:s?p:p*2,height:l?g:g*2}))}function Tme(e){var t=Xg(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:s}=t,l=Number(i),c=Number(s);return(Number.isNaN(l)||l<0)&&(l=n),(Number.isNaN(c)||c<0)&&(c=r),{r:l,strokeWidth:c}}return{r:n,strokeWidth:r}}function yN(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:y4}function bN(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:y4}var E4=(e,t,n)=>w3(e,"xAxis",yN(e,t),n),T4=(e,t,n)=>x3(e,"xAxis",yN(e,t),n),P4=(e,t,n)=>w3(e,"yAxis",bN(e,t),n),z4=(e,t,n)=>x3(e,"yAxis",bN(e,t),n),Pme=te([qt,E4,P4,T4,z4],(e,t,n,r,i)=>na(e,"xAxis")?$m(t,r,!1):$m(n,i,!1)),zme=(e,t)=>t,M4=te([q5,zme],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),R4=e=>{var t=qt(e),n=na(t,"xAxis");return n?"yAxis":"xAxis"},Mme=(e,t)=>{var n=R4(e);return n==="yAxis"?bN(e,t):yN(e,t)},Rme=(e,t,n)=>X5(e,R4(e),Mme(e,t),n),Dme=te([M4,Rme],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=jj(e);if(!(r==null||i==null)){var s=(n=t[r])===null||n===void 0?void 0:n.stackedData,l=s?.find(c=>c.key===i);if(l!=null)return l.map(c=>[c[0],c[1]])}}}),Ime=te([qt,E4,P4,T4,z4,Dme,tse,Pme,M4,use],(e,t,n,r,i,s,l,c,f,h)=>{var{chartData:p,dataStartIndex:g,dataEndIndex:v}=l;if(!(f==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||c==null)){var{data:y}=f,S;if(y&&y.length>0?S=y:S=p?.slice(g,v+1),S!=null)return rge({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:g,areaSettings:f,stackedData:s,displayedData:S,chartBaseValue:h,bandSize:c})}}),Lme=["id"],$me=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Zo(){return Zo=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},Zo.apply(null,arguments)}function D4(e,t){if(e==null)return{};var n,r,i=Ume(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ume(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 Gz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Nc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Gz(Object(n),!0).forEach(function(r){Bme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bme(e,t,n){return(t=qme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qme(e){var t=Fme(e,"string");return typeof t=="symbol"?t:t+""}function Fme(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 mg(e,t){return e&&e!=="none"?e:t}var Kme=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:s,hide:l}=e;return[{inactive:l,dataKey:t,type:s,color:mg(r,i),value:u$(n,t),payload:e}]},Hme=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:s,name:l,hide:c,unit:f,tooltipType:h,id:p}=e,g={dataDefinedOnItem:n,getPosition:nu,settings:{stroke:r,strokeWidth:i,fill:s,dataKey:t,nameKey:void 0,name:u$(l,t),hide:c,type:h,color:mg(r,s),unit:f,graphicalItemId:p}};return x.createElement(Che,{tooltipEntrySettings:g})});function Gme(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:s,dataKey:l}=r,c=Oi(r);return x.createElement(Vhe,{points:n,dot:s,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:c,needClip:i,clipPathId:t})}function Vme(e){var{showLabels:t,children:n,points:r}=e,i=r.map(s=>{var l,c,f={x:(l=s.x)!==null&&l!==void 0?l:0,y:(c=s.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Nc(Nc({},f),{},{value:s.value,payload:s.payload,parentViewBox:void 0,viewBox:f,fill:void 0})});return x.createElement(yhe,{value:t?i:void 0},n)}function Vz(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:s}=e,{layout:l,type:c,stroke:f,connectNulls:h,isRange:p}=s,{id:g}=s,v=D4(s,Lme),y=Oi(v),S=xr(v);return x.createElement(x.Fragment,null,t?.length>1&&x.createElement(_i,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},x.createElement(Jp,Zo({},S,{id:g,points:t,connectNulls:h,type:c,baseLine:n,layout:l,stroke:"none",className:"recharts-area-area"})),f!=="none"&&x.createElement(Jp,Zo({},y,{className:"recharts-area-curve",layout:l,type:c,connectNulls:h,fill:"none",points:t})),f!=="none"&&p&&Array.isArray(n)&&x.createElement(Jp,Zo({},y,{className:"recharts-area-curve",layout:l,type:c,connectNulls:h,fill:"none",points:n}))),x.createElement(Gme,{points:t,props:v,clipPathId:i}))}function Zme(e){var t,n,{alpha:r,baseLine:i,points:s,strokeWidth:l}=e,c=(t=s[0])===null||t===void 0?void 0:t.y,f=(n=s[s.length-1])===null||n===void 0?void 0:n.y;if(!We(c)||!We(f))return null;var h=r*Math.abs(c-f),p=Math.max(...s.map(g=>g.x||0));return ze(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(g=>g.x||0),p)),ze(p)?x.createElement("rect",{x:0,y:c<f?c:c-h,width:p+(l?parseInt("".concat(l),10):1),height:Math.floor(h)}):null}function Yme(e){var t,n,{alpha:r,baseLine:i,points:s,strokeWidth:l}=e,c=(t=s[0])===null||t===void 0?void 0:t.x,f=(n=s[s.length-1])===null||n===void 0?void 0:n.x;if(!We(c)||!We(f))return null;var h=r*Math.abs(c-f),p=Math.max(...s.map(g=>g.y||0));return ze(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(g=>g.y||0),p)),ze(p)?x.createElement("rect",{x:c<f?c:c-h,y:0,width:h,height:Math.floor(p+(l?parseInt("".concat(l),10):1))}):null}function Wme(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:s}=e;return n==="vertical"?x.createElement(Zme,{alpha:t,points:r,baseLine:i,strokeWidth:s}):x.createElement(Yme,{alpha:t,points:r,baseLine:i,strokeWidth:s})}function Qme(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:s}=e,{points:l,baseLine:c,isAnimationActive:f,animationBegin:h,animationDuration:p,animationEasing:g,onAnimationStart:v,onAnimationEnd:y}=r,S=x.useMemo(()=>({points:l,baseLine:c}),[l,c]),w=z$(S,"recharts-area-"),N=uj(),[C,E]=x.useState(!1),A=!C,O=x.useCallback(()=>{typeof y=="function"&&y(),E(!1)},[y]),P=x.useCallback(()=>{typeof v=="function"&&v(),E(!0)},[v]);if(N==null)return null;var z=i.current,_=s.current;return x.createElement(Vme,{showLabels:A,points:l},r.children,x.createElement(P$,{animationId:w,begin:h,duration:p,isActive:f,easing:g,onAnimationEnd:O,onAnimationStart:P,key:w},T=>{if(z){var R=z.length/l.length,B=T===1?l:l.map((L,ne)=>{var he=Math.floor(ne*R);if(z[he]){var ge=z[he];return Nc(Nc({},L),{},{x:Hi(ge.x,L.x,T),y:Hi(ge.y,L.y,T)})}return L}),$;return ze(c)?$=Hi(_,c,T):Un(c)||Xi(c)?$=Hi(_,0,T):$=c.map((L,ne)=>{var he=Math.floor(ne*R);if(Array.isArray(_)&&_[he]){var ge=_[he];return Nc(Nc({},L),{},{x:Hi(ge.x,L.x,T),y:Hi(ge.y,L.y,T)})}return L}),T>0&&(i.current=B,s.current=$),x.createElement(Vz,{points:B,baseLine:$,needClip:t,clipPathId:n,props:r})}return T>0&&(i.current=l,s.current=c),x.createElement(_i,null,f&&x.createElement("defs",null,x.createElement("clipPath",{id:"animationClipPath-".concat(n)},x.createElement(Wme,{alpha:T,points:l,baseLine:c,layout:N,strokeWidth:r.strokeWidth}))),x.createElement(_i,{clipPath:"url(#animationClipPath-".concat(n,")")},x.createElement(Vz,{points:l,baseLine:c,needClip:t,clipPathId:n,props:r})))}),x.createElement(whe,{label:r.label}))}function Xme(e){var{needClip:t,clipPathId:n,props:r}=e,i=x.useRef(null),s=x.useRef();return x.createElement(Qme,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:s})}class Jme extends x.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:s,left:l,needClip:c,xAxisId:f,yAxisId:h,width:p,height:g,id:v,baseLine:y,zIndex:S}=this.props;if(t)return null;var w=gt("recharts-area",i),N=v,{r:C,strokeWidth:E}=Tme(n),A=g4(n),O=C*2+E,P=c?"url(#clipPath-".concat(A?"":"dots-").concat(N,")"):void 0;return x.createElement(aa,{zIndex:S},x.createElement(_i,{className:w},c&&x.createElement("defs",null,x.createElement(Eme,{clipPathId:N,xAxisId:f,yAxisId:h}),!A&&x.createElement("clipPath",{id:"clipPath-dots-".concat(N)},x.createElement("rect",{x:l-O/2,y:s-O/2,width:p+O,height:g+O}))),x.createElement(Xme,{needClip:c,clipPathId:N,props:this.props})),x.createElement($z,{points:r,mainColor:mg(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:P}),this.props.isRange&&Array.isArray(y)&&x.createElement($z,{points:y,mainColor:mg(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:P}))}}var ege={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:Yn.area};function tge(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:s,connectNulls:l,dot:c,fill:f,fillOpacity:h,hide:p,isAnimationActive:g,legendType:v,stroke:y,xAxisId:S,yAxisId:w}=e,N=D4(e,$me),C=ru(),E=K3(),{needClip:A}=A4(S,w),O=or(),{points:P,isRange:z,baseLine:_}=(t=Re(ne=>Ime(ne,e.id,O)))!==null&&t!==void 0?t:{},T=mN();if(C!=="horizontal"&&C!=="vertical"||T==null||E!=="AreaChart"&&E!=="ComposedChart")return null;var{height:R,width:B,x:$,y:L}=T;return!P||!P.length?null:x.createElement(Jme,Zo({},N,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:s,baseLine:_,connectNulls:l,dot:c,fill:f,fillOpacity:h,height:R,hide:p,layout:C,isAnimationActive:g,isRange:z,legendType:v,needClip:A,points:P,stroke:y,width:B,left:$,top:L,xAxisId:S,yAxisId:w}))}var nge=(e,t,n,r,i)=>{var s=n??t;if(ze(s))return s;var l=e==="horizontal"?i:r,c=l.scale.domain();if(l.type==="number"){var f=Math.max(c[0],c[1]),h=Math.min(c[0],c[1]);return s==="dataMin"?h:s==="dataMax"||f<0?f:Math.max(Math.min(c[0],c[1]),0)}return s==="dataMin"?c[0]:s==="dataMax"?c[1]:c[0]};function rge(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:s,chartBaseValue:l,xAxis:c,yAxis:f,displayedData:h,dataStartIndex:p,xAxisTicks:g,yAxisTicks:v,bandSize:y}=e,S=i&&i.length,w=nge(s,l,n,c,f),N=s==="horizontal",C=!1,E=h.map((O,P)=>{var z,_,T,R;if(S)R=i[p+P];else{var B=On(O,r);Array.isArray(B)?(R=B,C=!0):R=[w,B]}var $=(z=(_=R)===null||_===void 0?void 0:_[1])!==null&&z!==void 0?z:null,L=$==null||S&&!t&&On(O,r)==null;if(N){var ne;return{x:QT({axis:c,ticks:g,bandSize:y,entry:O,index:P}),y:L?null:(ne=f.scale.map($))!==null&&ne!==void 0?ne:null,value:R,payload:O}}return{x:L?null:(T=c.scale.map($))!==null&&T!==void 0?T:null,y:QT({axis:f,ticks:v,bandSize:y,entry:O,index:P}),value:R,payload:O}}),A;return S||C?A=E.map(O=>{var P,z=Array.isArray(O.value)?O.value[0]:null;if(N){var _;return{x:O.x,y:z!=null&&O.y!=null&&(_=f.scale.map(z))!==null&&_!==void 0?_:null,payload:O.payload}}return{x:z!=null&&(P=c.scale.map(z))!==null&&P!==void 0?P:null,y:O.y,payload:O.payload}}):A=N?f.scale.map(w):c.scale.map(w),{points:E,baseLine:A??0,isRange:C}}function ige(e){var t=sr(e,ege),n=or();return x.createElement(The,{id:t.id,type:"area"},r=>x.createElement(x.Fragment,null,x.createElement(Ohe,{legendPayload:Kme(t)}),x.createElement(Hme,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),x.createElement(Lhe,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:Kne(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),x.createElement(tge,Zo({},t,{id:r}))))}var gg=x.memo(ige,Nf);gg.displayName="Area";var age=["domain","range"],sge=["domain","range"];function Zz(e,t){if(e==null)return{};var n,r,i=oge(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function oge(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 Yz(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 I4(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=Zz(e,age),{domain:s,range:l}=t,c=Zz(t,sge);return!Yz(n,s)||!Yz(r,l)?!1:Nf(i,c)}var lge=["type"],cge=["dangerouslySetInnerHTML","ticks","scale"],uge=["id","scale"];function zS(){return zS=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},zS.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 Qz(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){dge(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 dge(e,t,n){return(t=fge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fge(e){var t=hge(e,"string");return typeof t=="symbol"?t:t+""}function hge(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 MS(e,t){if(e==null)return{};var n,r,i=pge(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function pge(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 mge(e){var t=Yt(),n=x.useRef(null),r=uj(),{type:i}=e,s=MS(e,lge),l=jv(r,"xAxis",i),c=x.useMemo(()=>{if(l!=null)return Qz(Qz({},s),{},{type:l})},[s,l]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(Xhe(c)):n.current!==c&&t(Jhe({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(epe(n.current)),n.current=null)},[t]),null}var gge=e=>{var{xAxisId:t,className:n}=e,r=Re(f$),i=or(),s="xAxis",l=Re(C=>b3(C,s,t,i)),c=Re(C=>Uce(C,t)),f=Re(C=>Gce(C,t)),h=Re(C=>L5(C,t));if(c==null||f==null||h==null)return null;var{dangerouslySetInnerHTML:p,ticks:g,scale:v}=e,y=MS(e,cge),{id:S,scale:w}=h,N=MS(h,uge);return x.createElement(vN,zS({},y,N,{x:f.x,y:f.y,width:c.width,height:c.height,className:gt("recharts-".concat(s," ").concat(s),n),viewBox:r,ticks:l,axisType:s,axisId:t}))},vge={allowDataOverflow:bn.allowDataOverflow,allowDecimals:bn.allowDecimals,allowDuplicatedCategory:bn.allowDuplicatedCategory,angle:bn.angle,axisLine:Ma.axisLine,height:bn.height,hide:!1,includeHidden:bn.includeHidden,interval:bn.interval,label:!1,minTickGap:bn.minTickGap,mirror:bn.mirror,orientation:bn.orientation,padding:bn.padding,reversed:bn.reversed,scale:bn.scale,tick:bn.tick,tickCount:bn.tickCount,tickLine:Ma.tickLine,tickSize:Ma.tickSize,type:bn.type,niceTicks:bn.niceTicks,xAxisId:0},yge=e=>{var t=sr(e,vge);return x.createElement(x.Fragment,null,x.createElement(mge,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),x.createElement(gge,t))},xN=x.memo(yge,I4);xN.displayName="XAxis";var bge=["type"],xge=["dangerouslySetInnerHTML","ticks","scale"],wge=["id","scale"];function RS(){return RS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RS.apply(null,arguments)}function 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 Jz(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){Sge(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 Sge(e,t,n){return(t=jge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jge(e){var t=Nge(e,"string");return typeof t=="symbol"?t:t+""}function Nge(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 DS(e,t){if(e==null)return{};var n,r,i=Cge(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Cge(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 Oge(e){var t=Yt(),n=x.useRef(null),r=uj(),{type:i}=e,s=DS(e,bge),l=jv(r,"yAxis",i),c=x.useMemo(()=>{if(l!=null)return Jz(Jz({},s),{},{type:l})},[l,s]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(tpe(c)):n.current!==c&&t(npe({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(rpe(n.current)),n.current=null)},[t]),null}function _ge(e){var{yAxisId:t,className:n,width:r,label:i}=e,s=x.useRef(null),l=x.useRef(null),c=Re(f$),f=or(),h=Yt(),p="yAxis",g=Re(z=>Yce(z,t)),v=Re(z=>Zce(z,t)),y=Re(z=>b3(z,p,t,f)),S=Re(z=>$5(z,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!g||pN(i)||x.isValidElement(i)||S==null)){var z=s.current;if(z){var _=z.getCalculatedWidth();Math.round(g.width)!==Math.round(_)&&h(ipe({id:t,width:_}))}}},[y,g,h,i,t,r,S]),g==null||v==null||S==null)return null;var{dangerouslySetInnerHTML:w,ticks:N,scale:C}=e,E=DS(e,xge),{id:A,scale:O}=S,P=DS(S,wge);return x.createElement(vN,RS({},E,P,{ref:s,labelRef:l,x:v.x,y:v.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:g.width,height:g.height,className:gt("recharts-".concat(p," ").concat(p),n),viewBox:c,ticks:y,axisType:p,axisId:t}))}var kge={allowDataOverflow:xn.allowDataOverflow,allowDecimals:xn.allowDecimals,allowDuplicatedCategory:xn.allowDuplicatedCategory,angle:xn.angle,axisLine:Ma.axisLine,hide:!1,includeHidden:xn.includeHidden,interval:xn.interval,label:!1,minTickGap:xn.minTickGap,mirror:xn.mirror,orientation:xn.orientation,padding:xn.padding,reversed:xn.reversed,scale:xn.scale,tick:xn.tick,tickCount:xn.tickCount,tickLine:Ma.tickLine,tickSize:Ma.tickSize,type:xn.type,niceTicks:xn.niceTicks,width:xn.width,yAxisId:0},Age=e=>{var t=sr(e,kge);return x.createElement(x.Fragment,null,x.createElement(Oge,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),x.createElement(_ge,t))},wN=x.memo(Age,I4);wN.displayName="YAxis";var Ege=(e,t)=>t,SN=te([Ege,qt,e5,kn,L3,Fa,vde,qn],Nde);function Tge(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function jN(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(Tge(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var s=e.currentTarget;n=s.offsetWidth>0?t.width/s.offsetWidth:1,r=s.offsetHeight>0?t.height/s.offsetHeight:1}var l=(c,f)=>({relativeX:Math.round((c-t.left)/n),relativeY:Math.round((f-t.top)/r)});return"touches"in e?Array.from(e.touches).map(c=>l(c.clientX,c.clientY)):l(e.clientX,e.clientY)}var L4=zr("mouseClick"),$4=bf();$4.startListening({actionCreator:L4,effect:(e,t)=>{var n=e.payload,r=SN(t.getState(),jN(n));r?.activeIndex!=null&&t.dispatch(uue({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var IS=zr("mouseMove"),U4=bf(),hc=null,jo=null,nw=null;U4.startListening({actionCreator:IS,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:s}=r.eventSettings,l=s==="all"||s?.includes("mousemove");hc!==null&&(cancelAnimationFrame(hc),hc=null),jo!==null&&(typeof i!="number"||!l)&&(clearTimeout(jo),jo=null),nw=jN(n);var c=()=>{var f=t.getState(),h=zf(f,f.tooltip.settings.shared);if(!nw){hc=null,jo=null;return}if(h==="axis"){var p=SN(f,nw);p?.activeIndex!=null?t.dispatch(k3({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(_3())}hc=null,jo=null};if(!l){c();return}i==="raf"?hc=requestAnimationFrame(c):typeof i=="number"&&jo===null&&(jo=setTimeout(c,i))}});function Pge(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 eM={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},B4=Wn({name:"rootProps",initialState:eM,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:eM.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}}}),zge=B4.reducer,{updateOptions:Mge}=B4.actions,Rge=null,Dge={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)},q4=Wn({name:"polarOptions",initialState:Rge,reducers:Dge}),{updatePolarOptions:n0e}=q4.actions,Ige=q4.reducer,F4=zr("keyDown"),K4=zr("focus"),H4=zr("blur"),Dv=bf(),pc=null,No=null,Dp=null;Dv.startListening({actionCreator:F4,effect:(e,t)=>{Dp=e.payload,pc!==null&&(cancelAnimationFrame(pc),pc=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,s=i==="all"||i.includes("keydown");No!==null&&(typeof r!="number"||!s)&&(clearTimeout(No),No=null);var l=()=>{try{var c=t.getState(),f=c.rootProps.accessibilityLayer!==!1;if(!f)return;var{keyboardInteraction:h}=c.tooltip,p=Dp;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var g=Pd(h,sl(c),Kc(c),Gc(c)),v=g==null?-1:Number(g),y=!Number.isFinite(v)||v<0,S=Fa(c),w=sl(c),N=zf(c,c.tooltip.settings.shared);if(p==="Enter"){if(y)return;var C=ug(c,N,"hover",String(h.index));t.dispatch(cg({active:!h.active,activeIndex:h.index,activeCoordinate:C}));return}var E=eue(c),A=E==="left-to-right"?1:-1,O=p==="ArrowRight"?1:-1,P;if(y){var z=Kc(c),_=Gc(c),T=O*A,R=he=>({active:!1,index:String(he),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(P=-1,T>0){for(var B=0;B<w.length;B++)if(Pd(R(B),w,z,_)!=null){P=B;break}}else for(var $=w.length-1;$>=0;$--)if(Pd(R($),w,z,_)!=null){P=$;break}if(P<0)return}else{P=v+O*A;var L=S?.length||w.length;if(L===0||P>=L||P<0)return}var ne=ug(c,N,"hover",String(P));t.dispatch(cg({active:!0,activeIndex:P.toString(),activeCoordinate:ne}))}finally{pc=null,No=null}};if(!s){l();return}r==="raf"?pc=requestAnimationFrame(l):typeof r=="number"&&No===null&&(l(),Dp=null,No=setTimeout(()=>{Dp?l():(No=null,pc=null)},r))}});Dv.startListening({actionCreator:K4,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var s="0",l=zf(n,n.tooltip.settings.shared),c=ug(n,l,"hover",String(s));t.dispatch(cg({active:!0,activeIndex:s,activeCoordinate:c}))}}}});Dv.startListening({actionCreator:H4,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(cg({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function G4(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 Wr=zr("externalEvent"),V4=bf(),Ip=new Map,bd=new Map,rw=new Map;V4.startListening({actionCreator:Wr,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,s=G4(r);rw.set(i,{handler:n,reactEvent:s});var l=Ip.get(i);l!==void 0&&(cancelAnimationFrame(l),Ip.delete(i));var c=t.getState(),{throttleDelay:f,throttledEvents:h}=c.eventSettings,p=h,g=p==="all"||p?.includes(i),v=bd.get(i);v!==void 0&&(typeof f!="number"||!g)&&(clearTimeout(v),bd.delete(i));var y=()=>{var N=rw.get(i);try{if(!N)return;var{handler:C,reactEvent:E}=N,A=t.getState(),O={activeCoordinate:nde(A),activeDataKey:Jue(A),activeIndex:of(A),activeLabel:B3(A),activeTooltipIndex:of(A),isTooltipActive:rde(A)};C&&C(O,E)}finally{Ip.delete(i),bd.delete(i),rw.delete(i)}};if(!g){y();return}if(f==="raf"){var S=requestAnimationFrame(y);Ip.set(i,S)}else if(typeof f=="number"){if(!bd.has(i)){y();var w=setTimeout(y,f);bd.set(i,w)}}else y()}}});var Lge=te([du],e=>e.tooltipItemPayloads),$ge=te([Lge,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(s=>s.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),Z4=zr("touchMove"),Y4=bf(),Co=null,ws=null,tM=null,xd=null;Y4.startListening({actionCreator:Z4,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){xd=G4(n);var r=t.getState(),{throttleDelay:i,throttledEvents:s}=r.eventSettings,l=s==="all"||s.includes("touchmove");Co!==null&&(cancelAnimationFrame(Co),Co=null),ws!==null&&(typeof i!="number"||!l)&&(clearTimeout(ws),ws=null),tM=Array.from(n.touches).map(f=>jN({clientX:f.clientX,clientY:f.clientY,currentTarget:n.currentTarget}));var c=()=>{if(xd!=null){var f=t.getState(),h=zf(f,f.tooltip.settings.shared);if(h==="axis"){var p,g=(p=tM)===null||p===void 0?void 0:p[0];if(g==null){Co=null,ws=null;return}var v=SN(f,g);v?.activeIndex!=null&&t.dispatch(k3({activeIndex:v.activeIndex,activeDataKey:void 0,activeCoordinate:v.activeCoordinate}))}else if(h==="item"){var y,S=xd.touches[0];if(document.elementFromPoint==null||S==null)return;var w=document.elementFromPoint(S.clientX,S.clientY);if(!w||!w.getAttribute)return;var N=w.getAttribute(Qne),C=(y=w.getAttribute(Xne))!==null&&y!==void 0?y:void 0,E=vl(f).find(P=>P.id===C);if(N==null||E==null||C==null)return;var{dataKey:A}=E,O=$ge(f,N,C);t.dispatch(cue({activeDataKey:A,activeIndex:N,activeCoordinate:O,activeGraphicalItemId:C}))}Co=null,ws=null}};if(!l){c();return}i==="raf"?Co=requestAnimationFrame(c):typeof i=="number"&&ws===null&&(c(),xd=null,ws=setTimeout(()=>{xd?c():(ws=null,Co=null)},i))}}});var W4={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Q4=Wn({name:"eventSettings",initialState:W4,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:Uge}=Q4.actions,Bge=Q4.reducer,qge=zL({brush:ppe,cartesianAxis:ape,chartData:tfe,errorBars:Ame,eventSettings:Bge,graphicalItems:Dhe,layout:Rne,legend:Hre,options:Wde,polarAxis:jhe,polarOptions:Ige,referenceElements:Spe,renderedTicks:Qpe,rootProps:zge,tooltip:due,zIndex:Ide}),Fge=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return sne({reducer:qge,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([$4.middleware,U4.middleware,Dv.middleware,V4.middleware,Y4.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(ZL({type:"raf"}))},devTools:{serialize:{replacer:Pge},name:"recharts-".concat(n)}})};function Kge(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=or(),s=x.useRef(null);if(i)return n;s.current==null&&(s.current=Fge(t,r));var l=J1;return x.createElement(cie,{context:l,store:s.current},n)}function Hge(e){var{layout:t,margin:n}=e,r=Yt(),i=or();return x.useEffect(()=>{i||(r(Pne(t)),r(Tne(n)))},[r,i,t,n]),null}var Gge=x.memo(Hge,Nf);function Vge(e){var t=Yt();return x.useEffect(()=>{t(Mge(e))},[t,e]),null}var Zge=e=>{var t=Yt();return x.useEffect(()=>{t(Uge(e))},[t,e]),null},Yge=x.memo(Zge,Nf);function nM(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=Yt();return x.useLayoutEffect(()=>(r.current&&i(Rde({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Dde({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function rM(e){var{children:t,isPanorama:n}=e,r=Re(Ode);if(!r||r.length===0)return t;var i=r.filter(l=>l<0),s=r.filter(l=>l>0);return x.createElement(x.Fragment,null,i.map(l=>x.createElement(nM,{key:l,zIndex:l,isPanorama:n})),t,s.map(l=>x.createElement(nM,{key:l,zIndex:l,isPanorama:n})))}var Wge=["children"];function Qge(e,t){if(e==null)return{};var n,r,i=Xge(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Xge(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 vg(){return vg=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},vg.apply(null,arguments)}var Jge={width:"100%",height:"100%",display:"block"},eve=x.forwardRef((e,t)=>{var n=lj(),r=cj(),i=k$();if(!Ji(n)||!Ji(r))return null;var{children:s,otherAttributes:l,title:c,desc:f}=e,h,p;return l!=null&&(typeof l.tabIndex=="number"?h=l.tabIndex:h=i?0:void 0,typeof l.role=="string"?p=l.role:p=i?"application":void 0),x.createElement(K1,vg({},l,{title:c,desc:f,role:p,tabIndex:h,width:n,height:r,style:Jge,ref:t}),s)}),tve=e=>{var{children:t}=e,n=Re(gv);if(!n)return null;var{width:r,height:i,y:s,x:l}=n;return x.createElement(K1,{width:r,height:i,x:l,y:s},t)},iM=x.forwardRef((e,t)=>{var{children:n}=e,r=Qge(e,Wge),i=or();return i?x.createElement(tve,null,x.createElement(rM,{isPanorama:!0},n)):x.createElement(eve,vg({ref:t},r),x.createElement(rM,{isPanorama:!1},n))});function nve(){var e=Yt(),[t,n]=x.useState(null),r=Re(Wne);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),s=i.width/t.offsetWidth;We(s)&&s!==r&&e(Mne(s))}},[t,e,r]),n}function aM(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 rve(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aM(Object(n),!0).forEach(function(r){ive(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ive(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=sve(e,"string");return typeof t=="symbol"?t:t+""}function sve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $s(){return $s=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},$s.apply(null,arguments)}var ove=()=>(ufe(),null);function yg(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var lve=x.forwardRef((e,t)=>{var n,r,i=x.useRef(null),[s,l]=x.useState({containerWidth:yg((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:yg((r=e.style)===null||r===void 0?void 0:r.height)}),c=x.useCallback((h,p)=>{l(g=>{var v=Math.round(h),y=Math.round(p);return g.containerWidth===v&&g.containerHeight===y?g:{containerWidth:v,containerHeight:y}})},[]),f=x.useCallback(h=>{if(typeof t=="function"&&t(h),i.current!=null&&(i.current.disconnect(),i.current=null),h!=null&&typeof ResizeObserver<"u"){var{width:p,height:g}=h.getBoundingClientRect();c(p,g);var v=S=>{var w=S[0];if(w!=null){var{width:N,height:C}=w.contentRect;c(N,C)}},y=new ResizeObserver(v);y.observe(h),i.current=y}},[t,c]);return x.useEffect(()=>()=>{var h=i.current;h?.disconnect()},[c]),x.createElement(x.Fragment,null,x.createElement(Sf,{width:s.containerWidth,height:s.containerHeight}),x.createElement("div",$s({ref:f},e)))}),cve=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,s]=x.useState({containerWidth:yg(n),containerHeight:yg(r)}),l=x.useCallback((f,h)=>{s(p=>{var g=Math.round(f),v=Math.round(h);return p.containerWidth===g&&p.containerHeight===v?p:{containerWidth:g,containerHeight:v}})},[]),c=x.useCallback(f=>{if(typeof t=="function"&&t(f),f!=null){var{width:h,height:p}=f.getBoundingClientRect();l(h,p)}},[t,l]);return x.createElement(x.Fragment,null,x.createElement(Sf,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",$s({ref:c},e)))}),uve=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(Sf,{width:n,height:r}),x.createElement("div",$s({ref:t},e)))}),dve=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(cve,$s({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(uve,$s({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(Sf,{width:n,height:r}),x.createElement("div",$s({ref:t},e)))});function fve(e){return e?lve:dve}var hve=x.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:s,onContextMenu:l,onDoubleClick:c,onMouseDown:f,onMouseEnter:h,onMouseLeave:p,onMouseMove:g,onMouseUp:v,onTouchEnd:y,onTouchMove:S,onTouchStart:w,style:N,width:C,responsive:E,dispatchTouchEvents:A=!0}=e,O=x.useRef(null),P=Yt(),[z,_]=x.useState(null),[T,R]=x.useState(null),B=nve(),$=sj(),L=$?.width>0?$.width:C,ne=$?.height>0?$.height:i,he=x.useCallback(le=>{B(le),typeof t=="function"&&t(le),_(le),R(le),le!=null&&(O.current=le)},[B,t,_,R]),ge=x.useCallback(le=>{P(L4(le)),P(Wr({handler:s,reactEvent:le}))},[P,s]),H=x.useCallback(le=>{P(IS(le)),P(Wr({handler:h,reactEvent:le}))},[P,h]),ie=x.useCallback(le=>{P(_3()),P(Wr({handler:p,reactEvent:le}))},[P,p]),pe=x.useCallback(le=>{P(IS(le)),P(Wr({handler:g,reactEvent:le}))},[P,g]),we=x.useCallback(()=>{P(K4())},[P]),q=x.useCallback(()=>{P(H4())},[P]),D=x.useCallback(le=>{P(F4(le.key))},[P]),G=x.useCallback(le=>{P(Wr({handler:l,reactEvent:le}))},[P,l]),ae=x.useCallback(le=>{P(Wr({handler:c,reactEvent:le}))},[P,c]),Y=x.useCallback(le=>{P(Wr({handler:f,reactEvent:le}))},[P,f]),W=x.useCallback(le=>{P(Wr({handler:v,reactEvent:le}))},[P,v]),oe=x.useCallback(le=>{P(Wr({handler:w,reactEvent:le}))},[P,w]),xe=x.useCallback(le=>{A&&P(Z4(le)),P(Wr({handler:S,reactEvent:le}))},[P,A,S]),Se=x.useCallback(le=>{P(Wr({handler:y,reactEvent:le}))},[P,y]),Q=fve(E);return x.createElement(Y3.Provider,{value:z},x.createElement(GI.Provider,{value:T},x.createElement(Q,{width:L??N?.width,height:ne??N?.height,className:gt("recharts-wrapper",r),style:rve({position:"relative",cursor:"default",width:L,height:ne},N),onClick:ge,onContextMenu:G,onDoubleClick:ae,onFocus:we,onBlur:q,onKeyDown:D,onMouseDown:Y,onMouseEnter:H,onMouseLeave:ie,onMouseMove:pe,onMouseUp:W,onTouchEnd:Se,onTouchMove:xe,onTouchStart:oe,ref:he},x.createElement(ove,null),n)))}),pve=["width","height","responsive","children","className","style","compact","title","desc"];function mve(e,t){if(e==null)return{};var n,r,i=gve(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function gve(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 vve=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:s,className:l,style:c,compact:f,title:h,desc:p}=e,g=mve(e,pve),v=Oi(g);return f?x.createElement(x.Fragment,null,x.createElement(Sf,{width:n,height:r}),x.createElement(iM,{otherAttributes:v,title:h,desc:p},s)):x.createElement(hve,{className:l,style:c,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},x.createElement(iM,{otherAttributes:v,title:h,desc:p,ref:t},x.createElement(jpe,null,s)))});function LS(){return LS=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},LS.apply(null,arguments)}function sM(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 yve(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sM(Object(n),!0).forEach(function(r){bve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bve(e,t,n){return(t=xve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xve(e){var t=wve(e,"string");return typeof t=="symbol"?t:t+""}function wve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Sve={top:5,right:5,bottom:5,left:5},jve=yve({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:Sve,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},W4),Nve=x.forwardRef(function(t,n){var r,i=sr(t.categoricalChartProps,jve),{chartName:s,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:f,categoricalChartProps:h}=t,p={chartName:s,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:f,eventEmitter:void 0};return x.createElement(Kge,{preloadedState:{options:p},reduxStoreName:(r=h.id)!==null&&r!==void 0?r:s},x.createElement(hpe,{chartData:h.data}),x.createElement(Gge,{layout:i.layout,margin:i.margin}),x.createElement(Yge,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(Vge,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),x.createElement(vve,LS({},i,{ref:n})))}),Cve=["axis"],X4=x.forwardRef((e,t)=>x.createElement(Nve,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Cve,tooltipPayloadSearcher:Zde,categoricalChartProps:e,ref:t}));const J4={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},bg={fill:"#71717a",fontSize:11},Ove="#27272a",eU="#27272a",_d=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function tU(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function nU(e){return tU(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function rU(e){const t=tU(e);return`${t.getMonth()+1}/${t.getDate()}`}const _ve=["7d","30d","90d","all"],kve=["gap","cited","uncited"],iU={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"},Ave={[Ts.answer]:"Answer",[Ts.citation]:"Sources"};function Eve({projectName:e}){const[t,n]=x.useState("30d"),[r,i]=x.useState(Ts.answer),[s,l]=x.useState(null),[c,f]=x.useState(null),[h,p]=x.useState(null),[g,v]=x.useState(null),[y,S]=x.useState(!0);if(x.useEffect(()=>{let T=!1;return S(!0),Promise.all([Q9(e,t),X9(e,t),J9(e,t)]).then(([R,B,$])=>{T||(l(R),f(B),p($),S(!1))}).catch(()=>{T||S(!1)}),()=>{T=!0}},[e,t]),x.useEffect(()=>{v(null)},[r]),y&&!s)return u.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"});const w=r===Ts.answer,N=s?w?s.overall.answerRate:s.overall.citationRate:0,C=s?w?s.overall.answerMentionedCount:s.overall.cited:0,E=s?.overall.total??0,A=s?w?s.answerTrend:s.trend:"stable",O=A==="improving"?"positive":A==="declining"?"negative":"neutral",P=c?w?c.mentionedKeywords:c.cited:[],z=c?w?c.mentionGap:c.gap:[],_=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(Ln,{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:[Ts.answer,Ts.citation].map(T=>u.jsx("button",{type:"button",className:`sidebar-tab ${r===T?"sidebar-tab--active":""}`,onClick:()=>i(T),children:Ave[T]},T))})]}),u.jsx("div",{className:"flex gap-1",children:_ve.map(T=>u.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===T?"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(T),children:T==="all"?"All":T},T))})]}),s&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center gap-6",children:[u.jsx(FI,{value:`${Math.round(N*100)}`,label:w?"Answer Rate":"Citation Rate",delta:`${C} / ${E}`,tone:O,description:`Trend: ${A}`,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(bt,{tone:O,children:A})]}),Object.keys(s.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(s.byProvider).map(([T,R])=>{const B=w?R.answerRate:R.citationRate,$=w?R.answerMentionedCount:R.cited;return u.jsxs("tr",{className:"border-t border-zinc-800/40",children:[u.jsx("td",{className:"py-1.5 text-zinc-300",children:T}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(B*100).toFixed(1),"%"]}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[$," / ",R.total]})]},T)})})]})]})]}),s.buckets.length>=1&&u.jsx(Tve,{buckets:s.buckets,keywordChanges:s.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(Ln,{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:kve.map(T=>{const R=T==="cited"?P.length:T==="gap"?z.length:_.length,B=g===T,$=T==="gap"?"Gap":T==="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 ${B?T==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":T==="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:()=>v(B?null:T),children:[$," (",R,")"]},T)})}),u.jsx(Pve,{citedRows:P,gapRows:z,uncitedRows:_,filter:g,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(Ln,{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."})]})]}),h&&h.overall.length>0&&u.jsxs("div",{className:"space-y-4",children:[u.jsx(zve,{categories:h.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:h.overall.map(T=>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 ${iU[T.category]??"bg-zinc-600"}`}),T.label]}),u.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:T.count}),u.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(T.percentage*100).toFixed(1),"%"]}),u.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:T.topDomains.slice(0,3).map(R=>R.domain).join(", ")})]},T.category))})]})]}),h&&h.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 Tve({buckets:e,keywordChanges:t,metricMode:n}){const r=n===Ts.answer,i=r?"answerRate":"citationRate",s=r?"Answer Rate":"Citation Rate",l=e.map(f=>({date:f.startDate,answerRate:Math.round(f.answerRate*1e3)/10,citationRate:Math.round(f.citationRate*1e3)/10,keywordCount:f.keywordCount??0})),c=x.useMemo(()=>{if(!t||t.length===0||e.length<2)return[];const f=new Date(e[0].startDate).getTime(),h=new Date(e[e.length-1].startDate).getTime();return t.filter(p=>{const g=new Date(p.date).getTime();return g>=f&&g<=h}).map(p=>{const g=new Date(p.date).getTime();let v=e[0].startDate,y=Math.abs(g-new Date(v).getTime());for(const S of e){const w=Math.abs(g-new Date(S.startDate).getTime());w<y&&(v=S.startDate,y=w)}return{...p,date:v}})},[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":`${s} trend chart`,children:u.jsx(g$,{width:"100%",height:"100%",children:u.jsxs(X4,{data:l,margin:{top:8,right:8,bottom:0,left:0},children:[u.jsx(_4,{strokeDasharray:"3 3",stroke:Ove,vertical:!1}),u.jsx(xN,{dataKey:"date",tick:bg,tickLine:!1,axisLine:{stroke:eU},tickFormatter:rU}),u.jsx(wN,{tick:bg,tickLine:!1,axisLine:!1,domain:[0,100],tickFormatter:f=>`${f}%`,width:40}),u.jsx(X3,{...J4,labelFormatter:nU,formatter:(f,h)=>{const p=typeof f=="number"?f:Number(f??0);return String(h)===i?[`${p.toFixed(1)}%`,s]:[String(p),String(h)]}}),c.map(f=>u.jsx(j4,{x:f.date,stroke:"#52525b",strokeDasharray:"4 2",label:{value:f.label,position:"top",fill:"#71717a",fontSize:9}},f.date)),u.jsx(gg,{type:"monotone",dataKey:i,stroke:_d[0],fill:_d[0],fillOpacity:.15,strokeWidth:2,dot:{fill:_d[0],r:3,strokeWidth:0},activeDot:{fill:_d[0],r:5,strokeWidth:0,opacity:.8}})]})})})]})}function Pve({citedRows:e,gapRows:t,uncitedRows:n,filter:r,metricMode:i}){const s=i===Ts.answer,l=x.useMemo(()=>{const c=[...t.map(f=>({...f,_sort:0})),...e.map(f=>({...f,_sort:1})),...n.map(f=>({...f,_sort:2}))];return r?c.filter(f=>f.category===r):c.sort((f,h)=>f._sort-h._sort)},[e,t,n,r]);return l.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:s?"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:l.map(c=>{const f=c.category==="cited"?"positive":c.category==="gap"?"caution":"neutral",h=c.category==="gap"?"Gap":c.category==="cited"?s?"Mentioned":"Cited":s?"Not Mentioned":"Not Cited",p=s?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(bt,{tone:f,children:h})}),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 zve({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:`${iU[n.category]??"bg-zinc-600"} transition-all`,style:{width:`${r}%`},title:`${n.label}: ${(n.percentage*100).toFixed(1)}%`},n.category)})})}const Lp=_d;function wd(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function Mve(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 Rve({projectName:e}){const[t,n]=x.useState(null),[r,i]=x.useState(null),[s,l]=x.useState(!0),[c,f]=x.useState(!1),[h,p]=x.useState(!1),[g,v]=x.useState(null),[y,S]=x.useState(null),[w,N]=x.useState("sessions"),[C,E]=x.useState("desc"),[A,O]=x.useState("sessions"),[P,z]=x.useState("desc"),[_,T]=x.useState("sessions"),[R,B]=x.useState("desc"),[$,L]=x.useState([]),[ne,he]=x.useState([]);function ge(ve){l(!0),uA(e).then(Le=>{if(!ve.current)return n(Le),Le.connected?Promise.all([dA(e),fA(e).catch(()=>[]),hA(e).catch(()=>[])]):null}).then(Le=>{ve.current||(Array.isArray(Le)?(i(Le[0]),L(Le[1]),he(Le[2])):(i(null),L([]),he([])),l(!1))}).catch(Le=>{ve.current||(v(Le instanceof Error?Le.message:"Failed to load GA4 data"),l(!1))})}x.useEffect(()=>{const ve={current:!1};return ge(ve),()=>{ve.current=!0}},[e]);async function H(){f(!0),v(null),S(null);try{const ve=await nR(e);S(`Synced ${ve.rowCount.toLocaleString()} page rows, ${ve.aiReferralCount.toLocaleString()} AI and ${ve.socialReferralCount.toLocaleString()} social referral rows (${ve.days} days)`);const[Le,Fe,Be]=await Promise.all([dA(e),fA(e).catch(()=>[]),hA(e).catch(()=>[])]);i(Le),L(Fe),he(Be);const fe=await uA(e);n(fe)}catch(ve){v(ve instanceof Error?ve.message:"Sync failed")}finally{f(!1)}}async function ie(){p(!0),v(null),S(null);try{await tF(e),n({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),i(null),S("GA4 disconnected")}catch(ve){v(ve instanceof Error?ve.message:"Disconnect failed")}finally{p(!1)}}function pe(ve){w===ve?E(Le=>Le==="desc"?"asc":"desc"):(N(ve),E("desc"))}function we(ve){A===ve?z(Le=>Le==="desc"?"asc":"desc"):(O(ve),z("desc"))}function q(ve){_===ve?B(Le=>Le==="desc"?"asc":"desc"):(T(ve),B("desc"))}const D=x.useMemo(()=>r?.topPages?[...r.topPages].sort((ve,Le)=>{const Fe=ve[w],Be=Le[w];return typeof Fe=="string"&&typeof Be=="string"?C==="asc"?Fe.localeCompare(Be):Be.localeCompare(Fe):C==="asc"?Fe-Be:Be-Fe}):[],[r?.topPages,w,C]),G=x.useMemo(()=>r?.aiReferrals?[...r.aiReferrals].sort((ve,Le)=>{const Fe=ve[A],Be=Le[A];return typeof Fe=="string"&&typeof Be=="string"?P==="asc"?Fe.localeCompare(Be):Be.localeCompare(Fe):P==="asc"?Fe-Be:Be-Fe}):[],[r?.aiReferrals,A,P]),ae=x.useMemo(()=>r?.socialReferrals?[...r.socialReferrals].sort((ve,Le)=>{const Fe=ve[_],Be=Le[_];return typeof Fe=="string"&&typeof Be=="string"?R==="asc"?Fe.localeCompare(Be):Be.localeCompare(Fe):R==="asc"?Fe-Be:Be-Fe}):[],[r?.socialReferrals,_,R]),{chartData:Y,chartSources:W,dateRange:oe}=x.useMemo(()=>{const ve=[...new Set($.map(Ke=>Ke.source))],Le=new Map;for(const Ke of ne)Le.set(Ke.date,{_totalSessions:Ke.sessions,_organicSessions:Ke.organicSessions});const Fe=new Map;for(const Ke of $){const Ft=`${Ke.date}::${Ke.source}`,nt=Fe.get(Ft)??0;Fe.set(Ft,Math.max(nt,Ke.sessions))}for(const[Ke,Ft]of Fe){const[nt,Xe]=Ke.split("::");let Je=Le.get(nt);Je||(Je={_totalSessions:0,_organicSessions:0},Le.set(nt,Je)),Je[Xe]=(Je[Xe]??0)+Ft}const Be=[...Le.entries()].sort(([Ke],[Ft])=>Ke.localeCompare(Ft)).map(([Ke,Ft])=>({date:Ke,...Ft})),fe=Be.map(Ke=>Ke.date),Ge=fe.length>0?{start:fe[0],end:fe[fe.length-1]}:null;return{chartData:Be,chartSources:ve,dateRange:Ge}},[$,ne]);if(s&&!t)return u.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!t?.connected)return u.jsx(Dve,{projectName:e,onConnected:()=>ge({current:!1})});const xe=r?.organicSharePct??0,Se=r?.aiSessionsDeduped??0,Q=r?.aiSharePct??0,le=r?new Set(r.aiReferrals.map(ve=>ve.source.toLowerCase())).size:0,je=G[0]??null,V=r?.socialSessions??0,De=r?.socialSharePct??0,Ee=r?new Set(r.socialReferrals.map(ve=>ve.source.toLowerCase())).size:0,tt=ae[0]??null;return u.jsxs(u.Fragment,{children:[g&&u.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:g}),y&&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:y}),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(me,{variant:"outline",size:"sm",disabled:c,onClick:H,children:[u.jsx(yA,{className:`w-3.5 h-3.5 mr-1.5 ${c?"animate-spin":""}`}),c?"Syncing…":"Sync"]}),u.jsxs(me,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:h,onClick:ie,children:[u.jsx(qF,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),u.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",u.jsx(Ln,{text:"Aggregated traffic metrics from Google Analytics 4. Sessions and users are summed across all synced dates. Organic sessions are Google organic search sessions specifically."})]})]}),r?u.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[u.jsx(iw,{value:wd(r.totalSessions),label:"Total Sessions",subtitle:r.totalSessions.toLocaleString(),tone:"neutral"}),u.jsx(iw,{value:wd(r.totalOrganicSessions),label:"Organic Sessions",subtitle:`${xe}% of total`,tone:"positive"}),u.jsx(iw,{value:wd(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(me,{variant:"outline",size:"sm",disabled:c,onClick:H,children:[u.jsx(yA,{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(Ln,{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."})]})]}),oe&&u.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(oe.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(oe.end+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),Y.length>0&&u.jsxs(He,{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:W.length>0?"AI vs. total sessions":"All sessions (baseline)"}),W.length===0&&u.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),W.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(g$,{width:"100%",height:"100%",children:u.jsxs(X4,{data:Y,margin:{top:4,right:4,bottom:0,left:0},children:[u.jsx(xN,{dataKey:"date",tick:bg,tickLine:!1,axisLine:{stroke:eU},tickFormatter:rU}),u.jsx(wN,{tick:bg,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),u.jsx(X3,{...J4,labelFormatter:nU,formatter:(ve,Le)=>{const Fe=typeof ve=="number"?ve.toLocaleString():String(ve??0),Be=String(Le??"");return Be==="_totalSessions"?[Fe,"Total Sessions"]:Be==="_organicSessions"?[Fe,"Organic Sessions"]:[Fe,Be]}}),u.jsx(O$,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:ve=>ve==="_totalSessions"?"Total Sessions":ve==="_organicSessions"?"Organic Sessions":ve}),u.jsx(gg,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),W.map((ve,Le)=>u.jsx(gg,{type:"monotone",dataKey:ve,stackId:"ai",stroke:Lp[Le%Lp.length],fill:Lp[Le%Lp.length],fillOpacity:.4,strokeWidth:1.5},ve))]})})})]}),u.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[u.jsxs(He,{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(Yr,{label:"AI Sessions",value:wd(Se),hint:`${Se.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions attributed to AI referral sources detected via GA4 sessionSource, firstUserSource, and sessionManualSource dimensions."}),u.jsx(Yr,{label:"Share of Traffic",value:`${Q}%`,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(Yr,{label:"Tracked Sources",value:String(le),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."})]}),je&&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:je.source})," via ",je.medium,", accounting for ",je.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(Yr,{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(Yr,{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(Yr,{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(He,{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(Zr,{label:"Source",sortKey:"source",current:A,dir:P,onSort:we,align:"left"}),u.jsx(Zr,{label:"Medium",sortKey:"medium",current:A,dir:P,onSort:we,align:"left"}),u.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),u.jsx(Zr,{label:"Sessions",sortKey:"sessions",current:A,dir:P,onSort:we,align:"right"}),u.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),u.jsx(Zr,{label:"Users",sortKey:"users",current:A,dir:P,onSort:we,align:"right"})]})}),u.jsx("tbody",{children:G.map(ve=>u.jsx(Uve,{referral:ve,totalSessions:Se},`${ve.source}:${ve.medium}:${ve.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(Ln,{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."})]})]}),u.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[u.jsxs(He,{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(Yr,{label:"Social Sessions",value:wd(V),hint:`${V.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions classified as Organic Social or Paid Social by GA4's default channel grouping."}),u.jsx(Yr,{label:"Share of Traffic",value:`${De}%`,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from social media platforms."}),u.jsx(Yr,{label:"Platforms",value:String(Ee),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."})]}),tt&&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:tt.source})," via ",tt.medium,", accounting for ",tt.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(Yr,{label:"Social Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to social media platforms."}),u.jsx(Yr,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions from social media."}),u.jsx(Yr,{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(He,{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(Zr,{label:"Source",sortKey:"source",current:_,dir:R,onSort:q,align:"left"}),u.jsx(Zr,{label:"Medium",sortKey:"medium",current:_,dir:R,onSort:q,align:"left"}),u.jsx("th",{className:"py-1 font-medium text-left",children:"Channel"}),u.jsx(Zr,{label:"Sessions",sortKey:"sessions",current:_,dir:R,onSort:q,align:"right"}),u.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),u.jsx(Zr,{label:"Users",sortKey:"users",current:_,dir:R,onSort:q,align:"right"})]})}),u.jsx("tbody",{children:ae.map(ve=>u.jsx(Bve,{referral:ve,totalSessions:V},`${ve.source}:${ve.medium}:${ve.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(Ln,{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(Zr,{label:"Landing Page",sortKey:"landingPage",current:w,dir:C,onSort:pe,align:"left"}),u.jsx(Zr,{label:"Sessions",sortKey:"sessions",current:w,dir:C,onSort:pe,align:"right"}),u.jsx(Zr,{label:"Organic",sortKey:"organicSessions",current:w,dir:C,onSort:pe,align:"right"}),u.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),u.jsx(Zr,{label:"Users",sortKey:"users",current:w,dir:C,onSort:pe,align:"right"})]})}),u.jsx("tbody",{children:D.map(ve=>u.jsx(Ive,{page:ve},ve.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 ${Mve(r.lastSyncedAt)}`:"Never synced"}),u.jsx("span",{children:r?`${r.topPages.length} pages · ${r.aiReferrals.length} AI rows · ${r.socialReferrals.length} social rows`:""})]})]})}function Dve({projectName:e,onConnected:t}){const[n,r]=x.useState(""),[i,s]=x.useState(null),[l,c]=x.useState(null),[f,h]=x.useState(!1),[p,g]=x.useState(null),v=x.useRef(null),y=x.useCallback(w=>{const N=w.target.files?.[0];if(!N)return;g(null),s(N.name);const C=new FileReader;C.onload=()=>{const E=C.result;try{const A=JSON.parse(E);if(!A.client_email||!A.private_key){g("JSON file is missing required fields: client_email and private_key. Make sure you downloaded a service account key (not an OAuth client)."),c(null);return}c(E)}catch{g("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),c(null)}},C.onerror=()=>{g("Failed to read file."),c(null)},C.readAsText(N)},[]);async function S(){if(g(null),!n.trim()){g("Property ID is required.");return}if(!l){g("Please upload a service account key file.");return}h(!0);try{await eF(e,{propertyId:n.trim(),keyJson:l});try{await nR(e)}catch{}t()}catch(w){g(w instanceof Error?w.message:"Failed to connect GA4")}finally{h(!1)}}return u.jsxs(He,{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:v,type:"file",accept:".json,application/json",onChange:y,className:"hidden"}),u.jsxs("button",{type:"button",onClick:()=>v.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(KF,{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(me,{variant:"default",size:"sm",disabled:f||!n.trim()||!l,onClick:S,children:f?"Connecting & syncing…":"Connect GA4"})]})}function Zr({label:e,sortKey:t,current:n,dir:r,onSort:i,align:s}){const l=n===t;return u.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${s==="right"?"text-right":"text-left"}`,onClick:()=>i(t),children:[e,l&&u.jsx("span",{className:"ml-0.5",children:r==="asc"?"↑":"↓"})]})}const aU={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function iw({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 ${aU[r]}`,children:e}),u.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function Yr({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(Ln,{text:i})]}),u.jsx("p",{className:`text-xl font-semibold tabular-nums ${aU[r]}`,children:e}),u.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function Ive({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 Lve={session:"Session",first_user:"First Visit",manual_utm:"UTM"},$ve={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 Uve({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=Lve[e.sourceDimension]??e.sourceDimension,i=$ve[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 Bve({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 Rf(e){e.invalidateQueries({queryKey:ti.runs.all}),e.invalidateQueries({queryKey:ti.projects.all})}function qve(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function Fve(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 Iv(e,t){oR({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),at({title:qve(e.kind),detail:Fve(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function Kve(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){at({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)oR({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=tK({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});at({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 Lv(e,t){if(e instanceof $d&&e.code==="RUN_IN_PROGRESS"){at({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}at({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function sU(){const e=Hs();return uf({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>d9(t,n),onSuccess:(t,n)=>{Rf(e),Iv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{Lv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function Hve(){const e=Hs();return uf({meta:{skipGlobalErrorToast:!0},mutationFn:t=>E9(t),onSuccess:t=>{Rf(e),Kve(t)},onError:t=>{at({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function Gve(){const e=Hs();return uf({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>XM(t,n),onSuccess:(t,n)=>{Rf(e),Iv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{Lv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function Vve(){const e=Hs();return uf({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>F9(t),onSuccess:(t,n)=>{Rf(e),Iv(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{Lv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function Zve(){const e=Hs();return uf({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>B9(t,n),onSuccess:(t,n)=>{Rf(e),Iv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{Lv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}function Yve({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState([]),[s,l]=x.useState([]),[c,f]=x.useState([]),[h,p]=x.useState([]),[g,v]=x.useState([]),[y,S]=x.useState(null),[w,N]=x.useState(""),[C,E]=x.useState(""),[A,O]=x.useState("30"),[P,z]=x.useState(!1),[_,T]=x.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[R,B]=x.useState(""),[$,L]=x.useState(!0),[ne,he]=x.useState(!1),[ge,H]=x.useState(!1),[ie,pe]=x.useState(!1),[we,q]=x.useState(!1),[D,G]=x.useState(!1),[ae,Y]=x.useState(!1),[W,oe]=x.useState(null),[xe,Se]=x.useState(!1),[Q,le]=x.useState(!1),[je,V]=x.useState(null),[De,Ee]=x.useState(""),[tt,ve]=x.useState(!1),[Le,Fe]=x.useState(!1),[Be,fe]=x.useState("indexed"),[Ge,Ke]=x.useState(null),Ft=x.useMemo(()=>{if(!Ge)return c;const{key:F,dir:be}=Ge;return[...c].sort((wt,Wt)=>{const Kt=F===Es.CTR?Number.isFinite(wt.ctr)?wt.ctr:0:wt[F],Dt=F===Es.CTR?Number.isFinite(Wt.ctr)?Wt.ctr:0:Wt[F];return be==="asc"?Kt-Dt:Dt-Kt})},[c,Ge]),[nt,Xe]=x.useState([]),[Je,Rt]=x.useState(null),[cr,Ka]=x.useState(!1),[Js,pt]=x.useState(null),[yl,En]=x.useState(null),qe=r.find(F=>F.connectionType==="gsc"),Rr=c.length>0||h.length>0||g.length>0,ye=Gve(),Qn=Vve(),fu=Zve();async function If(F){if(!F){l([]),N("");return}H(!0);try{const{sites:be}=await z9(e);l(be),N(F.propertyId??be[0]?.siteUrl??"")}catch(be){l([]),pt(be instanceof Error?be.message:"Failed to load Search Console properties")}finally{H(!1)}}async function Ha(){q(!0);try{const F=await D9(e,{startDate:_.startDate||void 0,endDate:_.endDate||void 0,query:_.query||void 0,page:_.page||void 0,limit:parseInt(_.limit,10)||20});f(F)}catch(F){f([]),pt(F instanceof Error?F.message:"Failed to load GSC performance data")}finally{q(!1)}}async function sa(){G(!0);try{const[F,be]=await Promise.all([L9(e,{url:R.trim()||void 0,limit:20}),$9(e)]);p(F),v(be)}catch(F){p([]),v([]),pt(F instanceof Error?F.message:"Failed to load GSC inspection history")}finally{G(!1)}}async function eo(){Se(!0);try{const[F,be]=await Promise.all([s1(e),U9(e).catch(()=>[])]);oe(F),Xe(be)}catch(F){oe(null),Xe([]),pt(F instanceof Error?F.message:"Failed to load coverage data")}finally{Se(!1)}}async function zi(F){Ka(!0),pt(null);try{const be=await lA(e,{urls:F}),{succeeded:wt,failed:Wt,total:Kt}=be.summary;at({title:"Indexing requested",detail:Wt===0?`${wt} URL${wt!==1?"s":""} submitted for indexing.`:`${wt}/${Kt} submitted successfully, ${Wt} failed.`,tone:Wt===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(be){pt(be instanceof Error?be.message:"Failed to request indexing")}finally{Ka(!1)}}async function bl(){Ka(!0),pt(null);try{const F=await lA(e,{urls:[],allUnindexed:!0}),{succeeded:be,failed:wt,total:Wt}=F.summary;at({title:"Indexing requested",detail:wt===0?`${be} unindexed URL${be!==1?"s":""} submitted for indexing.`:`${be}/${Wt} submitted successfully, ${wt} failed.`,tone:wt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(F){pt(F instanceof Error?F.message:"Failed to request indexing")}finally{Ka(!1)}}async function Mi(){if(De.trim()){ve(!0),pt(null);try{await R9(e,"gsc",De.trim()),i(F=>F.map(be=>be.connectionType==="gsc"?{...be,sitemapUrl:De.trim()}:be)),at({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),Ee("")}catch(F){pt(F instanceof Error?F.message:"Failed to save sitemap URL")}finally{ve(!1)}}}async function Lf(){pt(null);try{const F=await Qn.mutateAsync({projectName:e,projectLabel:e});V(F.sitemaps),i(be=>be.map(wt=>wt.connectionType==="gsc"?{...wt,sitemapUrl:F.primarySitemapUrl}:wt))}catch{}}async function $f(){le(!0),pt(null);try{const F=await q9(e);V(F.sitemaps),F.sitemaps.length===0&&En("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(F){pt(F instanceof Error?F.message:"Failed to list sitemaps")}finally{le(!1)}}async function xl(){L(!0),pt(null);try{const[F,be]=await Promise.all([a1().catch(()=>null),QM(e).catch(()=>[])]);n(!!F?.google?.configured),i(be);const wt=be.find(Wt=>Wt.connectionType==="gsc");await Promise.all([If(wt),Ha(),sa(),eo()])}finally{L(!1)}}x.useEffect(()=>{xl()},[e]);async function to(){if(!t){pt("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}he(!0),pt(null),En(null);try{const{authUrl:F}=await T9(e,"gsc");if(!F.startsWith("https://accounts.google.com/")){pt("Unexpected OAuth redirect URL. Please try again.");return}const be=window.open(F,"_blank","width=600,height=700");if(!be){window.location.assign(F);return}En("Finish the Google consent flow in the popup, then close it to refresh this project.");const wt=window.setInterval(()=>{be.closed&&(window.clearInterval(wt),En(null),xl())},1e3)}catch(F){pt(F instanceof Error?F.message:"Failed to start OAuth flow")}finally{he(!1)}}async function Uv(){pt(null),En(null);try{await P9(e,"gsc"),i(F=>F.filter(be=>be.connectionType!=="gsc")),l([]),N("")}catch(F){pt(F instanceof Error?F.message:"Failed to disconnect")}}async function Uf(){if(w){pe(!0),pt(null);try{await M9(e,"gsc",w),i(F=>F.map(be=>be.connectionType==="gsc"?{...be,propertyId:w}:be)),at({title:"GSC property updated",detail:`${e} is now linked to ${w}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(F){pt(F instanceof Error?F.message:"Failed to save GSC property")}finally{pe(!1)}}}async function Bf(){pt(null),En(null);try{await ye.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(A,10)||void 0,full:P||void 0}})}catch{}}async function hu(){if(C.trim()){Y(!0),pt(null),En(null);try{const F=await I9(e,C.trim());S(F),E(""),await sa()}catch(F){pt(F instanceof Error?F.message:"Failed to inspect URL")}finally{Y(!1)}}}return u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),u.jsx("h2",{children:"Google Search Console"})]}),u.jsx("div",{className:"flex items-center gap-2",children:qe&&u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:we,onClick:()=>{Ha()},children:we?"Refreshing…":"Refresh data"})})]}),Js&&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:[Js,u.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>pt(null),children:"×"})]}),yl&&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:[yl,u.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>En(null),children:"×"})]}),$?u.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):u.jsxs("div",{className:"space-y-3",children:[u.jsxs(He,{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(bt,{tone:qe?"positive":t?"caution":"negative",children:qe?"Connected":t?"Ready to connect":"App credentials missing"})]}),qe?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:qe.domain}),u.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:Uv,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:qe.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:qe.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:xi(qe.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(me,{type:"button",variant:"outline",size:"sm",disabled:ne,onClick:to,children:ne?"Opening…":"Connect Google Search Console"}):u.jsx(me,{type:"button",variant:"outline",size:"sm",asChild:!0,children:u.jsx(Lt,{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."})]})]})]}),qe&&!qe.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(me,{type:"button",size:"sm",disabled:Qn.isPending||!qe.propertyId,onClick:Lf,children:Qn.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:De,onChange:F=>Ee(F.target.value),onKeyDown:F=>F.key==="Enter"&&void Mi()}),u.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:tt||!De.trim(),onClick:Mi,children:tt?"Saving…":"Save sitemap URL"})]})]})]})]})}),(qe||Rr)&&u.jsxs(u.Fragment,{children:[u.jsxs(He,{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:[W&&W.notIndexed.length>0&&u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:cr,onClick:()=>{bl()},children:cr?"Requesting…":`Request indexing (${W.notIndexed.length})`}),u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:xe,onClick:()=>{eo()},children:xe?"Loading…":"Refresh coverage"})]})]}),W&&W.summary.total>0?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const F=W.summary.indexed+W.summary.notIndexed,be=F>0?W.summary.indexed/F:0,wt=F>0?W.summary.notIndexed/F:0,Wt=54,Kt=2*Math.PI*Wt,Dt=Kt*(1-be),Qt=Kt*wt,Sr=Kt*be;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:Wt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),u.jsx("circle",{cx:"64",cy:"64",r:Wt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:Kt,strokeDashoffset:Dt,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),W.summary.notIndexed>0&&u.jsx("circle",{cx:"64",cy:"64",r:Wt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Qt} ${Kt-Qt}`,strokeDashoffset:-Sr,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:[(be*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:W.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:W.summary.notIndexed.toLocaleString()}),u.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(W.reasonGroups??[]).length>0&&u.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(W.reasonGroups??[]).length," ",(W.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),W.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:W.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(F=>{const be=F==="indexed"?W.indexed.length:F==="notIndexed"?W.notIndexed.length:W.deindexed.length,wt=F==="indexed"?"Indexed":F==="notIndexed"?"Not Indexed":"Deindexed";return u.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${Be===F?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{fe(F),Rt(null)},children:[wt," (",be,")"]},F)})}),u.jsxs("div",{className:"mt-3 overflow-x-auto",children:[Be==="indexed"&&W.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:W.indexed.map(F=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:F.url}),u.jsx("td",{className:"text-zinc-400",children:F.verdict??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:F.crawlTime?F.crawlTime.split("T")[0]:"—"}),u.jsx("td",{className:"text-zinc-400",children:F.isMobileFriendly===!0?"Yes":F.isMobileFriendly===!1?"No":"—"})]},F.id))})]}),Be==="notIndexed"&&!Je&&(W.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:(W.reasonGroups??[]).map(F=>u.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Rt(F.reason),children:[u.jsx("td",{className:"text-zinc-200",children:F.reason}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:F.count})]},F.reason))})]}),Be==="notIndexed"&&!Je&&(W.reasonGroups??[]).length===0&&W.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:W.notIndexed.map(F=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:F.url}),u.jsx("td",{className:"text-zinc-400",children:F.indexingState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:F.coverageState??"Unknown"})]},F.id))})]}),Be==="notIndexed"&&Je&&(()=>{const F=(W.reasonGroups??[]).find(be=>be.reason===Je);return F?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:()=>Rt(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:F.reason}),u.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[F.count," affected page",F.count!==1?"s":""]})]}),u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:cr,onClick:()=>{zi(F.urls.map(be=>be.url))},children:cr?"Requesting…":`Request indexing (${F.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:F.urls.map(be=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:be.url}),u.jsx("td",{className:"text-zinc-400",children:be.crawlTime?be.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:cr,onClick:()=>{zi([be.url])},title:"Request indexing",children:"Index"})})]},be.id))})]})]}):null})(),Be==="deindexed"&&W.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:W.deindexed.map((F,be)=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:F.url}),u.jsx("td",{className:"text-zinc-400",children:F.previousState}),u.jsx("td",{className:"text-zinc-400",children:F.currentState}),u.jsx("td",{className:"text-zinc-400",children:F.transitionDate.split("T")[0]})]},`${F.url}-${be}`))})]}),(Be==="indexed"&&W.indexed.length===0||Be==="notIndexed"&&!Je&&W.notIndexed.length===0||Be==="deindexed"&&W.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:xe?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),u.jsxs(He,{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(me,{type:"button",variant:"outline",size:"sm",disabled:we,onClick:()=>{Ha()},children:we?"Loading…":"Apply filters"})]}),c.length>0&&(()=>{const F=new Map;for(const st of c){const St=F.get(st.date);St?(St.clicks+=st.clicks,St.impressions+=st.impressions):F.set(st.date,{clicks:st.clicks,impressions:st.impressions})}const be=[...F.entries()].sort(([st],[St])=>st.localeCompare(St));if(be.length===0)return null;const wt=Math.max(...be.map(([,st])=>st.impressions),1),Wt=be.reduce((st,[,St])=>st+St.clicks,0),Kt=be.reduce((st,[,St])=>st+St.impressions,0),Dt=Kt>0?(Wt/Kt*100).toFixed(1):"0.0",Qt=700,Sr=220,Fn={top:12,bottom:36,left:48,right:12},Bv=Qt-Fn.left-Fn.right,Ga=Sr-Fn.top-Fn.bottom,Va=Bv/be.length,Ri=Math.max(Math.min(Va*.35,24),4),wl=Math.max(Ri*.15,1),Za=st=>{if(st<=0)return 1;const St=Math.pow(10,Math.floor(Math.log10(st))),gn=st/St,Xn=gn<=1.5?1.5:gn<=3?3:gn<=5?5:10;return Math.ceil(Xn*St)},pi=4,Di=Math.ceil(Za(wt)/pi)*pi,Ya=Array.from({length:pi+1},(st,St)=>Di/pi*St),cn=st=>st>=1e3?`${(st/1e3).toFixed(st>=1e4?0:1)}k`:String(st);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:Wt.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:Kt.toLocaleString()})]})]}),u.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",u.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Dt,"%"]})]})]}),u.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Qt} / ${Sr}`},children:u.jsxs("svg",{viewBox:`0 0 ${Qt} ${Sr}`,className:"h-full w-full",children:[Ya.map((st,St)=>{const gn=Fn.top+Ga-st/Di*Ga;return u.jsxs("g",{children:[u.jsx("line",{x1:Fn.left,y1:gn,x2:Qt-Fn.right,y2:gn,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),u.jsx("text",{x:Fn.left-6,y:gn+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:cn(st)})]},`t-${St}`)}),be.map(([st,St],gn)=>{const Xn=Fn.left+Va*gn+Va/2,Sl=St.impressions/Di*Ga,pu=St.clicks/Di*Ga;return u.jsxs("g",{children:[u.jsx("title",{children:`${st}
|
|
269
|
+
Clicks: ${St.clicks}
|
|
270
|
+
Impressions: ${St.impressions}
|
|
271
|
+
CTR: ${St.impressions>0?(St.clicks/St.impressions*100).toFixed(1):0}%`}),u.jsx("rect",{x:Xn-Ri-wl/2,y:Fn.top+Ga-Sl,width:Ri,height:Math.max(Sl,1),rx:2,fill:"#3b82f6",opacity:.85}),u.jsx("rect",{x:Xn+wl/2,y:Fn.top+Ga-pu,width:Ri,height:Math.max(pu,1),rx:2,fill:"#10b981",opacity:.85})]},st)}),(()=>{const st=Math.min(be.length,7);return Array.from({length:st},(St,gn)=>{const Xn=be.length===1?0:Math.round(gn/(st-1)*(be.length-1)),Sl=Fn.left+Va*Xn+Va/2;return u.jsx("text",{x:Sl,y:Sr-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:be[Xn][0].slice(5)},`xl-${Xn}`)})})()]})})]})})(),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:_.startDate,onChange:F=>T(be=>({...be,startDate:F.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:_.endDate,onChange:F=>T(be=>({...be,endDate:F.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:_.query,onChange:F=>T(be=>({...be,query:F.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:_.page,onChange:F=>T(be=>({...be,page:F.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:_.limit,onChange:F=>T(be=>({...be,limit:F.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(Es).map(F=>u.jsx("th",{className:"text-right","aria-sort":Ge?.key===F?Ge.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:()=>Ke(be=>be?.key===F?be.dir==="desc"?{key:F,dir:"asc"}:null:{key:F,dir:"desc"}),children:[GF[F],Ge?.key===F?Ge.dir==="desc"?" ↓":" ↑":""]})},F))]})}),u.jsx("tbody",{children:Ft.map((F,be)=>u.jsxs("tr",{children:[u.jsx("td",{className:"text-zinc-400",children:F.date}),u.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:F.query}),u.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:F.page}),u.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:F.clicks.toLocaleString()}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:F.impressions.toLocaleString()}),u.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(F.ctr)?F.ctr*100:0).toFixed(1),"%"]}),u.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:F.position.toFixed(1)})]},`${F.date}:${F.query}:${F.page}:${be}`))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),u.jsxs(He,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),u.jsx("h3",{children:"Inspect a URL"})]})}),u.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://example.com/page",value:C,onChange:F=>E(F.target.value),onKeyDown:F=>F.key==="Enter"&&void hu()}),u.jsx(me,{type:"button",size:"sm",disabled:ae||!qe?.propertyId||!C.trim(),onClick:hu,children:ae?"Inspecting…":"Inspect URL"})]}),y&&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:y.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:y.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:bA(y.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:xi(y.crawlTime)})]})]})]}),u.jsxs(He,{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(me,{type:"button",variant:"outline",size:"sm",disabled:D,onClick:()=>{sa()},children:D?"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:R,onChange:F=>B(F.target.value)}),u.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:D,onClick:()=>{sa()},children:"Apply filter"})]}),h.length>0?u.jsx("div",{className:"mt-3 overflow-x-auto",children:u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Indexing"}),u.jsx("th",{className:"text-left",children:"Verdict"}),u.jsx("th",{className:"text-left",children:"Coverage"}),u.jsx("th",{className:"text-left",children:"Mobile"}),u.jsx("th",{className:"text-left",children:"Inspected"})]})}),u.jsx("tbody",{children:h.map(F=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:F.url}),u.jsx("td",{className:"text-zinc-300",children:F.indexingState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:F.verdict??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:F.coverageState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:bA(F.isMobileFriendly)}),u.jsx("td",{className:"text-zinc-400",children:xi(F.inspectedAt)})]},F.id))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),u.jsxs(He,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),u.jsx("h3",{children:"Recent indexing losses"})]})}),g.length>0?u.jsx("div",{className:"mt-3 overflow-x-auto",children:u.jsxs("table",{className:"data-table w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left",children:"URL"}),u.jsx("th",{className:"text-left",children:"Previous"}),u.jsx("th",{className:"text-left",children:"Current"}),u.jsx("th",{className:"text-left",children:"Changed at"})]})}),u.jsx("tbody",{children:g.map(F=>u.jsxs("tr",{children:[u.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:F.url}),u.jsx("td",{className:"text-zinc-400",children:F.previousState??"Unknown"}),u.jsx("td",{className:"text-zinc-300",children:F.currentState??"Unknown"}),u.jsx("td",{className:"text-zinc-400",children:xi(F.transitionDate)})]},`${F.url}:${F.transitionDate}`))})]})}):u.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),qe&&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:()=>Fe(F=>!F),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 ${Le?"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"})]})}),Le&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[u.jsxs(He,{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:ge||s.length===0,onChange:F=>N(F.target.value),children:s.length===0?u.jsx("option",{value:"",children:ge?"Loading properties…":"No properties available"}):s.map(F=>u.jsxs("option",{value:F.siteUrl,children:[F.siteUrl," · ",F.permissionLevel]},F.siteUrl))}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:ge,onClick:()=>{If(qe)},children:ge?"Refreshing…":"Refresh properties"}),u.jsx(me,{type:"button",size:"sm",disabled:!w||ie,onClick:Uf,children:ie?"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(He,{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:A,onChange:F=>O(F.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:F=>z(F.target.checked)}),"Replace existing imported rows for the requested range"]})]}),u.jsx(me,{type:"button",size:"sm",disabled:ye.isPending||!qe.propertyId,onClick:Bf,children:ye.isPending?"Queueing…":"Queue sync"}),!qe.propertyId&&u.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),u.jsxs(He,{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:[qe.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:qe.sitemapUrl})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:Q||!qe.propertyId,onClick:()=>{$f()},children:Q?"Loading…":"Browse sitemaps from GSC"}),u.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:Qn.isPending||!qe.propertyId,onClick:Lf,children:Qn.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."}),je&&je.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 (",je.length,")"]}),je.map(F=>{const be=F.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:F.path}),F.lastSubmitted&&u.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",F.lastSubmitted.split("T")[0]]})]}),u.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[be&&u.jsxs("div",{className:"text-right",children:[u.jsxs("p",{className:"text-zinc-300",children:[be.indexed," / ",be.submitted]}),u.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),u.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Ee(F.path),children:"Use"})]})]},F.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:qe.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:De,onChange:F=>Ee(F.target.value),onKeyDown:F=>F.key==="Enter"&&De.trim()&&void Mi()}),u.jsx(me,{type:"button",size:"sm",disabled:tt||!De.trim(),onClick:Mi,children:tt?"Saving…":qe.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(me,{type:"button",size:"sm",variant:"outline",disabled:fu.isPending||!qe.propertyId,onClick:async()=>{const be=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||qe.sitemapUrl||void 0;pt(null),En(null);try{await fu.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:be}})}catch{}},children:fu.isPending?"Queueing…":"Inspect sitemap"})]}),!qe.propertyId&&u.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function Wve({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=x.useState(!1),[s,l]=x.useState(!1),[c,f]=x.useState(null),[h,p]=x.useState(e.displayName),[g,v]=x.useState(e.canonicalDomain),[y,S]=x.useState(e.country),[w,N]=x.useState(e.language),[C,E]=x.useState(e.ownedDomains??[]),[A,O]=x.useState(""),[P,z]=x.useState(null),[_,T]=x.useState(!1),[R,B]=x.useState(!1),[$,L]=x.useState(""),[ne,he]=x.useState(""),[ge,H]=x.useState(""),[ie,pe]=x.useState(""),[we,q]=x.useState("");x.useEffect(()=>{r||(p(e.displayName),v(e.canonicalDomain),S(e.country),N(e.language),E(e.ownedDomains??[]))},[e,r]);function D(){i(!1),f(null),p(e.displayName),v(e.canonicalDomain),S(e.country),N(e.language),E(e.ownedDomains??[]),O("")}function G(){const V=A.trim();V&&(C.includes(V)||E([...C,V]),O(""))}function ae(V){E(C.filter(De=>De!==V))}async function Y(){if(!(!h.trim()||!g.trim()||!y.trim()||!w.trim())){l(!0),f(null);try{await t(e.name,{displayName:h.trim(),canonicalDomain:g.trim(),ownedDomains:C,country:y.trim(),language:w.trim()}),i(!1),at({title:"Project settings saved",detail:`${h.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(V){f(V instanceof Error?V.message:"Failed to save")}finally{l(!1)}}}async function W(){const V=$.trim(),De=ne.trim(),Ee=ge.trim(),tt=ie.trim();if(!(!V||!De||!Ee||!tt)){T(!0),z(null);try{const ve={label:V,city:De,region:Ee,country:tt};we.trim()&&(ve.timezone=we.trim()),await f9(e.name,ve),n(),L(""),he(""),H(""),pe(""),q(""),B(!1),at({title:"Location added",detail:`${V} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${V}`,dedupeMode:"drop"})}catch(ve){z(ve instanceof Error?ve.message:"Failed to add location")}finally{T(!1)}}}async function oe(V){T(!0),z(null);try{await h9(e.name,V),n(),at({title:"Location removed",detail:`${V} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${V}`,dedupeMode:"drop"})}catch(De){z(De instanceof Error?De.message:"Failed to remove location")}finally{T(!1)}}async function xe(V){T(!0),z(null);try{await p9(e.name,V),n(),at({title:"Default location updated",detail:`${V} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(De){z(De instanceof Error?De.message:"Failed to set default location")}finally{T(!1)}}const Se=h!==e.displayName||g!==e.canonicalDomain||y!==e.country||w!==e.language||JSON.stringify(C)!==JSON.stringify(e.ownedDomains??[]),Q="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",le="block text-xs font-medium text-zinc-400 mb-1",je=$.trim()&&ne.trim()&&ge.trim()&&ie.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(me,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!0),children:"Edit settings"})]}),c&&u.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[c,u.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>f(null),children:"×"})]}),r?u.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:le,children:"Display name"}),u.jsx("input",{className:Q,type:"text",value:h,onChange:V=>p(V.target.value),placeholder:"My Project"})]}),u.jsxs("div",{children:[u.jsx("label",{className:le,children:"Canonical domain"}),u.jsx("input",{className:Q,type:"text",value:g,onChange:V=>v(V.target.value),placeholder:"example.com"})]}),u.jsxs("div",{children:[u.jsx("label",{className:le,children:"Country"}),u.jsx("input",{className:Q,type:"text",value:y,onChange:V=>S(V.target.value),placeholder:"US",maxLength:2})]}),u.jsxs("div",{children:[u.jsx("label",{className:le,children:"Language"}),u.jsx("input",{className:Q,type:"text",value:w,onChange:V=>N(V.target.value),placeholder:"en"})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:le,children:"Owned domains"}),u.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:C.map(V=>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:[V,u.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>ae(V),"aria-label":`Remove ${V}`,children:"×"})]},V))}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{className:`${Q} flex-1`,type:"text",placeholder:"docs.example.com",value:A,onChange:V=>O(V.target.value),onKeyDown:V=>V.key==="Enter"&&(V.preventDefault(),G())}),u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:!A.trim(),onClick:G,children:"Add"})]})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[u.jsx(me,{type:"button",disabled:s||!Se||!h.trim()||!g.trim(),onClick:Y,children:s?"Saving...":"Save changes"}),u.jsx(me,{type:"button",variant:"outline",disabled:s,onClick:D,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(V=>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:V},V))}):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:()=>z(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(V=>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 ${V.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:[V.label,V.label===e.defaultLocation?" ★":""]})}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:V.city}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:V.region}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:V.country}),u.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:V.timezone??"—"}),u.jsx("td",{className:"py-1.5",children:u.jsxs("div",{className:"flex items-center gap-1.5",children:[V.label!==e.defaultLocation&&u.jsx("button",{type:"button",disabled:_,onClick:()=>xe(V.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${V.label} as default location`,children:"Set default"}),u.jsx("button",{type:"button",disabled:_,onClick:()=>oe(V.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${V.label}`,children:"Remove"})]})})]},V.label))})]}):u.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),R?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:Q,type:"text",value:$,onChange:V=>L(V.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:Q,type:"text",value:ne,onChange:V=>he(V.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:Q,type:"text",value:ge,onChange:V=>H(V.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:Q,type:"text",value:ie,onChange:V=>pe(V.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:Q,type:"text",value:we,onChange:V=>q(V.target.value),placeholder:"America/New_York"})]})]}),u.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[u.jsx(me,{type:"button",size:"sm",disabled:_||!je,onClick:W,children:_?"Adding...":"Add location"}),u.jsx(me,{type:"button",size:"sm",variant:"outline",disabled:_,onClick:()=>{B(!1),z(null)},children:"Cancel"})]})]}):u.jsx(me,{type:"button",size:"sm",variant:"outline",onClick:()=>B(!0),children:"+ Add location"})]})]})]})})})]})}const Qve=[{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"}],oM=["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 Xve({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[s,l]=x.useState("daily"),[c,f]=x.useState(6),[h,p]=x.useState(""),[g,v]=x.useState("UTC"),[y,S]=x.useState(!1),[w,N]=x.useState(""),[C,E]=x.useState(!1),[A,O]=x.useState(!1),[P,z]=x.useState(null);x.useEffect(()=>{S9(e).then(n).catch(()=>n(null))},[e]);const _=()=>{if(t&&t!=="loading"){const $=YF(t.preset??null,t.cronExpr);l($.freq),f($.hour),p($.customCron);const L=oM.includes(t.timezone);v(L?t.timezone:"Other"),S(!L),N(L?"":t.timezone)}else l("daily"),f(6),p(""),v("UTC"),S(!1),N("");z(null),i(!0)},T=async()=>{E(!0),z(null);try{const L={timezone:y?w.trim()||"UTC":g};s==="custom"?L.cron=h.trim():L.preset=ZF(s,c);const ne=await sA(e,L);n(ne),i(!1),at({title:"Schedule saved",detail:fb(ne.preset??null,ne.cronExpr,ne.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch($){z($ instanceof Error?$.message:"Failed to save schedule")}finally{E(!1)}},R=async()=>{if(!(!t||t==="loading")){E(!0),z(null);try{const $={timezone:t.timezone,enabled:!t.enabled};t.preset?$.preset=t.preset:$.cron=t.cronExpr;const L=await sA(e,$);n(L),at({title:L.enabled?"Schedule resumed":"Schedule paused",detail:fb(L.preset??null,L.cronExpr,L.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch($){z($ instanceof Error?$.message:"Failed to update schedule")}finally{E(!1)}}},B=async()=>{O(!0),z(null);try{await j9(e),n(null),i(!1),at({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch($){z($ instanceof Error?$.message:"Failed to remove schedule")}finally{O(!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(me,{type:"button",variant:"outline",size:"sm",onClick:_,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&u.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&u.jsx(He,{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(He,{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:fb(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(bt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:C,onClick:R,children:t.enabled?"Pause":"Resume"}),u.jsx(me,{type:"button",variant:"ghost",size:"sm",disabled:A,onClick:B,children:A?"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:s,onChange:$=>l($.target.value),children:Qve.map($=>u.jsx("option",{value:$.value,children:$.label},$.value))})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),u.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none disabled:opacity-40",value:c,disabled:s==="twice-daily"||s==="custom",onChange:$=>f(parseInt($.target.value)),children:Array.from({length:24},($,L)=>u.jsx("option",{value:L,children:Sw(L)},L))})]})]}),s==="custom"&&u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),u.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 font-mono focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"0 9 * * 1-5",value:h,onChange:$=>p($.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:y?"Other":g,onChange:$=>{$.target.value==="Other"?(S(!0),v("Other")):(S(!1),v($.target.value))},children:[oM.map($=>u.jsx("option",{value:$,children:$},$)),u.jsxs("option",{value:"Other",children:["Other (enter manually)","…"]})]}),y&&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:$=>N($.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(me,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),z(null)},children:"Cancel"}),u.jsx(me,{type:"button",size:"sm",disabled:C||s==="custom"&&!h.trim(),onClick:T,children:C?"Saving...":"Save schedule"})]})]})]})}const Jve=[{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 eye({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[s,l]=x.useState(""),[c,f]=x.useState(["citation.lost","citation.gained"]),[h,p]=x.useState(!1),[g,v]=x.useState(null),[y,S]=x.useState({});x.useEffect(()=>{N9(e).then(n).catch(()=>n([]))},[e]);const w=A=>{f(O=>O.includes(A)?O.filter(P=>P!==A):[...O,A])},N=async()=>{if(!(!s.trim()||c.length===0)){p(!0),v(null);try{const A=await C9(e,{channel:"webhook",url:s.trim(),events:c});n(O=>O==="loading"?[A]:[...O,A]),l(""),f(["citation.lost","citation.gained"]),i(!1),at({title:"Webhook added",detail:`Notifications will be sent to ${A.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(A){v(A instanceof Error?A.message:"Failed to add webhook")}finally{p(!1)}}},C=async A=>{try{await O9(e,A),n(O=>O==="loading"?O:O.filter(P=>P.id!==A)),at({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${A}`,dedupeMode:"drop"})}catch(O){v(O instanceof Error?O.message:"Failed to remove webhook")}},E=async A=>{S(O=>({...O,[A]:{state:"testing"}}));try{const O=await _9(e,A);S(P=>({...P,[A]:{state:O.ok?"ok":"fail",status:O.status}})),O.ok&&at({title:"Test notification sent",detail:`Webhook returned status ${O.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${A}`,dedupeMode:"replace"})}catch{S(O=>({...O,[A]:{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(me,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),v(null)},children:r?"Cancel":"+ Add webhook"})]}),r&&u.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),u.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://hooks.example.com/canonry",value:s,onChange:A=>l(A.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:Jve.map(A=>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(A.value),onChange:()=>w(A.value)}),u.jsx("span",{className:"text-sm text-zinc-300",children:A.label})]},A.value))})]}),g&&u.jsx("p",{className:"text-rose-400 text-sm",children:g}),u.jsxs("div",{className:"flex gap-2 justify-end",children:[u.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),v(null)},children:"Cancel"}),u.jsx(me,{type:"button",size:"sm",disabled:h||!s.trim()||c.length===0,onClick:N,children:h?"Adding...":"Add webhook"})]})]}),t==="loading"&&u.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&u.jsx(He,{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(A=>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:A.urlHost,children:A.urlDisplay??A.url})}),u.jsx("td",{children:u.jsx("div",{className:"flex flex-wrap gap-1",children:A.events.map(O=>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:O.replace("."," ")},O))})}),u.jsx("td",{children:u.jsx(bt,{tone:A.enabled?"positive":"neutral",children:A.enabled?"Active":"Paused"})}),u.jsx("td",{children:u.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[y[A.id]&&(()=>{const O=y[A.id],P=O.state==="testing"?"Sending…":O.state==="ok"?`Delivered${O.status?` (${O.status})`:""}`:`Failed${O.status?` (${O.status})`:""}`;return u.jsx(bt,{tone:O.state==="ok"?"positive":O.state==="fail"?"negative":"neutral",children:P})})(),u.jsx(me,{variant:"ghost",size:"sm",type:"button",disabled:y[A.id]?.state==="testing",onClick:()=>E(A.id),children:"Test"}),u.jsx(me,{variant:"ghost",size:"sm",type:"button",onClick:()=>C(A.id),children:"Remove"})]})})]},A.id))})]}),g&&u.jsx("p",{className:"text-rose-400 text-sm mt-2",children:g})]})]})}function tye({projectName:e,refreshNonce:t}){const[n,r]=x.useState(null),[i,s]=x.useState([]),[l,c]=x.useState(null),[f,h]=x.useState([]),[p,g]=x.useState([]),[v,y]=x.useState(null),[S,w]=x.useState(""),[N,C]=x.useState(""),[E,A]=x.useState(""),[O,P]=x.useState(!0),[z,_]=x.useState(!1),[T,R]=x.useState(null),[B,$]=x.useState("coverage");x.useEffect(()=>{L()},[e,t]);async function L(){P(!0),R(null);try{const q=await JM(e);if(r(q),q.connected){const[D,G,ae,Y]=await Promise.all([o1(e).catch(()=>null),eR(e).catch(()=>[]),Y9(e).catch(()=>[]),q.siteUrl?Promise.resolve([]):V9(e).then(W=>W.sites).catch(()=>[])]);c(D),h(G),g(ae),s(Y)}else c(null),h([]),g([]),s([])}catch(q){R(q instanceof Error?q.message:"Failed to load Bing data")}finally{P(!1)}}async function ne(){if(N.trim()){R(null);try{const q=await H9(e,N.trim());C(""),q.availableSites.length>0&&s(q.availableSites),await L()}catch(q){R(q instanceof Error?q.message:"Failed to connect")}}}async function he(){try{await G9(e),r(null),s([]),c(null),h([]),g([]),y(null),A(""),R(null)}catch(q){R(q instanceof Error?q.message:"Failed to disconnect")}}async function ge(){if(E)try{await Z9(e,E),await L()}catch(q){R(q instanceof Error?q.message:"Failed to set site")}}async function H(){if(S.trim())try{const q=await tR(e,S.trim());y(q),h(D=>[q,...D])}catch(q){R(q instanceof Error?q.message:"Inspection failed")}}async function ie(q){_(!0),R(null);try{const D=await cA(e,{urls:[q]}),{succeeded:G,failed:ae,total:Y}=D.summary;at({title:"Bing submission requested",detail:ae===0?`${G} URL submitted to Bing.`:`${G}/${Y} submitted successfully, ${ae} failed.`,tone:ae===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${q}`,dedupeMode:"replace"})}catch(D){const G=D instanceof Error?D.message:"Submission failed";R(G),at({title:"Bing submission failed",detail:G,tone:"negative",dedupeKey:`bing:indexing:${e}:${q}`,dedupeMode:"replace"})}finally{_(!1)}}async function pe(){_(!0),R(null),at({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const q=await cA(e,{allUnindexed:!0}),{succeeded:D,failed:G,total:ae}=q.summary;at({title:"Bing submissions requested",detail:G===0?`${D}/${ae} URL${ae!==1?"s":""} submitted to Bing.`:`${D}/${ae} submitted successfully, ${G} failed.`,tone:G===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(q){const D=q instanceof Error?q.message:"Batch submission failed";R(D),at({title:"Bing submissions failed",detail:D,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{_(!1)}}if(O)return u.jsx(He,{className:"surface-card",children:u.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!n?.connected)return u.jsxs(He,{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(bt,{tone:"caution",children:"Not connected"})]}),u.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),u.jsxs("div",{className:"mt-3",children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),u.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[u.jsx("input",{id:"bing-api-key",type:"password",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:N,onChange:q=>C(q.target.value),onKeyDown:q=>q.key==="Enter"&&ne()}),u.jsx(me,{size:"sm",disabled:!N.trim(),onClick:ne,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"})]})]}),T&&u.jsx("p",{className:"mt-3 text-xs text-rose-400",children:T})]});if(!n.siteUrl)return u.jsxs(He,{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(bt,{tone:"positive",children:"Connected"}),u.jsx(me,{size:"sm",variant:"ghost",onClick:he,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?xi(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:E,onChange:q=>A(q.target.value),children:[u.jsx("option",{value:"",children:"Select a site..."}),i.map(q=>u.jsxs("option",{value:q.url,children:[q.url,q.verified?" (verified)":""]},q.url))]}),u.jsx(me,{size:"sm",disabled:!E,onClick:ge,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."})]})]}),T&&u.jsx("p",{className:"mt-3 text-xs text-rose-400",children:T})]});const we=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return u.jsxs("div",{className:"space-y-3",children:[u.jsxs(He,{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(bt,{tone:"positive",children:"Connected"}),u.jsx(me,{size:"sm",variant:"ghost",onClick:he,children:"Disconnect"})]})]}),T&&u.jsx("p",{className:"mb-3 text-xs text-rose-400",children:T}),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?xi(n.updatedAt):"—"})]})]})]})]}),u.jsxs(He,{className:"surface-card",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),u.jsx("h3",{children:"Index monitoring"})]}),u.jsx("p",{className:"text-xs text-zinc-500",children:l?.lastInspectedAt?`Last inspected ${xi(l.lastInspectedAt)}`:"No inspection history yet"})]}),u.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:we.map(q=>u.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${B===q.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>$(q.key),children:q.label},q.key))}),B==="coverage"&&l&&u.jsxs("div",{className:"mt-4 space-y-4",children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[u.jsx(wp,{label:"Indexed",value:l.summary.indexed,tone:"positive"}),u.jsx(wp,{label:"Not in index",value:l.summary.notIndexed+(l.summary.unknown??0),tone:"negative"}),u.jsx(wp,{label:"Status unknown",value:l.summary.unknown??0,tone:"neutral"}),u.jsx(wp,{label:"Coverage",value:`${l.summary.percentage}%`,tone:"neutral"})]}),l.notIndexed.length>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[u.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",l.notIndexed.length,")"]}),u.jsx(me,{size:"sm",variant:"ghost",disabled:z,onClick:pe,children:z?"Submitting…":"Submit all to Bing"})]}),u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),u.jsx("tbody",{children:l.notIndexed.map(q=>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:q.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.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:z,onClick:()=>ie(q.url),children:"Submit"})})]},q.id))})]})})]}),(l.unknown??[]).length>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[u.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(l.unknown??[]).length,")"]}),u.jsx(me,{size:"sm",variant:"ghost",disabled:z,onClick:pe,children:z?"Submitting…":"Submit all to Bing"})]}),u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),u.jsx("tbody",{children:(l.unknown??[]).map(q=>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:q.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.lastCrawledDate?xi(q.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:z,onClick:()=>ie(q.url),children:"Submit"})})]},q.id))})]})})]}),l.indexed.length>0&&u.jsxs("div",{children:[u.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",l.indexed.length,")"]}),u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),u.jsx("tbody",{children:l.indexed.map(q=>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:q.url}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.lastCrawledDate?xi(q.lastCrawledDate):"—"})]},q.id))})]})})]})]}),B==="coverage"&&!l&&u.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),B==="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:S,onChange:q=>w(q.target.value),onKeyDown:q=>q.key==="Enter"&&H()}),u.jsx(me,{size:"sm",disabled:!S.trim(),onClick:H,children:"Inspect"})]}),v&&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:v.url}),u.jsxs("div",{className:"text-zinc-400",children:["In Index: ",u.jsx("span",{className:v.inIndex?"text-emerald-400":"text-rose-400",children:v.inIndex?"Yes":"No"})," · ","HTTP: ",v.httpCode??"—"," · ","Crawled: ",v.lastCrawledDate??"—"]})]}),f.length>0&&u.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b border-zinc-800",children:[u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),u.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),u.jsx("tbody",{children:f.map(q=>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:q.url}),u.jsx("td",{className:"py-1.5 px-3",children:u.jsx(bt,{tone:q.inIndex?"positive":"negative",children:q.inIndex?"Yes":"No"})}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.httpCode??"—"}),u.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:xi(q.inspectedAt)})]},q.id))})]})})]}),B==="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:ip[Es.Clicks]}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:ip[Es.Impressions]}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:ip[Es.CTR]}),u.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:ip[Es.Position]})]})}),u.jsx("tbody",{children:p.map((q,D)=>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:q.query}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:q.clicks}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:q.impressions}),u.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(q.ctr)?q.ctr*100:0).toFixed(1),"%"]}),u.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:q.averagePosition.toFixed(1)})]},D))})]})})})]})]})}function nye({projectName:e}){const[t,n]=x.useState("google"),[r,i]=x.useState(!0),[s,l]=x.useState("idle"),[c,f]=x.useState(null),h=x.useRef(null),[p,g]=x.useState(!1),[v,y]=x.useState(null),[S,w]=x.useState(null),[N,C]=x.useState(!1),[E,A]=x.useState(null),[O,P]=x.useState(null),[z,_]=x.useState(0);async function T(D=!1){D||i(!0),f(null);try{const[G,ae,Y]=await Promise.all([a1().catch(()=>null),QM(e).catch(()=>[]),JM(e).catch(()=>null)]),W=ae.find(Se=>Se.connectionType==="gsc")??null;g(!!G?.google?.configured),C(!!G?.bing?.configured),y(W),A(Y);const[oe,xe]=await Promise.all([W?s1(e).catch(()=>null):Promise.resolve(null),Y?.connected?o1(e).catch(()=>null):Promise.resolve(null)]);w(oe),P(xe)}catch(G){f(G instanceof Error?G.message:"Failed to load search console overview")}finally{i(!1)}}async function R(){if(s!=="idle")return;h.current?.abort();const D=new AbortController;h.current=D;const G=D.signal;l("syncing"),f(null);const ae=[];try{async function Y(){if(!v)return;const Se=await XM(e);if(!Se?.id)return;const Q=2e3,je=Date.now()+12e4;for(;Date.now()<je;){if(G.aborted||(await new Promise(De=>setTimeout(De,Q)),G.aborted))return;const V=await zc(Se.id).catch(()=>null);if(!V)break;if(["completed","failed","cancelled"].includes(V.status)){V.status!=="completed"&&ae.push(`Google sync ${V.status}`);break}}}const W=10;async function oe(){if(!E?.connected)return;const Se=await eR(e).catch(()=>[]),Q=[...new Set(Se.map(le=>le.url))];if(Q.length!==0)for(let le=0;le<Q.length;le+=W){if(G.aborted)return;const je=Q.slice(le,le+W),De=(await Promise.allSettled(je.map(Ee=>tR(e,Ee)))).filter(Ee=>Ee.status==="rejected").length;De>0&&ae.push(`${De} Bing inspection(s) failed`)}}const xe=await Promise.allSettled([Y(),oe()]);for(const Se of xe)Se.status==="rejected"&&ae.push(Se.reason instanceof Error?Se.reason.message:"Sync failed");if(G.aborted)return;l("reloading"),await T(!0),_(Se=>Se+1),ae.length>0&&f(`Partial refresh: ${ae.join("; ")}`)}catch(Y){G.aborted||f(Y instanceof Error?Y.message:"Refresh failed")}finally{G.aborted||l("idle")}}x.useEffect(()=>(T(),()=>{h.current?.abort()}),[e]);const B=v?"positive":p?"caution":"negative",$=v?"Connected":p?"Ready to connect":"Needs setup",L=S?`${S.summary.percentage}% indexed`:v?"Awaiting coverage":"No coverage data",ne=S?`${S.summary.notIndexed} not indexed${S.summary.deindexed>0?` · ${S.summary.deindexed} deindexed`:""}`:v?"Run sitemap inspection to populate coverage":p?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",he=S?.lastInspectedAt??v?.updatedAt??null,ge=E?.connected?"positive":N?"caution":"negative",H=E?.connected?"Connected":N?"Ready to connect":"Needs setup",ie=O?`${O.summary.percentage}% indexed`:E?.connected?"Awaiting coverage":"No coverage data",pe=O?O.summary.notIndexed+(O.summary.unknown??0):0,we=O?`${pe} not in index`:E?.connected?"Inspect URLs to populate coverage":N?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",q=O?.lastInspectedAt??E?.updatedAt??null;return u.jsxs("div",{className:"space-y-6",children:[u.jsxs(He,{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(me,{type:"button",variant:"outline",size:"sm",disabled:r||s!=="idle",onClick:()=>{R()},children:r?"Loading…":s==="syncing"?"Refreshing Google & Bing…":s==="reloading"?"Reloading workspaces…":"Refresh all"})]}),c&&u.jsx("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:c}),u.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[u.jsx(zE,{eyebrow:"Google",title:"Google Search Console",status:r?"Loading…":$,tone:r?"neutral":B,targetLabel:"Selected property",targetValue:v?.propertyId??"No property selected",coverageValue:r?"Loading…":L,note:r?"Loading overview…":ne,updatedAt:he,active:t==="google",onClick:()=>n("google")}),u.jsx(zE,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:r?"Loading…":H,tone:r?"neutral":ge,targetLabel:"Selected site",targetValue:E?.siteUrl??"No site selected",coverageValue:r?"Loading…":ie,note:r?"Loading overview…":we,updatedAt:q,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(([D,G])=>u.jsx("button",{type:"button",role:"tab","aria-selected":t===D,className:`project-subnav-link ${t===D?"project-subnav-link-active":""}`,onClick:()=>n(D),children:G},D))}),t==="google"&&u.jsx(Yve,{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(tye,{projectName:e,refreshNonce:z})]})]})}function rye({insights:e}){const{openEvidence:t}=Qc(),[n,r]=x.useState(null);return u.jsx("div",{className:"insight-list",children:e.map(i=>{const s=n===i.id,l=i.affectedPhrases.length>0;return u.jsxs("div",{children:[u.jsxs("div",{className:`insight-row insight-row-${i.tone} ${l?"cursor-pointer":""}`,onClick:l?()=>r(s?null:i.id):void 0,children:[u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l&&u.jsx(kg,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${s?"rotate-90":""}`}),u.jsx(bt,{tone:i.tone,children:i.actionLabel}),u.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:i.title}),u.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:i.detail})]}),l&&u.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[i.affectedPhrases.length," phrase",i.affectedPhrases.length>1?"s":""]})]}),s&&u.jsx("div",{className:"divide-y divide-zinc-800/20",children:i.affectedPhrases.map((c,f)=>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(Kw,{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(Ud,{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:h=>{h.stopPropagation(),t(c.evidenceId)},children:"View →"})]},c.evidenceId||`${i.id}-${f}`))})]},i.id)})})}function $v({tab:e}){const{projectId:t}=Cg({from:"/projects/$projectId"}),n=Vs(),{dashboard:r,isLoading:i,refetch:s}=hl();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(fe=>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"})]},fe))}),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(fe=>u.jsx("div",{className:"skeleton-text-sm w-full"},fe))})]})]});const l=dQ(r,t),[c,f]=x.useState(!1),[h,p]=x.useState(!1),[g,v]=x.useState(!1),[y,S]=x.useState(""),[w,N]=x.useState(!1),[C,E]=x.useState(!1),[A,O]=x.useState(""),[P,z]=x.useState(!1),[_,T]=x.useState(!1),[R,B]=x.useState(""),[$,L]=x.useState(!1),[ne,he]=x.useState(void 0),[ge,H]=x.useState(!1),[ie,pe]=x.useState(null),[we,q]=x.useState(!1),D=l?.visibilityEvidence??[],G=l?.project.name??"",ae=l?.project.displayName||l?.project.name||G,Y=sU(),W=x.useMemo(()=>new Set(D.map(fe=>fe.location??"")),[D]),oe=W.has(""),xe=x.useMemo(()=>[...W].filter(Boolean),[W]);x.useEffect(()=>{if(ne===void 0||ne===""||!G){pe(null),q(!1);return}q(!0),YM(G,ne).then(fe=>{pe(fe),q(!1)}).catch(()=>{pe(null),q(!1)})},[ne,G]);const Se=x.useMemo(()=>{if(!ie)return null;const fe=new Map;for(const Ge of ie){for(const[Ke,Ft]of Object.entries(Ge.providerRuns??{}))fe.set(`${Ge.keyword}::${Ke}`,Ft.map(nt=>({runId:nt.runId,citationState:nt.citationState,createdAt:nt.createdAt,answerMentioned:nt.answerMentioned,visibilityState:nt.visibilityState,visibilityTransition:nt.visibilityTransition})));(!Ge.providerRuns||Object.keys(Ge.providerRuns).length===0)&&fe.set(`${Ge.keyword}::`,Ge.runs.map(Ke=>({runId:Ke.runId,citationState:Ke.citationState,createdAt:Ke.createdAt,answerMentioned:Ke.answerMentioned,visibilityState:Ke.visibilityState,visibilityTransition:Ke.visibilityTransition})))}return fe},[ie]),Q=x.useMemo(()=>{const fe=ne!==void 0?D.filter(Ge=>ne===""?!Ge.location:Ge.location===ne):D;return Se?fe.map(Ge=>{const Ke=Se.get(`${Ge.keyword}::${Ge.provider}`)??Se.get(`${Ge.keyword}::`);return Ke?{...Ge,runHistory:Ke}:Ge}):fe},[D,ne,Se]);if(!l)return u.jsx("div",{className:"page-container",children:u.jsxs(He,{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(me,{asChild:!0,children:u.jsx(Lt,{to:"/",children:"Return to overview"})})]})});async function le(){try{await Y.mutateAsync({projectName:G,projectLabel:ae,sourceAction:"project-run"}),s()}catch{}}async function je(){p(!0);try{await m9(G),at({title:"Project deleted",detail:`${ae} was removed.`,tone:"positive",dedupeKey:`project:delete:${G}`,dedupeMode:"drop"}),n({to:"/"}),s()}catch(fe){console.error("Failed to delete project:",fe)}finally{p(!1)}}async function V(){try{const fe=await g9(G),Ge=typeof fe=="string"?fe:JSON.stringify(fe,null,2),Ke=new Blob([Ge],{type:"text/yaml"}),Ft=URL.createObjectURL(Ke),nt=document.createElement("a");nt.href=Ft,nt.download=`${G}.yaml`,nt.click()}catch(fe){at({title:"Export failed",detail:fe instanceof Error?fe.message:"Could not export project YAML.",tone:"negative"})}}async function De(){const fe=y.split(`
|
|
272
|
+
`).map(Ge=>Ge.trim()).filter(Boolean);if(fe.length!==0){N(!0);try{await c9(G,fe),s(),S(""),v(!1)}finally{N(!1)}}}async function Ee(){const fe=A.trim();if(fe){z(!0);try{const Ke=(await ZM(G)).map(nt=>nt.domain),Ft=[...new Set([...Ke,fe])];await WM(G,Ft),s(),O(""),E(!1)}finally{z(!1)}}}async function tt(){const fe=R.trim();if(fe){L(!0);try{const Ge=l?.project.ownedDomains??[];await aA(G,[...Ge,fe]),s(),B(""),T(!1)}finally{L(!1)}}}async function ve(fe){L(!0);try{const Ge=l?.project.ownedDomains??[];await aA(G,Ge.filter(Ke=>Ke!==fe)),s()}finally{L(!1)}}async function Le(fe,Ge){await u9(fe,Ge),s()}const Fe=fe=>!Number.isNaN(Number.parseInt(fe,10)),Be=[{key:"overview",label:"Overview",href:`/projects/${l.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${l.project.id}/search-console`},{key:"traffic",label:"Traffic",href:`/projects/${l.project.id}/traffic`},{key:"analytics",label:"Visibility",href:`/projects/${l.project.id}/analytics`}];return u.jsxs("div",{className:"page-container",children:[c?u.jsxs(He,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[u.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),u.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",u.jsx("strong",{className:"text-zinc-200",children:l.project.displayName||l.project.name})," and all its key phrases, competitors, runs, and snapshots. This cannot be undone."]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(me,{type:"button",variant:"destructive",disabled:h,onClick:je,children:h?"Deleting...":"Yes, delete project"}),u.jsx(me,{type:"button",variant:"outline",disabled:h,onClick:()=>f(!1),children:"Cancel"})]})]}):null,u.jsxs("div",{className:"page-header",children:[u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:l.project.displayName||l.project.name}),u.jsxs("p",{className:"page-subtitle",children:[l.project.canonicalDomain,(l.project.ownedDomains??[]).length===0&&!_&&u.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>T(!0),children:"+ add domain"})," "," · ",l.contextLabel]}),u.jsxs("div",{className:"tag-row",children:[u.jsx("span",{className:"tag",children:l.project.country}),u.jsx("span",{className:"tag",children:l.project.language.toUpperCase()}),l.project.tags.map(fe=>u.jsx("span",{className:"tag",children:fe},fe))]}),((l.project.ownedDomains??[]).length>0||_)&&u.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[u.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(l.project.ownedDomains??[]).map(fe=>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:[fe,u.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:$,onClick:()=>ve(fe),"aria-label":`Remove ${fe}`,children:"×"})]},fe)),_?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:R,onChange:fe=>B(fe.target.value),onKeyDown:fe=>fe.key==="Enter"&&tt(),autoFocus:!0}),u.jsx(me,{type:"button",size:"sm",disabled:!R.trim()||$,onClick:tt,children:$?"...":"Add"}),u.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{T(!1),B("")},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:()=>T(!0),children:"+ domain"})]})]}),u.jsxs("div",{className:"page-header-right",children:[u.jsx("p",{className:"text-sm text-zinc-500",children:l.dateRangeLabel}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(me,{type:"button",variant:"outline",size:"icon",onClick:V,"aria-label":"Export project as YAML",children:u.jsx(yF,{className:"h-4 w-4 text-zinc-400"})}),u.jsx(me,{type:"button",variant:"outline",size:"icon",onClick:()=>f(!0),"aria-label":"Delete project",children:u.jsx(LF,{className:"h-4 w-4 text-zinc-400"})}),u.jsx(me,{type:"button",disabled:Y.isPending,onClick:le,children:Y.isPending?"Starting...":"Run now"})]})]})]}),u.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:Be.map(fe=>u.jsx(Lt,{to:fe.href,className:`project-subnav-link ${fe.key===e?"project-subnav-link-active":""}`,"aria-current":fe.key===e?"page":void 0,children:fe.label},fe.key))}),e==="overview"?u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"gauge-row",children:[u.jsx(FI,{value:l.visibilitySummary.value,label:l.visibilitySummary.label,delta:l.visibilitySummary.delta,tone:l.visibilitySummary.tone,description:l.visibilitySummary.description,tooltip:l.visibilitySummary.tooltip,isNumeric:Fe(l.visibilitySummary.value),progress:l.visibilitySummary.progress,providerCoverage:l.visibilitySummary.providerCoverage}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Key Phrases",u.jsx(Ln,{text:"Tracked key phrases where competitors are cited in the latest completed visibility run but your domain is not."})]}),u.jsxs("p",{className:"metric-card-big-value",children:[u.jsx("span",{className:"text-zinc-50",children:l.gapKeyPhrases.value}),u.jsxs("span",{className:"text-zinc-600",children:[" / ",l.keywordCounts.total]})]}),u.jsx("div",{className:"metric-card-bar",children:u.jsx("div",{className:`metric-card-bar-fill progress-fill-${l.gapKeyPhrases.tone}`,style:{width:l.gapKeyPhrases.progress!==void 0?`${l.gapKeyPhrases.progress*100}%`:"0%"}})}),u.jsx("p",{className:"metric-card-detail",children:l.gapKeyPhrases.delta}),u.jsx("p",{className:"metric-card-sub",children:l.gapKeyPhrases.description})]}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",u.jsx(Ln,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),u.jsxs("p",{className:"metric-card-big-value",children:[u.jsx("span",{className:"text-zinc-50",children:l.indexCoverage.value}),u.jsx("span",{className:"text-zinc-600",children:"%"})]}),u.jsx("div",{className:"metric-card-bar",children:u.jsx("div",{className:`metric-card-bar-fill progress-fill-${l.indexCoverage.tone}`,style:{width:`${Number.parseInt(l.indexCoverage.value,10)||0}%`}})}),u.jsx("p",{className:"metric-card-detail",children:l.indexCoverage.delta}),u.jsx("p",{className:"metric-card-sub",children:l.indexCoverage.description})]}),u.jsxs("div",{className:"metric-card",children:[u.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",u.jsx(Ln,{text:"Keyword-level citation changes compared to the previous completed run."})]}),l.movementSummary.hasPreviousRun?u.jsxs("div",{className:"metric-card-movement",children:[u.jsxs("span",{className:l.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",l.movementSummary.gained," gained"]}),u.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),u.jsxs("span",{className:l.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",l.movementSummary.lost," lost"]})]}):u.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),u.jsx("p",{className:"metric-card-sub mt-auto",children:l.movementSummary.gained===0&&l.movementSummary.lost===0&&l.movementSummary.hasPreviousRun?"No changes since last run":l.movementSummary.gained>l.movementSummary.lost?"Visibility improving":l.movementSummary.lost>l.movementSummary.gained?"Visibility declining":""})]})]}),l.providerScores.length>1&&u.jsxs("section",{className:"page-section-divider",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),u.jsxs("h2",{children:["Visibility by model ",u.jsx(Ln,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked key phrases. Switching models can significantly affect citation rates."})]})]})}),u.jsx("div",{className:"evidence-table-wrap",children:u.jsxs("table",{className:"evidence-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:"Model"}),u.jsx("th",{children:"Score"}),u.jsx("th",{children:"Cited key phrases"})]})}),u.jsx("tbody",{children:l.providerScores.map(fe=>u.jsxs("tr",{children:[u.jsx("td",{children:u.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[u.jsx(Ud,{provider:fe.provider}),fe.model&&u.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:fe.model})]})}),u.jsx("td",{children:u.jsxs("span",{className:`font-semibold ${fe.score>=70?"text-emerald-400":fe.score>=40?"text-amber-400":"text-rose-400"}`,children:[fe.score,"%"]})}),u.jsxs("td",{className:"text-zinc-500",children:[fe.cited," of ",fe.total]})]},`${fe.provider}::${fe.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(rye,{insights:l.insights})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),u.jsx("h2",{children:"Key phrase citation tracking"})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("p",{className:"supporting-copy",children:[new Set(l.visibilityEvidence.map(fe=>fe.keyword)).size," key phrases tracked"]}),u.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>v(!g),children:g?"Cancel":"+ Add key phrases"})]})]}),g&&u.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[u.jsx("textarea",{className:"w-full resize-none rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",rows:3,placeholder:"Enter key phrases, one per line",value:y,onChange:fe=>S(fe.target.value)}),u.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[u.jsxs("p",{className:"text-xs text-zinc-500",children:[y.split(`
|
|
273
|
+
`).filter(fe=>fe.trim()).length," key phrases"]}),u.jsx(me,{type:"button",size:"sm",disabled:!y.trim()||w,onClick:De,children:w?"Adding...":"Add key phrases"})]})]}),l.project.locations&&l.project.locations.length>0&&u.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[u.jsx("button",{className:`filter-chip ${ne===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":ne===void 0,onClick:()=>{he(void 0)},children:"All locations"}),l.project.locations.map(fe=>W.has(fe.label)&&u.jsx("button",{className:`filter-chip ${ne===fe.label?"filter-chip-active":""}`,type:"button","aria-pressed":ne===fe.label,onClick:()=>{he(fe.label),H(!1)},children:fe.label},fe.label)),oe&&u.jsx("button",{className:`filter-chip ${ne===""?"filter-chip-active":""}`,type:"button","aria-pressed":ne==="",onClick:()=>{he(""),H(!1)},children:"No location"}),xe.length>1&&ne===void 0&&u.jsx("button",{className:`filter-chip filter-chip-compare ${ge?"filter-chip-active":""}`,type:"button","aria-pressed":ge,onClick:()=>H(fe=>!fe),title:"Side-by-side location comparison",children:"Compare"})]}),u.jsx(CJ,{evidence:Q})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsxs("div",{className:"section-head section-head-inline",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),u.jsx("h2",{children:"Competitive landscape"})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("p",{className:"supporting-copy",children:[l.competitors.length," tracked"]}),u.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>E(!C),children:C?"Cancel":"+ Add competitor"})]})]}),C&&u.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"competitor.com",value:A,onChange:fe=>O(fe.target.value),onKeyDown:fe=>fe.key==="Enter"&&Ee()}),u.jsx(me,{type:"button",size:"sm",disabled:!A.trim()||P,onClick:Ee,children:P?"Adding...":"Add"})]}),u.jsx(OJ,{competitors:l.competitors})]}),u.jsxs("section",{className:"page-section-divider",children:[u.jsx("div",{className:"section-head section-head-inline",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),u.jsx("h2",{children:"Recent execution history"})]})}),u.jsx("div",{className:"run-list",children:l.recentRuns.map(fe=>u.jsx(qI,{run:fe},fe.id))})]}),u.jsx(Wve,{project:{...l.project,displayName:l.project.displayName??l.project.name,defaultLocation:l.project.defaultLocation??null},onUpdateProject:Le,onRefresh:()=>{s()}}),u.jsx(Xve,{projectName:l.project.name}),u.jsx(eye,{projectName:l.project.name})]}):e==="analytics"?u.jsx(Eve,{projectName:l.project.name}):e==="traffic"?u.jsx(Rve,{projectName:l.project.name}):u.jsx(nye,{projectName:l.project.name})]})}function iye(){const{dashboard:e,isLoading:t}=hl(),n=Hve();if(!e||t)return u.jsxs("div",{className:"page-skeleton",children:[u.jsxs("div",{className:"page-skeleton-header",children:[u.jsx("div",{className:"skeleton-text h-6 w-20"}),u.jsx("div",{className:"skeleton-text-sm w-72"})]}),u.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(f=>u.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[u.jsxs("div",{className:"flex-1 space-y-1.5",children:[u.jsx("div",{className:"skeleton-text w-40"}),u.jsx("div",{className:"skeleton-text-sm w-56"})]}),u.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},f))})]});const r=e.runs,[i,s]=x.useState("all"),l=i==="all"?r:r.filter(f=>f.status===i),c=async()=>{try{await n.mutateAsync(void 0)}catch{}};return u.jsxs("div",{className:"page-container",children:[u.jsxs("div",{className:"page-header",children:[u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Runs"}),u.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),u.jsx(me,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{c()},children:n.isPending?"Queueing…":"Run all projects"})]}),u.jsxs("section",{children:[u.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(f=>u.jsx("button",{className:`filter-chip ${i===f?"filter-chip-active":""}`,type:"button","aria-pressed":i===f,onClick:()=>s(f),children:f==="all"?"All runs":Eg(f)},f))}),u.jsx("div",{className:"run-list",children:l.length>0?l.map(f=>u.jsx(qI,{run:f},f.id)):u.jsxs(He,{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 aye({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[s,l]=x.useState(""),[c,f]=x.useState(""),[h,p]=x.useState(""),[g,v]=x.useState(""),[y,S]=x.useState(""),[w,N]=x.useState(""),[C,E]=x.useState(!1),[A,O]=x.useState(null),[P,z]=x.useState(!1),_=i?c.trim().length>0:s.trim().length>0;async function T(){if(_){E(!0),O(null),z(!1);try{const B=ge=>{const H=parseInt(ge.trim(),10);return Number.isFinite(H)&&H>0?H:void 0},$={},L=B(g);L!==void 0&&($.maxConcurrency=L);const ne=B(y);ne!==void 0&&($.maxRequestsPerMinute=ne);const he=B(w);he!==void 0&&($.maxRequestsPerDay=he),await x9(e.toLowerCase(),{...s.trim()?{apiKey:s.trim()}:{},...c.trim()?{baseUrl:c.trim()}:{},...h.trim()?{model:h.trim()}:{},...Object.keys($).length>0?{quota:$}:{}}),l(""),f(""),p(""),v(""),S(""),N(""),z(!0),at({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(B){O(B instanceof Error?B.message:"Failed to update provider")}finally{E(!1)}}}const R=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:B=>f(B.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",i?" (optional)":""]}),t&&u.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:["Get API key ","↗"]})]}),u.jsx("input",{id:`api-key-${e}`,type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:i?"Optional — most local servers don't need one":`Enter ${e} API key`,value:s,onChange:B=>l(B.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:R,value:h,onChange:B=>p(B.target.value)})]}),u.jsxs("div",{children:[u.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),u.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[u.jsxs("div",{children:[u.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Concurrent",value:g,onChange:B=>v(B.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:y,onChange:B=>S(B.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:B=>N(B.target.value)}),u.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),A&&u.jsx("p",{className:"text-xs text-rose-400",children:A}),P&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),u.jsx(me,{type:"button",size:"sm",disabled:!_||C,onClick:T,children:C?"Saving...":"Save"})]})}function sye({onSaved:e}){const[t,n]=x.useState(""),[r,i]=x.useState(""),[s,l]=x.useState(!1),[c,f]=x.useState(null),[h,p]=x.useState(!1),g=t.trim().length>0&&r.trim().length>0;async function v(){if(g){l(!0),f(null),p(!1);try{await w9({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),p(!0),at({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),e()}catch(y){f(y instanceof Error?y.message:"Failed to update Google OAuth credentials")}finally{l(!1)}}}return u.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),u.jsxs("a",{href:"https://console.cloud.google.com/apis/credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:["Google Cloud ","↗"]})]}),u.jsx("input",{id:"google-client-id",type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client ID",value:t,onChange:y=>n(y.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:y=>i(y.target.value)})]}),u.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",u.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),c&&u.jsx("p",{className:"text-xs text-rose-400",children:c}),h&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),u.jsx(me,{type:"button",size:"sm",disabled:!g||s,onClick:v,children:s?"Saving...":"Save Google OAuth app"})]})}function oye(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,s]=x.useState(!1),[l,c]=x.useState("localhost"),[f,h]=x.useState("9222"),[p,g]=x.useState(!1);return x.useEffect(()=>{oA().then(t).catch(v=>{const y=v instanceof Error?v.message:String(v);y.includes("501")||r(y)})},[]),u.jsxs(He,{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(bt,{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(v=>u.jsxs("span",{className:"mr-2",children:[v.name,": ",v.alive?"● alive":"○ idle"]},v.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(me,{type:"button",variant:"outline",size:"sm",onClick:()=>s(!i),children:i?"Cancel":e?.connected?"Update endpoint":"Configure"})}),i&&u.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async v=>{v.preventDefault(),g(!0);try{await K9(l,parseInt(f,10)||9222);const y=await oA().catch(()=>null);y&&t(y),s(!1),at({title:"CDP endpoint saved",detail:`${l}:${parseInt(f,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}catch(y){r(y instanceof Error?y.message:String(y))}finally{g(!1)}},children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"localhost",value:l,onChange:v=>c(v.target.value),"aria-label":"CDP host"}),u.jsx("input",{className:"w-24 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"9222",value:f,onChange:v=>h(v.target.value),"aria-label":"CDP port"})]}),u.jsx("div",{children:u.jsx(me,{type:"submit",size:"sm",disabled:p,children:p?"Saving…":"Save endpoint"})})]})]})}const lye={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function cye(){const e=ff(),{dashboard:t}=hl(),n=t?.settings??e?.dashboard?.settings,s=Bg(!e,e?.health).data??e?.health??lye,[l,c]=x.useState(null),[f,h]=x.useState(!1),[p,g]=x.useState(!1),[v,y]=x.useState(""),[S,w]=x.useState(!1),[N,C]=x.useState(null),[E,A]=x.useState(!1);return n?u.jsxs("div",{className:"page-container",children:[u.jsx("div",{className:"page-header",children:u.jsxs("div",{className:"page-header-left",children:[u.jsx("h1",{className:"page-title",children:"Settings"}),u.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),u.jsxs("section",{className:"settings-grid",children:[n.providerStatuses.map(O=>u.jsxs(He,{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:O.displayName??O.name})]}),u.jsx(bt,{tone:O.state==="ready"?"positive":"caution",children:O.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:O.model})]}),O.quota&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Concurrency"}),u.jsx("dd",{children:O.quota.maxConcurrency})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Rate limit"}),u.jsxs("dd",{children:[O.quota.maxRequestsPerMinute,"/min · ",O.quota.maxRequestsPerDay,"/day"]})]})]})]}),u.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:O.detail}),u.jsx("div",{className:"mt-2",children:u.jsx(me,{type:"button",variant:"outline",size:"sm",onClick:()=>c(l===O.name?null:O.name),children:l===O.name?"Cancel":O.state==="ready"?O.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),l===O.name&&u.jsx(aye,{providerName:O.name,keyUrl:O.keyUrl,modelHint:O.modelHint,onSaved:()=>{c(null)}})]},O.name)),u.jsxs(He,{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(bt,{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(me,{type:"button",variant:"outline",size:"sm",onClick:()=>h(!f),children:f?"Cancel":n.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),f&&u.jsx(sye,{onSaved:()=>{h(!1)}})]}),u.jsxs(He,{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(bt,{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(me,{type:"button",variant:"outline",size:"sm",onClick:()=>g(!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:v,onChange:O=>y(O.target.value)})]}),u.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",u.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),N&&u.jsx("p",{className:"text-xs text-rose-400",children:N}),E&&u.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),u.jsx(me,{type:"button",size:"sm",disabled:!v.trim()||S,onClick:async()=>{if(v.trim()){w(!0),C(null),A(!1);try{await W9(v.trim()),y(""),A(!0),g(!1),at({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(O){C(O instanceof Error?O.message:"Failed to update Bing API key")}finally{w(!1)}}},children:S?"Saving...":"Save Bing API key"})]})]}),u.jsx(oye,{}),u.jsxs(He,{className:"surface-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),u.jsx("h2",{children:"API and worker"})]})}),u.jsxs("div",{className:"compact-stack",children:[u.jsxs("div",{className:"health-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:"API"}),u.jsx("p",{className:"supporting-copy",children:s.apiStatus.detail})]}),u.jsx(bt,{tone:pm(s.apiStatus),children:s.apiStatus.state==="ok"?"Healthy":"Attention"})]}),u.jsxs("div",{className:"health-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:"Worker"}),u.jsx("p",{className:"supporting-copy",children:s.workerStatus.detail})]}),u.jsx(bt,{tone:pm(s.workerStatus),children:s.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),u.jsx("section",{className:"page-section",children:u.jsxs(He,{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(O=>u.jsx("li",{children:O},O))}),u.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const uye=[{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 dye({current:e,labels:t}){return u.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((n,r)=>{const i=r<e,s=r===e;return u.jsxs("div",{className:`setup-step ${i?"setup-step-done":""} ${s?"setup-step-active":""}`,role:"listitem","aria-current":s?"step":void 0,children:[u.jsx("span",{className:"setup-step-number",children:i?"✓":r+1}),u.jsx("span",{className:"setup-step-label",children:n.label})]},n.label)})})}function fye(){const e=ff(),{dashboard:t,isLoading:n,refetch:r}=hl(),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(ye=>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"})]},ye))})]})]});const s=i.settings,f=Bg(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},h=cX(i.setup,f,s),p=Vs(),[g,v]=x.useState(0),[y,S]=x.useState(""),[w,N]=x.useState(""),[C,E]=x.useState(""),[A,O]=x.useState("US"),[P,z]=x.useState("en"),[_,T]=x.useState(null),[R,B]=x.useState(null),[$,L]=x.useState(null),[ne,he]=x.useState(!1),[ge,H]=x.useState(""),[ie,pe]=x.useState(!1),[we,q]=x.useState(null),[D,G]=x.useState(!1),ae=s.providerStatuses.filter(ye=>ye.state==="ready"),[Y,W]=x.useState(ae[0]?.name??""),[oe,xe]=x.useState(5),[Se,Q]=x.useState(!1),[le,je]=x.useState(null),[V,De]=x.useState(""),[Ee,tt]=x.useState(!1),[ve,Le]=x.useState(null),[Fe,Be]=x.useState(!1),[fe,Ge]=x.useState(!1),[Ke,Ft]=x.useState(!1),nt=sU(),Xe=y.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Je=ge.split(`
|
|
274
|
+
`).map(ye=>ye.trim()).filter(Boolean),Rt=V.split(`
|
|
275
|
+
`).map(ye=>ye.trim()).filter(Boolean),cr=h.healthChecks.some(ye=>ye.id==="api"&&ye.state==="ready"),Ka=async()=>{if(!(!Xe||!C)){he(!0),L(null);try{const ye=await _g(Xe,{displayName:w||y,canonicalDomain:C,country:A,language:P});T(Xe),B(ye.id),at({title:"Project created",detail:`${ye.displayName||ye.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${ye.name}`,dedupeMode:"drop"}),r(),v(2)}catch(ye){L(ye instanceof Error?ye.message:"Failed to create project")}finally{he(!1)}}},Js=async()=>{if(!_)return;const ye=Je;if(ye.length!==0){G(!0),q(null);try{await l9(_,ye),pe(!0),r(),v(3)}catch(Qn){q(Qn instanceof Error?Qn.message:"Failed to save key phrases")}finally{G(!1)}}},pt=async()=>{if(!(!_||!Y)){Q(!0),je(null);try{const ye=await k9(_,Y,oe);if(ye.keywords.length>0){const Qn=ge?ge.trimEnd()+`
|
|
276
|
+
`+ye.keywords.join(`
|
|
277
|
+
`):ye.keywords.join(`
|
|
278
|
+
`);H(Qn)}}catch(ye){je(ye instanceof Error?ye.message:"Failed to generate key phrases")}finally{Q(!1)}}},yl=async()=>{if(!_)return;const ye=Rt;if(ye.length!==0){Be(!0),Le(null);try{await WM(_,ye),tt(!0),r(),v(4)}catch(Qn){Le(Qn instanceof Error?Qn.message:"Failed to save competitors")}finally{Be(!1)}}},En=async()=>{if(_){Ft(!0);try{await nt.mutateAsync({projectName:_,projectLabel:w||y||_,sourceAction:"setup-launch"}),Ge(!0),r()}catch{}finally{Ft(!1)}}},qe=()=>v(ye=>Math.max(0,ye-1)),Rr=(()=>{switch(g){case 0:return u.jsxs(He,{className:"surface-card step-card",children:[u.jsx("div",{className:"section-head",children:u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),u.jsx("h2",{children:"System ready"})]})}),u.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),u.jsx("div",{className:"compact-stack",children:h.healthChecks.map(ye=>u.jsxs("div",{className:"health-check-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"run-row-title",children:ye.label}),u.jsx("p",{className:"supporting-copy",children:ye.detail}),ye.id==="provider"&&ye.state!=="ready"&&u.jsx(Lt,{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(bt,{tone:ye.state==="ready"?"positive":"caution",children:ye.state==="ready"?"Ready":"Attention"})]},ye.id))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx("span",{}),u.jsx(me,{type:"button",disabled:!cr,onClick:()=>v(1),children:"Continue"})]})]});case 1:return u.jsxs(He,{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"})]}),_?u.jsx(bt,{tone:"positive",children:"Created"}):null]}),_?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:_})," created successfully."]}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(me,{type:"button",variant:"outline",onClick:qe,children:"Back"}),u.jsx(me,{type:"button",onClick:()=>v(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:y,onChange:ye=>S(ye.target.value)}),Xe&&Xe!==y?u.jsxs("p",{className:"supporting-copy",children:["Slug: ",Xe]}):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:ye=>N(ye.target.value)})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),u.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:C,onChange:ye=>E(ye.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:A,onChange:ye=>O(ye.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:ye=>z(ye.target.value.toLowerCase())})]})]}),$?u.jsx("p",{className:"text-rose-400 text-sm",children:$}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(me,{type:"button",variant:"outline",onClick:qe,children:"Back"}),u.jsx(me,{type:"button",disabled:!Xe||!C||ne,onClick:Ka,children:ne?"Creating...":"Create project"})]})]})]});case 2:return u.jsxs(He,{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"})]}),ie?u.jsxs(bt,{tone:"positive",children:[Je.length," saved"]}):u.jsxs(bt,{tone:"neutral",children:[Je.length," key phrase",Je.length!==1?"s":""]})]}),u.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),ie?u.jsxs("div",{className:"compact-stack",children:[u.jsx("ul",{className:"detail-list",children:Je.map(ye=>u.jsx("li",{children:ye},ye))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(me,{type:"button",variant:"outline",onClick:qe,children:"Back"}),u.jsx(me,{type:"button",onClick:()=>v(3),children:"Continue"})]})]}):u.jsxs("div",{className:"compact-stack",children:[ae.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:Y,onChange:ye=>W(ye.target.value),children:ae.map(ye=>u.jsxs("option",{value:ye.name,children:[ye.displayName??ye.name,ye.model?` (${ye.model})`:""]},ye.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:oe,onChange:ye=>xe(Number(ye.target.value)),children:[3,5,10,15,20].map(ye=>u.jsx("option",{value:ye,children:ye},ye))})]}),u.jsx(me,{type:"button",variant:"outline",disabled:Se||!Y,onClick:pt,children:Se?"Analyzing site...":"Generate"})]}),le?u.jsx("p",{className:"text-rose-400 text-sm",children:le}):null]}):null,u.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[u.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",u.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"keywords",children:"Key phrases (one per line)"}),u.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
|
|
279
|
+
best invisalign downtown brooklyn
|
|
280
|
+
pediatric dentist brooklyn heights`,value:ge,onChange:ye=>H(ye.target.value)})]}),we?u.jsx("p",{className:"text-rose-400 text-sm",children:we}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(me,{type:"button",variant:"outline",onClick:qe,children:"Back"}),u.jsx(me,{type:"button",disabled:Je.length===0||D,onClick:Js,children:D?"Saving...":`Save ${Je.length} key phrase${Je.length!==1?"s":""}`})]})]})]});case 3:return u.jsxs(He,{className:"surface-card step-card",children:[u.jsxs("div",{className:"section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),u.jsx("h2",{children:"Add competitors"})]}),Ee?u.jsx(bt,{tone:"positive",children:"Saved"}):null]}),u.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),Ee?u.jsxs("div",{className:"compact-stack",children:[u.jsx("ul",{className:"detail-list",children:Rt.map(ye=>u.jsx("li",{children:ye},ye))}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(me,{type:"button",variant:"outline",onClick:qe,children:"Back"}),u.jsx(me,{type:"button",onClick:()=>v(4),children:"Continue"})]})]}):u.jsxs("div",{className:"compact-stack",children:[u.jsxs("div",{className:"setup-field",children:[u.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),u.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
|
|
281
|
+
competitor2.com`,value:V,onChange:ye=>De(ye.target.value)})]}),ve?u.jsx("p",{className:"text-rose-400 text-sm",children:ve}):null,u.jsxs("div",{className:"setup-nav",children:[u.jsx(me,{type:"button",variant:"outline",onClick:qe,children:"Back"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(me,{type:"button",variant:"outline",onClick:()=>v(4),children:"Skip"}),u.jsx(me,{type:"button",disabled:Rt.length===0||Fe,onClick:yl,children:Fe?"Saving...":`Save ${Rt.length} competitor${Rt.length!==1?"s":""}`})]})]})]})]});case 4:return u.jsxs(He,{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"})]}),fe?u.jsx(bt,{tone:"positive",children:"Queued"}):null]}),fe?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(me,{type:"button",onClick:()=>p({to:R?`/projects/${R}`:"/"}),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:_}),"."]}),u.jsxs("div",{className:"setup-nav",children:[u.jsx(me,{type:"button",variant:"outline",onClick:qe,children:"Back"}),u.jsx(me,{type:"button",disabled:Ke,onClick:En,children:Ke?"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(dye,{current:g,labels:uye}),u.jsx("section",{className:"setup-wizard",children:Rr})]})}function hye(){return u.jsx("div",{className:"page-container",children:u.jsx("section",{className:"page-section",children:u.jsxs(He,{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(me,{asChild:!0,children:u.jsx(Lt,{to:"/",children:"Return to overview"})})]})})})}function pye(){return u.jsx(iX,{children:u.jsx(rX,{})})}const Ci=Fq()({component:pye,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),mye=ui({getParentRoute:()=>Ci,path:"/",component:dX,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(ti.projects.all);if(t&&t.length===0)throw YS({to:"/setup"})}}),gye=ui({getParentRoute:()=>Ci,path:"/projects",component:jJ}),Df=ui({getParentRoute:()=>Ci,path:"/projects/$projectId",component:()=>u.jsx(i1,{})}),vye=ui({getParentRoute:()=>Df,path:"/",component:()=>u.jsx($v,{tab:"overview"})}),yye=ui({getParentRoute:()=>Df,path:"/search-console",component:()=>u.jsx($v,{tab:"search-console"})}),bye=ui({getParentRoute:()=>Df,path:"/analytics",component:()=>u.jsx($v,{tab:"analytics"})}),xye=ui({getParentRoute:()=>Df,path:"/traffic",component:()=>u.jsx($v,{tab:"traffic"})}),wye=ui({getParentRoute:()=>Ci,path:"/runs",component:iye}),Sye=ui({getParentRoute:()=>Ci,path:"/settings",component:cye,beforeLoad:({context:e})=>{}}),jye=ui({getParentRoute:()=>Ci,path:"/setup",component:fye,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(ti.projects.all);if(t&&t.length>0)throw YS({to:"/"})}}),Nye=ui({getParentRoute:()=>Ci,path:"*",component:hye}),Cye=Ci.addChildren([mye,gye,Df.addChildren([vye,yye,bye,xye]),wye,Sye,jye,Nye]);function Oye(e,t){return Jq({routeTree:Cye,basepath:Mw||"/",context:{queryClient:e},...t?.initialEntries})}const oU=uF(),_ye=Oye(oU),lU=document.getElementById("root");if(!lU)throw new Error("Expected #root element for web app bootstrap.");function kye(){const[e,t]=x.useState(iA()?"ready":"checking"),[n,r]=x.useState(""),[i,s]=x.useState(""),[l,c]=x.useState(null),[f,h]=x.useState(!1);x.useEffect(()=>{if(iA())return;let v=!1;return v9().then(y=>{v||(y.authenticated?t("ready"):t(y.setupRequired?"setup":"login"))}).catch(y=>{v||(c(y instanceof Error?y.message:"Failed to reach the Canonry API"),t("login"))}),()=>{v=!0}},[]);const p=async v=>{if(v.preventDefault(),!n.trim()||n.trim().length<8){c("Password must be at least 8 characters");return}if(n!==i){c("Passwords do not match");return}h(!0),c(null);try{if(!(await y9(n.trim())).authenticated){c("Setup failed");return}r(""),s(""),t("ready")}catch(y){c(y instanceof $d||y instanceof Error?y.message:"Setup failed")}finally{h(!1)}},g=async v=>{if(v.preventDefault(),!!n.trim()){h(!0),c(null);try{if(!(await b9(n.trim())).authenticated){c("Incorrect password");return}r(""),t("ready")}catch(y){c(y instanceof $d||y instanceof Error?y.message:"Authentication failed")}finally{h(!1)}}};return e==="ready"?u.jsx(QB,{client:oU,children:u.jsx(n9,{router:_ye})}):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(He,{className:"surface-card w-full",children:e==="checking"?u.jsx(Gp,{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(Rw,{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),u.jsx(Dw,{children:"Create a dashboard password"}),u.jsx(Iw,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),u.jsx(Gp,{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:v=>r(v.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:v=>s(v.target.value),placeholder:"Re-enter password"})]}),l?u.jsx("p",{className:"text-sm text-rose-400",children:l}):null,u.jsx(me,{type:"submit",disabled:f||!n.trim()||!i.trim(),children:f?"Setting up…":"Create password & open dashboard"})]})})]}):u.jsxs(u.Fragment,{children:[u.jsxs(Rw,{children:[u.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),u.jsx(Dw,{children:"Sign in to Canonry"}),u.jsx(Iw,{children:"Enter your dashboard password to continue."})]}),u.jsx(Gp,{children:u.jsxs("form",{className:"space-y-4",onSubmit:g,children:[u.jsxs("label",{className:"block space-y-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),u.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:n,onChange:v=>r(v.target.value),placeholder:"Dashboard password"})]}),l?u.jsx("p",{className:"text-sm text-rose-400",children:l}):null,u.jsx(me,{type:"submit",disabled:f||!n.trim(),children:f?"Signing in…":"Open dashboard"})]})})]})})})})}OB.createRoot(lU).render(u.jsx(x.StrictMode,{children:u.jsx(kye,{})}));
|