@ainyc/canonry 4.8.0 → 4.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,302 @@
1
+ function mK(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function ma(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rw={exports:{}},Af={};var Az;function gK(){if(Az)return Af;Az=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+i.key),"key"in i){a={};for(var u in i)u!=="key"&&(a[u]=i[u])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:a}}return Af.Fragment=t,Af.jsx=n,Af.jsxs=n,Af}var Oz;function yK(){return Oz||(Oz=1,rw.exports=gK()),rw.exports}var s=yK(),iw={exports:{}},rt={};var Ez;function vK(){if(Ez)return rt;Ez=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),g=Symbol.iterator;function v(M){return M===null||typeof M!="object"?null:(M=g&&M[g]||M["@@iterator"],typeof M=="function"?M:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,S={};function k(M,q,D){this.props=M,this.context=q,this.refs=S,this.updater=D||j}k.prototype.isReactComponent={},k.prototype.setState=function(M,q){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,q,"setState")},k.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function E(){}E.prototype=k.prototype;function C(M,q,D){this.props=M,this.context=q,this.refs=S,this.updater=D||j}var A=C.prototype=new E;A.constructor=C,b(A,k.prototype),A.isPureReactComponent=!0;var T=Array.isArray;function O(){}var _={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function $(M,q,D){var G=D.ref;return{$$typeof:e,type:M,key:q,ref:G!==void 0?G:null,props:D}}function F(M,q){return $(M.type,q,M.props)}function U(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function B(M){var q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(D){return q[D]})}var V=/\/+/g;function X(M,q){return typeof M=="object"&&M!==null&&M.key!=null?B(""+M.key):q.toString(36)}function Z(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(O,O):(M.status="pending",M.then(function(q){M.status==="pending"&&(M.status="fulfilled",M.value=q)},function(q){M.status==="pending"&&(M.status="rejected",M.reason=q)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function H(M,q,D,G,se){var ne=typeof M;(ne==="undefined"||ne==="boolean")&&(M=null);var Ce=!1;if(M===null)Ce=!0;else switch(ne){case"bigint":case"string":case"number":Ce=!0;break;case"object":switch(M.$$typeof){case e:case t:Ce=!0;break;case p:return Ce=M._init,H(Ce(M._payload),q,D,G,se)}}if(Ce)return se=se(M),Ce=G===""?"."+X(M,0):G,T(se)?(D="",Ce!=null&&(D=Ce.replace(V,"$&/")+"/"),H(se,q,D,"",function(pe){return pe})):se!=null&&(U(se)&&(se=F(se,D+(se.key==null||M&&M.key===se.key?"":(""+se.key).replace(V,"$&/")+"/")+Ce)),q.push(se)),1;Ce=0;var Se=G===""?".":G+":";if(T(M))for(var ee=0;ee<M.length;ee++)G=M[ee],ne=Se+X(G,ee),Ce+=H(G,q,D,ne,se);else if(ee=v(M),typeof ee=="function")for(M=ee.call(M),ee=0;!(G=M.next()).done;)G=G.value,ne=Se+X(G,ee++),Ce+=H(G,q,D,ne,se);else if(ne==="object"){if(typeof M.then=="function")return H(Z(M),q,D,G,se);throw q=String(M),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Ce}function J(M,q,D){if(M==null)return M;var G=[],se=0;return H(M,G,"","",function(ne){return q.call(D,ne,se++)}),G}function oe(M){if(M._status===-1){var q=M._result;q=q(),q.then(function(D){(M._status===0||M._status===-1)&&(M._status=1,M._result=D)},function(D){(M._status===0||M._status===-1)&&(M._status=2,M._result=D)}),M._status===-1&&(M._status=0,M._result=q)}if(M._status===1)return M._result.default;throw M._result}var ye=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},I={map:J,forEach:function(M,q,D){J(M,function(){q.apply(this,arguments)},D)},count:function(M){var q=0;return J(M,function(){q++}),q},toArray:function(M){return J(M,function(q){return q})||[]},only:function(M){if(!U(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return rt.Activity=m,rt.Children=I,rt.Component=k,rt.Fragment=n,rt.Profiler=i,rt.PureComponent=C,rt.StrictMode=r,rt.Suspense=d,rt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,rt.__COMPILER_RUNTIME={__proto__:null,c:function(M){return _.H.useMemoCache(M)}},rt.cache=function(M){return function(){return M.apply(null,arguments)}},rt.cacheSignal=function(){return null},rt.cloneElement=function(M,q,D){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var G=b({},M.props),se=M.key;if(q!=null)for(ne in q.key!==void 0&&(se=""+q.key),q)!P.call(q,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&q.ref===void 0||(G[ne]=q[ne]);var ne=arguments.length-2;if(ne===1)G.children=D;else if(1<ne){for(var Ce=Array(ne),Se=0;Se<ne;Se++)Ce[Se]=arguments[Se+2];G.children=Ce}return $(M.type,se,G)},rt.createContext=function(M){return M={$$typeof:l,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:a,_context:M},M},rt.createElement=function(M,q,D){var G,se={},ne=null;if(q!=null)for(G in q.key!==void 0&&(ne=""+q.key),q)P.call(q,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(se[G]=q[G]);var Ce=arguments.length-2;if(Ce===1)se.children=D;else if(1<Ce){for(var Se=Array(Ce),ee=0;ee<Ce;ee++)Se[ee]=arguments[ee+2];se.children=Se}if(M&&M.defaultProps)for(G in Ce=M.defaultProps,Ce)se[G]===void 0&&(se[G]=Ce[G]);return $(M,ne,se)},rt.createRef=function(){return{current:null}},rt.forwardRef=function(M){return{$$typeof:u,render:M}},rt.isValidElement=U,rt.lazy=function(M){return{$$typeof:p,_payload:{_status:-1,_result:M},_init:oe}},rt.memo=function(M,q){return{$$typeof:f,type:M,compare:q===void 0?null:q}},rt.startTransition=function(M){var q=_.T,D={};_.T=D;try{var G=M(),se=_.S;se!==null&&se(D,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(O,ye)}catch(ne){ye(ne)}finally{q!==null&&D.types!==null&&(q.types=D.types),_.T=q}},rt.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},rt.use=function(M){return _.H.use(M)},rt.useActionState=function(M,q,D){return _.H.useActionState(M,q,D)},rt.useCallback=function(M,q){return _.H.useCallback(M,q)},rt.useContext=function(M){return _.H.useContext(M)},rt.useDebugValue=function(){},rt.useDeferredValue=function(M,q){return _.H.useDeferredValue(M,q)},rt.useEffect=function(M,q){return _.H.useEffect(M,q)},rt.useEffectEvent=function(M){return _.H.useEffectEvent(M)},rt.useId=function(){return _.H.useId()},rt.useImperativeHandle=function(M,q,D){return _.H.useImperativeHandle(M,q,D)},rt.useInsertionEffect=function(M,q){return _.H.useInsertionEffect(M,q)},rt.useLayoutEffect=function(M,q){return _.H.useLayoutEffect(M,q)},rt.useMemo=function(M,q){return _.H.useMemo(M,q)},rt.useOptimistic=function(M,q){return _.H.useOptimistic(M,q)},rt.useReducer=function(M,q,D){return _.H.useReducer(M,q,D)},rt.useRef=function(M){return _.H.useRef(M)},rt.useState=function(M){return _.H.useState(M)},rt.useSyncExternalStore=function(M,q,D){return _.H.useSyncExternalStore(M,q,D)},rt.useTransition=function(){return _.H.useTransition()},rt.version="19.2.4",rt}var _z;function md(){return _z||(_z=1,iw.exports=vK()),iw.exports}var x=md();const Li=ma(x),bv=mK({__proto__:null,default:Li},[x]);var aw={exports:{}},Of={},sw={exports:{}},ow={};var zz;function xK(){return zz||(zz=1,(function(e){function t(H,J){var oe=H.length;H.push(J);e:for(;0<oe;){var ye=oe-1>>>1,I=H[ye];if(0<i(I,J))H[ye]=J,H[oe]=I,oe=ye;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var J=H[0],oe=H.pop();if(oe!==J){H[0]=oe;e:for(var ye=0,I=H.length,M=I>>>1;ye<M;){var q=2*(ye+1)-1,D=H[q],G=q+1,se=H[G];if(0>i(D,oe))G<I&&0>i(se,D)?(H[ye]=se,H[G]=oe,ye=G):(H[ye]=D,H[q]=oe,ye=q);else if(G<I&&0>i(se,oe))H[ye]=se,H[G]=oe,ye=G;else break e}}return J}function i(H,J){var oe=H.sortIndex-J.sortIndex;return oe!==0?oe:H.id-J.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],f=[],p=1,m=null,g=3,v=!1,j=!1,b=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function A(H){for(var J=n(f);J!==null;){if(J.callback===null)r(f);else if(J.startTime<=H)r(f),J.sortIndex=J.expirationTime,t(d,J);else break;J=n(f)}}function T(H){if(b=!1,A(H),!j)if(n(d)!==null)j=!0,O||(O=!0,B());else{var J=n(f);J!==null&&Z(T,J.startTime-H)}}var O=!1,_=-1,P=5,$=-1;function F(){return S?!0:!(e.unstable_now()-$<P)}function U(){if(S=!1,O){var H=e.unstable_now();$=H;var J=!0;try{e:{j=!1,b&&(b=!1,E(_),_=-1),v=!0;var oe=g;try{t:{for(A(H),m=n(d);m!==null&&!(m.expirationTime>H&&F());){var ye=m.callback;if(typeof ye=="function"){m.callback=null,g=m.priorityLevel;var I=ye(m.expirationTime<=H);if(H=e.unstable_now(),typeof I=="function"){m.callback=I,A(H),J=!0;break t}m===n(d)&&r(d),A(H)}else r(d);m=n(d)}if(m!==null)J=!0;else{var M=n(f);M!==null&&Z(T,M.startTime-H),J=!1}}break e}finally{m=null,g=oe,v=!1}J=void 0}}finally{J?B():O=!1}}}var B;if(typeof C=="function")B=function(){C(U)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,X=V.port2;V.port1.onmessage=U,B=function(){X.postMessage(null)}}else B=function(){k(U,0)};function Z(H,J){_=k(function(){H(e.unstable_now())},J)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(H){switch(g){case 1:case 2:case 3:var J=3;break;default:J=g}var oe=g;g=J;try{return H()}finally{g=oe}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(H,J){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var oe=g;g=H;try{return J()}finally{g=oe}},e.unstable_scheduleCallback=function(H,J,oe){var ye=e.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?ye+oe:ye):oe=ye,H){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=oe+I,H={id:p++,callback:J,priorityLevel:H,startTime:oe,expirationTime:I,sortIndex:-1},oe>ye?(H.sortIndex=oe,t(f,H),n(d)===null&&H===n(f)&&(b?(E(_),_=-1):b=!0,Z(T,oe-ye))):(H.sortIndex=I,t(d,H),j||v||(j=!0,O||(O=!0,B()))),H},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(H){var J=g;return function(){var oe=g;g=J;try{return H.apply(this,arguments)}finally{g=oe}}}})(ow)),ow}var Tz;function bK(){return Tz||(Tz=1,sw.exports=xK()),sw.exports}var lw={exports:{}},yr={};var Pz;function wK(){if(Pz)return yr;Pz=1;var e=md();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(d,f,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:d,containerInfo:f,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return yr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,yr.createPortal=function(d,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return a(d,f,null,p)},yr.flushSync=function(d){var f=l.T,p=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=f,r.p=p,r.d.f()}},yr.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},yr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},yr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,m=u(p,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:g,fetchPriority:v}):p==="script"&&r.d.X(d,{crossOrigin:m,integrity:g,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},yr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=u(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},yr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,m=u(p,f.crossOrigin);r.d.L(d,p,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},yr.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=u(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},yr.requestFormReset=function(d){r.d.r(d)},yr.unstable_batchedUpdates=function(d,f){return d(f)},yr.useFormState=function(d,f,p){return l.H.useFormState(d,f,p)},yr.useFormStatus=function(){return l.H.useHostTransitionStatus()},yr.version="19.2.4",yr}var Rz;function UL(){if(Rz)return lw.exports;Rz=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(),lw.exports=wK(),lw.exports}var Dz;function jK(){if(Dz)return Of;Dz=1;var e=bK(),t=md(),n=UL();function r(o){var c="https://react.dev/errors/"+o;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+o+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function a(o){var c=o,h=o;if(o.alternate)for(;c.return;)c=c.return;else{o=c;do c=o,(c.flags&4098)!==0&&(h=c.return),o=c.return;while(o)}return c.tag===3?h:null}function l(o){if(o.tag===13){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function u(o){if(o.tag===31){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function d(o){if(a(o)!==o)throw Error(r(188))}function f(o){var c=o.alternate;if(!c){if(c=a(o),c===null)throw Error(r(188));return c!==o?null:o}for(var h=o,y=c;;){var w=h.return;if(w===null)break;var N=w.alternate;if(N===null){if(y=w.return,y!==null){h=y;continue}break}if(w.child===N.child){for(N=w.child;N;){if(N===h)return d(w),o;if(N===y)return d(w),c;N=N.sibling}throw Error(r(188))}if(h.return!==y.return)h=w,y=N;else{for(var z=!1,L=w.child;L;){if(L===h){z=!0,h=w,y=N;break}if(L===y){z=!0,y=w,h=N;break}L=L.sibling}if(!z){for(L=N.child;L;){if(L===h){z=!0,h=N,y=w;break}if(L===y){z=!0,y=N,h=w;break}L=L.sibling}if(!z)throw Error(r(189))}}if(h.alternate!==y)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?o:c}function p(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o;for(o=o.child;o!==null;){if(c=p(o),c!==null)return c;o=o.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),C=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function B(o){return o===null||typeof o!="object"?null:(o=U&&o[U]||o["@@iterator"],typeof o=="function"?o:null)}var V=Symbol.for("react.client.reference");function X(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===V?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case b:return"Fragment";case k:return"Profiler";case S:return"StrictMode";case T:return"Suspense";case O:return"SuspenseList";case $:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case j:return"Portal";case C:return o.displayName||"Context";case E:return(o._context.displayName||"Context")+".Consumer";case A:var c=o.render;return o=o.displayName,o||(o=c.displayName||c.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case _:return c=o.displayName||null,c!==null?c:X(o.type)||"Memo";case P:c=o._payload,o=o._init;try{return X(o(c))}catch{}}return null}var Z=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},ye=[],I=-1;function M(o){return{current:o}}function q(o){0>I||(o.current=ye[I],ye[I]=null,I--)}function D(o,c){I++,ye[I]=o.current,o.current=c}var G=M(null),se=M(null),ne=M(null),Ce=M(null);function Se(o,c){switch(D(ne,c),D(se,o),D(G,null),c.nodeType){case 9:case 11:o=(o=c.documentElement)&&(o=o.namespaceURI)?Y_(o):0;break;default:if(o=c.tagName,c=c.namespaceURI)c=Y_(c),o=Z_(c,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}q(G),D(G,o)}function ee(){q(G),q(se),q(ne)}function pe(o){o.memoizedState!==null&&D(Ce,o);var c=G.current,h=Z_(c,o.type);c!==h&&(D(se,o),D(G,h))}function Ee(o){se.current===o&&(q(G),q(se)),Ce.current===o&&(q(Ce),Sf._currentValue=oe)}var Y,He;function Pe(o){if(Y===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);Y=c&&c[1]||"",He=-1<h.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Y+o+He}var at=!1;function Ve(o,c){if(!o||at)return"";at=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(c){var we=function(){throw Error()};if(Object.defineProperty(we.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(we,[])}catch(ue){var le=ue}Reflect.construct(o,[],we)}else{try{we.call()}catch(ue){le=ue}o.call(we.prototype)}}else{try{throw Error()}catch(ue){le=ue}(we=o())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(ue){if(ue&&le&&typeof ue.stack=="string")return[ue.stack,le.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var w=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");w&&w.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=y.DetermineComponentFrameRoot(),z=N[0],L=N[1];if(z&&L){var K=z.split(`
4
+ `),ae=L.split(`
5
+ `);for(w=y=0;y<K.length&&!K[y].includes("DetermineComponentFrameRoot");)y++;for(;w<ae.length&&!ae[w].includes("DetermineComponentFrameRoot");)w++;if(y===K.length||w===ae.length)for(y=K.length-1,w=ae.length-1;1<=y&&0<=w&&K[y]!==ae[w];)w--;for(;1<=y&&0<=w;y--,w--)if(K[y]!==ae[w]){if(y!==1||w!==1)do if(y--,w--,0>w||K[y]!==ae[w]){var ge=`
6
+ `+K[y].replace(" at new "," at ");return o.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",o.displayName)),ge}while(1<=y&&0<=w);break}}}finally{at=!1,Error.prepareStackTrace=h}return(h=o?o.displayName||o.name:"")?Pe(h):""}function Ht(o,c){switch(o.tag){case 26:case 27:case 5:return Pe(o.type);case 16:return Pe("Lazy");case 13:return o.child!==c&&c!==null?Pe("Suspense Fallback"):Pe("Suspense");case 19:return Pe("SuspenseList");case 0:case 15:return Ve(o.type,!1);case 11:return Ve(o.type.render,!1);case 1:return Ve(o.type,!0);case 31:return Pe("Activity");default:return""}}function Lt(o){try{var c="",h=null;do c+=Ht(o,h),h=o,o=o.return;while(o);return c}catch(y){return`
7
+ Error generating stack: `+y.message+`
8
+ `+y.stack}}var cn=Object.prototype.hasOwnProperty,en=e.unstable_scheduleCallback,je=e.unstable_cancelCallback,Ze=e.unstable_shouldYield,Rt=e.unstable_requestPaint,mt=e.unstable_now,et=e.unstable_getCurrentPriorityLevel,ce=e.unstable_ImmediatePriority,Ne=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,Ge=e.unstable_LowPriority,pt=e.unstable_IdlePriority,mn=e.log,On=e.unstable_setDisableYieldValue,gn=null,We=null;function Kt(o){if(typeof mn=="function"&&On(o),We&&typeof We.setStrictMode=="function")try{We.setStrictMode(gn,o)}catch{}}var de=Math.clz32?Math.clz32:Qe,ze=Math.log,he=Math.LN2;function Qe(o){return o>>>=0,o===0?32:31-(ze(o)/he|0)|0}var Fn=256,wi=262144,tn=4194304;function En(o){var c=o&42;if(c!==0)return c;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function $r(o,c,h){var y=o.pendingLanes;if(y===0)return 0;var w=0,N=o.suspendedLanes,z=o.pingedLanes;o=o.warmLanes;var L=y&134217727;return L!==0?(y=L&~N,y!==0?w=En(y):(z&=L,z!==0?w=En(z):h||(h=L&~o,h!==0&&(w=En(h))))):(L=y&~N,L!==0?w=En(L):z!==0?w=En(z):h||(h=y&~o,h!==0&&(w=En(h)))),w===0?0:c!==0&&c!==w&&(c&N)===0&&(N=w&-w,h=c&-c,N>=h||N===32&&(h&4194048)!==0)?c:w}function Xi(o,c){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&c)===0}function wa(o,c){switch(o){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Sp(){var o=tn;return tn<<=1,(tn&62914560)===0&&(tn=4194304),o}function Gs(o){for(var c=[],h=0;31>h;h++)c.push(o);return c}function Vs(o,c){o.pendingLanes|=c,c!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Wx(o,c,h,y,w,N){var z=o.pendingLanes;o.pendingLanes=h,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=h,o.entangledLanes&=h,o.errorRecoveryDisabledLanes&=h,o.shellSuspendCounter=0;var L=o.entanglements,K=o.expirationTimes,ae=o.hiddenUpdates;for(h=z&~h;0<h;){var ge=31-de(h),we=1<<ge;L[ge]=0,K[ge]=-1;var le=ae[ge];if(le!==null)for(ae[ge]=null,ge=0;ge<le.length;ge++){var ue=le[ge];ue!==null&&(ue.lane&=-536870913)}h&=~we}y!==0&&Dd(o,y,0),N!==0&&w===0&&o.tag!==0&&(o.suspendedLanes|=N&~(z&~c))}function Dd(o,c,h){o.pendingLanes|=c,o.suspendedLanes&=~c;var y=31-de(c);o.entangledLanes|=c,o.entanglements[y]=o.entanglements[y]|1073741824|h&261930}function Np(o,c){var h=o.entangledLanes|=c;for(o=o.entanglements;h;){var y=31-de(h),w=1<<y;w&c|o[y]&c&&(o[y]|=c),h&=~w}}function kp(o,c){var h=c&-c;return h=(h&42)!==0?1:Md(h),(h&(o.suspendedLanes|c))!==0?0:h}function Md(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function Id(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function Ld(){var o=J.p;return o!==0?o:(o=window.event,o===void 0?32:bz(o.type))}function Q(o,c){var h=J.p;try{return J.p=o,c()}finally{J.p=h}}var ke=Math.random().toString(36).slice(2),nt="__reactFiber$"+ke,St="__reactProps$"+ke,_n="__reactContainer$"+ke,ja="__reactEvents$"+ke,Ja="__reactListeners$"+ke,Qs="__reactHandles$"+ke,Er="__reactResources$"+ke,il="__reactMarker$"+ke;function Sa(o){delete o[nt],delete o[St],delete o[ja],delete o[Ja],delete o[Qs]}function ji(o){var c=o[nt];if(c)return c;for(var h=o.parentNode;h;){if(c=h[_n]||h[nt]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(o=iz(o);o!==null;){if(h=o[nt])return h;o=iz(o)}return c}o=h,h=o.parentNode}return null}function Ji(o){if(o=o[nt]||o[_n]){var c=o.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return o}return null}function Ws(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o.stateNode;throw Error(r(33))}function Ys(o){var c=o[Er];return c||(c=o[Er]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function yn(o){o[il]=!0}var al=new Set,Cp={};function es(o,c){ut(o,c),ut(o+"Capture",c)}function ut(o,c){for(Cp[o]=c,o=0;o<c.length;o++)al.add(c[o])}var Gt=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Br={},ea={};function Oc(o){return cn.call(ea,o)?!0:cn.call(Br,o)?!1:Gt.test(o)?ea[o]=!0:(Br[o]=!0,!1)}function sl(o,c,h){if(Oc(c))if(h===null)o.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":o.removeAttribute(c);return;case"boolean":var y=c.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){o.removeAttribute(c);return}}o.setAttribute(c,""+h)}}function Ap(o,c,h){if(h===null)o.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(c);return}o.setAttribute(c,""+h)}}function ts(o,c,h,y){if(y===null)o.removeAttribute(h);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(h);return}o.setAttributeNS(c,h,""+y)}}function Si(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function qA(o){var c=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function l9(o,c,h){var y=Object.getOwnPropertyDescriptor(o.constructor.prototype,c);if(!o.hasOwnProperty(c)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var w=y.get,N=y.set;return Object.defineProperty(o,c,{configurable:!0,get:function(){return w.call(this)},set:function(z){h=""+z,N.call(this,z)}}),Object.defineProperty(o,c,{enumerable:y.enumerable}),{getValue:function(){return h},setValue:function(z){h=""+z},stopTracking:function(){o._valueTracker=null,delete o[c]}}}}function Yx(o){if(!o._valueTracker){var c=qA(o)?"checked":"value";o._valueTracker=l9(o,c,""+o[c])}}function FA(o){if(!o)return!1;var c=o._valueTracker;if(!c)return!0;var h=c.getValue(),y="";return o&&(y=qA(o)?o.checked?"true":"false":o.value),o=y,o!==h?(c.setValue(o),!0):!1}function Op(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var c9=/[\n"\\]/g;function Ni(o){return o.replace(c9,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Zx(o,c,h,y,w,N,z,L){o.name="",z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?o.type=z:o.removeAttribute("type"),c!=null?z==="number"?(c===0&&o.value===""||o.value!=c)&&(o.value=""+Si(c)):o.value!==""+Si(c)&&(o.value=""+Si(c)):z!=="submit"&&z!=="reset"||o.removeAttribute("value"),c!=null?Xx(o,z,Si(c)):h!=null?Xx(o,z,Si(h)):y!=null&&o.removeAttribute("value"),w==null&&N!=null&&(o.defaultChecked=!!N),w!=null&&(o.checked=w&&typeof w!="function"&&typeof w!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?o.name=""+Si(L):o.removeAttribute("name")}function HA(o,c,h,y,w,N,z,L){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(o.type=N),c!=null||h!=null){if(!(N!=="submit"&&N!=="reset"||c!=null)){Yx(o);return}h=h!=null?""+Si(h):"",c=c!=null?""+Si(c):h,L||c===o.value||(o.value=c),o.defaultValue=c}y=y??w,y=typeof y!="function"&&typeof y!="symbol"&&!!y,o.checked=L?o.checked:!!y,o.defaultChecked=!!y,z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"&&(o.name=z),Yx(o)}function Xx(o,c,h){c==="number"&&Op(o.ownerDocument)===o||o.defaultValue===""+h||(o.defaultValue=""+h)}function Ec(o,c,h,y){if(o=o.options,c){c={};for(var w=0;w<h.length;w++)c["$"+h[w]]=!0;for(h=0;h<o.length;h++)w=c.hasOwnProperty("$"+o[h].value),o[h].selected!==w&&(o[h].selected=w),w&&y&&(o[h].defaultSelected=!0)}else{for(h=""+Si(h),c=null,w=0;w<o.length;w++){if(o[w].value===h){o[w].selected=!0,y&&(o[w].defaultSelected=!0);return}c!==null||o[w].disabled||(c=o[w])}c!==null&&(c.selected=!0)}}function KA(o,c,h){if(c!=null&&(c=""+Si(c),c!==o.value&&(o.value=c),h==null)){o.defaultValue!==c&&(o.defaultValue=c);return}o.defaultValue=h!=null?""+Si(h):""}function GA(o,c,h,y){if(c==null){if(y!=null){if(h!=null)throw Error(r(92));if(Z(y)){if(1<y.length)throw Error(r(93));y=y[0]}h=y}h==null&&(h=""),c=h}h=Si(c),o.defaultValue=h,y=o.textContent,y===h&&y!==""&&y!==null&&(o.value=y),Yx(o)}function _c(o,c){if(c){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=c;return}}o.textContent=c}var u9=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 VA(o,c,h){var y=c.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?y?o.setProperty(c,""):c==="float"?o.cssFloat="":o[c]="":y?o.setProperty(c,h):typeof h!="number"||h===0||u9.has(c)?c==="float"?o.cssFloat=h:o[c]=(""+h).trim():o[c]=h+"px"}function QA(o,c,h){if(c!=null&&typeof c!="object")throw Error(r(62));if(o=o.style,h!=null){for(var y in h)!h.hasOwnProperty(y)||c!=null&&c.hasOwnProperty(y)||(y.indexOf("--")===0?o.setProperty(y,""):y==="float"?o.cssFloat="":o[y]="");for(var w in c)y=c[w],c.hasOwnProperty(w)&&h[w]!==y&&VA(o,w,y)}else for(var N in c)c.hasOwnProperty(N)&&VA(o,N,c[N])}function Jx(o){if(o.indexOf("-")===-1)return!1;switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var d9=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"]]),f9=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ep(o){return f9.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function ns(){}var e0=null;function t0(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var zc=null,Tc=null;function WA(o){var c=Ji(o);if(c&&(o=c.stateNode)){var h=o[St]||null;e:switch(o=c.stateNode,c.type){case"input":if(Zx(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),c=h.name,h.type==="radio"&&c!=null){for(h=o;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+Ni(""+c)+'"][type="radio"]'),c=0;c<h.length;c++){var y=h[c];if(y!==o&&y.form===o.form){var w=y[St]||null;if(!w)throw Error(r(90));Zx(y,w.value,w.defaultValue,w.defaultValue,w.checked,w.defaultChecked,w.type,w.name)}}for(c=0;c<h.length;c++)y=h[c],y.form===o.form&&FA(y)}break e;case"textarea":KA(o,h.value,h.defaultValue);break e;case"select":c=h.value,c!=null&&Ec(o,!!h.multiple,c,!1)}}}var n0=!1;function YA(o,c,h){if(n0)return o(c,h);n0=!0;try{var y=o(c);return y}finally{if(n0=!1,(zc!==null||Tc!==null)&&(gm(),zc&&(c=zc,o=Tc,Tc=zc=null,WA(c),o)))for(c=0;c<o.length;c++)WA(o[c])}}function $d(o,c){var h=o.stateNode;if(h===null)return null;var y=h[St]||null;if(y===null)return null;h=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(o=o.type,y=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!y;break e;default:o=!1}if(o)return null;if(h&&typeof h!="function")throw Error(r(231,c,typeof h));return h}var rs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),r0=!1;if(rs)try{var Bd={};Object.defineProperty(Bd,"passive",{get:function(){r0=!0}}),window.addEventListener("test",Bd,Bd),window.removeEventListener("test",Bd,Bd)}catch{r0=!1}var Zs=null,i0=null,_p=null;function ZA(){if(_p)return _p;var o,c=i0,h=c.length,y,w="value"in Zs?Zs.value:Zs.textContent,N=w.length;for(o=0;o<h&&c[o]===w[o];o++);var z=h-o;for(y=1;y<=z&&c[h-y]===w[N-y];y++);return _p=w.slice(o,1<y?1-y:void 0)}function zp(o){var c=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&c===13&&(o=13)):o=c,o===10&&(o=13),32<=o||o===13?o:0}function Tp(){return!0}function XA(){return!1}function Ur(o){function c(h,y,w,N,z){this._reactName=h,this._targetInst=w,this.type=y,this.nativeEvent=N,this.target=z,this.currentTarget=null;for(var L in o)o.hasOwnProperty(L)&&(h=o[L],this[L]=h?h(N):N[L]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?Tp:XA,this.isPropagationStopped=XA,this}return m(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Tp)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Tp)},persist:function(){},isPersistent:Tp}),c}var ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pp=Ur(ol),Ud=m({},ol,{view:0,detail:0}),h9=Ur(Ud),a0,s0,qd,Rp=m({},Ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:l0,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==qd&&(qd&&o.type==="mousemove"?(a0=o.screenX-qd.screenX,s0=o.screenY-qd.screenY):s0=a0=0,qd=o),a0)},movementY:function(o){return"movementY"in o?o.movementY:s0}}),JA=Ur(Rp),p9=m({},Rp,{dataTransfer:0}),m9=Ur(p9),g9=m({},Ud,{relatedTarget:0}),o0=Ur(g9),y9=m({},ol,{animationName:0,elapsedTime:0,pseudoElement:0}),v9=Ur(y9),x9=m({},ol,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),b9=Ur(x9),w9=m({},ol,{data:0}),eO=Ur(w9),j9={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},S9={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"},N9={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function k9(o){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(o):(o=N9[o])?!!c[o]:!1}function l0(){return k9}var C9=m({},Ud,{key:function(o){if(o.key){var c=j9[o.key]||o.key;if(c!=="Unidentified")return c}return o.type==="keypress"?(o=zp(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?S9[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:l0,charCode:function(o){return o.type==="keypress"?zp(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?zp(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),A9=Ur(C9),O9=m({},Rp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tO=Ur(O9),E9=m({},Ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:l0}),_9=Ur(E9),z9=m({},ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),T9=Ur(z9),P9=m({},Rp,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),R9=Ur(P9),D9=m({},ol,{newState:0,oldState:0}),M9=Ur(D9),I9=[9,13,27,32],c0=rs&&"CompositionEvent"in window,Fd=null;rs&&"documentMode"in document&&(Fd=document.documentMode);var L9=rs&&"TextEvent"in window&&!Fd,nO=rs&&(!c0||Fd&&8<Fd&&11>=Fd),rO=" ",iO=!1;function aO(o,c){switch(o){case"keyup":return I9.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sO(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Pc=!1;function $9(o,c){switch(o){case"compositionend":return sO(c);case"keypress":return c.which!==32?null:(iO=!0,rO);case"textInput":return o=c.data,o===rO&&iO?null:o;default:return null}}function B9(o,c){if(Pc)return o==="compositionend"||!c0&&aO(o,c)?(o=ZA(),_p=i0=Zs=null,Pc=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return nO&&c.locale!=="ko"?null:c.data;default:return null}}var U9={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 oO(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c==="input"?!!U9[o.type]:c==="textarea"}function lO(o,c,h,y){zc?Tc?Tc.push(y):Tc=[y]:zc=y,c=Sm(c,"onChange"),0<c.length&&(h=new Pp("onChange","change",null,h,y),o.push({event:h,listeners:c}))}var Hd=null,Kd=null;function q9(o){H_(o,0)}function Dp(o){var c=Ws(o);if(FA(c))return o}function cO(o,c){if(o==="change")return c}var uO=!1;if(rs){var u0;if(rs){var d0="oninput"in document;if(!d0){var dO=document.createElement("div");dO.setAttribute("oninput","return;"),d0=typeof dO.oninput=="function"}u0=d0}else u0=!1;uO=u0&&(!document.documentMode||9<document.documentMode)}function fO(){Hd&&(Hd.detachEvent("onpropertychange",hO),Kd=Hd=null)}function hO(o){if(o.propertyName==="value"&&Dp(Kd)){var c=[];lO(c,Kd,o,t0(o)),YA(q9,c)}}function F9(o,c,h){o==="focusin"?(fO(),Hd=c,Kd=h,Hd.attachEvent("onpropertychange",hO)):o==="focusout"&&fO()}function H9(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Dp(Kd)}function K9(o,c){if(o==="click")return Dp(c)}function G9(o,c){if(o==="input"||o==="change")return Dp(c)}function V9(o,c){return o===c&&(o!==0||1/o===1/c)||o!==o&&c!==c}var ii=typeof Object.is=="function"?Object.is:V9;function Gd(o,c){if(ii(o,c))return!0;if(typeof o!="object"||o===null||typeof c!="object"||c===null)return!1;var h=Object.keys(o),y=Object.keys(c);if(h.length!==y.length)return!1;for(y=0;y<h.length;y++){var w=h[y];if(!cn.call(c,w)||!ii(o[w],c[w]))return!1}return!0}function pO(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function mO(o,c){var h=pO(o);o=0;for(var y;h;){if(h.nodeType===3){if(y=o+h.textContent.length,o<=c&&y>=c)return{node:h,offset:c-o};o=y}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=pO(h)}}function gO(o,c){return o&&c?o===c?!0:o&&o.nodeType===3?!1:c&&c.nodeType===3?gO(o,c.parentNode):"contains"in o?o.contains(c):o.compareDocumentPosition?!!(o.compareDocumentPosition(c)&16):!1:!1}function yO(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var c=Op(o.document);c instanceof o.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)o=c.contentWindow;else break;c=Op(o.document)}return c}function f0(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c&&(c==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||c==="textarea"||o.contentEditable==="true")}var Q9=rs&&"documentMode"in document&&11>=document.documentMode,Rc=null,h0=null,Vd=null,p0=!1;function vO(o,c,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;p0||Rc==null||Rc!==Op(y)||(y=Rc,"selectionStart"in y&&f0(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Vd&&Gd(Vd,y)||(Vd=y,y=Sm(h0,"onSelect"),0<y.length&&(c=new Pp("onSelect","select",null,c,h),o.push({event:c,listeners:y}),c.target=Rc)))}function ll(o,c){var h={};return h[o.toLowerCase()]=c.toLowerCase(),h["Webkit"+o]="webkit"+c,h["Moz"+o]="moz"+c,h}var Dc={animationend:ll("Animation","AnimationEnd"),animationiteration:ll("Animation","AnimationIteration"),animationstart:ll("Animation","AnimationStart"),transitionrun:ll("Transition","TransitionRun"),transitionstart:ll("Transition","TransitionStart"),transitioncancel:ll("Transition","TransitionCancel"),transitionend:ll("Transition","TransitionEnd")},m0={},xO={};rs&&(xO=document.createElement("div").style,"AnimationEvent"in window||(delete Dc.animationend.animation,delete Dc.animationiteration.animation,delete Dc.animationstart.animation),"TransitionEvent"in window||delete Dc.transitionend.transition);function cl(o){if(m0[o])return m0[o];if(!Dc[o])return o;var c=Dc[o],h;for(h in c)if(c.hasOwnProperty(h)&&h in xO)return m0[o]=c[h];return o}var bO=cl("animationend"),wO=cl("animationiteration"),jO=cl("animationstart"),W9=cl("transitionrun"),Y9=cl("transitionstart"),Z9=cl("transitioncancel"),SO=cl("transitionend"),NO=new Map,g0="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(" ");g0.push("scrollEnd");function ta(o,c){NO.set(o,c),es(c,[o])}var Mp=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},ki=[],Mc=0,y0=0;function Ip(){for(var o=Mc,c=y0=Mc=0;c<o;){var h=ki[c];ki[c++]=null;var y=ki[c];ki[c++]=null;var w=ki[c];ki[c++]=null;var N=ki[c];if(ki[c++]=null,y!==null&&w!==null){var z=y.pending;z===null?w.next=w:(w.next=z.next,z.next=w),y.pending=w}N!==0&&kO(h,w,N)}}function Lp(o,c,h,y){ki[Mc++]=o,ki[Mc++]=c,ki[Mc++]=h,ki[Mc++]=y,y0|=y,o.lanes|=y,o=o.alternate,o!==null&&(o.lanes|=y)}function v0(o,c,h,y){return Lp(o,c,h,y),$p(o)}function ul(o,c){return Lp(o,null,null,c),$p(o)}function kO(o,c,h){o.lanes|=h;var y=o.alternate;y!==null&&(y.lanes|=h);for(var w=!1,N=o.return;N!==null;)N.childLanes|=h,y=N.alternate,y!==null&&(y.childLanes|=h),N.tag===22&&(o=N.stateNode,o===null||o._visibility&1||(w=!0)),o=N,N=N.return;return o.tag===3?(N=o.stateNode,w&&c!==null&&(w=31-de(h),o=N.hiddenUpdates,y=o[w],y===null?o[w]=[c]:y.push(c),c.lane=h|536870912),N):null}function $p(o){if(50<gf)throw gf=0,Ab=null,Error(r(185));for(var c=o.return;c!==null;)o=c,c=o.return;return o.tag===3?o.stateNode:null}var Ic={};function X9(o,c,h,y){this.tag=o,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(o,c,h,y){return new X9(o,c,h,y)}function x0(o){return o=o.prototype,!(!o||!o.isReactComponent)}function is(o,c){var h=o.alternate;return h===null?(h=ai(o.tag,c,o.key,o.mode),h.elementType=o.elementType,h.type=o.type,h.stateNode=o.stateNode,h.alternate=o,o.alternate=h):(h.pendingProps=c,h.type=o.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=o.flags&65011712,h.childLanes=o.childLanes,h.lanes=o.lanes,h.child=o.child,h.memoizedProps=o.memoizedProps,h.memoizedState=o.memoizedState,h.updateQueue=o.updateQueue,c=o.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=o.sibling,h.index=o.index,h.ref=o.ref,h.refCleanup=o.refCleanup,h}function CO(o,c){o.flags&=65011714;var h=o.alternate;return h===null?(o.childLanes=0,o.lanes=c,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=h.childLanes,o.lanes=h.lanes,o.child=h.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=h.memoizedProps,o.memoizedState=h.memoizedState,o.updateQueue=h.updateQueue,o.type=h.type,c=h.dependencies,o.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),o}function Bp(o,c,h,y,w,N){var z=0;if(y=o,typeof o=="function")x0(o)&&(z=1);else if(typeof o=="string")z=rK(o,h,G.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case $:return o=ai(31,h,c,w),o.elementType=$,o.lanes=N,o;case b:return dl(h.children,w,N,c);case S:z=8,w|=24;break;case k:return o=ai(12,h,c,w|2),o.elementType=k,o.lanes=N,o;case T:return o=ai(13,h,c,w),o.elementType=T,o.lanes=N,o;case O:return o=ai(19,h,c,w),o.elementType=O,o.lanes=N,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case C:z=10;break e;case E:z=9;break e;case A:z=11;break e;case _:z=14;break e;case P:z=16,y=null;break e}z=29,h=Error(r(130,o===null?"null":typeof o,"")),y=null}return c=ai(z,h,c,w),c.elementType=o,c.type=y,c.lanes=N,c}function dl(o,c,h,y){return o=ai(7,o,y,c),o.lanes=h,o}function b0(o,c,h){return o=ai(6,o,null,c),o.lanes=h,o}function AO(o){var c=ai(18,null,null,0);return c.stateNode=o,c}function w0(o,c,h){return c=ai(4,o.children!==null?o.children:[],o.key,c),c.lanes=h,c.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},c}var OO=new WeakMap;function Ci(o,c){if(typeof o=="object"&&o!==null){var h=OO.get(o);return h!==void 0?h:(c={value:o,source:c,stack:Lt(c)},OO.set(o,c),c)}return{value:o,source:c,stack:Lt(c)}}var Lc=[],$c=0,Up=null,Qd=0,Ai=[],Oi=0,Xs=null,Na=1,ka="";function as(o,c){Lc[$c++]=Qd,Lc[$c++]=Up,Up=o,Qd=c}function EO(o,c,h){Ai[Oi++]=Na,Ai[Oi++]=ka,Ai[Oi++]=Xs,Xs=o;var y=Na;o=ka;var w=32-de(y)-1;y&=~(1<<w),h+=1;var N=32-de(c)+w;if(30<N){var z=w-w%5;N=(y&(1<<z)-1).toString(32),y>>=z,w-=z,Na=1<<32-de(c)+w|h<<w|y,ka=N+o}else Na=1<<N|h<<w|y,ka=o}function j0(o){o.return!==null&&(as(o,1),EO(o,1,0))}function S0(o){for(;o===Up;)Up=Lc[--$c],Lc[$c]=null,Qd=Lc[--$c],Lc[$c]=null;for(;o===Xs;)Xs=Ai[--Oi],Ai[Oi]=null,ka=Ai[--Oi],Ai[Oi]=null,Na=Ai[--Oi],Ai[Oi]=null}function _O(o,c){Ai[Oi++]=Na,Ai[Oi++]=ka,Ai[Oi++]=Xs,Na=c.id,ka=c.overflow,Xs=o}var or=null,nn=null,wt=!1,Js=null,Ei=!1,N0=Error(r(519));function eo(o){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wd(Ci(c,o)),N0}function zO(o){var c=o.stateNode,h=o.type,y=o.memoizedProps;switch(c[nt]=o,c[St]=y,h){case"dialog":yt("cancel",c),yt("close",c);break;case"iframe":case"object":case"embed":yt("load",c);break;case"video":case"audio":for(h=0;h<vf.length;h++)yt(vf[h],c);break;case"source":yt("error",c);break;case"img":case"image":case"link":yt("error",c),yt("load",c);break;case"details":yt("toggle",c);break;case"input":yt("invalid",c),HA(c,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0);break;case"select":yt("invalid",c);break;case"textarea":yt("invalid",c),GA(c,y.value,y.defaultValue,y.children)}h=y.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||c.textContent===""+h||y.suppressHydrationWarning===!0||Q_(c.textContent,h)?(y.popover!=null&&(yt("beforetoggle",c),yt("toggle",c)),y.onScroll!=null&&yt("scroll",c),y.onScrollEnd!=null&&yt("scrollend",c),y.onClick!=null&&(c.onclick=ns),c=!0):c=!1,c||eo(o,!0)}function TO(o){for(or=o.return;or;)switch(or.tag){case 5:case 31:case 13:Ei=!1;return;case 27:case 3:Ei=!0;return;default:or=or.return}}function Bc(o){if(o!==or)return!1;if(!wt)return TO(o),wt=!0,!1;var c=o.tag,h;if((h=c!==3&&c!==27)&&((h=c===5)&&(h=o.type,h=!(h!=="form"&&h!=="button")||qb(o.type,o.memoizedProps)),h=!h),h&&nn&&eo(o),TO(o),c===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));nn=rz(o)}else if(c===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));nn=rz(o)}else c===27?(c=nn,mo(o.type)?(o=Vb,Vb=null,nn=o):nn=c):nn=or?zi(o.stateNode.nextSibling):null;return!0}function fl(){nn=or=null,wt=!1}function k0(){var o=Js;return o!==null&&(Kr===null?Kr=o:Kr.push.apply(Kr,o),Js=null),o}function Wd(o){Js===null?Js=[o]:Js.push(o)}var C0=M(null),hl=null,ss=null;function to(o,c,h){D(C0,c._currentValue),c._currentValue=h}function os(o){o._currentValue=C0.current,q(C0)}function A0(o,c,h){for(;o!==null;){var y=o.alternate;if((o.childLanes&c)!==c?(o.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),o===h)break;o=o.return}}function O0(o,c,h,y){var w=o.child;for(w!==null&&(w.return=o);w!==null;){var N=w.dependencies;if(N!==null){var z=w.child;N=N.firstContext;e:for(;N!==null;){var L=N;N=w;for(var K=0;K<c.length;K++)if(L.context===c[K]){N.lanes|=h,L=N.alternate,L!==null&&(L.lanes|=h),A0(N.return,h,o),y||(z=null);break e}N=L.next}}else if(w.tag===18){if(z=w.return,z===null)throw Error(r(341));z.lanes|=h,N=z.alternate,N!==null&&(N.lanes|=h),A0(z,h,o),z=null}else z=w.child;if(z!==null)z.return=w;else for(z=w;z!==null;){if(z===o){z=null;break}if(w=z.sibling,w!==null){w.return=z.return,z=w;break}z=z.return}w=z}}function Uc(o,c,h,y){o=null;for(var w=c,N=!1;w!==null;){if(!N){if((w.flags&524288)!==0)N=!0;else if((w.flags&262144)!==0)break}if(w.tag===10){var z=w.alternate;if(z===null)throw Error(r(387));if(z=z.memoizedProps,z!==null){var L=w.type;ii(w.pendingProps.value,z.value)||(o!==null?o.push(L):o=[L])}}else if(w===Ce.current){if(z=w.alternate,z===null)throw Error(r(387));z.memoizedState.memoizedState!==w.memoizedState.memoizedState&&(o!==null?o.push(Sf):o=[Sf])}w=w.return}o!==null&&O0(c,o,h,y),c.flags|=262144}function qp(o){for(o=o.firstContext;o!==null;){if(!ii(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function pl(o){hl=o,ss=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function lr(o){return PO(hl,o)}function Fp(o,c){return hl===null&&pl(o),PO(o,c)}function PO(o,c){var h=c._currentValue;if(c={context:c,memoizedValue:h,next:null},ss===null){if(o===null)throw Error(r(308));ss=c,o.dependencies={lanes:0,firstContext:c},o.flags|=524288}else ss=ss.next=c;return h}var J9=typeof AbortController<"u"?AbortController:function(){var o=[],c=this.signal={aborted:!1,addEventListener:function(h,y){o.push(y)}};this.abort=function(){c.aborted=!0,o.forEach(function(h){return h()})}},eH=e.unstable_scheduleCallback,tH=e.unstable_NormalPriority,Mn={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function E0(){return{controller:new J9,data:new Map,refCount:0}}function Yd(o){o.refCount--,o.refCount===0&&eH(tH,function(){o.controller.abort()})}var Zd=null,_0=0,qc=0,Fc=null;function nH(o,c){if(Zd===null){var h=Zd=[];_0=0,qc=Pb(),Fc={status:"pending",value:void 0,then:function(y){h.push(y)}}}return _0++,c.then(RO,RO),c}function RO(){if(--_0===0&&Zd!==null){Fc!==null&&(Fc.status="fulfilled");var o=Zd;Zd=null,qc=0,Fc=null;for(var c=0;c<o.length;c++)(0,o[c])()}}function rH(o,c){var h=[],y={status:"pending",value:null,reason:null,then:function(w){h.push(w)}};return o.then(function(){y.status="fulfilled",y.value=c;for(var w=0;w<h.length;w++)(0,h[w])(c)},function(w){for(y.status="rejected",y.reason=w,w=0;w<h.length;w++)(0,h[w])(void 0)}),y}var DO=H.S;H.S=function(o,c){v_=mt(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&nH(o,c),DO!==null&&DO(o,c)};var ml=M(null);function z0(){var o=ml.current;return o!==null?o:Vt.pooledCache}function Hp(o,c){c===null?D(ml,ml.current):D(ml,c.pool)}function MO(){var o=z0();return o===null?null:{parent:Mn._currentValue,pool:o}}var Hc=Error(r(460)),T0=Error(r(474)),Kp=Error(r(542)),Gp={then:function(){}};function IO(o){return o=o.status,o==="fulfilled"||o==="rejected"}function LO(o,c,h){switch(h=o[h],h===void 0?o.push(c):h!==c&&(c.then(ns,ns),c=h),c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,BO(o),o;default:if(typeof c.status=="string")c.then(ns,ns);else{if(o=Vt,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=c,o.status="pending",o.then(function(y){if(c.status==="pending"){var w=c;w.status="fulfilled",w.value=y}},function(y){if(c.status==="pending"){var w=c;w.status="rejected",w.reason=y}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,BO(o),o}throw yl=c,Hc}}function gl(o){try{var c=o._init;return c(o._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(yl=h,Hc):h}}var yl=null;function $O(){if(yl===null)throw Error(r(459));var o=yl;return yl=null,o}function BO(o){if(o===Hc||o===Kp)throw Error(r(483))}var Kc=null,Xd=0;function Vp(o){var c=Xd;return Xd+=1,Kc===null&&(Kc=[]),LO(Kc,o,c)}function Jd(o,c){c=c.props.ref,o.ref=c!==void 0?c:null}function Qp(o,c){throw c.$$typeof===g?Error(r(525)):(o=Object.prototype.toString.call(c),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":o)))}function UO(o){function c(te,W){if(o){var ie=te.deletions;ie===null?(te.deletions=[W],te.flags|=16):ie.push(W)}}function h(te,W){if(!o)return null;for(;W!==null;)c(te,W),W=W.sibling;return null}function y(te){for(var W=new Map;te!==null;)te.key!==null?W.set(te.key,te):W.set(te.index,te),te=te.sibling;return W}function w(te,W){return te=is(te,W),te.index=0,te.sibling=null,te}function N(te,W,ie){return te.index=ie,o?(ie=te.alternate,ie!==null?(ie=ie.index,ie<W?(te.flags|=67108866,W):ie):(te.flags|=67108866,W)):(te.flags|=1048576,W)}function z(te){return o&&te.alternate===null&&(te.flags|=67108866),te}function L(te,W,ie,xe){return W===null||W.tag!==6?(W=b0(ie,te.mode,xe),W.return=te,W):(W=w(W,ie),W.return=te,W)}function K(te,W,ie,xe){var Ke=ie.type;return Ke===b?ge(te,W,ie.props.children,xe,ie.key):W!==null&&(W.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===P&&gl(Ke)===W.type)?(W=w(W,ie.props),Jd(W,ie),W.return=te,W):(W=Bp(ie.type,ie.key,ie.props,null,te.mode,xe),Jd(W,ie),W.return=te,W)}function ae(te,W,ie,xe){return W===null||W.tag!==4||W.stateNode.containerInfo!==ie.containerInfo||W.stateNode.implementation!==ie.implementation?(W=w0(ie,te.mode,xe),W.return=te,W):(W=w(W,ie.children||[]),W.return=te,W)}function ge(te,W,ie,xe,Ke){return W===null||W.tag!==7?(W=dl(ie,te.mode,xe,Ke),W.return=te,W):(W=w(W,ie),W.return=te,W)}function we(te,W,ie){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=b0(""+W,te.mode,ie),W.return=te,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case v:return ie=Bp(W.type,W.key,W.props,null,te.mode,ie),Jd(ie,W),ie.return=te,ie;case j:return W=w0(W,te.mode,ie),W.return=te,W;case P:return W=gl(W),we(te,W,ie)}if(Z(W)||B(W))return W=dl(W,te.mode,ie,null),W.return=te,W;if(typeof W.then=="function")return we(te,Vp(W),ie);if(W.$$typeof===C)return we(te,Fp(te,W),ie);Qp(te,W)}return null}function le(te,W,ie,xe){var Ke=W!==null?W.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Ke!==null?null:L(te,W,""+ie,xe);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case v:return ie.key===Ke?K(te,W,ie,xe):null;case j:return ie.key===Ke?ae(te,W,ie,xe):null;case P:return ie=gl(ie),le(te,W,ie,xe)}if(Z(ie)||B(ie))return Ke!==null?null:ge(te,W,ie,xe,null);if(typeof ie.then=="function")return le(te,W,Vp(ie),xe);if(ie.$$typeof===C)return le(te,W,Fp(te,ie),xe);Qp(te,ie)}return null}function ue(te,W,ie,xe,Ke){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return te=te.get(ie)||null,L(W,te,""+xe,Ke);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case v:return te=te.get(xe.key===null?ie:xe.key)||null,K(W,te,xe,Ke);case j:return te=te.get(xe.key===null?ie:xe.key)||null,ae(W,te,xe,Ke);case P:return xe=gl(xe),ue(te,W,ie,xe,Ke)}if(Z(xe)||B(xe))return te=te.get(ie)||null,ge(W,te,xe,Ke,null);if(typeof xe.then=="function")return ue(te,W,ie,Vp(xe),Ke);if(xe.$$typeof===C)return ue(te,W,ie,Fp(W,xe),Ke);Qp(W,xe)}return null}function De(te,W,ie,xe){for(var Ke=null,kt=null,Be=W,ot=W=0,bt=null;Be!==null&&ot<ie.length;ot++){Be.index>ot?(bt=Be,Be=null):bt=Be.sibling;var Ct=le(te,Be,ie[ot],xe);if(Ct===null){Be===null&&(Be=bt);break}o&&Be&&Ct.alternate===null&&c(te,Be),W=N(Ct,W,ot),kt===null?Ke=Ct:kt.sibling=Ct,kt=Ct,Be=bt}if(ot===ie.length)return h(te,Be),wt&&as(te,ot),Ke;if(Be===null){for(;ot<ie.length;ot++)Be=we(te,ie[ot],xe),Be!==null&&(W=N(Be,W,ot),kt===null?Ke=Be:kt.sibling=Be,kt=Be);return wt&&as(te,ot),Ke}for(Be=y(Be);ot<ie.length;ot++)bt=ue(Be,te,ot,ie[ot],xe),bt!==null&&(o&&bt.alternate!==null&&Be.delete(bt.key===null?ot:bt.key),W=N(bt,W,ot),kt===null?Ke=bt:kt.sibling=bt,kt=bt);return o&&Be.forEach(function(bo){return c(te,bo)}),wt&&as(te,ot),Ke}function Ye(te,W,ie,xe){if(ie==null)throw Error(r(151));for(var Ke=null,kt=null,Be=W,ot=W=0,bt=null,Ct=ie.next();Be!==null&&!Ct.done;ot++,Ct=ie.next()){Be.index>ot?(bt=Be,Be=null):bt=Be.sibling;var bo=le(te,Be,Ct.value,xe);if(bo===null){Be===null&&(Be=bt);break}o&&Be&&bo.alternate===null&&c(te,Be),W=N(bo,W,ot),kt===null?Ke=bo:kt.sibling=bo,kt=bo,Be=bt}if(Ct.done)return h(te,Be),wt&&as(te,ot),Ke;if(Be===null){for(;!Ct.done;ot++,Ct=ie.next())Ct=we(te,Ct.value,xe),Ct!==null&&(W=N(Ct,W,ot),kt===null?Ke=Ct:kt.sibling=Ct,kt=Ct);return wt&&as(te,ot),Ke}for(Be=y(Be);!Ct.done;ot++,Ct=ie.next())Ct=ue(Be,te,ot,Ct.value,xe),Ct!==null&&(o&&Ct.alternate!==null&&Be.delete(Ct.key===null?ot:Ct.key),W=N(Ct,W,ot),kt===null?Ke=Ct:kt.sibling=Ct,kt=Ct);return o&&Be.forEach(function(pK){return c(te,pK)}),wt&&as(te,ot),Ke}function Ut(te,W,ie,xe){if(typeof ie=="object"&&ie!==null&&ie.type===b&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case v:e:{for(var Ke=ie.key;W!==null;){if(W.key===Ke){if(Ke=ie.type,Ke===b){if(W.tag===7){h(te,W.sibling),xe=w(W,ie.props.children),xe.return=te,te=xe;break e}}else if(W.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===P&&gl(Ke)===W.type){h(te,W.sibling),xe=w(W,ie.props),Jd(xe,ie),xe.return=te,te=xe;break e}h(te,W);break}else c(te,W);W=W.sibling}ie.type===b?(xe=dl(ie.props.children,te.mode,xe,ie.key),xe.return=te,te=xe):(xe=Bp(ie.type,ie.key,ie.props,null,te.mode,xe),Jd(xe,ie),xe.return=te,te=xe)}return z(te);case j:e:{for(Ke=ie.key;W!==null;){if(W.key===Ke)if(W.tag===4&&W.stateNode.containerInfo===ie.containerInfo&&W.stateNode.implementation===ie.implementation){h(te,W.sibling),xe=w(W,ie.children||[]),xe.return=te,te=xe;break e}else{h(te,W);break}else c(te,W);W=W.sibling}xe=w0(ie,te.mode,xe),xe.return=te,te=xe}return z(te);case P:return ie=gl(ie),Ut(te,W,ie,xe)}if(Z(ie))return De(te,W,ie,xe);if(B(ie)){if(Ke=B(ie),typeof Ke!="function")throw Error(r(150));return ie=Ke.call(ie),Ye(te,W,ie,xe)}if(typeof ie.then=="function")return Ut(te,W,Vp(ie),xe);if(ie.$$typeof===C)return Ut(te,W,Fp(te,ie),xe);Qp(te,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,W!==null&&W.tag===6?(h(te,W.sibling),xe=w(W,ie),xe.return=te,te=xe):(h(te,W),xe=b0(ie,te.mode,xe),xe.return=te,te=xe),z(te)):h(te,W)}return function(te,W,ie,xe){try{Xd=0;var Ke=Ut(te,W,ie,xe);return Kc=null,Ke}catch(Be){if(Be===Hc||Be===Kp)throw Be;var kt=ai(29,Be,null,te.mode);return kt.lanes=xe,kt.return=te,kt}}}var vl=UO(!0),qO=UO(!1),no=!1;function P0(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function R0(o,c){o=o.updateQueue,c.updateQueue===o&&(c.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function ro(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function io(o,c,h){var y=o.updateQueue;if(y===null)return null;if(y=y.shared,(zt&2)!==0){var w=y.pending;return w===null?c.next=c:(c.next=w.next,w.next=c),y.pending=c,c=$p(o),kO(o,null,h),c}return Lp(o,y,c,h),$p(o)}function ef(o,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194048)!==0)){var y=c.lanes;y&=o.pendingLanes,h|=y,c.lanes=h,Np(o,h)}}function D0(o,c){var h=o.updateQueue,y=o.alternate;if(y!==null&&(y=y.updateQueue,h===y)){var w=null,N=null;if(h=h.firstBaseUpdate,h!==null){do{var z={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};N===null?w=N=z:N=N.next=z,h=h.next}while(h!==null);N===null?w=N=c:N=N.next=c}else w=N=c;h={baseState:y.baseState,firstBaseUpdate:w,lastBaseUpdate:N,shared:y.shared,callbacks:y.callbacks},o.updateQueue=h;return}o=h.lastBaseUpdate,o===null?h.firstBaseUpdate=c:o.next=c,h.lastBaseUpdate=c}var M0=!1;function tf(){if(M0){var o=Fc;if(o!==null)throw o}}function nf(o,c,h,y){M0=!1;var w=o.updateQueue;no=!1;var N=w.firstBaseUpdate,z=w.lastBaseUpdate,L=w.shared.pending;if(L!==null){w.shared.pending=null;var K=L,ae=K.next;K.next=null,z===null?N=ae:z.next=ae,z=K;var ge=o.alternate;ge!==null&&(ge=ge.updateQueue,L=ge.lastBaseUpdate,L!==z&&(L===null?ge.firstBaseUpdate=ae:L.next=ae,ge.lastBaseUpdate=K))}if(N!==null){var we=w.baseState;z=0,ge=ae=K=null,L=N;do{var le=L.lane&-536870913,ue=le!==L.lane;if(ue?(xt&le)===le:(y&le)===le){le!==0&&le===qc&&(M0=!0),ge!==null&&(ge=ge.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var De=o,Ye=L;le=c;var Ut=h;switch(Ye.tag){case 1:if(De=Ye.payload,typeof De=="function"){we=De.call(Ut,we,le);break e}we=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Ye.payload,le=typeof De=="function"?De.call(Ut,we,le):De,le==null)break e;we=m({},we,le);break e;case 2:no=!0}}le=L.callback,le!==null&&(o.flags|=64,ue&&(o.flags|=8192),ue=w.callbacks,ue===null?w.callbacks=[le]:ue.push(le))}else ue={lane:le,tag:L.tag,payload:L.payload,callback:L.callback,next:null},ge===null?(ae=ge=ue,K=we):ge=ge.next=ue,z|=le;if(L=L.next,L===null){if(L=w.shared.pending,L===null)break;ue=L,L=ue.next,ue.next=null,w.lastBaseUpdate=ue,w.shared.pending=null}}while(!0);ge===null&&(K=we),w.baseState=K,w.firstBaseUpdate=ae,w.lastBaseUpdate=ge,N===null&&(w.shared.lanes=0),co|=z,o.lanes=z,o.memoizedState=we}}function FO(o,c){if(typeof o!="function")throw Error(r(191,o));o.call(c)}function HO(o,c){var h=o.callbacks;if(h!==null)for(o.callbacks=null,o=0;o<h.length;o++)FO(h[o],c)}var Gc=M(null),Wp=M(0);function KO(o,c){o=gs,D(Wp,o),D(Gc,c),gs=o|c.baseLanes}function I0(){D(Wp,gs),D(Gc,Gc.current)}function L0(){gs=Wp.current,q(Gc),q(Wp)}var si=M(null),_i=null;function ao(o){var c=o.alternate;D(zn,zn.current&1),D(si,o),_i===null&&(c===null||Gc.current!==null||c.memoizedState!==null)&&(_i=o)}function $0(o){D(zn,zn.current),D(si,o),_i===null&&(_i=o)}function GO(o){o.tag===22?(D(zn,zn.current),D(si,o),_i===null&&(_i=o)):so()}function so(){D(zn,zn.current),D(si,si.current)}function oi(o){q(si),_i===o&&(_i=null),q(zn)}var zn=M(0);function Yp(o){for(var c=o;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Kb(h)||Gb(h)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var ls=0,st=null,$t=null,In=null,Zp=!1,Vc=!1,xl=!1,Xp=0,rf=0,Qc=null,iH=0;function jn(){throw Error(r(321))}function B0(o,c){if(c===null)return!1;for(var h=0;h<c.length&&h<o.length;h++)if(!ii(o[h],c[h]))return!1;return!0}function U0(o,c,h,y,w,N){return ls=N,st=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,H.H=o===null||o.memoizedState===null?EE:nb,xl=!1,N=h(y,w),xl=!1,Vc&&(N=QO(c,h,y,w)),VO(o),N}function VO(o){H.H=of;var c=$t!==null&&$t.next!==null;if(ls=0,In=$t=st=null,Zp=!1,rf=0,Qc=null,c)throw Error(r(300));o===null||Ln||(o=o.dependencies,o!==null&&qp(o)&&(Ln=!0))}function QO(o,c,h,y){st=o;var w=0;do{if(Vc&&(Qc=null),rf=0,Vc=!1,25<=w)throw Error(r(301));if(w+=1,In=$t=null,o.updateQueue!=null){var N=o.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}H.H=_E,N=c(h,y)}while(Vc);return N}function aH(){var o=H.H,c=o.useState()[0];return c=typeof c.then=="function"?af(c):c,o=o.useState()[0],($t!==null?$t.memoizedState:null)!==o&&(st.flags|=1024),c}function q0(){var o=Xp!==0;return Xp=0,o}function F0(o,c,h){c.updateQueue=o.updateQueue,c.flags&=-2053,o.lanes&=~h}function H0(o){if(Zp){for(o=o.memoizedState;o!==null;){var c=o.queue;c!==null&&(c.pending=null),o=o.next}Zp=!1}ls=0,In=$t=st=null,Vc=!1,rf=Xp=0,Qc=null}function _r(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return In===null?st.memoizedState=In=o:In=In.next=o,In}function Tn(){if($t===null){var o=st.alternate;o=o!==null?o.memoizedState:null}else o=$t.next;var c=In===null?st.memoizedState:In.next;if(c!==null)In=c,$t=o;else{if(o===null)throw st.alternate===null?Error(r(467)):Error(r(310));$t=o,o={memoizedState:$t.memoizedState,baseState:$t.baseState,baseQueue:$t.baseQueue,queue:$t.queue,next:null},In===null?st.memoizedState=In=o:In=In.next=o}return In}function Jp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function af(o){var c=rf;return rf+=1,Qc===null&&(Qc=[]),o=LO(Qc,o,c),c=st,(In===null?c.memoizedState:In.next)===null&&(c=c.alternate,H.H=c===null||c.memoizedState===null?EE:nb),o}function em(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return af(o);if(o.$$typeof===C)return lr(o)}throw Error(r(438,String(o)))}function K0(o){var c=null,h=st.updateQueue;if(h!==null&&(c=h.memoCache),c==null){var y=st.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(c={data:y.data.map(function(w){return w.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),h===null&&(h=Jp(),st.updateQueue=h),h.memoCache=c,h=c.data[c.index],h===void 0)for(h=c.data[c.index]=Array(o),y=0;y<o;y++)h[y]=F;return c.index++,h}function cs(o,c){return typeof c=="function"?c(o):c}function tm(o){var c=Tn();return G0(c,$t,o)}function G0(o,c,h){var y=o.queue;if(y===null)throw Error(r(311));y.lastRenderedReducer=h;var w=o.baseQueue,N=y.pending;if(N!==null){if(w!==null){var z=w.next;w.next=N.next,N.next=z}c.baseQueue=w=N,y.pending=null}if(N=o.baseState,w===null)o.memoizedState=N;else{c=w.next;var L=z=null,K=null,ae=c,ge=!1;do{var we=ae.lane&-536870913;if(we!==ae.lane?(xt&we)===we:(ls&we)===we){var le=ae.revertLane;if(le===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),we===qc&&(ge=!0);else if((ls&le)===le){ae=ae.next,le===qc&&(ge=!0);continue}else we={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},K===null?(L=K=we,z=N):K=K.next=we,st.lanes|=le,co|=le;we=ae.action,xl&&h(N,we),N=ae.hasEagerState?ae.eagerState:h(N,we)}else le={lane:we,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},K===null?(L=K=le,z=N):K=K.next=le,st.lanes|=we,co|=we;ae=ae.next}while(ae!==null&&ae!==c);if(K===null?z=N:K.next=L,!ii(N,o.memoizedState)&&(Ln=!0,ge&&(h=Fc,h!==null)))throw h;o.memoizedState=N,o.baseState=z,o.baseQueue=K,y.lastRenderedState=N}return w===null&&(y.lanes=0),[o.memoizedState,y.dispatch]}function V0(o){var c=Tn(),h=c.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=o;var y=h.dispatch,w=h.pending,N=c.memoizedState;if(w!==null){h.pending=null;var z=w=w.next;do N=o(N,z.action),z=z.next;while(z!==w);ii(N,c.memoizedState)||(Ln=!0),c.memoizedState=N,c.baseQueue===null&&(c.baseState=N),h.lastRenderedState=N}return[N,y]}function WO(o,c,h){var y=st,w=Tn(),N=wt;if(N){if(h===void 0)throw Error(r(407));h=h()}else h=c();var z=!ii(($t||w).memoizedState,h);if(z&&(w.memoizedState=h,Ln=!0),w=w.queue,Y0(XO.bind(null,y,w,o),[o]),w.getSnapshot!==c||z||In!==null&&In.memoizedState.tag&1){if(y.flags|=2048,Wc(9,{destroy:void 0},ZO.bind(null,y,w,h,c),null),Vt===null)throw Error(r(349));N||(ls&127)!==0||YO(y,c,h)}return h}function YO(o,c,h){o.flags|=16384,o={getSnapshot:c,value:h},c=st.updateQueue,c===null?(c=Jp(),st.updateQueue=c,c.stores=[o]):(h=c.stores,h===null?c.stores=[o]:h.push(o))}function ZO(o,c,h,y){c.value=h,c.getSnapshot=y,JO(c)&&eE(o)}function XO(o,c,h){return h(function(){JO(c)&&eE(o)})}function JO(o){var c=o.getSnapshot;o=o.value;try{var h=c();return!ii(o,h)}catch{return!0}}function eE(o){var c=ul(o,2);c!==null&&Gr(c,o,2)}function Q0(o){var c=_r();if(typeof o=="function"){var h=o;if(o=h(),xl){Kt(!0);try{h()}finally{Kt(!1)}}}return c.memoizedState=c.baseState=o,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:o},c}function tE(o,c,h,y){return o.baseState=h,G0(o,$t,typeof y=="function"?y:cs)}function sH(o,c,h,y,w){if(im(o))throw Error(r(485));if(o=c.action,o!==null){var N={payload:w,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(z){N.listeners.push(z)}};H.T!==null?h(!0):N.isTransition=!1,y(N),h=c.pending,h===null?(N.next=c.pending=N,nE(c,N)):(N.next=h.next,c.pending=h.next=N)}}function nE(o,c){var h=c.action,y=c.payload,w=o.state;if(c.isTransition){var N=H.T,z={};H.T=z;try{var L=h(w,y),K=H.S;K!==null&&K(z,L),rE(o,c,L)}catch(ae){W0(o,c,ae)}finally{N!==null&&z.types!==null&&(N.types=z.types),H.T=N}}else try{N=h(w,y),rE(o,c,N)}catch(ae){W0(o,c,ae)}}function rE(o,c,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(y){iE(o,c,y)},function(y){return W0(o,c,y)}):iE(o,c,h)}function iE(o,c,h){c.status="fulfilled",c.value=h,aE(c),o.state=h,c=o.pending,c!==null&&(h=c.next,h===c?o.pending=null:(h=h.next,c.next=h,nE(o,h)))}function W0(o,c,h){var y=o.pending;if(o.pending=null,y!==null){y=y.next;do c.status="rejected",c.reason=h,aE(c),c=c.next;while(c!==y)}o.action=null}function aE(o){o=o.listeners;for(var c=0;c<o.length;c++)(0,o[c])()}function sE(o,c){return c}function oE(o,c){if(wt){var h=Vt.formState;if(h!==null){e:{var y=st;if(wt){if(nn){t:{for(var w=nn,N=Ei;w.nodeType!==8;){if(!N){w=null;break t}if(w=zi(w.nextSibling),w===null){w=null;break t}}N=w.data,w=N==="F!"||N==="F"?w:null}if(w){nn=zi(w.nextSibling),y=w.data==="F!";break e}}eo(y)}y=!1}y&&(c=h[0])}}return h=_r(),h.memoizedState=h.baseState=c,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sE,lastRenderedState:c},h.queue=y,h=CE.bind(null,st,y),y.dispatch=h,y=Q0(!1),N=tb.bind(null,st,!1,y.queue),y=_r(),w={state:c,dispatch:null,action:o,pending:null},y.queue=w,h=sH.bind(null,st,w,N,h),w.dispatch=h,y.memoizedState=o,[c,h,!1]}function lE(o){var c=Tn();return cE(c,$t,o)}function cE(o,c,h){if(c=G0(o,c,sE)[0],o=tm(cs)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var y=af(c)}catch(z){throw z===Hc?Kp:z}else y=c;c=Tn();var w=c.queue,N=w.dispatch;return h!==c.memoizedState&&(st.flags|=2048,Wc(9,{destroy:void 0},oH.bind(null,w,h),null)),[y,N,o]}function oH(o,c){o.action=c}function uE(o){var c=Tn(),h=$t;if(h!==null)return cE(c,h,o);Tn(),c=c.memoizedState,h=Tn();var y=h.queue.dispatch;return h.memoizedState=o,[c,y,!1]}function Wc(o,c,h,y){return o={tag:o,create:h,deps:y,inst:c,next:null},c=st.updateQueue,c===null&&(c=Jp(),st.updateQueue=c),h=c.lastEffect,h===null?c.lastEffect=o.next=o:(y=h.next,h.next=o,o.next=y,c.lastEffect=o),o}function dE(){return Tn().memoizedState}function nm(o,c,h,y){var w=_r();st.flags|=o,w.memoizedState=Wc(1|c,{destroy:void 0},h,y===void 0?null:y)}function rm(o,c,h,y){var w=Tn();y=y===void 0?null:y;var N=w.memoizedState.inst;$t!==null&&y!==null&&B0(y,$t.memoizedState.deps)?w.memoizedState=Wc(c,N,h,y):(st.flags|=o,w.memoizedState=Wc(1|c,N,h,y))}function fE(o,c){nm(8390656,8,o,c)}function Y0(o,c){rm(2048,8,o,c)}function lH(o){st.flags|=4;var c=st.updateQueue;if(c===null)c=Jp(),st.updateQueue=c,c.events=[o];else{var h=c.events;h===null?c.events=[o]:h.push(o)}}function hE(o){var c=Tn().memoizedState;return lH({ref:c,nextImpl:o}),function(){if((zt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function pE(o,c){return rm(4,2,o,c)}function mE(o,c){return rm(4,4,o,c)}function gE(o,c){if(typeof c=="function"){o=o();var h=c(o);return function(){typeof h=="function"?h():c(null)}}if(c!=null)return o=o(),c.current=o,function(){c.current=null}}function yE(o,c,h){h=h!=null?h.concat([o]):null,rm(4,4,gE.bind(null,c,o),h)}function Z0(){}function vE(o,c){var h=Tn();c=c===void 0?null:c;var y=h.memoizedState;return c!==null&&B0(c,y[1])?y[0]:(h.memoizedState=[o,c],o)}function xE(o,c){var h=Tn();c=c===void 0?null:c;var y=h.memoizedState;if(c!==null&&B0(c,y[1]))return y[0];if(y=o(),xl){Kt(!0);try{o()}finally{Kt(!1)}}return h.memoizedState=[y,c],y}function X0(o,c,h){return h===void 0||(ls&1073741824)!==0&&(xt&261930)===0?o.memoizedState=c:(o.memoizedState=h,o=b_(),st.lanes|=o,co|=o,h)}function bE(o,c,h,y){return ii(h,c)?h:Gc.current!==null?(o=X0(o,h,y),ii(o,c)||(Ln=!0),o):(ls&42)===0||(ls&1073741824)!==0&&(xt&261930)===0?(Ln=!0,o.memoizedState=h):(o=b_(),st.lanes|=o,co|=o,c)}function wE(o,c,h,y,w){var N=J.p;J.p=N!==0&&8>N?N:8;var z=H.T,L={};H.T=L,tb(o,!1,c,h);try{var K=w(),ae=H.S;if(ae!==null&&ae(L,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var ge=rH(K,y);sf(o,c,ge,ui(o))}else sf(o,c,y,ui(o))}catch(we){sf(o,c,{then:function(){},status:"rejected",reason:we},ui())}finally{J.p=N,z!==null&&L.types!==null&&(z.types=L.types),H.T=z}}function cH(){}function J0(o,c,h,y){if(o.tag!==5)throw Error(r(476));var w=jE(o).queue;wE(o,w,c,oe,h===null?cH:function(){return SE(o),h(y)})}function jE(o){var c=o.memoizedState;if(c!==null)return c;c={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:oe},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:h},next:null},o.memoizedState=c,o=o.alternate,o!==null&&(o.memoizedState=c),c}function SE(o){var c=jE(o);c.next===null&&(c=o.alternate.memoizedState),sf(o,c.next.queue,{},ui())}function eb(){return lr(Sf)}function NE(){return Tn().memoizedState}function kE(){return Tn().memoizedState}function uH(o){for(var c=o.return;c!==null;){switch(c.tag){case 24:case 3:var h=ui();o=ro(h);var y=io(c,o,h);y!==null&&(Gr(y,c,h),ef(y,c,h)),c={cache:E0()},o.payload=c;return}c=c.return}}function dH(o,c,h){var y=ui();h={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},im(o)?AE(c,h):(h=v0(o,c,h,y),h!==null&&(Gr(h,o,y),OE(h,c,y)))}function CE(o,c,h){var y=ui();sf(o,c,h,y)}function sf(o,c,h,y){var w={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(im(o))AE(c,w);else{var N=o.alternate;if(o.lanes===0&&(N===null||N.lanes===0)&&(N=c.lastRenderedReducer,N!==null))try{var z=c.lastRenderedState,L=N(z,h);if(w.hasEagerState=!0,w.eagerState=L,ii(L,z))return Lp(o,c,w,0),Vt===null&&Ip(),!1}catch{}if(h=v0(o,c,w,y),h!==null)return Gr(h,o,y),OE(h,c,y),!0}return!1}function tb(o,c,h,y){if(y={lane:2,revertLane:Pb(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},im(o)){if(c)throw Error(r(479))}else c=v0(o,h,y,2),c!==null&&Gr(c,o,2)}function im(o){var c=o.alternate;return o===st||c!==null&&c===st}function AE(o,c){Vc=Zp=!0;var h=o.pending;h===null?c.next=c:(c.next=h.next,h.next=c),o.pending=c}function OE(o,c,h){if((h&4194048)!==0){var y=c.lanes;y&=o.pendingLanes,h|=y,c.lanes=h,Np(o,h)}}var of={readContext:lr,use:em,useCallback:jn,useContext:jn,useEffect:jn,useImperativeHandle:jn,useLayoutEffect:jn,useInsertionEffect:jn,useMemo:jn,useReducer:jn,useRef:jn,useState:jn,useDebugValue:jn,useDeferredValue:jn,useTransition:jn,useSyncExternalStore:jn,useId:jn,useHostTransitionStatus:jn,useFormState:jn,useActionState:jn,useOptimistic:jn,useMemoCache:jn,useCacheRefresh:jn};of.useEffectEvent=jn;var EE={readContext:lr,use:em,useCallback:function(o,c){return _r().memoizedState=[o,c===void 0?null:c],o},useContext:lr,useEffect:fE,useImperativeHandle:function(o,c,h){h=h!=null?h.concat([o]):null,nm(4194308,4,gE.bind(null,c,o),h)},useLayoutEffect:function(o,c){return nm(4194308,4,o,c)},useInsertionEffect:function(o,c){nm(4,2,o,c)},useMemo:function(o,c){var h=_r();c=c===void 0?null:c;var y=o();if(xl){Kt(!0);try{o()}finally{Kt(!1)}}return h.memoizedState=[y,c],y},useReducer:function(o,c,h){var y=_r();if(h!==void 0){var w=h(c);if(xl){Kt(!0);try{h(c)}finally{Kt(!1)}}}else w=c;return y.memoizedState=y.baseState=w,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:w},y.queue=o,o=o.dispatch=dH.bind(null,st,o),[y.memoizedState,o]},useRef:function(o){var c=_r();return o={current:o},c.memoizedState=o},useState:function(o){o=Q0(o);var c=o.queue,h=CE.bind(null,st,c);return c.dispatch=h,[o.memoizedState,h]},useDebugValue:Z0,useDeferredValue:function(o,c){var h=_r();return X0(h,o,c)},useTransition:function(){var o=Q0(!1);return o=wE.bind(null,st,o.queue,!0,!1),_r().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,c,h){var y=st,w=_r();if(wt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=c(),Vt===null)throw Error(r(349));(xt&127)!==0||YO(y,c,h)}w.memoizedState=h;var N={value:h,getSnapshot:c};return w.queue=N,fE(XO.bind(null,y,N,o),[o]),y.flags|=2048,Wc(9,{destroy:void 0},ZO.bind(null,y,N,h,c),null),h},useId:function(){var o=_r(),c=Vt.identifierPrefix;if(wt){var h=ka,y=Na;h=(y&~(1<<32-de(y)-1)).toString(32)+h,c="_"+c+"R_"+h,h=Xp++,0<h&&(c+="H"+h.toString(32)),c+="_"}else h=iH++,c="_"+c+"r_"+h.toString(32)+"_";return o.memoizedState=c},useHostTransitionStatus:eb,useFormState:oE,useActionState:oE,useOptimistic:function(o){var c=_r();c.memoizedState=c.baseState=o;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=h,c=tb.bind(null,st,!0,h),h.dispatch=c,[o,c]},useMemoCache:K0,useCacheRefresh:function(){return _r().memoizedState=uH.bind(null,st)},useEffectEvent:function(o){var c=_r(),h={impl:o};return c.memoizedState=h,function(){if((zt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},nb={readContext:lr,use:em,useCallback:vE,useContext:lr,useEffect:Y0,useImperativeHandle:yE,useInsertionEffect:pE,useLayoutEffect:mE,useMemo:xE,useReducer:tm,useRef:dE,useState:function(){return tm(cs)},useDebugValue:Z0,useDeferredValue:function(o,c){var h=Tn();return bE(h,$t.memoizedState,o,c)},useTransition:function(){var o=tm(cs)[0],c=Tn().memoizedState;return[typeof o=="boolean"?o:af(o),c]},useSyncExternalStore:WO,useId:NE,useHostTransitionStatus:eb,useFormState:lE,useActionState:lE,useOptimistic:function(o,c){var h=Tn();return tE(h,$t,o,c)},useMemoCache:K0,useCacheRefresh:kE};nb.useEffectEvent=hE;var _E={readContext:lr,use:em,useCallback:vE,useContext:lr,useEffect:Y0,useImperativeHandle:yE,useInsertionEffect:pE,useLayoutEffect:mE,useMemo:xE,useReducer:V0,useRef:dE,useState:function(){return V0(cs)},useDebugValue:Z0,useDeferredValue:function(o,c){var h=Tn();return $t===null?X0(h,o,c):bE(h,$t.memoizedState,o,c)},useTransition:function(){var o=V0(cs)[0],c=Tn().memoizedState;return[typeof o=="boolean"?o:af(o),c]},useSyncExternalStore:WO,useId:NE,useHostTransitionStatus:eb,useFormState:uE,useActionState:uE,useOptimistic:function(o,c){var h=Tn();return $t!==null?tE(h,$t,o,c):(h.baseState=o,[o,h.queue.dispatch])},useMemoCache:K0,useCacheRefresh:kE};_E.useEffectEvent=hE;function rb(o,c,h,y){c=o.memoizedState,h=h(y,c),h=h==null?c:m({},c,h),o.memoizedState=h,o.lanes===0&&(o.updateQueue.baseState=h)}var ib={enqueueSetState:function(o,c,h){o=o._reactInternals;var y=ui(),w=ro(y);w.payload=c,h!=null&&(w.callback=h),c=io(o,w,y),c!==null&&(Gr(c,o,y),ef(c,o,y))},enqueueReplaceState:function(o,c,h){o=o._reactInternals;var y=ui(),w=ro(y);w.tag=1,w.payload=c,h!=null&&(w.callback=h),c=io(o,w,y),c!==null&&(Gr(c,o,y),ef(c,o,y))},enqueueForceUpdate:function(o,c){o=o._reactInternals;var h=ui(),y=ro(h);y.tag=2,c!=null&&(y.callback=c),c=io(o,y,h),c!==null&&(Gr(c,o,h),ef(c,o,h))}};function zE(o,c,h,y,w,N,z){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(y,N,z):c.prototype&&c.prototype.isPureReactComponent?!Gd(h,y)||!Gd(w,N):!0}function TE(o,c,h,y){o=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,y),c.state!==o&&ib.enqueueReplaceState(c,c.state,null)}function bl(o,c){var h=c;if("ref"in c){h={};for(var y in c)y!=="ref"&&(h[y]=c[y])}if(o=o.defaultProps){h===c&&(h=m({},h));for(var w in o)h[w]===void 0&&(h[w]=o[w])}return h}function PE(o){Mp(o)}function RE(o){console.error(o)}function DE(o){Mp(o)}function am(o,c){try{var h=o.onUncaughtError;h(c.value,{componentStack:c.stack})}catch(y){setTimeout(function(){throw y})}}function ME(o,c,h){try{var y=o.onCaughtError;y(h.value,{componentStack:h.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(w){setTimeout(function(){throw w})}}function ab(o,c,h){return h=ro(h),h.tag=3,h.payload={element:null},h.callback=function(){am(o,c)},h}function IE(o){return o=ro(o),o.tag=3,o}function LE(o,c,h,y){var w=h.type.getDerivedStateFromError;if(typeof w=="function"){var N=y.value;o.payload=function(){return w(N)},o.callback=function(){ME(c,h,y)}}var z=h.stateNode;z!==null&&typeof z.componentDidCatch=="function"&&(o.callback=function(){ME(c,h,y),typeof w!="function"&&(uo===null?uo=new Set([this]):uo.add(this));var L=y.stack;this.componentDidCatch(y.value,{componentStack:L!==null?L:""})})}function fH(o,c,h,y,w){if(h.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(c=h.alternate,c!==null&&Uc(c,h,w,!0),h=si.current,h!==null){switch(h.tag){case 31:case 13:return _i===null?ym():h.alternate===null&&Sn===0&&(Sn=3),h.flags&=-257,h.flags|=65536,h.lanes=w,y===Gp?h.flags|=16384:(c=h.updateQueue,c===null?h.updateQueue=new Set([y]):c.add(y),_b(o,y,w)),!1;case 22:return h.flags|=65536,y===Gp?h.flags|=16384:(c=h.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([y])},h.updateQueue=c):(h=c.retryQueue,h===null?c.retryQueue=new Set([y]):h.add(y)),_b(o,y,w)),!1}throw Error(r(435,h.tag))}return _b(o,y,w),ym(),!1}if(wt)return c=si.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=w,y!==N0&&(o=Error(r(422),{cause:y}),Wd(Ci(o,h)))):(y!==N0&&(c=Error(r(423),{cause:y}),Wd(Ci(c,h))),o=o.current.alternate,o.flags|=65536,w&=-w,o.lanes|=w,y=Ci(y,h),w=ab(o.stateNode,y,w),D0(o,w),Sn!==4&&(Sn=2)),!1;var N=Error(r(520),{cause:y});if(N=Ci(N,h),mf===null?mf=[N]:mf.push(N),Sn!==4&&(Sn=2),c===null)return!0;y=Ci(y,h),h=c;do{switch(h.tag){case 3:return h.flags|=65536,o=w&-w,h.lanes|=o,o=ab(h.stateNode,y,o),D0(h,o),!1;case 1:if(c=h.type,N=h.stateNode,(h.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(uo===null||!uo.has(N))))return h.flags|=65536,w&=-w,h.lanes|=w,w=IE(w),LE(w,o,h,y),D0(h,w),!1}h=h.return}while(h!==null);return!1}var sb=Error(r(461)),Ln=!1;function cr(o,c,h,y){c.child=o===null?qO(c,null,h,y):vl(c,o.child,h,y)}function $E(o,c,h,y,w){h=h.render;var N=c.ref;if("ref"in y){var z={};for(var L in y)L!=="ref"&&(z[L]=y[L])}else z=y;return pl(c),y=U0(o,c,h,z,N,w),L=q0(),o!==null&&!Ln?(F0(o,c,w),us(o,c,w)):(wt&&L&&j0(c),c.flags|=1,cr(o,c,y,w),c.child)}function BE(o,c,h,y,w){if(o===null){var N=h.type;return typeof N=="function"&&!x0(N)&&N.defaultProps===void 0&&h.compare===null?(c.tag=15,c.type=N,UE(o,c,N,y,w)):(o=Bp(h.type,null,y,c,c.mode,w),o.ref=c.ref,o.return=c,c.child=o)}if(N=o.child,!pb(o,w)){var z=N.memoizedProps;if(h=h.compare,h=h!==null?h:Gd,h(z,y)&&o.ref===c.ref)return us(o,c,w)}return c.flags|=1,o=is(N,y),o.ref=c.ref,o.return=c,c.child=o}function UE(o,c,h,y,w){if(o!==null){var N=o.memoizedProps;if(Gd(N,y)&&o.ref===c.ref)if(Ln=!1,c.pendingProps=y=N,pb(o,w))(o.flags&131072)!==0&&(Ln=!0);else return c.lanes=o.lanes,us(o,c,w)}return ob(o,c,h,y,w)}function qE(o,c,h,y){var w=y.children,N=o!==null?o.memoizedState:null;if(o===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),y.mode==="hidden"){if((c.flags&128)!==0){if(N=N!==null?N.baseLanes|h:h,o!==null){for(y=c.child=o.child,w=0;y!==null;)w=w|y.lanes|y.childLanes,y=y.sibling;y=w&~N}else y=0,c.child=null;return FE(o,c,N,h,y)}if((h&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},o!==null&&Hp(c,N!==null?N.cachePool:null),N!==null?KO(c,N):I0(),GO(c);else return y=c.lanes=536870912,FE(o,c,N!==null?N.baseLanes|h:h,h,y)}else N!==null?(Hp(c,N.cachePool),KO(c,N),so(),c.memoizedState=null):(o!==null&&Hp(c,null),I0(),so());return cr(o,c,w,h),c.child}function lf(o,c){return o!==null&&o.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function FE(o,c,h,y,w){var N=z0();return N=N===null?null:{parent:Mn._currentValue,pool:N},c.memoizedState={baseLanes:h,cachePool:N},o!==null&&Hp(c,null),I0(),GO(c),o!==null&&Uc(o,c,y,!0),c.childLanes=w,null}function sm(o,c){return c=lm({mode:c.mode,children:c.children},o.mode),c.ref=o.ref,o.child=c,c.return=o,c}function HE(o,c,h){return vl(c,o.child,null,h),o=sm(c,c.pendingProps),o.flags|=2,oi(c),c.memoizedState=null,o}function hH(o,c,h){var y=c.pendingProps,w=(c.flags&128)!==0;if(c.flags&=-129,o===null){if(wt){if(y.mode==="hidden")return o=sm(c,y),c.lanes=536870912,lf(null,o);if($0(c),(o=nn)?(o=nz(o,Ei),o=o!==null&&o.data==="&"?o:null,o!==null&&(c.memoizedState={dehydrated:o,treeContext:Xs!==null?{id:Na,overflow:ka}:null,retryLane:536870912,hydrationErrors:null},h=AO(o),h.return=c,c.child=h,or=c,nn=null)):o=null,o===null)throw eo(c);return c.lanes=536870912,null}return sm(c,y)}var N=o.memoizedState;if(N!==null){var z=N.dehydrated;if($0(c),w)if(c.flags&256)c.flags&=-257,c=HE(o,c,h);else if(c.memoizedState!==null)c.child=o.child,c.flags|=128,c=null;else throw Error(r(558));else if(Ln||Uc(o,c,h,!1),w=(h&o.childLanes)!==0,Ln||w){if(y=Vt,y!==null&&(z=kp(y,h),z!==0&&z!==N.retryLane))throw N.retryLane=z,ul(o,z),Gr(y,o,z),sb;ym(),c=HE(o,c,h)}else o=N.treeContext,nn=zi(z.nextSibling),or=c,wt=!0,Js=null,Ei=!1,o!==null&&_O(c,o),c=sm(c,y),c.flags|=4096;return c}return o=is(o.child,{mode:y.mode,children:y.children}),o.ref=c.ref,c.child=o,o.return=c,o}function om(o,c){var h=c.ref;if(h===null)o!==null&&o.ref!==null&&(c.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(o===null||o.ref!==h)&&(c.flags|=4194816)}}function ob(o,c,h,y,w){return pl(c),h=U0(o,c,h,y,void 0,w),y=q0(),o!==null&&!Ln?(F0(o,c,w),us(o,c,w)):(wt&&y&&j0(c),c.flags|=1,cr(o,c,h,w),c.child)}function KE(o,c,h,y,w,N){return pl(c),c.updateQueue=null,h=QO(c,y,h,w),VO(o),y=q0(),o!==null&&!Ln?(F0(o,c,N),us(o,c,N)):(wt&&y&&j0(c),c.flags|=1,cr(o,c,h,N),c.child)}function GE(o,c,h,y,w){if(pl(c),c.stateNode===null){var N=Ic,z=h.contextType;typeof z=="object"&&z!==null&&(N=lr(z)),N=new h(y,N),c.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=ib,c.stateNode=N,N._reactInternals=c,N=c.stateNode,N.props=y,N.state=c.memoizedState,N.refs={},P0(c),z=h.contextType,N.context=typeof z=="object"&&z!==null?lr(z):Ic,N.state=c.memoizedState,z=h.getDerivedStateFromProps,typeof z=="function"&&(rb(c,h,z,y),N.state=c.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(z=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),z!==N.state&&ib.enqueueReplaceState(N,N.state,null),nf(c,y,N,w),tf(),N.state=c.memoizedState),typeof N.componentDidMount=="function"&&(c.flags|=4194308),y=!0}else if(o===null){N=c.stateNode;var L=c.memoizedProps,K=bl(h,L);N.props=K;var ae=N.context,ge=h.contextType;z=Ic,typeof ge=="object"&&ge!==null&&(z=lr(ge));var we=h.getDerivedStateFromProps;ge=typeof we=="function"||typeof N.getSnapshotBeforeUpdate=="function",L=c.pendingProps!==L,ge||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(L||ae!==z)&&TE(c,N,y,z),no=!1;var le=c.memoizedState;N.state=le,nf(c,y,N,w),tf(),ae=c.memoizedState,L||le!==ae||no?(typeof we=="function"&&(rb(c,h,we,y),ae=c.memoizedState),(K=no||zE(c,h,K,y,le,ae,z))?(ge||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(c.flags|=4194308)):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=ae),N.props=y,N.state=ae,N.context=z,y=K):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{N=c.stateNode,R0(o,c),z=c.memoizedProps,ge=bl(h,z),N.props=ge,we=c.pendingProps,le=N.context,ae=h.contextType,K=Ic,typeof ae=="object"&&ae!==null&&(K=lr(ae)),L=h.getDerivedStateFromProps,(ae=typeof L=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(z!==we||le!==K)&&TE(c,N,y,K),no=!1,le=c.memoizedState,N.state=le,nf(c,y,N,w),tf();var ue=c.memoizedState;z!==we||le!==ue||no||o!==null&&o.dependencies!==null&&qp(o.dependencies)?(typeof L=="function"&&(rb(c,h,L,y),ue=c.memoizedState),(ge=no||zE(c,h,ge,y,le,ue,K)||o!==null&&o.dependencies!==null&&qp(o.dependencies))?(ae||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(y,ue,K),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(y,ue,K)),typeof N.componentDidUpdate=="function"&&(c.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof N.componentDidUpdate!="function"||z===o.memoizedProps&&le===o.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||z===o.memoizedProps&&le===o.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=ue),N.props=y,N.state=ue,N.context=K,y=ge):(typeof N.componentDidUpdate!="function"||z===o.memoizedProps&&le===o.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||z===o.memoizedProps&&le===o.memoizedState||(c.flags|=1024),y=!1)}return N=y,om(o,c),y=(c.flags&128)!==0,N||y?(N=c.stateNode,h=y&&typeof h.getDerivedStateFromError!="function"?null:N.render(),c.flags|=1,o!==null&&y?(c.child=vl(c,o.child,null,w),c.child=vl(c,null,h,w)):cr(o,c,h,w),c.memoizedState=N.state,o=c.child):o=us(o,c,w),o}function VE(o,c,h,y){return fl(),c.flags|=256,cr(o,c,h,y),c.child}var lb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cb(o){return{baseLanes:o,cachePool:MO()}}function ub(o,c,h){return o=o!==null?o.childLanes&~h:0,c&&(o|=ci),o}function QE(o,c,h){var y=c.pendingProps,w=!1,N=(c.flags&128)!==0,z;if((z=N)||(z=o!==null&&o.memoizedState===null?!1:(zn.current&2)!==0),z&&(w=!0,c.flags&=-129),z=(c.flags&32)!==0,c.flags&=-33,o===null){if(wt){if(w?ao(c):so(),(o=nn)?(o=nz(o,Ei),o=o!==null&&o.data!=="&"?o:null,o!==null&&(c.memoizedState={dehydrated:o,treeContext:Xs!==null?{id:Na,overflow:ka}:null,retryLane:536870912,hydrationErrors:null},h=AO(o),h.return=c,c.child=h,or=c,nn=null)):o=null,o===null)throw eo(c);return Gb(o)?c.lanes=32:c.lanes=536870912,null}var L=y.children;return y=y.fallback,w?(so(),w=c.mode,L=lm({mode:"hidden",children:L},w),y=dl(y,w,h,null),L.return=c,y.return=c,L.sibling=y,c.child=L,y=c.child,y.memoizedState=cb(h),y.childLanes=ub(o,z,h),c.memoizedState=lb,lf(null,y)):(ao(c),db(c,L))}var K=o.memoizedState;if(K!==null&&(L=K.dehydrated,L!==null)){if(N)c.flags&256?(ao(c),c.flags&=-257,c=fb(o,c,h)):c.memoizedState!==null?(so(),c.child=o.child,c.flags|=128,c=null):(so(),L=y.fallback,w=c.mode,y=lm({mode:"visible",children:y.children},w),L=dl(L,w,h,null),L.flags|=2,y.return=c,L.return=c,y.sibling=L,c.child=y,vl(c,o.child,null,h),y=c.child,y.memoizedState=cb(h),y.childLanes=ub(o,z,h),c.memoizedState=lb,c=lf(null,y));else if(ao(c),Gb(L)){if(z=L.nextSibling&&L.nextSibling.dataset,z)var ae=z.dgst;z=ae,y=Error(r(419)),y.stack="",y.digest=z,Wd({value:y,source:null,stack:null}),c=fb(o,c,h)}else if(Ln||Uc(o,c,h,!1),z=(h&o.childLanes)!==0,Ln||z){if(z=Vt,z!==null&&(y=kp(z,h),y!==0&&y!==K.retryLane))throw K.retryLane=y,ul(o,y),Gr(z,o,y),sb;Kb(L)||ym(),c=fb(o,c,h)}else Kb(L)?(c.flags|=192,c.child=o.child,c=null):(o=K.treeContext,nn=zi(L.nextSibling),or=c,wt=!0,Js=null,Ei=!1,o!==null&&_O(c,o),c=db(c,y.children),c.flags|=4096);return c}return w?(so(),L=y.fallback,w=c.mode,K=o.child,ae=K.sibling,y=is(K,{mode:"hidden",children:y.children}),y.subtreeFlags=K.subtreeFlags&65011712,ae!==null?L=is(ae,L):(L=dl(L,w,h,null),L.flags|=2),L.return=c,y.return=c,y.sibling=L,c.child=y,lf(null,y),y=c.child,L=o.child.memoizedState,L===null?L=cb(h):(w=L.cachePool,w!==null?(K=Mn._currentValue,w=w.parent!==K?{parent:K,pool:K}:w):w=MO(),L={baseLanes:L.baseLanes|h,cachePool:w}),y.memoizedState=L,y.childLanes=ub(o,z,h),c.memoizedState=lb,lf(o.child,y)):(ao(c),h=o.child,o=h.sibling,h=is(h,{mode:"visible",children:y.children}),h.return=c,h.sibling=null,o!==null&&(z=c.deletions,z===null?(c.deletions=[o],c.flags|=16):z.push(o)),c.child=h,c.memoizedState=null,h)}function db(o,c){return c=lm({mode:"visible",children:c},o.mode),c.return=o,o.child=c}function lm(o,c){return o=ai(22,o,null,c),o.lanes=0,o}function fb(o,c,h){return vl(c,o.child,null,h),o=db(c,c.pendingProps.children),o.flags|=2,c.memoizedState=null,o}function WE(o,c,h){o.lanes|=c;var y=o.alternate;y!==null&&(y.lanes|=c),A0(o.return,c,h)}function hb(o,c,h,y,w,N){var z=o.memoizedState;z===null?o.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:h,tailMode:w,treeForkCount:N}:(z.isBackwards=c,z.rendering=null,z.renderingStartTime=0,z.last=y,z.tail=h,z.tailMode=w,z.treeForkCount=N)}function YE(o,c,h){var y=c.pendingProps,w=y.revealOrder,N=y.tail;y=y.children;var z=zn.current,L=(z&2)!==0;if(L?(z=z&1|2,c.flags|=128):z&=1,D(zn,z),cr(o,c,y,h),y=wt?Qd:0,!L&&o!==null&&(o.flags&128)!==0)e:for(o=c.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&WE(o,h,c);else if(o.tag===19)WE(o,h,c);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===c)break e;for(;o.sibling===null;){if(o.return===null||o.return===c)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(w){case"forwards":for(h=c.child,w=null;h!==null;)o=h.alternate,o!==null&&Yp(o)===null&&(w=h),h=h.sibling;h=w,h===null?(w=c.child,c.child=null):(w=h.sibling,h.sibling=null),hb(c,!1,w,h,N,y);break;case"backwards":case"unstable_legacy-backwards":for(h=null,w=c.child,c.child=null;w!==null;){if(o=w.alternate,o!==null&&Yp(o)===null){c.child=w;break}o=w.sibling,w.sibling=h,h=w,w=o}hb(c,!0,h,null,N,y);break;case"together":hb(c,!1,null,null,void 0,y);break;default:c.memoizedState=null}return c.child}function us(o,c,h){if(o!==null&&(c.dependencies=o.dependencies),co|=c.lanes,(h&c.childLanes)===0)if(o!==null){if(Uc(o,c,h,!1),(h&c.childLanes)===0)return null}else return null;if(o!==null&&c.child!==o.child)throw Error(r(153));if(c.child!==null){for(o=c.child,h=is(o,o.pendingProps),c.child=h,h.return=c;o.sibling!==null;)o=o.sibling,h=h.sibling=is(o,o.pendingProps),h.return=c;h.sibling=null}return c.child}function pb(o,c){return(o.lanes&c)!==0?!0:(o=o.dependencies,!!(o!==null&&qp(o)))}function pH(o,c,h){switch(c.tag){case 3:Se(c,c.stateNode.containerInfo),to(c,Mn,o.memoizedState.cache),fl();break;case 27:case 5:pe(c);break;case 4:Se(c,c.stateNode.containerInfo);break;case 10:to(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,$0(c),null;break;case 13:var y=c.memoizedState;if(y!==null)return y.dehydrated!==null?(ao(c),c.flags|=128,null):(h&c.child.childLanes)!==0?QE(o,c,h):(ao(c),o=us(o,c,h),o!==null?o.sibling:null);ao(c);break;case 19:var w=(o.flags&128)!==0;if(y=(h&c.childLanes)!==0,y||(Uc(o,c,h,!1),y=(h&c.childLanes)!==0),w){if(y)return YE(o,c,h);c.flags|=128}if(w=c.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),D(zn,zn.current),y)break;return null;case 22:return c.lanes=0,qE(o,c,h,c.pendingProps);case 24:to(c,Mn,o.memoizedState.cache)}return us(o,c,h)}function ZE(o,c,h){if(o!==null)if(o.memoizedProps!==c.pendingProps)Ln=!0;else{if(!pb(o,h)&&(c.flags&128)===0)return Ln=!1,pH(o,c,h);Ln=(o.flags&131072)!==0}else Ln=!1,wt&&(c.flags&1048576)!==0&&EO(c,Qd,c.index);switch(c.lanes=0,c.tag){case 16:e:{var y=c.pendingProps;if(o=gl(c.elementType),c.type=o,typeof o=="function")x0(o)?(y=bl(o,y),c.tag=1,c=GE(null,c,o,y,h)):(c.tag=0,c=ob(null,c,o,y,h));else{if(o!=null){var w=o.$$typeof;if(w===A){c.tag=11,c=$E(null,c,o,y,h);break e}else if(w===_){c.tag=14,c=BE(null,c,o,y,h);break e}}throw c=X(o)||o,Error(r(306,c,""))}}return c;case 0:return ob(o,c,c.type,c.pendingProps,h);case 1:return y=c.type,w=bl(y,c.pendingProps),GE(o,c,y,w,h);case 3:e:{if(Se(c,c.stateNode.containerInfo),o===null)throw Error(r(387));y=c.pendingProps;var N=c.memoizedState;w=N.element,R0(o,c),nf(c,y,null,h);var z=c.memoizedState;if(y=z.cache,to(c,Mn,y),y!==N.cache&&O0(c,[Mn],h,!0),tf(),y=z.element,N.isDehydrated)if(N={element:y,isDehydrated:!1,cache:z.cache},c.updateQueue.baseState=N,c.memoizedState=N,c.flags&256){c=VE(o,c,y,h);break e}else if(y!==w){w=Ci(Error(r(424)),c),Wd(w),c=VE(o,c,y,h);break e}else for(o=c.stateNode.containerInfo,o.nodeType===9?o=o.body:o=o.nodeName==="HTML"?o.ownerDocument.body:o,nn=zi(o.firstChild),or=c,wt=!0,Js=null,Ei=!0,h=qO(c,null,y,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(fl(),y===w){c=us(o,c,h);break e}cr(o,c,y,h)}c=c.child}return c;case 26:return om(o,c),o===null?(h=lz(c.type,null,c.pendingProps,null))?c.memoizedState=h:wt||(h=c.type,o=c.pendingProps,y=Nm(ne.current).createElement(h),y[nt]=c,y[St]=o,ur(y,h,o),yn(y),c.stateNode=y):c.memoizedState=lz(c.type,o.memoizedProps,c.pendingProps,o.memoizedState),null;case 27:return pe(c),o===null&&wt&&(y=c.stateNode=az(c.type,c.pendingProps,ne.current),or=c,Ei=!0,w=nn,mo(c.type)?(Vb=w,nn=zi(y.firstChild)):nn=w),cr(o,c,c.pendingProps.children,h),om(o,c),o===null&&(c.flags|=4194304),c.child;case 5:return o===null&&wt&&((w=y=nn)&&(y=HH(y,c.type,c.pendingProps,Ei),y!==null?(c.stateNode=y,or=c,nn=zi(y.firstChild),Ei=!1,w=!0):w=!1),w||eo(c)),pe(c),w=c.type,N=c.pendingProps,z=o!==null?o.memoizedProps:null,y=N.children,qb(w,N)?y=null:z!==null&&qb(w,z)&&(c.flags|=32),c.memoizedState!==null&&(w=U0(o,c,aH,null,null,h),Sf._currentValue=w),om(o,c),cr(o,c,y,h),c.child;case 6:return o===null&&wt&&((o=h=nn)&&(h=KH(h,c.pendingProps,Ei),h!==null?(c.stateNode=h,or=c,nn=null,o=!0):o=!1),o||eo(c)),null;case 13:return QE(o,c,h);case 4:return Se(c,c.stateNode.containerInfo),y=c.pendingProps,o===null?c.child=vl(c,null,y,h):cr(o,c,y,h),c.child;case 11:return $E(o,c,c.type,c.pendingProps,h);case 7:return cr(o,c,c.pendingProps,h),c.child;case 8:return cr(o,c,c.pendingProps.children,h),c.child;case 12:return cr(o,c,c.pendingProps.children,h),c.child;case 10:return y=c.pendingProps,to(c,c.type,y.value),cr(o,c,y.children,h),c.child;case 9:return w=c.type._context,y=c.pendingProps.children,pl(c),w=lr(w),y=y(w),c.flags|=1,cr(o,c,y,h),c.child;case 14:return BE(o,c,c.type,c.pendingProps,h);case 15:return UE(o,c,c.type,c.pendingProps,h);case 19:return YE(o,c,h);case 31:return hH(o,c,h);case 22:return qE(o,c,h,c.pendingProps);case 24:return pl(c),y=lr(Mn),o===null?(w=z0(),w===null&&(w=Vt,N=E0(),w.pooledCache=N,N.refCount++,N!==null&&(w.pooledCacheLanes|=h),w=N),c.memoizedState={parent:y,cache:w},P0(c),to(c,Mn,w)):((o.lanes&h)!==0&&(R0(o,c),nf(c,null,null,h),tf()),w=o.memoizedState,N=c.memoizedState,w.parent!==y?(w={parent:y,cache:y},c.memoizedState=w,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=w),to(c,Mn,y)):(y=N.cache,to(c,Mn,y),y!==w.cache&&O0(c,[Mn],h,!0))),cr(o,c,c.pendingProps.children,h),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function ds(o){o.flags|=4}function mb(o,c,h,y,w){if((c=(o.mode&32)!==0)&&(c=!1),c){if(o.flags|=16777216,(w&335544128)===w)if(o.stateNode.complete)o.flags|=8192;else if(N_())o.flags|=8192;else throw yl=Gp,T0}else o.flags&=-16777217}function XE(o,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!hz(c))if(N_())o.flags|=8192;else throw yl=Gp,T0}function cm(o,c){c!==null&&(o.flags|=4),o.flags&16384&&(c=o.tag!==22?Sp():536870912,o.lanes|=c,Jc|=c)}function cf(o,c){if(!wt)switch(o.tailMode){case"hidden":c=o.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?o.tail=null:h.sibling=null;break;case"collapsed":h=o.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?c||o.tail===null?o.tail=null:o.tail.sibling=null:y.sibling=null}}function rn(o){var c=o.alternate!==null&&o.alternate.child===o.child,h=0,y=0;if(c)for(var w=o.child;w!==null;)h|=w.lanes|w.childLanes,y|=w.subtreeFlags&65011712,y|=w.flags&65011712,w.return=o,w=w.sibling;else for(w=o.child;w!==null;)h|=w.lanes|w.childLanes,y|=w.subtreeFlags,y|=w.flags,w.return=o,w=w.sibling;return o.subtreeFlags|=y,o.childLanes=h,c}function mH(o,c,h){var y=c.pendingProps;switch(S0(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rn(c),null;case 1:return rn(c),null;case 3:return h=c.stateNode,y=null,o!==null&&(y=o.memoizedState.cache),c.memoizedState.cache!==y&&(c.flags|=2048),os(Mn),ee(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(Bc(c)?ds(c):o===null||o.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,k0())),rn(c),null;case 26:var w=c.type,N=c.memoizedState;return o===null?(ds(c),N!==null?(rn(c),XE(c,N)):(rn(c),mb(c,w,null,y,h))):N?N!==o.memoizedState?(ds(c),rn(c),XE(c,N)):(rn(c),c.flags&=-16777217):(o=o.memoizedProps,o!==y&&ds(c),rn(c),mb(c,w,o,y,h)),null;case 27:if(Ee(c),h=ne.current,w=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==y&&ds(c);else{if(!y){if(c.stateNode===null)throw Error(r(166));return rn(c),null}o=G.current,Bc(c)?zO(c):(o=az(w,y,h),c.stateNode=o,ds(c))}return rn(c),null;case 5:if(Ee(c),w=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==y&&ds(c);else{if(!y){if(c.stateNode===null)throw Error(r(166));return rn(c),null}if(N=G.current,Bc(c))zO(c);else{var z=Nm(ne.current);switch(N){case 1:N=z.createElementNS("http://www.w3.org/2000/svg",w);break;case 2:N=z.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;default:switch(w){case"svg":N=z.createElementNS("http://www.w3.org/2000/svg",w);break;case"math":N=z.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;case"script":N=z.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof y.is=="string"?z.createElement("select",{is:y.is}):z.createElement("select"),y.multiple?N.multiple=!0:y.size&&(N.size=y.size);break;default:N=typeof y.is=="string"?z.createElement(w,{is:y.is}):z.createElement(w)}}N[nt]=c,N[St]=y;e:for(z=c.child;z!==null;){if(z.tag===5||z.tag===6)N.appendChild(z.stateNode);else if(z.tag!==4&&z.tag!==27&&z.child!==null){z.child.return=z,z=z.child;continue}if(z===c)break e;for(;z.sibling===null;){if(z.return===null||z.return===c)break e;z=z.return}z.sibling.return=z.return,z=z.sibling}c.stateNode=N;e:switch(ur(N,w,y),w){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&ds(c)}}return rn(c),mb(c,c.type,o===null?null:o.memoizedProps,c.pendingProps,h),null;case 6:if(o&&c.stateNode!=null)o.memoizedProps!==y&&ds(c);else{if(typeof y!="string"&&c.stateNode===null)throw Error(r(166));if(o=ne.current,Bc(c)){if(o=c.stateNode,h=c.memoizedProps,y=null,w=or,w!==null)switch(w.tag){case 27:case 5:y=w.memoizedProps}o[nt]=c,o=!!(o.nodeValue===h||y!==null&&y.suppressHydrationWarning===!0||Q_(o.nodeValue,h)),o||eo(c,!0)}else o=Nm(o).createTextNode(y),o[nt]=c,c.stateNode=o}return rn(c),null;case 31:if(h=c.memoizedState,o===null||o.memoizedState!==null){if(y=Bc(c),h!==null){if(o===null){if(!y)throw Error(r(318));if(o=c.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[nt]=c}else fl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;rn(c),o=!1}else h=k0(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=h),o=!0;if(!o)return c.flags&256?(oi(c),c):(oi(c),null);if((c.flags&128)!==0)throw Error(r(558))}return rn(c),null;case 13:if(y=c.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(w=Bc(c),y!==null&&y.dehydrated!==null){if(o===null){if(!w)throw Error(r(318));if(w=c.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(r(317));w[nt]=c}else fl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;rn(c),w=!1}else w=k0(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=w),w=!0;if(!w)return c.flags&256?(oi(c),c):(oi(c),null)}return oi(c),(c.flags&128)!==0?(c.lanes=h,c):(h=y!==null,o=o!==null&&o.memoizedState!==null,h&&(y=c.child,w=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(w=y.alternate.memoizedState.cachePool.pool),N=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(N=y.memoizedState.cachePool.pool),N!==w&&(y.flags|=2048)),h!==o&&h&&(c.child.flags|=8192),cm(c,c.updateQueue),rn(c),null);case 4:return ee(),o===null&&Ib(c.stateNode.containerInfo),rn(c),null;case 10:return os(c.type),rn(c),null;case 19:if(q(zn),y=c.memoizedState,y===null)return rn(c),null;if(w=(c.flags&128)!==0,N=y.rendering,N===null)if(w)cf(y,!1);else{if(Sn!==0||o!==null&&(o.flags&128)!==0)for(o=c.child;o!==null;){if(N=Yp(o),N!==null){for(c.flags|=128,cf(y,!1),o=N.updateQueue,c.updateQueue=o,cm(c,o),c.subtreeFlags=0,o=h,h=c.child;h!==null;)CO(h,o),h=h.sibling;return D(zn,zn.current&1|2),wt&&as(c,y.treeForkCount),c.child}o=o.sibling}y.tail!==null&&mt()>pm&&(c.flags|=128,w=!0,cf(y,!1),c.lanes=4194304)}else{if(!w)if(o=Yp(N),o!==null){if(c.flags|=128,w=!0,o=o.updateQueue,c.updateQueue=o,cm(c,o),cf(y,!0),y.tail===null&&y.tailMode==="hidden"&&!N.alternate&&!wt)return rn(c),null}else 2*mt()-y.renderingStartTime>pm&&h!==536870912&&(c.flags|=128,w=!0,cf(y,!1),c.lanes=4194304);y.isBackwards?(N.sibling=c.child,c.child=N):(o=y.last,o!==null?o.sibling=N:c.child=N,y.last=N)}return y.tail!==null?(o=y.tail,y.rendering=o,y.tail=o.sibling,y.renderingStartTime=mt(),o.sibling=null,h=zn.current,D(zn,w?h&1|2:h&1),wt&&as(c,y.treeForkCount),o):(rn(c),null);case 22:case 23:return oi(c),L0(),y=c.memoizedState!==null,o!==null?o.memoizedState!==null!==y&&(c.flags|=8192):y&&(c.flags|=8192),y?(h&536870912)!==0&&(c.flags&128)===0&&(rn(c),c.subtreeFlags&6&&(c.flags|=8192)):rn(c),h=c.updateQueue,h!==null&&cm(c,h.retryQueue),h=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==h&&(c.flags|=2048),o!==null&&q(ml),null;case 24:return h=null,o!==null&&(h=o.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),os(Mn),rn(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function gH(o,c){switch(S0(c),c.tag){case 1:return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 3:return os(Mn),ee(),o=c.flags,(o&65536)!==0&&(o&128)===0?(c.flags=o&-65537|128,c):null;case 26:case 27:case 5:return Ee(c),null;case 31:if(c.memoizedState!==null){if(oi(c),c.alternate===null)throw Error(r(340));fl()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 13:if(oi(c),o=c.memoizedState,o!==null&&o.dehydrated!==null){if(c.alternate===null)throw Error(r(340));fl()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 19:return q(zn),null;case 4:return ee(),null;case 10:return os(c.type),null;case 22:case 23:return oi(c),L0(),o!==null&&q(ml),o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 24:return os(Mn),null;case 25:return null;default:return null}}function JE(o,c){switch(S0(c),c.tag){case 3:os(Mn),ee();break;case 26:case 27:case 5:Ee(c);break;case 4:ee();break;case 31:c.memoizedState!==null&&oi(c);break;case 13:oi(c);break;case 19:q(zn);break;case 10:os(c.type);break;case 22:case 23:oi(c),L0(),o!==null&&q(ml);break;case 24:os(Mn)}}function uf(o,c){try{var h=c.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var w=y.next;h=w;do{if((h.tag&o)===o){y=void 0;var N=h.create,z=h.inst;y=N(),z.destroy=y}h=h.next}while(h!==w)}}catch(L){It(c,c.return,L)}}function oo(o,c,h){try{var y=c.updateQueue,w=y!==null?y.lastEffect:null;if(w!==null){var N=w.next;y=N;do{if((y.tag&o)===o){var z=y.inst,L=z.destroy;if(L!==void 0){z.destroy=void 0,w=c;var K=h,ae=L;try{ae()}catch(ge){It(w,K,ge)}}}y=y.next}while(y!==N)}}catch(ge){It(c,c.return,ge)}}function e_(o){var c=o.updateQueue;if(c!==null){var h=o.stateNode;try{HO(c,h)}catch(y){It(o,o.return,y)}}}function t_(o,c,h){h.props=bl(o.type,o.memoizedProps),h.state=o.memoizedState;try{h.componentWillUnmount()}catch(y){It(o,c,y)}}function df(o,c){try{var h=o.ref;if(h!==null){switch(o.tag){case 26:case 27:case 5:var y=o.stateNode;break;case 30:y=o.stateNode;break;default:y=o.stateNode}typeof h=="function"?o.refCleanup=h(y):h.current=y}}catch(w){It(o,c,w)}}function Ca(o,c){var h=o.ref,y=o.refCleanup;if(h!==null)if(typeof y=="function")try{y()}catch(w){It(o,c,w)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(w){It(o,c,w)}else h.current=null}function n_(o){var c=o.type,h=o.memoizedProps,y=o.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":h.autoFocus&&y.focus();break e;case"img":h.src?y.src=h.src:h.srcSet&&(y.srcset=h.srcSet)}}catch(w){It(o,o.return,w)}}function gb(o,c,h){try{var y=o.stateNode;LH(y,o.type,h,c),y[St]=c}catch(w){It(o,o.return,w)}}function r_(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&mo(o.type)||o.tag===4}function yb(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||r_(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&mo(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function vb(o,c,h){var y=o.tag;if(y===5||y===6)o=o.stateNode,c?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(o,c):(c=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,c.appendChild(o),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=ns));else if(y!==4&&(y===27&&mo(o.type)&&(h=o.stateNode,c=null),o=o.child,o!==null))for(vb(o,c,h),o=o.sibling;o!==null;)vb(o,c,h),o=o.sibling}function um(o,c,h){var y=o.tag;if(y===5||y===6)o=o.stateNode,c?h.insertBefore(o,c):h.appendChild(o);else if(y!==4&&(y===27&&mo(o.type)&&(h=o.stateNode),o=o.child,o!==null))for(um(o,c,h),o=o.sibling;o!==null;)um(o,c,h),o=o.sibling}function i_(o){var c=o.stateNode,h=o.memoizedProps;try{for(var y=o.type,w=c.attributes;w.length;)c.removeAttributeNode(w[0]);ur(c,y,h),c[nt]=o,c[St]=h}catch(N){It(o,o.return,N)}}var fs=!1,$n=!1,xb=!1,a_=typeof WeakSet=="function"?WeakSet:Set,Xn=null;function yH(o,c){if(o=o.containerInfo,Bb=zm,o=yO(o),f0(o)){if("selectionStart"in o)var h={start:o.selectionStart,end:o.selectionEnd};else e:{h=(h=o.ownerDocument)&&h.defaultView||window;var y=h.getSelection&&h.getSelection();if(y&&y.rangeCount!==0){h=y.anchorNode;var w=y.anchorOffset,N=y.focusNode;y=y.focusOffset;try{h.nodeType,N.nodeType}catch{h=null;break e}var z=0,L=-1,K=-1,ae=0,ge=0,we=o,le=null;t:for(;;){for(var ue;we!==h||w!==0&&we.nodeType!==3||(L=z+w),we!==N||y!==0&&we.nodeType!==3||(K=z+y),we.nodeType===3&&(z+=we.nodeValue.length),(ue=we.firstChild)!==null;)le=we,we=ue;for(;;){if(we===o)break t;if(le===h&&++ae===w&&(L=z),le===N&&++ge===y&&(K=z),(ue=we.nextSibling)!==null)break;we=le,le=we.parentNode}we=ue}h=L===-1||K===-1?null:{start:L,end:K}}else h=null}h=h||{start:0,end:0}}else h=null;for(Ub={focusedElem:o,selectionRange:h},zm=!1,Xn=c;Xn!==null;)if(c=Xn,o=c.child,(c.subtreeFlags&1028)!==0&&o!==null)o.return=c,Xn=o;else for(;Xn!==null;){switch(c=Xn,N=c.alternate,o=c.flags,c.tag){case 0:if((o&4)!==0&&(o=c.updateQueue,o=o!==null?o.events:null,o!==null))for(h=0;h<o.length;h++)w=o[h],w.ref.impl=w.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&N!==null){o=void 0,h=c,w=N.memoizedProps,N=N.memoizedState,y=h.stateNode;try{var De=bl(h.type,w);o=y.getSnapshotBeforeUpdate(De,N),y.__reactInternalSnapshotBeforeUpdate=o}catch(Ye){It(h,h.return,Ye)}}break;case 3:if((o&1024)!==0){if(o=c.stateNode.containerInfo,h=o.nodeType,h===9)Hb(o);else if(h===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":Hb(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=c.sibling,o!==null){o.return=c.return,Xn=o;break}Xn=c.return}}function s_(o,c,h){var y=h.flags;switch(h.tag){case 0:case 11:case 15:ps(o,h),y&4&&uf(5,h);break;case 1:if(ps(o,h),y&4)if(o=h.stateNode,c===null)try{o.componentDidMount()}catch(z){It(h,h.return,z)}else{var w=bl(h.type,c.memoizedProps);c=c.memoizedState;try{o.componentDidUpdate(w,c,o.__reactInternalSnapshotBeforeUpdate)}catch(z){It(h,h.return,z)}}y&64&&e_(h),y&512&&df(h,h.return);break;case 3:if(ps(o,h),y&64&&(o=h.updateQueue,o!==null)){if(c=null,h.child!==null)switch(h.child.tag){case 27:case 5:c=h.child.stateNode;break;case 1:c=h.child.stateNode}try{HO(o,c)}catch(z){It(h,h.return,z)}}break;case 27:c===null&&y&4&&i_(h);case 26:case 5:ps(o,h),c===null&&y&4&&n_(h),y&512&&df(h,h.return);break;case 12:ps(o,h);break;case 31:ps(o,h),y&4&&c_(o,h);break;case 13:ps(o,h),y&4&&u_(o,h),y&64&&(o=h.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(h=CH.bind(null,h),GH(o,h))));break;case 22:if(y=h.memoizedState!==null||fs,!y){c=c!==null&&c.memoizedState!==null||$n,w=fs;var N=$n;fs=y,($n=c)&&!N?ms(o,h,(h.subtreeFlags&8772)!==0):ps(o,h),fs=w,$n=N}break;case 30:break;default:ps(o,h)}}function o_(o){var c=o.alternate;c!==null&&(o.alternate=null,o_(c)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(c=o.stateNode,c!==null&&Sa(c)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var un=null,qr=!1;function hs(o,c,h){for(h=h.child;h!==null;)l_(o,c,h),h=h.sibling}function l_(o,c,h){if(We&&typeof We.onCommitFiberUnmount=="function")try{We.onCommitFiberUnmount(gn,h)}catch{}switch(h.tag){case 26:$n||Ca(h,c),hs(o,c,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:$n||Ca(h,c);var y=un,w=qr;mo(h.type)&&(un=h.stateNode,qr=!1),hs(o,c,h),bf(h.stateNode),un=y,qr=w;break;case 5:$n||Ca(h,c);case 6:if(y=un,w=qr,un=null,hs(o,c,h),un=y,qr=w,un!==null)if(qr)try{(un.nodeType===9?un.body:un.nodeName==="HTML"?un.ownerDocument.body:un).removeChild(h.stateNode)}catch(N){It(h,c,N)}else try{un.removeChild(h.stateNode)}catch(N){It(h,c,N)}break;case 18:un!==null&&(qr?(o=un,ez(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,h.stateNode),ou(o)):ez(un,h.stateNode));break;case 4:y=un,w=qr,un=h.stateNode.containerInfo,qr=!0,hs(o,c,h),un=y,qr=w;break;case 0:case 11:case 14:case 15:oo(2,h,c),$n||oo(4,h,c),hs(o,c,h);break;case 1:$n||(Ca(h,c),y=h.stateNode,typeof y.componentWillUnmount=="function"&&t_(h,c,y)),hs(o,c,h);break;case 21:hs(o,c,h);break;case 22:$n=(y=$n)||h.memoizedState!==null,hs(o,c,h),$n=y;break;default:hs(o,c,h)}}function c_(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{ou(o)}catch(h){It(c,c.return,h)}}}function u_(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{ou(o)}catch(h){It(c,c.return,h)}}function vH(o){switch(o.tag){case 31:case 13:case 19:var c=o.stateNode;return c===null&&(c=o.stateNode=new a_),c;case 22:return o=o.stateNode,c=o._retryCache,c===null&&(c=o._retryCache=new a_),c;default:throw Error(r(435,o.tag))}}function dm(o,c){var h=vH(o);c.forEach(function(y){if(!h.has(y)){h.add(y);var w=AH.bind(null,o,y);y.then(w,w)}})}function Fr(o,c){var h=c.deletions;if(h!==null)for(var y=0;y<h.length;y++){var w=h[y],N=o,z=c,L=z;e:for(;L!==null;){switch(L.tag){case 27:if(mo(L.type)){un=L.stateNode,qr=!1;break e}break;case 5:un=L.stateNode,qr=!1;break e;case 3:case 4:un=L.stateNode.containerInfo,qr=!0;break e}L=L.return}if(un===null)throw Error(r(160));l_(N,z,w),un=null,qr=!1,N=w.alternate,N!==null&&(N.return=null),w.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)d_(c,o),c=c.sibling}var na=null;function d_(o,c){var h=o.alternate,y=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:Fr(c,o),Hr(o),y&4&&(oo(3,o,o.return),uf(3,o),oo(5,o,o.return));break;case 1:Fr(c,o),Hr(o),y&512&&($n||h===null||Ca(h,h.return)),y&64&&fs&&(o=o.updateQueue,o!==null&&(y=o.callbacks,y!==null&&(h=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=h===null?y:h.concat(y))));break;case 26:var w=na;if(Fr(c,o),Hr(o),y&512&&($n||h===null||Ca(h,h.return)),y&4){var N=h!==null?h.memoizedState:null;if(y=o.memoizedState,h===null)if(y===null)if(o.stateNode===null){e:{y=o.type,h=o.memoizedProps,w=w.ownerDocument||w;t:switch(y){case"title":N=w.getElementsByTagName("title")[0],(!N||N[il]||N[nt]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=w.createElement(y),w.head.insertBefore(N,w.querySelector("head > title"))),ur(N,y,h),N[nt]=o,yn(N),y=N;break e;case"link":var z=dz("link","href",w).get(y+(h.href||""));if(z){for(var L=0;L<z.length;L++)if(N=z[L],N.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&N.getAttribute("rel")===(h.rel==null?null:h.rel)&&N.getAttribute("title")===(h.title==null?null:h.title)&&N.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){z.splice(L,1);break t}}N=w.createElement(y),ur(N,y,h),w.head.appendChild(N);break;case"meta":if(z=dz("meta","content",w).get(y+(h.content||""))){for(L=0;L<z.length;L++)if(N=z[L],N.getAttribute("content")===(h.content==null?null:""+h.content)&&N.getAttribute("name")===(h.name==null?null:h.name)&&N.getAttribute("property")===(h.property==null?null:h.property)&&N.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&N.getAttribute("charset")===(h.charSet==null?null:h.charSet)){z.splice(L,1);break t}}N=w.createElement(y),ur(N,y,h),w.head.appendChild(N);break;default:throw Error(r(468,y))}N[nt]=o,yn(N),y=N}o.stateNode=y}else fz(w,o.type,o.stateNode);else o.stateNode=uz(w,y,o.memoizedProps);else N!==y?(N===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):N.count--,y===null?fz(w,o.type,o.stateNode):uz(w,y,o.memoizedProps)):y===null&&o.stateNode!==null&&gb(o,o.memoizedProps,h.memoizedProps)}break;case 27:Fr(c,o),Hr(o),y&512&&($n||h===null||Ca(h,h.return)),h!==null&&y&4&&gb(o,o.memoizedProps,h.memoizedProps);break;case 5:if(Fr(c,o),Hr(o),y&512&&($n||h===null||Ca(h,h.return)),o.flags&32){w=o.stateNode;try{_c(w,"")}catch(De){It(o,o.return,De)}}y&4&&o.stateNode!=null&&(w=o.memoizedProps,gb(o,w,h!==null?h.memoizedProps:w)),y&1024&&(xb=!0);break;case 6:if(Fr(c,o),Hr(o),y&4){if(o.stateNode===null)throw Error(r(162));y=o.memoizedProps,h=o.stateNode;try{h.nodeValue=y}catch(De){It(o,o.return,De)}}break;case 3:if(Am=null,w=na,na=km(c.containerInfo),Fr(c,o),na=w,Hr(o),y&4&&h!==null&&h.memoizedState.isDehydrated)try{ou(c.containerInfo)}catch(De){It(o,o.return,De)}xb&&(xb=!1,f_(o));break;case 4:y=na,na=km(o.stateNode.containerInfo),Fr(c,o),Hr(o),na=y;break;case 12:Fr(c,o),Hr(o);break;case 31:Fr(c,o),Hr(o),y&4&&(y=o.updateQueue,y!==null&&(o.updateQueue=null,dm(o,y)));break;case 13:Fr(c,o),Hr(o),o.child.flags&8192&&o.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(hm=mt()),y&4&&(y=o.updateQueue,y!==null&&(o.updateQueue=null,dm(o,y)));break;case 22:w=o.memoizedState!==null;var K=h!==null&&h.memoizedState!==null,ae=fs,ge=$n;if(fs=ae||w,$n=ge||K,Fr(c,o),$n=ge,fs=ae,Hr(o),y&8192)e:for(c=o.stateNode,c._visibility=w?c._visibility&-2:c._visibility|1,w&&(h===null||K||fs||$n||wl(o)),h=null,c=o;;){if(c.tag===5||c.tag===26){if(h===null){K=h=c;try{if(N=K.stateNode,w)z=N.style,typeof z.setProperty=="function"?z.setProperty("display","none","important"):z.display="none";else{L=K.stateNode;var we=K.memoizedProps.style,le=we!=null&&we.hasOwnProperty("display")?we.display:null;L.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch(De){It(K,K.return,De)}}}else if(c.tag===6){if(h===null){K=c;try{K.stateNode.nodeValue=w?"":K.memoizedProps}catch(De){It(K,K.return,De)}}}else if(c.tag===18){if(h===null){K=c;try{var ue=K.stateNode;w?tz(ue,!0):tz(K.stateNode,!1)}catch(De){It(K,K.return,De)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===o)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break e;for(;c.sibling===null;){if(c.return===null||c.return===o)break e;h===c&&(h=null),c=c.return}h===c&&(h=null),c.sibling.return=c.return,c=c.sibling}y&4&&(y=o.updateQueue,y!==null&&(h=y.retryQueue,h!==null&&(y.retryQueue=null,dm(o,h))));break;case 19:Fr(c,o),Hr(o),y&4&&(y=o.updateQueue,y!==null&&(o.updateQueue=null,dm(o,y)));break;case 30:break;case 21:break;default:Fr(c,o),Hr(o)}}function Hr(o){var c=o.flags;if(c&2){try{for(var h,y=o.return;y!==null;){if(r_(y)){h=y;break}y=y.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var w=h.stateNode,N=yb(o);um(o,N,w);break;case 5:var z=h.stateNode;h.flags&32&&(_c(z,""),h.flags&=-33);var L=yb(o);um(o,L,z);break;case 3:case 4:var K=h.stateNode.containerInfo,ae=yb(o);vb(o,ae,K);break;default:throw Error(r(161))}}catch(ge){It(o,o.return,ge)}o.flags&=-3}c&4096&&(o.flags&=-4097)}function f_(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var c=o;f_(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),o=o.sibling}}function ps(o,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)s_(o,c.alternate,c),c=c.sibling}function wl(o){for(o=o.child;o!==null;){var c=o;switch(c.tag){case 0:case 11:case 14:case 15:oo(4,c,c.return),wl(c);break;case 1:Ca(c,c.return);var h=c.stateNode;typeof h.componentWillUnmount=="function"&&t_(c,c.return,h),wl(c);break;case 27:bf(c.stateNode);case 26:case 5:Ca(c,c.return),wl(c);break;case 22:c.memoizedState===null&&wl(c);break;case 30:wl(c);break;default:wl(c)}o=o.sibling}}function ms(o,c,h){for(h=h&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var y=c.alternate,w=o,N=c,z=N.flags;switch(N.tag){case 0:case 11:case 15:ms(w,N,h),uf(4,N);break;case 1:if(ms(w,N,h),y=N,w=y.stateNode,typeof w.componentDidMount=="function")try{w.componentDidMount()}catch(ae){It(y,y.return,ae)}if(y=N,w=y.updateQueue,w!==null){var L=y.stateNode;try{var K=w.shared.hiddenCallbacks;if(K!==null)for(w.shared.hiddenCallbacks=null,w=0;w<K.length;w++)FO(K[w],L)}catch(ae){It(y,y.return,ae)}}h&&z&64&&e_(N),df(N,N.return);break;case 27:i_(N);case 26:case 5:ms(w,N,h),h&&y===null&&z&4&&n_(N),df(N,N.return);break;case 12:ms(w,N,h);break;case 31:ms(w,N,h),h&&z&4&&c_(w,N);break;case 13:ms(w,N,h),h&&z&4&&u_(w,N);break;case 22:N.memoizedState===null&&ms(w,N,h),df(N,N.return);break;case 30:break;default:ms(w,N,h)}c=c.sibling}}function bb(o,c){var h=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),o=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(o=c.memoizedState.cachePool.pool),o!==h&&(o!=null&&o.refCount++,h!=null&&Yd(h))}function wb(o,c){o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&Yd(o))}function ra(o,c,h,y){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)h_(o,c,h,y),c=c.sibling}function h_(o,c,h,y){var w=c.flags;switch(c.tag){case 0:case 11:case 15:ra(o,c,h,y),w&2048&&uf(9,c);break;case 1:ra(o,c,h,y);break;case 3:ra(o,c,h,y),w&2048&&(o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&Yd(o)));break;case 12:if(w&2048){ra(o,c,h,y),o=c.stateNode;try{var N=c.memoizedProps,z=N.id,L=N.onPostCommit;typeof L=="function"&&L(z,c.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(K){It(c,c.return,K)}}else ra(o,c,h,y);break;case 31:ra(o,c,h,y);break;case 13:ra(o,c,h,y);break;case 23:break;case 22:N=c.stateNode,z=c.alternate,c.memoizedState!==null?N._visibility&2?ra(o,c,h,y):ff(o,c):N._visibility&2?ra(o,c,h,y):(N._visibility|=2,Yc(o,c,h,y,(c.subtreeFlags&10256)!==0||!1)),w&2048&&bb(z,c);break;case 24:ra(o,c,h,y),w&2048&&wb(c.alternate,c);break;default:ra(o,c,h,y)}}function Yc(o,c,h,y,w){for(w=w&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var N=o,z=c,L=h,K=y,ae=z.flags;switch(z.tag){case 0:case 11:case 15:Yc(N,z,L,K,w),uf(8,z);break;case 23:break;case 22:var ge=z.stateNode;z.memoizedState!==null?ge._visibility&2?Yc(N,z,L,K,w):ff(N,z):(ge._visibility|=2,Yc(N,z,L,K,w)),w&&ae&2048&&bb(z.alternate,z);break;case 24:Yc(N,z,L,K,w),w&&ae&2048&&wb(z.alternate,z);break;default:Yc(N,z,L,K,w)}c=c.sibling}}function ff(o,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var h=o,y=c,w=y.flags;switch(y.tag){case 22:ff(h,y),w&2048&&bb(y.alternate,y);break;case 24:ff(h,y),w&2048&&wb(y.alternate,y);break;default:ff(h,y)}c=c.sibling}}var hf=8192;function Zc(o,c,h){if(o.subtreeFlags&hf)for(o=o.child;o!==null;)p_(o,c,h),o=o.sibling}function p_(o,c,h){switch(o.tag){case 26:Zc(o,c,h),o.flags&hf&&o.memoizedState!==null&&iK(h,na,o.memoizedState,o.memoizedProps);break;case 5:Zc(o,c,h);break;case 3:case 4:var y=na;na=km(o.stateNode.containerInfo),Zc(o,c,h),na=y;break;case 22:o.memoizedState===null&&(y=o.alternate,y!==null&&y.memoizedState!==null?(y=hf,hf=16777216,Zc(o,c,h),hf=y):Zc(o,c,h));break;default:Zc(o,c,h)}}function m_(o){var c=o.alternate;if(c!==null&&(o=c.child,o!==null)){c.child=null;do c=o.sibling,o.sibling=null,o=c;while(o!==null)}}function pf(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var y=c[h];Xn=y,y_(y,o)}m_(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)g_(o),o=o.sibling}function g_(o){switch(o.tag){case 0:case 11:case 15:pf(o),o.flags&2048&&oo(9,o,o.return);break;case 3:pf(o);break;case 12:pf(o);break;case 22:var c=o.stateNode;o.memoizedState!==null&&c._visibility&2&&(o.return===null||o.return.tag!==13)?(c._visibility&=-3,fm(o)):pf(o);break;default:pf(o)}}function fm(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var y=c[h];Xn=y,y_(y,o)}m_(o)}for(o=o.child;o!==null;){switch(c=o,c.tag){case 0:case 11:case 15:oo(8,c,c.return),fm(c);break;case 22:h=c.stateNode,h._visibility&2&&(h._visibility&=-3,fm(c));break;default:fm(c)}o=o.sibling}}function y_(o,c){for(;Xn!==null;){var h=Xn;switch(h.tag){case 0:case 11:case 15:oo(8,h,c);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var y=h.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:Yd(h.memoizedState.cache)}if(y=h.child,y!==null)y.return=h,Xn=y;else e:for(h=o;Xn!==null;){y=Xn;var w=y.sibling,N=y.return;if(o_(y),y===h){Xn=null;break e}if(w!==null){w.return=N,Xn=w;break e}Xn=N}}}var xH={getCacheForType:function(o){var c=lr(Mn),h=c.data.get(o);return h===void 0&&(h=o(),c.data.set(o,h)),h},cacheSignal:function(){return lr(Mn).controller.signal}},bH=typeof WeakMap=="function"?WeakMap:Map,zt=0,Vt=null,gt=null,xt=0,Mt=0,li=null,lo=!1,Xc=!1,jb=!1,gs=0,Sn=0,co=0,jl=0,Sb=0,ci=0,Jc=0,mf=null,Kr=null,Nb=!1,hm=0,v_=0,pm=1/0,mm=null,uo=null,Hn=0,fo=null,eu=null,ys=0,kb=0,Cb=null,x_=null,gf=0,Ab=null;function ui(){return(zt&2)!==0&&xt!==0?xt&-xt:H.T!==null?Pb():Ld()}function b_(){if(ci===0)if((xt&536870912)===0||wt){var o=wi;wi<<=1,(wi&3932160)===0&&(wi=262144),ci=o}else ci=536870912;return o=si.current,o!==null&&(o.flags|=32),ci}function Gr(o,c,h){(o===Vt&&(Mt===2||Mt===9)||o.cancelPendingCommit!==null)&&(tu(o,0),ho(o,xt,ci,!1)),Vs(o,h),((zt&2)===0||o!==Vt)&&(o===Vt&&((zt&2)===0&&(jl|=h),Sn===4&&ho(o,xt,ci,!1)),Aa(o))}function w_(o,c,h){if((zt&6)!==0)throw Error(r(327));var y=!h&&(c&127)===0&&(c&o.expiredLanes)===0||Xi(o,c),w=y?SH(o,c):Eb(o,c,!0),N=y;do{if(w===0){Xc&&!y&&ho(o,c,0,!1);break}else{if(h=o.current.alternate,N&&!wH(h)){w=Eb(o,c,!1),N=!1;continue}if(w===2){if(N=c,o.errorRecoveryDisabledLanes&N)var z=0;else z=o.pendingLanes&-536870913,z=z!==0?z:z&536870912?536870912:0;if(z!==0){c=z;e:{var L=o;w=mf;var K=L.current.memoizedState.isDehydrated;if(K&&(tu(L,z).flags|=256),z=Eb(L,z,!1),z!==2){if(jb&&!K){L.errorRecoveryDisabledLanes|=N,jl|=N,w=4;break e}N=Kr,Kr=w,N!==null&&(Kr===null?Kr=N:Kr.push.apply(Kr,N))}w=z}if(N=!1,w!==2)continue}}if(w===1){tu(o,0),ho(o,c,0,!0);break}e:{switch(y=o,N=w,N){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:ho(y,c,ci,!lo);break e;case 2:Kr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(w=hm+300-mt(),10<w)){if(ho(y,c,ci,!lo),$r(y,0,!0)!==0)break e;ys=c,y.timeoutHandle=X_(j_.bind(null,y,h,Kr,mm,Nb,c,ci,jl,Jc,lo,N,"Throttled",-0,0),w);break e}j_(y,h,Kr,mm,Nb,c,ci,jl,Jc,lo,N,null,-0,0)}}break}while(!0);Aa(o)}function j_(o,c,h,y,w,N,z,L,K,ae,ge,we,le,ue){if(o.timeoutHandle=-1,we=c.subtreeFlags,we&8192||(we&16785408)===16785408){we={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ns},p_(c,N,we);var De=(N&62914560)===N?hm-mt():(N&4194048)===N?v_-mt():0;if(De=aK(we,De),De!==null){ys=N,o.cancelPendingCommit=De(__.bind(null,o,c,N,h,y,w,z,L,K,ge,we,null,le,ue)),ho(o,N,z,!ae);return}}__(o,c,N,h,y,w,z,L,K)}function wH(o){for(var c=o;;){var h=c.tag;if((h===0||h===11||h===15)&&c.flags&16384&&(h=c.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var y=0;y<h.length;y++){var w=h[y],N=w.getSnapshot;w=w.value;try{if(!ii(N(),w))return!1}catch{return!1}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function ho(o,c,h,y){c&=~Sb,c&=~jl,o.suspendedLanes|=c,o.pingedLanes&=~c,y&&(o.warmLanes|=c),y=o.expirationTimes;for(var w=c;0<w;){var N=31-de(w),z=1<<N;y[N]=-1,w&=~z}h!==0&&Dd(o,h,c)}function gm(){return(zt&6)===0?(yf(0),!1):!0}function Ob(){if(gt!==null){if(Mt===0)var o=gt.return;else o=gt,ss=hl=null,H0(o),Kc=null,Xd=0,o=gt;for(;o!==null;)JE(o.alternate,o),o=o.return;gt=null}}function tu(o,c){var h=o.timeoutHandle;h!==-1&&(o.timeoutHandle=-1,UH(h)),h=o.cancelPendingCommit,h!==null&&(o.cancelPendingCommit=null,h()),ys=0,Ob(),Vt=o,gt=h=is(o.current,null),xt=c,Mt=0,li=null,lo=!1,Xc=Xi(o,c),jb=!1,Jc=ci=Sb=jl=co=Sn=0,Kr=mf=null,Nb=!1,(c&8)!==0&&(c|=c&32);var y=o.entangledLanes;if(y!==0)for(o=o.entanglements,y&=c;0<y;){var w=31-de(y),N=1<<w;c|=o[w],y&=~N}return gs=c,Ip(),h}function S_(o,c){st=null,H.H=of,c===Hc||c===Kp?(c=$O(),Mt=3):c===T0?(c=$O(),Mt=4):Mt=c===sb?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,li=c,gt===null&&(Sn=1,am(o,Ci(c,o.current)))}function N_(){var o=si.current;return o===null?!0:(xt&4194048)===xt?_i===null:(xt&62914560)===xt||(xt&536870912)!==0?o===_i:!1}function k_(){var o=H.H;return H.H=of,o===null?of:o}function C_(){var o=H.A;return H.A=xH,o}function ym(){Sn=4,lo||(xt&4194048)!==xt&&si.current!==null||(Xc=!0),(co&134217727)===0&&(jl&134217727)===0||Vt===null||ho(Vt,xt,ci,!1)}function Eb(o,c,h){var y=zt;zt|=2;var w=k_(),N=C_();(Vt!==o||xt!==c)&&(mm=null,tu(o,c)),c=!1;var z=Sn;e:do try{if(Mt!==0&&gt!==null){var L=gt,K=li;switch(Mt){case 8:Ob(),z=6;break e;case 3:case 2:case 9:case 6:si.current===null&&(c=!0);var ae=Mt;if(Mt=0,li=null,nu(o,L,K,ae),h&&Xc){z=0;break e}break;default:ae=Mt,Mt=0,li=null,nu(o,L,K,ae)}}jH(),z=Sn;break}catch(ge){S_(o,ge)}while(!0);return c&&o.shellSuspendCounter++,ss=hl=null,zt=y,H.H=w,H.A=N,gt===null&&(Vt=null,xt=0,Ip()),z}function jH(){for(;gt!==null;)A_(gt)}function SH(o,c){var h=zt;zt|=2;var y=k_(),w=C_();Vt!==o||xt!==c?(mm=null,pm=mt()+500,tu(o,c)):Xc=Xi(o,c);e:do try{if(Mt!==0&&gt!==null){c=gt;var N=li;t:switch(Mt){case 1:Mt=0,li=null,nu(o,c,N,1);break;case 2:case 9:if(IO(N)){Mt=0,li=null,O_(c);break}c=function(){Mt!==2&&Mt!==9||Vt!==o||(Mt=7),Aa(o)},N.then(c,c);break e;case 3:Mt=7;break e;case 4:Mt=5;break e;case 7:IO(N)?(Mt=0,li=null,O_(c)):(Mt=0,li=null,nu(o,c,N,7));break;case 5:var z=null;switch(gt.tag){case 26:z=gt.memoizedState;case 5:case 27:var L=gt;if(z?hz(z):L.stateNode.complete){Mt=0,li=null;var K=L.sibling;if(K!==null)gt=K;else{var ae=L.return;ae!==null?(gt=ae,vm(ae)):gt=null}break t}}Mt=0,li=null,nu(o,c,N,5);break;case 6:Mt=0,li=null,nu(o,c,N,6);break;case 8:Ob(),Sn=6;break e;default:throw Error(r(462))}}NH();break}catch(ge){S_(o,ge)}while(!0);return ss=hl=null,H.H=y,H.A=w,zt=h,gt!==null?0:(Vt=null,xt=0,Ip(),Sn)}function NH(){for(;gt!==null&&!Ze();)A_(gt)}function A_(o){var c=ZE(o.alternate,o,gs);o.memoizedProps=o.pendingProps,c===null?vm(o):gt=c}function O_(o){var c=o,h=c.alternate;switch(c.tag){case 15:case 0:c=KE(h,c,c.pendingProps,c.type,void 0,xt);break;case 11:c=KE(h,c,c.pendingProps,c.type.render,c.ref,xt);break;case 5:H0(c);default:JE(h,c),c=gt=CO(c,gs),c=ZE(h,c,gs)}o.memoizedProps=o.pendingProps,c===null?vm(o):gt=c}function nu(o,c,h,y){ss=hl=null,H0(c),Kc=null,Xd=0;var w=c.return;try{if(fH(o,w,c,h,xt)){Sn=1,am(o,Ci(h,o.current)),gt=null;return}}catch(N){if(w!==null)throw gt=w,N;Sn=1,am(o,Ci(h,o.current)),gt=null;return}c.flags&32768?(wt||y===1?o=!0:Xc||(xt&536870912)!==0?o=!1:(lo=o=!0,(y===2||y===9||y===3||y===6)&&(y=si.current,y!==null&&y.tag===13&&(y.flags|=16384))),E_(c,o)):vm(c)}function vm(o){var c=o;do{if((c.flags&32768)!==0){E_(c,lo);return}o=c.return;var h=mH(c.alternate,c,gs);if(h!==null){gt=h;return}if(c=c.sibling,c!==null){gt=c;return}gt=c=o}while(c!==null);Sn===0&&(Sn=5)}function E_(o,c){do{var h=gH(o.alternate,o);if(h!==null){h.flags&=32767,gt=h;return}if(h=o.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!c&&(o=o.sibling,o!==null)){gt=o;return}gt=o=h}while(o!==null);Sn=6,gt=null}function __(o,c,h,y,w,N,z,L,K){o.cancelPendingCommit=null;do xm();while(Hn!==0);if((zt&6)!==0)throw Error(r(327));if(c!==null){if(c===o.current)throw Error(r(177));if(N=c.lanes|c.childLanes,N|=y0,Wx(o,h,N,z,L,K),o===Vt&&(gt=Vt=null,xt=0),eu=c,fo=o,ys=h,kb=N,Cb=w,x_=y,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,OH(Me,function(){return D_(),null})):(o.callbackNode=null,o.callbackPriority=0),y=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||y){y=H.T,H.T=null,w=J.p,J.p=2,z=zt,zt|=4;try{yH(o,c,h)}finally{zt=z,J.p=w,H.T=y}}Hn=1,z_(),T_(),P_()}}function z_(){if(Hn===1){Hn=0;var o=fo,c=eu,h=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||h){h=H.T,H.T=null;var y=J.p;J.p=2;var w=zt;zt|=4;try{d_(c,o);var N=Ub,z=yO(o.containerInfo),L=N.focusedElem,K=N.selectionRange;if(z!==L&&L&&L.ownerDocument&&gO(L.ownerDocument.documentElement,L)){if(K!==null&&f0(L)){var ae=K.start,ge=K.end;if(ge===void 0&&(ge=ae),"selectionStart"in L)L.selectionStart=ae,L.selectionEnd=Math.min(ge,L.value.length);else{var we=L.ownerDocument||document,le=we&&we.defaultView||window;if(le.getSelection){var ue=le.getSelection(),De=L.textContent.length,Ye=Math.min(K.start,De),Ut=K.end===void 0?Ye:Math.min(K.end,De);!ue.extend&&Ye>Ut&&(z=Ut,Ut=Ye,Ye=z);var te=mO(L,Ye),W=mO(L,Ut);if(te&&W&&(ue.rangeCount!==1||ue.anchorNode!==te.node||ue.anchorOffset!==te.offset||ue.focusNode!==W.node||ue.focusOffset!==W.offset)){var ie=we.createRange();ie.setStart(te.node,te.offset),ue.removeAllRanges(),Ye>Ut?(ue.addRange(ie),ue.extend(W.node,W.offset)):(ie.setEnd(W.node,W.offset),ue.addRange(ie))}}}}for(we=[],ue=L;ue=ue.parentNode;)ue.nodeType===1&&we.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<we.length;L++){var xe=we[L];xe.element.scrollLeft=xe.left,xe.element.scrollTop=xe.top}}zm=!!Bb,Ub=Bb=null}finally{zt=w,J.p=y,H.T=h}}o.current=c,Hn=2}}function T_(){if(Hn===2){Hn=0;var o=fo,c=eu,h=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||h){h=H.T,H.T=null;var y=J.p;J.p=2;var w=zt;zt|=4;try{s_(o,c.alternate,c)}finally{zt=w,J.p=y,H.T=h}}Hn=3}}function P_(){if(Hn===4||Hn===3){Hn=0,Rt();var o=fo,c=eu,h=ys,y=x_;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Hn=5:(Hn=0,eu=fo=null,R_(o,o.pendingLanes));var w=o.pendingLanes;if(w===0&&(uo=null),Id(h),c=c.stateNode,We&&typeof We.onCommitFiberRoot=="function")try{We.onCommitFiberRoot(gn,c,void 0,(c.current.flags&128)===128)}catch{}if(y!==null){c=H.T,w=J.p,J.p=2,H.T=null;try{for(var N=o.onRecoverableError,z=0;z<y.length;z++){var L=y[z];N(L.value,{componentStack:L.stack})}}finally{H.T=c,J.p=w}}(ys&3)!==0&&xm(),Aa(o),w=o.pendingLanes,(h&261930)!==0&&(w&42)!==0?o===Ab?gf++:(gf=0,Ab=o):gf=0,yf(0)}}function R_(o,c){(o.pooledCacheLanes&=c)===0&&(c=o.pooledCache,c!=null&&(o.pooledCache=null,Yd(c)))}function xm(){return z_(),T_(),P_(),D_()}function D_(){if(Hn!==5)return!1;var o=fo,c=kb;kb=0;var h=Id(ys),y=H.T,w=J.p;try{J.p=32>h?32:h,H.T=null,h=Cb,Cb=null;var N=fo,z=ys;if(Hn=0,eu=fo=null,ys=0,(zt&6)!==0)throw Error(r(331));var L=zt;if(zt|=4,g_(N.current),h_(N,N.current,z,h),zt=L,yf(0,!1),We&&typeof We.onPostCommitFiberRoot=="function")try{We.onPostCommitFiberRoot(gn,N)}catch{}return!0}finally{J.p=w,H.T=y,R_(o,c)}}function M_(o,c,h){c=Ci(h,c),c=ab(o.stateNode,c,2),o=io(o,c,2),o!==null&&(Vs(o,2),Aa(o))}function It(o,c,h){if(o.tag===3)M_(o,o,h);else for(;c!==null;){if(c.tag===3){M_(c,o,h);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(uo===null||!uo.has(y))){o=Ci(h,o),h=IE(2),y=io(c,h,2),y!==null&&(LE(h,y,c,o),Vs(y,2),Aa(y));break}}c=c.return}}function _b(o,c,h){var y=o.pingCache;if(y===null){y=o.pingCache=new bH;var w=new Set;y.set(c,w)}else w=y.get(c),w===void 0&&(w=new Set,y.set(c,w));w.has(h)||(jb=!0,w.add(h),o=kH.bind(null,o,c,h),c.then(o,o))}function kH(o,c,h){var y=o.pingCache;y!==null&&y.delete(c),o.pingedLanes|=o.suspendedLanes&h,o.warmLanes&=~h,Vt===o&&(xt&h)===h&&(Sn===4||Sn===3&&(xt&62914560)===xt&&300>mt()-hm?(zt&2)===0&&tu(o,0):Sb|=h,Jc===xt&&(Jc=0)),Aa(o)}function I_(o,c){c===0&&(c=Sp()),o=ul(o,c),o!==null&&(Vs(o,c),Aa(o))}function CH(o){var c=o.memoizedState,h=0;c!==null&&(h=c.retryLane),I_(o,h)}function AH(o,c){var h=0;switch(o.tag){case 31:case 13:var y=o.stateNode,w=o.memoizedState;w!==null&&(h=w.retryLane);break;case 19:y=o.stateNode;break;case 22:y=o.stateNode._retryCache;break;default:throw Error(r(314))}y!==null&&y.delete(c),I_(o,h)}function OH(o,c){return en(o,c)}var bm=null,ru=null,zb=!1,wm=!1,Tb=!1,po=0;function Aa(o){o!==ru&&o.next===null&&(ru===null?bm=ru=o:ru=ru.next=o),wm=!0,zb||(zb=!0,_H())}function yf(o,c){if(!Tb&&wm){Tb=!0;do for(var h=!1,y=bm;y!==null;){if(o!==0){var w=y.pendingLanes;if(w===0)var N=0;else{var z=y.suspendedLanes,L=y.pingedLanes;N=(1<<31-de(42|o)+1)-1,N&=w&~(z&~L),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(h=!0,U_(y,N))}else N=xt,N=$r(y,y===Vt?N:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(N&3)===0||Xi(y,N)||(h=!0,U_(y,N));y=y.next}while(h);Tb=!1}}function EH(){L_()}function L_(){wm=zb=!1;var o=0;po!==0&&BH()&&(o=po);for(var c=mt(),h=null,y=bm;y!==null;){var w=y.next,N=$_(y,c);N===0?(y.next=null,h===null?bm=w:h.next=w,w===null&&(ru=h)):(h=y,(o!==0||(N&3)!==0)&&(wm=!0)),y=w}Hn!==0&&Hn!==5||yf(o),po!==0&&(po=0)}function $_(o,c){for(var h=o.suspendedLanes,y=o.pingedLanes,w=o.expirationTimes,N=o.pendingLanes&-62914561;0<N;){var z=31-de(N),L=1<<z,K=w[z];K===-1?((L&h)===0||(L&y)!==0)&&(w[z]=wa(L,c)):K<=c&&(o.expiredLanes|=L),N&=~L}if(c=Vt,h=xt,h=$r(o,o===c?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),y=o.callbackNode,h===0||o===c&&(Mt===2||Mt===9)||o.cancelPendingCommit!==null)return y!==null&&y!==null&&je(y),o.callbackNode=null,o.callbackPriority=0;if((h&3)===0||Xi(o,h)){if(c=h&-h,c===o.callbackPriority)return c;switch(y!==null&&je(y),Id(h)){case 2:case 8:h=Ne;break;case 32:h=Me;break;case 268435456:h=pt;break;default:h=Me}return y=B_.bind(null,o),h=en(h,y),o.callbackPriority=c,o.callbackNode=h,c}return y!==null&&y!==null&&je(y),o.callbackPriority=2,o.callbackNode=null,2}function B_(o,c){if(Hn!==0&&Hn!==5)return o.callbackNode=null,o.callbackPriority=0,null;var h=o.callbackNode;if(xm()&&o.callbackNode!==h)return null;var y=xt;return y=$r(o,o===Vt?y:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),y===0?null:(w_(o,y,c),$_(o,mt()),o.callbackNode!=null&&o.callbackNode===h?B_.bind(null,o):null)}function U_(o,c){if(xm())return null;w_(o,c,!0)}function _H(){qH(function(){(zt&6)!==0?en(ce,EH):L_()})}function Pb(){if(po===0){var o=qc;o===0&&(o=Fn,Fn<<=1,(Fn&261888)===0&&(Fn=256)),po=o}return po}function q_(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Ep(""+o)}function F_(o,c){var h=c.ownerDocument.createElement("input");return h.name=c.name,h.value=c.value,o.id&&h.setAttribute("form",o.id),c.parentNode.insertBefore(h,c),o=new FormData(o),h.parentNode.removeChild(h),o}function zH(o,c,h,y,w){if(c==="submit"&&h&&h.stateNode===w){var N=q_((w[St]||null).action),z=y.submitter;z&&(c=(c=z[St]||null)?q_(c.formAction):z.getAttribute("formAction"),c!==null&&(N=c,z=null));var L=new Pp("action","action",null,y,w);o.push({event:L,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(po!==0){var K=z?F_(w,z):new FormData(w);J0(h,{pending:!0,data:K,method:w.method,action:N},null,K)}}else typeof N=="function"&&(L.preventDefault(),K=z?F_(w,z):new FormData(w),J0(h,{pending:!0,data:K,method:w.method,action:N},N,K))},currentTarget:w}]})}}for(var Rb=0;Rb<g0.length;Rb++){var Db=g0[Rb],TH=Db.toLowerCase(),PH=Db[0].toUpperCase()+Db.slice(1);ta(TH,"on"+PH)}ta(bO,"onAnimationEnd"),ta(wO,"onAnimationIteration"),ta(jO,"onAnimationStart"),ta("dblclick","onDoubleClick"),ta("focusin","onFocus"),ta("focusout","onBlur"),ta(W9,"onTransitionRun"),ta(Y9,"onTransitionStart"),ta(Z9,"onTransitionCancel"),ta(SO,"onTransitionEnd"),ut("onMouseEnter",["mouseout","mouseover"]),ut("onMouseLeave",["mouseout","mouseover"]),ut("onPointerEnter",["pointerout","pointerover"]),ut("onPointerLeave",["pointerout","pointerover"]),es("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),es("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),es("onBeforeInput",["compositionend","keypress","textInput","paste"]),es("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vf="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(" "),RH=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vf));function H_(o,c){c=(c&4)!==0;for(var h=0;h<o.length;h++){var y=o[h],w=y.event;y=y.listeners;e:{var N=void 0;if(c)for(var z=y.length-1;0<=z;z--){var L=y[z],K=L.instance,ae=L.currentTarget;if(L=L.listener,K!==N&&w.isPropagationStopped())break e;N=L,w.currentTarget=ae;try{N(w)}catch(ge){Mp(ge)}w.currentTarget=null,N=K}else for(z=0;z<y.length;z++){if(L=y[z],K=L.instance,ae=L.currentTarget,L=L.listener,K!==N&&w.isPropagationStopped())break e;N=L,w.currentTarget=ae;try{N(w)}catch(ge){Mp(ge)}w.currentTarget=null,N=K}}}}function yt(o,c){var h=c[ja];h===void 0&&(h=c[ja]=new Set);var y=o+"__bubble";h.has(y)||(K_(c,o,2,!1),h.add(y))}function Mb(o,c,h){var y=0;c&&(y|=4),K_(h,o,y,c)}var jm="_reactListening"+Math.random().toString(36).slice(2);function Ib(o){if(!o[jm]){o[jm]=!0,al.forEach(function(h){h!=="selectionchange"&&(RH.has(h)||Mb(h,!1,o),Mb(h,!0,o))});var c=o.nodeType===9?o:o.ownerDocument;c===null||c[jm]||(c[jm]=!0,Mb("selectionchange",!1,c))}}function K_(o,c,h,y){switch(bz(c)){case 2:var w=lK;break;case 8:w=cK;break;default:w=Xb}h=w.bind(null,c,h,o),w=void 0,!r0||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(w=!0),y?w!==void 0?o.addEventListener(c,h,{capture:!0,passive:w}):o.addEventListener(c,h,!0):w!==void 0?o.addEventListener(c,h,{passive:w}):o.addEventListener(c,h,!1)}function Lb(o,c,h,y,w){var N=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var z=y.tag;if(z===3||z===4){var L=y.stateNode.containerInfo;if(L===w)break;if(z===4)for(z=y.return;z!==null;){var K=z.tag;if((K===3||K===4)&&z.stateNode.containerInfo===w)return;z=z.return}for(;L!==null;){if(z=ji(L),z===null)return;if(K=z.tag,K===5||K===6||K===26||K===27){y=N=z;continue e}L=L.parentNode}}y=y.return}YA(function(){var ae=N,ge=t0(h),we=[];e:{var le=NO.get(o);if(le!==void 0){var ue=Pp,De=o;switch(o){case"keypress":if(zp(h)===0)break e;case"keydown":case"keyup":ue=A9;break;case"focusin":De="focus",ue=o0;break;case"focusout":De="blur",ue=o0;break;case"beforeblur":case"afterblur":ue=o0;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=JA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=m9;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=_9;break;case bO:case wO:case jO:ue=v9;break;case SO:ue=T9;break;case"scroll":case"scrollend":ue=h9;break;case"wheel":ue=R9;break;case"copy":case"cut":case"paste":ue=b9;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=tO;break;case"toggle":case"beforetoggle":ue=M9}var Ye=(c&4)!==0,Ut=!Ye&&(o==="scroll"||o==="scrollend"),te=Ye?le!==null?le+"Capture":null:le;Ye=[];for(var W=ae,ie;W!==null;){var xe=W;if(ie=xe.stateNode,xe=xe.tag,xe!==5&&xe!==26&&xe!==27||ie===null||te===null||(xe=$d(W,te),xe!=null&&Ye.push(xf(W,xe,ie))),Ut)break;W=W.return}0<Ye.length&&(le=new ue(le,De,null,h,ge),we.push({event:le,listeners:Ye}))}}if((c&7)===0){e:{if(le=o==="mouseover"||o==="pointerover",ue=o==="mouseout"||o==="pointerout",le&&h!==e0&&(De=h.relatedTarget||h.fromElement)&&(ji(De)||De[_n]))break e;if((ue||le)&&(le=ge.window===ge?ge:(le=ge.ownerDocument)?le.defaultView||le.parentWindow:window,ue?(De=h.relatedTarget||h.toElement,ue=ae,De=De?ji(De):null,De!==null&&(Ut=a(De),Ye=De.tag,De!==Ut||Ye!==5&&Ye!==27&&Ye!==6)&&(De=null)):(ue=null,De=ae),ue!==De)){if(Ye=JA,xe="onMouseLeave",te="onMouseEnter",W="mouse",(o==="pointerout"||o==="pointerover")&&(Ye=tO,xe="onPointerLeave",te="onPointerEnter",W="pointer"),Ut=ue==null?le:Ws(ue),ie=De==null?le:Ws(De),le=new Ye(xe,W+"leave",ue,h,ge),le.target=Ut,le.relatedTarget=ie,xe=null,ji(ge)===ae&&(Ye=new Ye(te,W+"enter",De,h,ge),Ye.target=ie,Ye.relatedTarget=Ut,xe=Ye),Ut=xe,ue&&De)t:{for(Ye=DH,te=ue,W=De,ie=0,xe=te;xe;xe=Ye(xe))ie++;xe=0;for(var Ke=W;Ke;Ke=Ye(Ke))xe++;for(;0<ie-xe;)te=Ye(te),ie--;for(;0<xe-ie;)W=Ye(W),xe--;for(;ie--;){if(te===W||W!==null&&te===W.alternate){Ye=te;break t}te=Ye(te),W=Ye(W)}Ye=null}else Ye=null;ue!==null&&G_(we,le,ue,Ye,!1),De!==null&&Ut!==null&&G_(we,Ut,De,Ye,!0)}}e:{if(le=ae?Ws(ae):window,ue=le.nodeName&&le.nodeName.toLowerCase(),ue==="select"||ue==="input"&&le.type==="file")var kt=cO;else if(oO(le))if(uO)kt=G9;else{kt=H9;var Be=F9}else ue=le.nodeName,!ue||ue.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?ae&&Jx(ae.elementType)&&(kt=cO):kt=K9;if(kt&&(kt=kt(o,ae))){lO(we,kt,h,ge);break e}Be&&Be(o,le,ae),o==="focusout"&&ae&&le.type==="number"&&ae.memoizedProps.value!=null&&Xx(le,"number",le.value)}switch(Be=ae?Ws(ae):window,o){case"focusin":(oO(Be)||Be.contentEditable==="true")&&(Rc=Be,h0=ae,Vd=null);break;case"focusout":Vd=h0=Rc=null;break;case"mousedown":p0=!0;break;case"contextmenu":case"mouseup":case"dragend":p0=!1,vO(we,h,ge);break;case"selectionchange":if(Q9)break;case"keydown":case"keyup":vO(we,h,ge)}var ot;if(c0)e:{switch(o){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else Pc?aO(o,h)&&(bt="onCompositionEnd"):o==="keydown"&&h.keyCode===229&&(bt="onCompositionStart");bt&&(nO&&h.locale!=="ko"&&(Pc||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&Pc&&(ot=ZA()):(Zs=ge,i0="value"in Zs?Zs.value:Zs.textContent,Pc=!0)),Be=Sm(ae,bt),0<Be.length&&(bt=new eO(bt,o,null,h,ge),we.push({event:bt,listeners:Be}),ot?bt.data=ot:(ot=sO(h),ot!==null&&(bt.data=ot)))),(ot=L9?$9(o,h):B9(o,h))&&(bt=Sm(ae,"onBeforeInput"),0<bt.length&&(Be=new eO("onBeforeInput","beforeinput",null,h,ge),we.push({event:Be,listeners:bt}),Be.data=ot)),zH(we,o,ae,h,ge)}H_(we,c)})}function xf(o,c,h){return{instance:o,listener:c,currentTarget:h}}function Sm(o,c){for(var h=c+"Capture",y=[];o!==null;){var w=o,N=w.stateNode;if(w=w.tag,w!==5&&w!==26&&w!==27||N===null||(w=$d(o,h),w!=null&&y.unshift(xf(o,w,N)),w=$d(o,c),w!=null&&y.push(xf(o,w,N))),o.tag===3)return y;o=o.return}return[]}function DH(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function G_(o,c,h,y,w){for(var N=c._reactName,z=[];h!==null&&h!==y;){var L=h,K=L.alternate,ae=L.stateNode;if(L=L.tag,K!==null&&K===y)break;L!==5&&L!==26&&L!==27||ae===null||(K=ae,w?(ae=$d(h,N),ae!=null&&z.unshift(xf(h,ae,K))):w||(ae=$d(h,N),ae!=null&&z.push(xf(h,ae,K)))),h=h.return}z.length!==0&&o.push({event:c,listeners:z})}var MH=/\r\n?/g,IH=/\u0000|\uFFFD/g;function V_(o){return(typeof o=="string"?o:""+o).replace(MH,`
9
+ `).replace(IH,"")}function Q_(o,c){return c=V_(c),V_(o)===c}function Bt(o,c,h,y,w,N){switch(h){case"children":typeof y=="string"?c==="body"||c==="textarea"&&y===""||_c(o,y):(typeof y=="number"||typeof y=="bigint")&&c!=="body"&&_c(o,""+y);break;case"className":Ap(o,"class",y);break;case"tabIndex":Ap(o,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":Ap(o,h,y);break;case"style":QA(o,y,N);break;case"data":if(c!=="object"){Ap(o,"data",y);break}case"src":case"href":if(y===""&&(c!=="a"||h!=="href")){o.removeAttribute(h);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){o.removeAttribute(h);break}y=Ep(""+y),o.setAttribute(h,y);break;case"action":case"formAction":if(typeof y=="function"){o.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof N=="function"&&(h==="formAction"?(c!=="input"&&Bt(o,c,"name",w.name,w,null),Bt(o,c,"formEncType",w.formEncType,w,null),Bt(o,c,"formMethod",w.formMethod,w,null),Bt(o,c,"formTarget",w.formTarget,w,null)):(Bt(o,c,"encType",w.encType,w,null),Bt(o,c,"method",w.method,w,null),Bt(o,c,"target",w.target,w,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){o.removeAttribute(h);break}y=Ep(""+y),o.setAttribute(h,y);break;case"onClick":y!=null&&(o.onclick=ns);break;case"onScroll":y!=null&&yt("scroll",o);break;case"onScrollEnd":y!=null&&yt("scrollend",o);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(h=y.__html,h!=null){if(w.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"multiple":o.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":o.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){o.removeAttribute("xlink:href");break}h=Ep(""+y),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":y!=null&&typeof y!="function"&&typeof y!="symbol"?o.setAttribute(h,""+y):o.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":y&&typeof y!="function"&&typeof y!="symbol"?o.setAttribute(h,""):o.removeAttribute(h);break;case"capture":case"download":y===!0?o.setAttribute(h,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?o.setAttribute(h,y):o.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?o.setAttribute(h,y):o.removeAttribute(h);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?o.removeAttribute(h):o.setAttribute(h,y);break;case"popover":yt("beforetoggle",o),yt("toggle",o),sl(o,"popover",y);break;case"xlinkActuate":ts(o,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":ts(o,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":ts(o,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":ts(o,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":ts(o,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":ts(o,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":ts(o,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":ts(o,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":ts(o,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":sl(o,"is",y);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=d9.get(h)||h,sl(o,h,y))}}function $b(o,c,h,y,w,N){switch(h){case"style":QA(o,y,N);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(h=y.__html,h!=null){if(w.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"children":typeof y=="string"?_c(o,y):(typeof y=="number"||typeof y=="bigint")&&_c(o,""+y);break;case"onScroll":y!=null&&yt("scroll",o);break;case"onScrollEnd":y!=null&&yt("scrollend",o);break;case"onClick":y!=null&&(o.onclick=ns);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Cp.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(w=h.endsWith("Capture"),c=h.slice(2,w?h.length-7:void 0),N=o[St]||null,N=N!=null?N[h]:null,typeof N=="function"&&o.removeEventListener(c,N,w),typeof y=="function")){typeof N!="function"&&N!==null&&(h in o?o[h]=null:o.hasAttribute(h)&&o.removeAttribute(h)),o.addEventListener(c,y,w);break e}h in o?o[h]=y:y===!0?o.setAttribute(h,""):sl(o,h,y)}}}function ur(o,c,h){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":yt("error",o),yt("load",o);var y=!1,w=!1,N;for(N in h)if(h.hasOwnProperty(N)){var z=h[N];if(z!=null)switch(N){case"src":y=!0;break;case"srcSet":w=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:Bt(o,c,N,z,h,null)}}w&&Bt(o,c,"srcSet",h.srcSet,h,null),y&&Bt(o,c,"src",h.src,h,null);return;case"input":yt("invalid",o);var L=N=z=w=null,K=null,ae=null;for(y in h)if(h.hasOwnProperty(y)){var ge=h[y];if(ge!=null)switch(y){case"name":w=ge;break;case"type":z=ge;break;case"checked":K=ge;break;case"defaultChecked":ae=ge;break;case"value":N=ge;break;case"defaultValue":L=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,c));break;default:Bt(o,c,y,ge,h,null)}}HA(o,N,L,K,ae,z,w,!1);return;case"select":yt("invalid",o),y=z=N=null;for(w in h)if(h.hasOwnProperty(w)&&(L=h[w],L!=null))switch(w){case"value":N=L;break;case"defaultValue":z=L;break;case"multiple":y=L;default:Bt(o,c,w,L,h,null)}c=N,h=z,o.multiple=!!y,c!=null?Ec(o,!!y,c,!1):h!=null&&Ec(o,!!y,h,!0);return;case"textarea":yt("invalid",o),N=w=y=null;for(z in h)if(h.hasOwnProperty(z)&&(L=h[z],L!=null))switch(z){case"value":y=L;break;case"defaultValue":w=L;break;case"children":N=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:Bt(o,c,z,L,h,null)}GA(o,y,w,N);return;case"option":for(K in h)h.hasOwnProperty(K)&&(y=h[K],y!=null)&&(K==="selected"?o.selected=y&&typeof y!="function"&&typeof y!="symbol":Bt(o,c,K,y,h,null));return;case"dialog":yt("beforetoggle",o),yt("toggle",o),yt("cancel",o),yt("close",o);break;case"iframe":case"object":yt("load",o);break;case"video":case"audio":for(y=0;y<vf.length;y++)yt(vf[y],o);break;case"image":yt("error",o),yt("load",o);break;case"details":yt("toggle",o);break;case"embed":case"source":case"link":yt("error",o),yt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ae in h)if(h.hasOwnProperty(ae)&&(y=h[ae],y!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:Bt(o,c,ae,y,h,null)}return;default:if(Jx(c)){for(ge in h)h.hasOwnProperty(ge)&&(y=h[ge],y!==void 0&&$b(o,c,ge,y,h,void 0));return}}for(L in h)h.hasOwnProperty(L)&&(y=h[L],y!=null&&Bt(o,c,L,y,h,null))}function LH(o,c,h,y){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var w=null,N=null,z=null,L=null,K=null,ae=null,ge=null;for(ue in h){var we=h[ue];if(h.hasOwnProperty(ue)&&we!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":K=we;default:y.hasOwnProperty(ue)||Bt(o,c,ue,null,y,we)}}for(var le in y){var ue=y[le];if(we=h[le],y.hasOwnProperty(le)&&(ue!=null||we!=null))switch(le){case"type":N=ue;break;case"name":w=ue;break;case"checked":ae=ue;break;case"defaultChecked":ge=ue;break;case"value":z=ue;break;case"defaultValue":L=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,c));break;default:ue!==we&&Bt(o,c,le,ue,y,we)}}Zx(o,z,L,K,ae,ge,N,w);return;case"select":ue=z=L=le=null;for(N in h)if(K=h[N],h.hasOwnProperty(N)&&K!=null)switch(N){case"value":break;case"multiple":ue=K;default:y.hasOwnProperty(N)||Bt(o,c,N,null,y,K)}for(w in y)if(N=y[w],K=h[w],y.hasOwnProperty(w)&&(N!=null||K!=null))switch(w){case"value":le=N;break;case"defaultValue":L=N;break;case"multiple":z=N;default:N!==K&&Bt(o,c,w,N,y,K)}c=L,h=z,y=ue,le!=null?Ec(o,!!h,le,!1):!!y!=!!h&&(c!=null?Ec(o,!!h,c,!0):Ec(o,!!h,h?[]:"",!1));return;case"textarea":ue=le=null;for(L in h)if(w=h[L],h.hasOwnProperty(L)&&w!=null&&!y.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Bt(o,c,L,null,y,w)}for(z in y)if(w=y[z],N=h[z],y.hasOwnProperty(z)&&(w!=null||N!=null))switch(z){case"value":le=w;break;case"defaultValue":ue=w;break;case"children":break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:w!==N&&Bt(o,c,z,w,y,N)}KA(o,le,ue);return;case"option":for(var De in h)le=h[De],h.hasOwnProperty(De)&&le!=null&&!y.hasOwnProperty(De)&&(De==="selected"?o.selected=!1:Bt(o,c,De,null,y,le));for(K in y)le=y[K],ue=h[K],y.hasOwnProperty(K)&&le!==ue&&(le!=null||ue!=null)&&(K==="selected"?o.selected=le&&typeof le!="function"&&typeof le!="symbol":Bt(o,c,K,le,y,ue));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ye in h)le=h[Ye],h.hasOwnProperty(Ye)&&le!=null&&!y.hasOwnProperty(Ye)&&Bt(o,c,Ye,null,y,le);for(ae in y)if(le=y[ae],ue=h[ae],y.hasOwnProperty(ae)&&le!==ue&&(le!=null||ue!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,c));break;default:Bt(o,c,ae,le,y,ue)}return;default:if(Jx(c)){for(var Ut in h)le=h[Ut],h.hasOwnProperty(Ut)&&le!==void 0&&!y.hasOwnProperty(Ut)&&$b(o,c,Ut,void 0,y,le);for(ge in y)le=y[ge],ue=h[ge],!y.hasOwnProperty(ge)||le===ue||le===void 0&&ue===void 0||$b(o,c,ge,le,y,ue);return}}for(var te in h)le=h[te],h.hasOwnProperty(te)&&le!=null&&!y.hasOwnProperty(te)&&Bt(o,c,te,null,y,le);for(we in y)le=y[we],ue=h[we],!y.hasOwnProperty(we)||le===ue||le==null&&ue==null||Bt(o,c,we,le,y,ue)}function W_(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $H(){if(typeof performance.getEntriesByType=="function"){for(var o=0,c=0,h=performance.getEntriesByType("resource"),y=0;y<h.length;y++){var w=h[y],N=w.transferSize,z=w.initiatorType,L=w.duration;if(N&&L&&W_(z)){for(z=0,L=w.responseEnd,y+=1;y<h.length;y++){var K=h[y],ae=K.startTime;if(ae>L)break;var ge=K.transferSize,we=K.initiatorType;ge&&W_(we)&&(K=K.responseEnd,z+=ge*(K<L?1:(L-ae)/(K-ae)))}if(--y,c+=8*(N+z)/(w.duration/1e3),o++,10<o)break}}if(0<o)return c/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Bb=null,Ub=null;function Nm(o){return o.nodeType===9?o:o.ownerDocument}function Y_(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Z_(o,c){if(o===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&c==="foreignObject"?0:o}function qb(o,c){return o==="textarea"||o==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Fb=null;function BH(){var o=window.event;return o&&o.type==="popstate"?o===Fb?!1:(Fb=o,!0):(Fb=null,!1)}var X_=typeof setTimeout=="function"?setTimeout:void 0,UH=typeof clearTimeout=="function"?clearTimeout:void 0,J_=typeof Promise=="function"?Promise:void 0,qH=typeof queueMicrotask=="function"?queueMicrotask:typeof J_<"u"?function(o){return J_.resolve(null).then(o).catch(FH)}:X_;function FH(o){setTimeout(function(){throw o})}function mo(o){return o==="head"}function ez(o,c){var h=c,y=0;do{var w=h.nextSibling;if(o.removeChild(h),w&&w.nodeType===8)if(h=w.data,h==="/$"||h==="/&"){if(y===0){o.removeChild(w),ou(c);return}y--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")y++;else if(h==="html")bf(o.ownerDocument.documentElement);else if(h==="head"){h=o.ownerDocument.head,bf(h);for(var N=h.firstChild;N;){var z=N.nextSibling,L=N.nodeName;N[il]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&N.rel.toLowerCase()==="stylesheet"||h.removeChild(N),N=z}}else h==="body"&&bf(o.ownerDocument.body);h=w}while(h);ou(c)}function tz(o,c){var h=o;o=0;do{var y=h.nextSibling;if(h.nodeType===1?c?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(c?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),y&&y.nodeType===8)if(h=y.data,h==="/$"){if(o===0)break;o--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||o++;h=y}while(h)}function Hb(o){var c=o.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var h=c;switch(c=c.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Hb(h),Sa(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}o.removeChild(h)}}function HH(o,c,h,y){for(;o.nodeType===1;){var w=h;if(o.nodeName.toLowerCase()!==c.toLowerCase()){if(!y&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(y){if(!o[il])switch(c){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(N=o.getAttribute("rel"),N==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(N!==w.rel||o.getAttribute("href")!==(w.href==null||w.href===""?null:w.href)||o.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin)||o.getAttribute("title")!==(w.title==null?null:w.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(N=o.getAttribute("src"),(N!==(w.src==null?null:w.src)||o.getAttribute("type")!==(w.type==null?null:w.type)||o.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin))&&N&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(c==="input"&&o.type==="hidden"){var N=w.name==null?null:""+w.name;if(w.type==="hidden"&&o.getAttribute("name")===N)return o}else return o;if(o=zi(o.nextSibling),o===null)break}return null}function KH(o,c,h){if(c==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!h||(o=zi(o.nextSibling),o===null))return null;return o}function nz(o,c){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!c||(o=zi(o.nextSibling),o===null))return null;return o}function Kb(o){return o.data==="$?"||o.data==="$~"}function Gb(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function GH(o,c){var h=o.ownerDocument;if(o.data==="$~")o._reactRetry=c;else if(o.data!=="$?"||h.readyState!=="loading")c();else{var y=function(){c(),h.removeEventListener("DOMContentLoaded",y)};h.addEventListener("DOMContentLoaded",y),o._reactRetry=y}}function zi(o){for(;o!=null;o=o.nextSibling){var c=o.nodeType;if(c===1||c===3)break;if(c===8){if(c=o.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return o}var Vb=null;function rz(o){o=o.nextSibling;for(var c=0;o;){if(o.nodeType===8){var h=o.data;if(h==="/$"||h==="/&"){if(c===0)return zi(o.nextSibling);c--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||c++}o=o.nextSibling}return null}function iz(o){o=o.previousSibling;for(var c=0;o;){if(o.nodeType===8){var h=o.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(c===0)return o;c--}else h!=="/$"&&h!=="/&"||c++}o=o.previousSibling}return null}function az(o,c,h){switch(c=Nm(h),o){case"html":if(o=c.documentElement,!o)throw Error(r(452));return o;case"head":if(o=c.head,!o)throw Error(r(453));return o;case"body":if(o=c.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function bf(o){for(var c=o.attributes;c.length;)o.removeAttributeNode(c[0]);Sa(o)}var Ti=new Map,sz=new Set;function km(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var vs=J.d;J.d={f:VH,r:QH,D:WH,C:YH,L:ZH,m:XH,X:eK,S:JH,M:tK};function VH(){var o=vs.f(),c=gm();return o||c}function QH(o){var c=Ji(o);c!==null&&c.tag===5&&c.type==="form"?SE(c):vs.r(o)}var iu=typeof document>"u"?null:document;function oz(o,c,h){var y=iu;if(y&&typeof c=="string"&&c){var w=Ni(c);w='link[rel="'+o+'"][href="'+w+'"]',typeof h=="string"&&(w+='[crossorigin="'+h+'"]'),sz.has(w)||(sz.add(w),o={rel:o,crossOrigin:h,href:c},y.querySelector(w)===null&&(c=y.createElement("link"),ur(c,"link",o),yn(c),y.head.appendChild(c)))}}function WH(o){vs.D(o),oz("dns-prefetch",o,null)}function YH(o,c){vs.C(o,c),oz("preconnect",o,c)}function ZH(o,c,h){vs.L(o,c,h);var y=iu;if(y&&o&&c){var w='link[rel="preload"][as="'+Ni(c)+'"]';c==="image"&&h&&h.imageSrcSet?(w+='[imagesrcset="'+Ni(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(w+='[imagesizes="'+Ni(h.imageSizes)+'"]')):w+='[href="'+Ni(o)+'"]';var N=w;switch(c){case"style":N=au(o);break;case"script":N=su(o)}Ti.has(N)||(o=m({rel:"preload",href:c==="image"&&h&&h.imageSrcSet?void 0:o,as:c},h),Ti.set(N,o),y.querySelector(w)!==null||c==="style"&&y.querySelector(wf(N))||c==="script"&&y.querySelector(jf(N))||(c=y.createElement("link"),ur(c,"link",o),yn(c),y.head.appendChild(c)))}}function XH(o,c){vs.m(o,c);var h=iu;if(h&&o){var y=c&&typeof c.as=="string"?c.as:"script",w='link[rel="modulepreload"][as="'+Ni(y)+'"][href="'+Ni(o)+'"]',N=w;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=su(o)}if(!Ti.has(N)&&(o=m({rel:"modulepreload",href:o},c),Ti.set(N,o),h.querySelector(w)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(jf(N)))return}y=h.createElement("link"),ur(y,"link",o),yn(y),h.head.appendChild(y)}}}function JH(o,c,h){vs.S(o,c,h);var y=iu;if(y&&o){var w=Ys(y).hoistableStyles,N=au(o);c=c||"default";var z=w.get(N);if(!z){var L={loading:0,preload:null};if(z=y.querySelector(wf(N)))L.loading=5;else{o=m({rel:"stylesheet",href:o,"data-precedence":c},h),(h=Ti.get(N))&&Qb(o,h);var K=z=y.createElement("link");yn(K),ur(K,"link",o),K._p=new Promise(function(ae,ge){K.onload=ae,K.onerror=ge}),K.addEventListener("load",function(){L.loading|=1}),K.addEventListener("error",function(){L.loading|=2}),L.loading|=4,Cm(z,c,y)}z={type:"stylesheet",instance:z,count:1,state:L},w.set(N,z)}}}function eK(o,c){vs.X(o,c);var h=iu;if(h&&o){var y=Ys(h).hoistableScripts,w=su(o),N=y.get(w);N||(N=h.querySelector(jf(w)),N||(o=m({src:o,async:!0},c),(c=Ti.get(w))&&Wb(o,c),N=h.createElement("script"),yn(N),ur(N,"link",o),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},y.set(w,N))}}function tK(o,c){vs.M(o,c);var h=iu;if(h&&o){var y=Ys(h).hoistableScripts,w=su(o),N=y.get(w);N||(N=h.querySelector(jf(w)),N||(o=m({src:o,async:!0,type:"module"},c),(c=Ti.get(w))&&Wb(o,c),N=h.createElement("script"),yn(N),ur(N,"link",o),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},y.set(w,N))}}function lz(o,c,h,y){var w=(w=ne.current)?km(w):null;if(!w)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(c=au(h.href),h=Ys(w).hoistableStyles,y=h.get(c),y||(y={type:"style",instance:null,count:0,state:null},h.set(c,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){o=au(h.href);var N=Ys(w).hoistableStyles,z=N.get(o);if(z||(w=w.ownerDocument||w,z={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(o,z),(N=w.querySelector(wf(o)))&&!N._p&&(z.instance=N,z.state.loading=5),Ti.has(o)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},Ti.set(o,h),N||nK(w,o,h,z.state))),c&&y===null)throw Error(r(528,""));return z}if(c&&y!==null)throw Error(r(529,""));return null;case"script":return c=h.async,h=h.src,typeof h=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=su(h),h=Ys(w).hoistableScripts,y=h.get(c),y||(y={type:"script",instance:null,count:0,state:null},h.set(c,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function au(o){return'href="'+Ni(o)+'"'}function wf(o){return'link[rel="stylesheet"]['+o+"]"}function cz(o){return m({},o,{"data-precedence":o.precedence,precedence:null})}function nK(o,c,h,y){o.querySelector('link[rel="preload"][as="style"]['+c+"]")?y.loading=1:(c=o.createElement("link"),y.preload=c,c.addEventListener("load",function(){return y.loading|=1}),c.addEventListener("error",function(){return y.loading|=2}),ur(c,"link",h),yn(c),o.head.appendChild(c))}function su(o){return'[src="'+Ni(o)+'"]'}function jf(o){return"script[async]"+o}function uz(o,c,h){if(c.count++,c.instance===null)switch(c.type){case"style":var y=o.querySelector('style[data-href~="'+Ni(h.href)+'"]');if(y)return c.instance=y,yn(y),y;var w=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return y=(o.ownerDocument||o).createElement("style"),yn(y),ur(y,"style",w),Cm(y,h.precedence,o),c.instance=y;case"stylesheet":w=au(h.href);var N=o.querySelector(wf(w));if(N)return c.state.loading|=4,c.instance=N,yn(N),N;y=cz(h),(w=Ti.get(w))&&Qb(y,w),N=(o.ownerDocument||o).createElement("link"),yn(N);var z=N;return z._p=new Promise(function(L,K){z.onload=L,z.onerror=K}),ur(N,"link",y),c.state.loading|=4,Cm(N,h.precedence,o),c.instance=N;case"script":return N=su(h.src),(w=o.querySelector(jf(N)))?(c.instance=w,yn(w),w):(y=h,(w=Ti.get(N))&&(y=m({},h),Wb(y,w)),o=o.ownerDocument||o,w=o.createElement("script"),yn(w),ur(w,"link",y),o.head.appendChild(w),c.instance=w);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(y=c.instance,c.state.loading|=4,Cm(y,h.precedence,o));return c.instance}function Cm(o,c,h){for(var y=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),w=y.length?y[y.length-1]:null,N=w,z=0;z<y.length;z++){var L=y[z];if(L.dataset.precedence===c)N=L;else if(N!==w)break}N?N.parentNode.insertBefore(o,N.nextSibling):(c=h.nodeType===9?h.head:h,c.insertBefore(o,c.firstChild))}function Qb(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.title==null&&(o.title=c.title)}function Wb(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.integrity==null&&(o.integrity=c.integrity)}var Am=null;function dz(o,c,h){if(Am===null){var y=new Map,w=Am=new Map;w.set(h,y)}else w=Am,y=w.get(h),y||(y=new Map,w.set(h,y));if(y.has(o))return y;for(y.set(o,null),h=h.getElementsByTagName(o),w=0;w<h.length;w++){var N=h[w];if(!(N[il]||N[nt]||o==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var z=N.getAttribute(c)||"";z=o+z;var L=y.get(z);L?L.push(N):y.set(z,[N])}}return y}function fz(o,c,h){o=o.ownerDocument||o,o.head.insertBefore(h,c==="title"?o.querySelector("head > title"):null)}function rK(o,c,h){if(h===1||c.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;return c.rel==="stylesheet"?(o=c.disabled,typeof c.precedence=="string"&&o==null):!0;case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function hz(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function iK(o,c,h,y){if(h.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var w=au(y.href),N=c.querySelector(wf(w));if(N){c=N._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(o.count++,o=Om.bind(o),c.then(o,o)),h.state.loading|=4,h.instance=N,yn(N);return}N=c.ownerDocument||c,y=cz(y),(w=Ti.get(w))&&Qb(y,w),N=N.createElement("link"),yn(N);var z=N;z._p=new Promise(function(L,K){z.onload=L,z.onerror=K}),ur(N,"link",y),h.instance=N}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(h,c),(c=h.state.preload)&&(h.state.loading&3)===0&&(o.count++,h=Om.bind(o),c.addEventListener("load",h),c.addEventListener("error",h))}}var Yb=0;function aK(o,c){return o.stylesheets&&o.count===0&&_m(o,o.stylesheets),0<o.count||0<o.imgCount?function(h){var y=setTimeout(function(){if(o.stylesheets&&_m(o,o.stylesheets),o.unsuspend){var N=o.unsuspend;o.unsuspend=null,N()}},6e4+c);0<o.imgBytes&&Yb===0&&(Yb=62500*$H());var w=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&_m(o,o.stylesheets),o.unsuspend)){var N=o.unsuspend;o.unsuspend=null,N()}},(o.imgBytes>Yb?50:800)+c);return o.unsuspend=h,function(){o.unsuspend=null,clearTimeout(y),clearTimeout(w)}}:null}function Om(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_m(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Em=null;function _m(o,c){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Em=new Map,c.forEach(sK,o),Em=null,Om.call(o))}function sK(o,c){if(!(c.state.loading&4)){var h=Em.get(o);if(h)var y=h.get(null);else{h=new Map,Em.set(o,h);for(var w=o.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<w.length;N++){var z=w[N];(z.nodeName==="LINK"||z.getAttribute("media")!=="not all")&&(h.set(z.dataset.precedence,z),y=z)}y&&h.set(null,y)}w=c.instance,z=w.getAttribute("data-precedence"),N=h.get(z)||y,N===y&&h.set(null,w),h.set(z,w),this.count++,y=Om.bind(this),w.addEventListener("load",y),w.addEventListener("error",y),N?N.parentNode.insertBefore(w,N.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(w,o.firstChild)),c.state.loading|=4}}var Sf={$$typeof:C,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function oK(o,c,h,y,w,N,z,L,K){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Gs(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gs(0),this.hiddenUpdates=Gs(null),this.identifierPrefix=y,this.onUncaughtError=w,this.onCaughtError=N,this.onRecoverableError=z,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function pz(o,c,h,y,w,N,z,L,K,ae,ge,we){return o=new oK(o,c,h,z,K,ae,ge,we,L),c=1,N===!0&&(c|=24),N=ai(3,null,null,c),o.current=N,N.stateNode=o,c=E0(),c.refCount++,o.pooledCache=c,c.refCount++,N.memoizedState={element:y,isDehydrated:h,cache:c},P0(N),o}function mz(o){return o?(o=Ic,o):Ic}function gz(o,c,h,y,w,N){w=mz(w),y.context===null?y.context=w:y.pendingContext=w,y=ro(c),y.payload={element:h},N=N===void 0?null:N,N!==null&&(y.callback=N),h=io(o,y,c),h!==null&&(Gr(h,o,c),ef(h,o,c))}function yz(o,c){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var h=o.retryLane;o.retryLane=h!==0&&h<c?h:c}}function Zb(o,c){yz(o,c),(o=o.alternate)&&yz(o,c)}function vz(o){if(o.tag===13||o.tag===31){var c=ul(o,67108864);c!==null&&Gr(c,o,67108864),Zb(o,67108864)}}function xz(o){if(o.tag===13||o.tag===31){var c=ui();c=Md(c);var h=ul(o,c);h!==null&&Gr(h,o,c),Zb(o,c)}}var zm=!0;function lK(o,c,h,y){var w=H.T;H.T=null;var N=J.p;try{J.p=2,Xb(o,c,h,y)}finally{J.p=N,H.T=w}}function cK(o,c,h,y){var w=H.T;H.T=null;var N=J.p;try{J.p=8,Xb(o,c,h,y)}finally{J.p=N,H.T=w}}function Xb(o,c,h,y){if(zm){var w=Jb(y);if(w===null)Lb(o,c,y,Tm,h),wz(o,y);else if(dK(w,o,c,h,y))y.stopPropagation();else if(wz(o,y),c&4&&-1<uK.indexOf(o)){for(;w!==null;){var N=Ji(w);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var z=En(N.pendingLanes);if(z!==0){var L=N;for(L.pendingLanes|=2,L.entangledLanes|=2;z;){var K=1<<31-de(z);L.entanglements[1]|=K,z&=~K}Aa(N),(zt&6)===0&&(pm=mt()+500,yf(0))}}break;case 31:case 13:L=ul(N,2),L!==null&&Gr(L,N,2),gm(),Zb(N,2)}if(N=Jb(y),N===null&&Lb(o,c,y,Tm,h),N===w)break;w=N}w!==null&&y.stopPropagation()}else Lb(o,c,y,null,h)}}function Jb(o){return o=t0(o),ew(o)}var Tm=null;function ew(o){if(Tm=null,o=ji(o),o!==null){var c=a(o);if(c===null)o=null;else{var h=c.tag;if(h===13){if(o=l(c),o!==null)return o;o=null}else if(h===31){if(o=u(c),o!==null)return o;o=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;o=null}else c!==o&&(o=null)}}return Tm=o,null}function bz(o){switch(o){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(et()){case ce:return 2;case Ne:return 8;case Me:case Ge:return 32;case pt:return 268435456;default:return 32}default:return 32}}var tw=!1,go=null,yo=null,vo=null,Nf=new Map,kf=new Map,xo=[],uK="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 wz(o,c){switch(o){case"focusin":case"focusout":go=null;break;case"dragenter":case"dragleave":yo=null;break;case"mouseover":case"mouseout":vo=null;break;case"pointerover":case"pointerout":Nf.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":kf.delete(c.pointerId)}}function Cf(o,c,h,y,w,N){return o===null||o.nativeEvent!==N?(o={blockedOn:c,domEventName:h,eventSystemFlags:y,nativeEvent:N,targetContainers:[w]},c!==null&&(c=Ji(c),c!==null&&vz(c)),o):(o.eventSystemFlags|=y,c=o.targetContainers,w!==null&&c.indexOf(w)===-1&&c.push(w),o)}function dK(o,c,h,y,w){switch(c){case"focusin":return go=Cf(go,o,c,h,y,w),!0;case"dragenter":return yo=Cf(yo,o,c,h,y,w),!0;case"mouseover":return vo=Cf(vo,o,c,h,y,w),!0;case"pointerover":var N=w.pointerId;return Nf.set(N,Cf(Nf.get(N)||null,o,c,h,y,w)),!0;case"gotpointercapture":return N=w.pointerId,kf.set(N,Cf(kf.get(N)||null,o,c,h,y,w)),!0}return!1}function jz(o){var c=ji(o.target);if(c!==null){var h=a(c);if(h!==null){if(c=h.tag,c===13){if(c=l(h),c!==null){o.blockedOn=c,Q(o.priority,function(){xz(h)});return}}else if(c===31){if(c=u(h),c!==null){o.blockedOn=c,Q(o.priority,function(){xz(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){o.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Pm(o){if(o.blockedOn!==null)return!1;for(var c=o.targetContainers;0<c.length;){var h=Jb(o.nativeEvent);if(h===null){h=o.nativeEvent;var y=new h.constructor(h.type,h);e0=y,h.target.dispatchEvent(y),e0=null}else return c=Ji(h),c!==null&&vz(c),o.blockedOn=h,!1;c.shift()}return!0}function Sz(o,c,h){Pm(o)&&h.delete(c)}function fK(){tw=!1,go!==null&&Pm(go)&&(go=null),yo!==null&&Pm(yo)&&(yo=null),vo!==null&&Pm(vo)&&(vo=null),Nf.forEach(Sz),kf.forEach(Sz)}function Rm(o,c){o.blockedOn===c&&(o.blockedOn=null,tw||(tw=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,fK)))}var Dm=null;function Nz(o){Dm!==o&&(Dm=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Dm===o&&(Dm=null);for(var c=0;c<o.length;c+=3){var h=o[c],y=o[c+1],w=o[c+2];if(typeof y!="function"){if(ew(y||h)===null)continue;break}var N=Ji(h);N!==null&&(o.splice(c,3),c-=3,J0(N,{pending:!0,data:w,method:h.method,action:y},y,w))}}))}function ou(o){function c(K){return Rm(K,o)}go!==null&&Rm(go,o),yo!==null&&Rm(yo,o),vo!==null&&Rm(vo,o),Nf.forEach(c),kf.forEach(c);for(var h=0;h<xo.length;h++){var y=xo[h];y.blockedOn===o&&(y.blockedOn=null)}for(;0<xo.length&&(h=xo[0],h.blockedOn===null);)jz(h),h.blockedOn===null&&xo.shift();if(h=(o.ownerDocument||o).$$reactFormReplay,h!=null)for(y=0;y<h.length;y+=3){var w=h[y],N=h[y+1],z=w[St]||null;if(typeof N=="function")z||Nz(h);else if(z){var L=null;if(N&&N.hasAttribute("formAction")){if(w=N,z=N[St]||null)L=z.formAction;else if(ew(w)!==null)continue}else L=z.action;typeof L=="function"?h[y+1]=L:(h.splice(y,3),y-=3),Nz(h)}}}function kz(){function o(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(z){return w=z})},focusReset:"manual",scroll:"manual"})}function c(){w!==null&&(w(),w=null),y||setTimeout(h,20)}function h(){if(!y&&!navigation.transition){var N=navigation.currentEntry;N&&N.url!=null&&navigation.navigate(N.url,{state:N.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var y=!1,w=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(h,100),function(){y=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),w!==null&&(w(),w=null)}}}function nw(o){this._internalRoot=o}Mm.prototype.render=nw.prototype.render=function(o){var c=this._internalRoot;if(c===null)throw Error(r(409));var h=c.current,y=ui();gz(h,y,o,c,null,null)},Mm.prototype.unmount=nw.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var c=o.containerInfo;gz(o.current,2,null,o,null,null),gm(),c[_n]=null}};function Mm(o){this._internalRoot=o}Mm.prototype.unstable_scheduleHydration=function(o){if(o){var c=Ld();o={blockedOn:null,target:o,priority:c};for(var h=0;h<xo.length&&c!==0&&c<xo[h].priority;h++);xo.splice(h,0,o),h===0&&jz(o)}};var Cz=t.version;if(Cz!=="19.2.4")throw Error(r(527,Cz,"19.2.4"));J.findDOMNode=function(o){var c=o._reactInternals;if(c===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=f(c),o=o!==null?p(o):null,o=o===null?null:o.stateNode,o};var hK={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Im=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Im.isDisabled&&Im.supportsFiber)try{gn=Im.inject(hK),We=Im}catch{}}return Of.createRoot=function(o,c){if(!i(o))throw Error(r(299));var h=!1,y="",w=PE,N=RE,z=DE;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(w=c.onUncaughtError),c.onCaughtError!==void 0&&(N=c.onCaughtError),c.onRecoverableError!==void 0&&(z=c.onRecoverableError)),c=pz(o,1,!1,null,null,h,y,null,w,N,z,kz),o[_n]=c.current,Ib(o),new nw(c)},Of.hydrateRoot=function(o,c,h){if(!i(o))throw Error(r(299));var y=!1,w="",N=PE,z=RE,L=DE,K=null;return h!=null&&(h.unstable_strictMode===!0&&(y=!0),h.identifierPrefix!==void 0&&(w=h.identifierPrefix),h.onUncaughtError!==void 0&&(N=h.onUncaughtError),h.onCaughtError!==void 0&&(z=h.onCaughtError),h.onRecoverableError!==void 0&&(L=h.onRecoverableError),h.formState!==void 0&&(K=h.formState)),c=pz(o,1,!0,c,h??null,y,w,K,N,z,L,kz),c.context=mz(null),h=c.current,y=ui(),y=Md(y),w=ro(y),w.callback=null,io(h,w,y),h=y,c.current.lanes=h,Vs(c,h),Aa(c),o[_n]=c.current,Ib(o),new Mm(c)},Of.version="19.2.4",Of}var Mz;function SK(){if(Mz)return aw.exports;Mz=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(),aw.exports=jK(),aw.exports}var NK=SK(),gc=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(){}},kK={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},CK=class{#t=kK;#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)}},Dl=new CK;function AK(e){setTimeout(e,0)}var Jl=typeof window>"u"||"Deno"in globalThis;function br(){}function OK(e,t){return typeof e=="function"?e(t):e}function PS(e){return typeof e=="number"&&e>=0&&e!==1/0}function qL(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Mo(e,t){return typeof e=="function"?e(t):e}function Ii(e,t){return typeof e=="function"?e(t):e}function Iz(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:l,stale:u}=e;if(l){if(r){if(t.queryHash!==CN(l,t.options))return!1}else if(!mh(t.queryKey,l))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||i&&i!==t.state.fetchStatus||a&&!a(t))}function Lz(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ec(t.options.mutationKey)!==ec(a))return!1}else if(!mh(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function CN(e,t){return(t?.queryKeyHashFn||ec)(e)}function ec(e){return JSON.stringify(e,(t,n)=>RS(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function mh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>mh(e[n],t[n])):!1}var EK=Object.prototype.hasOwnProperty;function AN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=$z(e)&&$z(t);if(!r&&!(RS(e)&&RS(t)))return t;const a=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),u=l.length,d=r?new Array(u):{};let f=0;for(let p=0;p<u;p++){const m=r?p:l[p],g=e[m],v=t[m];if(g===v){d[m]=g,(r?p<a:EK.call(e,m))&&f++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){d[m]=v;continue}const j=AN(g,v,n+1);d[m]=j,j===g&&f++}return a===u&&f===a?e:d}function gh(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 $z(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function RS(e){if(!Bz(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Bz(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Bz(e){return Object.prototype.toString.call(e)==="[object Object]"}function _K(e){return new Promise(t=>{Dl.setTimeout(t,e)})}function DS(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?AN(e,t):t}function zK(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function TK(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ON=Symbol();function FL(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ON?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function EN(e,t){return typeof e=="function"?e(...t):!!e}function PK(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var RK=class extends gc{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Jl&&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"}},_N=new RK;function MS(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var DK=AK;function MK(){let e=[],t=0,n=u=>{u()},r=u=>{u()},i=DK;const a=u=>{t?e.push(u):i(()=>{n(u)})},l=()=>{const u=e;e=[],u.length&&i(()=>{r(()=>{u.forEach(d=>{n(d)})})})};return{batch:u=>{let d;t++;try{d=u()}finally{t--,t||l()}return d},batchCalls:u=>(...d)=>{a(()=>{u(...d)})},schedule:a,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var Cn=MK(),IK=class extends gc{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Jl&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#t}},Vg=new IK;function LK(e){return Math.min(1e3*2**e,3e4)}function HL(e){return(e??"online")==="online"?Vg.isOnline():!0}var IS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function KL(e){let t=!1,n=0,r;const i=MS(),a=()=>i.status!=="pending",l=b=>{if(!a()){const S=new IS(b);g(S),e.onCancel?.(S)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>_N.isFocused()&&(e.networkMode==="always"||Vg.isOnline())&&e.canRun(),p=()=>HL(e.networkMode)&&e.canRun(),m=b=>{a()||(r?.(),i.resolve(b))},g=b=>{a()||(r?.(),i.reject(b))},v=()=>new Promise(b=>{r=S=>{(a()||f())&&b(S)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),j=()=>{if(a())return;let b;const S=n===0?e.initialPromise:void 0;try{b=S??e.fn()}catch(k){b=Promise.reject(k)}Promise.resolve(b).then(m).catch(k=>{if(a())return;const E=e.retry??(Jl?0:3),C=e.retryDelay??LK,A=typeof C=="function"?C(n,k):C,T=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,k);if(t||!T){g(k);return}n++,e.onFail?.(n,k),_K(A).then(()=>f()?void 0:v()).then(()=>{t?g(k):j()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r?.(),i),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?j():v().then(j),i)}}var GL=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),PS(this.gcTime)&&(this.#t=Dl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Jl?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Dl.clearTimeout(this.#t),this.#t=void 0)}},$K=class extends GL{#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=qz(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=qz(this.options);t.data!==void 0&&(this.setState(Uz(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=DS(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(br).catch(br):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Ii(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ON||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Mo(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:!qL(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const u=this.observers.find(d=>d.options.queryFn);u&&this.setOptions(u.options)}const n=new AbortController,r=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const u=FL(this.options,t),f=(()=>{const p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#o=!1,this.options.persister?this.options.persister(u,f,this):u(f)},l=(()=>{const u={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(u),u})();this.options.behavior?.onFetch(l,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#s({type:"fetch",meta:l.fetchOptions?.meta}),this.#r=KL({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:u=>{u instanceof IS&&u.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(u,d)=>{this.#s({type:"failed",failureCount:u,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const u=await this.#r.start();if(u===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(u),this.#n.config.onSuccess?.(u,this),this.#n.config.onSettled?.(u,this.state.error,this),u}catch(u){if(u instanceof IS){if(u.silent)return this.#r.promise;if(u.revert){if(this.state.data===void 0)throw u;return this.state.data}}throw this.#s({type:"error",error:u}),this.#n.config.onError?.(u,this),this.#n.config.onSettled?.(this.state.data,u,this),u}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...VL(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Uz(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Cn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function VL(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:HL(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Uz(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function qz(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 zN=class extends gc{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=MS(),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),Fz(this.#e,this.options)?this.#m():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return LS(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return LS(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#w(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,n=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ii(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#e.setOptions(this.options),t._defaulted&&!gh(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&Hz(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||Ii(this.options.enabled,this.#e)!==Ii(t.enabled,this.#e)||Mo(this.options.staleTime,this.#e)!==Mo(t.staleTime,this.#e))&&this.#g();const i=this.#y();r&&(this.#e!==n||Ii(this.options.enabled,this.#e)!==Ii(t.enabled,this.#e)||i!==this.#l)&&this.#v(i)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return UK(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.#j();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(br)),t}#g(){this.#b();const e=Mo(this.options.staleTime,this.#e);if(Jl||this.#i.isStale||!PS(e))return;const n=qL(this.#i.dataUpdatedAt,e)+1;this.#c=Dl.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(Jl||Ii(this.options.enabled,this.#e)===!1||!PS(this.#l)||this.#l===0)&&(this.#u=Dl.setInterval(()=>{(this.options.refetchIntervalInBackground||_N.isFocused())&&this.#m()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(Dl.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Dl.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,i=this.#i,a=this.#r,l=this.#a,d=e!==n?e.state:this.#n,{state:f}=e;let p={...f},m=!1,g;if(t._optimisticResults){const P=this.hasListeners(),$=!P&&Fz(e,t),F=P&&Hz(e,n,t,r);($||F)&&(p={...p,...VL(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:j,status:b}=p;g=p.data;let S=!1;if(t.placeholderData!==void 0&&g===void 0&&b==="pending"){let P;i?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(P=i.data,S=!0):P=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,P!==void 0&&(b="success",g=DS(i?.data,P,t),m=!0)}if(t.select&&g!==void 0&&!S)if(i&&g===a?.data&&t.select===this.#p)g=this.#d;else try{this.#p=t.select,g=t.select(g),g=DS(i?.data,g,t),this.#d=g,this.#s=null}catch(P){this.#s=P}this.#s&&(v=this.#s,g=this.#d,j=Date.now(),b="error");const k=p.fetchStatus==="fetching",E=b==="pending",C=b==="error",A=E&&k,T=g!==void 0,_={status:b,fetchStatus:p.fetchStatus,isPending:E,isSuccess:b==="success",isError:C,isInitialLoading:A,isLoading:A,data:g,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:j,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:k,isRefetching:k&&!E,isLoadingError:C&&!T,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:C&&T,isStale:TN(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Ii(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const P=_.data!==void 0,$=_.status==="error"&&!P,F=V=>{$?V.reject(_.error):P&&V.resolve(_.data)},U=()=>{const V=this.#o=_.promise=MS();F(V)},B=this.#o;switch(B.status){case"pending":e.queryHash===n.queryHash&&F(B);break;case"fulfilled":($||_.data!==B.value)&&U();break;case"rejected":(!$||_.error!==B.reason)&&U();break}}return _}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#a=this.options,this.#r.data!==void 0&&(this.#f=this.#e),gh(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#h.size)return!0;const a=new Set(i??this.#h);return this.options.throwOnError&&a.add("error"),Object.keys(this.#i).some(l=>{const u=l;return this.#i[u]!==e[u]&&a.has(u)})};this.#S({listeners:n()})}#j(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#S(e){Cn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function BK(e,t){return Ii(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Fz(e,t){return BK(e,t)||e.state.data!==void 0&&LS(e,t,t.refetchOnMount)}function LS(e,t,n){if(Ii(t.enabled,e)!==!1&&Mo(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&TN(e,t)}return!1}function Hz(e,t,n,r){return(e!==t||Ii(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&TN(e,n)}function TN(e,t){return Ii(t.enabled,e)!==!1&&e.isStaleByTime(Mo(t.staleTime,e))}function UK(e,t){return!gh(e.getCurrentResult(),t)}function Kz(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},d=0;const f=async()=>{let p=!1;const m=j=>{PK(j,()=>t.signal,()=>p=!0)},g=FL(t.options,t.fetchOptions),v=async(j,b,S)=>{if(p)return Promise.reject();if(b==null&&j.pages.length)return Promise.resolve(j);const E=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:b,direction:S?"backward":"forward",meta:t.options.meta};return m(O),O})(),C=await g(E),{maxPages:A}=t.options,T=S?TK:zK;return{pages:T(j.pages,C,A),pageParams:T(j.pageParams,b,A)}};if(i&&a.length){const j=i==="backward",b=j?qK:Gz,S={pages:a,pageParams:l},k=b(r,S);u=await v(S,k,j)}else{const j=e??a.length;do{const b=d===0?l[0]??r.initialPageParam:Gz(r,u);if(d>0&&b==null)break;u=await v(u,b),d++}while(d<j)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function Gz(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 qK(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var FK=class extends GL{#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||QL(),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=KL({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,l)=>{this.#r({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const l=await this.options.onMutate?.(e,n);l!==this.state.context&&this.#r({type:"pending",context:l,variables:e,isPaused:i})}const a=await this.#i.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(l){Promise.reject(l)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(l){Promise.reject(l)}throw this.#r({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Cn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function QL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var WL=class extends gc{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 FK({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#t.add(e);const t=Lm(e);if(typeof t=="string"){const n=this.#e.get(t);n?n.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=Lm(e);if(typeof t=="string"){const n=this.#e.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Lm(e);if(typeof t=="string"){const r=this.#e.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Lm(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Cn.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Lz(t,n))}findAll(e={}){return this.getAll().filter(t=>Lz(e,t))}notify(e){Cn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Cn.batch(()=>Promise.all(e.map(t=>t.continue().catch(br))))}};function Lm(e){return e.options.scope?.id}var HK=class extends gc{#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),gh(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&ec(n.mutationKey)!==ec(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??QL();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){Cn.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#e.variables,r=this.#e.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,r,i)}catch(a){Promise.reject(a)}try{this.#i.onSettled?.(t.data,null,n,r,i)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,r,i)}catch(a){Promise.reject(a)}try{this.#i.onSettled?.(void 0,t.error,n,r,i)}catch(a){Promise.reject(a)}}}this.listeners.forEach(n=>{n(this.#e)})})}};function Vz(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function KK(e,t,n){const r=e.slice(0);return r[t]=n,r}var GK=class extends gc{#t;#e;#n;#i;#r;#a;#o;#s;#p;#d=[];constructor(e,t,n){super(),this.#t=e,this.#i=n,this.#n=[],this.#r=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#r.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#r.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#i=t,Cn.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const i=r.map(p=>p.observer),a=i.map(p=>p.getCurrentResult()),l=n.length!==i.length,u=i.some((p,m)=>p!==n[m]),d=l||u,f=d?!0:a.some((p,m)=>{const g=this.#e[m];return!g||!gh(p,g)});!d&&!f||(d&&(this.#d=r,this.#r=i),this.#e=a,this.hasListeners()&&(d&&(Vz(n,i).forEach(p=>{p.destroy()}),Vz(i,n).forEach(p=>{p.subscribe(m=>{this.#l(p,m)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,t){const n=this.#u(e),r=n.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=n.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#c(a??r,t,i),()=>this.#f(r,n)]}#f(e,t){return t.map((n,r)=>{const i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,a=>{t.forEach(l=>{l.observer.trackProp(a)})})})}#c(e,t,n){if(t){const r=this.#p,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((a,l)=>a!==r[l]));return(!this.#a||this.#e!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#e,n!==void 0&&(this.#p=n),this.#a=AN(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#r.forEach(r=>{const i=r.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(r):t.set(i,[r])});const n=[];return e.forEach(r=>{const i=this.#t.defaultQueryOptions(r),l=t.get(i.queryHash)?.shift()??new zN(this.#t,i);n.push({defaultedQueryOptions:i,observer:l})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=KK(this.#e,n,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#e,this.#d),n=this.#c(t,this.#i?.combine);e!==n&&Cn.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},VK=class extends gc{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??CN(r,t);let a=this.get(i);return a||(a=new $K({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Cn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Iz(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Iz(e,n)):t}notify(e){Cn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Cn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Cn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},QK=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new VK,this.#e=e.mutationCache||new WL,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=_N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=Vg.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#t.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Mo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=this.#t.get(r.queryHash)?.state.data,l=OK(t,a);if(l!==void 0)return this.#t.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Cn.batch(()=>this.#t.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;Cn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return Cn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Cn.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(br).catch(br)}invalidateQueries(e,t={}){return Cn.batch(()=>(this.#t.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Cn.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(br)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(br)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(Mo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(br).catch(br)}fetchInfiniteQuery(e){return e.behavior=Kz(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(br).catch(br)}ensureInfiniteQueryData(e){return e.behavior=Kz(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Vg.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(ec(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{mh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(ec(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{mh(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=CN(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===ON&&(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()}},YL=x.createContext(void 0),xi=e=>{const t=x.useContext(YL);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},WK=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(YL.Provider,{value:e,children:t})),ZL=x.createContext(!1),XL=()=>x.useContext(ZL);ZL.Provider;function YK(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ZK=x.createContext(YK()),JL=()=>x.useContext(ZK),e5=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?EN(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},t5=e=>{x.useEffect(()=>{e.clearReset()},[e])},n5=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||EN(n,[e.error,r])),r5=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))}},XK=(e,t)=>e.isLoading&&e.isFetching&&!t,$S=(e,t)=>e?.suspense&&t.isPending,BS=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function JK({queries:e,...t},n){const r=xi(),i=XL(),a=JL(),l=x.useMemo(()=>e.map(b=>{const S=r.defaultQueryOptions(b);return S._optimisticResults=i?"isRestoring":"optimistic",S}),[e,r,i]);l.forEach(b=>{r5(b);const S=r.getQueryCache().get(b.queryHash);e5(b,a,S)}),t5(a);const[u]=x.useState(()=>new GK(r,l,t)),[d,f,p]=u.getOptimisticResult(l,t.combine),m=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(b=>m?u.subscribe(Cn.batchCalls(b)):br,[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),x.useEffect(()=>{u.setQueries(l,t)},[l,t,u]);const v=d.some((b,S)=>$S(l[S],b))?d.flatMap((b,S)=>{const k=l[S];if(k&&$S(k,b)){const E=new zN(r,k);return BS(k,E,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const j=d.find((b,S)=>{const k=l[S];return k&&n5({result:b,errorResetBoundary:a,throwOnError:k.throwOnError,query:r.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(j?.error)throw j.error;return f(p())}function e7(e,t,n){const r=XL(),i=JL(),a=xi(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const u=a.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",r5(l),e5(l,i,u),t5(i);const d=!a.getQueryCache().get(l.queryHash),[f]=x.useState(()=>new t(a,l)),p=f.getOptimisticResult(l),m=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(g=>{const v=m?f.subscribe(Cn.batchCalls(g)):br;return f.updateResult(),v},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setOptions(l)},[l,f]),$S(l,p))throw BS(l,f,i);if(n5({result:p,errorResetBoundary:i,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(l,p),l.experimental_prefetchInRender&&!Jl&&XK(p,r)&&(d?BS(l,f,i):u?.promise)?.catch(br).finally(()=>{f.updateResult()}),l.notifyOnChangeProps?p:f.trackResult(p)}function ua(e,t){return e7(e,zN)}function Fh(e,t){const n=xi(),[r]=x.useState(()=>new HK(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(l=>r.subscribe(Cn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((l,u)=>{r.mutate(l,u).catch(br)},[r]);if(i.error&&EN(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var $m=typeof window<"u"?x.useLayoutEffect:x.useEffect;function cw(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 t7(e,t,n={},r={}){x.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([a])=>{t(a)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function n7(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}var r7=!1;function yh(e){return e[e.length-1]}function i7(e){return typeof e=="function"}function To(e,t){return i7(e)?e(t):e}var a7=Object.prototype.hasOwnProperty,Qz=Object.prototype.propertyIsEnumerable,s7=()=>Object.create(null),Sl=(e,t)=>Ml(e,t,s7);function Ml(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=Zz(e)&&Zz(i);if(!a&&!(Qg(e)&&Qg(i)))return i;const l=a?e:Wz(e);if(!l)return i;const u=a?i:Wz(i);if(!u)return i;const d=l.length,f=u.length,p=a?new Array(f):n();let m=0;for(let g=0;g<f;g++){const v=a?g:u[g],j=e[v],b=i[v];if(j===b){p[v]=j,(a?g<d:a7.call(e,v))&&m++;continue}if(j===null||b===null||typeof j!="object"||typeof b!="object"){p[v]=b;continue}const S=Ml(j,b,n,r+1);p[v]=S,S===j&&m++}return d===f&&m===d?e:p}function Wz(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!Qz.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(!Qz.call(e,i))return!1;r.push(i)}return r}function Qg(e){if(!Yz(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Yz(n)||!n.hasOwnProperty("isPrototypeOf"))}function Yz(e){return Object.prototype.toString.call(e)==="[object Object]"}function Zz(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Kl(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(!Kl(e[r],t[r],n))return!1;return!0}if(Qg(e)&&Qg(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!Kl(e[l],t[l],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let a=0;for(const l in t)if((!r||t[l]!==void 0)&&(a++,a>i||!Kl(e[l],t[l],n)))return!1;return i===a}return!1}function Qu(e){let t,n;const r=new Promise((i,a)=>{t=i,n=a});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function vh(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function o7(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Xz(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 o7(t)}var l7=["http:","https:","mailto:","tel:"];function Wg(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Ef(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",i;for(;(i=t.exec(e))!==null;)r+=Xz(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+Xz(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function c7(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Yg(e){const t=new Map;let n,r;const i=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,n=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const l=t.get(a);if(l)return i(l),l.value},set(a,l){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const u=t.get(a);if(u)u.value=l,i(u);else{const d={key:a,value:l,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,r=void 0}}}var u7="Invariant failed";function _s(e,t){if(!e)throw new Error(u7)}var Il=4,i5=5;function d7(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 PN(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a==="$"){const u=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=u,n[4]=u,n[5]=u,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=d7(a);if(l){const[u,d]=l,f=a.charCodeAt(u+1);if(f===45){if(u+2<a.length&&a.charCodeAt(u+2)===36){const p=u+3,m=d;if(p<m)return n[0]=3,n[1]=t+u,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=i,n}}else if(f===36){const p=u+1,m=u+2;return m===d?(n[0]=2,n[1]=t+u,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=e.length,n):(n[0]=1,n[1]=t+u,n[2]=t+m,n[3]=t+d,n[4]=t+d+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function wv(e,t,n,r,i,a,l){l?.(n);let u=r;{const d=n.fullPath??n.from,f=d.length,p=n.options?.caseSensitive??e,m=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;u<f;){const v=PN(d,u,t);let j;const b=u,S=v[5];switch(u=S+1,a++,v[0]){case 0:{const k=d.substring(v[2],v[3]);if(p){const E=i.static?.get(k);if(E)j=E;else{i.static??=new Map;const C=Ll(n.fullPath??n.from);C.parent=i,C.depth=a,j=C,i.static.set(k,C)}}else{const E=k.toLowerCase(),C=i.staticInsensitive?.get(E);if(C)j=C;else{i.staticInsensitive??=new Map;const A=Ll(n.fullPath??n.from);A.parent=i,A.depth=a,j=A,i.staticInsensitive.set(E,A)}}break}case 1:{const k=d.substring(b,v[1]),E=d.substring(v[4],S),C=p&&!!(k||E),A=k?C?k:k.toLowerCase():void 0,T=E?C?E:E.toLowerCase():void 0,O=!m&&i.dynamic?.find(_=>!_.skipOnParamError&&_.caseSensitive===C&&_.prefix===A&&_.suffix===T);if(O)j=O;else{const _=dw(1,n.fullPath??n.from,C,A,T);j=_,_.depth=a,_.parent=i,i.dynamic??=[],i.dynamic.push(_)}break}case 3:{const k=d.substring(b,v[1]),E=d.substring(v[4],S),C=p&&!!(k||E),A=k?C?k:k.toLowerCase():void 0,T=E?C?E:E.toLowerCase():void 0,O=!m&&i.optional?.find(_=>!_.skipOnParamError&&_.caseSensitive===C&&_.prefix===A&&_.suffix===T);if(O)j=O;else{const _=dw(3,n.fullPath??n.from,C,A,T);j=_,_.parent=i,_.depth=a,i.optional??=[],i.optional.push(_)}break}case 2:{const k=d.substring(b,v[1]),E=d.substring(v[4],S),C=p&&!!(k||E),A=k?C?k:k.toLowerCase():void 0,T=E?C?E:E.toLowerCase():void 0,O=dw(2,n.fullPath??n.from,C,A,T);j=O,O.parent=i,O.depth=a,i.wildcard??=[],i.wildcard.push(O)}}i=j}if(m&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const v=Ll(n.fullPath??n.from);v.kind=i5,v.parent=i,a++,v.depth=a,i.pathless??=[],i.pathless.push(v),i=v}const g=(n.path||!n.children)&&!n.isRoot;if(g&&d.endsWith("/")){const v=Ll(n.fullPath??n.from);v.kind=Il,v.parent=i,a++,v.depth=a,i.index=v,i=v}i.parse=n.options?.params?.parse??null,i.skipOnParamError=m,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,g&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)wv(e,t,d,u,i,a,l)}function uw(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 Co(e){if(e.pathless)for(const t of e.pathless)Co(t);if(e.static)for(const t of e.static.values())Co(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Co(t);if(e.dynamic?.length){e.dynamic.sort(uw);for(const t of e.dynamic)Co(t)}if(e.optional?.length){e.optional.sort(uw);for(const t of e.optional)Co(t)}if(e.wildcard?.length){e.wildcard.sort(uw);for(const t of e.wildcard)Co(t)}}function Ll(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 dw(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 f7(e,t){const n=Ll("/"),r=new Uint16Array(6);for(const i of e)wv(!1,r,i,1,n,0);Co(n),t.masksTree=n,t.flatCache=Yg(1e3)}function h7(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=RN(e,t.masksTree);return t.flatCache.set(e,r),r}function p7(e,t,n,r,i){e||="/",r||="/";const a=t?`case\0${e}`:e;let l=i.singleCache.get(a);return l||(l=Ll("/"),wv(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(a,l)),RN(r,l,n)}function m7(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||="/";let a;try{a=RN(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=v7(a.route)),t.matchCache.set(r,a),a}function g7(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function y7(e,t=!1,n){const r=Ll(e.fullPath),i=new Uint16Array(6),a={},l={};let u=0;return wv(t,i,e,1,r,0,d=>{if(n?.(d,u),_s(!(d.id in a),`Duplicate routes found with id: ${String(d.id)}`),a[d.id]=d,u!==0&&d.path){const f=g7(d.fullPath);(!l[f]||d.fullPath.endsWith("/"))&&(l[f]=d)}u++}),Co(r),{processedTree:{segmentTree:r,singleCache:Yg(1e3),matchCache:Yg(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function RN(e,t,n=!1){const r=e.split("/"),i=b7(e,r,t,n);if(!i)return null;const[a]=a5(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function a5(e,t,n){const r=x7(n.node);let i=null;const a=Object.create(null);let l=n.extract?.part??0,u=n.extract?.node??0,d=n.extract?.path??0,f=n.extract?.segment??0;for(;u<r.length;l++,u++,d++,f++){const p=r[u];if(p.kind===Il)break;if(p.kind===i5){f--,l--,d--;continue}const m=t[l],g=d;if(m&&(d+=m.length),p.kind===1){i??=n.node.fullPath.split("/");const v=i[f],j=p.prefix?.length??0;if(v.charCodeAt(j)===123){const b=p.suffix?.length??0,S=v.substring(j+2,v.length-b-1),k=m.substring(j,m.length-b);a[S]=decodeURIComponent(k)}else{const b=v.substring(1);a[b]=decodeURIComponent(m)}}else if(p.kind===3){if(n.skipped&1<<u){l--,d=g-1;continue}i??=n.node.fullPath.split("/");const v=i[f],j=p.prefix?.length??0,b=p.suffix?.length??0,S=v.substring(j+3,v.length-b-1),k=p.suffix||p.prefix?m.substring(j,m.length-b):m;k&&(a[S]=decodeURIComponent(k))}else if(p.kind===2){const v=p,j=e.substring(g+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),b=decodeURIComponent(j);a["*"]=b,a._splat=b;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:l,node:u,path:d,segment:f}]}function v7(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function x7(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function b7(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!yh(t),a=i&&e!=="/",l=t.length-(i?1:0),u=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let d=null,f=null,p=null;for(;u.length;){const m=u.pop(),{node:g,index:v,skipped:j,depth:b,statics:S,dynamics:k,optionals:E}=m;let{extract:C,rawParams:A,parsedParams:T}=m;if(g.skipOnParamError){if(!fw(e,t,m))continue;A=m.rawParams,C=m.extract,T=m.parsedParams}r&&g.route&&g.kind!==Il&&_f(f,m)&&(f=m);const O=v===l;if(O&&(g.route&&!a&&_f(p,m)&&(p=m),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const _=O?void 0:t[v];let P;if(O&&g.index){const $={node:g.index,index:v,skipped:j,depth:b+1,statics:S,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:T};let F=!0;if(g.index.skipOnParamError&&(fw(e,t,$)||(F=!1)),F){if(S===l&&!k&&!E&&!j)return $;_f(p,$)&&(p=$)}}if(g.wildcard&&_f(d,m))for(const $ of g.wildcard){const{prefix:F,suffix:U}=$;if(F&&(O||!($.caseSensitive?_:P??=_.toLowerCase()).startsWith(F)))continue;if(U){if(O)continue;const V=t.slice(v).join("/").slice(-U.length);if(($.caseSensitive?V:V.toLowerCase())!==U)continue}const B={node:$,index:l,skipped:j,depth:b,statics:S,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:T};if(!($.skipOnParamError&&!fw(e,t,B))){d=B;break}}if(g.optional){const $=j|1<<b,F=b+1;for(let U=g.optional.length-1;U>=0;U--){const B=g.optional[U];u.push({node:B,index:v,skipped:$,depth:F,statics:S,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:T})}if(!O)for(let U=g.optional.length-1;U>=0;U--){const B=g.optional[U],{prefix:V,suffix:X}=B;if(V||X){const Z=B.caseSensitive?_:P??=_.toLowerCase();if(V&&!Z.startsWith(V)||X&&!Z.endsWith(X))continue}u.push({node:B,index:v+1,skipped:j,depth:F,statics:S,dynamics:k,optionals:E+1,extract:C,rawParams:A,parsedParams:T})}}if(!O&&g.dynamic&&_)for(let $=g.dynamic.length-1;$>=0;$--){const F=g.dynamic[$],{prefix:U,suffix:B}=F;if(U||B){const V=F.caseSensitive?_:P??=_.toLowerCase();if(U&&!V.startsWith(U)||B&&!V.endsWith(B))continue}u.push({node:F,index:v+1,skipped:j,depth:b+1,statics:S,dynamics:k+1,optionals:E,extract:C,rawParams:A,parsedParams:T})}if(!O&&g.staticInsensitive){const $=g.staticInsensitive.get(P??=_.toLowerCase());$&&u.push({node:$,index:v+1,skipped:j,depth:b+1,statics:S+1,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:T})}if(!O&&g.static){const $=g.static.get(_);$&&u.push({node:$,index:v+1,skipped:j,depth:b+1,statics:S+1,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:T})}if(g.pathless){const $=b+1;for(let F=g.pathless.length-1;F>=0;F--){const U=g.pathless[F];u.push({node:U,index:v,skipped:j,depth:$,statics:S,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:T})}}}if(p&&d)return _f(d,p)?p:d;if(p)return p;if(d)return d;if(r&&f){let m=f.index;for(let v=0;v<f.index;v++)m+=t[v].length;const g=m===e.length?"/":e.slice(m);return f.rawParams??=Object.create(null),f.rawParams["**"]=decodeURIComponent(g),f}return null}function fw(e,t,n){try{const[r,i]=a5(e,t,n);n.rawParams=r,n.extract=i;const a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function _f(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===Il)>(e.node.kind===Il)||t.node.kind===Il==(e.node.kind===Il)&&t.depth>e.depth))):!0}function zg(e){return DN(e.filter(t=>t!==void 0).join("/"))}function DN(e){return e.replace(/\/{2,}/g,"/")}function s5(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Io(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function o5(e){return Io(s5(e))}function Zg(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function w7(e,t,n){return Zg(e,n)===Zg(t,n)}function j7({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),a=!i&&t===".";let l;if(r){l=i?t:a?e:e+"\0"+t;const m=r.get(l);if(m)return m}let u;if(a)u=e.split("/");else if(i)u=t.split("/");else{for(u=e.split("/");u.length>1&&yh(u)==="";)u.pop();const m=t.split("/");for(let g=0,v=m.length;g<v;g++){const j=m[g];j===""?g?g===v-1&&u.push(j):u=[j]:j===".."?u.pop():j==="."||u.push(j)}}u.length>1&&(yh(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));let d,f="";for(let m=0;m<u.length;m++){m>0&&(f+="/");const g=u[m];if(!g)continue;d=PN(g,0,d);const v=d[0];if(v===0){f+=g;continue}const j=d[5],b=g.substring(0,d[1]),S=g.substring(d[4],j),k=g.substring(d[2],d[3]);v===1?f+=b||S?`${b}{$${k}}${S}`:`$${k}`:v===2?f+=b||S?`${b}{$}${S}`:"$":f+=`${b}{-$${k}}${S}`}f=DN(f);const p=f||"/";return l&&r&&r.set(l,p),p}function S7(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return i=>i.replace(r,a=>t.get(a)??a)}function hw(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=>e2(i,n)).join("/"):e2(r,n)}function Jz({path:e,params:t,decoder:n,...r}){let i=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:i};const l=e.length;let u=0,d,f="";for(;u<l;){const p=u;d=PN(e,p,d);const m=d[5];if(u=m+1,p===m)continue;const g=d[0];if(g===0){f+="/"+e.substring(p,m);continue}if(g===2){const v=t._splat;a._splat=v,a["*"]=v;const j=e.substring(p,d[1]),b=e.substring(d[4],m);if(!v){i=!0,(j||b)&&(f+="/"+j+b);continue}const S=hw("_splat",t,n);f+="/"+j+S+b;continue}if(g===1){const v=e.substring(d[2],d[3]);!i&&!(v in t)&&(i=!0),a[v]=t[v];const j=e.substring(p,d[1]),b=e.substring(d[4],m),S=hw(v,t,n)??"undefined";f+="/"+j+S+b;continue}if(g===3){const v=e.substring(d[2],d[3]),j=t[v];if(j==null)continue;a[v]=j;const b=e.substring(p,d[1]),S=e.substring(d[4],m),k=hw(v,t,n)??"";f+="/"+b+k+S;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:i}}function e2(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function Dr(e){return!!e?.isNotFound}function N7(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var US="tsr-scroll-restoration-v1_3",k7=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function C7(){const e=N7();if(!e)return null;const t=e.getItem(US);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=To(r,n)||n;try{e.setItem(US,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Bm=C7(),A7=e=>e.state.__TSR_key||e.href;function O7(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}var Xg=!1;function E7({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const u=t||window.history.state?.__TSR_key,d=l[u];Xg=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const m in d){const g=d[m];if(m==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(m){const v=document.querySelector(m);v&&(v.scrollLeft=g.scrollX,v.scrollTop=g.scrollY)}}break e}const f=(a??window.location).hash.split("#",2)[1];if(f){const m=window.history.state?.__hashScrollIntoViewOptions??!0;if(m){const g=document.getElementById(f);g&&g.scrollIntoView(m)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),i)for(const m of i){if(m==="window")continue;const g=typeof m=="function"?m():document.querySelector(m);g&&g.scrollTo(p)}}Xg=!1}function _7(e,t){if(!Bm||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Bm))return;e.isScrollRestorationSetup=!0,Xg=!1;const n=e.options.getScrollRestorationKey||A7;window.history.scrollRestoration="manual";const r=i=>{if(Xg||!e.isScrollRestoring)return;let a="";if(i.target===document||i.target===window)a="window";else{const u=i.target.getAttribute("data-scroll-restoration-id");u?a=`[data-scroll-restoration-id="${u}"]`:a=O7(i.target)}const l=n(e.state.location);Bm.set(u=>{const d=u[l]||={},f=d[a]||={};if(a==="window")f.scrollX=window.scrollX||0,f.scrollY=window.scrollY||0;else if(a){const p=document.querySelector(a);p&&(f.scrollX=p.scrollLeft||0,f.scrollY=p.scrollTop||0)}return u})};typeof document<"u"&&document.addEventListener("scroll",k7(r,100),!0),e.subscribe("onRendered",i=>{const a=n(i.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(E7({storageKey:US,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Bm.set(l=>(l[a]||={},l)))})}function z7(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 T7(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 pw(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function P7(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,i]of t.entries()){const a=n[r];a==null?n[r]=pw(i):Array.isArray(a)?a.push(pw(i)):n[r]=[a,pw(i)]}return n}var R7=M7(JSON.parse),D7=I7(JSON.stringify,JSON.parse);function M7(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=P7(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function I7(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const a=T7(i,r);return a?`?${a}`:""}}var Gl="__root__";function MN(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 Qr(e){return e instanceof Response&&!!e.options}function L7(e){return{input:({url:t})=>{for(const n of e)t=qS(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=l5(e[n],t);return t}}}function $7(e){const t=o5(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const u=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return u===i?l.pathname="/":u.startsWith(a)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=zg(["/",t,l.pathname]),l)}}function qS(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 l5(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 dn=(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))(dn||{});function c5({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:l,shallowPropagate:u};function r(f,p,m){const g=p.depsTail;if(g!==void 0&&g.dep===f)return;const v=g!==void 0?g.nextDep:p.deps;if(v!==void 0&&v.dep===f){v.version=m,p.depsTail=v;return}const j=f.subsTail;if(j!==void 0&&j.version===m&&j.sub===p)return;const b=p.depsTail=f.subsTail={version:m,dep:f,sub:p,prevDep:g,nextDep:v,prevSub:j,nextSub:void 0};v!==void 0&&(v.prevDep=b),g!==void 0?g.nextDep=b:p.deps=b,j!==void 0?j.nextSub=b:f.subs=b}function i(f,p=f.sub){const m=f.dep,g=f.prevDep,v=f.nextDep,j=f.nextSub,b=f.prevSub;return v!==void 0?v.prevDep=g:p.depsTail=g,g!==void 0?g.nextDep=v:p.deps=v,j!==void 0?j.prevSub=b:m.subsTail=b,b!==void 0?b.nextSub=j:(m.subs=j)===void 0&&n(m),v}function a(f){let p=f.nextSub,m;e:do{const g=f.sub;let v=g.flags;if(v&60?v&12?v&4?!(v&48)&&d(f,g)?(g.flags=v|40,v&=1):v=0:g.flags=v&-9|32:v=0:g.flags=v|32,v&2&&t(g),v&1){const j=g.subs;if(j!==void 0){const b=(f=j).nextSub;b!==void 0&&(m={value:p,prev:m},p=b);continue}}if((f=p)!==void 0){p=f.nextSub;continue}for(;m!==void 0;)if(f=m.value,m=m.prev,f!==void 0){p=f.nextSub;continue e}break}while(!0)}function l(f,p){let m,g=0,v=!1;e:do{const j=f.dep,b=j.flags;if(p.flags&16)v=!0;else if((b&17)===17){if(e(j)){const S=j.subs;S.nextSub!==void 0&&u(S),v=!0}}else if((b&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(m={value:f,prev:m}),f=j.deps,p=j,++g;continue}if(!v){const S=f.nextDep;if(S!==void 0){f=S;continue}}for(;g--;){const S=p.subs,k=S.nextSub!==void 0;if(k?(f=m.value,m=m.prev):f=S,v){if(e(p)){k&&u(S),p=f.sub;continue}v=!1}else p.flags&=-33;p=f.sub;const E=f.nextDep;if(E!==void 0){f=E;continue e}}return v}while(!0)}function u(f){do{const p=f.sub,m=p.flags;(m&48)===32&&(p.flags=m|16,(m&6)===2&&t(p))}while((f=f.nextSub)!==void 0)}function d(f,p){let m=p.depsTail;for(;m!==void 0;){if(m===f)return!0;m=m.prevDep}return!1}}let IN=0,Nl=0,ih=0;const ws=[],{link:lze,unlink:u5,propagate:cze,checkDirty:B7,shallowPropagate:uze}=c5({update(e){return e.depsTail!==void 0?H7(e):K7(e)},notify(e){let t=ih,n=t;do if(ws[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(ih=t;n<--t;){const r=ws[n];ws[n++]=ws[t],ws[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,jv(e)):Q7.call(e)}});function U7(){return IN}function q7(){++IN}function F7(){--IN||V7()}function H7(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,jv(e)}}function K7(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function G7(e){const t=e.flags;if(t&16||t&32&&B7(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,jv(e)}}else e.flags=2}function V7(){try{for(;Nl<ih;){const e=ws[Nl];ws[Nl++]=void 0,G7(e)}}finally{for(;Nl<ih;){const e=ws[Nl];ws[Nl++]=void 0,e.flags|=10}Nl=0,ih=0}}function Q7(){this.depsTail=void 0,this.flags=0,jv(this);const e=this.subs;e!==void 0&&u5(e)}function jv(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=u5(n,e)}function LN(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 FS=[];let Tg=0;const{link:t2,unlink:W7,propagate:Y7,checkDirty:d5,shallowPropagate:n2}=c5({update(e){return e._update()},notify(e){FS[HS++]=e,e.flags&=~dn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=dn.Mutable|dn.Dirty,Jg(e))}});let Um=0,HS=0,Pa;function Jg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=W7(n,e)}function f5(){if(!(U7()>0)){for(;Um<HS;){const e=FS[Um];FS[Um++]=void 0,e.notify()}Um=0,HS=0}}function h5(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?dn.None:dn.Mutable,get(){return Pa!==void 0&&t2(i,Pa,Tg),i._snapshot},subscribe(a){const l=LN(a),u={current:!1},d=Z7(()=>{i.get(),u.current?l.next?.(i._snapshot):u.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=Pa,u=Object.is;if(n)Pa=i,++Tg,i.depsTail=void 0;else if(a===void 0)return!1;n&&(i.flags=dn.Mutable|dn.RecursedCheck);try{const d=i._snapshot,f=typeof a=="function"?a(d):a===void 0&&n?r(d):a;return d===void 0||!u(d,f)?(i._snapshot=f,!0):!1}finally{Pa=l,n&&(i.flags&=~dn.RecursedCheck),Jg(i)}}};return n?(i.flags=dn.Mutable|dn.Dirty,i.get=function(){const a=i.flags;if(a&dn.Dirty||a&dn.Pending&&d5(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&n2(l)}}else a&dn.Pending&&(i.flags=a&~dn.Pending);return Pa!==void 0&&t2(i,Pa,Tg),i._snapshot}):i.set=function(a){if(i._update(a)){const l=i.subs;l!==void 0&&(Y7(l),n2(l),f5())}},i}function Z7(e){const t=()=>{const r=Pa;Pa=n,++Tg,n.depsTail=void 0,n.flags=dn.Watching|dn.RecursedCheck;try{return e()}finally{Pa=r,n.flags&=~dn.RecursedCheck,Jg(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:dn.Watching|dn.RecursedCheck,notify(){const r=this.flags;r&dn.Dirty||r&dn.Pending&&d5(this.deps,this)?t():this.flags=dn.Watching},stop(){this.flags=dn.None,this.depsTail=void 0,Jg(this)}};return t(),n}class X7{constructor(t){this.atom=h5(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(LN(t))}}class J7{constructor(t){this.atom=h5(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(LN(t))}}function eG(e){return typeof e=="function"?new J7(e):new X7(e)}function tG(e){try{q7(),e()}finally{F7(),f5()}}function ah(e){let t;return tG(()=>{t=e()}),t}var KS=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Sv=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Vl=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const l=e.matches[a];if(!l)continue;const u=e.router.getMatch(l.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},r2=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),i=r>=0?r:0;let a=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let l=a;l>=0;l--){const u=e.matches[l];if(e.router.looseRoutesById[u.routeId].options.notFoundComponent)return l}return n?a:i},Po=(e,t,n)=>{if(!(!Qr(n)&&!Dr(n)))throw Qr(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:Qr(n)?"redirected":r.status==="pending"?"success":r.status,context:Vl(e,t.index),isFetching:!1,error:n})),Dr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Qr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},p5=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},i2=(e,t,n)=>{const r=Vl(e,n);e.updateMatch(t,i=>({...i,context:r}))},zf=(e,t,n,r)=>{const{id:i,routeId:a}=e.matches[t],l=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Po(e,e.router.getMatch(i),n);try{l.options.onError?.(n)}catch(u){n=u,Po(e,e.router.getMatch(i),n)}e.updateMatch(i,u=>(u._nonReactive.beforeLoadPromise?.resolve(),u._nonReactive.beforeLoadPromise=void 0,u._nonReactive.loadPromise?.resolve(),{...u,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Qr(n)&&!Dr(n)&&(e.serialError??=n)},m5=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Sv(e,t)&&(n.options.loader||n.options.beforeLoad||y5(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{KS(e)},i);r._nonReactive.pendingTimeout=a}},nG=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;m5(e,t,n,r);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&Po(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},rG=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Qu(()=>{a?.resolve(),a=void 0});const{paramsError:l,searchError:u}=i;l&&zf(e,n,l,"PARSE_PARAMS"),u&&zf(e,n,u,"VALIDATE_SEARCH"),m5(e,t,r,i);const d=new AbortController;let f=!1;const p=()=>{f||(f=!0,e.updateMatch(t,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,abortController:d})))},m=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,A=>({...A,isFetching:!1}))};if(!r.options.beforeLoad){ah(()=>{p(),m()});return}i._nonReactive.beforeLoadPromise=Qu();const g={...Vl(e,n,!1),...i.__routeContext},{search:v,params:j,cause:b}=i,S=Sv(e,t),k={search:v,abortController:d,params:j,preload:S,context:g,location:e.location,navigate:A=>e.router.navigate({...A,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:S?"preload":b,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},E=A=>{if(A===void 0){ah(()=>{p(),m()});return}(Qr(A)||Dr(A))&&(p(),zf(e,n,A,"BEFORE_LOAD")),ah(()=>{p(),e.updateMatch(t,T=>({...T,__beforeLoadContext:A})),m()})};let C;try{if(C=r.options.beforeLoad(k),vh(C))return p(),C.catch(A=>{zf(e,n,A,"BEFORE_LOAD")}).then(E)}catch(A){p(),zf(e,n,A,"BEFORE_LOAD")}E(C)},iG=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>u(),l=()=>rG(e,n,t,i),u=()=>{if(p5(e,n))return;const d=nG(e,n,i);return vh(d)?d.then(l):l()};return a()},aG=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([a,l,u])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:u,scripts:l,styles:a?.styles}))},g5=(e,t,n,r,i)=>{const a=t[r-1],{params:l,loaderDeps:u,abortController:d,cause:f}=e.router.getMatch(n),p=Vl(e,r),m=Sv(e,n);return{params:l,deps:u,preload:!!m,parentMatchPromise:a,abortController:d,context:p,location:e.location,navigate:g=>e.router.navigate({...g,_fromLocation:e.location}),cause:m?"preload":f,route:i,...e.router.options.additionalContext}},a2=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(r7??e.router.isServer)||a.ssr===!0)&&xh(i);const l=i.options.loader,u=typeof l=="function"?l:l?.handler,d=u?.(g5(e,t,n,r,i)),f=!!u&&vh(d);if((f||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,m=>({...m,isFetching:"loader"})),u){const m=f?await d:d;Po(e,e.router.getMatch(n),m),m!==void 0&&e.updateMatch(n,g=>({...g,loaderData:m}))}i._lazyPromise&&await i._lazyPromise;const p=a._nonReactive.minPendingPromise;p&&await p,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,m=>({...m,error:void 0,context:Vl(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:Vl(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,Dr(l)&&await i.options.notFoundComponent?.preload?.(),Po(e,e.router.getMatch(n),l);try{i.options.onError?.(l)}catch(f){u=f,Po(e,e.router.getMatch(n),f)}!Qr(u)&&!Dr(u)&&await xh(i,["errorComponent"]),e.updateMatch(n,f=>({...f,error:u,context:Vl(e,r),status:"error",isFetching:!1}))}}catch(a){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),Po(e,l,a)}},sG=async(e,t,n)=>{async function r(v,j,b,S,k){const E=Date.now()-j.updatedAt,C=v?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,A=k.options.shouldReload,T=typeof A=="function"?A(g5(e,t,i,n,k)):A,{status:O,invalid:_}=S,P=E>C&&(!!e.forceStaleReload||S.cause==="enter"||b!==void 0&&b!==S.id);l=O==="success"&&(_||(T??P)),v&&k.options.preload===!1||(l&&!e.sync&&p?(u=!0,(async()=>{try{await a2(e,t,i,n,k);const $=e.router.getMatch(i);$._nonReactive.loaderPromise?.resolve(),$._nonReactive.loadPromise?.resolve(),$._nonReactive.loaderPromise=void 0,$._nonReactive.loadPromise=void 0}catch($){Qr($)&&await e.router.navigate($.options)}})()):O!=="success"||l?await a2(e,t,i,n,k):i2(e,i,n))}const{id:i,routeId:a}=e.matches[n];let l=!1,u=!1;const d=e.router.looseRoutesById[a],f=d.options.loader,p=((typeof f=="function"?void 0:f?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(p5(e,i)){if(!e.router.getMatch(i))return e.matches[n];i2(e,i,n)}else{const v=e.router.getMatch(i),j=e.router.state.matches[n]?.routeId===a?e.router.state.matches[n].id:e.router.state.matches.find(S=>S.routeId===a)?.id,b=Sv(e,i);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload&&p)return v;await v._nonReactive.loaderPromise;const S=e.router.getMatch(i),k=S._nonReactive.error||S.error;k&&Po(e,S,k),S.status==="pending"&&await r(b,v,j,S,d)}else{const S=b&&!e.router.state.matches.some(E=>E.id===i),k=e.router.getMatch(i);k._nonReactive.loaderPromise=Qu(),S!==k.preload&&e.updateMatch(i,E=>({...E,preload:S})),await r(b,v,j,k,d)}}const m=e.router.getMatch(i);u||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,u||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const g=u?m.isFetching:!1;return g!==m.isFetching||m.invalid!==!1?(e.updateMatch(i,v=>({...v,isFetching:g,invalid:!1})),e.router.getMatch(i)):m};async function s2(e){const t=e,n=[];t.router.state.matches.some(g=>g._forcePending)&&KS(t);let r;for(let g=0;g<t.matches.length;g++){try{const v=iG(t,g);vh(v)&&await v}catch(v){if(Qr(v))throw v;if(Dr(v))r=v;else if(!t.preload)throw v;break}if(t.serialError)break}const i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?r2(t,r):void 0,l=r&&t.preload?0:a!==void 0?Math.min(a+1,i):i;let u,d;for(let g=0;g<l;g++)n.push(sG(t,n,g));try{await Promise.all(n)}catch{const g=await Promise.allSettled(n);for(const v of g){if(v.status!=="rejected")continue;const j=v.reason;if(Qr(j))throw j;Dr(j)?u??=j:d??=j}if(d!==void 0)throw d}const f=u??(r&&!t.preload?r:void 0);let p=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!f&&r&&t.preload)return t.matches;if(f){const g=r2(t,f);_s(g!==void 0);const v=t.matches[g],j=t.router.looseRoutesById[v.routeId],b=t.router.options?.defaultNotFoundComponent;!j.options.notFoundComponent&&b&&(j.options.notFoundComponent=b),f.routeId=v.routeId;const S=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,k=>({...k,...S?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),p=g,await xh(j,["notFoundComponent"])}else if(!t.preload){const g=t.matches[0];g.globalNotFound||t.router.getMatch(g.id)?.globalNotFound&&t.updateMatch(g.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const g=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await xh(g,["errorComponent"])}for(let g=0;g<=p;g++){const{id:v,routeId:j}=t.matches[g],b=t.router.looseRoutesById[j];try{const S=aG(t,v,b);if(S){const k=await S;t.updateMatch(v,E=>({...E,...k}))}}catch(S){console.error(`Error executing head for route ${j}:`,S)}}const m=KS(t);if(vh(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function o2(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function xh(e,t=Pg){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...a}=r.options;Object.assign(e.options,a),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Pg?(()=>{if(e._componentsPromise===void 0){const r=o2(e,Pg);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():o2(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function y5(e){for(const t of Pg)if(e.options[t]?.preload)return!0;return!1}var Pg=["component","errorComponent","pendingComponent","notFoundComponent"],Lo="__TSR_index",l2="popstate",c2="beforeunload";function oG(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},a=async({task:l,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){l();return}const f=e.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&f.length&&p)for(const m of f){const g=ey(d.path,d.state);if(await m.blockerFn({currentLocation:t,nextLocation:g,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,u,d)=>{const f=t.state[Lo];u=u2(f+1,u),a({task:()=>{e.pushState(l,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:u})},replace:(l,u,d)=>{const f=t.state[Lo];u=u2(f,u),a({task:()=>{e.replaceState(l,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:u})},go:(l,u)=>{a({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:u,type:"GO"})},back:l=>{a({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{a({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Lo]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function u2(e,t){t||(t={});const n=$N();return{...t,key:n,__TSR_key:n,[Lo]:e}}function lG(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const a=()=>i,l=P=>i=P,u=(P=>P),d=(()=>ey(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const P=$N();t.history.replaceState({[Lo]:0,key:P,__TSR_key:P},"")}let f=d(),p,m=!1,g=!1,v=!1,j=!1;const b=()=>f;let S,k;const E=()=>{S&&(_._ignoreSubscribers=!0,(S.isPush?t.history.pushState:t.history.replaceState)(S.state,"",S.href),_._ignoreSubscribers=!1,S=void 0,k=void 0,p=void 0)},C=(P,$,F)=>{const U=u($);k||(p=f),f=ey($,F),S={href:U,state:F,isPush:S?.isPush||P==="push"},k||(k=Promise.resolve().then(()=>E()))},A=P=>{f=d(),_.notify({type:P})},T=async()=>{if(g){g=!1;return}const P=d(),$=P.state[Lo]-f.state[Lo],F=$===1,U=$===-1,B=!F&&!U||m;m=!1;const V=B?"GO":U?"BACK":"FORWARD",X=B?{type:"GO",index:$}:{type:U?"BACK":"FORWARD"};if(v)v=!1;else{const Z=a();if(typeof document<"u"&&Z.length){for(const H of Z)if(await H.blockerFn({currentLocation:f,nextLocation:P,action:V})){g=!0,t.history.go(1),_.notify(X);return}}}f=d(),_.notify(X)},O=P=>{if(j){j=!1;return}let $=!1;const F=a();if(typeof document<"u"&&F.length)for(const U of F){const B=U.enableBeforeUnload??!0;if(B===!0){$=!0;break}if(typeof B=="function"&&B()===!0){$=!0;break}}if($)return P.preventDefault(),P.returnValue=""},_=oG({getLocation:b,getLength:()=>t.history.length,pushState:(P,$)=>C("push",P,$),replaceState:(P,$)=>C("replace",P,$),back:P=>(P&&(v=!0),j=!0,t.history.back()),forward:P=>{P&&(v=!0),j=!0,t.history.forward()},go:P=>{m=!0,t.history.go(P)},createHref:P=>u(P),flush:E,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(c2,O,{capture:!0}),t.removeEventListener(l2,T)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(c2,O,{capture:!0}),t.addEventListener(l2,T),t.history.pushState=function(...P){const $=n.apply(t.history,P);return _._ignoreSubscribers||A("PUSH"),$},t.history.replaceState=function(...P){const $=r.apply(t.history,P);return _._ignoreSubscribers||A("REPLACE"),$},_}function cG(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function ey(e,t){const n=cG(e),r=n.indexOf("#"),i=n.indexOf("?"),a=$N();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||{[Lo]:0,key:a,__TSR_key:a}}}function $N(){return(Math.random()+1).toString(36).substring(7)}function Ql(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 uG(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var dG=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=t=>t(),this.update=t=>{const n=this.options,r=this.basepath??n?.basepath??"/",i=this.basepath===void 0,a=n?.rewrite;if(this.options={...n,...t},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=S7(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=lG()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let f;this.resolvePathCache=Yg(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=eG(hG(this.latestLocation)),_7(this));let l=!1;const u=this.options.basepath??"/",d=this.options.rewrite;if(i||r!==u||a!==d){this.basepath=u;const f=[],p=o5(u);p&&p!=="/"&&f.push($7({basepath:u})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:L7(f),this.history&&this.updateLatestLocation(),l=!0}l&&this.__store&&this.__store.setState(f=>({...f,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=y7(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&f7(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,n)=>{const r={eventType:t,fn:n};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=t=>{this.subscribers.forEach(n=>{n.eventType===t.type&&n.fn(t)})},this.parseLocation=(t,n)=>{const r=({pathname:u,search:d,hash:f,href:p,state:m})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){const S=this.options.parseSearch(d),k=this.options.stringifySearch(S);return{href:u+k+f,publicHref:p,pathname:Ef(u).path,external:!1,searchStr:k,search:Sl(n?.search,S),hash:Ef(f.slice(1)).path,state:Ml(n?.state,m)}}const g=new URL(p,this.origin),v=qS(this.rewrite,g),j=this.options.parseSearch(v.search),b=this.options.stringifySearch(j);return v.search=b,{href:v.href.replace(v.origin,""),publicHref:p,pathname:Ef(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:b,search:Sl(n?.search,j),hash:Ef(v.hash.slice(1)).path,state:Ml(n?.state,m)}},i=r(t),{__tempLocation:a,__tempKey:l}=i.state;if(a&&(!l||l===this.tempLocationKey)){const u=r(a);return u.state.key=i.state.key,u.state.__TSR_key=i.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:i}}return i},this.resolvePathWithBase=(t,n)=>j7({base:t,to:DN(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=>pG({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const n=this.getMatch(t);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(r=>r.status==="pending"),n=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...n]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=t=>{const n=(i={})=>{const a=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,l=this.matchRoutesLightweight(a);i.from;const u=i.unsafeRelative==="path"?a.pathname:i.from??l.fullPath,d=this.resolvePathWithBase(u,"."),f=l.search,p=Object.assign(Object.create(null),l.params),m=i.to?this.resolvePathWithBase(d,`${i.to}`):this.resolvePathWithBase(d,"."),g=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?p:Object.assign(p,To(i.params,p)),v=this.getMatchedRoutes(m);let j=v.matchedRoutes;if((!v.foundRoute||v.foundRoute.path!=="/"&&v.routeParams["**"])&&this.options.notFoundRoute&&(j=[...j,this.options.notFoundRoute]),Object.keys(g).length>0)for(const $ of j){const F=$.options.params?.stringify??$.options.stringifyParams;if(F)try{Object.assign(g,F(g))}catch{}}const b=t.leaveParams?m:Ef(Jz({path:m,params:g,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let S=f;if(t._includeValidateSearch&&this.options.search?.strict){const $={};j.forEach(F=>{if(F.options.validateSearch)try{Object.assign($,Rg(F.options.validateSearch,{...$,...S}))}catch{}}),S=$}S=mG({search:S,dest:i,destRoutes:j,_includeValidateSearch:t._includeValidateSearch}),S=Sl(f,S);const k=this.options.stringifySearch(S),E=i.hash===!0?a.hash:i.hash?To(i.hash,a.hash):void 0,C=E?`#${E}`:"";let A=i.state===!0?a.state:i.state?To(i.state,a.state):{};A=Ml(a.state,A);const T=`${b}${k}${C}`;let O,_,P=!1;if(this.rewrite){const $=new URL(T,this.origin),F=l5(this.rewrite,$);O=$.href.replace($.origin,""),F.origin!==this.origin?(_=F.href,P=!0):_=F.pathname+F.search+F.hash}else O=c7(T),_=O;return{publicHref:_,href:O,pathname:b,search:S,searchStr:k,state:A,hash:E??"",external:P,unmaskOnReload:i.unmaskOnReload}},r=(i={},a)=>{const l=n(i);let u=a?n(a):void 0;if(!u){const d=Object.create(null);if(this.options.routeMasks){const f=h7(l.pathname,this.processedTree);if(f){Object.assign(d,f.rawParams);const{from:p,params:m,...g}=f.route,v=m===!1||m===null?Object.create(null):(m??!0)===!0?d:Object.assign(d,To(m,d));a={from:t.from,...g,params:v},u=n(a)}}}return u&&(l.maskedLocation=u),l};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:n,...r})=>{const i=()=>{const u=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];u.forEach(f=>{r.state[f]=this.latestLocation.state[f]});const d=Kl(r.state,this.latestLocation.state);return u.forEach(f=>{delete r.state[f]}),d},a=Io(this.latestLocation.href)===Io(r.href);let l=this.commitLocationPromise;if(this.commitLocationPromise=Qu(()=>{l?.resolve(),l=void 0}),a&&i())this.load();else{let{maskedLocation:u,hashScrollIntoView:d,...f}=r;u&&(f={...u,state:{...u.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[r.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:n})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:n,hashScrollIntoView:r,viewTransition:i,ignoreBlocker:a,href:l,...u}={})=>{if(l){const p=this.history.location.state.__TSR_index,m=ey(l,{__TSR_index:t?p:p+1}),g=new URL(m.pathname,this.origin);u.to=qS(this.rewrite,g).pathname,u.search=this.options.parseSearch(m.search),u.hash=m.hash.slice(1)}const d=this.buildLocation({...u,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const f=this.commitLocation({...d,viewTransition:i,replace:t,resetScroll:n,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:t,reloadDocument:n,href:r,publicHref:i,...a})=>{let l=!1;if(r)try{new URL(`${r}`),l=!0}catch{}if(l&&!n&&(n=!0),n){if(t!==void 0||!r){const d=this.buildLocation({to:t,...a});r=r??d.publicHref,i=i??d.publicHref}const u=!l&&i?i:r;if(Wg(u,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const f of d)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(u):window.location.href=u,Promise.resolve()}return this.buildAndCommitLocation({...a,href:r,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:n.cachedMatches.filter(r=>!t.some(i=>i.id===r.id))}))},this.load=async t=>{let n,r,i;const a=this.state.resolvedLocation??this.state.location;for(i=new Promise(u=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Ql({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...Ql({resolvedLocation:f,location:d})}),await s2({router:this,sync:t?.sync,forceStaleReload:a.href===d.href,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],m=[],g=[],v=[];ah(()=>{this.__store.setState(j=>{const b=j.matches,S=j.pendingMatches||j.matches;return p=b.filter(k=>!S.some(E=>E.id===k.id)),m=b.filter(k=>!S.some(E=>E.routeId===k.routeId)),g=S.filter(k=>!b.some(E=>E.routeId===k.routeId)),v=S.filter(k=>b.some(E=>E.routeId===k.routeId)),{...j,isLoading:!1,loadedAt:Date.now(),matches:S,pendingMatches:void 0,cachedMatches:[...j.cachedMatches,...p.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[g,"onEnter"],[v,"onStay"]].forEach(([j,b])=>{j.forEach(S=>{this.looseRoutesById[S.routeId].options[b]?.(S)})})})})}})}catch(d){Qr(d)?(n=d,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Dr(d)&&(r=d),this.__store.setState(f=>({...f,statusCode:n?n.status:r?404:f.matches.some(p=>p.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),u()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(u=>u.status==="error")&&(l=500),l!==void 0&&this.__store.setState(u=>({...u,statusCode:l}))},this.startViewTransition=t=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,a=this.state.resolvedLocation,l=typeof n.types=="function"?n.types(Ql({resolvedLocation:a,location:i})):n.types;if(l===!1){t();return}r={update:t,types:l}}else r=t;document.startViewTransition(r)}else t()},this.updateMatch=(t,n)=>{this.startTransition(()=>{const r=this.state.pendingMatches?.some(i=>i.id===t)?"pendingMatches":this.state.matches.some(i=>i.id===t)?"matches":this.state.cachedMatches.some(i=>i.id===t)?"cachedMatches":"";r&&(r==="cachedMatches"?this.__store.setState(i=>({...i,cachedMatches:uG(i.cachedMatches.map(a=>a.id===t?n(a):a))})):this.__store.setState(i=>({...i,[r]:i[r]?.map(a=>a.id===t?n(a):a)})))})},this.getMatch=t=>{const n=r=>r.id===t;return this.state.cachedMatches.find(n)??this.state.pendingMatches?.find(n)??this.state.matches.find(n)},this.invalidate=t=>{const n=r=>t?.filter?.(r)??!0?{...r,invalid:!0,...t?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r;return this.__store.setState(r=>({...r,matches:r.matches.map(n),cachedMatches:r.cachedMatches.map(n),pendingMatches:r.pendingMatches?.map(n)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const n=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const r=t.options._builtLocation??this.buildLocation(t.options),i=this.getParsedLocationHref(r);t.options.href=i,t.headers.set("Location",i)}else if(n)try{const r=new URL(n);if(this.origin&&r.origin===this.origin){const i=r.pathname+r.search+r.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}if(t.options.href&&!t.options._builtLocation&&Wg(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=xh,this.preloadRoute=async t=>{const n=t._builtLocation??this.buildLocation(t);let r=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:t});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(l=>l.id)),a=new Set([...i,...this.state.cachedMatches.map(l=>l.id)]);ah(()=>{r.forEach(l=>{a.has(l.id)||this.__store.setState(u=>({...u,cachedMatches:[...u.cachedMatches,l]}))})});try{return r=await s2({router:this,matches:r,location:n,preload:!0,updateMatch:(l,u)=>{i.has(l)?r=r.map(d=>d.id===l?u(d):d):this.updateMatch(l,u)}}),r}catch(l){if(Qr(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:n});Dr(l)||console.error(l);return}},this.matchRoute=(t,n)=>{const r={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(r);if(n?.pending&&this.state.status!=="pending")return!1;const a=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=p7(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,a.pathname,this.processedTree);return!l||t.params&&!Kl(l.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?Kl(a.search,i.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??D7,parseSearch:e.parseSearch??R7,protocolAllowlist:e.protocolAllowlist??l7}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n;let{matchedRoutes:l}=n,u=!1;(r?r.path!=="/"&&i["**"]:Io(e.pathname))&&(this.options.notFoundRoute?l=[...l,this.options.notFoundRoute]:u=!0);const d=u?yG(this.options.notFoundMode,l):void 0,f=new Array(l.length),p=new Map(this.state.matches.map(m=>[m.routeId,m]));for(let m=0;m<l.length;m++){const g=l[m],v=f[m-1];let j,b,S;{const V=v?.search??e.search,X=v?._strictSearch??void 0;try{const Z=Rg(g.options.validateSearch,{...V})??void 0;j={...V,...Z},b={...X,...Z},S=void 0}catch(Z){let H=Z;if(Z instanceof ty||(H=new ty(Z.message,{cause:Z})),t?.throwOnError)throw H;j=V,b={},S=H}}const k=g.options.loaderDeps?.({search:j})??"",E=k?JSON.stringify(k):"",{interpolatedPath:C,usedParams:A}=Jz({path:g.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),T=g.id+C+E,O=this.getMatch(T),_=p.get(g.id),P=O?._strictParams??A;let $;if(!O)try{d2(g,A,a,P)}catch(V){if(Dr(V)||Qr(V)?$=V:$=new fG(V.message,{cause:V}),t?.throwOnError)throw $}Object.assign(i,P);const F=_?"stay":"enter";let U;if(O)U={...O,cause:F,params:_?.params??i,_strictParams:P,search:Sl(_?_.search:O.search,j),_strictSearch:b};else{const V=g.options.loader||g.options.beforeLoad||g.lazyFn||y5(g)?"pending":"success";U={id:T,ssr:g.options.ssr,index:m,routeId:g.id,params:_?.params??i,_strictParams:P,pathname:C,updatedAt:Date.now(),search:_?Sl(_.search,j):j,_strictSearch:b,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:$,__routeContext:void 0,_nonReactive:{loadPromise:Qu()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:_?Ml(_.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:g.options.staticData||{},fullPath:g.fullPath}}t?.preload||(U.globalNotFound=d===g.id),U.searchError=S;const B=this.getParentContext(v);U.context={...B,...U.__routeContext,...U.__beforeLoadContext},f[m]=U}for(let m=0;m<f.length;m++){const g=f[m],v=this.looseRoutesById[g.routeId],j=this.getMatch(g.id),b=p.get(g.routeId);if(g.params=b?Sl(b.params,i):i,!j){const S=f[m-1],k=this.getParentContext(S);if(v.options.context){const E={deps:g.loaderDeps,params:g.params,context:k??{},location:e,navigate:C=>this.navigate({...C,_fromLocation:e}),buildLocation:this.buildLocation,cause:g.cause,abortController:g.abortController,preload:!!g.preload,matches:f,routeId:v.id};g.__routeContext=v.options.context(E)??void 0}g.context={...k,...g.__routeContext,...g.__beforeLoadContext}}}return f}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=yh(t),a={...e.search};for(const f of t)try{Object.assign(a,Rg(f.options.validateSearch,a))}catch{}const l=yh(this.state.matches),u=l&&l.routeId===i.id&&e.pathname===this.state.location.pathname;let d;if(u)d=l.params;else{const f=Object.assign(Object.create(null),n);for(const p of t)try{d2(p,n,r??{},f)}catch{}d=f}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:d}}},ty=class extends Error{},fG=class extends Error{};function hG(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Rg(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new ty("Async validation not supported");if(n.issues)throw new ty(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function pG({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=Io(e);let a,l;const u=m7(i,n,!0);return u&&(a=u.route,Object.assign(r,u.rawParams),l=Object.assign(Object.create(null),u.parsedParams)),{matchedRoutes:u?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:l}}function mG({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return gG(n)(e,t,r??!1)}function gG(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const a=({search:l,next:u})=>{let d=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((p,m)=>m(p),l));const f=u(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((p,m)=>m(p),f):f};t.middlewares.push(a)}if(i.options.validateSearch){const a=({search:l,next:u})=>{const d=u(l);if(!t._includeValidateSearch)return d;try{return{...d,...Rg(i.options.validateSearch,d)??void 0}}catch{return d}};t.middlewares.push(a)}}const n=({search:i})=>{const a=t.dest;return a.search?a.search===!0?i:To(a.search,i):{}};t.middlewares.push(n);const r=(i,a,l)=>{if(i>=l.length)return a;const u=l[i];return u({search:a,next:f=>r(i+1,f,l)})};return function(a,l,u){return t.dest=l,t._includeValidateSearch=u,r(0,a,t.middlewares)}}function yG(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 Gl}function d2(e,t,n,r){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const a in t)a in n&&(r[a]=n[a]);else{const a=i(r);Object.assign(r,a)}}var vG="Error preloading route! ☝️",v5=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=Gl:this.parentRoute||_s(!1);let i=r?Gl:n?.path;i&&i!=="/"&&(i=s5(i));const a=n?.id||i;let l=r?Gl:zg([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=zg(["/",l]));const u=l==="__root__"?"/":zg([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=u,this._to=Io(u)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>MN({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.")}},xG=class extends v5{constructor(e){super(e)}};function BN(e){const t=e.errorComponent??UN;return s.jsx(bG,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?x.createElement(t,{error:n,reset:r}):e.children})}var bG=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 UN({error:e}){const[t,n]=x.useState(!1);return s.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[s.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),s.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),s.jsx("div",{style:{height:".25rem"}}),t?s.jsx("div",{children:s.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?s.jsx("code",{children:e.message}):null})}):null]})}function wG({children:e,fallback:t=null}){return x5()?s.jsx(Li.Fragment,{children:e}):s.jsx(Li.Fragment,{children:t})}function x5(){return Li.useSyncExternalStore(jG,()=>!0,()=>!1)}function jG(){return()=>{}}var b5=x.createContext(null);function Qi(e){const t=x.useContext(b5);return e?.warn,t}var mw={exports:{}},gw={},yw={exports:{}},vw={};var f2;function SG(){if(f2)return vw;f2=1;var e=md();function t(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function u(m,g){var v=g(),j=r({inst:{value:v,getSnapshot:g}}),b=j[0].inst,S=j[1];return a(function(){b.value=v,b.getSnapshot=g,d(b)&&S({inst:b})},[m,v,g]),i(function(){return d(b)&&S({inst:b}),m(function(){d(b)&&S({inst:b})})},[m]),l(v),v}function d(m){var g=m.getSnapshot;m=m.value;try{var v=g();return!n(m,v)}catch{return!0}}function f(m,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return vw.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,vw}var h2;function NG(){return h2||(h2=1,yw.exports=SG()),yw.exports}var p2;function kG(){if(p2)return gw;p2=1;var e=md(),t=NG();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return gw.useSyncExternalStoreWithSelector=function(f,p,m,g,v){var j=a(null);if(j.current===null){var b={hasValue:!1,value:null};j.current=b}else b=j.current;j=u(function(){function k(O){if(!E){if(E=!0,C=O,O=g(O),v!==void 0&&b.hasValue){var _=b.value;if(v(_,O))return A=_}return A=O}if(_=A,r(C,O))return _;var P=g(O);return v!==void 0&&v(_,P)?(C=O,_):(C=O,A=P)}var E=!1,C,A,T=m===void 0?null:m;return[function(){return k(p())},T===null?void 0:function(){return k(T())}]},[p,m,g,v]);var S=i(f,j[0],j[1]);return l(function(){b.hasValue=!0,b.value=S},[S]),d(S),S},gw}var m2;function CG(){return m2||(m2=1,mw.exports=kG()),mw.exports}var w5=CG();function AG(e,t){return e===t}function OG(e,t,n=AG){const r=x.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(l);return u},[e]),i=x.useCallback(()=>e?.get(),[e]);return w5.useSyncExternalStoreWithSelector(r,i,i,t,n)}function Xr(e){const t=Qi({warn:e?.router===void 0}),n=e?.router||t,r=x.useRef(void 0);return OG(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=Ml(r.current,e.select(i));return r.current=a,a}return e.select(i)}return i})}var Nv=x.createContext(void 0),EG=x.createContext(void 0);function Qo(e){const t=x.useContext(e.from?EG:Nv);return Xr({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(_s(!((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 qN(e){return Qo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function FN(e){const{select:t,...n}=e;return Qo({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function kv(e){return Qo({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Cv(e){return Qo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Wo(e){const t=Qi();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function HN(e){return Qo({...e,select:t=>e.select?e.select(t.context):t.context})}var yc=UL();const _G=ma(yc);function zG(e,t){const n=Qi(),r=n7(t),{activeProps:i,inactiveProps:a,activeOptions:l,to:u,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:g,resetScroll:v,viewTransition:j,children:b,target:S,disabled:k,style:E,className:C,onClick:A,onBlur:T,onFocus:O,onMouseEnter:_,onMouseLeave:P,onTouchStart:$,ignoreBlocker:F,params:U,search:B,hash:V,state:X,mask:Z,reloadDocument:H,unsafeRelative:J,from:oe,_fromLocation:ye,...I}=e,M=x5(),q=Xr({select:et=>{const ce=et.matches[et.matches.length-1];return{search:ce?.search,hash:et.location.hash,path:ce?.pathname}},structuralSharing:!0}),D=e.from,G=x.useMemo(()=>({...e,from:D}),[n,q,D,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),se=x.useMemo(()=>n.buildLocation({...G}),[n,G]),ne=se.maskedLocation?se.maskedLocation.publicHref:se.publicHref,Ce=se.maskedLocation?se.maskedLocation.external:se.external,Se=x.useMemo(()=>IG(ne,Ce,n.history,k),[k,Ce,ne,n.history]),ee=x.useMemo(()=>{if(Se?.external)return Wg(Se.href,n.protocolAllowlist)?void 0:Se.href;if(!LG(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),Wg(u,n.protocolAllowlist)?void 0:u}catch{}},[u,Se,n.protocolAllowlist]),pe=Xr({select:et=>{if(ee)return!1;if(l?.exact){if(!w7(et.location.pathname,se.pathname,n.basepath))return!1}else{const ce=Zg(et.location.pathname,n.basepath),Ne=Zg(se.pathname,n.basepath);if(!(ce.startsWith(Ne)&&(ce.length===Ne.length||ce[Ne.length]==="/")))return!1}return(l?.includeSearch??!0)&&!Kl(et.location.search,se.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?M&&et.location.hash===se.hash:!0}}),Ee=pe?To(i,{})??TG:xw,Y=pe?xw:To(a,{})??xw,He=[C,Ee.className,Y.className].filter(Boolean).join(" "),Pe=(E||Ee.style||Y.style)&&{...E,...Ee.style,...Y.style},[at,Ve]=x.useState(!1),Ht=x.useRef(!1),Lt=e.reloadDocument||ee?!1:d??n.options.defaultPreload,cn=f??n.options.defaultPreloadDelay??0,en=x.useCallback(()=>{n.preloadRoute({...G,_builtLocation:se}).catch(et=>{console.warn(et),console.warn(vG)})},[n,G,se]);t7(r,x.useCallback(et=>{et?.isIntersecting&&en()},[en]),MG,{disabled:!!k||Lt!=="viewport"}),x.useEffect(()=>{Ht.current||!k&&Lt==="render"&&(en(),Ht.current=!0)},[k,en,Lt]);const je=et=>{const ce=et.currentTarget.getAttribute("target"),Ne=S!==void 0?S:ce;if(!k&&!$G(et)&&!et.defaultPrevented&&(!Ne||Ne==="_self")&&et.button===0){et.preventDefault(),yc.flushSync(()=>{Ve(!0)});const Me=n.subscribe("onResolved",()=>{Me(),Ve(!1)});n.navigate({...G,replace:m,resetScroll:v,hashScrollIntoView:p,startTransition:g,viewTransition:j,ignoreBlocker:F})}};if(ee)return{...I,ref:r,href:ee,...b&&{children:b},...S&&{target:S},...k&&{disabled:k},...E&&{style:E},...C&&{className:C},...A&&{onClick:A},...T&&{onBlur:T},...O&&{onFocus:O},..._&&{onMouseEnter:_},...P&&{onMouseLeave:P},...$&&{onTouchStart:$}};const Ze=et=>{if(k||Lt!=="intent")return;if(!cn){en();return}const ce=et.currentTarget;if(Tf.has(ce))return;const Ne=setTimeout(()=>{Tf.delete(ce),en()},cn);Tf.set(ce,Ne)},Rt=et=>{k||Lt!=="intent"||en()},mt=et=>{if(k||!Lt||!cn)return;const ce=et.currentTarget,Ne=Tf.get(ce);Ne&&(clearTimeout(Ne),Tf.delete(ce))};return{...I,...Ee,...Y,href:Se?.href,ref:r,onClick:lu([A,je]),onBlur:lu([T,mt]),onFocus:lu([O,Ze]),onMouseEnter:lu([_,Ze]),onMouseLeave:lu([P,mt]),onTouchStart:lu([$,Rt]),disabled:!!k,target:S,...Pe&&{style:Pe},...He&&{className:He},...k&&PG,...pe&&RG,...M&&at&&DG}}var xw={},TG={className:"active"},PG={role:"link","aria-disabled":!0},RG={"data-status":"active","aria-current":"page"},DG={"data-transitioning":"transitioning"},Tf=new WeakMap,MG={rootMargin:"100px"},lu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function IG(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function LG(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Yt=x.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...a}=zG(r,t),l=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:u,...d}=a;return x.createElement("a",d,l)}return x.createElement(n,a,l)});function $G(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var BG=class extends v5{constructor(e){super(e),this.useMatch=t=>Qo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>HN({...t,from:this.id}),this.useSearch=t=>Cv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>kv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>FN({...t,from:this.id}),this.useLoaderData=t=>qN({...t,from:this.id}),this.useNavigate=()=>Wo({from:this.fullPath}),this.Link=Li.forwardRef((t,n)=>s.jsx(Yt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function ti(e){return new BG(e)}function UG(){return e=>FG(e)}var qG=class extends xG{constructor(e){super(e),this.useMatch=t=>Qo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>HN({...t,from:this.id}),this.useSearch=t=>Cv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>kv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>FN({...t,from:this.id}),this.useLoaderData=t=>qN({...t,from:this.id}),this.useNavigate=()=>Wo({from:this.fullPath}),this.Link=Li.forwardRef((t,n)=>s.jsx(Yt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function FG(e){return new qG(e)}function g2(e){return typeof e=="object"?new y2(e,{silent:!0}).createRoute(e):new y2(e,{silent:!0}).createRoute}var y2=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=ti(n);return r.isRoot=!1,r},this.silent=t?.silent}},v2=class{constructor(e){this.useMatch=t=>Qo({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>HN({...t,from:this.options.id}),this.useSearch=t=>Cv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>kv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>FN({...t,from:this.options.id}),this.useLoaderData=t=>qN({...t,from:this.options.id}),this.useNavigate=()=>Wo({from:Qi().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function x2(e){return typeof e=="object"?new v2(e):t=>new v2({id:e,...t})}function HG(e){const t=Xr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return s.jsx(BN,{getResetKey:()=>t,onCatch:(n,r)=>{if(Dr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Dr(n))return e.fallback?.(n);throw n},children:e.children})}function KG(){return s.jsx("p",{children:"Not Found"})}function ku(e){return s.jsx(s.Fragment,{children:e.children})}function j5(e,t,n){return t.options.notFoundComponent?s.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?s.jsx(e.options.defaultNotFoundComponent,{...n}):s.jsx(KG,{})}function GG(){return Qi().isScrollRestoring,null}var S5=x.memo(function({matchId:t}){const n=Qi(),r=Xr({select:j=>{const b=j.matches.findIndex(k=>k.id===t),S=j.matches[b];return _s(S),{routeId:S.routeId,ssr:S.ssr,_displayPending:S._displayPending,resetKey:j.loadedAt,parentRouteId:j.matches[b-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],a=i.options.pendingComponent??n.options.defaultPendingComponent,l=a?s.jsx(a,{}):null,u=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,f=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",m=(!i.isRoot||i.options.wrapInSuspense||p)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||p))?x.Suspense:ku,g=u?BN:ku,v=f?HG:ku;return s.jsxs(i.isRoot?i.options.shellComponent??ku:ku,{children:[s.jsx(Nv.Provider,{value:t,children:s.jsx(m,{fallback:l,children:s.jsx(g,{getResetKey:()=>r.resetKey,errorComponent:u||UN,onCatch:(j,b)=>{if(Dr(j))throw j;d?.(j,b)},children:s.jsx(v,{fallback:j=>{if(!f||j.routeId&&j.routeId!==r.routeId||!j.routeId&&!i.isRoot)throw j;return x.createElement(f,j)},children:p||r._displayPending?s.jsx(wG,{fallback:l,children:s.jsx(b2,{matchId:t})}):s.jsx(b2,{matchId:t})})})})}),r.parentRouteId===Gl&&n.options.scrollRestoration?s.jsxs(s.Fragment,{children:[s.jsx(VG,{}),s.jsx(GG,{})]}):null]})});function VG(){const e=Qi(),t=x.useRef(void 0);return s.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Ql(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var b2=x.memo(function({matchId:t}){const n=Qi(),{match:r,key:i,routeId:a}=Xr({select:d=>{const f=d.matches.find(g=>g.id===t),p=f.routeId,m=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:m?JSON.stringify(m):void 0,routeId:p,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),l=n.routesById[a],u=x.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?s.jsx(d,{},i):s.jsx(KN,{})},[i,l.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const d=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const f=n.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise){const p=Qu();f._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),f._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return _s(Dr(r.error)),j5(n,l,r.error);if(r.status==="redirected")throw _s(Qr(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return u}),KN=x.memo(function(){const t=Qi(),n=x.useContext(Nv),r=Xr({select:f=>f.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],a=Xr({select:f=>{const p=f.matches.find(m=>m.id===n);return _s(p),p.globalNotFound}}),l=Xr({select:f=>{const p=f.matches;return p[p.findIndex(m=>m.id===n)+1]?.id}}),u=t.options.defaultPendingComponent?s.jsx(t.options.defaultPendingComponent,{}):null;if(a)return j5(t,i,void 0);if(!l)return null;const d=s.jsx(S5,{matchId:l});return r===Gl?s.jsx(x.Suspense,{fallback:u,children:d}):d});function QG(){const e=Qi(),t=x.useRef({router:e,mounted:!1}),[n,r]=x.useState(!1),{hasPendingMatches:i,isLoading:a}=Xr({select:m=>({isLoading:m.isLoading,hasPendingMatches:m.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),l=cw(a),u=a||n||i,d=cw(u),f=a||i,p=cw(f);return e.startTransition=m=>{r(!0),x.startTransition(()=>{m(),r(!1)})},x.useEffect(()=>{const m=e.history.subscribe(e.load),g=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Io(e.latestLocation.publicHref)!==Io(g.publicHref)&&e.commitLocation({...g,replace:!0}),()=>{m()}},[e,e.history]),$m(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(g){console.error(g)}})()},[e]),$m(()=>{l&&!a&&e.emit({type:"onLoad",...Ql(e.state)})},[l,e,a]),$m(()=>{p&&!f&&e.emit({type:"onBeforeRouteMount",...Ql(e.state)})},[f,p,e]),$m(()=>{if(d&&!u){const m=Ql(e.state);e.emit({type:"onResolved",...m}),e.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),m.hrefChanged&&z7(e)}},[u,d,e]),null}function WG(){const e=Qi(),t=e.routesById[Gl].options.pendingComponent??e.options.defaultPendingComponent,n=t?s.jsx(t,{}):null,r=s.jsxs(typeof document<"u"&&e.ssr?ku:x.Suspense,{fallback:n,children:[s.jsx(QG,{}),s.jsx(YG,{})]});return e.options.InnerWrap?s.jsx(e.options.InnerWrap,{children:r}):r}function YG(){const e=Qi(),t=Xr({select:i=>i.matches[0]?.id}),n=Xr({select:i=>i.loadedAt}),r=t?s.jsx(S5,{matchId:t}):null;return s.jsx(Nv.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:s.jsx(BN,{getResetKey:()=>n,errorComponent:UN,onCatch:void 0,children:r})})}var ZG=e=>new XG(e),XG=class extends dG{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=g2,globalThis.createLazyFileRoute=x2):typeof window<"u"&&(window.createFileRoute=g2,window.createLazyFileRoute=x2);function JG({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=s.jsx(b5.Provider,{value:e,children:t});return e.options.Wrap?s.jsx(e.options.Wrap,{children:r}):r}function eV({router:e,...t}){return s.jsx(JG,{router:e,...t,children:s.jsx(WG,{})})}function N5(e){return Xr({select:t=>t.location})}class ei extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function tV(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const k5=tV();function nV(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function rV(e){return`${nV()}${e}`}function iV(e,t){if(t===404)return"Health endpoint returned 404. Check basePath or reverse-proxy configuration and make sure the dashboard reaches /health instead of an API-prefixed route."}function aV(){return""}function w2(){return!!aV()}async function _e(e,t){const n=t?.body!=null,r=await fetch(`${k5}${e}`,{...t,credentials:t?.credentials??"same-origin",headers:{...n?{"Content-Type":"application/json"}:{},...t?.headers}});if(!r.ok){const i=await r.text();let a=`API ${r.status}: ${r.statusText}`,l;if(i)try{const u=JSON.parse(i);typeof u.error=="string"?a=u.error:u.error?.message?(a=u.error.message,l=u.error.code):u.message&&(a=u.message)}catch{a=i}throw new ei(a,r.status,l)}if(r.status!==204)return r.json()}function GN(){return _e("/projects")}function C5(e){return _e(`/projects/${encodeURIComponent(e)}`)}function A5(){return _e("/runs")}function sV(e){return _e(`/projects/${encodeURIComponent(e)}/runs`)}function tc(e){return _e(`/runs/${encodeURIComponent(e)}`)}function oV(e){return _e(`/projects/${encodeURIComponent(e)}/queries`)}function O5(e){return _e(`/projects/${encodeURIComponent(e)}/competitors`)}function E5(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const r=n.toString();return _e(`/projects/${encodeURIComponent(e)}/timeline${r?`?${r}`:""}`)}function lV(e,t){const r=new URLSearchParams().toString();return _e(`/projects/${encodeURIComponent(e)}/overview${r?`?${r}`:""}`)}function Av(e,t){return _e(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function cV(e,t){return _e(`/projects/${encodeURIComponent(e)}/queries`,{method:"PUT",body:JSON.stringify({queries:t})})}function uV(e,t){return _e(`/projects/${encodeURIComponent(e)}/queries`,{method:"POST",body:JSON.stringify({queries:t})})}function _5(e,t){return _e(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function j2(e,t){const n=await C5(e);return Av(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 dV(e,t){const n=await C5(e);return Av(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 fV(e,t){const n={};return t?.location&&(n.location=t.location),t?.allLocations&&(n.allLocations=!0),t?.noLocation&&(n.noLocation=!0),_e(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function hV(e,t){return _e(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function pV(e,t){await _e(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function mV(e,t){return _e(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function gV(e){await _e(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function yV(e){return _e(`/projects/${encodeURIComponent(e)}/export`)}function VN(){return _e("/settings")}function vV(){return _e("/session")}function xV(e){return _e("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function bV(e){return _e("/session",{method:"POST",body:JSON.stringify({password:e})})}function wV(e,t){return _e(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function jV(e){return _e("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function SV(e){try{return await _e(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof ei&&t.statusCode===404)return null;throw t}}function S2(e,t){return _e(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function NV(e){await _e(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function kV(e){return _e(`/projects/${encodeURIComponent(e)}/notifications`)}function CV(e,t){return _e(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function AV(e,t){await _e(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function OV(e,t){return _e(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function EV(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/queries/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function _V(e){return _e("/apply",{method:"POST",body:JSON.stringify(e)})}function zV(e){return _e("/runs",{method:"POST",body:JSON.stringify(e??{})})}function z5(e){return _e(`/projects/${encodeURIComponent(e)}/google/connections`)}function TV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function PV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function RV(e){return _e(`/projects/${encodeURIComponent(e)}/google/properties`)}function DV(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function MV(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function T5(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function IV(e,t){const n=new URLSearchParams;t?.startDate&&n.set("startDate",t.startDate),t?.endDate&&n.set("endDate",t.endDate),t?.window&&t.window!=="all"&&!t.startDate&&n.set("window",t.window),t?.query&&n.set("query",t.query),t?.page&&n.set("page",t.page),t?.limit!==void 0&&n.set("limit",String(t.limit));const r=n.toString()?`?${n.toString()}`:"";return _e(`/projects/${encodeURIComponent(e)}/google/gsc/performance${r}`)}function LV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function $V(e,t){const n=new URLSearchParams;t?.url&&n.set("url",t.url),n.set("limit",String(t.limit));const r=n.toString()?`?${n.toString()}`:"";return _e(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${r}`)}function BV(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function QN(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function UV(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return _e(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function qV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function FV(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function HV(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function N2(){return _e("/cdp/status")}function KV(e,t){return _e("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function k2(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function P5(e){return _e(`/projects/${encodeURIComponent(e)}/bing/status`)}function GV(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function VV(e){return _e(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function QV(e){return _e(`/projects/${encodeURIComponent(e)}/bing/sites`)}function WV(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function WN(e){return _e(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function R5(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return _e(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function D5(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function C2(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function YV(e){return _e(`/projects/${encodeURIComponent(e)}/bing/performance`)}function ZV(e){return _e("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function XV(e){return _e(`/projects/${encodeURIComponent(e)}/report`)}function JV(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function eQ(e,t="agency"){const n=new URLSearchParams({audience:t}),r=await fetch(`${k5}/projects/${encodeURIComponent(e)}/report.html?${n.toString()}`,{credentials:"same-origin",headers:{}});if(!r.ok)throw new ei(`Failed to download report: ${r.status}`,r.status);const i=await r.blob(),a=URL.createObjectURL(i),l=JV(r.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,u=document.createElement("a");u.href=a,u.download=l,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(a)}function tQ(e){return _e(`/projects/${encodeURIComponent(e)}/ga/status`)}function nQ(e,t,n){const r=new URLSearchParams;n&&n!=="all"&&r.set("window",n);const i=r.toString()?`?${r}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/traffic${i}`)}function M5(e,t){return _e(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function rQ(e,t){return _e(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function iQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history${n}`)}function aQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/social-referral-history${n}`)}function sQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/session-history${n}`)}function oQ(e){return _e(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function lQ(e,t){const n=t?`?runId=${encodeURIComponent(t)}`:"";return _e(`/projects/${encodeURIComponent(e)}/insights${n}`)}function cQ(e){return _e(`/projects/${encodeURIComponent(e)}/citations/visibility`)}async function uQ(e,t){const n=rV(e);try{const r=await fetch(n,{credentials:"same-origin"});if(!r.ok)return{label:t,state:"error",detail:`${t} ${r.status}: ${r.statusText}`,statusCode:r.status,hint:iV(e,r.status)};const i=await r.json(),a=typeof i.version=="string"?i.version:"unknown",l=typeof i.databaseUrlConfigured=="boolean"?i.databaseUrlConfigured:void 0,u=typeof i.lastHeartbeatAt=="string"?i.lastHeartbeatAt:void 0,d=[a,l===!1?"database not configured":"database configured",u?`heartbeat ${u}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:d,version:a,databaseConfigured:l,lastHeartbeatAt:u}}catch(r){return{label:t,state:"error",detail:r instanceof Error?r.message:"unreachable",hint:e==="/health"?`Request failed while checking ${n}. If this instance is served behind a sub-path, verify the dashboard basePath and reverse-proxy rewrites.`:void 0}}}function dQ(){return _e("/backlinks/status")}function fQ(){return _e("/backlinks/install",{method:"POST"})}function I5(){return _e("/backlinks/syncs/latest")}function hQ(){return _e("/backlinks/syncs")}function pQ(e){return _e("/backlinks/syncs",{method:"POST",body:JSON.stringify(e?{release:e}:{})})}function mQ(){return _e("/backlinks/releases")}function gQ(){return _e("/backlinks/latest-release")}function yQ(e){return _e(`/backlinks/cache/${encodeURIComponent(e)}`,{method:"DELETE"})}function vQ(e,t={}){const n=new URLSearchParams;t.release&&n.set("release",t.release),t.excludeCrawlers&&n.set("excludeCrawlers","1");const r=n.toString();return _e(`/projects/${encodeURIComponent(e)}/backlinks/summary${r?`?${r}`:""}`)}function xQ(e,t={}){const n=new URLSearchParams;t.limit!==void 0&&n.set("limit",String(t.limit)),t.offset!==void 0&&n.set("offset",String(t.offset)),t.release&&n.set("release",t.release),t.excludeCrawlers&&n.set("excludeCrawlers","1");const r=n.toString();return _e(`/projects/${encodeURIComponent(e)}/backlinks/domains${r?`?${r}`:""}`)}function bQ(e){return _e(`/projects/${encodeURIComponent(e)}/backlinks/history`)}function wQ(e,t){return _e(`/projects/${encodeURIComponent(e)}/backlinks/extract`,{method:"POST",body:JSON.stringify({release:void 0})})}const jQ=6e3,SQ=5,NQ=180;let wr=[],kQ=0;const GS=new Set,VS=new Map,QS=new Map;function ny(){const e=[...wr];for(const t of GS)t(e)}function YN(e){const t=VS.get(e);t&&(clearTimeout(t),VS.delete(e));const n=QS.get(e);n&&(clearTimeout(n),QS.delete(e))}function L5(e){YN(e);const t=wr.length;wr=wr.filter(n=>n.id!==e),wr.length!==t&&ny()}function A2(e){YN(e.id),VS.set(e.id,setTimeout(()=>{WS(e.id)},e.durationMs))}function CQ(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function vt(e,t="negative",n=jQ){const r=CQ(e,t,n),i={id:String(++kQ),title:r.title,detail:r.detail,tone:r.tone??t,durationMs:r.durationMs??n,dedupeKey:r.dedupeKey,cta:r.cta,state:"open"};if(r.dedupeKey){const a=wr.find(l=>l.dedupeKey===r.dedupeKey);if(a){if((r.dedupeMode??"drop")==="drop")return a.id;const l={...a,title:i.title,detail:i.detail,tone:i.tone,durationMs:i.durationMs,cta:i.cta,state:"open"};return wr=wr.map(u=>u.id===a.id?l:u),ny(),A2(l),a.id}}return wr.length>=SQ&&L5(wr[0].id),wr=[...wr,i],ny(),A2(i),i.id}function WS(e){const t=wr.find(n=>n.id===e);!t||t.state==="closing"||(YN(e),wr=wr.map(n=>n.id===e?{...n,state:"closing"}:n),ny(),QS.set(e,setTimeout(()=>{L5(e)},NQ)))}function AQ(e){return GS.add(e),()=>{GS.delete(e)}}function O2(){return wr}const OQ=5*6e4,$5=30*6e4,Pf=3e4,jr=6e4,YS=3e4;function EQ(){return new QK({defaultOptions:{queries:{staleTime:OQ,retry:1,refetchOnWindowFocus:!1}},mutationCache:new WL({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||vt({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const _Q=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zQ=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),E2=e=>{const t=zQ(e);return t.charAt(0).toUpperCase()+t.slice(1)},B5=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),TQ=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var PQ={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const RQ=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:l,...u},d)=>x.createElement("svg",{ref:d,...PQ,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:B5("lucide",i),...!a&&!TQ(u)&&{"aria-hidden":"true"},...u},[...l.map(([f,p])=>x.createElement(f,p)),...Array.isArray(a)?a:[a]]));const Nt=(e,t)=>{const n=x.forwardRef(({className:r,...i},a)=>x.createElement(RQ,{ref:a,iconNode:t,className:B5(`lucide-${_Q(E2(e))}`,`lucide-${e}`,r),...i}));return n.displayName=E2(e),n};const DQ=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],MQ=Nt("arrow-up",DQ);const IQ=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],LQ=Nt("book-open",IQ);const $Q=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],U5=Nt("check",$Q);const BQ=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],UQ=Nt("chevron-down",BQ);const qQ=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Hh=Nt("chevron-right",qQ);const FQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],HQ=Nt("circle-alert",FQ);const KQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],q5=Nt("circle-check",KQ);const GQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],F5=Nt("circle-question-mark",GQ);const VQ=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],QQ=Nt("copy",VQ);const WQ=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Ov=Nt("download",WQ);const YQ=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ZQ=Nt("external-link",YQ);const XQ=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],JQ=Nt("file-text",XQ);const eW=[["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"}]],tW=Nt("github",eW);const nW=[["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"}]],rW=Nt("globe",nW);const iW=[["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"}]],aW=Nt("layout-dashboard",iW);const sW=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],H5=Nt("link-2",sW);const oW=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],K5=Nt("loader-circle",oW);const lW=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],cW=Nt("maximize-2",lW);const uW=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],dW=Nt("menu",uW);const fW=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],hW=Nt("minimize-2",fW);const pW=[["path",{d:"M5 12h14",key:"1ays0h"}]],mW=Nt("minus",pW);const gW=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ry=Nt("play",gW);const yW=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],_2=Nt("plus",yW);const vW=[["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"}]],z2=Nt("refresh-cw",vW);const xW=[["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"}]],bW=Nt("rocket",xW);const wW=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],G5=Nt("rotate-ccw",wW);const jW=[["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"}]],SW=Nt("settings",jW);const NW=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],T2=Nt("sparkles",NW);const kW=[["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"}]],V5=Nt("trash-2",kW);const CW=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],iy=Nt("triangle-alert",CW);const AW=[["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"}]],OW=Nt("unplug",AW);const EW=[["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"}]],_W=Nt("upload",EW);const zW=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],TW=Nt("wrench",zW);const PW=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Kh=Nt("x",PW);function ve(e,t,n){function r(u,d){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:d,constr:l,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,d);const f=l.prototype,p=Object.keys(f);for(let m=0;m<p.length;m++){const g=p[m];g in u||(u[g]=f[g].bind(u))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function l(u){var d;const f=n?.Parent?new a:this;r(f,u),(d=f._zod).deferred??(d.deferred=[]);for(const p of f._zod.deferred)p();return f}return Object.defineProperty(l,"init",{value:r}),Object.defineProperty(l,Symbol.hasInstance,{value:u=>n?.Parent&&u instanceof n.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class Iu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Q5 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const W5={};function Fo(e){return W5}function Y5(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function ZS(e,t){return typeof t=="bigint"?t.toString():t}function Ev(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ZN(e){return e==null}function XN(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function RW(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const d=r.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const a=n>i?n:i,l=Number.parseInt(e.toFixed(a).replace(".","")),u=Number.parseInt(t.toFixed(a).replace(".",""));return l%u/10**a}const P2=Symbol("evaluating");function Dt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==P2)return r===void 0&&(r=P2,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function vc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Yo(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function R2(e){return JSON.stringify(e)}function DW(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Z5="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function bh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const MW=Ev(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Wu(e){if(bh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(bh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function X5(e){return Wu(e)?{...e}:Array.isArray(e)?[...e]:e}const IW=new Set(["string","number","symbol"]);function Yu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zo(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Fe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function LW(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const $W={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 BW(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=Yo(e._zod.def,{get shape(){const l={};for(const u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(l[u]=n.shape[u])}return vc(this,"shape",l),l},checks:[]});return Zo(e,a)}function UW(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=Yo(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete l[u]}return vc(this,"shape",l),l},checks:[]});return Zo(e,a)}function qW(e,t){if(!Wu(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const a=e._zod.def.shape;for(const l in t)if(Object.getOwnPropertyDescriptor(a,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Yo(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return vc(this,"shape",a),a}});return Zo(e,i)}function FW(e,t){if(!Wu(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Yo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return vc(this,"shape",r),r}});return Zo(e,n)}function HW(e,t){const n=Yo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return vc(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Zo(e,n)}function KW(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const l=Yo(t._zod.def,{get shape(){const u=t._zod.def.shape,d={...u};if(n)for(const f in n){if(!(f in u))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(d[f]=e?new e({type:"optional",innerType:u[f]}):u[f])}else for(const f in u)d[f]=e?new e({type:"optional",innerType:u[f]}):u[f];return vc(this,"shape",d),d},checks:[]});return Zo(t,l)}function GW(e,t,n){const r=Yo(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(a[l]=new e({type:"nonoptional",innerType:i[l]}))}else for(const l in i)a[l]=new e({type:"nonoptional",innerType:i[l]});return vc(this,"shape",a),a}});return Zo(t,r)}function Au(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Ou(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function qm(e){return typeof e=="string"?e:e?.message}function Ho(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=qm(e.inst?._zod.def?.error?.(e))??qm(t?.error?.(e))??qm(n.customError?.(e))??qm(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function JN(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function wh(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const J5=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ZS,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},e4=ve("$ZodError",J5),t4=ve("$ZodError",J5,{Parent:Error});function VW(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 QW(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(l=>r({issues:l}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let l=n,u=0;for(;u<a.path.length;){const d=a.path[u];u===a.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(a))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}};return r(e),n}const ek=e=>(t,n,r,i)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},a);if(l instanceof Promise)throw new Iu;if(l.issues.length){const u=new(i?.Err??e)(l.issues.map(d=>Ho(d,a,Fo())));throw Z5(u,i?.callee),u}return l.value},tk=e=>async(t,n,r,i)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},a);if(l instanceof Promise&&(l=await l),l.issues.length){const u=new(i?.Err??e)(l.issues.map(d=>Ho(d,a,Fo())));throw Z5(u,i?.callee),u}return l.value},_v=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Iu;return a.issues.length?{success:!1,error:new(e??e4)(a.issues.map(l=>Ho(l,i,Fo())))}:{success:!0,data:a.value}},WW=_v(t4),zv=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(l=>Ho(l,i,Fo())))}:{success:!0,data:a.value}},YW=zv(t4),ZW=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ek(e)(t,n,i)},XW=e=>(t,n,r)=>ek(e)(t,n,r),JW=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return tk(e)(t,n,i)},eY=e=>async(t,n,r)=>tk(e)(t,n,r),tY=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return _v(e)(t,n,i)},nY=e=>(t,n,r)=>_v(e)(t,n,r),rY=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return zv(e)(t,n,i)},iY=e=>async(t,n,r)=>zv(e)(t,n,r),aY=/^[cC][^\s-]{8,}$/,sY=/^[0-9a-z]+$/,oY=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,lY=/^[0-9a-vA-V]{20}$/,cY=/^[A-Za-z0-9]{27}$/,uY=/^[a-zA-Z0-9_-]{21}$/,dY=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,fY=/^([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})$/,D2=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)$/,hY=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,pY="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function mY(){return new RegExp(pY,"u")}const gY=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,yY=/^(([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}|:))$/,vY=/^((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])$/,xY=/^(([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])$/,bY=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,n4=/^[A-Za-z0-9_-]*$/,wY=/^\+[1-9]\d{6,14}$/,r4="(?:(?:\\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])))",jY=new RegExp(`^${r4}$`);function i4(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 SY(e){return new RegExp(`^${i4(e)}$`)}function NY(e){const t=i4({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(`^${r4}T(?:${r})$`)}const kY=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},CY=/^-?\d+$/,a4=/^-?\d+(?:\.\d+)?$/,AY=/^(?:true|false)$/i,OY=/^[^A-Z]*$/,EY=/^[^a-z]*$/,ni=ve("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),s4={number:"number",bigint:"bigint",object:"date"},o4=ve("$ZodCheckLessThan",(e,t)=>{ni.init(e,t);const n=s4[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),l4=ve("$ZodCheckGreaterThan",(e,t)=>{ni.init(e,t);const n=s4[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_Y=ve("$ZodCheckMultipleOf",(e,t)=>{ni.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):RW(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})}}),zY=ve("$ZodCheckNumberFormat",(e,t)=>{ni.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,a]=$W[t.format];e._zod.onattach.push(l=>{const u=l._zod.bag;u.format=t.format,u.minimum=i,u.maximum=a,n&&(u.pattern=CY)}),e._zod.check=l=>{const u=l.value;if(n){if(!Number.isInteger(u)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?l.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):l.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}u<i&&l.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),u>a&&l.issues.push({origin:"number",input:u,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),TY=ve("$ZodCheckMaxLength",(e,t)=>{var n;ni.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!ZN(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=JN(i);r.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),PY=ve("$ZodCheckMinLength",(e,t)=>{var n;ni.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!ZN(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=JN(i);r.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),RY=ve("$ZodCheckLengthEquals",(e,t)=>{var n;ni.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!ZN(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,a=i.length;if(a===t.length)return;const l=JN(i),u=a>t.length;r.issues.push({origin:l,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Tv=ve("$ZodCheckStringFormat",(e,t)=>{var n,r;ni.init(e,t),e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),DY=ve("$ZodCheckRegex",(e,t)=>{Tv.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})}}),MY=ve("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=OY),Tv.init(e,t)}),IY=ve("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=EY),Tv.init(e,t)}),LY=ve("$ZodCheckIncludes",(e,t)=>{ni.init(e,t);const n=Yu(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),$Y=ve("$ZodCheckStartsWith",(e,t)=>{ni.init(e,t);const n=new RegExp(`^${Yu(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})}}),BY=ve("$ZodCheckEndsWith",(e,t)=>{ni.init(e,t);const n=new RegExp(`.*${Yu(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})}}),UY=ve("$ZodCheckOverwrite",(e,t)=>{ni.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class qY{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
10
+ `).filter(l=>l),i=Math.min(...r.map(l=>l.length-l.trimStart().length)),a=r.map(l=>l.slice(i)).map(l=>" ".repeat(this.indent*2)+l);for(const l of a)this.content.push(l)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
11
+ `))}}const FY={major:4,minor:3,patch:6},xn=ve("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=FY;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const a of i._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(l,u,d)=>{let f=Au(l),p;for(const m of u){if(m._zod.def.when){if(!m._zod.def.when(l))continue}else if(f)continue;const g=l.issues.length,v=m._zod.check(l);if(v instanceof Promise&&d?.async===!1)throw new Iu;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,l.issues.length!==g&&(f||(f=Au(l,g)))});else{if(l.issues.length===g)continue;f||(f=Au(l,g))}}return p?p.then(()=>l):l},a=(l,u,d)=>{if(Au(l))return l.aborted=!0,l;const f=i(u,r,d);if(f instanceof Promise){if(d.async===!1)throw new Iu;return f.then(p=>e._zod.parse(p,d))}return e._zod.parse(f,d)};e._zod.run=(l,u)=>{if(u.skipChecks)return e._zod.parse(l,u);if(u.direction==="backward"){const f=e._zod.parse({value:l.value,issues:[]},{...u,skipChecks:!0});return f instanceof Promise?f.then(p=>a(p,l,u)):a(f,l,u)}const d=e._zod.parse(l,u);if(d instanceof Promise){if(u.async===!1)throw new Iu;return d.then(f=>i(f,r,u))}return i(d,r,u)}}Dt(e,"~standard",()=>({validate:i=>{try{const a=WW(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return YW(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),nk=ve("$ZodString",(e,t)=>{xn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??kY(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),pn=ve("$ZodStringFormat",(e,t)=>{Tv.init(e,t),nk.init(e,t)}),HY=ve("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=fY),pn.init(e,t)}),KY=ve("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=D2(r))}else t.pattern??(t.pattern=D2());pn.init(e,t)}),GY=ve("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=hY),pn.init(e,t)}),VY=ve("$ZodURL",(e,t)=>{pn.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),QY=ve("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=mY()),pn.init(e,t)}),WY=ve("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=uY),pn.init(e,t)}),YY=ve("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=aY),pn.init(e,t)}),ZY=ve("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=sY),pn.init(e,t)}),XY=ve("$ZodULID",(e,t)=>{t.pattern??(t.pattern=oY),pn.init(e,t)}),JY=ve("$ZodXID",(e,t)=>{t.pattern??(t.pattern=lY),pn.init(e,t)}),eZ=ve("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=cY),pn.init(e,t)}),tZ=ve("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=NY(t)),pn.init(e,t)}),nZ=ve("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=jY),pn.init(e,t)}),rZ=ve("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=SY(t)),pn.init(e,t)}),iZ=ve("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=dY),pn.init(e,t)}),aZ=ve("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=gY),pn.init(e,t),e._zod.bag.format="ipv4"}),sZ=ve("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=yY),pn.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),oZ=ve("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=vY),pn.init(e,t)}),lZ=ve("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=xY),pn.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,a]=r;if(!a)throw new Error;const l=Number(a);if(`${l}`!==a)throw new Error;if(l<0||l>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function c4(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const cZ=ve("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=bY),pn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{c4(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function uZ(e){if(!n4.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return c4(n)}const dZ=ve("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=n4),pn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{uZ(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),fZ=ve("$ZodE164",(e,t)=>{t.pattern??(t.pattern=wY),pn.init(e,t)});function hZ(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 pZ=ve("$ZodJWT",(e,t)=>{pn.init(e,t),e._zod.check=n=>{hZ(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),u4=ve("$ZodNumber",(e,t)=>{xn.init(e,t),e._zod.pattern=e._zod.bag.pattern??a4,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),n}}),mZ=ve("$ZodNumberFormat",(e,t)=>{zY.init(e,t),u4.init(e,t)}),gZ=ve("$ZodBoolean",(e,t)=>{xn.init(e,t),e._zod.pattern=AY,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}}),yZ=ve("$ZodUnknown",(e,t)=>{xn.init(e,t),e._zod.parse=n=>n}),vZ=ve("$ZodNever",(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function M2(e,t,n){e.issues.length&&t.issues.push(...Ou(n,e.issues)),t.value[n]=e.value}const xZ=ve("$ZodArray",(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const a=[];for(let l=0;l<i.length;l++){const u=i[l],d=t.element._zod.run({value:u,issues:[]},r);d instanceof Promise?a.push(d.then(f=>M2(f,n,l))):M2(d,n,l)}return a.length?Promise.all(a).then(()=>n):n}});function ay(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Ou(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function d4(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=LW(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function f4(e,t,n,r,i,a){const l=[],u=i.keySet,d=i.catchall._zod,f=d.def.type,p=d.optout==="optional";for(const m in t){if(u.has(m))continue;if(f==="never"){l.push(m);continue}const g=d.run({value:t[m],issues:[]},r);g instanceof Promise?e.push(g.then(v=>ay(v,n,m,t,p))):ay(g,n,m,t,p)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const bZ=ve("$ZodObject",(e,t)=>{if(xn.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const u=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...u};return Object.defineProperty(t,"shape",{value:d}),d}})}const r=Ev(()=>d4(t));Dt(e._zod,"propValues",()=>{const u=t.shape,d={};for(const f in u){const p=u[f]._zod;if(p.values){d[f]??(d[f]=new Set);for(const m of p.values)d[f].add(m)}}return d});const i=bh,a=t.catchall;let l;e._zod.parse=(u,d)=>{l??(l=r.value);const f=u.value;if(!i(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value={};const p=[],m=l.shape;for(const g of l.keys){const v=m[g],j=v._zod.optout==="optional",b=v._zod.run({value:f[g],issues:[]},d);b instanceof Promise?p.push(b.then(S=>ay(S,u,g,f,j))):ay(b,u,g,f,j)}return a?f4(p,f,u,d,r.value,e):p.length?Promise.all(p).then(()=>u):u}}),wZ=ve("$ZodObjectJIT",(e,t)=>{bZ.init(e,t);const n=e._zod.parse,r=Ev(()=>d4(t)),i=g=>{const v=new qY(["shape","payload","ctx"]),j=r.value,b=C=>{const A=R2(C);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};v.write("const input = payload.value;");const S=Object.create(null);let k=0;for(const C of j.keys)S[C]=`key_${k++}`;v.write("const newResult = {};");for(const C of j.keys){const A=S[C],T=R2(C),_=g[C]?._zod?.optout==="optional";v.write(`const ${A} = ${b(C)};`),_?v.write(`
12
+ if (${A}.issues.length) {
13
+ if (${T} in input) {
14
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
15
+ ...iss,
16
+ path: iss.path ? [${T}, ...iss.path] : [${T}]
17
+ })));
18
+ }
19
+ }
20
+
21
+ if (${A}.value === undefined) {
22
+ if (${T} in input) {
23
+ newResult[${T}] = undefined;
24
+ }
25
+ } else {
26
+ newResult[${T}] = ${A}.value;
27
+ }
28
+
29
+ `):v.write(`
30
+ if (${A}.issues.length) {
31
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
32
+ ...iss,
33
+ path: iss.path ? [${T}, ...iss.path] : [${T}]
34
+ })));
35
+ }
36
+
37
+ if (${A}.value === undefined) {
38
+ if (${T} in input) {
39
+ newResult[${T}] = undefined;
40
+ }
41
+ } else {
42
+ newResult[${T}] = ${A}.value;
43
+ }
44
+
45
+ `)}v.write("payload.value = newResult;"),v.write("return payload;");const E=v.compile();return(C,A)=>E(g,C,A)};let a;const l=bh,u=!W5.jitless,f=u&&MW.value,p=t.catchall;let m;e._zod.parse=(g,v)=>{m??(m=r.value);const j=g.value;return l(j)?u&&f&&v?.async===!1&&v.jitless!==!0?(a||(a=i(t.shape)),g=a(g,v),p?f4([],j,g,v,m,e):g):n(g,v):(g.issues.push({expected:"object",code:"invalid_type",input:j,inst:e}),g)}});function I2(e,t,n,r){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const i=e.filter(a=>!Au(a));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(l=>Ho(l,r,Fo())))}),t)}const h4=ve("$ZodUnion",(e,t)=>{xn.init(e,t),Dt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Dt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Dt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Dt(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${i.map(a=>XN(a.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let l=!1;const u=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},a);if(f instanceof Promise)u.push(f),l=!0;else{if(f.issues.length===0)return f;u.push(f)}}return l?Promise.all(u).then(d=>I2(d,i,e,a)):I2(u,i,e,a)}}),jZ=ve("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,h4.init(e,t);const n=e._zod.parse;Dt(e._zod,"propValues",()=>{const i={};for(const a of t.options){const l=a._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const[u,d]of Object.entries(l)){i[u]||(i[u]=new Set);for(const f of d)i[u].add(f)}}return i});const r=Ev(()=>{const i=t.options,a=new Map;for(const l of i){const u=l._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const d of u){if(a.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);a.set(d,l)}}return a});e._zod.parse=(i,a)=>{const l=i.value;if(!bh(l))return i.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),i;const u=r.value.get(l?.[t.discriminator]);return u?u._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),i)}}),SZ=ve("$ZodIntersection",(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},r),l=t.right._zod.run({value:i,issues:[]},r);return a instanceof Promise||l instanceof Promise?Promise.all([a,l]).then(([d,f])=>L2(n,d,f)):L2(n,a,l)}});function XS(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(Wu(e)&&Wu(t)){const n=Object.keys(t),r=Object.keys(e).filter(a=>n.indexOf(a)!==-1),i={...e,...t};for(const a of r){const l=XS(e[a],t[a]);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};i[a]=l.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],a=t[r],l=XS(i,a);if(!l.valid)return{valid:!1,mergeErrorPath:[r,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function L2(e,t,n){const r=new Map;let i;for(const u of t.issues)if(u.code==="unrecognized_keys"){i??(i=u);for(const d of u.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(u);for(const u of n.issues)if(u.code==="unrecognized_keys")for(const d of u.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(u);const a=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length&&i&&e.issues.push({...i,keys:a}),Au(e))return e;const l=XS(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 NZ=ve("$ZodRecord",(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Wu(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],l=t.keyType._zod.values;if(l){n.value={};const u=new Set;for(const f of l)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){u.add(typeof f=="number"?f.toString():f);const p=t.valueType._zod.run({value:i[f],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...Ou(f,m.issues)),n.value[f]=m.value})):(p.issues.length&&n.issues.push(...Ou(f,p.issues)),n.value[f]=p.value)}let d;for(const f in i)u.has(f)||(d=d??[],d.push(f));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:d})}else{n.value={};for(const u of Reflect.ownKeys(i)){if(u==="__proto__")continue;let d=t.keyType._zod.run({value:u,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&a4.test(u)&&d.issues.length){const m=t.keyType._zod.run({value:Number(u),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(d=m)}if(d.issues.length){t.mode==="loose"?n.value[u]=i[u]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>Ho(m,r,Fo())),input:u,path:[u],inst:e});continue}const p=t.valueType._zod.run({value:i[u],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...Ou(u,m.issues)),n.value[d.value]=m.value})):(p.issues.length&&n.issues.push(...Ou(u,p.issues)),n.value[d.value]=p.value)}}return a.length?Promise.all(a).then(()=>n):n}}),kZ=ve("$ZodEnum",(e,t)=>{xn.init(e,t);const n=Y5(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>IW.has(typeof i)).map(i=>typeof i=="string"?Yu(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const l=i.value;return r.has(l)||i.issues.push({code:"invalid_value",values:n,input:l,inst:e}),i}}),CZ=ve("$ZodLiteral",(e,t)=>{if(xn.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Yu(r):r?Yu(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const a=r.value;return n.has(a)||r.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),r}}),AZ=ve("$ZodTransform",(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Q5(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(n.value=l,n));if(i instanceof Promise)throw new Iu;return n.value=i,n}});function $2(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const p4=ve("$ZodOptional",(e,t)=>{xn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Dt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Dt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${XN(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>$2(a,n.value)):$2(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),OZ=ve("$ZodExactOptional",(e,t)=>{p4.init(e,t),Dt(e._zod,"values",()=>t.innerType._zod.values),Dt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),EZ=ve("$ZodNullable",(e,t)=>{xn.init(e,t),Dt(e._zod,"optin",()=>t.innerType._zod.optin),Dt(e._zod,"optout",()=>t.innerType._zod.optout),Dt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${XN(n.source)}|null)$`):void 0}),Dt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),_Z=ve("$ZodDefault",(e,t)=>{xn.init(e,t),e._zod.optin="optional",Dt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>B2(a,t)):B2(i,t)}});function B2(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const zZ=ve("$ZodPrefault",(e,t)=>{xn.init(e,t),e._zod.optin="optional",Dt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),TZ=ve("$ZodNonOptional",(e,t)=>{xn.init(e,t),Dt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>U2(a,e)):U2(i,e)}});function U2(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const PZ=ve("$ZodCatch",(e,t)=>{xn.init(e,t),Dt(e._zod,"optin",()=>t.innerType._zod.optin),Dt(e._zod,"optout",()=>t.innerType._zod.optout),Dt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(l=>Ho(l,r,Fo()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>Ho(a,r,Fo()))},input:n.value}),n.issues=[]),n)}}),RZ=ve("$ZodPipe",(e,t)=>{xn.init(e,t),Dt(e._zod,"values",()=>t.in._zod.values),Dt(e._zod,"optin",()=>t.in._zod.optin),Dt(e._zod,"optout",()=>t.out._zod.optout),Dt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const a=t.out._zod.run(n,r);return a instanceof Promise?a.then(l=>Fm(l,t.in,r)):Fm(a,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>Fm(a,t.out,r)):Fm(i,t.out,r)}});function Fm(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const DZ=ve("$ZodReadonly",(e,t)=>{xn.init(e,t),Dt(e._zod,"propValues",()=>t.innerType._zod.propValues),Dt(e._zod,"values",()=>t.innerType._zod.values),Dt(e._zod,"optin",()=>t.innerType?._zod?.optin),Dt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(q2):q2(i)}});function q2(e){return e.value=Object.freeze(e.value),e}const MZ=ve("$ZodCustom",(e,t)=>{ni.init(e,t),xn.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(a=>F2(a,n,r,e));F2(i,n,r,e)}});function F2(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(wh(i))}}var H2;class IZ{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 LZ(){return new IZ}(H2=globalThis).__zod_globalRegistry??(H2.__zod_globalRegistry=LZ());const Jf=globalThis.__zod_globalRegistry;function $Z(e,t){return new e({type:"string",...Fe(t)})}function BZ(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Fe(t)})}function K2(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Fe(t)})}function UZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Fe(t)})}function qZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Fe(t)})}function FZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Fe(t)})}function HZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Fe(t)})}function KZ(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Fe(t)})}function GZ(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Fe(t)})}function VZ(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Fe(t)})}function QZ(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Fe(t)})}function WZ(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Fe(t)})}function YZ(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Fe(t)})}function ZZ(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Fe(t)})}function XZ(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Fe(t)})}function JZ(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Fe(t)})}function eX(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Fe(t)})}function tX(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Fe(t)})}function nX(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Fe(t)})}function rX(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Fe(t)})}function iX(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Fe(t)})}function aX(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Fe(t)})}function sX(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Fe(t)})}function oX(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Fe(t)})}function lX(e,t){return new e({type:"string",format:"date",check:"string_format",...Fe(t)})}function cX(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Fe(t)})}function uX(e,t){return new e({type:"string",format:"duration",check:"string_format",...Fe(t)})}function dX(e,t){return new e({type:"number",checks:[],...Fe(t)})}function fX(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Fe(t)})}function hX(e,t){return new e({type:"boolean",...Fe(t)})}function pX(e){return new e({type:"unknown"})}function mX(e,t){return new e({type:"never",...Fe(t)})}function G2(e,t){return new o4({check:"less_than",...Fe(t),value:e,inclusive:!1})}function bw(e,t){return new o4({check:"less_than",...Fe(t),value:e,inclusive:!0})}function V2(e,t){return new l4({check:"greater_than",...Fe(t),value:e,inclusive:!1})}function ww(e,t){return new l4({check:"greater_than",...Fe(t),value:e,inclusive:!0})}function Q2(e,t){return new _Y({check:"multiple_of",...Fe(t),value:e})}function m4(e,t){return new TY({check:"max_length",...Fe(t),maximum:e})}function sy(e,t){return new PY({check:"min_length",...Fe(t),minimum:e})}function g4(e,t){return new RY({check:"length_equals",...Fe(t),length:e})}function gX(e,t){return new DY({check:"string_format",format:"regex",...Fe(t),pattern:e})}function yX(e){return new MY({check:"string_format",format:"lowercase",...Fe(e)})}function vX(e){return new IY({check:"string_format",format:"uppercase",...Fe(e)})}function xX(e,t){return new LY({check:"string_format",format:"includes",...Fe(t),includes:e})}function bX(e,t){return new $Y({check:"string_format",format:"starts_with",...Fe(t),prefix:e})}function wX(e,t){return new BY({check:"string_format",format:"ends_with",...Fe(t),suffix:e})}function gd(e){return new UY({check:"overwrite",tx:e})}function jX(e){return gd(t=>t.normalize(e))}function SX(){return gd(e=>e.trim())}function NX(){return gd(e=>e.toLowerCase())}function kX(){return gd(e=>e.toUpperCase())}function CX(){return gd(e=>DW(e))}function AX(e,t,n){return new e({type:"array",element:t,...Fe(n)})}function OX(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Fe(n)})}function EX(e){const t=_X(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(wh(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(wh(i))}},e(n.value,n)));return t}function _X(e,t){const n=new ni({check:"custom",...Fe(t)});return n._zod.check=e,n}function y4(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Jf,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Un(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,p);else{const g=l.schema,v=t.processors[i.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);v(e,t,g,p)}const m=e._zod.parent;m&&(l.ref||(l.ref=m),Un(m,t,p),t.seen.get(m).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&zr(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 v4(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const l of e.seen.entries()){const u=e.metadataRegistry.get(l[0])?.id;if(u){const d=r.get(u);if(d&&d!==l[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(u,l[0])}}const i=l=>{const u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(l[0])?.id,g=e.external.uri??(j=>j);if(m)return{ref:g(m)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${g("__shared")}#/${u}/${v}`}}if(l[1]===n)return{ref:"#"};const f=`#/${u}/`,p=l[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},a=l=>{if(l[1].schema.$ref)return;const u=l[1],{ref:d,defId:f}=i(l);u.def={...u.schema},f&&(u.defId=f);const p=u.schema;for(const m in p)delete p[m];p.$ref=d};if(e.cycles==="throw")for(const l of e.seen.entries()){const u=l[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
46
+
47
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const u=l[1];if(t===l[0]){a(l);continue}if(e.external){const f=e.external.registry.get(l[0])?.id;if(t!==l[0]&&f){a(l);continue}}if(e.metadataRegistry.get(l[0])?.id){a(l);continue}if(u.cycle){a(l);continue}if(u.count>1&&e.reused==="ref"){a(l);continue}}}function x4(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const u=e.seen.get(l);if(u.ref===null)return;const d=u.def??u.schema,f={...d},p=u.ref;if(u.ref=null,p){r(p);const g=e.seen.get(p),v=g.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):Object.assign(d,v),Object.assign(d,f),l._zod.parent===p)for(const b in d)b==="$ref"||b==="allOf"||b in f||delete d[b];if(v.$ref&&g.def)for(const b in d)b==="$ref"||b==="allOf"||b in g.def&&JSON.stringify(d[b])===JSON.stringify(g.def[b])&&delete d[b]}const m=l._zod.parent;if(m&&m!==p){r(m);const g=e.seen.get(m);if(g?.schema.$ref&&(d.$ref=g.schema.$ref,g.def))for(const v in d)v==="$ref"||v==="allOf"||v in g.def&&JSON.stringify(d[v])===JSON.stringify(g.def[v])&&delete d[v]}e.override({zodSchema:l,jsonSchema:d,path:u.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(l)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const l of e.seen.entries()){const u=l[1];u.def&&u.defId&&(a[u.defId]=u.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:oy(t,"input",e.processors),output:oy(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function zr(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 zr(r.element,n);if(r.type==="set")return zr(r.valueType,n);if(r.type==="lazy")return zr(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 zr(r.innerType,n);if(r.type==="intersection")return zr(r.left,n)||zr(r.right,n);if(r.type==="record"||r.type==="map")return zr(r.keyType,n)||zr(r.valueType,n);if(r.type==="pipe")return zr(r.in,n)||zr(r.out,n);if(r.type==="object"){for(const i in r.shape)if(zr(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(zr(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(zr(i,n))return!0;return!!(r.rest&&zr(r.rest,n))}return!1}const zX=(e,t={})=>n=>{const r=y4({...n,processors:t});return Un(e,r),v4(r,e),x4(r,e)},oy=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},l=y4({...i??{},target:a,io:t,processors:n});return Un(e,l),v4(l,e),x4(l,e)},TX={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},PX=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:a,maximum:l,format:u,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof l=="number"&&(i.maxLength=l),u&&(i.format=TX[u]??u,i.format===""&&delete i.format,u==="time"&&delete i.format),f&&(i.contentEncoding=f),d&&d.size>0){const p=[...d];p.length===1?i.pattern=p[0].source:p.length>1&&(i.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},RX=(e,t,n,r)=>{const i=n,{minimum:a,maximum:l,format:u,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:p}=e._zod.bag;typeof u=="string"&&u.includes("int")?i.type="integer":i.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=p,i.exclusiveMinimum=!0):i.exclusiveMinimum=p),typeof a=="number"&&(i.minimum=a,typeof p=="number"&&t.target!=="draft-04"&&(p>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=f,i.exclusiveMaximum=!0):i.exclusiveMaximum=f),typeof l=="number"&&(i.maximum=l,typeof f=="number"&&t.target!=="draft-04"&&(f<=l?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},DX=(e,t,n,r)=>{n.type="boolean"},MX=(e,t,n,r)=>{n.not={}},IX=(e,t,n,r)=>{},LX=(e,t,n,r)=>{const i=e._zod.def,a=Y5(i.entries);a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),n.enum=a},$X=(e,t,n,r)=>{const i=e._zod.def,a=[];for(const l of i.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(l))}else a.push(l);if(a.length!==0)if(a.length===1){const l=a[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),a.every(l=>typeof l=="boolean")&&(n.type="boolean"),a.every(l=>l===null)&&(n.type="null"),n.enum=a},BX=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},UX=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},qX=(e,t,n,r)=>{const i=n,a=e._zod.def,{minimum:l,maximum:u}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof u=="number"&&(i.maxItems=u),i.type="array",i.items=Un(a.element,t,{...r,path:[...r.path,"items"]})},FX=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const l=a.shape;for(const f in l)i.properties[f]=Un(l[f],t,{...r,path:[...r.path,"properties",f]});const u=new Set(Object.keys(l)),d=new Set([...u].filter(f=>{const p=a.shape[f]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(i.required=Array.from(d)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Un(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},HX=(e,t,n,r)=>{const i=e._zod.def,a=i.inclusive===!1,l=i.options.map((u,d)=>Un(u,t,{...r,path:[...r.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=l:n.anyOf=l},KX=(e,t,n,r)=>{const i=e._zod.def,a=Un(i.left,t,{...r,path:[...r.path,"allOf",0]}),l=Un(i.right,t,{...r,path:[...r.path,"allOf",1]}),u=f=>"allOf"in f&&Object.keys(f).length===1,d=[...u(a)?a.allOf:[a],...u(l)?l.allOf:[l]];n.allOf=d},GX=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object";const l=a.keyType,d=l._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){const p=Un(a.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const m of d)i.patternProperties[m.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=Un(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Un(a.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=l._zod.values;if(f){const p=[...f].filter(m=>typeof m=="string"||typeof m=="number");p.length>0&&(i.required=p)}},VX=(e,t,n,r)=>{const i=e._zod.def,a=Un(i.innerType,t,r),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},QX=(e,t,n,r)=>{const i=e._zod.def;Un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},WX=(e,t,n,r)=>{const i=e._zod.def;Un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},YX=(e,t,n,r)=>{const i=e._zod.def;Un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},ZX=(e,t,n,r)=>{const i=e._zod.def;Un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType;let l;try{l=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},XX=(e,t,n,r)=>{const i=e._zod.def,a=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Un(a,t,r);const l=t.seen.get(e);l.ref=a},JX=(e,t,n,r)=>{const i=e._zod.def;Un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},b4=(e,t,n,r)=>{const i=e._zod.def;Un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},eJ=ve("ZodISODateTime",(e,t)=>{tZ.init(e,t),wn.init(e,t)});function tJ(e){return oX(eJ,e)}const nJ=ve("ZodISODate",(e,t)=>{nZ.init(e,t),wn.init(e,t)});function rJ(e){return lX(nJ,e)}const iJ=ve("ZodISOTime",(e,t)=>{rZ.init(e,t),wn.init(e,t)});function aJ(e){return cX(iJ,e)}const sJ=ve("ZodISODuration",(e,t)=>{iZ.init(e,t),wn.init(e,t)});function oJ(e){return uX(sJ,e)}const lJ=(e,t)=>{e4.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>QW(e,n)},flatten:{value:n=>VW(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,ZS,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,ZS,2)}},isEmpty:{get(){return e.issues.length===0}}})},Wi=ve("ZodError",lJ,{Parent:Error}),cJ=ek(Wi),uJ=tk(Wi),dJ=_v(Wi),fJ=zv(Wi),hJ=ZW(Wi),pJ=XW(Wi),mJ=JW(Wi),gJ=eY(Wi),yJ=tY(Wi),vJ=nY(Wi),xJ=rY(Wi),bJ=iY(Wi),bn=ve("ZodType",(e,t)=>(xn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:oy(e,"input"),output:oy(e,"output")}}),e.toJSONSchema=zX(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Yo(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Zo(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>cJ(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>dJ(e,n,r),e.parseAsync=async(n,r)=>uJ(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>fJ(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>hJ(e,n,r),e.decode=(n,r)=>pJ(e,n,r),e.encodeAsync=async(n,r)=>mJ(e,n,r),e.decodeAsync=async(n,r)=>gJ(e,n,r),e.safeEncode=(n,r)=>yJ(e,n,r),e.safeDecode=(n,r)=>vJ(e,n,r),e.safeEncodeAsync=async(n,r)=>xJ(e,n,r),e.safeDecodeAsync=async(n,r)=>bJ(e,n,r),e.refine=(n,r)=>e.check(mee(n,r)),e.superRefine=n=>e.check(gee(n)),e.overwrite=n=>e.check(gd(n)),e.optional=()=>Z2(e),e.exactOptional=()=>nee(e),e.nullable=()=>X2(e),e.nullish=()=>Z2(X2(e)),e.nonoptional=n=>lee(e,n),e.array=()=>Ae(e),e.or=n=>GJ([e,n]),e.and=n=>YJ(e,n),e.transform=n=>J2(e,eee(n)),e.default=n=>aee(e,n),e.prefault=n=>oee(e,n),e.catch=n=>uee(e,n),e.pipe=n=>J2(e,n),e.readonly=()=>hee(e),e.describe=n=>{const r=e.clone();return Jf.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Jf.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Jf.get(e);const r=e.clone();return Jf.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),w4=ve("_ZodString",(e,t)=>{nk.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>PX(e,r,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(gX(...r)),e.includes=(...r)=>e.check(xX(...r)),e.startsWith=(...r)=>e.check(bX(...r)),e.endsWith=(...r)=>e.check(wX(...r)),e.min=(...r)=>e.check(sy(...r)),e.max=(...r)=>e.check(m4(...r)),e.length=(...r)=>e.check(g4(...r)),e.nonempty=(...r)=>e.check(sy(1,...r)),e.lowercase=r=>e.check(yX(r)),e.uppercase=r=>e.check(vX(r)),e.trim=()=>e.check(SX()),e.normalize=(...r)=>e.check(jX(...r)),e.toLowerCase=()=>e.check(NX()),e.toUpperCase=()=>e.check(kX()),e.slugify=()=>e.check(CX())}),wJ=ve("ZodString",(e,t)=>{nk.init(e,t),w4.init(e,t),e.email=n=>e.check(BZ(jJ,n)),e.url=n=>e.check(KZ(SJ,n)),e.jwt=n=>e.check(sX(LJ,n)),e.emoji=n=>e.check(GZ(NJ,n)),e.guid=n=>e.check(K2(W2,n)),e.uuid=n=>e.check(UZ(Hm,n)),e.uuidv4=n=>e.check(qZ(Hm,n)),e.uuidv6=n=>e.check(FZ(Hm,n)),e.uuidv7=n=>e.check(HZ(Hm,n)),e.nanoid=n=>e.check(VZ(kJ,n)),e.guid=n=>e.check(K2(W2,n)),e.cuid=n=>e.check(QZ(CJ,n)),e.cuid2=n=>e.check(WZ(AJ,n)),e.ulid=n=>e.check(YZ(OJ,n)),e.base64=n=>e.check(rX(DJ,n)),e.base64url=n=>e.check(iX(MJ,n)),e.xid=n=>e.check(ZZ(EJ,n)),e.ksuid=n=>e.check(XZ(_J,n)),e.ipv4=n=>e.check(JZ(zJ,n)),e.ipv6=n=>e.check(eX(TJ,n)),e.cidrv4=n=>e.check(tX(PJ,n)),e.cidrv6=n=>e.check(nX(RJ,n)),e.e164=n=>e.check(aX(IJ,n)),e.datetime=n=>e.check(tJ(n)),e.date=n=>e.check(rJ(n)),e.time=n=>e.check(aJ(n)),e.duration=n=>e.check(oJ(n))});function R(e){return $Z(wJ,e)}const wn=ve("ZodStringFormat",(e,t)=>{pn.init(e,t),w4.init(e,t)}),jJ=ve("ZodEmail",(e,t)=>{GY.init(e,t),wn.init(e,t)}),W2=ve("ZodGUID",(e,t)=>{HY.init(e,t),wn.init(e,t)}),Hm=ve("ZodUUID",(e,t)=>{KY.init(e,t),wn.init(e,t)}),SJ=ve("ZodURL",(e,t)=>{VY.init(e,t),wn.init(e,t)}),NJ=ve("ZodEmoji",(e,t)=>{QY.init(e,t),wn.init(e,t)}),kJ=ve("ZodNanoID",(e,t)=>{WY.init(e,t),wn.init(e,t)}),CJ=ve("ZodCUID",(e,t)=>{YY.init(e,t),wn.init(e,t)}),AJ=ve("ZodCUID2",(e,t)=>{ZY.init(e,t),wn.init(e,t)}),OJ=ve("ZodULID",(e,t)=>{XY.init(e,t),wn.init(e,t)}),EJ=ve("ZodXID",(e,t)=>{JY.init(e,t),wn.init(e,t)}),_J=ve("ZodKSUID",(e,t)=>{eZ.init(e,t),wn.init(e,t)}),zJ=ve("ZodIPv4",(e,t)=>{aZ.init(e,t),wn.init(e,t)}),TJ=ve("ZodIPv6",(e,t)=>{sZ.init(e,t),wn.init(e,t)}),PJ=ve("ZodCIDRv4",(e,t)=>{oZ.init(e,t),wn.init(e,t)}),RJ=ve("ZodCIDRv6",(e,t)=>{lZ.init(e,t),wn.init(e,t)}),DJ=ve("ZodBase64",(e,t)=>{cZ.init(e,t),wn.init(e,t)}),MJ=ve("ZodBase64URL",(e,t)=>{dZ.init(e,t),wn.init(e,t)}),IJ=ve("ZodE164",(e,t)=>{fZ.init(e,t),wn.init(e,t)}),LJ=ve("ZodJWT",(e,t)=>{pZ.init(e,t),wn.init(e,t)}),j4=ve("ZodNumber",(e,t)=>{u4.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>RX(e,r,i),e.gt=(r,i)=>e.check(V2(r,i)),e.gte=(r,i)=>e.check(ww(r,i)),e.min=(r,i)=>e.check(ww(r,i)),e.lt=(r,i)=>e.check(G2(r,i)),e.lte=(r,i)=>e.check(bw(r,i)),e.max=(r,i)=>e.check(bw(r,i)),e.int=r=>e.check(Y2(r)),e.safe=r=>e.check(Y2(r)),e.positive=r=>e.check(V2(0,r)),e.nonnegative=r=>e.check(ww(0,r)),e.negative=r=>e.check(G2(0,r)),e.nonpositive=r=>e.check(bw(0,r)),e.multipleOf=(r,i)=>e.check(Q2(r,i)),e.step=(r,i)=>e.check(Q2(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 fe(e){return dX(j4,e)}const $J=ve("ZodNumberFormat",(e,t)=>{mZ.init(e,t),j4.init(e,t)});function Y2(e){return fX($J,e)}const BJ=ve("ZodBoolean",(e,t)=>{gZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>DX(e,n,r)});function ct(e){return hX(BJ,e)}const UJ=ve("ZodUnknown",(e,t)=>{yZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>IX()});function Zu(){return pX(UJ)}const qJ=ve("ZodNever",(e,t)=>{vZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>MX(e,n,r)});function FJ(e){return mX(qJ,e)}const HJ=ve("ZodArray",(e,t)=>{xZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>qX(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(sy(n,r)),e.nonempty=n=>e.check(sy(1,n)),e.max=(n,r)=>e.check(m4(n,r)),e.length=(n,r)=>e.check(g4(n,r)),e.unwrap=()=>e.element});function Ae(e,t){return AX(HJ,e,t)}const KJ=ve("ZodObject",(e,t)=>{wZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>FX(e,n,r,i),Dt(e,"shape",()=>t.shape),e.keyof=()=>Je(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Zu()}),e.loose=()=>e.clone({...e._zod.def,catchall:Zu()}),e.strict=()=>e.clone({...e._zod.def,catchall:FJ()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>qW(e,n),e.safeExtend=n=>FW(e,n),e.merge=n=>HW(e,n),e.pick=n=>BW(e,n),e.omit=n=>UW(e,n),e.partial=(...n)=>KW(N4,e,n[0]),e.required=(...n)=>GW(k4,e,n[0])});function me(e,t){const n={type:"object",shape:e??{},...Fe(t)};return new KJ(n)}const S4=ve("ZodUnion",(e,t)=>{h4.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>HX(e,n,r,i),e.options=t.options});function GJ(e,t){return new S4({type:"union",options:e,...Fe(t)})}const VJ=ve("ZodDiscriminatedUnion",(e,t)=>{S4.init(e,t),jZ.init(e,t)});function QJ(e,t,n){return new VJ({type:"union",options:t,discriminator:e,...Fe(n)})}const WJ=ve("ZodIntersection",(e,t)=>{SZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>KX(e,n,r,i)});function YJ(e,t){return new WJ({type:"intersection",left:e,right:t})}const ZJ=ve("ZodRecord",(e,t)=>{NZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>GX(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function Is(e,t,n){return new ZJ({type:"record",keyType:e,valueType:t,...Fe(n)})}const JS=ve("ZodEnum",(e,t)=>{kZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>LX(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const a={};for(const l of r)if(n.has(l))a[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new JS({...t,checks:[],...Fe(i),entries:a})},e.exclude=(r,i)=>{const a={...t.entries};for(const l of r)if(n.has(l))delete a[l];else throw new Error(`Key ${l} not found in enum`);return new JS({...t,checks:[],...Fe(i),entries:a})}});function Je(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new JS({type:"enum",entries:n,...Fe(t)})}const XJ=ve("ZodLiteral",(e,t)=>{CZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>$X(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ki(e,t){return new XJ({type:"literal",values:Array.isArray(e)?e:[e],...Fe(t)})}const JJ=ve("ZodTransform",(e,t)=>{AZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>UX(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Q5(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(wh(a,n.value,t));else{const l=a;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(wh(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function eee(e){return new JJ({type:"transform",transform:e})}const N4=ve("ZodOptional",(e,t)=>{p4.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>b4(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Z2(e){return new N4({type:"optional",innerType:e})}const tee=ve("ZodExactOptional",(e,t)=>{OZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>b4(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function nee(e){return new tee({type:"optional",innerType:e})}const ree=ve("ZodNullable",(e,t)=>{EZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>VX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function X2(e){return new ree({type:"nullable",innerType:e})}const iee=ve("ZodDefault",(e,t)=>{_Z.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>WX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function aee(e,t){return new iee({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():X5(t)}})}const see=ve("ZodPrefault",(e,t)=>{zZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>YX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function oee(e,t){return new see({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():X5(t)}})}const k4=ve("ZodNonOptional",(e,t)=>{TZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>QX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function lee(e,t){return new k4({type:"nonoptional",innerType:e,...Fe(t)})}const cee=ve("ZodCatch",(e,t)=>{PZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ZX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function uee(e,t){return new cee({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const dee=ve("ZodPipe",(e,t)=>{RZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>XX(e,n,r,i),e.in=t.in,e.out=t.out});function J2(e,t){return new dee({type:"pipe",in:e,out:t})}const fee=ve("ZodReadonly",(e,t)=>{DZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>JX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function hee(e){return new fee({type:"readonly",innerType:e})}const pee=ve("ZodCustom",(e,t)=>{MZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>BX(e,n)});function mee(e,t={}){return OX(pee,e,t)}function gee(e){return EX(e)}me({maxConcurrency:fe().int().positive(),maxRequestsPerMinute:fe().int().positive(),maxRequestsPerDay:fe().int().positive()});const Ls=R().min(1);R().min(1);const rk=me({label:R().min(1),city:R().min(1),region:R().min(1),country:R().length(2),timezone:R().optional()}),ik=Je(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);me({id:R(),projectId:R(),channel:Ki("webhook"),url:R().url(),urlDisplay:R(),urlHost:R(),events:Ae(ik),enabled:ct().default(!0),source:R().optional(),webhookSecret:R().optional(),createdAt:R(),updatedAt:R()});me({channel:Ki("webhook"),url:R().url(),events:Ae(ik).min(1),source:R().optional()});const C4=Je(["cli","api","config-file"]);function yee(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 vee(e,t){return t?e.some(n=>n.label===t):!0}me({displayName:R().min(1),canonicalDomain:R().min(1),ownedDomains:Ae(R().min(1)).optional(),country:R().length(2),language:R().min(2),tags:Ae(R()).optional(),labels:Is(R(),R()).optional(),providers:Ae(Ls).optional(),locations:Ae(rk).optional(),defaultLocation:R().nullable().optional(),autoExtractBacklinks:ct().optional(),configSource:C4.optional()});me({id:R(),name:R(),displayName:R().optional(),canonicalDomain:R(),ownedDomains:Ae(R()).default([]),country:R().length(2),language:R().min(2),tags:Ae(R()).default([]),labels:Is(R(),R()).default({}),locations:Ae(rk).default([]),defaultLocation:R().nullable().optional(),autoExtractBacklinks:ct().default(!1),configSource:C4.default("cli"),configRevision:fe().int().positive().default(1),createdAt:R().optional(),updatedAt:R().optional()});me({id:R(),query:R(),createdAt:R()});me({id:R(),keyword:R(),createdAt:R()});me({queries:Ae(R().trim().min(1)).min(1)});me({keywords:Ae(R().trim().min(1)).min(1)});me({provider:Ls,count:fe().int().min(1).max(20).optional()});me({id:R(),domain:R(),createdAt:R()});me({competitors:Ae(R().trim().min(1)).min(1)});function ly(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}const xee=new Set(["ac.uk","co.id","co.il","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.au","com.br","com.cn","com.mx","com.ph","com.sg","com.tr","edu.au","edu.sg","gov.au","gov.uk","me.uk","ne.jp","net.au","net.br","net.cn","net.in","net.tr","or.jp","or.kr","org.au","org.br","org.in","org.nz","org.tr","org.uk","org.za"]);function bee(e){const t=ly(e);if(!t)return"";const n=t.split("/")[0]?.split(":")[0]??"";if(!n)return"";const r=n.split(".").filter(Boolean);if(r.length<2)return"";if(r.length===2)return r.join(".");const i=r.slice(-2).join(".");return xee.has(i)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function wee(e){const t=bee(e);return t?t.split(".")[0]??"":""}function jee(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],n=new Set,r=[];for(const i of t){const a=i.trim();if(!a)continue;const l=ly(a);n.has(l)||(n.add(l),r.push(a))}return r}const See=me({name:R().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,{message:"Name must be a lowercase slug (letters, numbers, hyphens)"}),labels:Is(R(),R()).optional().default({})}),Nee=me({preset:R().optional(),cron:R().optional(),timezone:R().optional().default("UTC"),providers:Ae(Ls).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),kee=me({channel:Ki("webhook"),url:R().url(),events:Ae(ik).min(1)}),Cee=me({gsc:me({propertyUrl:R()}).optional(),syncSchedule:me({preset:R().optional(),cron:R().optional()}).optional()}).optional(),eT=Ae(R().min(1)),Aee=me({displayName:R().min(1),canonicalDomain:R().min(1),ownedDomains:Ae(R().min(1)).optional().default([]),country:R().length(2),language:R().min(2),queries:eT.optional(),keywords:eT.optional(),competitors:Ae(R().min(1)).optional().default([]),providers:Ae(Ls).optional().default([]),locations:Ae(rk).optional().default([]),defaultLocation:R().optional(),schedule:Nee,notifications:Ae(kee).optional().default([]),google:Cee,autoExtractBacklinks:ct().optional().default(!1)}).superRefine((e,t)=>{e.queries!==void 0&&e.keywords!==void 0&&t.addIssue({code:"custom",message:"Use spec.queries; spec.keywords is accepted only as a legacy alias when spec.queries is omitted",path:["keywords"]});const n=yee(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),vee(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});me({apiVersion:Ki("canonry/v1"),kind:Ki("Project"),metadata:See,spec:Aee});const Oee=Je(["gsc","ga4"]);me({id:R(),domain:R(),connectionType:Oee,propertyId:R().nullable().optional(),sitemapUrl:R().nullable().optional(),scopes:Ae(R()).default([]),createdAt:R(),updatedAt:R()});me({date:R(),query:R(),page:R(),country:R().nullable().optional(),device:R().nullable().optional(),clicks:fe(),impressions:fe(),ctr:fe(),position:fe()});const e1=me({id:R(),url:R(),indexingState:R().nullable().optional(),verdict:R().nullable().optional(),coverageState:R().nullable().optional(),pageFetchState:R().nullable().optional(),robotsTxtState:R().nullable().optional(),crawlTime:R().nullable().optional(),lastCrawlResult:R().nullable().optional(),isMobileFriendly:ct().nullable().optional(),richResults:Ae(R()).default([]),inspectedAt:R()});Je(["stable","reindexed","deindexed","still-missing","new"]);const Eee=me({url:R(),previousState:R().nullable(),currentState:R().nullable(),transitionDate:R()}),_ee=me({reason:R(),count:fe(),urls:Ae(e1).default([])});me({summary:me({total:fe(),indexed:fe(),notIndexed:fe(),deindexed:fe(),percentage:fe()}),lastInspectedAt:R().nullable(),lastSyncedAt:R().nullable(),indexed:Ae(e1).default([]),notIndexed:Ae(e1).default([]),deindexed:Ae(Eee).default([]),reasonGroups:Ae(_ee).default([])});me({url:R(),type:Je(["URL_UPDATED","URL_DELETED"]),notifiedAt:R()});me({url:R(),type:Je(["URL_UPDATED","URL_DELETED"]),notifiedAt:R(),status:Je(["success","error"]),error:R().optional()});me({date:R(),indexed:fe(),notIndexed:fe(),reasonBreakdown:Is(R(),fe()).default({})});me({id:R(),domain:R(),siteUrl:R().nullable().optional(),createdAt:R(),updatedAt:R()});const jw=me({id:R(),url:R(),httpCode:fe().nullable().optional(),inIndex:ct().nullable().optional(),lastCrawledDate:R().nullable().optional(),inIndexDate:R().nullable().optional(),inspectedAt:R(),documentSize:fe().nullable().optional(),anchorCount:fe().nullable().optional(),discoveryDate:R().nullable().optional()});me({summary:me({total:fe(),indexed:fe(),notIndexed:fe(),unknown:fe().optional(),percentage:fe()}),lastInspectedAt:R().nullable(),indexed:Ae(jw).default([]),notIndexed:Ae(jw).default([]),unknown:Ae(jw).default([]).optional()});me({query:R(),impressions:fe(),clicks:fe(),ctr:fe(),averagePosition:fe()});me({date:R(),indexed:fe(),notIndexed:fe(),unknown:fe()});me({url:R(),status:Je(["success","error"]),submittedAt:R(),error:R().optional()});const yd=Je(["live","staging"]);me({projectName:R(),url:R(),stagingUrl:R().optional(),username:R(),defaultEnv:yd,createdAt:R(),updatedAt:R()});const tT=me({url:R(),reachable:ct(),pageCount:fe().nullable().optional(),version:R().nullable().optional(),error:R().nullable().optional(),plugins:Ae(R()).optional(),authenticatedUser:me({id:fe(),slug:R()}).nullable().optional()});me({connected:ct(),projectName:R(),defaultEnv:yd,live:tT.nullable(),staging:tT.nullable(),adminUrl:R().nullable().optional()});const zee=me({id:fe(),slug:R(),title:R(),status:R(),modifiedAt:R().nullable().optional(),link:R().nullable().optional()}),A4=me({title:R().nullable(),description:R().nullable(),noindex:ct().nullable(),writable:ct().default(!1),writeTargets:Ae(R()).default([])}),Tee=me({type:R(),json:Is(R(),Zu())}),Pee=zee.extend({env:yd,content:R(),seo:A4,schemaBlocks:Ae(Tee).default([])}),nT=Pee.extend({contentHash:R(),contentSnippet:R()}),O4=me({manualRequired:Ki(!0),targetUrl:R(),adminUrl:R().nullable().optional(),content:R(),nextSteps:Ae(R()).default([])}),Ree=me({slug:R(),severity:Je(["high","medium","low"]),code:Je(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:R()});me({slug:R(),title:R(),status:R(),wordCount:fe(),seo:A4,schemaPresent:ct(),issues:Ae(Ree).default([])});const Dee=me({slug:R(),status:Je(["applied","skipped","manual"]),error:R().optional(),manualAssist:O4.optional()});me({env:yd,strategy:Je(["plugin","manual"]),results:Ae(Dee)});const Mee=me({slug:R(),status:Je(["deployed","stripped","skipped","failed"]),schemasInjected:Ae(R()).optional(),manualAssist:O4.optional(),error:R().optional()});me({env:yd,results:Ae(Mee)});const Iee=me({slug:R(),title:R(),canonrySchemas:Ae(R()),thirdPartySchemas:Ae(R()),hasCanonrySchema:ct()});me({env:yd,pages:Ae(Iee)});const Lee=me({name:R(),status:Je(["completed","skipped","failed"]),summary:R().optional(),error:R().optional()});me({projectName:R(),steps:Ae(Lee)});me({slug:R(),live:nT,staging:nT,hasDifferences:ct(),differences:me({title:ct(),slug:ct(),content:ct(),seoTitle:ct(),seoDescription:ct(),noindex:ct(),schema:ct()})});const E4=Je(["queued","running","completed","partial","failed","cancelled"]),hr=E4.enum,_4=Je(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","bing-inspect-sitemap","backlink-extract"]),Tt=_4.enum,z4=Je(["manual","scheduled","config-apply"]),sh=z4.enum,Xu=Je(["cited","not-cited"]),Ju=Xu.enum,cy=Je(["visible","not-visible"]);cy.enum;const T4=Je(["new","cited","lost","emerging","not-cited"]);T4.enum;me({kind:Ki(Tt["answer-visibility"]).optional(),trigger:Ki(sh.manual).optional(),providers:Ae(Ls).optional(),location:R().min(1).optional(),allLocations:ct().optional(),noLocation:ct().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const $ee=me({message:R(),raw:Zu().optional()}),Bee=me({message:R().optional(),providers:Is(R(),$ee).optional()}),Uee=me({id:R(),projectId:R(),kind:_4,status:E4,trigger:z4.default("manual"),location:R().nullable().optional(),startedAt:R().nullable().optional(),finishedAt:R().nullable().optional(),error:Bee.nullable().optional(),createdAt:R()});function ak(e){if(e.providers){const t=Object.entries(e.providers);if(t.length===1){const[n,r]=t[0];return`${n}: ${r.message}`}if(t.length>1)return t.map(([n,r])=>`${n}: ${r.message}`).join(" • ")}return e.message??"Run failed."}const P4=me({uri:R(),title:R()}),R4=me({id:R(),runId:R(),queryId:R(),query:R().optional(),provider:Ls,citationState:Xu,answerMentioned:ct().optional(),visibilityState:cy.optional(),transition:T4.optional(),answerText:R().nullable().optional(),citedDomains:Ae(R()).default([]),competitorOverlap:Ae(R()).default([]),recommendedCompetitors:Ae(R()).default([]),matchedTerms:Ae(R()).default([]),groundingSources:Ae(P4).default([]),searchQueries:Ae(R()).default([]),model:R().nullable().optional(),location:R().nullable().optional(),createdAt:R()});me({snapshots:Ae(R4),total:fe().int().nonnegative()});const qee=me({queryId:R().nullable(),query:R().nullable(),run1State:Xu.nullable(),run2State:Xu.nullable(),run1AnswerMentioned:ct().nullable(),run2AnswerMentioned:ct().nullable(),run1VisibilityState:cy.nullable(),run2VisibilityState:cy.nullable(),changed:ct(),visibilityChanged:ct()});me({run1:R(),run2:R(),diff:Ae(qee)});const Fee=Uee.extend({snapshots:Ae(R4).optional()});me({totalRuns:fe().int().nonnegative(),run:Fee.nullable()});me({id:R(),projectId:R().nullable().optional(),actor:R(),action:R(),entityType:R(),entityId:R().nullable().optional(),diff:Zu().optional(),createdAt:R()});const Hee=Je(["yes","no","unknown","not-mentioned"]),rT=Ae(R().min(1));me({companyName:R().min(1),domain:R().min(1),queries:rT.optional(),phrases:rT.optional(),competitors:Ae(R().min(1)).optional().default([])}).superRefine((e,t)=>{e.queries!==void 0&&e.phrases!==void 0&&t.addIssue({code:"custom",message:"Use queries; phrases is accepted only as a legacy alias when queries is omitted",path:["phrases"]})});const Kee=me({name:R(),count:fe().int().nonnegative()}),Gee=me({id:R(),name:R(),weight:fe(),score:fe(),grade:R(),status:Je(["pass","partial","fail"]),findings:Ae(me({type:R(),message:R()})).default([]),recommendations:Ae(R()).default([])}),Vee=me({url:R(),finalUrl:R(),auditedAt:R(),overallScore:fe(),overallGrade:R(),summary:R(),factors:Ae(Gee).default([])}),Qee=me({industry:R(),summary:R(),services:Ae(R()).default([]),categoryTerms:Ae(R()).default([])}),Wee=me({provider:R(),displayName:R(),model:R().nullable().optional(),mentioned:ct(),cited:ct(),describedAccurately:Hee,accuracyNotes:R().nullable().optional(),incorrectClaims:Ae(R()).default([]),recommendedCompetitors:Ae(R()).default([]),citedDomains:Ae(R()).default([]),groundingSources:Ae(P4).default([]),searchQueries:Ae(R()).default([]),answerText:R(),error:R().nullable().optional()}),Yee=me({query:R(),providerResults:Ae(Wee).default([])}),Zee=me({totalQueries:fe().int().nonnegative(),totalProviders:fe().int().nonnegative(),totalComparisons:fe().int().nonnegative(),mentionCount:fe().int().nonnegative(),citationCount:fe().int().nonnegative(),topCompetitors:Ae(Kee).default([]),visibilityGap:R(),whatThisMeans:Ae(R()).default([]),recommendedActions:Ae(R()).default([])});me({companyName:R(),domain:R(),homepageUrl:R(),generatedAt:R(),queries:Ae(R()).default([]),competitors:Ae(R()).default([]),profile:Qee,audit:Vee,queryResults:Ae(Yee).default([]),summary:Zee});me({id:R(),projectId:R(),cronExpr:R(),preset:R().nullable().optional(),timezone:R().default("UTC"),enabled:ct().default(!0),providers:Ae(Ls).default([]),lastRunAt:R().nullable().optional(),nextRunAt:R().nullable().optional(),createdAt:R(),updatedAt:R()});me({preset:R().optional(),cron:R().optional(),timezone:R().optional().default("UTC"),enabled:ct().optional().default(!0),providers:Ae(Ls).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const Xee=Je(["mentioned","cited"]);Xee.enum;me({id:R(),projectId:R(),propertyId:R(),clientEmail:R(),connected:ct(),createdAt:R(),updatedAt:R()});me({date:R(),landingPage:R(),sessions:fe(),organicSessions:fe(),users:fe()});const sk=Je(["session","first_user","manual_utm"]),Jee=me({source:R(),medium:R(),sessions:fe(),users:fe(),sourceDimension:sk}),ete=me({source:R(),medium:R(),sourceDimension:sk,landingPage:R(),sessions:fe(),users:fe()}),tte=me({source:R(),medium:R(),sessions:fe(),users:fe(),channelGroup:R()});me({totalSessions:fe(),totalOrganicSessions:fe(),totalDirectSessions:fe(),totalUsers:fe(),topPages:Ae(me({landingPage:R(),sessions:fe(),organicSessions:fe(),directSessions:fe(),users:fe()})),aiReferrals:Ae(Jee),aiReferralLandingPages:Ae(ete),aiSessionsDeduped:fe(),aiUsersDeduped:fe(),aiSessionsBySession:fe(),aiUsersBySession:fe(),socialReferrals:Ae(tte),socialSessions:fe(),socialUsers:fe(),organicSharePct:fe(),aiSharePct:fe(),aiSharePctBySession:fe(),directSharePct:fe(),socialSharePct:fe(),organicSharePctDisplay:R(),aiSharePctDisplay:R(),aiSharePctBySessionDisplay:R(),directSharePctDisplay:R(),socialSharePctDisplay:R(),lastSyncedAt:R().nullable()});me({date:R(),source:R(),medium:R(),landingPage:R(),sessions:fe(),users:fe(),sourceDimension:sk});me({date:R(),source:R(),medium:R(),sessions:fe(),users:fe(),channelGroup:R()});me({date:R(),sessions:fe(),organicSessions:fe(),users:fe()});function uy(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const nte=Je(["aero","user","compaction"]);nte.enum;const D4=128;me({key:R().min(1).max(D4),value:R().min(1)});me({key:R().min(1).max(D4)});const ok=Je(["queued","downloading","querying","ready","failed"]);ok.enum;me({id:R(),release:R(),status:ok,phaseDetail:R().nullable().optional(),vertexPath:R().nullable().optional(),edgesPath:R().nullable().optional(),vertexSha256:R().nullable().optional(),edgesSha256:R().nullable().optional(),vertexBytes:fe().int().nullable().optional(),edgesBytes:fe().int().nullable().optional(),projectsProcessed:fe().int().nullable().optional(),domainsDiscovered:fe().int().nullable().optional(),downloadStartedAt:R().nullable().optional(),downloadFinishedAt:R().nullable().optional(),queryStartedAt:R().nullable().optional(),queryFinishedAt:R().nullable().optional(),error:R().nullable().optional(),createdAt:R(),updatedAt:R()});const rte=me({linkingDomain:R(),numHosts:fe().int()}),ite=me({projectId:R(),release:R(),targetDomain:R(),totalLinkingDomains:fe().int(),totalHosts:fe().int(),top10HostsShare:R(),queriedAt:R(),excludedLinkingDomains:fe().int().optional(),excludedHosts:fe().int().optional()});me({summary:ite.nullable(),total:fe().int(),rows:Ae(rte)});me({release:R(),totalLinkingDomains:fe().int(),totalHosts:fe().int(),top10HostsShare:R(),queriedAt:R()});me({duckdbInstalled:ct(),duckdbVersion:R().nullable().optional(),duckdbSpec:R(),pluginDir:R()});me({installed:ct(),version:R(),path:R(),alreadyPresent:ct()});me({release:R(),vertexUrl:R(),edgesUrl:R(),vertexBytes:fe().int().nullable(),edgesBytes:fe().int().nullable(),lastModified:R().nullable()});me({release:R(),syncStatus:ok.nullable(),bytes:fe().int(),lastUsedAt:R().nullable()});Je(["snapshot","insight"]);const ate=me({kind:Ki("snapshot"),id:R(),runId:R(),query:R(),provider:R(),model:R().nullable(),citationState:Xu,matchedField:Je(["answerText","citedDomains","searchQueries","query"]),snippet:R(),createdAt:R()}),ste=me({kind:Ki("insight"),id:R(),runId:R().nullable(),type:Je(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost"]),severity:Je(["critical","high","medium","low"]),title:R(),query:R(),provider:R(),matchedField:Je(["title","query","recommendation","cause"]),snippet:R(),dismissed:ct(),createdAt:R()}),ote=QJ("kind",[ate,ste]);me({query:R(),totalHits:fe().int().nonnegative(),truncated:ct(),hits:Ae(ote)});const M4=Je(["create","expand","refresh","add-schema"]);M4.enum;function iT(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}const I4=Je(["gsc","competitor-evidence","both"]);I4.enum;const L4=Je(["high","medium","low"]);L4.enum;function aT(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}const lte=Je(["blog-post","comparison","listicle","how-to","guide","glossary"]);lte.enum;const $4=Je(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);$4.enum;const cte=me({url:R(),gscImpressions:fe().nonnegative(),gscClicks:fe().nonnegative(),gscAvgPosition:fe().nonnegative().nullable(),organicSessions:fe().nonnegative()}),ute=me({domain:R(),url:R(),title:R(),citationCount:fe().int().nonnegative()}),dte=me({demand:fe(),competitor:fe(),absence:fe(),gapSeverity:fe()}),fte=me({actionId:R(),state:$4,lastUpdated:R()}),hte=me({targetRef:R(),query:R(),action:M4,ourBestPage:cte.nullable(),winningCompetitor:ute.nullable(),score:fe(),scoreBreakdown:dte,drivers:Ae(R()),demandSource:I4,actionConfidence:L4,existingAction:fte.nullable()});me({targets:Ae(hte),contextMetrics:me({totalAiReferralSessions:fe().int().nonnegative(),latestRunId:R(),runTimestamp:R()})});const pte=me({uri:R(),title:R(),domain:R(),isOurDomain:ct(),isCompetitor:ct(),citationCount:fe().int().nonnegative(),providers:Ae(Ls)}),mte=me({query:R(),groundingSources:Ae(pte)});me({sources:Ae(mte),latestRunId:R()});const gte=me({query:R(),competitorDomains:Ae(R()),competitorCount:fe().int().nonnegative(),missRate:fe().min(0).max(1),lastSeenInRunId:R()});me({gaps:Ae(gte),latestRunId:R()});const B4=Je(["ok","warn","fail","skipped"]);B4.enum;const lk=Je(["global","project"]);lk.enum;const U4=Je(["auth","config","providers","integrations","database","schedules"]);U4.enum;const yte=me({id:R(),category:U4,scope:lk,title:R(),status:B4,code:R().describe('Stable machine-readable code (e.g. "google.token.refresh-failed"). Use this for filtering and remediation logic.'),summary:R(),remediation:R().nullable().optional().describe('Operator-facing next step. Null when status is "ok" or no specific remediation applies.'),details:Is(R(),Zu()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:fe().int().nonnegative().describe("How long the check took to execute.")});me({scope:lk,project:R().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:R().describe("ISO-8601 timestamp when this doctor run started."),durationMs:fe().int().nonnegative(),summary:me({total:fe().int().nonnegative(),ok:fe().int().nonnegative(),warn:fe().int().nonnegative(),fail:fe().int().nonnegative(),skipped:fe().int().nonnegative()}),checks:Ae(yte)});function vte(e,t){if(!e)return"";const n=e.trim();if(!n)return"";if(/^https?:\/\//i.test(n))return n;if(n.startsWith("//"))return`https:${n}`;const r=t.trim().replace(/^https?:\/\//i,"").replace(/\/+$/,"");return r?n.startsWith("/")?`https://${r}${n}`:`https://${r}/${n}`:n}const xte=me({provider:R(),citationState:Xu,cited:ct(),mentioned:ct(),runId:R(),runCreatedAt:R()}),bte=me({queryId:R(),query:R(),providers:Ae(xte),citedCount:fe().int().nonnegative(),mentionedCount:fe().int().nonnegative(),totalProviders:fe().int().nonnegative()}),wte=me({queryId:R(),query:R(),provider:R(),citingCompetitors:Ae(R()),runId:R(),runCreatedAt:R()}),jte=me({providersConfigured:fe().int().nonnegative(),providersCiting:fe().int().nonnegative(),providersMentioning:fe().int().nonnegative(),totalQueries:fe().int().nonnegative(),queriesCitedAndMentioned:fe().int().nonnegative(),queriesCitedOnly:fe().int().nonnegative(),queriesMentionedOnly:fe().int().nonnegative(),queriesInvisible:fe().int().nonnegative(),latestRunId:R().nullable(),latestRunAt:R().nullable()});me({summary:jte,byQuery:Ae(bte),competitorGaps:Ae(wte),status:Je(["ready","no-data"]),reason:Je(["no-runs-yet","no-queries"]).optional()});function Ste(e){return e.horizon==="immediate"?"negative":e.confidence==="high"?"caution":e.confidence==="low"?"neutral":"caution"}function q4(e){switch(e){case"critical":return"Critical";case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}function F4(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function Nte(e){switch(e){case"content":return"Content";case"competitors":return"Competitors";case"provider":return"Provider";case"search-demand":return"Search demand";case"indexing":return"Indexing";case"location":return"Location";case"monitoring":return"Monitoring"}}function kte(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}const Cte=new Set(["a","an","and","for","from","in","near","of","on","or","the","to"]);function H4(e){return e.toLowerCase().match(/[a-z0-9]+/g)??[]}function K4(e){return e.length>4&&e.endsWith("ies")?`${e.slice(0,-3)}y`:e.length>4&&e.endsWith("s")&&!e.endsWith("ss")?e.slice(0,-1):e}function G4(e){const t=e.meta.location;return t?new Set([t.label,t.city,t.region,t.country].flatMap(H4).map(K4).filter(Boolean)):new Set}function V4(e,t){const n=H4(e).map(K4).filter(Boolean).filter(r=>!Cte.has(r)).filter(r=>!t.has(r));return[...new Set(n)].sort().join(" ")}function Ate(e){return e.title.match(/"([^"]+)"/)?.[1]??e.successMetric.match(/"([^"]+)"/)?.[1]??e.title}function Q4(e,t){const n=G4(e);if(t.length<=1||n.size===0)return[...t];const r=new Set,i=[];for(const a of t){if(a.category!=="content"){i.push(a);continue}const l=V4(Ate(a),n);!l||r.has(l)||(r.add(l),i.push(a))}return i}function W4(e){const t=G4(e),n=e.contentOpportunities;if(n.length<=1||t.size===0)return n;const r=new Set;return n.filter(i=>{const a=V4(i.query,t);return!a||r.has(a)?!1:(r.add(a),!0)})}const Ote=Je(["claude","codex"]);Ote.enum;const Ete=Je(["claude","codex","all"]);Ete.enum;const Y4=Je(["cloud-run","wordpress","cloudflare","vercel","generic-log"]);Y4.enum;const _te=Je(["raw-request-events","aggregate-request-metrics","request-url","status-code","user-agent","remote-ip","referer","cursor-pull"]);_te.enum;const zte=Je(["raw-request","aggregate-bucket"]),Tte=zte.enum,Pte=Je(["observed","provider-aggregated","inferred"]),Rte=Pte.enum,Dte=me({type:R().nullable(),labels:Is(R(),R())}),Mte=me({sourceType:Y4,evidenceKind:Ki(Tte["raw-request"]),confidence:Ki(Rte.observed),eventId:R().min(1),observedAt:R().min(1),method:R().nullable(),requestUrl:R().nullable(),host:R().nullable(),path:R().min(1),queryString:R().nullable(),status:fe().int().nullable(),userAgent:R().nullable(),remoteIp:R().nullable(),referer:R().nullable(),latencyMs:fe().nullable(),requestSizeBytes:fe().int().nullable(),responseSizeBytes:fe().int().nullable(),providerResource:Dte,providerLabels:Is(R(),R())});me({events:Ae(Mte),rawEntryCount:fe().int().nonnegative(),skippedEntryCount:fe().int().nonnegative(),nextPageToken:R().optional(),filter:R()});var Ro=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(Ro||{});const Ite={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},Km={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},Lte=ak;function $te(e){const t=[];if(e.message&&t.push(e.message),e.providers)for(const[n,r]of Object.entries(e.providers)){const i=`[${n}] ${r.message}`;r.raw!==void 0?t.push(`${i}
48
+
49
+ ${JSON.stringify(r.raw,null,2)}`):t.push(i)}return t.length>0?t.join(`
50
+
51
+ `):"Run failed."}function Pv(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function sa(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function sT(e){return e===null?"Unknown":e?"Pass":"Fail"}function t1(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function Bte(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function Ute(e,t){if(!e)return{freq:"custom",hour:6,customCron:t};if(e==="twice-daily")return{freq:"twice-daily",hour:6,customCron:""};const n=e.match(/^daily(?:@(\d+))?$/);if(n)return{freq:"daily",hour:n[1]?parseInt(n[1]):6,customCron:""};const r=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return r?{freq:r[1],hour:r[2]?parseInt(r[2]):6,customCron:""}:{freq:"custom",hour:6,customCron:t}}function Sw(e,t,n){const r=n==="UTC"?"UTC":n.split("/").pop()?.replace(/_/g," ")??n;if(!e)return`Custom: ${t} · ${r}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${r}`;const i=e.match(/^daily(?:@(\d+))?$/);if(i){const l=i[1]?parseInt(i[1]):6;return`Every day at ${t1(l)} · ${r}`}const a=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(a){const l={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},u=a[2]?parseInt(a[2]):6;return`Every ${l[a[1]]} at ${t1(u)} · ${r}`}return`${e} · ${r}`}function dy(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function Z4(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 qte(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 Fte(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function Hte(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function Ko(e){const t=[e.detail,e.hint].filter(Boolean);return t.length>0?t.join(`
52
+ `):void 0}function Kte(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:dy(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:dy(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const i=n.providerStatuses.filter(d=>d.state==="ready").length,a=n.providerStatuses.length,l=i>0,u=n.providerStatuses.filter(d=>d.state==="ready").map(d=>Hte(d)).join(" · ");return{...r,label:"Providers",tone:l?"positive":"caution",detail:`${i} of ${a} configured`,meta:u||"None configured"}})}function Gte(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 Vte(e,t,n){const r=Gte(t,n),i=structuredClone(e);return i.healthChecks=i.healthChecks.map(a=>{if(a.id==="api")return{...a,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(a.id==="worker")return{...a,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const l=n.providerStatuses.some(u=>u.state==="ready");return{...a,detail:l?"At least one provider configured.":"No providers configured.",state:l?"ready":"attention"}}),i.launchState.enabled=r===void 0,i.launchState.blockedReason=r,i.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",i}const X4="canonry.run-tracker",n1=new Set;let oT=!1,Qte=0,Rv={runs:{},batches:{}};function Wte(){const e=nc();for(const t of n1)t(e)}function Yte(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function Zte(){typeof window>"u"||window.sessionStorage.setItem(X4,JSON.stringify(Rv))}function J4(){oT||(oT=!0,!(typeof window>"u")&&(Rv=Yte(window.sessionStorage.getItem(X4))))}function Dv(e){Rv=e,Zte(),Wte()}function nc(){return J4(),Rv}function Xte(e){return J4(),n1.add(e),()=>{n1.delete(e)}}function e$(e){const t=nc();Dv({...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 lT(e){const t=nc();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;Dv({...t,runs:r})}function Jte(e){const t=nc(),n=`batch_${Date.now()}_${++Qte}`;return Dv({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function ene(e){const t=nc();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;Dv({...t,batches:r})}function ck(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function tne(e,t){let n=0,r=0,i=0,a=0,l=0;for(const u of e){const d=t[u]?.status;d==="completed"?n+=1:d==="partial"?r+=1:d==="failed"?i+=1:d==="cancelled"?a+=1:l+=1}return{completed:n,partial:r,failed:i,cancelled:a,pending:l,finished:l===0}}function cT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function uk(...e){return t=>{let n=!1;const r=e.map(i=>{const a=cT(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():cT(e[i],null)}}}}function xc(...e){return x.useCallback(uk(...e),e)}var nne=Symbol.for("react.lazy"),fy=bv[" use ".trim().toString()];function rne(e){return typeof e=="object"&&e!==null&&"then"in e}function t$(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===nne&&"_payload"in e&&rne(e._payload)}function ine(e){const t=sne(e),n=x.forwardRef((r,i)=>{let{children:a,...l}=r;t$(a)&&typeof fy=="function"&&(a=fy(a._payload));const u=x.Children.toArray(a),d=u.find(lne);if(d){const f=d.props.children,p=u.map(m=>m===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:m);return s.jsx(t,{...l,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return s.jsx(t,{...l,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var ane=ine("Slot");function sne(e){const t=x.forwardRef((n,r)=>{let{children:i,...a}=n;if(t$(i)&&typeof fy=="function"&&(i=fy(i._payload)),x.isValidElement(i)){const l=une(i),u=cne(a,i.props);return i.type!==x.Fragment&&(u.ref=r?uk(r,l):l),x.cloneElement(i,u)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var one=Symbol("radix.slottable");function lne(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===one}function cne(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...u)=>{const d=a(...u);return i(...u),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function une(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 n$(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=n$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ot(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=n$(e))&&(r&&(r+=" "),r+=t);return r}const uT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,dT=Ot,r$=(e,t)=>n=>{var r;if(t?.variants==null)return dT(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,l=Object.keys(i).map(f=>{const p=n?.[f],m=a?.[f];if(p===null)return null;const g=uT(p)||uT(m);return i[f][g]}),u=n&&Object.entries(n).reduce((f,p)=>{let[m,g]=p;return g===void 0||(f[m]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:m,className:g,...v}=p;return Object.entries(v).every(j=>{let[b,S]=j;return Array.isArray(S)?S.includes({...a,...u}[b]):{...a,...u}[b]===S})?[...f,m,g]:f},[]);return dT(e,l,d,n?.class,n?.className)},dne=(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},fne=(e,t)=>({classGroupId:e,validator:t}),i$=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),hy="-",fT=[],hne="arbitrary..",pne=e=>{const t=gne(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return mne(l);const u=l.split(hy),d=u[0]===""&&u.length>1?1:0;return a$(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],f=n[l];return d?f?dne(f,d):d:f||fT}return n[l]||fT}}},a$=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=a$(e,t+1,a);if(f)return f}const l=n.validators;if(l===null)return;const u=t===0?e.join(hy):e.slice(t).join(hy),d=l.length;for(let f=0;f<d;f++){const p=l[f];if(p.validator(u))return p.classGroupId}},mne=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?hne+r:void 0})(),gne=e=>{const{theme:t,classGroups:n}=e;return yne(n,t)},yne=(e,t)=>{const n=i$();for(const r in e){const i=e[r];dk(i,n,r,t)}return n},dk=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];vne(l,t,n,r)}},vne=(e,t,n,r)=>{if(typeof e=="string"){xne(e,t,n);return}if(typeof e=="function"){bne(e,t,n,r);return}wne(e,t,n,r)},xne=(e,t,n)=>{const r=e===""?t:s$(t,e);r.classGroupId=n},bne=(e,t,n,r)=>{if(jne(e)){dk(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(fne(n,e))},wne=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[u,d]=i[l];dk(d,s$(t,u),n,r)}},s$=(e,t)=>{let n=e;const r=t.split(hy),i=r.length;for(let a=0;a<i;a++){const l=r[a];let u=n.nextPart.get(l);u||(u=i$(),n.nextPart.set(l,u)),n=u}return n},jne=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Sne=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,l)=>{n[a]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=r[a])!==void 0)return i(a,l),l},set(a,l){a in n?n[a]=l:i(a,l)}}},r1="!",hT=":",Nne=[],pT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),kne=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let l=0,u=0,d=0,f;const p=i.length;for(let b=0;b<p;b++){const S=i[b];if(l===0&&u===0){if(S===hT){a.push(i.slice(d,b)),d=b+1;continue}if(S==="/"){f=b;continue}}S==="["?l++:S==="]"?l--:S==="("?u++:S===")"&&u--}const m=a.length===0?i:i.slice(d);let g=m,v=!1;m.endsWith(r1)?(g=m.slice(0,-1),v=!0):m.startsWith(r1)&&(g=m.slice(1),v=!0);const j=f&&f>d?f-d:void 0;return pT(a,v,g,j)};if(t){const i=t+hT,a=r;r=l=>l.startsWith(i)?a(l.slice(i.length)):pT(Nne,!1,l,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},Cne=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const l=n[a],u=l[0]==="[",d=t.has(l);u||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(l)):i.push(l)}return i.length>0&&(i.sort(),r.push(...i)),r}},Ane=e=>({cache:Sne(e.cacheSize),parseClassName:kne(e),sortModifiers:Cne(e),...pne(e)}),One=/\s+/,Ene=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,l=[],u=e.trim().split(One);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:m,modifiers:g,hasImportantModifier:v,baseClassName:j,maybePostfixModifierPosition:b}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let S=!!b,k=r(S?j.substring(0,b):j);if(!k){if(!S){d=p+(d.length>0?" "+d:d);continue}if(k=r(j),!k){d=p+(d.length>0?" "+d:d);continue}S=!1}const E=g.length===0?"":g.length===1?g[0]:a(g).join(":"),C=v?E+r1:E,A=C+k;if(l.indexOf(A)>-1)continue;l.push(A);const T=i(k,S);for(let O=0;O<T.length;++O){const _=T[O];l.push(C+_)}d=p+(d.length>0?" "+d:d)}return d},_ne=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=o$(n))&&(i&&(i+=" "),i+=r);return i},o$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=o$(e[r]))&&(n&&(n+=" "),n+=t);return n},zne=(e,...t)=>{let n,r,i,a;const l=d=>{const f=t.reduce((p,m)=>m(p),e());return n=Ane(f),r=n.cache.get,i=n.cache.set,a=u,u(d)},u=d=>{const f=r(d);if(f)return f;const p=Ene(d,n);return i(d,p),p};return a=l,(...d)=>a(_ne(...d))},Tne=[],Kn=e=>{const t=n=>n[e]||Tne;return t.isThemeGetter=!0,t},l$=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,c$=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Pne=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Rne=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dne=/\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$/,Mne=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ine=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Lne=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wo=e=>Pne.test(e),dt=e=>!!e&&!Number.isNaN(Number(e)),jo=e=>!!e&&Number.isInteger(Number(e)),Nw=e=>e.endsWith("%")&&dt(e.slice(0,-1)),xs=e=>Rne.test(e),u$=()=>!0,$ne=e=>Dne.test(e)&&!Mne.test(e),fk=()=>!1,Bne=e=>Ine.test(e),Une=e=>Lne.test(e),qne=e=>!Ie(e)&&!Le(e),Fne=e=>Xo(e,h$,fk),Ie=e=>l$.test(e),kl=e=>Xo(e,p$,$ne),mT=e=>Xo(e,Zne,dt),Hne=e=>Xo(e,g$,u$),Kne=e=>Xo(e,m$,fk),gT=e=>Xo(e,d$,fk),Gne=e=>Xo(e,f$,Une),Gm=e=>Xo(e,y$,Bne),Le=e=>c$.test(e),Rf=e=>bc(e,p$),Vne=e=>bc(e,m$),yT=e=>bc(e,d$),Qne=e=>bc(e,h$),Wne=e=>bc(e,f$),Vm=e=>bc(e,y$,!0),Yne=e=>bc(e,g$,!0),Xo=(e,t,n)=>{const r=l$.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},bc=(e,t,n=!1)=>{const r=c$.exec(e);return r?r[1]?t(r[1]):n:!1},d$=e=>e==="position"||e==="percentage",f$=e=>e==="image"||e==="url",h$=e=>e==="length"||e==="size"||e==="bg-size",p$=e=>e==="length",Zne=e=>e==="number",m$=e=>e==="family-name",g$=e=>e==="number"||e==="weight",y$=e=>e==="shadow",Xne=()=>{const e=Kn("color"),t=Kn("font"),n=Kn("text"),r=Kn("font-weight"),i=Kn("tracking"),a=Kn("leading"),l=Kn("breakpoint"),u=Kn("container"),d=Kn("spacing"),f=Kn("radius"),p=Kn("shadow"),m=Kn("inset-shadow"),g=Kn("text-shadow"),v=Kn("drop-shadow"),j=Kn("blur"),b=Kn("perspective"),S=Kn("aspect"),k=Kn("ease"),E=Kn("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...A(),Le,Ie],O=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],P=()=>[Le,Ie,d],$=()=>[wo,"full","auto",...P()],F=()=>[jo,"none","subgrid",Le,Ie],U=()=>["auto",{span:["full",jo,Le,Ie]},jo,Le,Ie],B=()=>[jo,"auto",Le,Ie],V=()=>["auto","min","max","fr",Le,Ie],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...P()],J=()=>[wo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],oe=()=>[wo,"screen","full","dvw","lvw","svw","min","max","fit",...P()],ye=()=>[wo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],I=()=>[e,Le,Ie],M=()=>[...A(),yT,gT,{position:[Le,Ie]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",Qne,Fne,{size:[Le,Ie]}],G=()=>[Nw,Rf,kl],se=()=>["","none","full",f,Le,Ie],ne=()=>["",dt,Rf,kl],Ce=()=>["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"],ee=()=>[dt,Nw,yT,gT],pe=()=>["","none",j,Le,Ie],Ee=()=>["none",dt,Le,Ie],Y=()=>["none",dt,Le,Ie],He=()=>[dt,Le,Ie],Pe=()=>[wo,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xs],breakpoint:[xs],color:[u$],container:[xs],"drop-shadow":[xs],ease:["in","out","in-out"],font:[qne],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xs],shadow:[xs],spacing:["px",dt],text:[xs],"text-shadow":[xs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wo,Ie,Le,S]}],container:["container"],columns:[{columns:[dt,Ie,Le,u]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[jo,"auto",Le,Ie]}],basis:[{basis:[wo,"full","auto",u,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dt,wo,"auto","initial","none",Ie]}],grow:[{grow:["",dt,Le,Ie]}],shrink:[{shrink:["",dt,Le,Ie]}],order:[{order:[jo,"first","last","none",Le,Ie]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],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":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],"inline-size":[{inline:["auto",...oe()]}],"min-inline-size":[{"min-inline":["auto",...oe()]}],"max-inline-size":[{"max-inline":["none",...oe()]}],"block-size":[{block:["auto",...ye()]}],"min-block-size":[{"min-block":["auto",...ye()]}],"max-block-size":[{"max-block":["none",...ye()]}],w:[{w:[u,"screen",...J()]}],"min-w":[{"min-w":[u,"screen","none",...J()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",n,Rf,kl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Yne,Hne]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Nw,Ie]}],"font-family":[{font:[Vne,Kne,t]}],"font-features":[{"font-features":[Ie]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Le,Ie]}],"line-clamp":[{"line-clamp":[dt,"none",Le,mT]}],leading:[{leading:[a,...P()]}],"list-image":[{"list-image":["none",Le,Ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Le,Ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[dt,"from-font","auto",Le,kl]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[dt,"auto",Le,Ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Le,Ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Le,Ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},jo,Le,Ie],radial:["",Le,Ie],conic:[jo,Le,Ie]},Wne,Gne]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ce(),"hidden","none"]}],"divide-style":[{divide:[...Ce(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...Ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dt,Le,Ie]}],"outline-w":[{outline:["",dt,Rf,kl]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",p,Vm,Gm]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",m,Vm,Gm]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[dt,kl]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",g,Vm,Gm]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[dt,Le,Ie]}],"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":[dt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Le,Ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[dt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Le,Ie]}],filter:[{filter:["","none",Le,Ie]}],blur:[{blur:pe()}],brightness:[{brightness:[dt,Le,Ie]}],contrast:[{contrast:[dt,Le,Ie]}],"drop-shadow":[{"drop-shadow":["","none",v,Vm,Gm]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",dt,Le,Ie]}],"hue-rotate":[{"hue-rotate":[dt,Le,Ie]}],invert:[{invert:["",dt,Le,Ie]}],saturate:[{saturate:[dt,Le,Ie]}],sepia:[{sepia:["",dt,Le,Ie]}],"backdrop-filter":[{"backdrop-filter":["","none",Le,Ie]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[dt,Le,Ie]}],"backdrop-contrast":[{"backdrop-contrast":[dt,Le,Ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dt,Le,Ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dt,Le,Ie]}],"backdrop-invert":[{"backdrop-invert":["",dt,Le,Ie]}],"backdrop-opacity":[{"backdrop-opacity":[dt,Le,Ie]}],"backdrop-saturate":[{"backdrop-saturate":[dt,Le,Ie]}],"backdrop-sepia":[{"backdrop-sepia":["",dt,Le,Ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Le,Ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dt,"initial",Le,Ie]}],ease:[{ease:["linear","initial",k,Le,Ie]}],delay:[{delay:[dt,Le,Ie]}],animate:[{animate:["none",E,Le,Ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Le,Ie]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:Y()}],"scale-x":[{"scale-x":Y()}],"scale-y":[{"scale-y":Y()}],"scale-z":[{"scale-z":Y()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[Le,Ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Pe()}],"translate-x":[{"translate-x":Pe()}],"translate-y":[{"translate-y":Pe()}],"translate-z":[{"translate-z":Pe()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Le,Ie]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Le,Ie]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[dt,Rf,kl,mT]}],stroke:[{stroke:["none",...I()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Jne=zne(Xne);function Yi(...e){return Jne(Ot(e))}const ere=r$("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-zinc-50 text-black hover:bg-zinc-200",secondary:"border border-zinc-800 bg-zinc-950 text-zinc-100 hover:bg-zinc-900",ghost:"text-zinc-400 hover:bg-zinc-900 hover:text-zinc-50",outline:"border border-zinc-800 bg-transparent text-zinc-100 hover:bg-zinc-900",destructive:"bg-rose-600 text-white hover:bg-rose-700"},size:{default:"h-9 px-4",sm:"h-8 px-3 text-xs",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),be=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const l=r?ane:"button";return s.jsx(l,{ref:a,className:Yi(ere({variant:t,size:n,className:e})),...i})});be.displayName="Button";const tre=r$("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 v$({className:e,variant:t,...n}){return s.jsx("div",{className:Yi(tre({variant:t}),e),...n})}function vT({compact:e=!1,version:t}){const n=!e&&t&&t!=="unknown";return s.jsxs(Yt,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[s.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),s.jsxs("span",{className:"brand-copy",children:[s.jsx("span",{className:"brand-mark",children:"Canonry"}),n?s.jsxs("span",{className:"brand-version",children:["v",t]}):null]})]})}function rc({provider:e}){const t={gemini:"border-blue-800/50 bg-blue-950/40 text-blue-300",openai:"border-green-800/50 bg-green-950/40 text-green-300",claude:"border-amber-800/50 bg-amber-950/40 text-amber-300",perplexity:"border-teal-800/50 bg-teal-950/40 text-teal-300",local:"border-purple-800/50 bg-purple-950/40 text-purple-300"};return s.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ${t[e]??"border-zinc-700 bg-zinc-800 text-zinc-300"}`,children:e})}function Xe({tone:e,children:t,...n}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return s.jsx(v$,{variant:r,...n,children:t})}function Mv({status:e}){return s.jsx(Xe,{tone:Z4(e),children:Pv(e)})}function $o(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function nre(e,t){const n=x.createContext(t),r=a=>{const{children:l,...u}=a,d=x.useMemo(()=>u,Object.values(u));return s.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function i(a){const l=x.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function rre(e,t=[]){let n=[];function r(a,l){const u=x.createContext(l),d=n.length;n=[...n,l];const f=m=>{const{scope:g,children:v,...j}=m,b=g?.[e]?.[d]||u,S=x.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:S,children:v})};f.displayName=a+"Provider";function p(m,g){const v=g?.[e]?.[d]||u,j=x.useContext(v);if(j)return j;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[f,p]}const i=()=>{const a=n.map(l=>x.createContext(l));return function(u){const d=u?.[e]||a;return x.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return i.scopeName=e,[r,ire(i,...t)]}function ire(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const m=d(a)[`__scope${f}`];return{...u,...m}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var jh=globalThis?.document?x.useLayoutEffect:()=>{},are=bv[" useId ".trim().toString()]||(()=>{}),sre=0;function kw(e){const[t,n]=x.useState(are());return jh(()=>{n(r=>r??String(sre++))},[e]),e||(t?`radix-${t}`:"")}var ore=bv[" useInsertionEffect ".trim().toString()]||jh;function lre({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,l]=cre({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:i;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const m=p.current;m!==u&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=u},[u,r])}const f=x.useCallback(p=>{if(u){const m=ure(p)?p(e):p;m!==e&&l.current?.(m)}else a(p)},[u,e,a,l]);return[d,f]}function cre({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),a=x.useRef(t);return ore(()=>{a.current=t},[t]),x.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function ure(e){return typeof e=="function"}function x$(e){const t=dre(e),n=x.forwardRef((r,i)=>{const{children:a,...l}=r,u=x.Children.toArray(a),d=u.find(hre);if(d){const f=d.props.children,p=u.map(m=>m===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:m);return s.jsx(t,{...l,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return s.jsx(t,{...l,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function dre(e){const t=x.forwardRef((n,r)=>{const{children:i,...a}=n;if(x.isValidElement(i)){const l=mre(i),u=pre(a,i.props);return i.type!==x.Fragment&&(u.ref=r?uk(r,l):l),x.cloneElement(i,u)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fre=Symbol("radix.slottable");function hre(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fre}function pre(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...u)=>{const d=a(...u);return i(...u),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function mre(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 gre=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$s=gre.reduce((e,t)=>{const n=x$(`Primitive.${t}`),r=x.forwardRef((i,a)=>{const{asChild:l,...u}=i,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function yre(e,t){e&&yc.flushSync(()=>e.dispatchEvent(t))}function Sh(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function vre(e,t=globalThis?.document){const n=Sh(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 xre="DismissableLayer",i1="dismissableLayer.update",bre="dismissableLayer.pointerDownOutside",wre="dismissableLayer.focusOutside",xT,b$=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),w$=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:l,onDismiss:u,...d}=e,f=x.useContext(b$),[p,m]=x.useState(null),g=p?.ownerDocument??globalThis?.document,[,v]=x.useState({}),j=xc(t,_=>m(_)),b=Array.from(f.layers),[S]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=b.indexOf(S),E=p?b.indexOf(p):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,A=E>=k,T=Nre(_=>{const P=_.target,$=[...f.branches].some(F=>F.contains(P));!A||$||(i?.(_),l?.(_),_.defaultPrevented||u?.())},g),O=kre(_=>{const P=_.target;[...f.branches].some(F=>F.contains(P))||(a?.(_),l?.(_),_.defaultPrevented||u?.())},g);return vre(_=>{E===f.layers.size-1&&(r?.(_),!_.defaultPrevented&&u&&(_.preventDefault(),u()))},g),x.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(xT=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),bT(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=xT)}},[p,g,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),bT())},[p,f]),x.useEffect(()=>{const _=()=>v({});return document.addEventListener(i1,_),()=>document.removeEventListener(i1,_)},[]),s.jsx($s.div,{...d,ref:j,style:{pointerEvents:C?A?"auto":"none":void 0,...e.style},onFocusCapture:$o(e.onFocusCapture,O.onFocusCapture),onBlurCapture:$o(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:$o(e.onPointerDownCapture,T.onPointerDownCapture)})});w$.displayName=xre;var jre="DismissableLayerBranch",Sre=x.forwardRef((e,t)=>{const n=x.useContext(b$),r=x.useRef(null),i=xc(t,r);return x.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),s.jsx($s.div,{...e,ref:i})});Sre.displayName=jre;function Nre(e,t=globalThis?.document){const n=Sh(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const a=u=>{if(u.target&&!r.current){let d=function(){j$(bre,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function kre(e,t=globalThis?.document){const n=Sh(e),r=x.useRef(!1);return x.useEffect(()=>{const i=a=>{a.target&&!r.current&&j$(wre,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function bT(){const e=new CustomEvent(i1);document.dispatchEvent(e)}function j$(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?yre(i,a):i.dispatchEvent(a)}var Cw="focusScope.autoFocusOnMount",Aw="focusScope.autoFocusOnUnmount",wT={bubbles:!1,cancelable:!0},Cre="FocusScope",S$=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...l}=e,[u,d]=x.useState(null),f=Sh(i),p=Sh(a),m=x.useRef(null),g=xc(t,b=>d(b)),v=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let b=function(C){if(v.paused||!u)return;const A=C.target;u.contains(A)?m.current=A:ko(m.current,{select:!0})},S=function(C){if(v.paused||!u)return;const A=C.relatedTarget;A!==null&&(u.contains(A)||ko(m.current,{select:!0}))},k=function(C){if(document.activeElement===document.body)for(const T of C)T.removedNodes.length>0&&ko(u)};document.addEventListener("focusin",b),document.addEventListener("focusout",S);const E=new MutationObserver(k);return u&&E.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",S),E.disconnect()}}},[r,u,v.paused]),x.useEffect(()=>{if(u){ST.add(v);const b=document.activeElement;if(!u.contains(b)){const k=new CustomEvent(Cw,wT);u.addEventListener(Cw,f),u.dispatchEvent(k),k.defaultPrevented||(Are(Tre(N$(u)),{select:!0}),document.activeElement===b&&ko(u))}return()=>{u.removeEventListener(Cw,f),setTimeout(()=>{const k=new CustomEvent(Aw,wT);u.addEventListener(Aw,p),u.dispatchEvent(k),k.defaultPrevented||ko(b??document.body,{select:!0}),u.removeEventListener(Aw,p),ST.remove(v)},0)}}},[u,f,p,v]);const j=x.useCallback(b=>{if(!n&&!r||v.paused)return;const S=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,k=document.activeElement;if(S&&k){const E=b.currentTarget,[C,A]=Ore(E);C&&A?!b.shiftKey&&k===A?(b.preventDefault(),n&&ko(C,{select:!0})):b.shiftKey&&k===C&&(b.preventDefault(),n&&ko(A,{select:!0})):k===E&&b.preventDefault()}},[n,r,v.paused]);return s.jsx($s.div,{tabIndex:-1,...l,ref:g,onKeyDown:j})});S$.displayName=Cre;function Are(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ko(r,{select:t}),document.activeElement!==n)return}function Ore(e){const t=N$(e),n=jT(t,e),r=jT(t.reverse(),e);return[n,r]}function N$(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 jT(e,t){for(const n of e)if(!Ere(n,{upTo:t}))return n}function Ere(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 _re(e){return e instanceof HTMLInputElement&&"select"in e}function ko(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&_re(e)&&t&&e.select()}}var ST=zre();function zre(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=NT(e,t),e.unshift(t)},remove(t){e=NT(e,t),e[0]?.resume()}}}function NT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Tre(e){return e.filter(t=>t.tagName!=="A")}var Pre="Portal",k$=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,a]=x.useState(!1);jh(()=>a(!0),[]);const l=n||i&&globalThis?.document?.body;return l?_G.createPortal(s.jsx($s.div,{...r,ref:t}),l):null});k$.displayName=Pre;function Rre(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Iv=e=>{const{present:t,children:n}=e,r=Dre(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=xc(r.ref,Mre(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:a}):null};Iv.displayName="Presence";function Dre(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),a=x.useRef("none"),l=e?"mounted":"unmounted",[u,d]=Rre(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Qm(r.current);a.current=u==="mounted"?f:"none"},[u]),jh(()=>{const f=r.current,p=i.current;if(p!==e){const g=a.current,v=Qm(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&g!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),jh(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,m=v=>{const b=Qm(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&b&&(d("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},g=v=>{v.target===t&&(a.current=Qm(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Qm(e){return e?.animationName||"none"}function Mre(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 Ow=0;function Ire(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??kT()),document.body.insertAdjacentElement("beforeend",e[1]??kT()),Ow++,()=>{Ow===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ow--}},[])}function kT(){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 Da=function(){return Da=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Da.apply(this,arguments)};function C$(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 Lre(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Dg="right-scroll-bar-position",Mg="width-before-scroll-bar",$re="with-scroll-bars-hidden",Bre="--removed-body-scroll-bar-size";function Ew(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Ure(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 qre=typeof window<"u"?x.useLayoutEffect:x.useEffect,CT=new WeakMap;function Fre(e,t){var n=Ure(null,function(r){return e.forEach(function(i){return Ew(i,r)})});return qre(function(){var r=CT.get(n);if(r){var i=new Set(r),a=new Set(e),l=n.current;i.forEach(function(u){a.has(u)||Ew(u,null)}),a.forEach(function(u){i.has(u)||Ew(u,l)})}CT.set(n,e)},[e]),n}function Hre(e){return e}function Kre(e,t){t===void 0&&(t=Hre);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var l=t(a,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(a){for(r=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(u){return a(u)},filter:function(){return n}}},assignMedium:function(a){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(a),l=n}var d=function(){var p=l;l=[],p.forEach(a)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){l.push(p),f()},filter:function(p){return l=l.filter(p),n}}}};return i}function Gre(e){e===void 0&&(e={});var t=Kre(null);return t.options=Da({async:!0,ssr:!1},e),t}var A$=function(e){var t=e.sideCar,n=C$(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,Da({},n))};A$.isSideCarExport=!0;function Vre(e,t){return e.useMedium(t),A$}var O$=Gre(),_w=function(){},Lv=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:_w,onWheelCapture:_w,onTouchMoveCapture:_w}),i=r[0],a=r[1],l=e.forwardProps,u=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,g=e.sideCar,v=e.noRelative,j=e.noIsolation,b=e.inert,S=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,C=e.gapMode,A=C$(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=g,O=Fre([n,t]),_=Da(Da({},A),i);return x.createElement(x.Fragment,null,p&&x.createElement(T,{sideCar:O$,removeScrollBar:f,shards:m,noRelative:v,noIsolation:j,inert:b,setCallbacks:a,allowPinchZoom:!!S,lockRef:n,gapMode:C}),l?x.cloneElement(x.Children.only(u),Da(Da({},_),{ref:O})):x.createElement(E,Da({},_,{className:d,ref:O}),u))});Lv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Lv.classNames={fullWidth:Mg,zeroRight:Dg};var Qre=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Wre(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Qre();return t&&e.setAttribute("nonce",t),e}function Yre(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Zre(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Xre=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Wre())&&(Yre(t,n),Zre(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Jre=function(){var e=Xre();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},E$=function(){var e=Jre(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},eie={left:0,top:0,right:0,gap:0},zw=function(e){return parseInt(e||"",10)||0},tie=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[zw(n),zw(r),zw(i)]},nie=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return eie;var t=tie(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])}},rie=E$(),Lu="data-scroll-locked",iie=function(e,t,n,r){var i=e.left,a=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
53
+ .`.concat($re,` {
54
+ overflow: hidden `).concat(r,`;
55
+ padding-right: `).concat(u,"px ").concat(r,`;
56
+ }
57
+ body[`).concat(Lu,`] {
58
+ overflow: hidden `).concat(r,`;
59
+ overscroll-behavior: contain;
60
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
61
+ padding-left: `.concat(i,`px;
62
+ padding-top: `).concat(a,`px;
63
+ padding-right: `).concat(l,`px;
64
+ margin-left:0;
65
+ margin-top:0;
66
+ margin-right: `).concat(u,"px ").concat(r,`;
67
+ `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
68
+ }
69
+
70
+ .`).concat(Dg,` {
71
+ right: `).concat(u,"px ").concat(r,`;
72
+ }
73
+
74
+ .`).concat(Mg,` {
75
+ margin-right: `).concat(u,"px ").concat(r,`;
76
+ }
77
+
78
+ .`).concat(Dg," .").concat(Dg,` {
79
+ right: 0 `).concat(r,`;
80
+ }
81
+
82
+ .`).concat(Mg," .").concat(Mg,` {
83
+ margin-right: 0 `).concat(r,`;
84
+ }
85
+
86
+ body[`).concat(Lu,`] {
87
+ `).concat(Bre,": ").concat(u,`px;
88
+ }
89
+ `)},AT=function(){var e=parseInt(document.body.getAttribute(Lu)||"0",10);return isFinite(e)?e:0},aie=function(){x.useEffect(function(){return document.body.setAttribute(Lu,(AT()+1).toString()),function(){var e=AT()-1;e<=0?document.body.removeAttribute(Lu):document.body.setAttribute(Lu,e.toString())}},[])},sie=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;aie();var a=x.useMemo(function(){return nie(i)},[i]);return x.createElement(rie,{styles:iie(a,!t,i,n?"":"!important")})},a1=!1;if(typeof window<"u")try{var Wm=Object.defineProperty({},"passive",{get:function(){return a1=!0,!0}});window.addEventListener("test",Wm,Wm),window.removeEventListener("test",Wm,Wm)}catch{a1=!1}var cu=a1?{passive:!1}:!1,oie=function(e){return e.tagName==="TEXTAREA"},_$=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!oie(e)&&n[t]==="visible")},lie=function(e){return _$(e,"overflowY")},cie=function(e){return _$(e,"overflowX")},OT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=z$(e,r);if(i){var a=T$(e,r),l=a[1],u=a[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},uie=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},die=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},z$=function(e,t){return e==="v"?lie(t):cie(t)},T$=function(e,t){return e==="v"?uie(t):die(t)},fie=function(e,t){return e==="h"&&t==="rtl"?-1:1},hie=function(e,t,n,r,i){var a=fie(e,window.getComputedStyle(t).direction),l=a*r,u=n.target,d=t.contains(u),f=!1,p=l>0,m=0,g=0;do{if(!u)break;var v=T$(e,u),j=v[0],b=v[1],S=v[2],k=b-S-a*j;(j||k)&&z$(e,u)&&(m+=k,g+=j);var E=u.parentNode;u=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(p&&Math.abs(m)<1||!p&&Math.abs(g)<1)&&(f=!0),f},Ym=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ET=function(e){return[e.deltaX,e.deltaY]},_T=function(e){return e&&"current"in e?e.current:e},pie=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mie=function(e){return`
90
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
91
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
92
+ `)},gie=0,uu=[];function yie(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(gie++)[0],a=x.useState(E$)[0],l=x.useRef(e);x.useEffect(function(){l.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var b=Lre([e.lockRef.current],(e.shards||[]).map(_T),!0).filter(Boolean);return b.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=x.useCallback(function(b,S){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var k=Ym(b),E=n.current,C="deltaX"in b?b.deltaX:E[0]-k[0],A="deltaY"in b?b.deltaY:E[1]-k[1],T,O=b.target,_=Math.abs(C)>Math.abs(A)?"h":"v";if("touches"in b&&_==="h"&&O.type==="range")return!1;var P=window.getSelection(),$=P&&P.anchorNode,F=$?$===O||$.contains(O):!1;if(F)return!1;var U=OT(_,O);if(!U)return!0;if(U?T=_:(T=_==="v"?"h":"v",U=OT(_,O)),!U)return!1;if(!r.current&&"changedTouches"in b&&(C||A)&&(r.current=T),!T)return!0;var B=r.current||T;return hie(B,S,b,B==="h"?C:A)},[]),d=x.useCallback(function(b){var S=b;if(!(!uu.length||uu[uu.length-1]!==a)){var k="deltaY"in S?ET(S):Ym(S),E=t.current.filter(function(T){return T.name===S.type&&(T.target===S.target||S.target===T.shadowParent)&&pie(T.delta,k)})[0];if(E&&E.should){S.cancelable&&S.preventDefault();return}if(!E){var C=(l.current.shards||[]).map(_T).filter(Boolean).filter(function(T){return T.contains(S.target)}),A=C.length>0?u(S,C[0]):!l.current.noIsolation;A&&S.cancelable&&S.preventDefault()}}},[]),f=x.useCallback(function(b,S,k,E){var C={name:b,delta:S,target:k,should:E,shadowParent:vie(k)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(A){return A!==C})},1)},[]),p=x.useCallback(function(b){n.current=Ym(b),r.current=void 0},[]),m=x.useCallback(function(b){f(b.type,ET(b),b.target,u(b,e.lockRef.current))},[]),g=x.useCallback(function(b){f(b.type,Ym(b),b.target,u(b,e.lockRef.current))},[]);x.useEffect(function(){return uu.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",d,cu),document.addEventListener("touchmove",d,cu),document.addEventListener("touchstart",p,cu),function(){uu=uu.filter(function(b){return b!==a}),document.removeEventListener("wheel",d,cu),document.removeEventListener("touchmove",d,cu),document.removeEventListener("touchstart",p,cu)}},[]);var v=e.removeScrollBar,j=e.inert;return x.createElement(x.Fragment,null,j?x.createElement(a,{styles:mie(i)}):null,v?x.createElement(sie,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function vie(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const xie=Vre(O$,yie);var P$=x.forwardRef(function(e,t){return x.createElement(Lv,Da({},e,{ref:t,sideCar:xie}))});P$.classNames=Lv.classNames;var bie=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},du=new WeakMap,Zm=new WeakMap,Xm={},Tw=0,R$=function(e){return e&&(e.host||R$(e.parentNode))},wie=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=R$(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},jie=function(e,t,n,r){var i=wie(t,Array.isArray(e)?e:[e]);Xm[n]||(Xm[n]=new WeakMap);var a=Xm[n],l=[],u=new Set,d=new Set(i),f=function(m){!m||u.has(m)||(u.add(m),f(m.parentNode))};i.forEach(f);var p=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(g){if(u.has(g))p(g);else try{var v=g.getAttribute(r),j=v!==null&&v!=="false",b=(du.get(g)||0)+1,S=(a.get(g)||0)+1;du.set(g,b),a.set(g,S),l.push(g),b===1&&j&&Zm.set(g,!0),S===1&&g.setAttribute(n,"true"),j||g.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",g,k)}})};return p(t),u.clear(),Tw++,function(){l.forEach(function(m){var g=du.get(m)-1,v=a.get(m)-1;du.set(m,g),a.set(m,v),g||(Zm.has(m)||m.removeAttribute(r),Zm.delete(m)),v||m.removeAttribute(n)}),Tw--,Tw||(du=new WeakMap,du=new WeakMap,Zm=new WeakMap,Xm={})}},Sie=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=bie(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),jie(r,i,n,"aria-hidden")):function(){return null}},$v="Dialog",[D$]=rre($v),[Nie,ga]=D$($v),M$=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:l=!0}=e,u=x.useRef(null),d=x.useRef(null),[f,p]=lre({prop:r,defaultProp:i??!1,onChange:a,caller:$v});return s.jsx(Nie,{scope:t,triggerRef:u,contentRef:d,contentId:kw(),titleId:kw(),descriptionId:kw(),open:f,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(m=>!m),[p]),modal:l,children:n})};M$.displayName=$v;var I$="DialogTrigger",kie=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ga(I$,n),a=xc(t,i.triggerRef);return s.jsx($s.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":mk(i.open),...r,ref:a,onClick:$o(e.onClick,i.onOpenToggle)})});kie.displayName=I$;var hk="DialogPortal",[Cie,L$]=D$(hk,{forceMount:void 0}),$$=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ga(hk,t);return s.jsx(Cie,{scope:t,forceMount:n,children:x.Children.map(r,l=>s.jsx(Iv,{present:n||a.open,children:s.jsx(k$,{asChild:!0,container:i,children:l})}))})};$$.displayName=hk;var py="DialogOverlay",B$=x.forwardRef((e,t)=>{const n=L$(py,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ga(py,e.__scopeDialog);return a.modal?s.jsx(Iv,{present:r||a.open,children:s.jsx(Oie,{...i,ref:t})}):null});B$.displayName=py;var Aie=x$("DialogOverlay.RemoveScroll"),Oie=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ga(py,n);return s.jsx(P$,{as:Aie,allowPinchZoom:!0,shards:[i.contentRef],children:s.jsx($s.div,{"data-state":mk(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ic="DialogContent",U$=x.forwardRef((e,t)=>{const n=L$(ic,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ga(ic,e.__scopeDialog);return s.jsx(Iv,{present:r||a.open,children:a.modal?s.jsx(Eie,{...i,ref:t}):s.jsx(_ie,{...i,ref:t})})});U$.displayName=ic;var Eie=x.forwardRef((e,t)=>{const n=ga(ic,e.__scopeDialog),r=x.useRef(null),i=xc(t,n.contentRef,r);return x.useEffect(()=>{const a=r.current;if(a)return Sie(a)},[]),s.jsx(q$,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$o(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:$o(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&a.preventDefault()}),onFocusOutside:$o(e.onFocusOutside,a=>a.preventDefault())})}),_ie=x.forwardRef((e,t)=>{const n=ga(ic,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return s.jsx(q$,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=a.target;n.triggerRef.current?.contains(l)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),q$=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...l}=e,u=ga(ic,n),d=x.useRef(null),f=xc(t,d);return Ire(),s.jsxs(s.Fragment,{children:[s.jsx(S$,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:s.jsx(w$,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":mk(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(zie,{titleId:u.titleId}),s.jsx(Pie,{contentRef:d,descriptionId:u.descriptionId})]})]})}),pk="DialogTitle",F$=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ga(pk,n);return s.jsx($s.h2,{id:i.titleId,...r,ref:t})});F$.displayName=pk;var H$="DialogDescription",K$=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ga(H$,n);return s.jsx($s.p,{id:i.descriptionId,...r,ref:t})});K$.displayName=H$;var G$="DialogClose",V$=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ga(G$,n);return s.jsx($s.button,{type:"button",...r,ref:t,onClick:$o(e.onClick,()=>i.onOpenChange(!1))})});V$.displayName=G$;function mk(e){return e?"open":"closed"}var Q$="DialogTitleWarning",[dze,W$]=nre(Q$,{contentName:ic,titleName:pk,docsSlug:"dialog"}),zie=({titleId:e})=>{const t=W$(Q$),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
93
+
94
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
95
+
96
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Tie="DialogDescriptionWarning",Pie=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${W$(Tie).contentName}}.`;return x.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Y$=M$,Z$=$$,gk=B$,yk=U$,vk=F$,X$=K$,J$=V$;const Rie=Y$,Die=Z$,e3=x.forwardRef(({className:e,...t},n)=>s.jsx(gk,{ref:n,className:Yi("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));e3.displayName=gk.displayName;const Mie=400,Iie=1200,Lie=720,t3=x.forwardRef(({className:e,children:t,...n},r)=>{const[i,a]=x.useState(Lie),l=x.useRef(!1),u=x.useRef(0),d=x.useRef(0),f=x.useCallback(g=>{l.current=!0,u.current=g.clientX,d.current=i,g.target.setPointerCapture(g.pointerId),g.preventDefault()},[i]),p=x.useCallback(g=>{if(!l.current)return;const v=u.current-g.clientX,j=Math.min(Iie,Math.max(Mie,d.current+v));a(j)},[]),m=x.useCallback(()=>{l.current=!1},[]);return s.jsxs(Die,{children:[s.jsx(e3,{}),s.jsxs(yk,{ref:r,className:Yi("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${i}px, 100vw)`},...n,children:[s.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:f,onPointerMove:p,onPointerUp:m}),t,s.jsxs(J$,{className:"absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-900 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400",children:[s.jsx(Kh,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});t3.displayName=yk.displayName;const $ie=({className:e,...t})=>s.jsx("div",{className:Yi("flex flex-col gap-1.5 pr-10",e),...t}),n3=x.forwardRef(({className:e,...t},n)=>s.jsx(vk,{ref:n,className:Yi("text-lg font-medium text-zinc-50",e),...t}));n3.displayName=vk.displayName;const r3=x.forwardRef(({className:e,...t},n)=>s.jsx(X$,{ref:n,className:Yi("text-sm text-zinc-500",e),...t}));r3.displayName=X$.displayName;function Bie({title:e,subtitle:t,children:n,open:r,onClose:i}){return s.jsx(Rie,{open:r,onOpenChange:a=>a?void 0:i(),children:s.jsxs(t3,{children:[s.jsxs($ie,{className:"drawer-head",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),s.jsx(n3,{id:"drawer-title",children:e}),s.jsx(r3,{className:"sr-only",children:t})]}),s.jsx("div",{className:"drawer-body",children:n})]})})}function pr({text:e}){const[t,n]=x.useState(null),r=x.useRef(null),i=x.useCallback(()=>{if(!r.current)return;const l=r.current.getBoundingClientRect();n({top:l.top,left:l.left+l.width/2})},[]),a=x.useCallback(()=>n(null),[]);return s.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,children:[s.jsxs("svg",{ref:r,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[s.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),s.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),t!==null&&yc.createPortal(s.jsx("span",{role:"tooltip",style:{position:"fixed",top:t.top,left:t.left,transform:"translateX(-50%) translateY(calc(-100% - 8px))",zIndex:9999,pointerEvents:"none",width:"14rem",padding:"0.5rem 0.75rem",fontSize:"11px",fontWeight:400,textTransform:"none",letterSpacing:"normal",lineHeight:"1rem",color:"#d4d4d8",backgroundColor:"#18181b",border:"1px solid rgba(63, 63, 70, 0.6)",borderRadius:"0.5rem",boxShadow:"0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1)"},children:e}),document.body)]})}const Uie=/[\s\-_]+/;function qie(e){const t=e.split(Uie).filter(Boolean);return t.length===0?null:t.map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function zT(e,t){const n=Fie(t),r=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(f=>f.startsWith("**")&&f.endsWith("**")?{type:"bold",value:f.slice(2,-2)}:{type:"text",value:f}),i=n.flatMap(f=>f.terms).filter(f=>f.trim().length>1);if(i.length===0)return r.map((f,p)=>f.type==="bold"?Li.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const l=[...i].sort((f,p)=>p.length-f.length).map(qie).filter(f=>!!f);if(l.length===0)return r.map((f,p)=>f.type==="bold"?Li.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const u=new RegExp(`(${l.join("|")})`,"gi"),d=new Map;for(const f of n)for(const p of f.terms){const m=uy(p);m&&!d.has(m)&&d.set(m,f.className)}return r.flatMap((f,p)=>f.value.split(u).map((g,v)=>{if(!g)return null;if(v%2===1){const b=d.get(uy(g))??"answer-highlight";return f.type==="bold"?Li.createElement("mark",{key:`hl-${p}-${v}`,className:b},Li.createElement("strong",{className:"text-zinc-200 font-semibold"},g)):Li.createElement("mark",{key:`hl-${p}-${v}`,className:b},g)}return f.type==="bold"?Li.createElement("strong",{key:`b-${p}-${v}`,className:"text-zinc-200 font-semibold"},g):g})).filter(Boolean)}function Fie(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Pw(e,t){switch(e){case"new":return"First observation";case"emerging":return"First visibility";case"lost":return"Lost since last run";default:return t==="visible"?"Visible in latest run":t==="pending"?"Awaiting first run":"Not visible in latest run"}}function Hie({evidence:e,project:t,onClose:n}){const[r,i]=x.useState(!1),[a,l]=x.useState("mentions"),[u,d]=x.useState(-1),[f,p]=x.useState(null),[m,g]=x.useState(!1),[v,j]=x.useState({}),b=jee(t.project),S=new Set(b.map(ly)),k=e.runHistory,E=k.length>1,[C,A]=x.useState(null),T=x.useRef(!1);x.useEffect(()=>{if(T.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const G=k.at(-1);G&&(T.current=!0,tc(G.runId).then(se=>{const ne=se.snapshots.find(Ce=>Ce.query===e.query&&Ce.provider===e.provider);ne&&A({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:G.visibilityTransition,provider:ne.provider,model:ne.model??e.model,answerSnippet:ne.answerText??e.answerSnippet,citedDomains:ne.citedDomains??e.citedDomains,competitorDomains:ne.competitorOverlap??e.competitorDomains,recommendedCompetitors:ne.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:ne.matchedTerms??e.matchedTerms??[],groundingSources:ne.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,k]);const O=u>=0&&f!==null,_=O?f:C||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:k.at(-1)?.visibilityTransition,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,recommendedCompetitors:e.recommendedCompetitors??[],matchedTerms:e.matchedTerms??[],groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},P=_.visibilityState==="pending"||_.citationState==="pending",$=P?!1:_.visibilityState!=null?_.visibilityState==="visible":_.answerMentioned!=null?_.answerMentioned:_.citationState===Ju.cited||_.citationState==="emerging",F=_.answerMentioned!=null||_.visibilityState!=null||_.recommendedCompetitors.length>0,U=_.citedDomains.length>0||_.groundingSources.length>0||_.evidenceUrls.length>0,B=t.project.displayName||t.project.name,V=[...b.map(ly),B,B.split(" ").slice(0,2).join(" "),..._.matchedTerms].filter(G=>G.trim().length>2),X=[..._.competitorDomains.flatMap(G=>{const se=wee(G);return se.length>=4?[se]:[]}),..._.recommendedCompetitors].filter(G=>G.trim().length>2),Z=[{terms:V,className:"answer-highlight-brand"},...X.length>0?[{terms:X,className:"answer-highlight-competitor"}]:[]],H=P?"pending":_.visibilityTransition==="lost"?"lost":$?"cited":"not-cited",J=x.useRef(0),oe=x.useCallback(async G=>{const se=++J.current;if(G===-1||G===k.length-1){d(-1),p(null),i(!1);return}d(G),i(!1);const ne=k[G],Ce=`${ne.runId}::${e.query}::${e.provider}`;if(v[Ce]){p(v[Ce]);return}g(!0);try{const Se=await tc(ne.runId);if(se!==J.current)return;const ee=Se.snapshots.find(Ee=>Ee.query===e.query&&Ee.provider===e.provider)??Se.snapshots.find(Ee=>Ee.query===e.query),pe=ee?{citationState:ee.citationState,answerMentioned:ee.answerMentioned,visibilityState:ee.visibilityState,visibilityTransition:ne.visibilityTransition,provider:ee.provider,model:ee.model??null,answerSnippet:ee.answerText??"",citedDomains:ee.citedDomains,competitorDomains:ee.competitorOverlap,recommendedCompetitors:ee.recommendedCompetitors??[],matchedTerms:ee.matchedTerms??[],groundingSources:ee.groundingSources,evidenceUrls:[],changeLabel:Pw(ne.visibilityTransition,ne.visibilityState),summary:""}:{citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ne.visibilityTransition,provider:e.provider,model:ne.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Pw(ne.visibilityTransition,ne.visibilityState),summary:"Snapshot data not available for this run."};j(Ee=>({...Ee,[Ce]:pe})),p(pe)}catch{if(se!==J.current)return;p({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ne.visibilityTransition,provider:e.provider,model:ne.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Pw(ne.visibilityTransition,ne.visibilityState),summary:"Failed to load historical run data."})}finally{se===J.current&&g(!1)}},[k,e.query,e.provider,v]),I=(O||e.historyScope!=="provider")&&_.model?`${_.provider} (${_.model}) · ${_.changeLabel.toLowerCase()}`:`${_.provider} · ${_.changeLabel.toLowerCase()}`,M=!O&&e.historyScope==="provider"?[e.model?`Current model: ${e.model}`:null,e.modelsSeen&&e.modelsSeen.length>1?`History spans ${e.modelsSeen.length} models`:null].filter(Boolean).join(" · "):"",q=$?{label:"Visible in answer",title:"Your brand or domain is mentioned in this answer",meta:I}:_.visibilityTransition==="lost"?{label:"Visibility lost",title:"Your brand no longer appears in this answer",meta:I}:P?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not visible in answer",title:"Your brand or domain was not mentioned in this answer",meta:I},D=()=>{if(!_.answerSnippet)return null;const G=_.answerSnippet.split(`
97
+ `),se=[];let ne=[],Ce=0;const Se=()=>{if(ne.length===0)return;const ee=ne.join(" ").trim();ee&&se.push(s.jsx("p",{className:se.length>0?"mt-2.5":"",children:zT(ee,Z)},Ce++)),ne=[]};for(const ee of G){const pe=ee.trim();if(/^[-\u2013\u2014]{3,}$/.test(pe)){Se(),se.push(s.jsx("hr",{className:"border-zinc-800/60 my-3"},Ce++));continue}const Ee=pe.match(/^(#{1,3})\s+(.+)$/);if(Ee){Se();const Y=Ee[1].length,He=Ee[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||Ee[2],Pe=Y===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":Y===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";se.push(s.jsx("p",{className:Pe,children:zT(He,Z)},Ce++));continue}if(pe===""){Se();continue}ne.push(pe)}return Se(),se};return s.jsx(Y$,{open:!0,onOpenChange:G=>{G||n()},children:s.jsxs(Z$,{children:[s.jsx(gk,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),s.jsxs(yk,{className:"evidence-modal","aria-describedby":void 0,children:[s.jsxs("div",{className:"evidence-modal-header",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," ","·"," ",_.provider||"All providers"]}),s.jsx(vk,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),s.jsxs(J$,{className:"inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-800 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 shrink-0",children:[s.jsx(Kh,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]}),E&&s.jsxs("div",{className:"evidence-modal-timeline",children:[s.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),s.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:k.map((G,se)=>{const ne=u===-1&&se===k.length-1||u===se,Ce=G.visibilityState??(G.answerMentioned?"visible":"not-visible"),Se=G.visibilityTransition??Ce,ee=Ce==="visible"?"bg-emerald-400":Se==="emerging"?"bg-amber-400":Se==="lost"?"bg-rose-400":"bg-zinc-600",Ee=new Date(G.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Y=!!(G.model&&se>0&&k[se-1]?.model&&k[se-1].model!==G.model);return s.jsxs("button",{type:"button",className:`evidence-run-dot ${ne?"evidence-run-dot--selected":""}`,onClick:()=>oe(se===k.length-1?-1:se),"aria-label":[`Run ${Ee}: ${Ce}`,G.model?`model ${G.model}`:null,Y?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ne,children:[s.jsx("span",{className:`size-2 rounded-full ${ee} ${Y?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),s.jsx("span",{className:"text-[10px] text-zinc-500",children:Ee})]},se)})}),u>=0&&u<k.length&&s.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(k[u].createdAt).toLocaleString()," ","—"," ",s.jsx("span",{className:"capitalize",children:k[u].visibilityState??(k[u].answerMentioned?"visible":"not-visible")}),s.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>oe(-1),children:["←"," Back to latest"]})]}),!O&&(e.modelTransitions?.length??0)>0&&s.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(G=>s.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-400/30 bg-amber-400/10 px-2 py-1 text-[10px] text-amber-100",children:`${G.fromModel??"unknown"} -> ${G.toModel??"unknown"} on ${new Date(G.createdAt).toLocaleDateString()}`},`${G.runId}:${G.toModel??"unknown"}`))})]}),s.jsxs("div",{className:"evidence-modal-body",children:[m&&s.jsxs("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:["Loading historical run data","…"]}),!m&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"evidence-modal-main",children:[s.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${H}`,children:[s.jsx("p",{className:`evidence-position-label evidence-position-label--${H}`,children:q.label}),s.jsx("p",{className:`evidence-position-title evidence-position-title--${H}`,children:q.title}),s.jsx("p",{className:"evidence-position-meta",children:q.meta}),M&&s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:M})]}),_.answerSnippet&&s.jsxs("div",{children:[s.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),s.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:D()}),_.answerSnippet.length>280&&s.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>i(!r),children:r?"↑ Collapse":"↓ Show full answer"})]}),!_.answerSnippet&&!m&&s.jsx("div",{className:"rounded-lg border border-zinc-800/40 bg-zinc-900/20 px-4 py-8 text-center text-zinc-600 text-sm",children:"No answer text recorded for this run"}),!O&&e.relatedTechnicalSignals.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"drawer-section-label",children:$?"Why you're visible":"What to fix"}),s.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((G,se)=>s.jsxs("div",{className:"action-item",children:[s.jsx("svg",{className:`action-item-icon ${$?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:$?s.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):s.jsxs(s.Fragment,{children:[s.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),s.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),s.jsx("span",{className:"action-item-text",children:G})]},se))})]}),_.summary&&s.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:_.summary})]}),s.jsxs("div",{className:"evidence-modal-sidebar",children:[(F||U)&&s.jsxs("div",{className:"sidebar-tabs",children:[s.jsx("button",{className:`sidebar-tab ${a==="mentions"?"sidebar-tab--active":""}`,onClick:()=>l("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),s.jsx("button",{className:`sidebar-tab ${a==="sources"?"sidebar-tab--active":""}`,onClick:()=>l("sources"),type:"button",title:"Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.",children:"Sources"})]}),a==="mentions"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsxs("div",{className:"drawer-section-label flex items-center",children:[s.jsx("span",{children:"Answer visibility"}),s.jsx(pr,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),s.jsxs("div",{className:`mention-status mention-status--${$?"visible":"not-visible"}`,children:[s.jsx("span",{className:"mention-status-icon",children:P?"…":$?"✓":"—"}),s.jsx("span",{className:"mention-status-label",children:P?"Pending":$?"Visible":"Not visible"})]}),_.matchedTerms.length>0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:_.matchedTerms.map(G=>s.jsx("span",{className:"mention-chip mention-chip--brand",children:G},G))})]}),!P&&!$&&_.matchedTerms.length===0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:V.map(G=>s.jsx("span",{className:"mention-chip mention-chip--muted",children:G},G))}),s.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(_.recommendedCompetitors.length>0||_.competitorDomains.length>0)&&s.jsxs("div",{children:[s.jsxs("div",{className:"drawer-section-label flex items-center",children:[s.jsx("span",{children:"Competitors in answer"}),s.jsx(pr,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const G=_.competitorDomains.map(Ce=>Ce.replace(/^www\./,"")),se=new Set(G.map(Ce=>uy(Ce.replace(/\.[^.]+$/,""))));return[..._.recommendedCompetitors.filter(Ce=>!se.has(uy(Ce))),...G].map(Ce=>s.jsx("span",{className:"mention-chip mention-chip--competitor",children:Ce},Ce))})()})]})]}),a==="sources"&&s.jsxs(s.Fragment,{children:[_.citedDomains.length>0&&s.jsxs("div",{children:[s.jsxs("div",{className:"drawer-section-label flex items-center",children:[s.jsx("span",{children:"Domains from source links"}),s.jsx(pr,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),s.jsx("div",{className:"citation-leaderboard",children:_.citedDomains.map((G,se)=>{const ne=G.toLowerCase().replace(/^www\./,""),Ce=S.has(ne),Se=!Ce&&_.competitorDomains.some(pe=>pe.toLowerCase().replace(/^www\./,"")===ne),ee=Ce?"you":Se?"competitor":"other";return s.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${ee}`,children:[s.jsxs("span",{className:"citation-leaderboard-rank",children:["#",se+1]}),s.jsx("span",{className:"citation-leaderboard-domain",children:G}),Ce&&s.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),Se&&s.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},G)})})]}),_.groundingSources.length>0&&s.jsxs("div",{children:[s.jsxs("div",{className:"drawer-section-label flex items-center",children:[s.jsxs("span",{children:["Grounding source links (",_.groundingSources.length,")"]}),s.jsx(pr,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),s.jsx("ul",{className:"grid gap-0.5",children:_.groundingSources.map((G,se)=>s.jsx("li",{className:"truncate text-sm",children:s.jsx("a",{href:G.uri,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G.title||G.uri})},se))})]}),_.evidenceUrls.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),s.jsx("ul",{className:"grid gap-1",children:_.evidenceUrls.map(G=>s.jsx("li",{className:"truncate text-sm",children:s.jsx("a",{href:G,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G})},G))})]}),_.citedDomains.length===0&&_.groundingSources.length===0&&_.evidenceUrls.length===0&&s.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",O?"for this run":"yet"]})]}),!F&&!U&&s.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",O?"for this run":"yet"]})]})]})]})]})]})})}function aa(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 Rw=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1},{id:"project_harbor",name:"Harbor Legal Group",canonicalDomain:"harborlegal.com",ownedDomains:[],country:"US",language:"en",tags:["lead gen"],labels:{},locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1},{id:"project_northstar",name:"Northstar Orthopedics",canonicalDomain:"northstarortho.com",ownedDomains:[],country:"US",language:"en",tags:["multi-location"],labels:{},locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1}];function Bv(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 Kie=Bv({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"}),Gie=Bv({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"}),Vie=Bv({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"}),Qie=Bv({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"}),Wie=[{id:"evidence_citypoint_emergency_gemini",query:"emergency dentist brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"lost",changeLabel:"Lost since Mar 5",answerSnippet:"For urgent dental care in Brooklyn, Downtown Smiles and Harbor Dental are now cited first for emergency availability and same-day booking.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:["https://downtownsmiles.com/emergency-dentist-brooklyn","https://harbordental.com/same-day-emergency-care"],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing on the emergency service page","llms.txt not found during latest site audit","Location pages link weakly into the emergency care hub"],summary:"AI answers now cite two competitors while your emergency page is no longer grounded.",runHistory:aa(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",query:"emergency dentist brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"Cited for 6 runs",answerSnippet:"Citypoint Dental is listed as a top emergency dentist in Brooklyn for same-day appointments and walk-in availability.",citedDomains:["citypointdental.com","downtownsmiles.com"],evidenceUrls:["https://citypointdental.com/emergency-dentist-brooklyn"],competitorDomains:["downtownsmiles.com"],groundingSources:[],relatedTechnicalSignals:["Emergency page indexed with structured data"],summary:"OpenAI cites your emergency page consistently alongside one competitor.",runHistory:aa(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",query:"emergency dentist brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"Based on the search results, top-rated emergency dental practices in Brooklyn include Downtown Smiles and Harbor Dental.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:[],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing","llms.txt not found"],summary:"Claude does not cite your domain for this emergency query.",runHistory:aa(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_invisalign_openai",query:"best invisalign dentist downtown brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"First citation in 7 days",answerSnippet:"Citypoint Dental appears as an emerging recommendation for Invisalign in Downtown Brooklyn, supported by recent before-and-after case pages.",citedDomains:["citypointdental.com","clearlineortho.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn","https://citypointdental.com/case-studies/invisalign-open-bite"],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["Structured data now present on two case-study pages","Internal links from service pages to case studies improved crawl depth"],summary:"Fresh case-study content is starting to earn citations on Invisalign prompts.",runHistory:aa(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",query:"best invisalign dentist downtown brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"cited",changeLabel:"Cited for 8 runs",answerSnippet:"Citypoint Dental in Downtown Brooklyn is highlighted for its Invisalign expertise and patient outcomes.",citedDomains:["citypointdental.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn"],competitorDomains:[],groundingSources:[],relatedTechnicalSignals:["Case study pages well-indexed"],summary:"Gemini consistently cites your Invisalign page with no competitor overlap.",runHistory:aa(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",query:"best invisalign dentist downtown brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For Invisalign in Downtown Brooklyn, Clear Line Ortho and Brooklyn Smiles are frequently recommended for their experienced orthodontists.",citedDomains:["clearlineortho.com","brooklynsmiles.com"],evidenceUrls:[],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["No before/after schema on case study pages"],summary:"Claude does not surface your Invisalign content despite strong page quality.",runHistory:aa(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_claude",query:"pediatric dentist brooklyn heights",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 4 runs",answerSnippet:"Answers cite neighborhood-specific pediatric practices with stronger family-focused FAQ content and clearer insurance details.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:["https://brightkidsdental.com/pediatric-dentist-brooklyn-heights","https://parkpediatricdental.com/insurance"],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric service page exists for Brooklyn Heights","Insurance content is buried three clicks deep"],summary:"Coverage gap is content-driven, not purely technical.",runHistory:aa(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",query:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For pediatric dentistry in Brooklyn Heights, Bright Kids Dental and Park Pediatric Dental are cited for family-friendly care.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:[],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric page for Brooklyn Heights"],summary:"Gemini does not surface your domain for pediatric queries in this area.",runHistory:aa(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_openai",query:"pediatric dentist brooklyn heights",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"First citation this month",answerSnippet:"Citypoint Dental is mentioned as offering pediatric services in Brooklyn, though specialized pediatric-only practices are also highlighted.",citedDomains:["citypointdental.com","brightkidsdental.com"],evidenceUrls:["https://citypointdental.com/family-dentistry"],competitorDomains:["brightkidsdental.com"],groundingSources:[],relatedTechnicalSignals:["Family dentistry page recently updated"],summary:"OpenAI recently started citing your family dentistry page for this query.",runHistory:aa(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Rw[0],Rw[1],aa(["cited","cited","cited","cited","cited"]),Rw[2],2/7,aa(["not-cited","not-cited","not-cited","cited"]);function Yie(e,t){return e.projects.find(n=>n.project.id===t)}function Zie(e,t){return e.runs.find(n=>n.id===t)}function Xie(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 Jie={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral"},eae={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited"},tae={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor"};function nae(e){return{id:e.id,tone:Jie[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??tae[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:eae[e.type]}]}}function rae(e){return e.filter(t=>!t.dismissed).map(nae)}function i3(e){return{id:e.id,name:e.name,displayName:e.displayName,canonicalDomain:e.canonicalDomain,ownedDomains:e.ownedDomains??[],country:e.country,language:e.language,tags:e.tags,labels:e.labels,locations:e.locations??[],defaultLocation:e.defaultLocation??null,autoExtractBacklinks:e.autoExtractBacklinks??!1,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function TT(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function iae(e,t){if(!e)return"Waiting";if(!t)return"Running";const n=new Date(t).getTime()-new Date(e).getTime();if(n<1e3)return"<1s";const r=Math.floor(n/1e3);if(r<60)return`${r}s`;const i=Math.floor(r/60),a=r%60;return`${i}m ${a}s`}function a3(e){switch(e){case Tt["answer-visibility"]:return"Answer visibility sweep";case Tt["gsc-sync"]:return"GSC sync";case Tt["inspect-sitemap"]:return"Sitemap inspection";case Tt["ga-sync"]:return"GA sync";case Tt["bing-inspect"]:return"Bing URL inspection";case Tt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Tt["site-audit"]:return"Site audit";case Tt["backlink-extract"]:return"Backlink extract"}}function aae(e){return e===sh.manual?"Manual":e===sh.scheduled?"Scheduled":e===sh["config-apply"]?"Config apply":e}function xk(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:a3(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?TT(e.startedAt):TT(e.createdAt),duration:iae(e.startedAt,e.finishedAt),statusDetail:e.error?s3(e.error):sae(e),summary:oae(e),triggerLabel:aae(e.trigger)}}function s3(e){const t=ak(e);return t.length>200?t.slice(0,200)+"…":t}function sae(e){switch(e.status){case hr.queued:return"Waiting for execution slot.";case hr.running:return"Provider queries in progress.";case hr.completed:return"All queries checked.";case hr.partial:return"Run completed with some queries skipped.";case hr.failed:return e.error?s3(e.error):"Run failed.";case hr.cancelled:return"Run was cancelled.";default:return""}}function oae(e){const t=a3(e.kind);switch(e.status){case hr.queued:return`${t} queued`;case hr.running:return`${t} in progress`;case hr.completed:return`${t} completed`;case hr.partial:return`${t} partially completed`;case hr.failed:return`${t} failed`;case hr.cancelled:return`${t} cancelled`;default:return e.status}}function lae(e,t,n,r){const i=[];let a=0;const l=new Set;if(n){const u=new Map;for(const g of n.snapshots)if(g.query){const v=`${g.query}::${g.provider}`;u.set(v,g)}const d=new Set(n.snapshots.map(g=>g.provider)),f=new Set(t.flatMap(g=>Object.keys(g.providerRuns??{}))),p=[...new Set([...d,...f])].sort(),m=p.length>0?p:["gemini"];for(const g of t){if(g.runs.length===0)continue;l.add(g.query);const v=g.runs.at(-1),j=v?.transition??"not-cited";for(const b of m){const S=u.get(`${g.query}::${b}`),k=(g.providerRuns?.[b]?.length??0)>0;if(!S&&!k)continue;const E=S?.model??null,C=E?`${b}:${E}`:null,A=C?g.modelRuns?.[C]:void 0,T=g.providerRuns?.[b],O=(T?.length?T:null)??(A?.length?A:null),_=T?.length?"provider":A?.length?"model":"query",P=O?O.at(-1).transition:j,$=O?O.at(-1).visibilityTransition??(O.at(-1).visibilityState==="visible"?"visible":"not-visible"):v?.visibilityTransition??(v?.visibilityState==="visible"?"visible":"not-visible"),F=O?.at(-1)?.citationState,U=O?.at(-1)?.visibilityState,B=S?P==="lost"?"lost":P==="emerging"?"emerging":S.citationState===Ju.cited?"cited":"not-cited":F===Ju.cited?"cited":"not-cited",V=S?.visibilityState??(U==="visible"?"visible":U==="pending"?"pending":"not-visible"),X=PT(O||g.runs),Z=RT(O||g.runs),H=cae(g,b),J=(O??g.runs).map(M=>({runId:M.runId,citationState:M.citationState,createdAt:M.createdAt,model:H.get(M.runId)??null,answerMentioned:M.answerMentioned,visibilityState:M.visibilityState,visibilityTransition:M.visibilityTransition})),oe=uae(J),ye=_==="provider"&&oe.length<=1?"model":_,I=dae(J);i.push({id:`evidence_${e}_${a++}`,query:g.query,provider:S?.provider??b,model:S?.model??null,location:S?.location??null,citationState:B,answerMentioned:S?.answerMentioned,visibilityState:V,visibilityChangeLabel:DT($,Z,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:DT(P,X),answerSnippet:S?.answerText??"",citedDomains:S?.citedDomains??[],evidenceUrls:[],competitorDomains:S?.competitorOverlap??[],recommendedCompetitors:S?.recommendedCompetitors??[],matchedTerms:S?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:S?.groundingSources??[],summary:fae(V,$,g.query),runHistory:J,historyScope:ye,modelsSeen:oe,modelTransitions:I})}}}for(const u of r)l.has(u.query)||i.push({id:`evidence_${e}_${a++}`,query:u.query,provider:"",model:null,location:null,citationState:"pending",visibilityState:"pending",visibilityChangeLabel:"Awaiting first run",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${u.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"query",modelsSeen:[],modelTransitions:[]});return i}function cae(e,t){const n=new Map,r=`${t}:`;for(const[i,a]of Object.entries(e.modelRuns??{})){if(!i.startsWith(r))continue;const l=i.slice(r.length),u=l==="unknown"?null:l;for(const d of a)n.set(d.runId,u)}return n}function uae(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function dae(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 PT(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 RT(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 DT(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?`${Df(r.positive)} in latest run`:`${Df(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return Df(r.first);case"not-cited":case"not-visible":return t<=1?`${Df(r.negative)} in latest run`:`${Df(r.negative)} across ${t} runs`;default:return e}}function Df(e){return e.charAt(0).toUpperCase()+e.slice(1)}function fae(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 hae(e){const t=i3(e.project),n=lae(t.name,e.timeline,e.latestRunDetail,e.queries),i=[...e.runs].sort((a,l)=>l.createdAt.localeCompare(a.createdAt)).map(a=>xk(a,e.project.displayName||e.project.name));return e.overview?pae(t,e.overview,n,i):mae(t,n,i)}function pae(e,t,n,r){const i=rae(t.topInsights);for(const a of t.attentionItems)a.id.startsWith("insight_")||i.push({id:a.id,tone:a.tone,title:a.title,detail:a.detail,actionLabel:a.actionLabel,affectedPhrases:[]});return{project:e,dateRangeLabel:t.dateRangeLabel,contextLabel:t.contextLabel,visibilitySummary:t.scores.visibility,queryCounts:{cited:t.queryCounts.citedQueries,total:t.queryCounts.totalQueries},gapQueries:t.scores.gapQueries,indexCoverage:t.scores.indexCoverage,providerScores:t.providerScores,competitorPressure:t.scores.competitorPressure,runStatus:t.scores.runStatus,movementSummary:t.movementSummary,insights:i,visibilityEvidence:n,competitors:t.competitors.map(a=>({id:a.id,domain:a.domain,citationCount:a.citationCount,totalQueries:a.totalQueries,pressureLabel:a.pressureLabel,citedQueries:a.citedQueries,movement:"",notes:""})),recentRuns:r.slice(0,5)}}function mae(e,t,n){const r={label:"",value:"No data",delta:"Loading…",tone:"neutral",description:"",tooltip:"",trend:[]};return{project:e,dateRangeLabel:"All time",contextLabel:`${e.country} / ${e.language.toUpperCase()}`,visibilitySummary:{...r,label:"Answer Visibility"},queryCounts:{cited:0,total:0},gapQueries:{...r,label:"Gap Queries"},indexCoverage:{...r,label:"Index Coverage"},providerScores:[],competitorPressure:{...r,label:"Competitor Pressure"},runStatus:{...r,label:"Run Status"},movementSummary:{gained:0,lost:0,tone:"neutral",hasPreviousRun:!1},insights:[],visibilityEvidence:t,competitors:[],recentRuns:n.slice(0,5)}}function gae(e){const t=i3(e.project),n=[...e.runs].sort((g,v)=>v.createdAt.localeCompare(g.createdAt)),r=n.find(g=>g.kind===Tt["answer-visibility"])??n[0],i=e.project.displayName||e.project.name,a=r?xk(r,i):yae(e.project.id,i),l=e.overview;if(!l)return{project:t,visibilityScore:0,visibilityDelta:"No data",visibilityTone:"neutral",lastRun:a,insight:"No runs completed yet.",trend:[],competitorPressureLabel:"None"};const u=l.scores.visibility,d=u.progress??0,f=l.queryCounts.citedQueries,p=l.queryCounts.totalQueries,m=l.providers.length;return{project:t,visibilityScore:d,visibilityDelta:p>0?`${f} of ${p} queries`:"No data",visibilityTone:u.tone,providerCoverage:u.providerCoverage,lastRun:a,insight:p>0?`${f} of ${p} queries visible across ${m} provider${m===1?"":"s"}.`:"No runs completed yet.",trend:[],competitorPressureLabel:l.scores.competitorPressure.value}}function yae(e,t){return{id:"none",projectId:e,projectName:t,kind:Tt["answer-visibility"],kindLabel:"No runs yet",status:hr.queued,trigger:sh.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function vae(e,t){const n=[],r=[],i=[];for(const l of e){r.push(hae(l)),i.push(gae(l));const u=[...l.runs].sort((d,f)=>f.createdAt.localeCompare(d.createdAt));for(const d of u)n.push(xk(d,l.project.displayName||l.project.name))}n.sort((l,u)=>u.createdAt.localeCompare(l.createdAt));const a=e.length>0;return{portfolioOverview:{projects:i,attentionItems:a?xae(r):[{id:"attention_setup",tone:"neutral",title:"No projects yet",detail:"Create your first project using the setup wizard, CLI, or API.",actionLabel:"Open setup",href:"/setup"}],recentRuns:n.slice(0,5),systemHealth:[{id:"api",label:"API",tone:"positive",detail:"Connected",meta:"Real-time data"},{id:"provider",label:"Gemini",tone:"positive",detail:"Configured",meta:"Provider active"}],lastUpdatedAt:new Date().toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),...a?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small query set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:r,runs:n,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},queryImportState:{mode:"paste",queryCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:a,ctaLabel:a?"Trigger run":"Create a project first",summary:a?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(l=>({name:l.name,displayName:l.displayName,keyUrl:l.keyUrl,modelHint:l.modelHint,model:l.model,state:l.configured?"ready":"needs-config",detail:l.configured?"Provider is configured.":"API key is missing.",quota:l.quota})),google:{state:t?.google?.configured?"ready":"needs-config",detail:t?.google?.configured?"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard.":"Google OAuth client ID and client secret are not configured yet."},bing:{state:t?.bing?.configured?"ready":"needs-config",detail:t?.bing?.configured?"Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.":"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}}}function xae(e){const t=[];for(const n of e){const r=n.visibilityEvidence.filter(a=>a.citationState==="lost");r.length>0&&t.push({id:`attention_${n.project.id}_lost`,tone:"negative",title:`${n.project.displayName||n.project.name} lost citations`,detail:`${r.length} quer${r.length>1?"ies":"y"} lost citation.`,actionLabel:"Open project",href:`/projects/${n.project.id}`});const i=n.recentRuns.filter(a=>a.status===hr.running||a.status===hr.queued);i.length>0&&t.push({id:`attention_${n.project.id}_active`,tone:"neutral",title:`${n.project.displayName||n.project.name} has active runs`,detail:`${i.length} run${i.length>1?"s":""} in progress.`,actionLabel:"View runs",href:"/runs"})}return t.length===0&&t.push({id:"attention_stable",tone:"positive",title:"All projects stable",detail:"No citation losses or active runs to flag.",actionLabel:"View portfolio",href:"/"}),t}const qe={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],queries:e=>["projects",e,"queries"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"],gsc:{project:e=>["gsc",e],connections:e=>["gsc",e,"connections"],properties:e=>["gsc",e,"properties"],performance:(e,t)=>["gsc",e,"performance",t],inspections:(e,t)=>["gsc",e,"inspections",t],deindexed:e=>["gsc",e,"deindexed"],coverage:e=>["gsc",e,"coverage"],coverageHistory:e=>["gsc",e,"coverage-history"],sitemaps:e=>["gsc",e,"sitemaps"]},bing:{project:e=>["bing",e],status:e=>["bing",e,"status"],coverage:e=>["bing",e,"coverage"],inspections:e=>["bing",e,"inspections"],performance:e=>["bing",e,"performance"],sites:e=>["bing",e,"sites"]},schedule:e=>["schedule",e],notifications:e=>["notifications",e],agent:{providers:e=>["agent",e,"providers"]},citationVisibility:e=>["citation-visibility",e],report:e=>["report",e],traffic:{project:e=>["traffic",e],status:e=>["traffic",e,"status"],summary:(e,t)=>["traffic",e,"summary",t],aiHistory:(e,t)=>["traffic",e,"ai-history",t],sessionHistory:(e,t)=>["traffic",e,"session-history",t],socialHistory:(e,t)=>["traffic",e,"social-history",t]}},o3=x.createContext(null);o3.Provider;function Gh(){return x.useContext(o3)}function wc(e){const n=Gh()?.dashboard??null,r=ua({queryKey:qe.projects.all,queryFn:GN,enabled:!n}),i=ua({queryKey:qe.runs.all,queryFn:A5,enabled:!n,staleTime:YS,refetchInterval:j=>j.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:YS}),a=ua({queryKey:qe.settings,queryFn:()=>VN().catch(()=>null),enabled:!n}),l=r.data??[],u=i.data??[],d=JK({queries:l.map(j=>{const b=u.filter(k=>k.projectId===j.id),S=b.filter(k=>(k.status==="completed"||k.status==="partial")&&k.kind==="answer-visibility").sort((k,E)=>E.createdAt.localeCompare(k.createdAt));return{queryKey:qe.projects.detail(j.id,S[0]?.id),queryFn:async()=>{const k=S[0]?.id,[E,C,A,T,O,_,P,$,F]=await Promise.all([oV(j.name).catch(()=>[]),O5(j.name).catch(()=>[]),E5(j.name).catch(()=>[]),k?tc(k).catch(()=>null):Promise.resolve(null),S[1]?tc(S[1].id).catch(()=>null):Promise.resolve(null),QN(j.name).catch(()=>null),WN(j.name).catch(()=>null),k?lQ(j.name,k).catch(()=>null):Promise.resolve(null),lV(j.name).catch(()=>null)]);return{project:j,runs:b,queries:E,competitors:C,timeline:A,latestRunDetail:T,previousRunDetail:O,gscCoverage:_,bingCoverage:P,dbInsights:$,overview:F}},enabled:!n&&r.isSuccess&&i.isSuccess,staleTime:$5}})}),f=d.every(j=>j.isSuccess),p=x.useMemo(()=>{if(n)return n;if(!r.data||!i.data||l.length>0&&!f)return null;const j=d.map(b=>b.data?{...b.data,runs:u.filter(S=>S.projectId===b.data.project.id)}:null).filter(b=>b!=null);return vae(j,a.data??null)},[n,r.data,i.data,a.data,f,d,l.length,u]),m=!n&&(r.isError||i.isError),g=!n&&!p&&!m,v=x.useCallback(async()=>{await Promise.all([r.refetch(),i.refetch(),a.refetch()])},[r.refetch,i.refetch,a.refetch]);return{dashboard:p,isLoading:g,isError:m,refetch:v}}async function bae(){const e=await uQ("/health","API"),t=e.state==="ok"?{label:"Worker",state:"ok",detail:"In-process job runner"}:{label:"Worker",state:e.state,detail:`Depends on API health check · ${e.detail}`,statusCode:e.statusCode,hint:e.hint?`Worker status is inferred from API health in this deployment mode. ${e.hint}`:"Worker status is inferred from API health in this deployment mode."};return{apiStatus:e,workerStatus:t}}function Uv(e,t){return ua({queryKey:qe.health,queryFn:bae,enabled:e,refetchInterval:15e3,initialData:t})}function wae(e){return ua({queryKey:qe.runs.detail(e??""),queryFn:()=>tc(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function vd(){const e=Wo(),t=Cv({strict:!1}),n=Xr({select:d=>d.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:d=>e({to:n,from:Hi.to,search:f=>({...f,runId:d,evidenceId:void 0})}),openEvidence:d=>e({to:n,from:Hi.to,search:f=>({...f,evidenceId:d,runId:void 0})}),closeDrawer:()=>e({to:n,from:Hi.to,search:d=>({...d,runId:void 0,evidenceId:void 0})})}}const jae={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function Sae(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function Nae(){const e=x.useSyncExternalStore(AQ,O2,O2),t=Wo(),{openRun:n}=vd(),r=x.useCallback(a=>{WS(a)},[]),i=x.useCallback(a=>{a.cta&&(a.cta.intent==="open-run-drawer"?n(a.cta.runId):t({to:"/runs"}),WS(a.id))},[t,n]);return e.length===0?null:s.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(a=>s.jsxs("section",{role:a.tone==="negative"?"alert":"status","aria-live":a.tone==="negative"?"assertive":"polite","data-state":a.state,className:`toast-card ${jae[a.tone]}`,children:[s.jsxs("div",{className:"toast-copy",children:[s.jsx("p",{className:"toast-title",children:a.title}),a.detail?s.jsx("p",{className:"toast-detail",children:a.detail}):null,a.cta?s.jsx("button",{type:"button",className:"toast-action",onClick:()=>i(a),"aria-label":Sae(a),children:a.cta.label}):null]}),s.jsx("button",{type:"button",onClick:()=>r(a.id),className:"toast-dismiss","aria-label":"Dismiss",children:s.jsx(Kh,{className:"size-3.5"})})]},a.id))})}function kae(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Cae=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Aae=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Oae={};function MT(e,t){return(Oae.jsx?Aae:Cae).test(e)}const Eae=/[ \t\n\f\r]/g;function _ae(e){return typeof e=="object"?e.type==="text"?IT(e.value):!1:IT(e)}function IT(e){return e.replace(Eae,"")===""}let Vh=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Vh.prototype.normal={};Vh.prototype.property={};Vh.prototype.space=void 0;function l3(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Vh(n,r,t)}function s1(e){return e.toLowerCase()}class ri{constructor(t,n){this.attribute=n,this.property=t}}ri.prototype.attribute="";ri.prototype.booleanish=!1;ri.prototype.boolean=!1;ri.prototype.commaOrSpaceSeparated=!1;ri.prototype.commaSeparated=!1;ri.prototype.defined=!1;ri.prototype.mustUseProperty=!1;ri.prototype.number=!1;ri.prototype.overloadedBoolean=!1;ri.prototype.property="";ri.prototype.spaceSeparated=!1;ri.prototype.space=void 0;let zae=0;const lt=jc(),Bn=jc(),o1=jc(),Oe=jc(),Wt=jc(),$u=jc(),di=jc();function jc(){return 2**++zae}const l1=Object.freeze(Object.defineProperty({__proto__:null,boolean:lt,booleanish:Bn,commaOrSpaceSeparated:di,commaSeparated:$u,number:Oe,overloadedBoolean:o1,spaceSeparated:Wt},Symbol.toStringTag,{value:"Module"})),Dw=Object.keys(l1);class bk extends ri{constructor(t,n,r,i){let a=-1;if(super(t,n),LT(this,"space",i),typeof r=="number")for(;++a<Dw.length;){const l=Dw[a];LT(this,Dw[a],(r&l1[l])===l1[l])}}}bk.prototype.defined=!0;function LT(e,t,n){n&&(e[t]=n)}function xd(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new bk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[s1(r)]=r,n[s1(a.attribute)]=r}return new Vh(t,n,e.space)}const c3=xd({properties:{ariaActiveDescendant:null,ariaAtomic:Bn,ariaAutoComplete:null,ariaBusy:Bn,ariaChecked:Bn,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:Wt,ariaCurrent:null,ariaDescribedBy:Wt,ariaDetails:null,ariaDisabled:Bn,ariaDropEffect:Wt,ariaErrorMessage:null,ariaExpanded:Bn,ariaFlowTo:Wt,ariaGrabbed:Bn,ariaHasPopup:null,ariaHidden:Bn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Wt,ariaLevel:Oe,ariaLive:null,ariaModal:Bn,ariaMultiLine:Bn,ariaMultiSelectable:Bn,ariaOrientation:null,ariaOwns:Wt,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:Bn,ariaReadOnly:Bn,ariaRelevant:null,ariaRequired:Bn,ariaRoleDescription:Wt,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:Bn,ariaSetSize:Oe,ariaSort:null,ariaValueMax:Oe,ariaValueMin:Oe,ariaValueNow:Oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function u3(e,t){return t in e?e[t]:t}function d3(e,t){return u3(e,t.toLowerCase())}const Tae=xd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$u,acceptCharset:Wt,accessKey:Wt,action:null,allow:null,allowFullScreen:lt,allowPaymentRequest:lt,allowUserMedia:lt,alt:null,as:null,async:lt,autoCapitalize:null,autoComplete:Wt,autoFocus:lt,autoPlay:lt,blocking:Wt,capture:null,charSet:null,checked:lt,cite:null,className:Wt,cols:Oe,colSpan:null,content:null,contentEditable:Bn,controls:lt,controlsList:Wt,coords:Oe|$u,crossOrigin:null,data:null,dateTime:null,decoding:null,default:lt,defer:lt,dir:null,dirName:null,disabled:lt,download:o1,draggable:Bn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:lt,formTarget:null,headers:Wt,height:Oe,hidden:o1,high:Oe,href:null,hrefLang:null,htmlFor:Wt,httpEquiv:Wt,id:null,imageSizes:null,imageSrcSet:null,inert:lt,inputMode:null,integrity:null,is:null,isMap:lt,itemId:null,itemProp:Wt,itemRef:Wt,itemScope:lt,itemType:Wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:lt,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:lt,muted:lt,name:null,nonce:null,noModule:lt,noValidate:lt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:lt,optimum:Oe,pattern:null,ping:Wt,placeholder:null,playsInline:lt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:lt,referrerPolicy:null,rel:Wt,required:lt,reversed:lt,rows:Oe,rowSpan:Oe,sandbox:Wt,scope:null,scoped:lt,seamless:lt,selected:lt,shadowRootClonable:lt,shadowRootDelegatesFocus:lt,shadowRootMode:null,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:Bn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oe,step:null,style:null,tabIndex:Oe,target:null,title:null,translate:null,type:null,typeMustMatch:lt,useMap:null,value:Bn,width:Oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Wt,axis:null,background:null,bgColor:null,border:Oe,borderColor:null,bottomMargin:Oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:lt,declare:lt,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:lt,noHref:lt,noShade:lt,noWrap:lt,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:Bn,standby:null,summary:null,text:null,topMargin:Oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:lt,disableRemotePlayback:lt,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:d3}),Pae=xd({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:di,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:Wt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Oe,diffuseConstant:Oe,direction:null,display:null,dur:null,divisor:Oe,dominantBaseline:null,download:lt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oe,enableBackground:null,end:null,event:null,exponent:Oe,externalResourcesRequired:null,fill:null,fillOpacity:Oe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:$u,g2:$u,glyphName:$u,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:di,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Oe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:di,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:di,rev:di,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:di,requiredFeatures:di,requiredFonts:di,requiredFormats:di,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:di,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:di,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:di,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:u3}),f3=xd({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),h3=xd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:d3}),p3=xd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Rae={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Dae=/[A-Z]/g,$T=/-[a-z]/g,Mae=/^data[-\w.:]+$/i;function Iae(e,t){const n=s1(t);let r=t,i=ri;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Mae.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace($T,$ae);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!$T.test(a)){let l=a.replace(Dae,Lae);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=bk}return new i(r,t)}function Lae(e){return"-"+e.toLowerCase()}function $ae(e){return e.charAt(1).toUpperCase()}const Bae=l3([c3,Tae,f3,h3,p3],"html"),wk=l3([c3,Pae,f3,h3,p3],"svg");function Uae(e){return e.join(" ").trim()}var fu={},Mw,BT;function qae(){if(BT)return Mw;BT=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
98
+ `,f="/",p="*",m="",g="comment",v="declaration";function j(S,k){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];k=k||{};var E=1,C=1;function A(X){var Z=X.match(t);Z&&(E+=Z.length);var H=X.lastIndexOf(d);C=~H?X.length-H:C+X.length}function T(){var X={line:E,column:C};return function(Z){return Z.position=new O(X),$(),Z}}function O(X){this.start=X,this.end={line:E,column:C},this.source=k.source}O.prototype.content=S;function _(X){var Z=new Error(k.source+":"+E+":"+C+": "+X);if(Z.reason=X,Z.filename=k.source,Z.line=E,Z.column=C,Z.source=S,!k.silent)throw Z}function P(X){var Z=X.exec(S);if(Z){var H=Z[0];return A(H),S=S.slice(H.length),Z}}function $(){P(n)}function F(X){var Z;for(X=X||[];Z=U();)Z!==!1&&X.push(Z);return X}function U(){var X=T();if(!(f!=S.charAt(0)||p!=S.charAt(1))){for(var Z=2;m!=S.charAt(Z)&&(p!=S.charAt(Z)||f!=S.charAt(Z+1));)++Z;if(Z+=2,m===S.charAt(Z-1))return _("End of comment missing");var H=S.slice(2,Z-2);return C+=2,A(H),S=S.slice(Z),C+=2,X({type:g,comment:H})}}function B(){var X=T(),Z=P(r);if(Z){if(U(),!P(i))return _("property missing ':'");var H=P(a),J=X({type:v,property:b(Z[0].replace(e,m)),value:H?b(H[0].replace(e,m)):m});return P(l),J}}function V(){var X=[];F(X);for(var Z;Z=B();)Z!==!1&&(X.push(Z),F(X));return X}return $(),V()}function b(S){return S?S.replace(u,m):m}return Mw=j,Mw}var UT;function Fae(){if(UT)return fu;UT=1;var e=fu&&fu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fu,"__esModule",{value:!0}),fu.default=n;const t=e(qae());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),u=typeof i=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;u?i(f,p,d):p&&(a=a||{},a[f]=p)}),a}return fu}var Mf={},qT;function Hae(){if(qT)return Mf;qT=1,Object.defineProperty(Mf,"__esModule",{value:!0}),Mf.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},l=function(f,p){return p.toUpperCase()},u=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),a(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(i,u):f=f.replace(r,u),f.replace(t,l))};return Mf.camelCase=d,Mf}var If,FT;function Kae(){if(FT)return If;FT=1;var e=If&&If.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Fae()),n=Hae();function r(i,a){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(u,d){u&&d&&(l[(0,n.camelCase)(u,a)]=d)}),l}return r.default=r,If=r,If}var Gae=Kae();const Vae=ma(Gae),m3=g3("end"),jk=g3("start");function g3(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Qae(e){const t=jk(e),n=m3(e);if(t&&n)return{start:t,end:n}}function oh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?HT(e.position):"start"in e||"end"in e?HT(e):"line"in e||"column"in e?c1(e):""}function c1(e){return KT(e&&e.line)+":"+KT(e&&e.column)}function HT(e){return c1(e&&e.start)+"-"+c1(e&&e.end)}function KT(e){return e&&typeof e=="number"?e:1}class Ar extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(l=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const u=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=oh(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ar.prototype.file="";Ar.prototype.name="";Ar.prototype.reason="";Ar.prototype.message="";Ar.prototype.stack="";Ar.prototype.column=void 0;Ar.prototype.line=void 0;Ar.prototype.ancestors=void 0;Ar.prototype.cause=void 0;Ar.prototype.fatal=void 0;Ar.prototype.place=void 0;Ar.prototype.ruleId=void 0;Ar.prototype.source=void 0;const Sk={}.hasOwnProperty,Wae=new Map,Yae=/[A-Z]/g,Zae=new Set(["table","tbody","thead","tfoot","tr"]),Xae=new Set(["td","th"]),y3="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Jae(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ose(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=sse(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?wk:Bae,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=v3(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function v3(e,t,n){if(t.type==="element")return ese(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return tse(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return rse(e,t,n);if(t.type==="mdxjsEsm")return nse(e,t);if(t.type==="root")return ise(e,t,n);if(t.type==="text")return ase(e,t)}function ese(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=wk,e.schema=i),e.ancestors.push(t);const a=b3(e,t.tagName,!1),l=lse(e,t);let u=kk(e,t);return Zae.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!_ae(d):!0})),x3(e,l,a,t),Nk(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function tse(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Nh(e,t.position)}function nse(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Nh(e,t.position)}function rse(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=wk,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:b3(e,t.name,!0),l=cse(e,t),u=kk(e,t);return x3(e,l,a,t),Nk(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function ise(e,t,n){const r={};return Nk(r,kk(e,t)),e.create(t,e.Fragment,r,n)}function ase(e,t){return t.value}function x3(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Nk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function sse(e,t,n){return r;function r(i,a,l,u){const f=Array.isArray(l.children)?n:t;return u?f(a,l,u):f(a,l)}}function ose(e,t){return n;function n(r,i,a,l){const u=Array.isArray(a.children),d=jk(r);return t(i,a,l,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function lse(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Sk.call(t.properties,i)){const a=use(e,i,t.properties[i]);if(a){const[l,u]=a;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&Xae.has(t.tagName)?r=u:n[l]=u}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function cse(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else Nh(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else Nh(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function kk(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Wae;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=i.get(d)||0;l=d+"-"+f,i.set(d,f+1)}}const u=v3(e,a,l);u!==void 0&&n.push(u)}return n}function use(e,t,n){const r=Iae(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?kae(n):Uae(n)),r.property==="style"){let i=typeof n=="object"?n:dse(e,String(n));return e.stylePropertyNameCase==="css"&&(i=fse(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Rae[r.property]||r.property:r.attribute,n]}}function dse(e,t){try{return Vae(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ar("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=y3+"#cannot-parse-style-attribute",i}}function b3(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,l;for(;++a<i.length;){const u=MT(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=l}else r=MT(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Sk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Nh(e)}function Nh(e,t){const n=new Ar("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=y3+"#cannot-handle-mdx-estrees-without-createevaluater",n}function fse(e){const t={};let n;for(n in e)Sk.call(e,n)&&(t[hse(n)]=e[n]);return t}function hse(e){let t=e.replace(Yae,pse);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function pse(e){return"-"+e.toLowerCase()}const Iw={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},mse={};function gse(e,t){const n=mse,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return w3(e,r,i)}function w3(e,t,n){if(yse(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return GT(e.children,t,n)}return Array.isArray(e)?GT(e,t,n):""}function GT(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=w3(e[i],t,n);return r.join("")}function yse(e){return!!(e&&typeof e=="object")}const VT=document.createElement("i");function Ck(e){const t="&"+e+";";VT.innerHTML=t;const n=VT.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ua(e,t,n,r){const i=e.length;let a=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function $i(e,t){return e.length>0?(Ua(e,e.length,0,t),e):t}const QT={}.hasOwnProperty;function vse(e){const t={};let n=-1;for(;++n<e.length;)xse(t,e[n]);return t}function xse(e,t){let n;for(n in t){const i=(QT.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){QT.call(i,l)||(i[l]=[]);const u=a[l];bse(i[l],Array.isArray(u)?u:u?[u]:[])}}}function bse(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ua(e,0,0,r)}function j3(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Bu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ma=Jo(/[A-Za-z]/),hi=Jo(/[\dA-Za-z]/),wse=Jo(/[#-'*+\--9=?A-Z^-~]/);function u1(e){return e!==null&&(e<32||e===127)}const d1=Jo(/\d/),jse=Jo(/[\dA-Fa-f]/),Sse=Jo(/[!-/:-@[-`{-~]/);function tt(e){return e!==null&&e<-2}function Jr(e){return e!==null&&(e<0||e===32)}function Pt(e){return e===-2||e===-1||e===32}const Nse=Jo(new RegExp("\\p{P}|\\p{S}","u")),kse=Jo(/\s/);function Jo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function bd(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&hi(e.charCodeAt(n+1))&&hi(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(l=String.fromCharCode(a,u),i=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Xt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return Pt(d)?(e.enter(n),u(d)):t(d)}function u(d){return Pt(d)&&a++<i?(e.consume(d),u):(e.exit(n),t(d))}}const Cse={tokenize:Ase};function Ase(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Xt(e,t,"linePrefix")}function i(u){return e.enter("paragraph"),a(u)}function a(u){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return tt(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),l)}}const Ose={tokenize:Ese},WT={tokenize:_se};function Ese(e){const t=this,n=[];let r=0,i,a,l;return u;function u(C){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,d,f)(C)}return f(C)}function d(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const A=t.events.length;let T=A,O;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){O=t.events[T][1].end;break}k(r);let _=A;for(;_<t.events.length;)t.events[_][1].end={...O},_++;return Ua(t.events,T+1,0,t.events.slice(A)),t.events.length=_,f(C)}return u(C)}function f(C){if(r===n.length){if(!i)return g(C);if(i.currentConstruct&&i.currentConstruct.concrete)return j(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(WT,p,m)(C)}function p(C){return i&&E(),k(r),g(C)}function m(C){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,j(C)}function g(C){return t.containerState={},e.attempt(WT,v,j)(C)}function v(C){return r++,n.push([t.currentConstruct,t.containerState]),g(C)}function j(C){if(C===null){i&&E(),k(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),b(C)}function b(C){if(C===null){S(e.exit("chunkFlow"),!0),k(0),e.consume(C);return}return tt(C)?(e.consume(C),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(C),b)}function S(C,A){const T=t.sliceStream(C);if(A&&T.push(null),C.previous=a,a&&(a.next=C),a=C,i.defineSkip(C.start),i.write(T),t.parser.lazy[C.start.line]){let O=i.events.length;for(;O--;)if(i.events[O][1].start.offset<l&&(!i.events[O][1].end||i.events[O][1].end.offset>l))return;const _=t.events.length;let P=_,$,F;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if($){F=t.events[P][1].end;break}$=!0}for(k(r),O=_;O<t.events.length;)t.events[O][1].end={...F},O++;Ua(t.events,P+1,0,t.events.slice(_)),t.events.length=O}}function k(C){let A=n.length;for(;A-- >C;){const T=n[A];t.containerState=T[1],T[0].exit.call(t,e)}n.length=C}function E(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function _se(e,t,n){return Xt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function YT(e){if(e===null||Jr(e)||kse(e))return 1;if(Nse(e))return 2}function Ak(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const f1={name:"attention",resolveAll:zse,tokenize:Tse};function zse(e,t){let n=-1,r,i,a,l,u,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},g={...e[n][1].start};ZT(m,-d),ZT(g,d),l={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=$i(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=$i(f,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",a,t]]),f=$i(f,Ak(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=$i(f,[["exit",a,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=$i(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Ua(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Tse(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=YT(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),u(d)}function u(d){if(d===a)return e.consume(d),u;const f=e.exit("attentionSequence"),p=YT(d),m=!p||p===2&&i||n.includes(d),g=!i||i===2&&p||n.includes(r);return f._open=!!(a===42?m:m&&(i||!g)),f._close=!!(a===42?g:g&&(p||!m)),t(d)}}function ZT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Pse={name:"autolink",tokenize:Rse};function Rse(e,t,n){let r=0;return i;function i(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(v){return Ma(v)?(e.consume(v),l):v===64?n(v):f(v)}function l(v){return v===43||v===45||v===46||hi(v)?(r=1,u(v)):f(v)}function u(v){return v===58?(e.consume(v),r=0,d):(v===43||v===45||v===46||hi(v))&&r++<32?(e.consume(v),u):(r=0,f(v))}function d(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||u1(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):wse(v)?(e.consume(v),f):n(v)}function p(v){return hi(v)?m(v):n(v)}function m(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):g(v)}function g(v){if((v===45||hi(v))&&r++<63){const j=v===45?g:m;return e.consume(v),j}return n(v)}}const qv={partial:!0,tokenize:Dse};function Dse(e,t,n){return r;function r(a){return Pt(a)?Xt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||tt(a)?t(a):n(a)}}const S3={continuation:{tokenize:Ise},exit:Lse,name:"blockQuote",tokenize:Mse};function Mse(e,t,n){const r=this;return i;function i(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return Pt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function Ise(e,t,n){const r=this;return i;function i(l){return Pt(l)?Xt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(S3,t,n)(l)}}function Lse(e){e.exit("blockQuote")}const N3={name:"characterEscape",tokenize:$se};function $se(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return Sse(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const k3={name:"characterReference",tokenize:Bse};function Bse(e,t,n){const r=this;let i=0,a,l;return u;function u(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,l=hi,p(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=jse,p):(e.enter("characterReferenceValue"),a=7,l=d1,p(m))}function p(m){if(m===59&&i){const g=e.exit("characterReferenceValue");return l===hi&&!Ck(r.sliceSerialize(g))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&i++<a?(e.consume(m),p):n(m)}}const XT={partial:!0,tokenize:qse},JT={concrete:!0,name:"codeFenced",tokenize:Use};function Use(e,t,n){const r=this,i={partial:!0,tokenize:T};let a=0,l=0,u;return d;function d(O){return f(O)}function f(O){const _=r.events[r.events.length-1];return a=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,u=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(O)}function p(O){return O===u?(l++,e.consume(O),p):l<3?n(O):(e.exit("codeFencedFenceSequence"),Pt(O)?Xt(e,m,"whitespace")(O):m(O))}function m(O){return O===null||tt(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(XT,b,A)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(O))}function g(O){return O===null||tt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(O)):Pt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Xt(e,v,"whitespace")(O)):O===96&&O===u?n(O):(e.consume(O),g)}function v(O){return O===null||tt(O)?m(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),j(O))}function j(O){return O===null||tt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(O)):O===96&&O===u?n(O):(e.consume(O),j)}function b(O){return e.attempt(i,A,S)(O)}function S(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),k}function k(O){return a>0&&Pt(O)?Xt(e,E,"linePrefix",a+1)(O):E(O)}function E(O){return O===null||tt(O)?e.check(XT,b,A)(O):(e.enter("codeFlowValue"),C(O))}function C(O){return O===null||tt(O)?(e.exit("codeFlowValue"),E(O)):(e.consume(O),C)}function A(O){return e.exit("codeFenced"),t(O)}function T(O,_,P){let $=0;return F;function F(Z){return O.enter("lineEnding"),O.consume(Z),O.exit("lineEnding"),U}function U(Z){return O.enter("codeFencedFence"),Pt(Z)?Xt(O,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):B(Z)}function B(Z){return Z===u?(O.enter("codeFencedFenceSequence"),V(Z)):P(Z)}function V(Z){return Z===u?($++,O.consume(Z),V):$>=l?(O.exit("codeFencedFenceSequence"),Pt(Z)?Xt(O,X,"whitespace")(Z):X(Z)):P(Z)}function X(Z){return Z===null||tt(Z)?(O.exit("codeFencedFence"),_(Z)):P(Z)}}}function qse(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Lw={name:"codeIndented",tokenize:Hse},Fse={partial:!0,tokenize:Kse};function Hse(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Xt(e,a,"linePrefix",5)(f)}function a(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?d(f):tt(f)?e.attempt(Fse,l,d)(f):(e.enter("codeFlowValue"),u(f))}function u(f){return f===null||tt(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),u)}function d(f){return e.exit("codeIndented"),t(f)}}function Kse(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):tt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):Xt(e,a,"linePrefix",5)(l)}function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):tt(l)?i(l):n(l)}}const Gse={name:"codeText",previous:Qse,resolve:Vse,tokenize:Wse};function Vse(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Qse(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Wse(e,t,n){let r=0,i,a;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),r++,u):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(a=e.enter("codeTextSequence"),i=0,p(m)):tt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(m))}function f(m){return m===null||m===32||m===96||tt(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),f)}function p(m){return m===96?(e.consume(m),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",f(m))}}class Yse{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Lf(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Lf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Lf(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Lf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Lf(this.left,n.reverse())}}}function Lf(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function C3(e){const t={};let n=-1,r,i,a,l,u,d,f;const p=new Yse(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Zse(p,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(l=p.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},u=p.slice(i,n),u.unshift(r),p.splice(i,n-i+1,u))}}return Ua(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function Zse(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,d=[],f={};let p,m,g=-1,v=n,j=0,b=0;const S=[b];for(;v;){for(;e.get(++i)[1]!==v;);a.push(i),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),m&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++g<u.length;)u[g][0]==="exit"&&u[g-1][0]==="enter"&&u[g][1].type===u[g-1][1].type&&u[g][1].start.line!==u[g][1].end.line&&(b=g+1,S.push(b),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):S.pop(),g=S.length;g--;){const k=u.slice(S[g],S[g+1]),E=a.pop();d.push([E,E+k.length-1]),e.splice(E,2,k)}for(d.reverse(),g=-1;++g<d.length;)f[j+d[g][0]]=j+d[g][1],j+=d[g][1]-d[g][0]-1;return f}const Xse={resolve:eoe,tokenize:toe},Jse={partial:!0,tokenize:noe};function eoe(e){return C3(e),e}function toe(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?a(u):tt(u)?e.check(Jse,l,a)(u):(e.consume(u),i)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function l(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function noe(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Xt(e,a,"linePrefix")}function a(l){if(l===null||tt(l))return n(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function A3(e,t,n,r,i,a,l,u,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return m;function m(k){return k===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(k),e.exit(a),g):k===null||k===32||k===41||u1(k)?n(k):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),b(k))}function g(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===62?(e.exit("chunkString"),e.exit(u),g(k)):k===null||k===60||tt(k)?n(k):(e.consume(k),k===92?j:v)}function j(k){return k===60||k===62||k===92?(e.consume(k),v):v(k)}function b(k){return!p&&(k===null||k===41||Jr(k))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(k)):p<f&&k===40?(e.consume(k),p++,b):k===41?(e.consume(k),p--,b):k===null||k===32||k===40||u1(k)?n(k):(e.consume(k),k===92?S:b)}function S(k){return k===40||k===41||k===92?(e.consume(k),b):b(k)}}function O3(e,t,n,r,i,a){const l=this;let u=0,d;return f;function f(v){return e.enter(r),e.enter(i),e.consume(v),e.exit(i),e.enter(a),p}function p(v){return u>999||v===null||v===91||v===93&&!d||v===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):tt(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||v===91||v===93||tt(v)||u++>999?(e.exit("chunkString"),p(v)):(e.consume(v),d||(d=!Pt(v)),v===92?g:m)}function g(v){return v===91||v===92||v===93?(e.consume(v),u++,m):m(v)}}function E3(e,t,n,r,i,a){let l;return u;function u(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),l=g===40?41:g,d):n(g)}function d(g){return g===l?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(a),f(g))}function f(g){return g===l?(e.exit(a),d(l)):g===null?n(g):tt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Xt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===l||g===null||tt(g)?(e.exit("chunkString"),f(g)):(e.consume(g),g===92?m:p)}function m(g){return g===l||g===92?(e.consume(g),p):p(g)}}function lh(e,t){let n;return r;function r(i){return tt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Pt(i)?Xt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const roe={name:"definition",tokenize:aoe},ioe={partial:!0,tokenize:soe};function aoe(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),l(v)}function l(v){return O3.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function u(v){return i=Bu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),d):n(v)}function d(v){return Jr(v)?lh(e,f)(v):f(v)}function f(v){return A3(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(ioe,m,m)(v)}function m(v){return Pt(v)?Xt(e,g,"whitespace")(v):g(v)}function g(v){return v===null||tt(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function soe(e,t,n){return r;function r(u){return Jr(u)?lh(e,i)(u):n(u)}function i(u){return E3(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return Pt(u)?Xt(e,l,"whitespace")(u):l(u)}function l(u){return u===null||tt(u)?t(u):n(u)}}const ooe={name:"hardBreakEscape",tokenize:loe};function loe(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return tt(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const coe={name:"headingAtx",resolve:uoe,tokenize:doe};function uoe(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ua(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function doe(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||Jr(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||tt(p)?(e.exit("atxHeading"),t(p)):Pt(p)?Xt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),u(p))}function f(p){return p===null||p===35||Jr(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),f)}}const foe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],eP=["pre","script","style","textarea"],hoe={concrete:!0,name:"htmlFlow",resolveTo:goe,tokenize:yoe},poe={partial:!0,tokenize:xoe},moe={partial:!0,tokenize:voe};function goe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function yoe(e,t,n){const r=this;let i,a,l,u,d;return f;function f(D){return p(D)}function p(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),m}function m(D){return D===33?(e.consume(D),g):D===47?(e.consume(D),a=!0,b):D===63?(e.consume(D),i=3,r.interrupt?t:I):Ma(D)?(e.consume(D),l=String.fromCharCode(D),S):n(D)}function g(D){return D===45?(e.consume(D),i=2,v):D===91?(e.consume(D),i=5,u=0,j):Ma(D)?(e.consume(D),i=4,r.interrupt?t:I):n(D)}function v(D){return D===45?(e.consume(D),r.interrupt?t:I):n(D)}function j(D){const G="CDATA[";return D===G.charCodeAt(u++)?(e.consume(D),u===G.length?r.interrupt?t:B:j):n(D)}function b(D){return Ma(D)?(e.consume(D),l=String.fromCharCode(D),S):n(D)}function S(D){if(D===null||D===47||D===62||Jr(D)){const G=D===47,se=l.toLowerCase();return!G&&!a&&eP.includes(se)?(i=1,r.interrupt?t(D):B(D)):foe.includes(l.toLowerCase())?(i=6,G?(e.consume(D),k):r.interrupt?t(D):B(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):a?E(D):C(D))}return D===45||hi(D)?(e.consume(D),l+=String.fromCharCode(D),S):n(D)}function k(D){return D===62?(e.consume(D),r.interrupt?t:B):n(D)}function E(D){return Pt(D)?(e.consume(D),E):F(D)}function C(D){return D===47?(e.consume(D),F):D===58||D===95||Ma(D)?(e.consume(D),A):Pt(D)?(e.consume(D),C):F(D)}function A(D){return D===45||D===46||D===58||D===95||hi(D)?(e.consume(D),A):T(D)}function T(D){return D===61?(e.consume(D),O):Pt(D)?(e.consume(D),T):C(D)}function O(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),d=D,_):Pt(D)?(e.consume(D),O):P(D)}function _(D){return D===d?(e.consume(D),d=null,$):D===null||tt(D)?n(D):(e.consume(D),_)}function P(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Jr(D)?T(D):(e.consume(D),P)}function $(D){return D===47||D===62||Pt(D)?C(D):n(D)}function F(D){return D===62?(e.consume(D),U):n(D)}function U(D){return D===null||tt(D)?B(D):Pt(D)?(e.consume(D),U):n(D)}function B(D){return D===45&&i===2?(e.consume(D),H):D===60&&i===1?(e.consume(D),J):D===62&&i===4?(e.consume(D),M):D===63&&i===3?(e.consume(D),I):D===93&&i===5?(e.consume(D),ye):tt(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(poe,q,V)(D)):D===null||tt(D)?(e.exit("htmlFlowData"),V(D)):(e.consume(D),B)}function V(D){return e.check(moe,X,q)(D)}function X(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Z}function Z(D){return D===null||tt(D)?V(D):(e.enter("htmlFlowData"),B(D))}function H(D){return D===45?(e.consume(D),I):B(D)}function J(D){return D===47?(e.consume(D),l="",oe):B(D)}function oe(D){if(D===62){const G=l.toLowerCase();return eP.includes(G)?(e.consume(D),M):B(D)}return Ma(D)&&l.length<8?(e.consume(D),l+=String.fromCharCode(D),oe):B(D)}function ye(D){return D===93?(e.consume(D),I):B(D)}function I(D){return D===62?(e.consume(D),M):D===45&&i===2?(e.consume(D),I):B(D)}function M(D){return D===null||tt(D)?(e.exit("htmlFlowData"),q(D)):(e.consume(D),M)}function q(D){return e.exit("htmlFlow"),t(D)}}function voe(e,t,n){const r=this;return i;function i(l){return tt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function xoe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(qv,t,n)}}const boe={name:"htmlText",tokenize:woe};function woe(e,t,n){const r=this;let i,a,l;return u;function u(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),d}function d(I){return I===33?(e.consume(I),f):I===47?(e.consume(I),T):I===63?(e.consume(I),C):Ma(I)?(e.consume(I),P):n(I)}function f(I){return I===45?(e.consume(I),p):I===91?(e.consume(I),a=0,j):Ma(I)?(e.consume(I),E):n(I)}function p(I){return I===45?(e.consume(I),v):n(I)}function m(I){return I===null?n(I):I===45?(e.consume(I),g):tt(I)?(l=m,J(I)):(e.consume(I),m)}function g(I){return I===45?(e.consume(I),v):m(I)}function v(I){return I===62?H(I):I===45?g(I):m(I)}function j(I){const M="CDATA[";return I===M.charCodeAt(a++)?(e.consume(I),a===M.length?b:j):n(I)}function b(I){return I===null?n(I):I===93?(e.consume(I),S):tt(I)?(l=b,J(I)):(e.consume(I),b)}function S(I){return I===93?(e.consume(I),k):b(I)}function k(I){return I===62?H(I):I===93?(e.consume(I),k):b(I)}function E(I){return I===null||I===62?H(I):tt(I)?(l=E,J(I)):(e.consume(I),E)}function C(I){return I===null?n(I):I===63?(e.consume(I),A):tt(I)?(l=C,J(I)):(e.consume(I),C)}function A(I){return I===62?H(I):C(I)}function T(I){return Ma(I)?(e.consume(I),O):n(I)}function O(I){return I===45||hi(I)?(e.consume(I),O):_(I)}function _(I){return tt(I)?(l=_,J(I)):Pt(I)?(e.consume(I),_):H(I)}function P(I){return I===45||hi(I)?(e.consume(I),P):I===47||I===62||Jr(I)?$(I):n(I)}function $(I){return I===47?(e.consume(I),H):I===58||I===95||Ma(I)?(e.consume(I),F):tt(I)?(l=$,J(I)):Pt(I)?(e.consume(I),$):H(I)}function F(I){return I===45||I===46||I===58||I===95||hi(I)?(e.consume(I),F):U(I)}function U(I){return I===61?(e.consume(I),B):tt(I)?(l=U,J(I)):Pt(I)?(e.consume(I),U):$(I)}function B(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),i=I,V):tt(I)?(l=B,J(I)):Pt(I)?(e.consume(I),B):(e.consume(I),X)}function V(I){return I===i?(e.consume(I),i=void 0,Z):I===null?n(I):tt(I)?(l=V,J(I)):(e.consume(I),V)}function X(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Jr(I)?$(I):(e.consume(I),X)}function Z(I){return I===47||I===62||Jr(I)?$(I):n(I)}function H(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function J(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),oe}function oe(I){return Pt(I)?Xt(e,ye,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):ye(I)}function ye(I){return e.enter("htmlTextData"),l(I)}}const Ok={name:"labelEnd",resolveAll:koe,resolveTo:Coe,tokenize:Aoe},joe={tokenize:Ooe},Soe={tokenize:Eoe},Noe={tokenize:_oe};function koe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Ua(e,0,e.length,n),e}function Coe(e,t){let n=e.length,r=0,i,a,l,u;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",d,t],["enter",f,t]],u=$i(u,e.slice(a+1,a+r+3)),u=$i(u,[["enter",p,t]]),u=$i(u,Ak(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),u=$i(u,[["exit",p,t],e[l-2],e[l-1],["exit",f,t]]),u=$i(u,e.slice(l+1)),u=$i(u,[["exit",d,t]]),Ua(e,a,e.length,u),e}function Aoe(e,t,n){const r=this;let i=r.events.length,a,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return u;function u(g){return a?a._inactive?m(g):(l=r.parser.defined.includes(Bu(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),d):n(g)}function d(g){return g===40?e.attempt(joe,p,l?p:m)(g):g===91?e.attempt(Soe,p,l?f:m)(g):l?p(g):m(g)}function f(g){return e.attempt(Noe,p,m)(g)}function p(g){return t(g)}function m(g){return a._balanced=!0,n(g)}}function Ooe(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),i}function i(m){return Jr(m)?lh(e,a)(m):a(m)}function a(m){return m===41?p(m):A3(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return Jr(m)?lh(e,d)(m):p(m)}function u(m){return n(m)}function d(m){return m===34||m===39||m===40?E3(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return Jr(m)?lh(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function Eoe(e,t,n){const r=this;return i;function i(u){return O3.call(r,e,a,l,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(Bu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function _oe(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const zoe={name:"labelStartImage",resolveAll:Ok.resolveAll,tokenize:Toe};function Toe(e,t,n){const r=this;return i;function i(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const Poe={name:"labelStartLink",resolveAll:Ok.resolveAll,tokenize:Roe};function Roe(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const $w={name:"lineEnding",tokenize:Doe};function Doe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Xt(e,t,"linePrefix")}}const Ig={name:"thematicBreak",tokenize:Moe};function Moe(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),l(f)}function l(f){return i=f,u(f)}function u(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||tt(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Pt(f)?Xt(e,u,"whitespace")(f):u(f))}}const Vr={continuation:{tokenize:Boe},exit:qoe,name:"list",tokenize:$oe},Ioe={partial:!0,tokenize:Foe},Loe={partial:!0,tokenize:Uoe};function $oe(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return u;function u(v){const j=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(j==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:d1(v)){if(r.containerState.type||(r.containerState.type=j,e.enter(j,{_container:!0})),j==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Ig,n,f)(v):f(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return n(v)}function d(v){return d1(v)&&++l<10?(e.consume(v),d):(!r.interrupt||l<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(qv,r.interrupt?n:p,e.attempt(Ioe,g,m))}function p(v){return r.containerState.initialBlankLine=!0,a++,g(v)}function m(v){return Pt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),g):n(v)}function g(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function Boe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(qv,i,a);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Xt(e,t,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!Pt(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Loe,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Xt(e,e.attempt(Vr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function Uoe(e,t,n){const r=this;return Xt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function qoe(e){e.exit(this.containerState.type)}function Foe(e,t,n){const r=this;return Xt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const l=r.events[r.events.length-1];return!Pt(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const tP={name:"setextUnderline",resolveTo:Hoe,tokenize:Koe};function Hoe(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Koe(e,t,n){const r=this;let i;return a;function a(f){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=f,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),u(f)}function u(f){return f===i?(e.consume(f),u):(e.exit("setextHeadingLineSequence"),Pt(f)?Xt(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||tt(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const Goe={tokenize:Voe};function Voe(e){const t=this,n=e.attempt(qv,r,e.attempt(this.parser.constructs.flowInitial,i,Xt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Xse,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Qoe={resolveAll:z3()},Woe=_3("string"),Yoe=_3("text");function _3(e){return{resolveAll:z3(e==="text"?Zoe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,l,u);return l;function l(p){return f(p)?a(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),a(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const m=i[p];let g=-1;if(m)for(;++g<m.length;){const v=m[g];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function z3(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function Zoe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,l=-1,u=0,d;for(;a--;){const f=i[a];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(f===-2)d=!0,u++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const f={type:n===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const Xoe={42:Vr,43:Vr,45:Vr,48:Vr,49:Vr,50:Vr,51:Vr,52:Vr,53:Vr,54:Vr,55:Vr,56:Vr,57:Vr,62:S3},Joe={91:roe},ele={[-2]:Lw,[-1]:Lw,32:Lw},tle={35:coe,42:Ig,45:[tP,Ig],60:hoe,61:tP,95:Ig,96:JT,126:JT},nle={38:k3,92:N3},rle={[-5]:$w,[-4]:$w,[-3]:$w,33:zoe,38:k3,42:f1,60:[Pse,boe],91:Poe,92:[ooe,N3],93:Ok,95:f1,96:Gse},ile={null:[f1,Qoe]},ale={null:[42,95]},sle={null:[]},ole=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ale,contentInitial:Joe,disable:sle,document:Xoe,flow:tle,flowInitial:ele,insideSpan:ile,string:nle,text:rle},Symbol.toStringTag,{value:"Module"}));function lle(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let l=[],u=[];const d={attempt:_(T),check:_(O),consume:E,enter:C,exit:A,interrupt:_(O,{interrupt:!0})},f={code:null,containerState:{},defineSkip:b,events:[],now:j,parser:e,previous:null,sliceSerialize:g,sliceStream:v,write:m};let p=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function m(U){return l=$i(l,U),S(),l[l.length-1]!==null?[]:(P(t,0),f.events=Ak(a,f.events,f),f.events)}function g(U,B){return ule(v(U),B)}function v(U){return cle(l,U)}function j(){const{_bufferIndex:U,_index:B,line:V,column:X,offset:Z}=r;return{_bufferIndex:U,_index:B,line:V,column:X,offset:Z}}function b(U){i[U.line]=U.column,F()}function S(){let U;for(;r._index<l.length;){const B=l[r._index];if(typeof B=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<B.length;)k(B.charCodeAt(r._bufferIndex));else k(B)}}function k(U){p=p(U)}function E(U){tt(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,F()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=U}function C(U,B){const V=B||{};return V.type=U,V.start=j(),f.events.push(["enter",V,f]),u.push(V),V}function A(U){const B=u.pop();return B.end=j(),f.events.push(["exit",B,f]),B}function T(U,B){P(U,B.from)}function O(U,B){B.restore()}function _(U,B){return V;function V(X,Z,H){let J,oe,ye,I;return Array.isArray(X)?q(X):"tokenize"in X?q([X]):M(X);function M(ne){return Ce;function Ce(Se){const ee=Se!==null&&ne[Se],pe=Se!==null&&ne.null,Ee=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(pe)?pe:pe?[pe]:[]];return q(Ee)(Se)}}function q(ne){return J=ne,oe=0,ne.length===0?H:D(ne[oe])}function D(ne){return Ce;function Ce(Se){return I=$(),ye=ne,ne.partial||(f.currentConstruct=ne),ne.name&&f.parser.constructs.disable.null.includes(ne.name)?se():ne.tokenize.call(B?Object.assign(Object.create(f),B):f,d,G,se)(Se)}}function G(ne){return U(ye,I),Z}function se(ne){return I.restore(),++oe<J.length?D(J[oe]):H}}}function P(U,B){U.resolveAll&&!a.includes(U)&&a.push(U),U.resolve&&Ua(f.events,B,f.events.length-B,U.resolve(f.events.slice(B),f)),U.resolveTo&&(f.events=U.resolveTo(f.events,f))}function $(){const U=j(),B=f.previous,V=f.currentConstruct,X=f.events.length,Z=Array.from(u);return{from:X,restore:H};function H(){r=U,f.previous=B,f.currentConstruct=V,f.events.length=X,u=Z,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function cle(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,a)];else{if(l=e.slice(n,i),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}a>0&&l.push(e[i].slice(0,a))}return l}function ule(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
99
+ `;break}case-3:{l=`\r
100
+ `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(a)}i=a===-2,r.push(l)}return r.join("")}function dle(e){const r={constructs:vse([ole,...(e||{}).extensions||[]]),content:i(Cse),defined:[],document:i(Ose),flow:i(Goe),lazy:{},string:i(Woe),text:i(Yoe)};return r;function i(a){return l;function l(u){return lle(r,a,u)}}}function fle(e){for(;!C3(e););return e}const nP=/[\0\t\n\r]/g;function hle(){let e=1,t="",n=!0,r;return i;function i(a,l,u){const d=[];let f,p,m,g,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(nP.lastIndex=m,f=nP.exec(a),g=f&&f.index!==void 0?f.index:a.length,v=a.charCodeAt(g),!f){t=a.slice(m);break}if(v===10&&m===g&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<g&&(d.push(a.slice(m,g)),e+=g-m),v){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=g+1}return u&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const ple=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function mle(e){return e.replace(ple,gle)}function gle(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return j3(n.slice(a?2:1),a?16:10)}return Ck(n)||e}const T3={}.hasOwnProperty;function yle(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),vle(n)(fle(dle(n).document().write(hle()(e,t,!0))))}function vle(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(cn),autolinkProtocol:$,autolinkEmail:$,atxHeading:a(at),blockQuote:a(pe),characterEscape:$,characterReference:$,codeFenced:a(Ee),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Ee,l),codeText:a(Y,l),codeTextData:$,data:$,codeFlowValue:$,definition:a(He),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Pe),hardBreakEscape:a(Ve),hardBreakTrailing:a(Ve),htmlFlow:a(Ht,l),htmlFlowData:$,htmlText:a(Ht,l),htmlTextData:$,image:a(Lt),label:l,link:a(cn),listItem:a(je),listItemValue:g,listOrdered:a(en,m),listUnordered:a(en),paragraph:a(Ze),reference:D,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(at),strong:a(Rt),thematicBreak:a(et)},exit:{atxHeading:d(),atxHeadingSequence:T,autolink:d(),autolinkEmail:ee,autolinkProtocol:Se,blockQuote:d(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ne,characterReference:Ce,codeFenced:d(S),codeFencedFence:b,codeFencedFenceInfo:v,codeFencedFenceMeta:j,codeFlowValue:F,codeIndented:d(k),codeText:d(Z),codeTextData:F,data:F,definition:d(),definitionDestinationString:A,definitionLabelString:E,definitionTitleString:C,emphasis:d(),hardBreakEscape:d(B),hardBreakTrailing:d(B),htmlFlow:d(V),htmlFlowData:F,htmlText:d(X),htmlTextData:F,image:d(J),label:ye,labelText:oe,lineEnding:U,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:G,resourceDestinationString:I,resourceTitleString:M,resource:q,setextHeading:d(P),setextHeadingLineSequence:_,setextHeadingText:O,strong:d(),thematicBreak:d()}};P3(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ce){let Ne={type:"root",children:[]};const Me={stack:[Ne],tokenStack:[],config:t,enter:u,exit:f,buffer:l,resume:p,data:n},Ge=[];let pt=-1;for(;++pt<ce.length;)if(ce[pt][1].type==="listOrdered"||ce[pt][1].type==="listUnordered")if(ce[pt][0]==="enter")Ge.push(pt);else{const mn=Ge.pop();pt=i(ce,mn,pt)}for(pt=-1;++pt<ce.length;){const mn=t[ce[pt][0]];T3.call(mn,ce[pt][1].type)&&mn[ce[pt][1].type].call(Object.assign({sliceSerialize:ce[pt][2].sliceSerialize},Me),ce[pt][1])}if(Me.tokenStack.length>0){const mn=Me.tokenStack[Me.tokenStack.length-1];(mn[1]||rP).call(Me,void 0,mn[0])}for(Ne.position={start:So(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:So(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},pt=-1;++pt<t.transforms.length;)Ne=t.transforms[pt](Ne)||Ne;return Ne}function i(ce,Ne,Me){let Ge=Ne-1,pt=-1,mn=!1,On,gn,We,Kt;for(;++Ge<=Me;){const de=ce[Ge];switch(de[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{de[0]==="enter"?pt++:pt--,Kt=void 0;break}case"lineEndingBlank":{de[0]==="enter"&&(On&&!Kt&&!pt&&!We&&(We=Ge),Kt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Kt=void 0}if(!pt&&de[0]==="enter"&&de[1].type==="listItemPrefix"||pt===-1&&de[0]==="exit"&&(de[1].type==="listUnordered"||de[1].type==="listOrdered")){if(On){let ze=Ge;for(gn=void 0;ze--;){const he=ce[ze];if(he[1].type==="lineEnding"||he[1].type==="lineEndingBlank"){if(he[0]==="exit")continue;gn&&(ce[gn][1].type="lineEndingBlank",mn=!0),he[1].type="lineEnding",gn=ze}else if(!(he[1].type==="linePrefix"||he[1].type==="blockQuotePrefix"||he[1].type==="blockQuotePrefixWhitespace"||he[1].type==="blockQuoteMarker"||he[1].type==="listItemIndent"))break}We&&(!gn||We<gn)&&(On._spread=!0),On.end=Object.assign({},gn?ce[gn][1].start:de[1].end),ce.splice(gn||Ge,0,["exit",On,de[2]]),Ge++,Me++}if(de[1].type==="listItemPrefix"){const ze={type:"listItem",_spread:!1,start:Object.assign({},de[1].start),end:void 0};On=ze,ce.splice(Ge,0,["enter",ze,de[2]]),Ge++,Me++,We=void 0,Kt=!0}}}return ce[Ne][1]._spread=mn,Me}function a(ce,Ne){return Me;function Me(Ge){u.call(this,ce(Ge),Ge),Ne&&Ne.call(this,Ge)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(ce,Ne,Me){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([Ne,Me||void 0]),ce.position={start:So(Ne.start),end:void 0}}function d(ce){return Ne;function Ne(Me){ce&&ce.call(this,Me),f.call(this,Me)}}function f(ce,Ne){const Me=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==ce.type&&(Ne?Ne.call(this,ce,Ge[0]):(Ge[1]||rP).call(this,ce,Ge[0]));else throw new Error("Cannot close `"+ce.type+"` ("+oh({start:ce.start,end:ce.end})+"): it’s not open");Me.position.end=So(ce.end)}function p(){return gse(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function g(ce){if(this.data.expectingFirstListItemValue){const Ne=this.stack[this.stack.length-2];Ne.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.lang=ce}function j(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.meta=ce}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce.replace(/(\r?\n|\r)$/g,"")}function E(ce){const Ne=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ne,Me.identifier=Bu(this.sliceSerialize(ce)).toLowerCase()}function C(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=ce}function A(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=ce}function T(ce){const Ne=this.stack[this.stack.length-1];if(!Ne.depth){const Me=this.sliceSerialize(ce).length;Ne.depth=Me}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function _(ce){const Ne=this.stack[this.stack.length-1];Ne.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function $(ce){const Me=this.stack[this.stack.length-1].children;let Ge=Me[Me.length-1];(!Ge||Ge.type!=="text")&&(Ge=mt(),Ge.position={start:So(ce.start),end:void 0},Me.push(Ge)),this.stack.push(Ge)}function F(ce){const Ne=this.stack.pop();Ne.value+=this.sliceSerialize(ce),Ne.position.end=So(ce.end)}function U(ce){const Ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=Ne.children[Ne.children.length-1];Me.position.end=So(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ne.type)&&($.call(this,ce),F.call(this,ce))}function B(){this.data.atHardBreak=!0}function V(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce}function X(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce}function Z(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce}function H(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Ne,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function J(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Ne,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function oe(ce){const Ne=this.sliceSerialize(ce),Me=this.stack[this.stack.length-2];Me.label=mle(Ne),Me.identifier=Bu(Ne).toLowerCase()}function ye(){const ce=this.stack[this.stack.length-1],Ne=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const Ge=ce.children;Me.children=Ge}else Me.alt=Ne}function I(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=ce}function M(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=ce}function q(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function G(ce){const Ne=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ne,Me.identifier=Bu(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function se(ce){this.data.characterReferenceType=ce.type}function ne(ce){const Ne=this.sliceSerialize(ce),Me=this.data.characterReferenceType;let Ge;Me?(Ge=j3(Ne,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=Ck(Ne);const pt=this.stack[this.stack.length-1];pt.value+=Ge}function Ce(ce){const Ne=this.stack.pop();Ne.position.end=So(ce.end)}function Se(ce){F.call(this,ce);const Ne=this.stack[this.stack.length-1];Ne.url=this.sliceSerialize(ce)}function ee(ce){F.call(this,ce);const Ne=this.stack[this.stack.length-1];Ne.url="mailto:"+this.sliceSerialize(ce)}function pe(){return{type:"blockquote",children:[]}}function Ee(){return{type:"code",lang:null,meta:null,value:""}}function Y(){return{type:"inlineCode",value:""}}function He(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pe(){return{type:"emphasis",children:[]}}function at(){return{type:"heading",depth:0,children:[]}}function Ve(){return{type:"break"}}function Ht(){return{type:"html",value:""}}function Lt(){return{type:"image",title:null,url:"",alt:null}}function cn(){return{type:"link",title:null,url:"",children:[]}}function en(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function je(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function Ze(){return{type:"paragraph",children:[]}}function Rt(){return{type:"strong",children:[]}}function mt(){return{type:"text",value:""}}function et(){return{type:"thematicBreak"}}}function So(e){return{line:e.line,column:e.column,offset:e.offset}}function P3(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?P3(e,r):xle(e,r)}}function xle(e,t){let n;for(n in t)if(T3.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function rP(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+oh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+oh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+oh({start:t.start,end:t.end})+") is still open")}function ble(e){const t=this;t.parser=n;function n(r){return yle(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function wle(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function jle(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
101
+ `}]}function Sle(e,t){const n=t.value?t.value+`
102
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function Nle(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kle(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Cle(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=bd(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,u+=1,e.footnoteCounts.set(r,u);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function Ale(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ole(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function R3(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function Ele(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return R3(e,t);const i={src:bd(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function _le(e,t){const n={src:bd(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function zle(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Tle(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return R3(e,t);const i={href:bd(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Ple(e,t){const n={href:bd(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Rle(e,t,n){const r=e.all(t),i=n?Dle(n):D3(t),a={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const p=r[u];(i||u!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
103
+ `}),p.type==="element"&&p.tagName==="p"&&!i?l.push(...p.children):l.push(p)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
104
+ `});const f={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,f),e.applyData(t,f)}function Dle(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=D3(n[r])}return t}function D3(e){const t=e.spread;return t??e.children.length>1}function Mle(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Ile(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Lle(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function $le(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ble(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=jk(t.children[1]),d=m3(t.children[t.children.length-1]);u&&d&&(l.position={start:u,end:d}),i.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Ule(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:t.children.length;let d=-1;const f=[];for(;++d<u;){const m=t.children[d],g={},v=l?l[d]:void 0;v&&(g.align=v);let j={type:"element",tagName:a,properties:g,children:[]};m&&(j.children=e.all(m),e.patch(m,j),j=e.applyData(m,j)),f.push(j)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function qle(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const iP=9,aP=32;function Fle(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(sP(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(sP(t.slice(i),i>0,!1)),a.join("")}function sP(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===iP||a===aP;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===iP||a===aP;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Hle(e,t){const n={type:"text",value:Fle(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Kle(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Gle={blockquote:wle,break:jle,code:Sle,delete:Nle,emphasis:kle,footnoteReference:Cle,heading:Ale,html:Ole,imageReference:Ele,image:_le,inlineCode:zle,linkReference:Tle,link:Ple,listItem:Rle,list:Mle,paragraph:Ile,root:Lle,strong:$le,table:Ble,tableCell:qle,tableRow:Ule,text:Hle,thematicBreak:Kle,toml:Jm,yaml:Jm,definition:Jm,footnoteDefinition:Jm};function Jm(){}const M3=-1,Fv=0,ch=1,my=2,Ek=3,_k=4,zk=5,Tk=6,I3=7,L3=8,oP=typeof self=="object"?self:globalThis,Vle=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,l]=t[i];switch(a){case Fv:case M3:return n(l,i);case ch:{const u=n([],i);for(const d of l)u.push(r(d));return u}case my:{const u=n({},i);for(const[d,f]of l)u[r(d)]=r(f);return u}case Ek:return n(new Date(l),i);case _k:{const{source:u,flags:d}=l;return n(new RegExp(u,d),i)}case zk:{const u=n(new Map,i);for(const[d,f]of l)u.set(r(d),r(f));return u}case Tk:{const u=n(new Set,i);for(const d of l)u.add(r(d));return u}case I3:{const{name:u,message:d}=l;return n(new oP[u](d),i)}case L3:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(new oP[a](l),i)};return r},lP=e=>Vle(new Map,e)(0),hu="",{toString:Qle}={},{keys:Wle}=Object,$f=e=>{const t=typeof e;if(t!=="object"||!e)return[Fv,t];const n=Qle.call(e).slice(8,-1);switch(n){case"Array":return[ch,hu];case"Object":return[my,hu];case"Date":return[Ek,hu];case"RegExp":return[_k,hu];case"Map":return[zk,hu];case"Set":return[Tk,hu];case"DataView":return[ch,n]}return n.includes("Array")?[ch,n]:n.includes("Error")?[I3,n]:[my,n]},eg=([e,t])=>e===Fv&&(t==="function"||t==="symbol"),Yle=(e,t,n,r)=>{const i=(l,u)=>{const d=r.push(l)-1;return n.set(u,d),d},a=l=>{if(n.has(l))return n.get(l);let[u,d]=$f(l);switch(u){case Fv:{let p=l;switch(d){case"bigint":u=L3,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([M3],l)}return i([u,p],l)}case ch:{if(d){let g=l;return d==="DataView"?g=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(g=new Uint8Array(l)),i([d,[...g]],l)}const p=[],m=i([u,p],l);for(const g of l)p.push(a(g));return m}case my:{if(d)switch(d){case"BigInt":return i([d,l.toString()],l);case"Boolean":case"Number":case"String":return i([d,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const p=[],m=i([u,p],l);for(const g of Wle(l))(e||!eg($f(l[g])))&&p.push([a(g),a(l[g])]);return m}case Ek:return i([u,l.toISOString()],l);case _k:{const{source:p,flags:m}=l;return i([u,{source:p,flags:m}],l)}case zk:{const p=[],m=i([u,p],l);for(const[g,v]of l)(e||!(eg($f(g))||eg($f(v))))&&p.push([a(g),a(v)]);return m}case Tk:{const p=[],m=i([u,p],l);for(const g of l)(e||!eg($f(g)))&&p.push(a(g));return m}}const{message:f}=l;return i([u,{name:d,message:f}],l)};return a},cP=(e,{json:t,lossy:n}={})=>{const r=[];return Yle(!(t||n),!!t,new Map,r)(e),r},gy=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?lP(cP(e,t)):structuredClone(e):(e,t)=>lP(cP(e,t));function Zle(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Xle(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Jle(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Zle,r=e.options.footnoteBackLabel||Xle,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const p=e.all(f),m=String(f.identifier).toUpperCase(),g=bd(m.toLowerCase());let v=0;const j=[],b=e.footnoteCounts.get(m);for(;b!==void 0&&++v<=b;){j.length>0&&j.push({type:"text",value:" "});let E=typeof n=="string"?n:n(d,v);typeof E=="string"&&(E={type:"text",value:E}),j.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,v),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const S=p[p.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const E=S.children[S.children.length-1];E&&E.type==="text"?E.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...j)}else p.push(...j);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(p,!0)};e.patch(f,k),u.push(k)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...gy(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
105
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
106
+ `}]}}const $3=(function(e){if(e==null)return rce;if(typeof e=="function")return Hv(e);if(typeof e=="object")return Array.isArray(e)?ece(e):tce(e);if(typeof e=="string")return nce(e);throw new Error("Expected function, string, or object as test")});function ece(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=$3(e[n]);return Hv(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function tce(e){const t=e;return Hv(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function nce(e){return Hv(t);function t(n){return n&&n.type===e}}function Hv(e){return t;function t(n,r,i){return!!(ice(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function rce(){return!0}function ice(e){return e!==null&&typeof e=="object"&&"type"in e}const B3=[],ace=!0,uP=!1,sce="skip";function oce(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=$3(i),l=r?-1:1;u(e,void 0,[])();function u(d,f,p){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const v=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return g;function g(){let v=B3,j,b,S;if((!t||a(d,f,p[p.length-1]||void 0))&&(v=lce(n(d,p)),v[0]===uP))return v;if("children"in d&&d.children){const k=d;if(k.children&&v[0]!==sce)for(b=(r?k.children.length:-1)+l,S=p.concat(k);b>-1&&b<k.children.length;){const E=k.children[b];if(j=u(E,b,S)(),j[0]===uP)return j;b=typeof j[1]=="number"?j[1]:b+l}}return v}}}function lce(e){return Array.isArray(e)?e:typeof e=="number"?[ace,e]:e==null?B3:[e]}function U3(e,t,n,r){let i,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,i=n):(a=t,l=n,i=r),oce(e,a,u,i);function u(d,f){const p=f[f.length-1],m=p?p.children.indexOf(d):void 0;return l(d,m,p)}}const h1={}.hasOwnProperty,cce={};function uce(e,t){const n=t||cce,r=new Map,i=new Map,a=new Map,l={...Gle,...n.handlers},u={all:f,applyData:fce,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:dce,wrap:pce};return U3(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:i,g=String(p.identifier).toUpperCase();m.has(g)||m.set(g,p)}}),u;function d(p,m){const g=p.type,v=u.handlers[g];if(h1.call(u.handlers,g)&&v)return v(u,p,m);if(u.options.passThrough&&u.options.passThrough.includes(g)){if("children"in p){const{children:b,...S}=p,k=gy(S);return k.children=u.all(p),k}return gy(p)}return(u.options.unknownHandler||hce)(u,p,m)}function f(p){const m=[];if("children"in p){const g=p.children;let v=-1;for(;++v<g.length;){const j=u.one(g[v],p);if(j){if(v&&g[v-1].type==="break"&&(!Array.isArray(j)&&j.type==="text"&&(j.value=dP(j.value)),!Array.isArray(j)&&j.type==="element")){const b=j.children[0];b&&b.type==="text"&&(b.value=dP(b.value))}Array.isArray(j)?m.push(...j):m.push(j)}}}return m}}function dce(e,t){e.position&&(t.position=Qae(e))}function fce(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,gy(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function hce(e,t){const n=t.data||{},r="value"in t&&!(h1.call(n,"hProperties")||h1.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function pce(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
107
+ `});++r<e.length;)r&&n.push({type:"text",value:`
108
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
109
+ `}),n}function dP(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function fP(e,t){const n=uce(e,t),r=n.one(e,void 0),i=Jle(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
110
+ `},i),a}function mce(e,t){return e&&"run"in e?async function(n,r){const i=fP(n,{file:r,...t});await e.run(i,r)}:function(n,r){return fP(n,{file:r,...e||t})}}function hP(e){if(e)throw e}var Bw,pP;function gce(){if(pP)return Bw;pP=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var g;for(g in f);return typeof g>"u"||e.call(f,g)},l=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},u=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Bw=function d(){var f,p,m,g,v,j,b=arguments[0],S=1,k=arguments.length,E=!1;for(typeof b=="boolean"&&(E=b,b=arguments[1]||{},S=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});S<k;++S)if(f=arguments[S],f!=null)for(p in f)m=u(b,p),g=u(f,p),b!==g&&(E&&g&&(a(g)||(v=i(g)))?(v?(v=!1,j=m&&i(m)?m:[]):j=m&&a(m)?m:{},l(b,{name:p,newValue:d(E,j,g)})):typeof g<"u"&&l(b,{name:p,newValue:g}));return b},Bw}var yce=gce();const Uw=ma(yce);function p1(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function vce(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...i);function u(d,...f){const p=e[++a];let m=-1;if(d){l(d);return}for(;++m<i.length;)(f[m]===null||f[m]===void 0)&&(f[m]=i[m]);i=f,p?xce(p,u)(...f):l(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function xce(e,t){let n;return r;function r(...l){const u=e.length>l.length;let d;u&&l.push(i);try{d=e.apply(this,l)}catch(f){const p=f;if(u&&n)throw p;return i(p)}u||(d&&d.then&&typeof d.then=="function"?d.then(a,i):d instanceof Error?i(d):a(d))}function i(l,...u){n||(n=!0,t(l,...u))}function a(l){i(null,l)}}const Ta={basename:bce,dirname:wce,extname:jce,join:Sce,sep:"/"};function bce(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Qh(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else l<0&&(a=!0,l=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function wce(e){if(Qh(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function jce(e){Qh(e);let t=e.length,n=-1,r=0,i=-1,a=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Sce(...e){let t=-1,n;for(;++t<e.length;)Qh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Nce(n)}function Nce(e){Qh(e);const t=e.codePointAt(0)===47;let n=kce(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function kce(e,t){let n="",r=0,i=-1,a=0,l=-1,u,d;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(i===l-1||a===1))if(i!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=l,a=0;continue}}else if(n.length>0){n="",r=0,i=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,a=0}else u===46&&a>-1?a++:a=-1}return n}function Qh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Cce={cwd:Ace};function Ace(){return"/"}function m1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Oce(e){if(typeof e=="string")e=new URL(e);else if(!m1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Ece(e)}function Ece(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const qw=["history","path","basename","stem","extname","dirname"];class q3{constructor(t){let n;t?m1(t)?n={path:t}:typeof t=="string"||_ce(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Cce.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<qw.length;){const a=qw[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)qw.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ta.basename(this.path):void 0}set basename(t){Hw(t,"basename"),Fw(t,"basename"),this.path=Ta.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ta.dirname(this.path):void 0}set dirname(t){mP(this.basename,"dirname"),this.path=Ta.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ta.extname(this.path):void 0}set extname(t){if(Fw(t,"extname"),mP(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ta.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){m1(t)&&(t=Oce(t)),Hw(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ta.basename(this.path,this.extname):void 0}set stem(t){Hw(t,"stem"),Fw(t,"stem"),this.path=Ta.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Ar(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Fw(e,t){if(e&&e.includes(Ta.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ta.sep+"`")}function Hw(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function mP(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function _ce(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const zce=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),Tce={}.hasOwnProperty;class Pk extends zce{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=vce()}copy(){const t=new Pk;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Uw(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Vw("data",this.frozen),this.namespace[t]=n,this):Tce.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Vw("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=tg(t),r=this.parser||this.Parser;return Kw("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Kw("process",this.parser||this.Parser),Gw("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,l){const u=tg(t),d=r.parse(u);r.run(d,u,function(p,m,g){if(p||!m||!g)return f(p);const v=m,j=r.stringify(v,g);Dce(j)?g.value=j:g.result=j,f(p,g)});function f(p,m){p||!m?l(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),Kw("processSync",this.parser||this.Parser),Gw("processSync",this.compiler||this.Compiler),this.process(t,i),yP("processSync","process",n),r;function i(a,l){n=!0,hP(a),r=l}}run(t,n,r){gP(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,u){const d=tg(n);i.run(t,d,f);function f(p,m,g){const v=m||t;p?u(p):l?l(v):r(void 0,v,g)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),yP("runSync","run",r),i;function a(l,u){hP(l),i=u,r=!0}}stringify(t,n){this.freeze();const r=tg(n),i=this.compiler||this.Compiler;return Gw("stringify",i),gP(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Vw("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,m)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(f.plugins),f.settings&&(i.settings=Uw(!0,i.settings,f.settings))}function u(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const m=f[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let m=-1,g=-1;for(;++m<r.length;)if(r[m][0]===f){g=m;break}if(g===-1)r.push([f,...p]);else if(p.length>0){let[v,...j]=p;const b=r[g][1];p1(b)&&p1(v)&&(v=Uw(!0,b,v)),r[g]=[f,v,...j]}}}}const Pce=new Pk().freeze();function Kw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Gw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Vw(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function gP(e){if(!p1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function yP(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function tg(e){return Rce(e)?e:new q3(e)}function Rce(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Dce(e){return typeof e=="string"||Mce(e)}function Mce(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ice="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",vP=[],xP={allowDangerousHtml:!0},Lce=/^(https?|ircs?|mailto|xmpp)$/i,$ce=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Bce(e){const t=Uce(e),n=qce(e);return Fce(t.runSync(t.parse(n),n),e)}function Uce(e){const t=e.rehypePlugins||vP,n=e.remarkPlugins||vP,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...xP}:xP;return Pce().use(ble).use(n).use(mce,r).use(t)}function qce(e){const t=e.children||"",n=new q3;return typeof t=="string"&&(n.value=t),n}function Fce(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||Hce;for(const p of $ce)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Ice+p.id,void 0);return U3(e,f),Jae(e,{Fragment:s.Fragment,components:i,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function f(p,m,g){if(p.type==="raw"&&g&&typeof m=="number")return l?g.children.splice(m,1):g.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in Iw)if(Object.hasOwn(Iw,v)&&Object.hasOwn(p.properties,v)){const j=p.properties[v],b=Iw[v];(b===null||b.includes(p.tagName))&&(p.properties[v]=d(String(j||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!v&&r&&typeof m=="number"&&(v=!r(p,m,g)),v&&g&&typeof m=="number")return u&&p.children?g.children.splice(m,1,...p.children):g.children.splice(m,1),m}}}function Hce(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Lce.test(e.slice(0,t))?e:""}function Kce(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Kv=Kce();async function bP(e){const t=await fetch(`${Kv}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new ei(n?.error?.message??`transcript fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function Gce(e){const t=await fetch(`${Kv}/projects/${encodeURIComponent(e)}/agent/providers`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new ei(n?.error?.message??`providers fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function Vce(e){const t=await fetch(`${Kv}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new ei(n?.error?.message??`reset failed: ${t.status}`,t.status,n?.error?.code)}}async function Qce({project:e,prompt:t,provider:n,modelId:r,scope:i,signal:a,onEvent:l}){const u={prompt:t};n&&(u.provider=n),r&&(u.modelId=r),i&&(u.scope=i);const d=await fetch(`${Kv}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(u),signal:a});if(!d.ok||!d.body){const v=await d.json().catch(()=>({}));throw new ei(v?.error?.message??`prompt failed: ${d.status}`,d.status,v?.error?.code)}const f=d.body.getReader(),p=new TextDecoder;let m="";const g=()=>{f.cancel().catch(()=>{})};a?.addEventListener("abort",g,{once:!0});try{for(;;){const{value:v,done:j}=await f.read();if(j)break;m+=p.decode(v,{stream:!0});let b=m.indexOf(`
111
+
112
+ `);for(;b!==-1;){const S=m.slice(0,b);m=m.slice(b+2);for(const k of S.split(`
113
+ `)){if(!k.startsWith("data:"))continue;const E=k.slice(5).trim();if(E)try{l(JSON.parse(E))}catch{}}b=m.indexOf(`
114
+
115
+ `)}}}finally{a?.removeEventListener("abort",g);try{f.releaseLock()}catch{}}}function F3(e){return!e||e.role!=="assistant"?"":e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}const Wce=[{label:"Status",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{label:"Top insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{label:"Last failed run",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{label:"Schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"}],Yce=[{command:"/status",label:"Status",hint:"Latest runs, health, anything unusual",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{command:"/insights",label:"Top insights",hint:"Walk through the most severe active insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{command:"/last-run",label:"Last run",hint:"Summarize the latest sweep",prompt:"Summarize the latest run for this project — provider mix, visibility changes, and anything that moved."},{command:"/last-failed",label:"Last failed run",hint:"Diagnose the most recent failure",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{command:"/run-sweep",label:"Run sweep now",hint:"Trigger a new visibility sweep",prompt:"Run a new answer-visibility sweep for this project now and tell me when it lands."},{command:"/schedule",label:"Schedule",hint:"Review the sweep schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"},{command:"/queries",label:"Queries",hint:"List tracked queries",prompt:"List the tracked queries for this project and flag any that are obvious duplicates or underperformers."},{command:"/competitors",label:"Competitors",hint:"List tracked competitors",prompt:"List this project's tracked competitors and call out which ones are showing up in answer citations."},{command:"/clear",label:"Clear conversation",hint:"Wipe transcript and start fresh",action:"clear"}],ng=e=>`canonry:aero:provider:${e}`,wP=e=>`canonry:aero:scope:${e}`;function Zce({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(!1),[a,l]=x.useState([]),[u,d]=x.useState(""),[f,p]=x.useState(!1),[m,g]=x.useState([]),[v,j]=x.useState(""),[b,S]=x.useState(null),[k,E]=x.useState(()=>typeof window>"u"?null:window.localStorage.getItem(ng(e))??null),[C,A]=x.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(wP(e))==="all"?"all":"read-only"),T=x.useRef(null),O=x.useRef(null),_=x.useRef(null),[P,$]=x.useState(0),F=x.useMemo(()=>{const q=u.trimStart();if(!q.startsWith("/"))return[];if(/\s/.test(q))return[];const D=q.toLowerCase();return Yce.filter(G=>G.command.startsWith(D)||G.label.toLowerCase().includes(D.slice(1)))},[u]);x.useEffect(()=>{$(q=>F.length===0?0:Math.min(q,F.length-1))},[F.length]);const U=ua({queryKey:qe.agent.providers(e),queryFn:()=>Gce(e),enabled:t,staleTime:6e4}),B=x.useMemo(()=>{const q=U.data?.providers??[];if(k){const G=q.find(se=>se.id===k&&se.configured);if(G)return G}const D=U.data?.defaultProvider;return D?q.find(G=>G.id===D)??null:null},[k,U.data]);x.useEffect(()=>{if(!U.data||!k)return;U.data.providers.find(D=>D.id===k&&D.configured)||(E(null),window.localStorage.removeItem(ng(e)))},[U.data,k,e]);const V=x.useCallback(q=>{E(q),!(typeof window>"u")&&(q?window.localStorage.setItem(ng(e),q):window.localStorage.removeItem(ng(e)))},[e]),X=x.useCallback(()=>{A(q=>{const D=q==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(wP(e),D),D})},[e]);x.useEffect(()=>{if(!t)return;const q=D=>{D.key==="Escape"&&(r?i(!1):n(!1))};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[t,r]),x.useEffect(()=>{if(!t)return;let q=!1;S(null);const D=()=>{q||f||bP(e).then(ne=>{q||l(ne.messages)}).catch(ne=>{q||S(ne instanceof Error?ne.message:"Failed to load transcript")})};D();const se=window.setInterval(D,15e3);return()=>{q=!0,window.clearInterval(se)}},[t,e,f]),x.useEffect(()=>()=>{T.current?.abort()},[e]),x.useEffect(()=>{const q=O.current;q&&(q.scrollTop=q.scrollHeight)},[a,v,m]);async function Z(q){const D=q.trim();if(!D||f)return;S(null),d(""),p(!0),j(""),g([]);const G={role:"user",content:D,timestamp:Date.now()};l(ne=>[...ne,G]);const se=new AbortController;T.current=se;try{await Qce({project:e,prompt:D,provider:k??void 0,scope:C,signal:se.signal,onEvent:H});const ne=await bP(e);l(ne.messages)}catch(ne){ne.name!=="AbortError"&&S(ne instanceof Error?ne.message:"Prompt failed")}finally{p(!1),j(""),T.current=null}}function H(q){switch(q.type){case"message_update":j(F3(q.message));break;case"message_end":q.message.role==="assistant"&&j("");break;case"tool_execution_start":g(D=>[...D,{id:q.toolCallId,name:q.toolName,args:q.args,startedAt:Date.now()}]);break;case"tool_execution_end":g(D=>D.map(G=>G.id===q.toolCallId?{...G,endedAt:Date.now(),isError:q.isError,result:q.result}:G));break;case"error":S(q.message);break}}async function J(){T.current?.abort();try{await Vce(e),l([]),S(null)}catch(q){S(q instanceof Error?q.message:"Reset failed")}}const oe=a.length===0,ye=t&&r?"pointer-events-auto fixed inset-0 z-40 flex items-stretch justify-center bg-zinc-950/70 p-4 sm:p-8 backdrop-blur-sm":"pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center p-3",I=r?"pointer-events-auto flex h-full w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-2xl":"pointer-events-auto w-full max-w-3xl",M=r?"flex-1 overflow-y-auto px-6 py-5 text-sm text-zinc-200":"max-h-[40vh] min-h-[120px] overflow-y-auto px-4 py-3 text-sm text-zinc-200";return s.jsx("div",{className:ye,onClick:q=>{r&&q.target===q.currentTarget&&i(!1)},children:s.jsx("div",{className:I,children:t?s.jsxs("div",{className:r?"flex h-full flex-col":"flex flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-xl backdrop-blur",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(T2,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),s.jsx("span",{className:"text-sm font-medium text-zinc-100",children:"Aero"}),s.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:f?"working…":e})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Xce,{providers:U.data?.providers??[],active:B,override:k,onPick:V,disabled:f}),s.jsx("button",{type:"button",onClick:J,className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Reset conversation",title:"Reset conversation",children:s.jsx(G5,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),s.jsx("button",{type:"button",onClick:()=>i(q=>!q),className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":r?"Collapse":"Expand",title:r?"Collapse":"Expand",children:r?s.jsx(hW,{className:"h-3.5 w-3.5","aria-hidden":"true"}):s.jsx(cW,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),s.jsx("button",{type:"button",onClick:()=>{i(!1),n(!1)},className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Close Aero",children:s.jsx(Kh,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),s.jsxs("div",{ref:O,className:M,children:[b&&s.jsx("div",{className:"mb-2 rounded-md border border-rose-700/40 bg-rose-950/40 px-3 py-2 text-xs text-rose-200",children:b}),oe&&!f&&s.jsxs("div",{className:"flex flex-col gap-3 py-2",children:[s.jsxs("p",{className:"text-xs text-zinc-500",children:["Ask anything about ",s.jsx("span",{className:"text-zinc-300",children:e}),", or start with:"]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:Wce.map(q=>s.jsx("button",{type:"button",onClick:()=>Z(q.prompt),className:"rounded-full border border-zinc-800 bg-zinc-900/70 px-3 py-1 text-xs text-zinc-300 transition hover:border-zinc-700 hover:bg-zinc-800/70 hover:text-zinc-100",children:q.label},q.label))})]}),rue(a,e,k,C),m.length>0&&s.jsx("div",{className:"mt-3 space-y-1.5",children:m.map(q=>s.jsx(H3,{trail:q},q.id))}),f&&v&&s.jsxs("div",{className:"mt-3",children:[s.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),s.jsx(K3,{content:v})]}),f&&!v&&m.every(q=>q.endedAt!==void 0)&&s.jsx(oue,{})]}),s.jsx(Jce,{projectName:e,activeProvider:B,scope:C,onToggleScope:X,disabled:f}),s.jsxs("div",{className:"relative",children:[F.length>0&&s.jsx(eue,{matches:F,selectedIndex:P,onHover:$,onPick:q=>{d(""),_.current?.focus(),q.action==="clear"?J():Z(q.prompt)}}),s.jsxs("form",{className:"flex items-end gap-2 border-t border-zinc-800/70 bg-zinc-950/80 px-3 py-2.5",onSubmit:q=>{if(q.preventDefault(),F.length>0){const D=F[P];d(""),D.action==="clear"?J():Z(D.prompt);return}Z(u)},children:[s.jsx("textarea",{ref:_,value:u,onChange:q=>d(q.target.value),onKeyDown:q=>{if(F.length>0){if(q.key==="ArrowDown"){q.preventDefault(),$(D=>(D+1)%F.length);return}if(q.key==="ArrowUp"){q.preventDefault(),$(D=>(D-1+F.length)%F.length);return}if(q.key==="Tab"){q.preventDefault();const D=F[P];d(`${D.command} `);return}if(q.key==="Escape"){q.preventDefault(),d("");return}}if(q.key==="Enter"&&!q.shiftKey)if(q.preventDefault(),F.length>0){const D=F[P];d(""),D.action==="clear"?J():Z(D.prompt)}else Z(u)},placeholder:"Ask Aero, or / for commands…",disabled:f,rows:r?3:1,className:"flex-1 resize-none bg-transparent text-sm text-zinc-100 placeholder:text-zinc-600 focus:outline-none disabled:opacity-60"}),s.jsx("button",{type:"submit",disabled:f||!u.trim(),className:"inline-flex h-7 w-7 items-center justify-center rounded-md bg-emerald-500 text-zinc-950 transition hover:bg-emerald-400 disabled:opacity-40","aria-label":"Send",children:s.jsx(MQ,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}):s.jsxs("button",{type:"button",onClick:()=>n(!0),className:"flex w-full items-center justify-between rounded-full border border-zinc-800/80 bg-zinc-950/95 px-4 py-2 text-left text-sm text-zinc-400 shadow-lg backdrop-blur transition hover:border-zinc-700 hover:bg-zinc-900/90 hover:text-zinc-200",children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(T2,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Ask Aero about ",e,"…"]}),s.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-600",children:"Enter"})]})})})}function Xce({providers:e,active:t,override:n,onPick:r,disabled:i}){const[a,l]=x.useState(!1),u=x.useRef(null);if(x.useEffect(()=>{if(!a)return;const p=g=>{u.current?.contains(g.target)||l(!1)},m=g=>{g.key==="Escape"&&l(!1)};return window.addEventListener("mousedown",p),window.addEventListener("keydown",m),()=>{window.removeEventListener("mousedown",p),window.removeEventListener("keydown",m)}},[a]),e.length===0)return null;const d=t?.label.replace(/\s+\(.+\)$/,"")??"No provider",f=t?.defaultModel;return s.jsxs("div",{ref:u,className:"relative",children:[s.jsxs("button",{type:"button",onClick:()=>l(p=>!p),disabled:i,className:"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-zinc-400 transition hover:bg-zinc-800/60 hover:text-zinc-200 disabled:opacity-50","aria-label":"Switch agent model","aria-haspopup":"listbox","aria-expanded":a,title:t?`${t.label} · ${t.defaultModel}`:"Pick a provider",children:[s.jsx("span",{className:"font-medium text-zinc-200",children:d}),f&&s.jsx("span",{className:"hidden font-mono text-[10px] text-zinc-500 sm:inline",children:f}),s.jsx(UQ,{className:"h-3 w-3","aria-hidden":"true"})]}),a&&s.jsxs("div",{role:"listbox",className:"absolute right-0 top-full z-50 mt-1 w-64 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950 shadow-xl",children:[s.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-2 text-[10px] uppercase tracking-wider text-zinc-500",children:"Aero provider"}),s.jsx("ul",{className:"max-h-72 overflow-y-auto py-1",children:e.map(p=>{const m=t?.id===p.id,g=n===p.id;return s.jsx("li",{children:s.jsxs("button",{type:"button",role:"option","aria-selected":m,disabled:!p.configured,onClick:()=>{p.configured&&(r(g?null:p.id),l(!1))},className:"flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition enabled:hover:bg-zinc-900 disabled:cursor-not-allowed disabled:opacity-50",children:[s.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:m?s.jsx(U5,{className:"h-3 w-3 text-emerald-400","aria-hidden":"true"}):null}),s.jsxs("span",{className:"flex-1",children:[s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"font-medium text-zinc-100",children:p.label}),g&&s.jsx("span",{className:"rounded-full border border-emerald-800/60 bg-emerald-950/60 px-1.5 text-[9px] uppercase tracking-wider text-emerald-300",children:"Pinned"}),!p.configured&&s.jsx("span",{className:"rounded-full border border-zinc-800 px-1.5 text-[9px] uppercase tracking-wider text-zinc-500",children:"Key missing"})]}),s.jsx("span",{className:"mt-0.5 block font-mono text-[10px] text-zinc-500",children:p.defaultModel}),p.keySource==="env"&&s.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!p.configured&&s.jsxs("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:["Add key in config.yaml or export"," ",s.jsx("code",{className:"font-mono text-zinc-400",children:tue(p.id)})]})]})]})},p.id)})}),n&&s.jsx("button",{type:"button",onClick:()=>{r(null),l(!1)},className:"w-full border-t border-zinc-800/60 px-3 py-2 text-left text-[11px] text-zinc-400 transition hover:bg-zinc-900 hover:text-zinc-100",children:"Reset to auto-detected default"})]})]})}function Jce({projectName:e,activeProvider:t,scope:n,onToggleScope:r,disabled:i}){const a=t?.label.replace(/\s+\(.+\)$/,"")??null,l=n==="all";return s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-t border-zinc-800/70 bg-zinc-950/80 px-3 pt-2",children:[s.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[s.jsx("span",{className:"text-zinc-600",children:"project"}),s.jsx("span",{className:"font-medium text-zinc-200",children:e})]}),a&&s.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[s.jsx("span",{className:"text-zinc-600",children:"model"}),s.jsx("span",{className:"font-medium text-zinc-200",children:a})]}),s.jsxs("button",{type:"button",onClick:r,disabled:i,className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] transition disabled:opacity-50 ${l?"border-amber-800/60 bg-amber-950/40 text-amber-300 hover:border-amber-700 hover:text-amber-200":"border-zinc-800 bg-zinc-900/70 text-zinc-400 hover:border-zinc-700 hover:text-zinc-200"}`,title:l?"Aero can invoke write tools (run sweep, dismiss insight, etc). Click to restrict.":"Aero is restricted to read-only tools. Click to allow writes.",children:[s.jsx("span",{className:l?"text-amber-500":"text-zinc-600",children:"scope"}),s.jsx("span",{className:"font-medium",children:l?"all tools":"read-only"})]})]})}function eue({matches:e,selectedIndex:t,onHover:n,onPick:r}){return s.jsxs("div",{className:"absolute inset-x-3 bottom-full mb-2 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950/98 shadow-2xl",children:[s.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500",children:"Commands"}),s.jsx("ul",{role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:e.map((i,a)=>{const l=a===t;return s.jsx("li",{children:s.jsxs("button",{type:"button",role:"option","aria-selected":l,onMouseEnter:()=>n(a),onClick:()=>r(i),className:`flex w-full items-center gap-3 px-3 py-1.5 text-left text-xs transition ${l?"bg-zinc-900 text-zinc-100":"text-zinc-300 hover:bg-zinc-900/60"}`,children:[s.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:i.command}),s.jsx("span",{className:"font-medium",children:i.label}),s.jsx("span",{className:"ml-auto text-[10px] text-zinc-500",children:i.hint})]})},i.command)})}),s.jsxs("div",{className:"border-t border-zinc-800/60 px-3 py-1.5 text-[10px] text-zinc-600",children:[s.jsx("span",{className:"mr-3",children:"↑↓ to select"}),s.jsx("span",{className:"mr-3",children:"Enter to run"}),s.jsx("span",{children:"Tab to autocomplete"})]})]})}function tue(e){switch(e){case"claude":return"ANTHROPIC_API_KEY";case"openai":return"OPENAI_API_KEY";case"gemini":return"GOOGLE_API_KEY";case"zai":return"ZAI_API_KEY"}}function nue(e,t){const n=e.timestamp??0;return`${e.role}:${n}:${t}`}function rue(e,t,n,r){const i=[];for(let a=0;a<e.length;a++){const l=e[a],u=nue(l,a);if(l.role==="user"){const d=typeof l.content=="string"?l.content:JSON.stringify(l.content);if(d.startsWith("[system]"))continue;i.push(s.jsx(iue,{text:d,projectName:t,providerOverride:n,scope:r},u));continue}if(l.role==="assistant"){const d=new Map;let f=a+1;for(;f<e.length&&e[f].role==="toolResult";){const g=e[f];d.set(g.toolCallId,g),f++}const p=sue(l,d,l.timestamp??0),m=F3(l);i.push(s.jsxs(x.Fragment,{children:[p.length>0&&s.jsx("div",{className:"mt-3 space-y-1.5",children:p.map(g=>s.jsx(H3,{trail:g},g.id))}),m.trim()&&s.jsxs("div",{className:"mt-3",children:[s.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),s.jsx(K3,{content:m})]})]},u)),a=f-1;continue}}return i}function iue({text:e,projectName:t,providerOverride:n,scope:r}){const[i,a]=x.useState(!1),l=x.useMemo(()=>aue(t,e,n,r),[t,e,n,r]);async function u(){try{await navigator.clipboard.writeText(l),a(!0),window.setTimeout(()=>a(!1),1500)}catch{}}return s.jsxs("div",{className:"group relative mt-3 rounded-md bg-zinc-900/60 px-3 py-2 text-zinc-200",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("div",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"You"}),s.jsx("button",{type:"button",onClick:u,className:"inline-flex items-center gap-1 rounded border border-zinc-800/70 bg-zinc-950/60 px-1.5 py-0.5 text-[10px] text-zinc-400 opacity-0 transition hover:border-zinc-700 hover:text-zinc-100 group-hover:opacity-100 focus:opacity-100","aria-label":"Copy as CLI command",title:l,children:i?s.jsxs(s.Fragment,{children:[s.jsx(U5,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):s.jsxs(s.Fragment,{children:[s.jsx(QQ,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),s.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function aue(e,t,n,r){const i=["canonry","agent","ask",jP(e),jP(t)];return n&&i.push("--provider",n),r==="read-only"&&i.push("--scope","read-only"),i.join(" ")}function jP(e){return`'${e.replace(/'/g,"'\\''")}'`}function sue(e,t,n){const r=[];for(const i of e.content){if(i.type!=="toolCall")continue;const a=i,l=t.get(a.id);r.push({id:a.id,name:a.name,args:a.arguments,startedAt:n,endedAt:l?.timestamp,isError:l?.isError,result:l?.content})}return r}function H3({trail:e}){const[t,n]=x.useState(!1),r=e.endedAt===void 0,i=!r&&e.isError===!0,a=e.endedAt!=null?e.endedAt-e.startedAt:null,l=a==null||a<0?null:a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`,u=i?"border-rose-800/50":r?"border-emerald-800/50":"border-zinc-800/70",d=i?"bg-rose-950/20":r?"bg-emerald-950/20":"bg-zinc-900/40";return s.jsxs("div",{className:`rounded-md border ${u} ${d} font-mono`,children:[s.jsxs("button",{type:"button",onClick:()=>n(f=>!f),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left","aria-expanded":t,children:[s.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:r?s.jsx(K5,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):i?s.jsx(iy,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):s.jsx(TW,{className:"h-3 w-3 text-zinc-500","aria-hidden":"true"})}),s.jsx("span",{className:"text-[11px] font-semibold text-zinc-100",children:e.name}),s.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px] text-zinc-500",children:[r?s.jsx("span",{className:"text-emerald-400",children:"running…"}):s.jsxs(s.Fragment,{children:[s.jsx("span",{children:i?"failed":"ok"}),l&&s.jsx("span",{children:l})]}),s.jsx(Hh,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`,"aria-hidden":"true"})]})]}),t&&s.jsxs("div",{className:"border-t border-zinc-800/60 px-2.5 py-2 text-[11px] text-zinc-400",children:[s.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:"Args"}),s.jsx("pre",{className:"mb-2 overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:SP(e.args)}),!r&&e.result!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:i?"Error":"Result"}),s.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:SP(e.result)})]})]})]})}function SP(e){try{const t=typeof e=="string"?e:JSON.stringify(e,null,2);return t.length>2e3?`${t.slice(0,2e3)}
116
+ … (${t.length-2e3} more chars)`:t}catch{return String(e)}}function K3({content:e}){return s.jsx("div",{className:"aero-markdown text-zinc-100",children:s.jsx(Bce,{components:{h1:t=>s.jsx("h1",{...t,className:"mt-3 mb-2 text-base font-semibold text-zinc-50"}),h2:t=>s.jsx("h2",{...t,className:"mt-3 mb-2 text-sm font-semibold text-zinc-50"}),h3:t=>s.jsx("h3",{...t,className:"mt-3 mb-1.5 text-sm font-semibold text-zinc-100"}),h4:t=>s.jsx("h4",{...t,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-300"}),p:t=>s.jsx("p",{...t,className:"mb-2 leading-relaxed"}),ul:t=>s.jsx("ul",{...t,className:"mb-2 ml-4 list-disc space-y-1"}),ol:t=>s.jsx("ol",{...t,className:"mb-2 ml-4 list-decimal space-y-1"}),li:t=>s.jsx("li",{...t,className:"marker:text-zinc-600"}),strong:t=>s.jsx("strong",{...t,className:"font-semibold text-zinc-50"}),em:t=>s.jsx("em",{...t,className:"text-zinc-200"}),code:({children:t,...n})=>s.jsx("code",{...n,className:"rounded bg-zinc-800/70 px-1 py-0.5 font-mono text-[12px] text-emerald-200",children:t}),pre:t=>s.jsx("pre",{...t,className:"mb-2 overflow-x-auto rounded-md border border-zinc-800 bg-zinc-900/70 p-3 font-mono text-xs text-zinc-200"}),a:t=>s.jsx("a",{...t,className:"text-emerald-400 underline decoration-emerald-700 hover:decoration-emerald-400",target:"_blank",rel:"noopener noreferrer"}),table:t=>s.jsx("div",{className:"mb-2 overflow-x-auto",children:s.jsx("table",{...t,className:"w-full border-collapse text-xs"})}),thead:t=>s.jsx("thead",{...t,className:"border-b border-zinc-800"}),th:t=>s.jsx("th",{...t,className:"px-2 py-1 text-left font-semibold text-zinc-300"}),tr:t=>s.jsx("tr",{...t,className:"border-b border-zinc-900"}),td:t=>s.jsx("td",{...t,className:"px-2 py-1 text-zinc-200"}),blockquote:t=>s.jsx("blockquote",{...t,className:"mb-2 border-l-2 border-zinc-700 pl-3 italic text-zinc-400"}),hr:()=>s.jsx("hr",{className:"my-3 border-zinc-800"})},children:e})})}function oue(){return s.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[s.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),s.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[s.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-emerald-400/80"}),s.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-emerald-400/60"}),s.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-emerald-400/40"})]})]})}function lue(){const e=N5(),t=/^\/projects\/([^/]+)/.exec(e.pathname),n=t?decodeURIComponent(t[1]):null,r=ua({queryKey:qe.projects.all,queryFn:GN,enabled:n!==null,staleTime:6e4});if(!n)return null;const i=r.data??[],a=i.find(l=>l.id===n)??i.find(l=>l.name===n);return a?s.jsx(Zce,{projectName:a.name},a.name):null}function Gv(e,t,n){switch(e.invalidateQueries({queryKey:qe.runs.all}),e.invalidateQueries({queryKey:qe.projects.all}),t){case Tt["answer-visibility"]:case Tt["site-audit"]:case Tt["backlink-extract"]:return;case Tt["gsc-sync"]:case Tt["inspect-sitemap"]:e.invalidateQueries({queryKey:qe.gsc.project(n)});return;case Tt["ga-sync"]:e.invalidateQueries({queryKey:qe.traffic.project(n)});return;case Tt["bing-inspect"]:case Tt["bing-inspect-sitemap"]:e.invalidateQueries({queryKey:qe.bing.project(n)});return;default:return t}}const NP=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:tW},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:LQ},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:JQ}],kP=e=>({label:e,state:"checking",detail:"Checking service health"}),cue={apiStatus:kP("API"),workerStatus:kP("Worker")};function uue(e){switch(e){case Tt["answer-visibility"]:return"Visibility sweep";case Tt["gsc-sync"]:return"GSC sync";case Tt["inspect-sitemap"]:return"Sitemap inspection";case Tt["ga-sync"]:return"GA sync";case Tt["bing-inspect"]:return"Bing URL inspection";case Tt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Tt["site-audit"]:return"Site audit";case Tt["backlink-extract"]:return"Backlink extract"}}function due(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function fue(e){const t=uue(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function hue(e,t){return e.error?`${t}: ${ak(e.error)}`:e.location?`${t} · ${e.location}`:t}function pue(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function mue(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 gue(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function yue(){const e=xi(),t=x.useSyncExternalStore(Xte,nc,nc),n=Object.keys(t.runs).length>0||Object.keys(t.batches).length>0,r=ua({queryKey:qe.runs.all,queryFn:A5,enabled:n,staleTime:YS,refetchInterval:3e3}),i=ua({queryKey:qe.projects.all,queryFn:GN,enabled:n}),a=x.useRef({}),l=x.useCallback(()=>{r.refetch()},[r.refetch]);return x.useEffect(()=>{n&&l()},[n,l]),x.useEffect(()=>{if(!n||typeof window>"u")return;const u=()=>{document.visibilityState==="visible"&&l()};return window.addEventListener("focus",l),document.addEventListener("visibilitychange",u),()=>{window.removeEventListener("focus",l),document.removeEventListener("visibilitychange",u)}},[n,l]),x.useEffect(()=>{const u=r.data??[],d=i.data??[],f=Object.fromEntries(u.map(m=>[m.id,m])),p=Object.fromEntries(u.map(m=>[m.id,m.status]));for(const m of Object.values(t.runs)){const g=f[m.runId];if(!g||!ck(g.status)||(a.current[g.id]??m.lastAnnouncedStatus)===g.status)continue;const j=d.find(S=>S.id===g.projectId);if(j&&Gv(e,g.kind,j.name),m.sourceAction==="run-all"){lT(g.id);continue}const b=pue(g.projectId,m.projectLabel,d);vt({title:fue(g),detail:hue(g,b),tone:due(g.status),dedupeKey:`run:${g.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:g.id}}),lT(g.id)}for(const m of Object.values(t.batches)){const g=tne(m.runIds,f);g.finished&&(vt({title:"Run-all batch finished",detail:mue(g,m.skippedCount),tone:gue(g),dedupeKey:`batch:${m.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),ene(m.batchId))}a.current=p},[i.data,r.data,t,e]),null}function vue(){const e=Gh(),{dashboard:t,isLoading:n,refetch:r}=wc(),l=Uv(!e,e?.health).data??e?.health??cue,u=N5(),{runId:d,evidenceId:f,closeDrawer:p}=vd(),[m,g]=x.useState(!1),v=wae(d),j=v.data??null,b=v.isLoading;x.useEffect(()=>{j&&j.status!=="running"&&j.status!=="queued"&&r()},[j?.status,r]),x.useEffect(()=>{g(!1)},[u.pathname]),x.useEffect(()=>{if(typeof window>"u"||!d&&!f)return;const A=T=>{T.key==="Escape"&&p()};return window.addEventListener("keydown",A),()=>{window.removeEventListener("keydown",A)}},[d,f,p]);const S=t??e?.dashboard??null,k=d&&S?Zie(S,d):void 0,E=f&&S?Xie(S,f):void 0,C=(()=>{const A=u.pathname;if(A==="/")return"Portfolio";if(A==="/projects")return"Projects";if(A==="/runs")return"Runs";if(A==="/settings")return"Settings";if(A==="/setup")return"Setup";if(A==="/backlinks")return"Backlinks";if(A.startsWith("/projects/")){const O=A.split("/").filter(Boolean)[1];if(O&&S){const _=S.projects.find(P=>P.project.id===O);if(_)return _.project.name}return"Project"}return"Not found"})();return s.jsxs("div",{className:"app-shell",children:[s.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),s.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[s.jsx("div",{className:"sidebar-brand",children:s.jsx(vT,{version:l.apiStatus.version})}),s.jsxs("nav",{className:"sidebar-nav",children:[s.jsxs(Yt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(aW,{className:"sidebar-icon"}),s.jsx("span",{children:"Overview"})]}),s.jsxs(Yt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[s.jsx(rW,{className:"sidebar-icon"}),s.jsx("span",{children:"Projects"})]}),s.jsxs(Yt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(ry,{className:"sidebar-icon"}),s.jsx("span",{children:"Runs"})]}),s.jsxs(Yt,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(H5,{className:"sidebar-icon"}),s.jsx("span",{children:"Backlinks"})]}),s.jsxs(Yt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(SW,{className:"sidebar-icon"}),s.jsx("span",{children:"Settings"})]}),n?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(A=>s.jsxs("div",{className:"sidebar-skeleton-item",children:[s.jsx("span",{className:"skeleton-circle size-2"}),s.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+A*15}%`}})]},A))]}):S&&S.projects.length>0?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"sidebar-section-title",children:"Projects"}),S.projects.map(A=>{const T=A.visibilitySummary.tone;return s.jsxs(Yt,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[s.jsx("span",{className:`sidebar-dot sidebar-dot-${T}`}),s.jsx("span",{children:A.project.name})]},A.project.id)})]}):n?null:s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"sidebar-section-title",children:"Resources"}),s.jsxs(Yt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(bW,{className:"sidebar-icon"}),s.jsx("span",{children:"Setup"})]})]})]}),s.jsx("div",{className:"sidebar-footer",children:NP.map(({label:A,href:T,Icon:O})=>s.jsx("a",{className:"sidebar-footer-icon",href:T,target:"_blank",rel:"noopener noreferrer",title:A,"aria-label":A,children:s.jsx(O,{className:"size-4"})},T))})]}),s.jsxs("div",{className:"main-area",children:[s.jsxs("header",{className:"topbar",children:[s.jsxs("div",{className:"topbar-left",children:[s.jsx("div",{className:"topbar-brand-mobile",children:s.jsx(vT,{compact:!0})}),s.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[s.jsx(Yt,{to:"/",children:"Home"}),s.jsx(Hh,{className:"breadcrumb-sep size-3"}),s.jsx("span",{className:"breadcrumb-current",children:C})]})]}),s.jsxs("div",{className:"topbar-actions",children:[s.jsxs("div",{className:"health-pill-row",children:[s.jsxs("span",{className:`health-pill health-pill-${l.apiStatus.state}`,title:Ko(l.apiStatus),children:["API ",l.apiStatus.state==="ok"?"ok":l.apiStatus.state]}),s.jsxs("span",{className:`health-pill health-pill-${l.workerStatus.state}`,title:Ko(l.workerStatus),children:["Worker ",l.workerStatus.state==="ok"?"ok":l.workerStatus.state]})]}),s.jsxs(be,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":m,"aria-controls":"mobile-nav",onClick:()=>g(A=>!A),children:[s.jsx(dW,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),s.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${m?"mobile-nav-open":""}`,children:[s.jsxs(be,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>g(!1),children:[s.jsx(Kh,{className:"size-5"}),s.jsx("span",{className:"sr-only",children:"Close navigation"})]}),s.jsx(Yt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),s.jsx(Yt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),s.jsx(Yt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),s.jsx(Yt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),S&&S.projects.length>0?s.jsxs("div",{className:"mobile-nav-section",children:[s.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),S.projects.map(A=>s.jsx(Yt,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"mobile-nav-link",children:A.project.name},A.project.id))]}):null]}),s.jsx("main",{id:"content",className:"page-shell",children:n&&!e?s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-40"}),s.jsx("div",{className:"skeleton-text-sm w-72"})]}),s.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(A=>s.jsxs("div",{className:"page-skeleton-card",children:[s.jsx("div",{className:"skeleton-text w-24"}),s.jsx("div",{className:"skeleton-text w-full"}),s.jsx("div",{className:"skeleton-text-sm w-3/4"})]},A))}),s.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(A=>s.jsxs("div",{className:"page-skeleton-card",children:[s.jsx("div",{className:"skeleton-text w-20"}),s.jsx("div",{className:"space-y-2",children:[1,2,3].map(T=>s.jsx("div",{className:"skeleton-text-sm w-full"},T))})]},A))})]}):s.jsx(KN,{})}),s.jsxs("footer",{className:"footer",children:[s.jsxs("span",{className:"footer-brand",children:[s.jsx("span",{children:"Canonry"}),l.apiStatus.version&&l.apiStatus.version!=="unknown"?s.jsxs("span",{className:"footer-version",children:["v",l.apiStatus.version]}):null]}),s.jsx("div",{className:"footer-links",children:NP.map(({label:A,href:T,Icon:O})=>s.jsx("a",{href:T,target:"_blank",rel:"noopener noreferrer",title:A,"aria-label":A,className:"footer-icon",children:s.jsx(O,{className:"size-3.5"})},T))})]})]}),k?s.jsxs(Bie,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:p,children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[s.jsx(Mv,{status:k.status}),s.jsx("span",{className:"text-zinc-400",children:k.startedAt}),s.jsx("span",{className:"text-zinc-500",children:k.duration}),s.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&s.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.statusDetail}),s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),b?s.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):j&&j.snapshots.length>0?s.jsxs("div",{className:"space-y-2",children:[j.snapshots.map(A=>s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[s.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:A.query??"Unknown query"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(rc,{provider:A.provider}),s.jsx(v$,{variant:A.citationState===Ju.cited?"success":"neutral",children:A.citationState})]})]}),A.model&&s.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:A.model}),A.citedDomains.length>0&&s.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[s.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",A.citedDomains.join(", ")]}),A.competitorOverlap.length>0&&s.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",A.competitorOverlap.join(", ")]}),A.groundingSources&&A.groundingSources.length>0&&s.jsxs("details",{className:"mt-2",children:[s.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[A.groundingSources.length," grounding source",A.groundingSources.length!==1?"s":""]}),s.jsx("ul",{className:"mt-1 space-y-0.5",children:A.groundingSources.map((T,O)=>s.jsx("li",{className:"text-xs text-zinc-500 truncate",children:s.jsx("a",{href:T.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:T.title||T.uri})},O))})]}),A.answerText&&s.jsxs("details",{className:"mt-1",children:[s.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),s.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:A.answerText})]})]},A.id)),j.status==="running"&&s.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Running remaining queries..."]})]}):j&&j.status==="running"?s.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first query result..."]}):j&&j.status==="queued"?s.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):j&&j.error?s.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[s.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),s.jsx("pre",{className:"text-xs text-rose-300/80 whitespace-pre-wrap break-words max-h-48 overflow-y-auto font-mono leading-5",children:$te(j.error)})]}):s.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?s.jsx(Hie,{evidence:E.evidence,project:E.project,onClose:p}):null,s.jsx(yue,{}),s.jsx(Nae,{}),s.jsx(lue,{})]})}class xue extends x.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("[ErrorBoundary]",t,n.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?s.jsx("div",{className:"page-container",children:s.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[s.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:s.jsx(iy,{className:"size-6 text-rose-400"})}),s.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),s.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),s.jsxs("div",{className:"flex gap-3 mt-2",children:[s.jsxs(be,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[s.jsx(G5,{className:"size-3.5 mr-1.5"}),"Try again"]}),s.jsx(be,{variant:"secondary",size:"sm",onClick:()=>{const t=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=t||"/"},children:"Go home"})]})]})}):this.props.children}}const $e=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Yi("rounded-xl border border-zinc-800 bg-zinc-950/75 shadow-[0_0_0_1px_rgba(255,255,255,0.01)] backdrop-blur",e),...t}));$e.displayName="Card";const g1=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Yi("flex flex-col gap-1.5 p-5",e),...t}));g1.displayName="CardHeader";const y1=x.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:Yi("font-medium tracking-tight text-zinc-50",e),...t}));y1.displayName="CardTitle";const v1=x.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:Yi("text-sm text-zinc-500",e),...t}));v1.displayName="CardDescription";const Lg=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Yi("p-5 pt-0",e),...t}));Lg.displayName="CardContent";function bue({points:e,tone:t}){const n=x.useId();if(e.length===0)return null;const r=42,i=132,a=5,l=Math.min(...e),d=Math.max(...e)-l||1,f=i-a*2,p=r-a*2,m=e.map((g,v)=>{const j=a+v/Math.max(e.length-1,1)*f,b=a+(1-(g-l)/d)*p;return`${j},${b}`}).join(" ");return s.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${i} ${r}`,"aria-hidden":"true",children:[s.jsx("defs",{children:s.jsx("clipPath",{id:n,children:s.jsx("rect",{x:a,y:a,width:f,height:p,rx:"8"})})}),s.jsx("line",{className:"sparkline-guide",x1:a,x2:i-a,y1:r-a,y2:r-a}),s.jsx("polyline",{clipPath:`url(#${n})`,points:m,vectorEffect:"non-scaling-stroke"})]})}function wue({project:e}){return s.jsxs(Yt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[s.jsxs("div",{className:"project-row-primary",children:[s.jsxs("div",{children:[s.jsx("p",{className:"project-name",children:e.project.name}),s.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),s.jsx("p",{className:"project-insight",children:e.insight})]}),s.jsx("div",{className:"project-row-stat",children:s.jsxs("div",{className:"metric-inline-block",children:[s.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),s.jsx("p",{className:`metric-inline-value ${e.visibilityTone==="caution"?"text-amber-400":""}`,children:e.visibilityScore}),s.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta}),e.providerCoverage&&s.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),s.jsx("div",{className:"project-row-stat",children:s.jsxs("div",{className:"metric-inline-block",children:[s.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),s.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),s.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Pv(e.lastRun.status)]})]})}),s.jsx("div",{className:"project-row-chart",children:s.jsx(bue,{points:e.trend,tone:Z4(e.lastRun.status)})}),s.jsx("span",{className:"project-row-link",children:s.jsx(Hh,{className:"h-4 w-4 text-zinc-500"})})]})}function jue(){const e=Gh(),{dashboard:t,isLoading:n}=wc(),r=t??e?.dashboard;if(!r||n)return s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-32"}),s.jsx("div",{className:"skeleton-text-sm w-64"})]}),s.jsx("div",{className:"space-y-3",children:[1,2,3].map(p=>s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsx("div",{className:"skeleton-text w-36"}),s.jsx("div",{className:"skeleton-text-sm w-48"})]}),s.jsx("div",{className:"skeleton-text w-16"}),s.jsx("div",{className:"skeleton-text w-16"}),s.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},p))})]});const i=r.portfolioOverview,u=Uv(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},d=Kte(i.systemHealth,u,r.settings),{openRun:f}=vd();return s.jsxs("div",{className:"page-container",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Portfolio"}),s.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),s.jsx("div",{className:"page-header-right",children:s.jsx("p",{className:"text-[11px] text-zinc-600",children:i.lastUpdatedAt})})]}),i.projects.length>0?s.jsx("div",{className:"project-list project-list-scrollable",children:i.projects.map(p=>s.jsx(wue,{project:p},p.project.id))}):s.jsxs($e,{className:"surface-card empty-card",children:[s.jsx("h3",{children:i.emptyState?.title??"No projects yet"}),s.jsx("p",{className:"supporting-copy",children:i.emptyState?.detail}),s.jsx(be,{size:"sm",asChild:!0,children:s.jsx(Yt,{to:i.emptyState?.ctaHref==="/setup"||!i.emptyState?.ctaHref?"/setup":"/",children:i.emptyState?.ctaLabel??"Launch setup"})})]}),s.jsxs("div",{className:"overview-secondary-grid",children:[i.attentionItems.length>0&&s.jsxs("section",{className:"overview-secondary-section",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),s.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),s.jsx("div",{className:"attention-list attention-list-scrollable",children:i.attentionItems.map(p=>s.jsxs(Yt,{to:p.href,className:`attention-item attention-item-${p.tone}`,children:[s.jsxs("div",{children:[s.jsx("p",{className:"attention-title",children:p.title}),s.jsx("p",{className:"attention-detail",children:p.detail})]}),s.jsx("span",{className:"attention-action",children:p.actionLabel})]},p.id))})]}),s.jsxs("section",{className:"overview-secondary-section",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),s.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),s.jsx("div",{className:"compact-stack compact-stack-scrollable",children:i.recentRuns.length>0?i.recentRuns.map(p=>s.jsxs("button",{className:"compact-run",type:"button",onClick:()=>f(p.id),children:[s.jsxs("div",{children:[s.jsx("p",{className:"compact-run-title",children:p.projectName}),s.jsx("p",{className:"compact-run-detail",children:p.summary})]}),s.jsx(Mv,{status:p.status})]},p.id)):s.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),s.jsxs("section",{className:"page-section",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),s.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),s.jsx("div",{className:"health-grid",children:d.map(p=>s.jsxs($e,{className:"surface-card compact-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:p.label}),s.jsx("h3",{children:p.detail})]}),s.jsx(Xe,{tone:p.tone,title:p.id==="api"?Ko(u.apiStatus):p.id==="worker"?Ko(u.workerStatus):void 0,children:p.label})]}),s.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const Rk=Symbol.for("yaml.alias"),x1=Symbol.for("yaml.document"),Bo=Symbol.for("yaml.map"),G3=Symbol.for("yaml.pair"),qa=Symbol.for("yaml.scalar"),wd=Symbol.for("yaml.seq"),Gi=Symbol.for("yaml.node.type"),Sc=e=>!!e&&typeof e=="object"&&e[Gi]===Rk,Vv=e=>!!e&&typeof e=="object"&&e[Gi]===x1,Wh=e=>!!e&&typeof e=="object"&&e[Gi]===Bo,Dn=e=>!!e&&typeof e=="object"&&e[Gi]===G3,Jt=e=>!!e&&typeof e=="object"&&e[Gi]===qa,Yh=e=>!!e&&typeof e=="object"&&e[Gi]===wd;function Pn(e){if(e&&typeof e=="object")switch(e[Gi]){case Bo:case wd:return!0}return!1}function Rn(e){if(e&&typeof e=="object")switch(e[Gi]){case Rk:case Bo:case qa:case wd:return!0}return!1}const V3=e=>(Jt(e)||Pn(e))&&!!e.anchor,zl=Symbol("break visit"),Sue=Symbol("skip children"),uh=Symbol("remove node");function jd(e,t){const n=Nue(t);Vv(e)?Eu(null,e.contents,n,Object.freeze([e]))===uh&&(e.contents=null):Eu(null,e,n,Object.freeze([]))}jd.BREAK=zl;jd.SKIP=Sue;jd.REMOVE=uh;function Eu(e,t,n,r){const i=kue(e,t,n,r);if(Rn(i)||Dn(i))return Cue(e,r,i),Eu(e,i,n,r);if(typeof i!="symbol"){if(Pn(t)){r=Object.freeze(r.concat(t));for(let a=0;a<t.items.length;++a){const l=Eu(a,t.items[a],n,r);if(typeof l=="number")a=l-1;else{if(l===zl)return zl;l===uh&&(t.items.splice(a,1),a-=1)}}}else if(Dn(t)){r=Object.freeze(r.concat(t));const a=Eu("key",t.key,n,r);if(a===zl)return zl;a===uh&&(t.key=null);const l=Eu("value",t.value,n,r);if(l===zl)return zl;l===uh&&(t.value=null)}}return i}function Nue(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 kue(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(Wh(t))return n.Map?.(e,t,r);if(Yh(t))return n.Seq?.(e,t,r);if(Dn(t))return n.Pair?.(e,t,r);if(Jt(t))return n.Scalar?.(e,t,r);if(Sc(t))return n.Alias?.(e,t,r)}function Cue(e,t,n){const r=t[t.length-1];if(Pn(r))r.items[e]=n;else if(Dn(r))e==="key"?r.key=n:r.value=n;else if(Vv(r))r.contents=n;else{const i=Sc(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Aue={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Oue=e=>e.replace(/[!,[\]{}]/g,t=>Aue[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[a,l]=r;return this.tags[a]=l,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[a]=r;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const l=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,l),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const l=t.slice(2,-1);return l==="!"||l==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),l)}const[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const a=this.tags[r];if(a)try{return a+decodeURIComponent(i)}catch(l){return n(String(l)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+Oue(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&&Rn(t.contents)){const a={};jd(t.contents,(l,u)=>{Rn(u)&&u.tag&&(a[u.tag]=!0)}),i=Object.keys(a)}else i=[];for(const[a,l]of r)a==="!!"&&l==="tag:yaml.org,2002:"||(!t||i.some(u=>u.startsWith(l)))&&n.push(`%TAG ${a} ${l}`);return n.join(`
117
+ `)}}Tr.defaultYaml={explicit:!1,version:"1.2"};Tr.defaultTags={"!!":"tag:yaml.org,2002:"};function Q3(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 W3(e){const t=new Set;return jd(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function Y3(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Eue(e,t){const n=[],r=new Map;let i=null;return{onAnchor:a=>{n.push(a),i??(i=W3(e));const l=Y3(t,i);return i.add(l),l},setAnchors:()=>{for(const a of n){const l=r.get(a);if(typeof l=="object"&&l.anchor&&(Jt(l.node)||Pn(l.node)))l.node.anchor=l.anchor;else{const u=new Error("Failed to resolve repeated object (this should not happen)");throw u.source=a,u}}},sourceObjects:r}}function _u(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,a=r.length;i<a;++i){const l=r[i],u=_u(e,r,String(i),l);u===void 0?delete r[i]:u!==l&&(r[i]=u)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const a=r.get(i),l=_u(e,r,i,a);l===void 0?r.delete(i):l!==a&&r.set(i,l)}else if(r instanceof Set)for(const i of Array.from(r)){const a=_u(e,r,i,i);a===void 0?r.delete(i):a!==i&&(r.delete(i),r.add(a))}else for(const[i,a]of Object.entries(r)){const l=_u(e,r,i,a);l===void 0?delete r[i]:l!==a&&(r[i]=l)}return e.call(t,n,r)}function Fi(e,t,n){if(Array.isArray(e))return e.map((r,i)=>Fi(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!V3(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=a=>{r.res=a,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}class Dk{constructor(t){Object.defineProperty(this,Gi,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){if(!Vv(t))throw new TypeError("A document argument is required");const l={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},u=Fi(this,"",l);if(typeof i=="function")for(const{count:d,res:f}of l.anchors.values())i(f,d);return typeof a=="function"?_u(a,{"":u},"",u):u}}class Mk extends Dk{constructor(t){super(Rk),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],jd(t,{Node:(a,l)=>{(Sc(l)||V3(l))&&r.push(l)}}),n&&(n.aliasResolveCache=r));let i;for(const a of r){if(a===this)break;a.anchor===this.source&&(i=a)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:a}=n,l=this.resolve(i,n);if(!l){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let u=r.get(l);if(u||(Fi(l,null,n),u=r.get(l)),u?.res===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(a>=0&&(u.count+=1,u.aliasCount===0&&(u.aliasCount=$g(i,l,r)),u.count*u.aliasCount>a)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return u.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(Q3(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${i} `}return i}}function $g(e,t,n){if(Sc(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Pn(t)){let r=0;for(const i of t.items){const a=$g(e,i,n);a>r&&(r=a)}return r}else if(Dn(t)){const r=$g(e,t.key,n),i=$g(e,t.value,n);return Math.max(r,i)}return 1}const Z3=e=>!e||typeof e!="function"&&typeof e!="object";class it extends Dk{constructor(t){super(qa),this.value=t}toJSON(t,n){return n?.keep?this.value:Fi(this.value,t,n)}toString(){return String(this.value)}}it.BLOCK_FOLDED="BLOCK_FOLDED";it.BLOCK_LITERAL="BLOCK_LITERAL";it.PLAIN="PLAIN";it.QUOTE_DOUBLE="QUOTE_DOUBLE";it.QUOTE_SINGLE="QUOTE_SINGLE";const _ue="tag:yaml.org,2002:";function zue(e,t,n){if(t){const r=n.filter(a=>a.tag===t),i=r.find(a=>!a.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function kh(e,t,n){if(Vv(e)&&(e=e.contents),Rn(e))return e;if(Dn(e)){const m=n.schema[Bo].createNode?.(n.schema,null,n);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:l,sourceObjects:u}=n;let d;if(r&&e&&typeof e=="object"){if(d=u.get(e),d)return d.anchor??(d.anchor=i(e)),new Mk(d.anchor);d={anchor:null,node:null},u.set(e,d)}t?.startsWith("!!")&&(t=_ue+t.slice(2));let f=zue(e,t,l.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new it(e);return d&&(d.node=m),m}f=e instanceof Map?l[Bo]:Symbol.iterator in Object(e)?l[wd]:l[Bo]}a&&(a(f),delete n.onTagObj);const p=f?.createNode?f.createNode(n.schema,e,n):typeof f?.nodeClass?.from=="function"?f.nodeClass.from(n.schema,e,n):new it(e);return t?p.tag=t:f.default||(p.tag=f.tag),d&&(d.node=p),p}function yy(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const a=t[i];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const l=[];l[a]=r,r=l}else r=new Map([[a,r]])}return kh(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 eh=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class X3 extends Dk{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>Rn(r)||Dn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(eh(t))this.add(n);else{const[r,...i]=t,a=this.get(r,!0);if(Pn(a))a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,yy(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(Pn(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t,a=this.get(r,!0);return i.length===0?!n&&Jt(a)?a.value:a:Pn(a)?a.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Dn(n))return!1;const r=n.value;return r==null||t&&Jt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const i=this.get(n,!0);return Pn(i)?i.hasIn(r):!1}setIn(t,n){const[r,...i]=t;if(i.length===0)this.set(r,n);else{const a=this.get(r,!0);if(Pn(a))a.setIn(i,n);else if(a===void 0&&this.schema)this.set(r,yy(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const Tue=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ss(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const $l=(e,t,n)=>e.endsWith(`
118
+ `)?Ss(n,t):n.includes(`
119
+ `)?`
120
+ `+Ss(n,t):(e.endsWith(" ")?"":" ")+n,J3="flow",b1="block",Bg="quoted";function Qv(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:l,onOverflow:u}={}){if(!i||i<0)return e;i<a&&(a=0);const d=Math.max(1+a,1+i-t.length);if(e.length<=d)return e;const f=[],p={};let m=i-t.length;typeof r=="number"&&(r>i-Math.max(2,a)?f.push(0):m=i-r);let g,v,j=!1,b=-1,S=-1,k=-1;n===b1&&(b=CP(e,b,t.length),b!==-1&&(m=b+d));for(let C;C=e[b+=1];){if(n===Bg&&C==="\\"){switch(S=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}k=b}if(C===`
121
+ `)n===b1&&(b=CP(e,b,t.length)),m=b+t.length+d,g=void 0;else{if(C===" "&&v&&v!==" "&&v!==`
122
+ `&&v!==" "){const A=e[b+1];A&&A!==" "&&A!==`
123
+ `&&A!==" "&&(g=b)}if(b>=m)if(g)f.push(g),m=g+d,g=void 0;else if(n===Bg){for(;v===" "||v===" ";)v=C,C=e[b+=1],j=!0;const A=b>k+1?b-2:S-1;if(p[A])return e;f.push(A),p[A]=!0,m=A+d,g=void 0}else j=!0}v=C}if(j&&u&&u(),f.length===0)return e;l&&l();let E=e.slice(0,f[0]);for(let C=0;C<f.length;++C){const A=f[C],T=f[C+1]||e.length;A===0?E=`
124
+ ${t}${e.slice(0,T)}`:(n===Bg&&p[A]&&(E+=`${e[A]}\\`),E+=`
125
+ ${t}${e.slice(A+1,T)}`)}return E}function CP(e,t,n){let r=t,i=t+1,a=e[i];for(;a===" "||a===" ";)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
126
+ `);r=t,i=t+1,a=e[i]}return r}const Wv=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Yv=e=>/^(%|---|\.\.\.)/m.test(e);function Pue(e,t,n){if(!t||t<0)return!1;const r=t-n,i=e.length;if(i<=r)return!1;for(let a=0,l=0;a<i;++a)if(e[a]===`
127
+ `){if(a-l>r)return!0;if(l=a+1,i-l<=r)return!1}return!0}function dh(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Yv(e)?" ":"");let l="",u=0;for(let d=0,f=n[d];f;f=n[++d])if(f===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(l+=n.slice(u,d)+"\\ ",d+=1,u=d,f="\\"),f==="\\")switch(n[d+1]){case"u":{l+=n.slice(u,d);const p=n.substr(d+2,4);switch(p){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:p.substr(0,2)==="00"?l+="\\x"+p.substr(2):l+=n.substr(d,6)}d+=5,u=d+1}break;case"n":if(r||n[d+2]==='"'||n.length<i)d+=1;else{for(l+=n.slice(u,d)+`
128
+
129
+ `;n[d+2]==="\\"&&n[d+3]==="n"&&n[d+4]!=='"';)l+=`
130
+ `,d+=2;l+=a,n[d+2]===" "&&(l+="\\"),d+=1,u=d+1}break;default:d+=1}return l=u?l+n.slice(u):n,r?l:Qv(l,a,Bg,Wv(t,!1))}function w1(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
131
+ `)||/[ \t]\n|\n[ \t]/.test(e))return dh(e,t);const n=t.indent||(Yv(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
132
+ ${n}`)+"'";return t.implicitKey?r:Qv(r,n,J3,Wv(t,!1))}function zu(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=dh;else{const i=e.includes('"'),a=e.includes("'");i&&!a?r=w1:a&&!i?r=dh:r=n?w1:dh}return r(e,t)}let j1;try{j1=new RegExp(`(^|(?<!
133
+ ))
134
+ +(?!
135
+ |$)`,"g")}catch{j1=/\n+(?!\n|$)/g}function Ug({comment:e,type:t,value:n},r,i,a){const{blockQuote:l,commentString:u,lineWidth:d}=r.options;if(!l||/\n[\t ]+$/.test(n))return zu(n,r);const f=r.indent||(r.forceBlockIndent||Yv(n)?" ":""),p=l==="literal"?!0:l==="folded"||t===it.BLOCK_FOLDED?!1:t===it.BLOCK_LITERAL?!0:!Pue(n,d,f.length);if(!n)return p?`|
136
+ `:`>
137
+ `;let m,g;for(g=n.length;g>0;--g){const T=n[g-1];if(T!==`
138
+ `&&T!==" "&&T!==" ")break}let v=n.substring(g);const j=v.indexOf(`
139
+ `);j===-1?m="-":n===v||j!==v.length-1?(m="+",a&&a()):m="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
140
+ `&&(v=v.slice(0,-1)),v=v.replace(j1,`$&${f}`));let b=!1,S,k=-1;for(S=0;S<n.length;++S){const T=n[S];if(T===" ")b=!0;else if(T===`
141
+ `)k=S;else break}let E=n.substring(0,k<S?k+1:S);E&&(n=n.substring(E.length),E=E.replace(/\n+/g,`$&${f}`));let A=(b?f?"2":"1":"")+m;if(e&&(A+=" "+u(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const T=n.replace(/\n+/g,`
142
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let O=!1;const _=Wv(r,!0);l!=="folded"&&t!==it.BLOCK_FOLDED&&(_.onOverflow=()=>{O=!0});const P=Qv(`${E}${T}${v}`,f,b1,_);if(!O)return`>${A}
143
+ ${f}${P}`}return n=n.replace(/\n+/g,`$&${f}`),`|${A}
144
+ ${f}${E}${n}${v}`}function Rue(e,t,n,r){const{type:i,value:a}=e,{actualString:l,implicitKey:u,indent:d,indentStep:f,inFlow:p}=t;if(u&&a.includes(`
145
+ `)||p&&/[[\]{},]/.test(a))return zu(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return u||p||!a.includes(`
146
+ `)?zu(a,t):Ug(e,t,n,r);if(!u&&!p&&i!==it.PLAIN&&a.includes(`
147
+ `))return Ug(e,t,n,r);if(Yv(a)){if(d==="")return t.forceBlockIndent=!0,Ug(e,t,n,r);if(u&&d===f)return zu(a,t)}const m=a.replace(/\n+/g,`$&
148
+ ${d}`);if(l){const g=b=>b.default&&b.tag!=="tag:yaml.org,2002:str"&&b.test?.test(m),{compat:v,tags:j}=t.doc.schema;if(j.some(g)||v?.some(g))return zu(a,t)}return u?m:Qv(m,d,J3,Wv(t,!1))}function Ik(e,t,n,r){const{implicitKey:i,inFlow:a}=t,l=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:u}=e;u!==it.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(u=it.QUOTE_DOUBLE);const d=p=>{switch(p){case it.BLOCK_FOLDED:case it.BLOCK_LITERAL:return i||a?zu(l.value,t):Ug(l,t,n,r);case it.QUOTE_DOUBLE:return dh(l.value,t);case it.QUOTE_SINGLE:return w1(l.value,t);case it.PLAIN:return Rue(l,t,n,r);default:return null}};let f=d(u);if(f===null){const{defaultKeyType:p,defaultStringType:m}=t.options,g=i&&p||m;if(f=d(g),f===null)throw new Error(`Unsupported default string type ${g}`)}return f}function eB(e,t){const n=Object.assign({blockQuote:!0,commentString:Tue,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 Due(e,t){if(t.tag){const i=e.filter(a=>a.tag===t.tag);if(i.length>0)return i.find(a=>a.format===t.format)??i[0]}let n,r;if(Jt(t)){r=t.value;let i=e.filter(a=>a.identify?.(r));if(i.length>1){const a=i.filter(l=>l.test);a.length>0&&(i=a)}n=i.find(a=>a.format===t.format)??i.find(a=>!a.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function Mue(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],a=(Jt(e)||Pn(e))&&e.anchor;a&&Q3(a)&&(n.add(a),i.push(`&${a}`));const l=e.tag??(t.default?null:t.tag);return l&&i.push(r.directives.tagString(l)),i.join(" ")}function ed(e,t,n,r){if(Dn(e))return e.toString(t,n,r);if(Sc(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const a=Rn(e)?e:t.doc.createNode(e,{onTagObj:d=>i=d});i??(i=Due(t.doc.schema.tags,a));const l=Mue(a,i,t);l.length>0&&(t.indentAtStart=(t.indentAtStart??0)+l.length+1);const u=typeof i.stringify=="function"?i.stringify(a,t,n,r):Jt(a)?Ik(a,t,n,r):a.toString(t,n,r);return l?Jt(a)||u[0]==="{"||u[0]==="["?`${l} ${u}`:`${l}
149
+ ${t.indent}${u}`:u}function Iue({key:e,value:t},n,r,i){const{allNullValues:a,doc:l,indent:u,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:m}}=n;let g=Rn(e)&&e.comment||null;if(m){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(Pn(e)||!Rn(e)&&typeof e=="object"){const _="With simple keys, collection cannot be used as a key value";throw new Error(_)}}let v=!m&&(!e||g&&t==null&&!n.inFlow||Pn(e)||(Jt(e)?e.type===it.BLOCK_FOLDED||e.type===it.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(m||!a),indent:u+d});let j=!1,b=!1,S=ed(e,n,()=>j=!0,()=>b=!0);if(!v&&!n.inFlow&&S.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(a||t==null)return j&&r&&r(),S===""?"?":v?`? ${S}`:S}else if(a&&!m||t==null&&v)return S=`? ${S}`,g&&!j?S+=$l(S,n.indent,f(g)):b&&i&&i(),S;j&&(g=null),v?(g&&(S+=$l(S,n.indent,f(g))),S=`? ${S}
150
+ ${u}:`):(S=`${S}:`,g&&(S+=$l(S,n.indent,f(g))));let k,E,C;Rn(t)?(k=!!t.spaceBefore,E=t.commentBefore,C=t.comment):(k=!1,E=null,C=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!v&&!g&&Jt(t)&&(n.indentAtStart=S.length+1),b=!1,!p&&d.length>=2&&!n.inFlow&&!v&&Yh(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let A=!1;const T=ed(t,n,()=>A=!0,()=>b=!0);let O=" ";if(g||k||E){if(O=k?`
151
+ `:"",E){const _=f(E);O+=`
152
+ ${Ss(_,n.indent)}`}T===""&&!n.inFlow?O===`
153
+ `&&C&&(O=`
154
+
155
+ `):O+=`
156
+ ${n.indent}`}else if(!v&&Pn(t)){const _=T[0],P=T.indexOf(`
157
+ `),$=P!==-1,F=n.inFlow??t.flow??t.items.length===0;if($||!F){let U=!1;if($&&(_==="&"||_==="!")){let B=T.indexOf(" ");_==="&"&&B!==-1&&B<P&&T[B+1]==="!"&&(B=T.indexOf(" ",B+1)),(B===-1||P<B)&&(U=!0)}U||(O=`
158
+ ${n.indent}`)}}else(T===""||T[0]===`
159
+ `)&&(O="");return S+=O+T,n.inFlow?A&&r&&r():C&&!A?S+=$l(S,n.indent,f(C)):b&&i&&i(),S}function Lue(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const rg="<<",Cs={identify:e=>e===rg||typeof e=="symbol"&&e.description===rg,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new it(Symbol(rg)),{addToJSMap:tB}),stringify:()=>rg},$ue=(e,t)=>(Cs.identify(t)||Jt(t)&&(!t.type||t.type===it.PLAIN)&&Cs.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Cs.tag&&n.default);function tB(e,t,n){if(n=e&&Sc(n)?n.resolve(e.doc):n,Yh(n))for(const r of n.items)Qw(e,t,r);else if(Array.isArray(n))for(const r of n)Qw(e,t,r);else Qw(e,t,n)}function Qw(e,t,n){const r=e&&Sc(n)?n.resolve(e.doc):n;if(!Wh(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[a,l]of i)t instanceof Map?t.has(a)||t.set(a,l):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:l,writable:!0,enumerable:!0,configurable:!0});return t}function nB(e,t,{key:n,value:r}){if(Rn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if($ue(e,n))tB(e,t,r);else{const i=Fi(n,"",e);if(t instanceof Map)t.set(i,Fi(r,i,e));else if(t instanceof Set)t.add(i);else{const a=Bue(n,i,e),l=Fi(r,a,e);a in t?Object.defineProperty(t,a,{value:l,writable:!0,enumerable:!0,configurable:!0}):t[a]=l}}return t}function Bue(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Rn(e)&&n?.doc){const r=eB(n.doc,{});r.anchors=new Set;for(const a of n.anchors.keys())r.anchors.add(a.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=e.toString(r);if(!n.mapKeyWarned){let a=JSON.stringify(i);a.length>40&&(a=a.substring(0,36)+'..."'),Lue(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function Lk(e,t,n){const r=kh(e,void 0,n),i=kh(t,void 0,n);return new Mr(r,i)}class Mr{constructor(t,n=null){Object.defineProperty(this,Gi,{value:G3}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Rn(n)&&(n=n.clone(t)),Rn(r)&&(r=r.clone(t)),new Mr(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return nB(n,r,this)}toString(t,n,r){return t?.doc?Iue(this,t,n,r):JSON.stringify(this)}}function rB(e,t,n){return(t.inFlow??e.flow?que:Uue)(e,t,n)}function Uue({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:l,onComment:u}){const{indent:d,options:{commentString:f}}=n,p=Object.assign({},n,{indent:a,type:null});let m=!1;const g=[];for(let j=0;j<t.length;++j){const b=t[j];let S=null;if(Rn(b))!m&&b.spaceBefore&&g.push(""),vy(n,g,b.commentBefore,m),b.comment&&(S=b.comment);else if(Dn(b)){const E=Rn(b.key)?b.key:null;E&&(!m&&E.spaceBefore&&g.push(""),vy(n,g,E.commentBefore,m))}m=!1;let k=ed(b,p,()=>S=null,()=>m=!0);S&&(k+=$l(k,a,f(S))),m&&S&&(m=!1),g.push(r+k)}let v;if(g.length===0)v=i.start+i.end;else{v=g[0];for(let j=1;j<g.length;++j){const b=g[j];v+=b?`
160
+ ${d}${b}`:`
161
+ `}}return e?(v+=`
162
+ `+Ss(f(e),d),u&&u()):m&&l&&l(),v}function que({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:a,flowCollectionPadding:l,options:{commentString:u}}=t;r+=a;const d=Object.assign({},t,{indent:r,inFlow:!0,type:null});let f=!1,p=0;const m=[];for(let j=0;j<e.length;++j){const b=e[j];let S=null;if(Rn(b))b.spaceBefore&&m.push(""),vy(t,m,b.commentBefore,!1),b.comment&&(S=b.comment);else if(Dn(b)){const E=Rn(b.key)?b.key:null;E&&(E.spaceBefore&&m.push(""),vy(t,m,E.commentBefore,!1),E.comment&&(f=!0));const C=Rn(b.value)?b.value:null;C?(C.comment&&(S=C.comment),C.commentBefore&&(f=!0)):b.value==null&&E?.comment&&(S=E.comment)}S&&(f=!0);let k=ed(b,d,()=>S=null);j<e.length-1&&(k+=","),S&&(k+=$l(k,r,u(S))),!f&&(m.length>p||k.includes(`
163
+ `))&&(f=!0),m.push(k),p=m.length}const{start:g,end:v}=n;if(m.length===0)return g+v;if(!f){const j=m.reduce((b,S)=>b+S.length+2,2);f=t.options.lineWidth>0&&j>t.options.lineWidth}if(f){let j=g;for(const b of m)j+=b?`
164
+ ${a}${i}${b}`:`
165
+ `;return`${j}
166
+ ${i}${v}`}else return`${g}${l}${m.join(" ")}${l}${v}`}function vy({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=Ss(t(r),e);n.push(a.trimStart())}}function Bl(e,t){const n=Jt(t)?t.value:t;for(const r of e)if(Dn(r)&&(r.key===t||r.key===n||Jt(r.key)&&r.key.value===n))return r}class Bi extends X3{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Bo,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:a}=r,l=new this(t),u=(d,f)=>{if(typeof a=="function")f=a.call(n,d,f);else if(Array.isArray(a)&&!a.includes(d))return;(f!==void 0||i)&&l.items.push(Lk(d,f,r))};if(n instanceof Map)for(const[d,f]of n)u(d,f);else if(n&&typeof n=="object")for(const d of Object.keys(n))u(d,n[d]);return typeof t.sortMapEntries=="function"&&l.items.sort(t.sortMapEntries),l}add(t,n){let r;Dn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Mr(t,t?.value):r=new Mr(t.key,t.value);const i=Bl(this.items,r.key),a=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Jt(i.value)&&Z3(r.value)?i.value.value=r.value:i.value=r.value}else if(a){const l=this.items.findIndex(u=>a(r,u)<0);l===-1?this.items.push(r):this.items.splice(l,0,r)}else this.items.push(r)}delete(t){const n=Bl(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Bl(this.items,t)?.value;return(!n&&Jt(i)?i.value:i)??void 0}has(t){return!!Bl(this.items,t)}set(t,n){this.add(new Mr(t,n),!0)}toJSON(t,n,r){const i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(const a of this.items)nB(n,i,a);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!Dn(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})),rB(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Sd={collection:"map",default:!0,nodeClass:Bi,tag:"tag:yaml.org,2002:map",resolve(e,t){return Wh(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Bi.from(e,t,n)};class ac extends X3{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(wd,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=ig(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=ig(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Jt(i)?i.value:i}has(t){const n=ig(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=ig(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];Jt(i)&&Z3(n)?i.value=n:this.items[r]=n}toJSON(t,n){const r=[];n?.onCreate&&n.onCreate(r);let i=0;for(const a of this.items)r.push(Fi(a,String(i++),n));return r}toString(t,n,r){return t?rB(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n)){let l=0;for(let u of n){if(typeof i=="function"){const d=n instanceof Set?u:String(l++);u=i.call(n,d,u)}a.items.push(kh(u,void 0,r))}}return a}}function ig(e){let t=Jt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Nd={collection:"seq",default:!0,nodeClass:ac,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Yh(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>ac.from(e,t,n)},Zv={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Ik(e,t,n,r)}},Xv={identify:e=>e==null,createNode:()=>new it(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new it(null),stringify:({source:e},t)=>typeof e=="string"&&Xv.test.test(e)?e:t.options.nullStr},$k={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new it(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&$k.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function ya({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let a=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(a)){let l=a.indexOf(".");l<0&&(l=a.length,a+=".");let u=t-(a.length-l-1);for(;u-- >0;)a+="0"}return a}const iB={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:ya},aB={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():ya(e)}},sB={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new it(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ya},Jv=e=>typeof e=="bigint"||Number.isInteger(e),Bk=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function oB(e,t,n){const{value:r}=e;return Jv(r)&&r>=0?n+r.toString(t):ya(e)}const lB={identify:e=>Jv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Bk(e,2,8,n),stringify:e=>oB(e,8,"0o")},cB={identify:Jv,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Bk(e,0,10,n),stringify:ya},uB={identify:e=>Jv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Bk(e,2,16,n),stringify:e=>oB(e,16,"0x")},Fue=[Sd,Nd,Zv,Xv,$k,lB,cB,uB,iB,aB,sB];function AP(e){return typeof e=="bigint"||Number.isInteger(e)}const ag=({value:e})=>JSON.stringify(e),Hue=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:ag},{identify:e=>e==null,createNode:()=>new it(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ag},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:ag},{identify:AP,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})=>AP(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:ag}],Kue={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Gue=[Sd,Nd].concat(Hue,Kue),Uk={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return"";const l=n;let u;if(typeof btoa=="function"){let d="";for(let f=0;f<l.length;++f)d+=String.fromCharCode(l[f]);u=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=it.BLOCK_LITERAL),t!==it.QUOTE_DOUBLE){const d=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),f=Math.ceil(u.length/d),p=new Array(f);for(let m=0,g=0;m<f;++m,g+=d)p[m]=u.substr(g,d);u=p.join(t===it.BLOCK_LITERAL?`
167
+ `:" ")}return Ik({comment:e,type:t,value:u},r,i,a)}};function dB(e,t){if(Yh(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Dn(r)){if(Wh(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new Mr(new it(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
168
+ ${i.key.commentBefore}`:r.commentBefore),r.comment){const a=i.value??i.key;a.comment=a.comment?`${r.comment}
169
+ ${a.comment}`:r.comment}r=i}e.items[n]=Dn(r)?r:new Mr(r)}}else t("Expected a sequence for this tag");return e}function fB(e,t,n){const{replacer:r}=n,i=new ac(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let l of t){typeof r=="function"&&(l=r.call(t,String(a++),l));let u,d;if(Array.isArray(l))if(l.length===2)u=l[0],d=l[1];else throw new TypeError(`Expected [key, value] tuple: ${l}`);else if(l&&l instanceof Object){const f=Object.keys(l);if(f.length===1)u=f[0],d=l[u];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else u=l;i.items.push(Lk(u,d,n))}return i}const qk={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:dB,createNode:fB};class Uu extends ac{constructor(){super(),this.add=Bi.prototype.add.bind(this),this.delete=Bi.prototype.delete.bind(this),this.get=Bi.prototype.get.bind(this),this.has=Bi.prototype.has.bind(this),this.set=Bi.prototype.set.bind(this),this.tag=Uu.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n?.onCreate&&n.onCreate(r);for(const i of this.items){let a,l;if(Dn(i)?(a=Fi(i.key,"",n),l=Fi(i.value,a,n)):a=Fi(i,"",n),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,l)}return r}static from(t,n,r){const i=fB(t,n,r),a=new this;return a.items=i.items,a}}Uu.tag="tag:yaml.org,2002:omap";const Fk={collection:"seq",identify:e=>e instanceof Map,nodeClass:Uu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=dB(e,t),r=[];for(const{key:i}of n.items)Jt(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Uu,n)},createNode:(e,t,n)=>Uu.from(e,t,n)};function hB({value:e,source:t},n){return t&&(e?pB:mB).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const pB={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new it(!0),stringify:hB},mB={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new it(!1),stringify:hB},Vue={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:ya},Que={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():ya(e)}},Wue={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new it(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:ya},Zh=e=>typeof e=="bigint"||Number.isInteger(e);function ex(e,t,n,{intAsBigInt:r}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const l=BigInt(e);return i==="-"?BigInt(-1)*l:l}const a=parseInt(e,n);return i==="-"?-1*a:a}function Hk(e,t,n){const{value:r}=e;if(Zh(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return ya(e)}const Yue={identify:Zh,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>ex(e,2,2,n),stringify:e=>Hk(e,2,"0b")},Zue={identify:Zh,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>ex(e,1,8,n),stringify:e=>Hk(e,8,"0")},Xue={identify:Zh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>ex(e,0,10,n),stringify:ya},Jue={identify:Zh,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>ex(e,2,16,n),stringify:e=>Hk(e,16,"0x")};class qu extends Bi{constructor(t){super(t),this.tag=qu.tag}add(t){let n;Dn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Mr(t.key,null):n=new Mr(t,null),Bl(this.items,n.key)||this.items.push(n)}get(t,n){const r=Bl(this.items,t);return!n&&Dn(r)?Jt(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Bl(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Mr(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let l of n)typeof i=="function"&&(l=i.call(n,l,l)),a.items.push(Lk(l,null,r));return a}}qu.tag="tag:yaml.org,2002:set";const Kk={collection:"map",identify:e=>e instanceof Set,nodeClass:qu,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>qu.from(e,t,n),resolve(e,t){if(Wh(e)){if(e.hasAllNullValues(!0))return Object.assign(new qu,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Gk(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=l=>t?BigInt(l):Number(l),a=r.replace(/_/g,"").split(":").reduce((l,u)=>l*i(60)+i(u),i(0));return n==="-"?i(-1)*a:a}function gB(e){let{value:t}=e,n=l=>l;if(typeof t=="bigint")n=l=>BigInt(l);else if(isNaN(t)||!isFinite(t))return ya(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(l=>String(l).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const yB={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Gk(e,n),stringify:gB},vB={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Gk(e,!1),stringify:gB},tx={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(tx.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,a,l,u]=t.map(Number),d=t[7]?Number((t[7]+"00").substr(1,3)):0;let f=Date.UTC(n,r-1,i,a||0,l||0,u||0,d);const p=t[8];if(p&&p!=="Z"){let m=Gk(p,!1);Math.abs(m)<30&&(m*=60),f-=6e4*m}return new Date(f)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},OP=[Sd,Nd,Zv,Xv,pB,mB,Yue,Zue,Xue,Jue,Vue,Que,Wue,Uk,Cs,Fk,qk,Kk,yB,vB,tx],EP=new Map([["core",Fue],["failsafe",[Sd,Nd,Zv]],["json",Gue],["yaml11",OP],["yaml-1.1",OP]]),_P={binary:Uk,bool:$k,float:sB,floatExp:aB,floatNaN:iB,floatTime:vB,int:cB,intHex:uB,intOct:lB,intTime:yB,map:Sd,merge:Cs,null:Xv,omap:Fk,pairs:qk,seq:Nd,set:Kk,timestamp:tx},ede={"tag:yaml.org,2002:binary":Uk,"tag:yaml.org,2002:merge":Cs,"tag:yaml.org,2002:omap":Fk,"tag:yaml.org,2002:pairs":qk,"tag:yaml.org,2002:set":Kk,"tag:yaml.org,2002:timestamp":tx};function Ww(e,t,n){const r=EP.get(t);if(r&&!e)return n&&!r.includes(Cs)?r.concat(Cs):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const a=Array.from(EP.keys()).filter(l=>l!=="yaml11").map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${a} or define customTags array`)}if(Array.isArray(e))for(const a of e)i=i.concat(a);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(Cs)),i.reduce((a,l)=>{const u=typeof l=="string"?_P[l]:l;if(!u){const d=JSON.stringify(l),f=Object.keys(_P).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${f}`)}return a.includes(u)||a.push(u),a},[])}const tde=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Vk{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:a,sortMapEntries:l,toStringDefaults:u}){this.compat=Array.isArray(t)?Ww(t,"compat"):t?Ww(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=i?ede:{},this.tags=Ww(n,this.name,r),this.toStringOptions=u??null,Object.defineProperty(this,Bo,{value:Sd}),Object.defineProperty(this,qa,{value:Zv}),Object.defineProperty(this,wd,{value:Nd}),this.sortMapEntries=typeof l=="function"?l:l===!0?tde:null}clone(){const t=Object.create(Vk.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function nde(e,t){const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const d=e.directives.toString(e);d?(n.push(d),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const i=eB(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=a(e.commentBefore);n.unshift(Ss(d,""))}let l=!1,u=null;if(e.contents){if(Rn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=a(e.contents.commentBefore);n.push(Ss(p,""))}i.forceBlockIndent=!!e.comment,u=e.contents.comment}const d=u?void 0:()=>l=!0;let f=ed(e.contents,i,()=>u=null,d);u&&(f+=$l(f,"",a(u))),(f[0]==="|"||f[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${f}`:n.push(f)}else n.push(ed(e.contents,i));if(e.directives?.docEnd)if(e.comment){const d=a(e.comment);d.includes(`
170
+ `)?(n.push("..."),n.push(Ss(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&l&&(d=d.replace(/^\n+/,"")),d&&((!l||u)&&n[n.length-1]!==""&&n.push(""),n.push(Ss(a(d),"")))}return n.join(`
171
+ `)+`
172
+ `}class nx{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Gi,{value:x1});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);const a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=a;let{version:l}=a;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(l=this.directives.yaml.version)):this.directives=new Tr({version:l}),this.setSchema(l,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(nx.prototype,{[Gi]:{value:x1}});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=Rn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){pu(this.contents)&&this.contents.add(t)}addIn(t,n){pu(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=W3(this);t.anchor=!n||r.has(n)?Y3(n||"a",r):n}return new Mk(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const S=E=>typeof E=="number"||E instanceof String||E instanceof Number,k=n.filter(S).map(String);k.length>0&&(n=n.concat(k)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:l,flow:u,keepUndefined:d,onTagObj:f,tag:p}=r??{},{onAnchor:m,setAnchors:g,sourceObjects:v}=Eue(this,l||"a"),j={aliasDuplicateObjects:a??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:v},b=kh(t,p,j);return u&&Pn(b)&&(b.flow=!0),g(),b}createPair(t,n,r={}){const i=this.createNode(t,null,r),a=this.createNode(n,null,r);return new Mr(i,a)}delete(t){return pu(this.contents)?this.contents.delete(t):!1}deleteIn(t){return eh(t)?this.contents==null?!1:(this.contents=null,!0):pu(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Pn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return eh(t)?!n&&Jt(this.contents)?this.contents.value:this.contents:Pn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Pn(this.contents)?this.contents.has(t):!1}hasIn(t){return eh(t)?this.contents!==void 0:Pn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=yy(this.schema,[t],n):pu(this.contents)&&this.contents.set(t,n)}setIn(t,n){eh(t)?this.contents=n:this.contents==null?this.contents=yy(this.schema,Array.from(t),n):pu(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new 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 Vk(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:a,reviver:l}={}){const u={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},d=Fi(this.contents,n??"",u);if(typeof a=="function")for(const{count:f,res:p}of u.anchors.values())a(p,f);return typeof l=="function"?_u(l,{"":d},"",d):d}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return nde(this,t)}}function pu(e){if(Pn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class xB extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class sg extends xB{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class rde extends xB{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const zP=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(u=>t.linePos(u));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,l=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(a>=60&&l.length>80){const u=Math.min(a-39,l.length-79);l="…"+l.substring(u),a-=u-1}if(l.length>80&&(l=l.substring(0,79)+"…"),r>1&&/^ *$/.test(l.substring(0,a))){let u=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);u.length>80&&(u=u.substring(0,79)+`…
173
+ `),l=u+l}if(/[^ ]/.test(l)){let u=1;const d=n.linePos[1];d?.line===r&&d.col>i&&(u=Math.max(1,Math.min(d.col-i,80-a)));const f=" ".repeat(a)+"^".repeat(u);n.message+=`:
174
+
175
+ ${l}
176
+ ${f}
177
+ `}};function td(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:l,startOnNewline:u}){let d=!1,f=u,p=u,m="",g="",v=!1,j=!1,b=null,S=null,k=null,E=null,C=null,A=null,T=null;for(const P of e)switch(j&&(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma"&&a(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),j=!1),b&&(f&&P.type!=="comment"&&P.type!=="newline"&&a(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),P.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&P.source.includes(" ")&&(b=P),p=!0;break;case"comment":{p||a(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const $=P.source.substring(1)||" ";m?m+=g+$:m=$,g="",f=!1;break}case"newline":f?m?m+=P.source:(!A||n!=="seq-item-ind")&&(d=!0):g+=P.source,f=!0,v=!0,(S||k)&&(E=P),p=!0;break;case"anchor":S&&a(P,"MULTIPLE_ANCHORS","A node can have at most one anchor"),P.source.endsWith(":")&&a(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),S=P,T??(T=P.offset),f=!1,p=!1,j=!0;break;case"tag":{k&&a(P,"MULTIPLE_TAGS","A node can have at most one tag"),k=P,T??(T=P.offset),f=!1,p=!1,j=!0;break}case n:(S||k)&&a(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`),A&&a(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${t??"collection"}`),A=P,f=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){C&&a(P,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),C=P,f=!1,p=!1;break}default:a(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),f=!1,p=!1}const O=e[e.length-1],_=O?O.offset+O.source.length:i;return j&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&a(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(f&&b.indent<=l||r?.type==="block-map"||r?.type==="block-seq")&&a(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:C,found:A,spaceBefore:d,comment:m,hasNewline:v,anchor:S,tag:k,newlineAfterProp:E,end:_,start:T??_}}function Ch(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
178
+ `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(Ch(t.key)||Ch(t.value))return!0}return!1;default:return!0}}function S1(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Ch(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function bB(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(a,l)=>a===l||Jt(a)&&Jt(l)&&a.value===l.value;return t.some(a=>i(a.key,n))}const TP="All mapping items must start at the same column";function ide({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=a?.nodeClass??Bi,u=new l(n.schema);n.atRoot&&(n.atRoot=!1);let d=r.offset,f=null;for(const p of r.items){const{start:m,key:g,sep:v,value:j}=p,b=td(m,{indicator:"explicit-key-ind",next:g??v?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0}),S=!b.found;if(S){if(g&&(g.type==="block-seq"?i(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==r.indent&&i(d,"BAD_INDENT",TP)),!b.anchor&&!b.tag&&!v){f=b.end,b.comment&&(u.comment?u.comment+=`
179
+ `+b.comment:u.comment=b.comment);continue}(b.newlineAfterProp||Ch(g))&&i(g??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else b.found?.indent!==r.indent&&i(d,"BAD_INDENT",TP);n.atKey=!0;const k=b.end,E=g?e(n,g,b,i):t(n,k,m,null,b,i);n.schema.compat&&S1(r.indent,g,i),n.atKey=!1,bB(n,u.items,E)&&i(k,"DUPLICATE_KEY","Map keys must be unique");const C=td(v??[],{indicator:"map-value-ind",next:j,offset:E.range[2],onError:i,parentIndent:r.indent,startOnNewline:!g||g.type==="block-scalar"});if(d=C.end,C.found){S&&(j?.type==="block-map"&&!C.hasNewline&&i(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&b.start<C.found.offset-1024&&i(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const A=j?e(n,j,C,i):t(n,d,v,null,C,i);n.schema.compat&&S1(r.indent,j,i),d=A.range[2];const T=new Mr(E,A);n.options.keepSourceTokens&&(T.srcToken=p),u.items.push(T)}else{S&&i(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),C.comment&&(E.comment?E.comment+=`
180
+ `+C.comment:E.comment=C.comment);const A=new Mr(E);n.options.keepSourceTokens&&(A.srcToken=p),u.items.push(A)}}return f&&f<d&&i(f,"IMPOSSIBLE","Map comment with trailing content"),u.range=[r.offset,d,f??d],u}function ade({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=a?.nodeClass??ac,u=new l(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset,f=null;for(const{start:p,value:m}of r.items){const g=td(p,{indicator:"seq-item-ind",next:m,offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||m)m?.type==="block-seq"?i(g.end,"BAD_INDENT","All sequence items must start at the same column"):i(d,"MISSING_CHAR","Sequence item without - indicator");else{f=g.end,g.comment&&(u.comment=g.comment);continue}const v=m?e(n,m,g,i):t(n,g.end,p,null,g,i);n.schema.compat&&S1(r.indent,m,i),d=v.range[2],u.items.push(v)}return u.range=[r.offset,d,f??d],u}function Xh(e,t,n,r){let i="";if(e){let a=!1,l="";for(const u of e){const{source:d,type:f}=u;switch(f){case"space":a=!0;break;case"comment":{n&&!a&&r(u,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=d.substring(1)||" ";i?i+=l+p:i=p,l="";break}case"newline":i&&(l+=d),a=!0;break;default:r(u,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=d.length}}return{comment:i,offset:t}}const Yw="Block collections are not allowed within flow collections",Zw=e=>e&&(e.type==="block-map"||e.type==="block-seq");function sde({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=r.start.source==="{",u=l?"flow map":"flow sequence",d=a?.nodeClass??(l?Bi:ac),f=new d(n.schema);f.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let m=r.offset+r.start.source.length;for(let S=0;S<r.items.length;++S){const k=r.items[S],{start:E,key:C,sep:A,value:T}=k,O=td(E,{flow:u,indicator:"explicit-key-ind",next:C??A?.[0],offset:m,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!A&&!T){S===0&&O.comma?i(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`):S<r.items.length-1&&i(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${u}`),O.comment&&(f.comment?f.comment+=`
181
+ `+O.comment:f.comment=O.comment),m=O.end;continue}!l&&n.options.strict&&Ch(C)&&i(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)O.comma&&i(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`);else if(O.comma||i(O.start,"MISSING_CHAR",`Missing , between ${u} items`),O.comment){let _="";e:for(const P of E)switch(P.type){case"comma":case"space":break;case"comment":_=P.source.substring(1);break e;default:break e}if(_){let P=f.items[f.items.length-1];Dn(P)&&(P=P.value??P.key),P.comment?P.comment+=`
182
+ `+_:P.comment=_,O.comment=O.comment.substring(_.length+1)}}if(!l&&!A&&!O.found){const _=T?e(n,T,O,i):t(n,O.end,A,null,O,i);f.items.push(_),m=_.range[2],Zw(T)&&i(_.range,"BLOCK_IN_FLOW",Yw)}else{n.atKey=!0;const _=O.end,P=C?e(n,C,O,i):t(n,_,E,null,O,i);Zw(C)&&i(P.range,"BLOCK_IN_FLOW",Yw),n.atKey=!1;const $=td(A??[],{flow:u,indicator:"map-value-ind",next:T,offset:P.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if($.found){if(!l&&!O.found&&n.options.strict){if(A)for(const B of A){if(B===$.found)break;if(B.type==="newline"){i(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}O.start<$.found.offset-1024&&i($.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else T&&("source"in T&&T.source?.[0]===":"?i(T,"MISSING_CHAR",`Missing space after : in ${u}`):i($.start,"MISSING_CHAR",`Missing , or : between ${u} items`));const F=T?e(n,T,$,i):$.found?t(n,$.end,A,null,$,i):null;F?Zw(T)&&i(F.range,"BLOCK_IN_FLOW",Yw):$.comment&&(P.comment?P.comment+=`
183
+ `+$.comment:P.comment=$.comment);const U=new Mr(P,F);if(n.options.keepSourceTokens&&(U.srcToken=k),l){const B=f;bB(n,B.items,P)&&i(_,"DUPLICATE_KEY","Map keys must be unique"),B.items.push(U)}else{const B=new Bi(n.schema);B.flow=!0,B.items.push(U);const V=(F??P).range;B.range=[P.range[0],V[1],V[2]],f.items.push(B)}m=F?F.range[2]:$.end}}const g=l?"}":"]",[v,...j]=r.end;let b=m;if(v?.source===g)b=v.offset+v.source.length;else{const S=u[0].toUpperCase()+u.substring(1),k=p?`${S} must end with a ${g}`:`${S} in block collection must be sufficiently indented and end with a ${g}`;i(m,p?"MISSING_CHAR":"BAD_INDENT",k),v&&v.source.length!==1&&j.unshift(v)}if(j.length>0){const S=Xh(j,b,n.options.strict,i);S.comment&&(f.comment?f.comment+=`
184
+ `+S.comment:f.comment=S.comment),f.range=[r.offset,b,S.offset]}else f.range=[r.offset,b,b];return f}function Xw(e,t,n,r,i,a){const l=n.type==="block-map"?ide(e,t,n,r,a):n.type==="block-seq"?ade(e,t,n,r,a):sde(e,t,n,r,a),u=l.constructor;return i==="!"||i===u.tagName?(l.tag=u.tagName,l):(i&&(l.tag=i),l)}function ode(e,t,n,r,i){const a=r.tag,l=a?t.directives.tagName(a.source,g=>i(a,"TAG_RESOLVE_FAILED",g)):null;if(n.type==="block-seq"){const{anchor:g,newlineAfterProp:v}=r,j=g&&a?g.offset>a.offset?g:a:g??a;j&&(!v||v.offset<j.offset)&&i(j,"MISSING_CHAR","Missing newline after block sequence props")}const u=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!l||l==="!"||l===Bi.tagName&&u==="map"||l===ac.tagName&&u==="seq")return Xw(e,t,n,i,l);let d=t.schema.tags.find(g=>g.tag===l&&g.collection===u);if(!d){const g=t.schema.knownTags[l];if(g?.collection===u)t.schema.tags.push(Object.assign({},g,{default:!1})),d=g;else return g?i(a,"BAD_COLLECTION_TYPE",`${g.tag} used for ${u} collection, but expects ${g.collection??"scalar"}`,!0):i(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),Xw(e,t,n,i,l)}const f=Xw(e,t,n,i,l,d),p=d.resolve?.(f,g=>i(a,"TAG_RESOLVE_FAILED",g),t.options)??f,m=Rn(p)?p:new it(p);return m.range=f.range,m.tag=l,d?.format&&(m.format=d.format),m}function lde(e,t,n){const r=t.offset,i=cde(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const a=i.mode===">"?it.BLOCK_FOLDED:it.BLOCK_LITERAL,l=t.source?ude(t.source):[];let u=l.length;for(let b=l.length-1;b>=0;--b){const S=l[b][1];if(S===""||S==="\r")u=b;else break}if(u===0){const b=i.chomp==="+"&&l.length>0?`
185
+ `.repeat(Math.max(1,l.length-1)):"";let S=r+i.length;return t.source&&(S+=t.source.length),{value:b,type:a,comment:i.comment,range:[r,S,S]}}let d=t.indent+i.indent,f=t.offset+i.length,p=0;for(let b=0;b<u;++b){const[S,k]=l[b];if(k===""||k==="\r")i.indent===0&&S.length>d&&(d=S.length);else{S.length<d&&n(f+S.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(d=S.length),p=b,d===0&&!e.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=S.length+k.length+1}for(let b=l.length-1;b>=u;--b)l[b][0].length>d&&(u=b+1);let m="",g="",v=!1;for(let b=0;b<p;++b)m+=l[b][0].slice(d)+`
186
+ `;for(let b=p;b<u;++b){let[S,k]=l[b];f+=S.length+k.length+1;const E=k[k.length-1]==="\r";if(E&&(k=k.slice(0,-1)),k&&S.length<d){const A=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(f-k.length-(E?2:1),"BAD_INDENT",A),S=""}a===it.BLOCK_LITERAL?(m+=g+S.slice(d)+k,g=`
187
+ `):S.length>d||k[0]===" "?(g===" "?g=`
188
+ `:!v&&g===`
189
+ `&&(g=`
190
+
191
+ `),m+=g+S.slice(d)+k,g=`
192
+ `,v=!0):k===""?g===`
193
+ `?m+=`
194
+ `:g=`
195
+ `:(m+=g+k,g=" ",v=!1)}switch(i.chomp){case"-":break;case"+":for(let b=u;b<l.length;++b)m+=`
196
+ `+l[b][0].slice(d);m[m.length-1]!==`
197
+ `&&(m+=`
198
+ `);break;default:m+=`
199
+ `}const j=r+i.length+t.source.length;return{value:m,type:a,comment:i.comment,range:[r,j,j]}}function cde({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],a=i[0];let l=0,u="",d=-1;for(let g=1;g<i.length;++g){const v=i[g];if(!u&&(v==="-"||v==="+"))u=v;else{const j=Number(v);!l&&j?l=j:d===-1&&(d=e+g)}}d!==-1&&r(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let f=!1,p="",m=i.length;for(let g=1;g<t.length;++g){const v=t[g];switch(v.type){case"space":f=!0;case"newline":m+=v.source.length;break;case"comment":n&&!f&&r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=v.source.length,p=v.source.substring(1);break;case"error":r(v,"UNEXPECTED_TOKEN",v.message),m+=v.source.length;break;default:{const j=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",j);const b=v.source;b&&typeof b=="string"&&(m+=b.length)}}}return{mode:a,indent:l,chomp:u,comment:p,length:m}}function ude(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),a=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let l=1;l<t.length;l+=2)a.push([t[l],t[l+1]]);return a}function dde(e,t,n){const{offset:r,type:i,source:a,end:l}=e;let u,d;const f=(g,v,j)=>n(r+g,v,j);switch(i){case"scalar":u=it.PLAIN,d=fde(a,f);break;case"single-quoted-scalar":u=it.QUOTE_SINGLE,d=hde(a,f);break;case"double-quoted-scalar":u=it.QUOTE_DOUBLE,d=pde(a,f);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+a.length,r+a.length]}}const p=r+a.length,m=Xh(l,p,t,n);return{value:d,type:u,comment:m.comment,range:[r,p,m.offset]}}function fde(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}`),wB(e)}function hde(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),wB(e.slice(1,-1)).replace(/''/g,"'")}function wB(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
200
+ `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
201
+ `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=" ",l=t.lastIndex;for(n.lastIndex=l;r=n.exec(e);)r[1]===""?a===`
202
+ `?i+=a:a=`
203
+ `:(i+=a+r[1],a=" "),l=n.lastIndex;const u=/[ \t]*(.*)/sy;return u.lastIndex=l,r=u.exec(e),i+a+(r?.[1]??"")}function pde(e,t){let n="";for(let r=1;r<e.length-1;++r){const i=e[r];if(!(i==="\r"&&e[r+1]===`
204
+ `))if(i===`
205
+ `){const{fold:a,offset:l}=mde(e,r);n+=a,r=l}else if(i==="\\"){let a=e[++r];const l=gde[a];if(l)n+=l;else if(a===`
206
+ `)for(a=e[r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="\r"&&e[r+1]===`
207
+ `)for(a=e[++r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="x"||a==="u"||a==="U"){const u={x:2,u:4,U:8}[a];n+=yde(e,r+1,u,t),r+=u}else{const u=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),n+=u}}else if(i===" "||i===" "){const a=r;let l=e[r+1];for(;l===" "||l===" ";)l=e[++r+1];l!==`
208
+ `&&!(l==="\r"&&e[r+2]===`
209
+ `)&&(n+=r>a?e.slice(a,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function mde(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
210
+ `||r==="\r")&&!(r==="\r"&&e[t+2]!==`
211
+ `);)r===`
212
+ `&&(n+=`
213
+ `),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const gde={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
214
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function yde(e,t,n,r){const i=e.substr(t,n),l=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(l)){const u=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),u}return String.fromCodePoint(l)}function jB(e,t,n,r){const{value:i,type:a,comment:l,range:u}=t.type==="block-scalar"?lde(e,t,r):dde(t,e.options.strict,r),d=n?e.directives.tagName(n.source,m=>r(n,"TAG_RESOLVE_FAILED",m)):null;let f;e.options.stringKeys&&e.atKey?f=e.schema[qa]:d?f=vde(e.schema,i,d,n,r):t.type==="scalar"?f=xde(e,i,t,r):f=e.schema[qa];let p;try{const m=f.resolve(i,g=>r(n??t,"TAG_RESOLVE_FAILED",g),e.options);p=Jt(m)?m:new it(m)}catch(m){const g=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",g),p=new it(i)}return p.range=u,p.source=i,a&&(p.type=a),d&&(p.tag=d),f.format&&(p.format=f.format),l&&(p.comment=l),p}function vde(e,t,n,r,i){if(n==="!")return e[qa];const a=[];for(const u of e.tags)if(!u.collection&&u.tag===n)if(u.default&&u.test)a.push(u);else return u;for(const u of a)if(u.test?.test(t))return u;const l=e.knownTags[n];return l&&!l.collection?(e.tags.push(Object.assign({},l,{default:!1,test:void 0})),l):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[qa])}function xde({atKey:e,directives:t,schema:n},r,i,a){const l=n.tags.find(u=>(u.default===!0||e&&u.default==="key")&&u.test?.test(r))||n[qa];if(n.compat){const u=n.compat.find(d=>d.default&&d.test?.test(r))??n[qa];if(l.tag!==u.tag){const d=t.tagString(l.tag),f=t.tagString(u.tag),p=`Value may be parsed as either ${d} or ${f}`;a(i,"TAG_RESOLVE_FAILED",p,!0)}}return l}function bde(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 wde={composeNode:SB,composeEmptyNode:Qk};function SB(e,t,n,r){const i=e.atKey,{spaceBefore:a,comment:l,anchor:u,tag:d}=n;let f,p=!0;switch(t.type){case"alias":f=jde(e,t,r),(u||d)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":f=jB(e,t,d,r),u&&(f.anchor=u.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=ode(wde,e,t,n,r),u&&(f.anchor=u.source.substring(1));break;default:{const m=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",m),f=Qk(e,t.offset,void 0,null,n,r),p=!1}}return u&&f.anchor===""&&r(u,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!Jt(f)||typeof f.value!="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")&&r(d??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(f.spaceBefore=!0),l&&(t.type==="scalar"&&t.source===""?f.comment=l:f.commentBefore=l),e.options.keepSourceTokens&&p&&(f.srcToken=t),f}function Qk(e,t,n,r,{spaceBefore:i,comment:a,anchor:l,tag:u,end:d},f){const p={type:"scalar",offset:bde(t,n,r),indent:-1,source:""},m=jB(e,p,u,f);return l&&(m.anchor=l.source.substring(1),m.anchor===""&&f(l,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(m.spaceBefore=!0),a&&(m.comment=a,m.range[2]=d),m}function jde({options:e},{offset:t,source:n,end:r},i){const a=new Mk(n.substring(1));a.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const l=t+n.length,u=Xh(r,l,e.strict,i);return a.range=[t,l,u.offset],u.comment&&(a.comment=u.comment),a}function Sde(e,t,{offset:n,start:r,value:i,end:a},l){const u=Object.assign({_directives:t},e),d=new nx(void 0,u),f={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=td(r,{indicator:"doc-start",next:i??a?.[0],offset:n,onError:l,parentIndent:0,startOnNewline:!0});p.found&&(d.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&l(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=i?SB(f,i,p,l):Qk(f,p.end,r,null,p,l);const m=d.contents.range[2],g=Xh(a,m,!1,l);return g.comment&&(d.comment=g.comment),d.range=[n,m,g.offset],d}function Bf(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 PP(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){const a=e[i];switch(a[0]){case"#":t+=(t===""?"":r?`
215
+
216
+ `:`
217
+ `)+(a.substring(1)||" "),n=!0,r=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class Nde{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,a)=>{const l=Bf(n);a?this.warnings.push(new rde(l,r,i)):this.errors.push(new sg(l,r,i))},this.directives=new Tr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=PP(this.prelude);if(r){const a=t.contents;if(n)t.comment=t.comment?`${t.comment}
218
+ ${r}`:r;else if(i||t.directives.docStart||!a)t.commentBefore=r;else if(Pn(a)&&!a.flow&&a.items.length>0){let l=a.items[0];Dn(l)&&(l=l.key);const u=l.commentBefore;l.commentBefore=u?`${r}
219
+ ${u}`:r}else{const l=a.commentBefore;a.commentBefore=l?`${r}
220
+ ${l}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:PP(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const i of t)yield*this.next(i);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,i)=>{const a=Bf(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=Sde(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new sg(Bf(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new sg(Bf(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Xh(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
221
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new sg(Bf(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 nx(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 NB="\uFEFF",kB="",CB="",N1="";function kde(e){switch(e){case NB:return"byte-order-mark";case kB:return"doc-mode";case CB:return"flow-error-end";case N1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
222
+ `:case`\r
223
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function ia(e){switch(e){case void 0:case" ":case`
224
+ `:case"\r":case" ":return!0;default:return!1}}const RP=new Set("0123456789ABCDEFabcdef"),Cde=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),og=new Set(",[]{}"),Ade=new Set(` ,[]{}
225
+ \r `),Jw=e=>!e||Ade.has(e);class Ode{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
226
+ `?!0:n==="\r"?this.buffer[t+1]===`
227
+ `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const i=this.buffer[r+t+1];if(i===`
228
+ `||!i&&!this.atEnd)return t+r+1}return n===`
229
+ `||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&ia(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
230
+ `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===NB&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const a=t[r-1];if(a===" "||a===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const a=t[n-1];if(a===" "||a===" ")n-=1;else break}const i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield kB,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==="...")&&ia(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&&!ia(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===":")&&ia(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(Jw),"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("..."))&&ia(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield CB,yield*this.parseLineStart();let a=0;for(;i[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),i[a]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-a),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Jw),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const l=this.charAt(1);if(this.flowKey||ia(l)||l===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let a=0;for(;this.buffer[n-1-a]==="\\";)a+=1;if(a%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let i=r.indexOf(`
231
+ `,this.pos);if(i!==-1){for(;i!==-1;){const a=this.continueScalar(i+1);if(a===-1)break;i=r.indexOf(`
232
+ `,a)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ia(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let a=this.pos;r=this.buffer[a];++a)switch(r){case" ":n+=1;break;case`
233
+ `:t=a,n=0;break;case"\r":{const l=this.buffer[a+1];if(!l&&!this.atEnd)return this.setNext("block-scalar");if(l===`
234
+ `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const a=this.continueScalar(t+1);if(a===-1)break;t=this.buffer.indexOf(`
235
+ `,a)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
236
+ `;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let a=t-1,l=this.buffer[a];l==="\r"&&(l=this.buffer[--a]);const u=a;for(;l===" ";)l=this.buffer[--a];if(l===`
237
+ `&&a>=this.pos&&a+1+n>u)t=a;else break}while(!0);return yield N1,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){const a=this.buffer[r+1];if(ia(a)||t&&og.has(a))break;n=r}else if(ia(i)){let a=this.buffer[r+1];if(i==="\r"&&(a===`
238
+ `?(r+=1,i=`
239
+ `,a=this.buffer[r+1]):n=r),a==="#"||t&&og.has(a))break;if(i===`
240
+ `){const l=this.continueScalar(r+1);if(l===-1)break;r=Math.max(r,l-2)}}else{if(t&&og.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield N1,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(Jw))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(ia(n)||t&&og.has(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!ia(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(Cde.has(n))n=this.buffer[++t];else if(n==="%"&&RP.has(this.buffer[t+1])&&RP.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
241
+ `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
242
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class Ede{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const a=n+r>>1;this.lineStarts[a]<t?n=a+1:r=a}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const i=this.lineStarts[n-1];return{line:n,col:t-i+1}}}}function Ao(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function DP(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 AB(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function lg(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function mu(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function MP(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Ao(t.start,"explicit-key-ind")&&!Ao(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,AB(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 _de{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 Ode,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=kde(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"&&MP(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&&DP(i.start)===-1&&(n.indent===0||i.start.every(a=>a.type!=="comment"||a.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{DP(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=lg(this.peek(2)),r=mu(n);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
243
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
244
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(i&&n.sep&&!n.value){const l=[];for(let u=0;u<n.sep.length;++u){const d=n.sep[u];switch(d.type){case"newline":l.push(u);break;case"space":break;case"comment":d.indent>t.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(a=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ao(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(AB(n.key)&&!Ao(n.sep,"newline")){const l=mu(n.start),u=n.key,d=n.sep;d.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:u,sep:d}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Ao(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=mu(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Ao(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ao(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:a});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Ao(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const i=lg(r),a=mu(i);MP(t);const l=t.end.splice(1,t.end.length);l.push(this.sourceToken);const u={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
245
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
246
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=lg(t),r=mu(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=lg(t),r=mu(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function zde(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Ede||null,prettyErrors:t}}function Tde(e,t={}){const{lineCounter:n,prettyErrors:r}=zde(t),i=new _de(n?.addNewLine),a=new Nde(t),l=Array.from(a.compose(i.parse(e)));if(r&&n)for(const u of l)u.errors.forEach(zP(e,n)),u.warnings.forEach(zP(e,n));return l.length>0?l:Object.assign([],{empty:!0},a.streamInfo())}function Pde({onApplied:e}){const[t,n]=x.useState(""),[r,i]=x.useState(!1),[a,l]=x.useState([]),[u,d]=x.useState([]),f=async()=>{if(!t.trim())return;i(!0),l([]),d([]);const p=Tde(t),m=[],g=[];for(let v=0;v<p.length;v++){const j=p[v];if(j.errors.length>0){m.push(`Document ${v+1}: ${j.errors[0]?.message}`);continue}const b=j.toJSON();if(!(!b||typeof b!="object"))try{const S=await _V(b);g.push(`Applied "${S.displayName||S.name}" (revision ${S.configRevision})`)}catch(S){m.push(`Document ${v+1}: ${S instanceof Error?S.message:String(S)}`)}}l(g),d(m),i(!1),g.length>0&&(vt({title:"YAML applied",detail:`Applied ${g.length} document${g.length===1?"":"s"} successfully.`,tone:m.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return s.jsxs("section",{className:"mt-8",children:[s.jsx("div",{className:"page-section-divider"}),s.jsx("div",{className:"section-head mt-6",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),s.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),s.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",s.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",s.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),s.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
247
+ kind: Project
248
+ metadata:
249
+ name: my-project
250
+ spec:
251
+ canonicalDomain: example.com
252
+ country: US
253
+ language: en
254
+ queries: []`,value:t,onChange:p=>n(p.target.value)}),a.length>0&&s.jsx("ul",{className:"mt-2 space-y-1",children:a.map((p,m)=>s.jsx("li",{className:"text-emerald-400 text-sm",children:p},m))}),u.length>0&&s.jsx("ul",{className:"mt-2 space-y-1",children:u.map((p,m)=>s.jsx("li",{className:"text-rose-400 text-sm",children:p},m))}),s.jsx("div",{className:"mt-3",children:s.jsx(be,{type:"button",disabled:!t.trim()||r,onClick:f,children:r?"Applying...":"Apply"})})]})}function Rde(){const{dashboard:e,isLoading:t,refetch:n}=wc();if(!e||t)return s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-28"}),s.jsx("div",{className:"skeleton-text-sm w-40"})]}),s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[s.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(_=>s.jsx("div",{className:"skeleton-text-sm w-16"},_))}),[1,2,3].map(_=>s.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[s.jsxs("div",{className:"flex-1 space-y-1",children:[s.jsx("div",{className:"skeleton-text w-28"}),s.jsx("div",{className:"skeleton-text-sm w-16"})]}),s.jsx("div",{className:"skeleton-text w-24"}),s.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),s.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),s.jsx("div",{className:"skeleton-text-sm w-8"})]},_))]})]});const r=e.projects,i=Wo(),[a,l]=x.useState(!1),[u,d]=x.useState(""),[f,p]=x.useState(""),[m,g]=x.useState(""),[v,j]=x.useState("US"),[b,S]=x.useState("en"),[k,E]=x.useState(!1),[C,A]=x.useState(null),T=u.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),O=async()=>{if(!(!T||!m)){E(!0),A(null);try{const _=await Av(T,{displayName:f||u,canonicalDomain:m,country:v,language:b});vt({title:"Project created",detail:`${_.displayName||_.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${_.name}`,dedupeMode:"drop"}),n(),d(""),p(""),g(""),j("US"),S("en"),l(!1),i({to:"/projects/$projectId",params:{projectId:_.id}})}catch(_){A(_ instanceof Error?_.message:"Failed to create project")}finally{E(!1)}}};return s.jsxs("div",{className:"page-container",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Projects"}),s.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),s.jsx("div",{className:"page-header-right",children:s.jsxs(be,{type:"button",onClick:()=>l(_=>!_),children:[s.jsx(_2,{className:"size-4 mr-1.5"}),"Add project"]})})]}),a?s.jsxs($e,{className:"surface-card mb-6",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),s.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),s.jsxs("div",{className:"compact-stack mt-4",children:[s.jsxs("div",{className:"setup-field-row",children:[s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),s.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:u,onChange:_=>d(_.target.value)}),T&&T!==u?s.jsxs("p",{className:"supporting-copy",children:["Slug: ",T]}):null]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),s.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:f,onChange:_=>p(_.target.value)})]})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),s.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:m,onChange:_=>g(_.target.value)})]}),s.jsxs("div",{className:"setup-field-row",children:[s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),s.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:v,onChange:_=>j(_.target.value.toUpperCase())})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),s.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:b,onChange:_=>S(_.target.value.toLowerCase())})]})]})]}),C?s.jsx("p",{className:"text-rose-400 text-sm mt-3",children:C}):null,s.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[s.jsx(be,{type:"button",disabled:!T||!m||k,onClick:O,children:k?"Creating...":"Create project"}),s.jsx(be,{type:"button",variant:"ghost",onClick:()=>l(!1),children:"Cancel"})]})]}):null,r.length>0?s.jsx("div",{className:"data-table-wrapper",children:s.jsxs("table",{className:"data-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Domain"}),s.jsx("th",{children:"Visibility"}),s.jsx("th",{children:"Last run"}),s.jsx("th",{className:"text-right",children:"Country"})]})}),s.jsx("tbody",{children:r.map(_=>{const P=_.recentRuns[0];return s.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:_.project.id}}),children:[s.jsxs("td",{children:[s.jsx(Yt,{to:"/projects/$projectId",params:{projectId:_.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:$=>$.stopPropagation(),children:_.project.displayName||_.project.name}),s.jsx("p",{className:"text-[11px] text-zinc-500",children:_.project.name})]}),s.jsx("td",{className:"text-zinc-400",children:_.project.canonicalDomain}),s.jsx("td",{children:s.jsx(Xe,{tone:_.visibilitySummary.tone,children:_.visibilitySummary.value})}),s.jsx("td",{className:"text-zinc-500 text-sm",children:P?s.jsx(Mv,{status:P.status}):s.jsx("span",{className:"text-zinc-600",children:"No runs"})}),s.jsx("td",{className:"text-right text-zinc-500",children:_.project.country})]},_.project.id)})})]})}):a?null:s.jsxs($e,{className:"surface-card empty-card",children:[s.jsx("h3",{children:"No projects yet"}),s.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),s.jsxs(be,{type:"button",onClick:()=>l(!0),children:[s.jsx(_2,{className:"size-4 mr-1.5"}),"Add project"]})]}),s.jsx(Pde,{onApplied:()=>{n()}})]})}function k1({state:e,label:t}){return s.jsx(Xe,{tone:qte(e),children:t??Pv(e)})}function OB({run:e}){const{openRun:t}=vd();return s.jsxs("article",{className:"run-row",children:[s.jsxs("div",{className:"run-row-main",children:[s.jsxs("div",{className:"run-row-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"run-row-title",children:e.summary}),s.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),s.jsx(Mv,{status:e.status})]}),s.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),s.jsxs("dl",{className:"run-row-meta",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:e.startedAt})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Duration"}),s.jsx("dd",{children:e.duration})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Trigger"}),s.jsx("dd",{children:e.triggerLabel})]})]}),s.jsx(be,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function Dde({value:e,label:t,delta:n,tone:r,description:i,tooltip:a,isNumeric:l=!0,progress:u,providerCoverage:d}){const m=2*Math.PI*48,g=Number.parseInt(e,10),v=typeof u=="number"&&Number.isFinite(u)?Math.min(Math.max(u,0),100)/100:l&&!Number.isNaN(g)?Math.min(g/100,1):.5,j=m*(1-v);return s.jsxs("div",{className:"score-gauge",children:[s.jsxs("div",{className:"gauge-ring-wrapper",children:[s.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[s.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),s.jsx("circle",{className:`gauge-fill gauge-fill-${r}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:m,strokeDashoffset:j,transform:"rotate(-90 60 60)"})]}),s.jsx("div",{className:"gauge-center",children:s.jsx("span",{className:l?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),s.jsxs("p",{className:"gauge-label",children:[t,a&&s.jsx(pr,{text:a})]}),s.jsx("p",{className:"gauge-delta",children:n}),d&&s.jsx("p",{className:"gauge-provider-coverage",children:d}),s.jsx("p",{className:"gauge-description",children:i})]})}function IP({history:e,maxDots:t=12}){const n=e.slice(-t);if(n.length===0)return s.jsx("span",{className:"text-[11px] text-zinc-600",children:"No data"});const r={cited:"bg-emerald-400","not-cited":"bg-zinc-600",lost:"bg-rose-400",emerging:"bg-amber-400 ring-1 ring-amber-300/60"},i=new Date(n[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),a=new Date(n[n.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:i}),s.jsx("div",{className:"flex items-center gap-[3px]",title:`${n.length} runs`,children:n.map((l,u)=>s.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[l.citationState]??"bg-zinc-700"} ${l.model&&u>0&&n[u-1]?.model&&n[u-1].model!==l.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[l.citationState,new Date(l.createdAt).toLocaleDateString(),l.model?`model ${l.model}`:null,l.model&&u>0&&n[u-1]?.model&&n[u-1].model!==l.model?"model changed":null].filter(Boolean).join(" — ")},u))}),s.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:a})]})}function Mde(e){const t=new Map;for(const r of e)for(const i of r.runHistory){const a=t.get(i.createdAt);a?a.states.push(i.citationState):t.set(i.createdAt,{states:[i.citationState],runId:i.runId})}return[...t.entries()].sort(([r],[i])=>r.localeCompare(i)).map(([r,{states:i,runId:a}])=>({runId:a,createdAt:r,citationState:i.includes("cited")?"cited":i.includes("emerging")?"emerging":"not-cited"}))}function LP(e,t){return t==="citations"?e.citationState:e.visibilityState==="pending"||e.answerMentioned==null&&e.visibilityState==null?"pending":e.visibilityState==="visible"||e.answerMentioned===!0?"cited":"not-cited"}function $P(e,t){if(t==="mentions")switch(e){case"cited":return"Mentioned";case"not-cited":return"Not Mentioned";case"pending":return"Pending";case"emerging":return"Newly Mentioned";case"lost":return"No Longer Mentioned"}switch(e){case"cited":return"Cited";case"not-cited":return"Not Cited";case"lost":return"Lost";case"emerging":return"Emerging";case"pending":return"Pending"}}function BP(e,t){const n=t==="mentions"?"mentioned":"cited",r=t==="mentions"?"Mentioned":"Cited";if(e.length===0)return"Awaiting first run";if(e.length===1)return"First observation";const i=e[e.length-1].citationState,a=e[e.length-2].citationState;if(a!=="cited"&&i==="cited")return`Newly ${n}`;if(a==="cited"&&i!=="cited")return"Lost since last run";let l=0;for(let u=e.length-1;u>=0&&e[u].citationState===i;u--)l++;return i==="cited"?l<=1?`${r} in latest run`:`${r} for ${l} runs`:l<=1?`Not ${n} in latest run`:`Not ${n} across ${l} runs`}function Ide(e,t){return t==="citations"?e:e.map(n=>({...n,citationState:LP(n,t),runHistory:n.runHistory.map(r=>({...r,citationState:LP(r,t)}))}))}function Lde({evidence:e}){const{openEvidence:t}=vd(),[n,r]=x.useState(new Set),[i,a]=x.useState("citations"),l=x.useMemo(()=>{const m=Ide(e,i),g=new Map;for(const v of m){const j=g.get(v.query)??[];g.set(v.query,[...j,v])}return[...g.entries()].map(([v,j])=>({phrase:v,items:j}))},[e,i]),u=m=>{r(g=>{const v=new Set(g);return v.has(m)?v.delete(m):v.add(m),v})},d=i==="mentions"?"mentioned":"cited",f=i==="mentions"?"Mention History":"Citation History",p=i==="mentions"?"mentioned":"cited";return s.jsxs("div",{children:[s.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"View by"}),s.jsxs("div",{className:"inline-flex gap-0.5 p-0.5 rounded-md bg-zinc-900/60 border border-zinc-800/40",role:"tablist","aria-label":"Citation tracking view",children:[s.jsx("button",{type:"button",role:"tab","aria-selected":i==="citations",className:`px-2.5 py-1 text-xs font-medium rounded transition-colors ${i==="citations"?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,onClick:()=>a("citations"),children:"Citations"}),s.jsx("button",{type:"button",role:"tab","aria-selected":i==="mentions",className:`px-2.5 py-1 text-xs font-medium rounded transition-colors ${i==="mentions"?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,onClick:()=>a("mentions"),children:"Mentions"})]}),s.jsx("span",{className:"text-[11px] text-zinc-500",children:i==="mentions"?"Brand or domain in answer text":"Brand or domain in source links"})]}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:{width:"2rem"}}),s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:f}),s.jsx("th",{children:"Change"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:l.map(({phrase:m,items:g})=>{const v=n.has(m),j=g.map(C=>C.citationState),b=j.includes("cited")?"cited":j.includes("emerging")?"emerging":j.includes("lost")?"lost":j.every(C=>C==="pending")?"pending":"not-cited",S=Mde(g),k=g.filter(C=>C.citationState===Ju.cited||C.citationState==="emerging").length,E=BP(S,i);return s.jsxs(x.Fragment,{children:[s.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>u(m),"aria-expanded":v,children:[s.jsx("td",{children:s.jsx(Hh,{size:14,className:`transition-transform duration-150 text-zinc-500 ${v?"rotate-90":""}`})}),s.jsx("td",{className:"evidence-query-cell",children:s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-zinc-100",children:m}),s.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:g.map(C=>s.jsx(rc,{provider:C.provider},C.id))})]})}),s.jsx("td",{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(k1,{state:b,label:$P(b,i)}),s.jsxs("span",{className:"text-[11px] text-zinc-500",title:`${k} of ${g.length} engines ${p}`,children:[k,"/",g.length]})]})}),s.jsx("td",{children:s.jsx(IP,{history:S})}),s.jsx("td",{className:"evidence-change-cell",children:E}),s.jsx("td",{})]}),v&&g.map(C=>s.jsxs("tr",{className:"bg-zinc-900/30",children:[s.jsx("td",{}),s.jsx("td",{className:"evidence-query-cell pl-5",children:s.jsx(rc,{provider:C.provider})}),s.jsx("td",{children:s.jsx(k1,{state:C.citationState,label:$P(C.citationState,i)})}),s.jsx("td",{children:s.jsx(IP,{history:C.runHistory})}),s.jsx("td",{className:"evidence-change-cell",children:BP(C.runHistory,i)}),s.jsx("td",{children:s.jsx(be,{variant:"ghost",size:"sm",type:"button",onClick:A=>{A.stopPropagation(),t(C.id)},children:"View"})})]},C.id))]},m)})})]})}),s.jsxs("p",{className:"sr-only","aria-live":"polite",children:["Showing ",d==="cited"?"citations (sources)":"mentions (answer text)","."]})]})}function $de({competitors:e}){return e.length===0?s.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):s.jsx("div",{className:"competitor-table-wrap",children:s.jsxs("table",{className:"competitor-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Domain"}),s.jsx("th",{children:"Pressure"}),s.jsx("th",{children:"Citations"}),s.jsx("th",{children:"Queries"})]})}),s.jsx("tbody",{children:e.map(t=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),s.jsx("td",{children:s.jsx(Xe,{tone:Fte(t.pressureLabel),children:t.pressureLabel})}),s.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalQueries>0?`${t.citationCount} / ${t.totalQueries}`:"—"}),s.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedQueries.length>0?t.citedQueries.join(", "):"Not cited"})]},t.id))})]})})}function UP({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:a,coverageValue:l,note:u,updatedAt:d,active:f,onClick:p}){return s.jsxs("button",{type:"button",onClick:p,className:`surface-card w-full text-left transition-colors ${f?"border-zinc-200 bg-zinc-900/50":"hover:border-zinc-700 hover:bg-zinc-900/40"}`,children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),s.jsx("h3",{children:t})]}),s.jsx(Xe,{tone:r,children:n})]}),s.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:i}),s.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:a})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:l})]})]}),s.jsxs("div",{className:"mt-3 flex flex-col gap-1 text-xs text-zinc-500 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("span",{children:u}),s.jsx("span",{children:d?`Updated ${sa(d)}`:"No recent sync yet"})]})]})}function cg({label:e,value:t,tone:n}){const r=n==="positive"?"text-emerald-400":n==="negative"?"text-rose-400":"text-zinc-200";return s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),s.jsx("p",{className:`mt-2 text-2xl font-semibold ${r}`,children:t})]})}var Bde=["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 Wk(e){if(typeof e!="string")return!1;var t=Bde;return t.includes(e)}var Ude=["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"],qde=new Set(Ude);function EB(e){return typeof e!="string"?!1:qde.has(e)}function _B(e){return typeof e=="string"&&e.startsWith("data-")}function gi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(EB(n)||_B(n))&&(t[n]=e[n]);return t}function Jh(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return gi(t)}return typeof e=="object"&&!Array.isArray(e)?gi(e):null}function kr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(EB(n)||_B(n)||Wk(n))&&(t[n]=e[n]);return t}function Fde(e){return e==null?null:x.isValidElement(e)?kr(e.props):typeof e=="object"&&!Array.isArray(e)?kr(e):null}var Hde=["children","width","height","viewBox","className","style","title","desc"];function C1(){return C1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C1.apply(null,arguments)}function Kde(e,t){if(e==null)return{};var n,r,i=Gde(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Gde(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 Yk=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:l,style:u,title:d,desc:f}=e,p=Kde(e,Hde),m=a||{width:r,height:i,x:0,y:0},g=Ot("recharts-surface",l);return x.createElement("svg",C1({},kr(p),{className:g,width:r,height:i,style:u,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height),ref:t}),x.createElement("title",null,d),x.createElement("desc",null,f),n)}),Vde=["children","className"];function A1(){return A1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A1.apply(null,arguments)}function Qde(e,t){if(e==null)return{};var n,r,i=Wde(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Wde(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var gr=x.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Qde(e,Vde),a=Ot("recharts-layer",r);return x.createElement("g",A1({className:a},kr(i),{ref:t}),n)}),zB=x.createContext(null),Yde=()=>x.useContext(zB);function Zt(e){return function(){return e}}const TB=Math.cos,xy=Math.sin,va=Math.sqrt,by=Math.PI,rx=2*by,O1=Math.PI,E1=2*O1,Tl=1e-6,Zde=E1-Tl;function PB(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Xde(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return PB;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Jde{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?PB:Xde(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+l}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let l=this._x1,u=this._y1,d=r-t,f=i-n,p=l-t,m=u-n,g=p*p+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>Tl)if(!(Math.abs(m*d-f*p)>Tl)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-l,j=i-u,b=d*d+f*f,S=v*v+j*j,k=Math.sqrt(b),E=Math.sqrt(g),C=a*Math.tan((O1-Math.acos((b+g-S)/(2*k*E)))/2),A=C/E,T=C/k;Math.abs(A-1)>Tl&&this._append`L${t+A*p},${n+A*m}`,this._append`A${a},${a},0,0,${+(m*v>p*j)},${this._x1=t+T*d},${this._y1=n+T*f}`}}arc(t,n,r,i,a,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let u=r*Math.cos(i),d=r*Math.sin(i),f=t+u,p=n+d,m=1^l,g=l?i-a:a-i;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>Tl||Math.abs(this._y1-p)>Tl)&&this._append`L${f},${p}`,r&&(g<0&&(g=g%E1+E1),g>Zde?this._append`A${r},${r},0,1,${m},${t-u},${n-d}A${r},${r},0,1,${m},${this._x1=f},${this._y1=p}`:g>Tl&&this._append`A${r},${r},0,${+(g>=O1)},${m},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Zk(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 Jde(t)}function Xk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function RB(e){this._context=e}RB.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 ix(e){return new RB(e)}function DB(e){return e[0]}function MB(e){return e[1]}function IB(e,t){var n=Zt(!0),r=null,i=ix,a=null,l=Zk(u);e=typeof e=="function"?e:e===void 0?DB:Zt(e),t=typeof t=="function"?t:t===void 0?MB:Zt(t);function u(d){var f,p=(d=Xk(d)).length,m,g=!1,v;for(r==null&&(a=i(v=l())),f=0;f<=p;++f)!(f<p&&n(m=d[f],f,d))===g&&((g=!g)?a.lineStart():a.lineEnd()),g&&a.point(+e(m,f,d),+t(m,f,d));if(v)return a=null,v+""||null}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Zt(+d),u):e},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Zt(+d),u):t},u.defined=function(d){return arguments.length?(n=typeof d=="function"?d:Zt(!!d),u):n},u.curve=function(d){return arguments.length?(i=d,r!=null&&(a=i(r)),u):i},u.context=function(d){return arguments.length?(d==null?r=a=null:a=i(r=d),u):r},u}function ug(e,t,n){var r=null,i=Zt(!0),a=null,l=ix,u=null,d=Zk(f);e=typeof e=="function"?e:e===void 0?DB:Zt(+e),t=typeof t=="function"?t:Zt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?MB:Zt(+n);function f(m){var g,v,j,b=(m=Xk(m)).length,S,k=!1,E,C=new Array(b),A=new Array(b);for(a==null&&(u=l(E=d())),g=0;g<=b;++g){if(!(g<b&&i(S=m[g],g,m))===k)if(k=!k)v=g,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),j=g-1;j>=v;--j)u.point(C[j],A[j]);u.lineEnd(),u.areaEnd()}k&&(C[g]=+e(S,g,m),A[g]=+t(S,g,m),u.point(r?+r(S,g,m):C[g],n?+n(S,g,m):A[g]))}if(E)return u=null,E+""||null}function p(){return IB().defined(i).curve(l).context(a)}return f.x=function(m){return arguments.length?(e=typeof m=="function"?m:Zt(+m),r=null,f):e},f.x0=function(m){return arguments.length?(e=typeof m=="function"?m:Zt(+m),f):e},f.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:Zt(+m),f):r},f.y=function(m){return arguments.length?(t=typeof m=="function"?m:Zt(+m),n=null,f):t},f.y0=function(m){return arguments.length?(t=typeof m=="function"?m:Zt(+m),f):t},f.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:Zt(+m),f):n},f.lineX0=f.lineY0=function(){return p().x(e).y(t)},f.lineY1=function(){return p().x(e).y(n)},f.lineX1=function(){return p().x(r).y(t)},f.defined=function(m){return arguments.length?(i=typeof m=="function"?m:Zt(!!m),f):i},f.curve=function(m){return arguments.length?(l=m,a!=null&&(u=l(a)),f):l},f.context=function(m){return arguments.length?(m==null?a=u=null:u=l(a=m),f):a},f}class LB{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 efe(e){return new LB(e,!0)}function tfe(e){return new LB(e,!1)}const Jk={draw(e,t){const n=va(t/by);e.moveTo(n,0),e.arc(0,0,n,0,rx)}},nfe={draw(e,t){const n=va(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()}},$B=va(1/3),rfe=$B*2,ife={draw(e,t){const n=va(t/rfe),r=n*$B;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},afe={draw(e,t){const n=va(t),r=-n/2;e.rect(r,r,n,n)}},sfe=.8908130915292852,BB=xy(by/10)/xy(7*by/10),ofe=xy(rx/10)*BB,lfe=-TB(rx/10)*BB,cfe={draw(e,t){const n=va(t*sfe),r=ofe*n,i=lfe*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const l=rx*a/5,u=TB(l),d=xy(l);e.lineTo(d*n,-u*n),e.lineTo(u*r-d*i,d*r+u*i)}e.closePath()}},ej=va(3),ufe={draw(e,t){const n=-va(t/(ej*3));e.moveTo(0,n*2),e.lineTo(-ej*n,-n),e.lineTo(ej*n,-n),e.closePath()}},Pi=-.5,Ri=va(3)/2,_1=1/va(12),dfe=(_1/2+1)*3,ffe={draw(e,t){const n=va(t/dfe),r=n/2,i=n*_1,a=r,l=n*_1+n,u=-a,d=l;e.moveTo(r,i),e.lineTo(a,l),e.lineTo(u,d),e.lineTo(Pi*r-Ri*i,Ri*r+Pi*i),e.lineTo(Pi*a-Ri*l,Ri*a+Pi*l),e.lineTo(Pi*u-Ri*d,Ri*u+Pi*d),e.lineTo(Pi*r+Ri*i,Pi*i-Ri*r),e.lineTo(Pi*a+Ri*l,Pi*l-Ri*a),e.lineTo(Pi*u+Ri*d,Pi*d-Ri*u),e.closePath()}};function hfe(e,t){let n=null,r=Zk(i);e=typeof e=="function"?e:Zt(e||Jk),t=typeof t=="function"?t:Zt(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Zt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Zt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function wy(){}function jy(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 UB(e){this._context=e}UB.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:jy(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:jy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pfe(e){return new UB(e)}function qB(e){this._context=e}qB.prototype={areaStart:wy,areaEnd:wy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:jy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function mfe(e){return new qB(e)}function FB(e){this._context=e}FB.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:jy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function gfe(e){return new FB(e)}function HB(e){this._context=e}HB.prototype={areaStart:wy,areaEnd:wy,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function yfe(e){return new HB(e)}function qP(e){return e<0?-1:1}function FP(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),u=(a*i+l*r)/(r+i);return(qP(a)+qP(l))*Math.min(Math.abs(a),Math.abs(l),.5*Math.abs(u))||0}function HP(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function tj(e,t,n){var r=e._x0,i=e._y0,a=e._x1,l=e._y1,u=(a-r)/3;e._context.bezierCurveTo(r+u,i+u*t,a-u,l-u*n,a,l)}function Sy(e){this._context=e}Sy.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:tj(this,this._t0,HP(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,tj(this,HP(this,n=FP(this,e,t)),n);break;default:tj(this,this._t0,n=FP(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function KB(e){this._context=new GB(e)}(KB.prototype=Object.create(Sy.prototype)).point=function(e,t){Sy.prototype.point.call(this,t,e)};function GB(e){this._context=e}GB.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function vfe(e){return new Sy(e)}function xfe(e){return new KB(e)}function VB(e){this._context=e}VB.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=KP(e),i=KP(t),a=0,l=1;l<n;++a,++l)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[l],t[l]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function KP(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),l=new Array(n);for(i[0]=0,a[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(l[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function bfe(e){return new VB(e)}function ax(e,t){this._context=e,this._t=t}ax.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 wfe(e){return new ax(e,.5)}function jfe(e){return new ax(e,0)}function Sfe(e){return new ax(e,1)}function sc(e,t){if((l=e.length)>1)for(var n=1,r,i,a=e[t[0]],l,u=a.length;n<l;++n)for(i=a,a=e[t[n]],r=0;r<u;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function z1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Nfe(e,t){return e[t]}function kfe(e){const t=[];return t.key=e,t}function Cfe(){var e=Zt([]),t=z1,n=sc,r=Nfe;function i(a){var l=Array.from(e.apply(this,arguments),kfe),u,d=l.length,f=-1,p;for(const m of a)for(u=0,++f;u<d;++u)(l[u][f]=[0,+r(m,l[u].key,f,a)]).data=m;for(u=0,p=Xk(t(l));u<d;++u)l[p[u]].index=u;return n(l,p),l}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Zt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Zt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?z1:typeof a=="function"?a:Zt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??sc,i):n},i}function Afe(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,l;i<a;++i){for(l=n=0;n<r;++n)l+=e[n][i][1]||0;if(l)for(n=0;n<r;++n)e[n][i][1]/=l}sc(e,t)}}function Ofe(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var l=0,u=0;l<i;++l)u+=e[l][n][1]||0;r[n][1]+=r[n][0]=-u/2}sc(e,t)}}function Efe(e,t){if(!(!((l=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,l;r<a;++r){for(var u=0,d=0,f=0;u<l;++u){for(var p=e[t[u]],m=p[r][1]||0,g=p[r-1][1]||0,v=(m-g)/2,j=0;j<u;++j){var b=e[t[j]],S=b[r][1]||0,k=b[r-1][1]||0;v+=S-k}d+=m,f+=v*m}i[r-1][1]+=i[r-1][0]=n,d&&(n-=f/d)}i[r-1][1]+=i[r-1][0]=n,sc(e,t)}}var nj={},rj={},GP;function _fe(){return GP||(GP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(rj)),rj}var ij={},VP;function QB(){return VP||(VP=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})(ij)),ij}var aj={},QP;function eC(){return QP||(QP=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})(aj)),aj}var sj={},oj={},WP;function zfe(){return WP||(WP=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})(oj)),oj}var YP;function tC(){return YP||(YP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zfe(),n=eC();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],l=i.length;if(l===0)return a;let u=0,d="",f="",p=!1;for(i.charCodeAt(0)===46&&(a.push(""),u++);u<l;){const m=i[u];f?m==="\\"&&u+1<l?(u++,d+=i[u]):m===f?f="":d+=m:p?m==='"'||m==="'"?f=m:m==="]"?(p=!1,a.push(d),d=""):d+=m:m==="["?(p=!0,d&&(a.push(d),d="")):m==="."?d&&(a.push(d),d=""):d+=m,u++}return d&&a.push(d),a}e.toPath=r})(sj)),sj}var ZP;function nC(){return ZP||(ZP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_fe(),n=QB(),r=eC(),i=tC();function a(u,d,f){if(u==null)return f;switch(typeof d){case"string":{if(t.isUnsafeProperty(d))return f;const p=u[d];return p===void 0?n.isDeepKey(d)?a(u,i.toPath(d),f):f:p}case"number":case"symbol":{typeof d=="number"&&(d=r.toKey(d));const p=u[d];return p===void 0?f:p}default:{if(Array.isArray(d))return l(u,d,f);if(Object.is(d?.valueOf(),-0)?d="-0":d=String(d),t.isUnsafeProperty(d))return f;const p=u[d];return p===void 0?f:p}}}function l(u,d,f){if(d.length===0)return f;let p=u;for(let m=0;m<d.length;m++){if(p==null||t.isUnsafeProperty(d[m]))return f;p=p[d[m]]}return p===void 0?f:p}e.get=a})(nj)),nj}var lj,XP;function Tfe(){return XP||(XP=1,lj=nC().get),lj}var Pfe=Tfe();const nd=ma(Pfe);var Rfe=4;function Do(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Rfe,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function kn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,l)=>{var u=n[l-1];return typeof u=="string"?i+u+a:u!==void 0?i+Do(u)+a:i+a},"")}var Wr=e=>e===0?0:e>0?1:-1,fa=e=>typeof e=="number"&&e!=+e,oc=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Te=e=>(typeof e=="number"||e instanceof Number)&&!fa(e),Fa=e=>Te(e)||typeof e=="string",Dfe=0,Ah=e=>{var t=++Dfe;return"".concat(e||"").concat(t)},ha=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Te(t)&&typeof t!="string")return r;var a;if(oc(t)){if(n==null)return r;var l=t.indexOf("%");a=n*parseFloat(t.slice(0,l))/100}else a=+t;return fa(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},WB=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Ft(e,t,n){return Te(e)&&Te(t)?Do(e+n*(t-e)):t}function YB(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):nd(r,t))===n)}var on=e=>e===null||typeof e>"u",ep=e=>on(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Yr(e){return e!=null}function el(){}var Mfe=["type","size","sizeType"];function T1(){return T1=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},T1.apply(null,arguments)}function JP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function eR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JP(Object(n),!0).forEach(function(r){Ife(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ife(e,t,n){return(t=Lfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lfe(e){var t=$fe(e,"string");return typeof t=="symbol"?t:t+""}function $fe(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 Bfe(e,t){if(e==null)return{};var n,r,i=Ufe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ufe(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 ZB={symbolCircle:Jk,symbolCross:nfe,symbolDiamond:ife,symbolSquare:afe,symbolStar:cfe,symbolTriangle:ufe,symbolWye:ffe},qfe=Math.PI/180,Ffe=e=>{var t="symbol".concat(ep(e));return ZB[t]||Jk},Hfe=(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*qfe;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}},Kfe=(e,t)=>{ZB["symbol".concat(ep(e))]=t},rC=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=Bfe(e,Mfe),a=eR(eR({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var u=()=>{var g=Ffe(l),v=hfe().type(g).size(Hfe(n,r,l)),j=v();if(j!==null)return j},{className:d,cx:f,cy:p}=a,m=kr(a);return Te(f)&&Te(p)&&Te(n)?x.createElement("path",T1({},m,{className:Ot("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};rC.registerSymbol=Kfe;var XB=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,iC=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(x.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{Wk(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},Gfe=(e,t,n)=>r=>(e(t,n,r),null),sx=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];Wk(i)&&typeof a=="function"&&(r||(r={}),r[i]=Gfe(a,t,n))}),r};function tR(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 Vfe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tR(Object(n),!0).forEach(function(r){Qfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qfe(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=Yfe(e,"string");return typeof t=="symbol"?t:t+""}function Yfe(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 tr(e,t){var n=Vfe({},e),r=t,i=Object.keys(t),a=i.reduce((l,u)=>(l[u]===void 0&&r[u]!==void 0&&(l[u]=r[u]),l),n);return a}function Ny(){return Ny=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ny.apply(null,arguments)}function nR(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 JB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nR(Object(n),!0).forEach(function(r){Zfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zfe(e,t,n){return(t=Xfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xfe(e){var t=Jfe(e,"string");return typeof t=="symbol"?t:t+""}function Jfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mi=32,ehe={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function the(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function nhe(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Mi/2,a=Mi/6,l=Mi/3,u=t.inactive?r:t.color,d=n??t.type;if(d==="none")return null;if(d==="plainline")return x.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:the(t.payload),x1:0,y1:i,x2:Mi,y2:i,className:"recharts-legend-icon"});if(d==="line")return x.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(i,"h").concat(l,`
255
+ A`).concat(a,",").concat(a,",0,1,1,").concat(2*l,",").concat(i,`
256
+ H`).concat(Mi,"M").concat(2*l,",").concat(i,`
257
+ A`).concat(a,",").concat(a,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(d==="rect")return x.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(Mi/8,"h").concat(Mi,"v").concat(Mi*3/4,"h").concat(-Mi,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var f=JB({},t);return delete f.legendIcon,x.cloneElement(t.legendIcon,f)}return x.createElement(rC,{fill:u,cx:i,cy:i,size:Mi,sizeType:"diameter",type:d})}function rhe(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:l,labelStyle:u}=e,d={x:0,y:0,width:Mi,height:Mi},f={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((m,g)=>{var v=m.formatter||i,j=Ot({"recharts-legend-item":!0,["legend-item-".concat(g)]:!0,inactive:m.inactive});if(m.type==="none")return null;var b=typeof u=="object"?JB({},u):{};b.color=m.inactive?a:b.color||m.color;var S=v?v(m.value,m,g):m.value;return x.createElement("li",Ny({className:j,style:f,key:"legend-item-".concat(g)},sx(e,m,g)),x.createElement(Yk,{width:n,height:n,viewBox:d,style:p,"aria-label":"".concat(m.value," legend icon")},x.createElement(nhe,{data:m,iconType:l,inactiveColor:a})),x.createElement("span",{className:"recharts-legend-item-text",style:b},S))})}var ihe=e=>{var t=tr(e,ehe),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return x.createElement("ul",{className:"recharts-default-legend",style:a},x.createElement(rhe,Ny({},t,{payload:n})))},cj={},uj={},rR;function ahe(){return rR||(rR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a<n.length;a++){const l=n[a],u=r(l,a,n);i.has(u)||i.set(u,l)}return Array.from(i.values())}e.uniqBy=t})(uj)),uj}var dj={},iR;function she(){return iR||(iR=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})(dj)),dj}var fj={},aR;function e6(){return aR||(aR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(fj)),fj}var hj={},pj={},mj={},sR;function ohe(){return sR||(sR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(mj)),mj}var oR;function t6(){return oR||(oR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ohe();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(pj)),pj}var gj={},lR;function lhe(){return lR||(lR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(gj)),gj}var cR;function che(){return cR||(cR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=t6(),n=lhe();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(hj)),hj}var yj={},vj={},uR;function uhe(){return uR||(uR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nC();function n(r){return function(i){return t.get(i,r)}}e.property=n})(vj)),vj}var xj={},bj={},wj={},jj={},dR;function n6(){return dR||(dR=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})(jj)),jj}var Sj={},fR;function r6(){return fR||(fR=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})(Sj)),Sj}var Nj={},hR;function i6(){return hR||(hR=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})(Nj)),Nj}var pR;function dhe(){return pR||(pR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=n6(),n=r6(),r=i6();function i(p,m,g){return typeof g!="function"?i(p,m,()=>{}):a(p,m,function v(j,b,S,k,E,C){const A=g(j,b,S,k,E,C);return A!==void 0?!!A:a(j,b,v,C)},new Map)}function a(p,m,g,v){if(m===p)return!0;switch(typeof m){case"object":return l(p,m,g,v);case"function":return Object.keys(m).length>0?a(p,{...m},g,v):r.isEqualsSameValueZero(p,m);default:return t.isObject(p)?typeof m=="string"?m==="":!0:r.isEqualsSameValueZero(p,m)}}function l(p,m,g,v){if(m==null)return!0;if(Array.isArray(m))return d(p,m,g,v);if(m instanceof Map)return u(p,m,g,v);if(m instanceof Set)return f(p,m,g,v);const j=Object.keys(m);if(p==null||n.isPrimitive(p))return j.length===0;if(j.length===0)return!0;if(v?.has(m))return v.get(m)===p;v?.set(m,p);try{for(let b=0;b<j.length;b++){const S=j[b];if(!n.isPrimitive(p)&&!(S in p)||m[S]===void 0&&p[S]!==void 0||m[S]===null&&p[S]!==null||!g(p[S],m[S],S,p,m,v))return!1}return!0}finally{v?.delete(m)}}function u(p,m,g,v){if(m.size===0)return!0;if(!(p instanceof Map))return!1;for(const[j,b]of m.entries()){const S=p.get(j);if(g(S,b,j,p,m,v)===!1)return!1}return!0}function d(p,m,g,v){if(m.length===0)return!0;if(!Array.isArray(p))return!1;const j=new Set;for(let b=0;b<m.length;b++){const S=m[b];let k=!1;for(let E=0;E<p.length;E++){if(j.has(E))continue;const C=p[E];let A=!1;if(g(C,S,b,p,m,v)&&(A=!0),A){j.add(E),k=!0;break}}if(!k)return!1}return!0}function f(p,m,g,v){return m.size===0?!0:p instanceof Set?d([...p],[...m],g,v):!1}e.isMatchWith=i,e.isSetMatch=f})(wj)),wj}var mR;function a6(){return mR||(mR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=dhe();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(bj)),bj}var kj={},Cj={},Aj={},gR;function fhe(){return gR||(gR=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})(Aj)),Aj}var Oj={},yR;function aC(){return yR||(yR=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})(Oj)),Oj}var Ej={},vR;function s6(){return vR||(vR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",l="[object Symbol]",u="[object Date]",d="[object Map]",f="[object Set]",p="[object Array]",m="[object Function]",g="[object ArrayBuffer]",v="[object Object]",j="[object Error]",b="[object DataView]",S="[object Uint8Array]",k="[object Uint8ClampedArray]",E="[object Uint16Array]",C="[object Uint32Array]",A="[object BigUint64Array]",T="[object Int8Array]",O="[object Int16Array]",_="[object Int32Array]",P="[object BigInt64Array]",$="[object Float32Array]",F="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=g,e.arrayTag=p,e.bigInt64ArrayTag=P,e.bigUint64ArrayTag=A,e.booleanTag=i,e.dataViewTag=b,e.dateTag=u,e.errorTag=j,e.float32ArrayTag=$,e.float64ArrayTag=F,e.functionTag=m,e.int16ArrayTag=O,e.int32ArrayTag=_,e.int8ArrayTag=T,e.mapTag=d,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=f,e.stringTag=n,e.symbolTag=l,e.uint16ArrayTag=E,e.uint32ArrayTag=C,e.uint8ArrayTag=S,e.uint8ClampedArrayTag=k})(Ej)),Ej}var _j={},xR;function hhe(){return xR||(xR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(_j)),_j}var bR;function o6(){return bR||(bR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fhe(),n=aC(),r=s6(),i=r6(),a=hhe();function l(p,m){return u(p,void 0,p,new Map,m)}function u(p,m,g,v=new Map,j=void 0){const b=j?.(p,m,g,v);if(b!==void 0)return b;if(i.isPrimitive(p))return p;if(v.has(p))return v.get(p);if(Array.isArray(p)){const S=new Array(p.length);v.set(p,S);for(let k=0;k<p.length;k++)S[k]=u(p[k],k,g,v,j);return Object.hasOwn(p,"index")&&(S.index=p.index),Object.hasOwn(p,"input")&&(S.input=p.input),S}if(p instanceof Date)return new Date(p.getTime());if(p instanceof RegExp){const S=new RegExp(p.source,p.flags);return S.lastIndex=p.lastIndex,S}if(p instanceof Map){const S=new Map;v.set(p,S);for(const[k,E]of p)S.set(k,u(E,k,g,v,j));return S}if(p instanceof Set){const S=new Set;v.set(p,S);for(const k of p)S.add(u(k,void 0,g,v,j));return S}if(typeof Buffer<"u"&&Buffer.isBuffer(p))return p.subarray();if(a.isTypedArray(p)){const S=new(Object.getPrototypeOf(p)).constructor(p.length);v.set(p,S);for(let k=0;k<p.length;k++)S[k]=u(p[k],k,g,v,j);return S}if(p instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&p instanceof SharedArrayBuffer)return p.slice(0);if(p instanceof DataView){const S=new DataView(p.buffer.slice(0),p.byteOffset,p.byteLength);return v.set(p,S),d(S,p,g,v,j),S}if(typeof File<"u"&&p instanceof File){const S=new File([p],p.name,{type:p.type});return v.set(p,S),d(S,p,g,v,j),S}if(typeof Blob<"u"&&p instanceof Blob){const S=new Blob([p],{type:p.type});return v.set(p,S),d(S,p,g,v,j),S}if(p instanceof Error){const S=structuredClone(p);return v.set(p,S),S.message=p.message,S.name=p.name,S.stack=p.stack,S.cause=p.cause,S.constructor=p.constructor,d(S,p,g,v,j),S}if(p instanceof Boolean){const S=new Boolean(p.valueOf());return v.set(p,S),d(S,p,g,v,j),S}if(p instanceof Number){const S=new Number(p.valueOf());return v.set(p,S),d(S,p,g,v,j),S}if(p instanceof String){const S=new String(p.valueOf());return v.set(p,S),d(S,p,g,v,j),S}if(typeof p=="object"&&f(p)){const S=Object.create(Object.getPrototypeOf(p));return v.set(p,S),d(S,p,g,v,j),S}return p}function d(p,m,g=p,v,j){const b=[...Object.keys(m),...t.getSymbols(m)];for(let S=0;S<b.length;S++){const k=b[S],E=Object.getOwnPropertyDescriptor(p,k);(E==null||E.writable)&&(p[k]=u(m[k],k,g,v,j))}}function f(p){switch(n.getTag(p)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=l,e.cloneDeepWithImpl=u,e.copyProperties=d})(Cj)),Cj}var wR;function phe(){return wR||(wR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=o6();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(kj)),kj}var jR;function mhe(){return jR||(jR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=a6(),n=phe();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(xj)),xj}var zj={},Tj={},Pj={},SR;function ghe(){return SR||(SR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=o6(),n=aC(),r=s6();function i(a,l){return t.cloneDeepWith(a,(u,d,f,p)=>{const m=l?.(u,d,f,p);if(m!==void 0)return m;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const g={};return p.set(a,g),t.copyProperties(g,a,f,p),g}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const g=new a.constructor(a?.valueOf());return t.copyProperties(g,a),g}case r.argumentsTag:{const g={};return t.copyProperties(g,a),g.length=a.length,g[Symbol.iterator]=a[Symbol.iterator],g}default:return}}})}e.cloneDeepWith=i})(Pj)),Pj}var NR;function yhe(){return NR||(NR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ghe();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(Tj)),Tj}var Rj={},Dj={},kR;function l6(){return kR||(kR=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})(Dj)),Dj}var Mj={},CR;function vhe(){return CR||(CR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=aC();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(Mj)),Mj}var AR;function xhe(){return AR||(AR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=QB(),n=l6(),r=vhe(),i=tC();function a(l,u){let d;if(Array.isArray(u)?d=u:typeof u=="string"&&t.isDeepKey(u)&&l?.[u]==null?d=i.toPath(u):d=[u],d.length===0)return!1;let f=l;for(let p=0;p<d.length;p++){const m=d[p];if((f==null||!Object.hasOwn(f,m))&&!((Array.isArray(f)||r.isArguments(f))&&n.isIndex(m)&&m<f.length))return!1;f=f[m]}return!0}e.has=a})(Rj)),Rj}var OR;function bhe(){return OR||(OR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=a6(),n=eC(),r=yhe(),i=nC(),a=xhe();function l(u,d){switch(typeof u){case"object":{Object.is(u?.valueOf(),-0)&&(u="-0");break}case"number":{u=n.toKey(u);break}}return d=r.cloneDeep(d),function(f){const p=i.get(f,u);return p===void 0?a.has(f,u):d===void 0?p===void 0:t.isMatch(p,d)}}e.matchesProperty=l})(zj)),zj}var ER;function whe(){return ER||(ER=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=e6(),n=uhe(),r=mhe(),i=bhe();function a(l){if(l==null)return t.identity;switch(typeof l){case"function":return l;case"object":return Array.isArray(l)&&l.length===2?i.matchesProperty(l[0],l[1]):r.matches(l);case"string":case"symbol":case"number":return n.property(l)}}e.iteratee=a})(yj)),yj}var _R;function jhe(){return _R||(_R=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ahe(),n=she(),r=e6(),i=che(),a=whe();function l(u,d=r.identity){return i.isArrayLikeObject(u)?t.uniqBy(Array.from(u),n.ary(a.iteratee(d),1)):[]}e.uniqBy=l})(cj)),cj}var Ij,zR;function She(){return zR||(zR=1,Ij=jhe().uniqBy),Ij}var Nhe=She();const TR=ma(Nhe);function c6(e,t,n){return t===!0?TR(e,n):typeof t=="function"?TR(e,t):e}var sC=x.createContext(null),khe=e=>e,ln=()=>{var e=x.useContext(sC);return e?e.store.dispatch:khe},qg=()=>{},Che=()=>qg,Ahe=(e,t)=>e===t;function Ue(e){var t=x.useContext(sC),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:qg,[t,e]);return w5.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Che,t?t.store.getState:qg,t?t.store.getState:qg,n,Ahe)}function Ohe(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Ehe(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function _he(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 PR=e=>Array.isArray(e)?e:[e];function zhe(e){const t=Array.isArray(e[0])?e[0]:e;return _he(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function The(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Phe=class{constructor(e){this.value=e}deref(){return this.value}},Rhe=typeof WeakRef<"u"?WeakRef:Phe,Dhe=0,RR=1;function dg(){return{s:Dhe,v:void 0,o:null,p:null}}function u6(e,t={}){let n=dg();const{resultEqualityCheck:r}=t;let i,a=0;function l(){let u=n;const{length:d}=arguments;for(let m=0,g=d;m<g;m++){const v=arguments[m];if(typeof v=="function"||typeof v=="object"&&v!==null){let j=u.o;j===null&&(u.o=j=new WeakMap);const b=j.get(v);b===void 0?(u=dg(),j.set(v,u)):u=b}else{let j=u.p;j===null&&(u.p=j=new Map);const b=j.get(v);b===void 0?(u=dg(),j.set(v,u)):u=b}}const f=u;let p;if(u.s===RR)p=u.v;else if(p=e.apply(null,arguments),a++,r){const m=i?.deref?.()??i;m!=null&&r(m,p)&&(p=m,a!==0&&a--),i=typeof p=="object"&&p!==null||typeof p=="function"?new Rhe(p):p}return f.s=RR,f.v=p,p}return l.clearCache=()=>{n=dg(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function Mhe(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,l=0,u,d={},f=i.pop();typeof f=="object"&&(d=f,f=i.pop()),Ohe(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p={...n,...d},{memoize:m,memoizeOptions:g=[],argsMemoize:v=u6,argsMemoizeOptions:j=[]}=p,b=PR(g),S=PR(j),k=zhe(i),E=m(function(){return a++,f.apply(null,arguments)},...b),C=v(function(){l++;const T=The(k,arguments);return u=E.apply(null,T),u},...S);return Object.assign(C,{resultFunc:f,memoizedResultFunc:E,dependencies:k,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var re=Mhe(u6),Ihe=Object.assign((e,t=re)=>{Ehe(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((l,u,d)=>(l[n[d]]=u,l),{}))},{withTypes:()=>Ihe}),Lj={},$j={},Bj={},DR;function Lhe(){return DR||(DR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,a)=>{if(r!==i){const l=t(r),u=t(i);if(l===u&&l===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?u-l:l-u}return 0};e.compareValues=n})(Bj)),Bj}var Uj={},qj={},MR;function d6(){return MR||(MR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(qj)),qj}var IR;function $he(){return IR||(IR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=d6(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,l){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(r.test(a)||!n.test(a))||l!=null&&Object.hasOwn(l,a)}e.isKey=i})(Uj)),Uj}var LR;function Bhe(){return LR||(LR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Lhe(),n=$he(),r=tC();function i(a,l,u,d){if(a==null)return[];u=d?void 0:u,Array.isArray(a)||(a=Object.values(a)),Array.isArray(l)||(l=l==null?[null]:[l]),l.length===0&&(l=[null]),Array.isArray(u)||(u=u==null?[]:[u]),u=u.map(v=>String(v));const f=(v,j)=>{let b=v;for(let S=0;S<j.length&&b!=null;++S)b=b[j[S]];return b},p=(v,j)=>j==null||v==null?j:typeof v=="object"&&"key"in v?Object.hasOwn(j,v.key)?j[v.key]:f(j,v.path):typeof v=="function"?v(j):Array.isArray(v)?f(j,v):typeof j=="object"?j[v]:j,m=l.map(v=>(Array.isArray(v)&&v.length===1&&(v=v[0]),v==null||typeof v=="function"||Array.isArray(v)||n.isKey(v)?v:{key:v,path:r.toPath(v)}));return a.map(v=>({original:v,criteria:m.map(j=>p(j,v))})).slice().sort((v,j)=>{for(let b=0;b<m.length;b++){const S=t.compareValues(v.criteria[b],j.criteria[b],u[b]);if(S!==0)return S}return 0}).map(v=>v.original)}e.orderBy=i})($j)),$j}var Fj={},$R;function Uhe(){return $R||($R=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),l=(u,d)=>{for(let f=0;f<u.length;f++){const p=u[f];Array.isArray(p)&&d<a?l(p,d+1):i.push(p)}};return l(n,0),i}e.flatten=t})(Fj)),Fj}var Hj={},BR;function f6(){return BR||(BR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=l6(),n=t6(),r=n6(),i=i6();function a(l,u,d){return r.isObject(d)&&(typeof u=="number"&&n.isArrayLike(d)&&t.isIndex(u)&&u<d.length||typeof u=="string"&&u in d)?i.isEqualsSameValueZero(d[u],l):!1}e.isIterateeCall=a})(Hj)),Hj}var UR;function qhe(){return UR||(UR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bhe(),n=Uhe(),r=f6();function i(a,...l){const u=l.length;return u>1&&r.isIterateeCall(a,l[0],l[1])?l=[]:u>2&&r.isIterateeCall(l[0],l[1],l[2])&&(l=[l[0]]),t.orderBy(a,n.flatten(l),["asc"])}e.sortBy=i})(Lj)),Lj}var Kj,qR;function Fhe(){return qR||(qR=1,Kj=qhe().sortBy),Kj}var Hhe=Fhe();const ox=ma(Hhe);var h6=e=>e.legend.settings,Khe=e=>e.legend.size,Ghe=e=>e.legend.payload,Vhe=re([Ghe,h6],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?ox(r,n):r});function Qhe(){return Ue(Vhe)}var fg=1;function p6(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=x.useState({height:0,left:0,top:0,width:0}),r=x.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),l={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(l.height-t.height)>fg||Math.abs(l.left-t.left)>fg||Math.abs(l.top-t.top)>fg||Math.abs(l.width-t.width)>fg)&&n({height:l.height,left:l.left,top:l.top,width:l.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function dr(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Whe=typeof Symbol=="function"&&Symbol.observable||"@@observable",FR=Whe,Gj=()=>Math.random().toString(36).substring(7).split("").join("."),Yhe={INIT:`@@redux/INIT${Gj()}`,REPLACE:`@@redux/REPLACE${Gj()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Gj()}`},ky=Yhe;function oC(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function m6(e,t,n){if(typeof e!="function")throw new Error(dr(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(dr(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(dr(1));return n(m6)(e,t)}let r=e,i=t,a=new Map,l=a,u=0,d=!1;function f(){l===a&&(l=new Map,a.forEach((S,k)=>{l.set(k,S)}))}function p(){if(d)throw new Error(dr(3));return i}function m(S){if(typeof S!="function")throw new Error(dr(4));if(d)throw new Error(dr(5));let k=!0;f();const E=u++;return l.set(E,S),function(){if(k){if(d)throw new Error(dr(6));k=!1,f(),l.delete(E),a=null}}}function g(S){if(!oC(S))throw new Error(dr(7));if(typeof S.type>"u")throw new Error(dr(8));if(typeof S.type!="string")throw new Error(dr(17));if(d)throw new Error(dr(9));try{d=!0,i=r(i,S)}finally{d=!1}return(a=l).forEach(E=>{E()}),S}function v(S){if(typeof S!="function")throw new Error(dr(10));r=S,g({type:ky.REPLACE})}function j(){const S=m;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(dr(11));function E(){const A=k;A.next&&A.next(p())}return E(),{unsubscribe:S(E)}},[FR](){return this}}}return g({type:ky.INIT}),{dispatch:g,subscribe:m,getState:p,replaceReducer:v,[FR]:j}}function Zhe(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:ky.INIT})>"u")throw new Error(dr(12));if(typeof n(void 0,{type:ky.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(dr(13))})}function g6(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const l=t[a];typeof e[l]=="function"&&(n[l]=e[l])}const r=Object.keys(n);let i;try{Zhe(n)}catch(a){i=a}return function(l={},u){if(i)throw i;let d=!1;const f={};for(let p=0;p<r.length;p++){const m=r[p],g=n[m],v=l[m],j=g(v,u);if(typeof j>"u")throw u&&u.type,new Error(dr(14));f[m]=j,d=d||j!==v}return d=d||r.length!==Object.keys(l).length,d?f:l}}function Cy(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Xhe(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(dr(15))};const l={getState:i.getState,dispatch:(d,...f)=>a(d,...f)},u=e.map(d=>d(l));return a=Cy(...u)(i.dispatch),{...i,dispatch:a}}}function y6(e){return oC(e)&&"type"in e&&typeof e.type=="string"}var v6=Symbol.for("immer-nothing"),HR=Symbol.for("immer-draftable"),Ir=Symbol.for("immer-state");function oa(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var pi=Object,rd=pi.getPrototypeOf,Ay="constructor",lx="prototype",P1="configurable",Oy="enumerable",Fg="writable",Oh="value",zs=e=>!!e&&!!e[Ir];function pa(e){return e?x6(e)||ux(e)||!!e[HR]||!!e[Ay]?.[HR]||dx(e)||fx(e):!1}var Jhe=pi[lx][Ay].toString(),KR=new WeakMap;function x6(e){if(!e||!lC(e))return!1;const t=rd(e);if(t===null||t===pi[lx])return!0;const n=pi.hasOwnProperty.call(t,Ay)&&t[Ay];if(n===Object)return!0;if(!Cu(n))return!1;let r=KR.get(n);return r===void 0&&(r=Function.toString.call(n),KR.set(n,r)),r===Jhe}function cx(e,t,n=!0){tp(e)===0?(n?Reflect.ownKeys(e):pi.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function tp(e){const t=e[Ir];return t?t.type_:ux(e)?1:dx(e)?2:fx(e)?3:0}var GR=(e,t,n=tp(e))=>n===2?e.has(t):pi[lx].hasOwnProperty.call(e,t),R1=(e,t,n=tp(e))=>n===2?e.get(t):e[t],Ey=(e,t,n,r=tp(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function epe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ux=Array.isArray,dx=e=>e instanceof Map,fx=e=>e instanceof Set,lC=e=>typeof e=="object",Cu=e=>typeof e=="function",Vj=e=>typeof e=="boolean";function tpe(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var bs=e=>e.copy_||e.base_,cC=e=>e.modified_?e.copy_:e.base_;function D1(e,t){if(dx(e))return new Map(e);if(fx(e))return new Set(e);if(ux(e))return Array[lx].slice.call(e);const n=x6(e);if(t===!0||t==="class_only"&&!n){const r=pi.getOwnPropertyDescriptors(e);delete r[Ir];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],u=r[l];u[Fg]===!1&&(u[Fg]=!0,u[P1]=!0),(u.get||u.set)&&(r[l]={[P1]:!0,[Fg]:!0,[Oy]:u[Oy],[Oh]:e[l]})}return pi.create(rd(e),r)}else{const r=rd(e);if(r!==null&&n)return{...e};const i=pi.create(r);return pi.assign(i,e)}}function uC(e,t=!1){return hx(e)||zs(e)||!pa(e)||(tp(e)>1&&pi.defineProperties(e,{set:hg,add:hg,clear:hg,delete:hg}),pi.freeze(e),t&&cx(e,(n,r)=>{uC(r,!0)},!1)),e}function npe(){oa(2)}var hg={[Oh]:npe};function hx(e){return e===null||!lC(e)?!0:pi.isFrozen(e)}var _y="MapSet",M1="Patches",VR="ArrayMethods",b6={};function lc(e){const t=b6[e];return t||oa(0,e),t}var QR=e=>!!b6[e],Eh,w6=()=>Eh,rpe=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:QR(_y)?lc(_y):void 0,arrayMethodsPlugin_:QR(VR)?lc(VR):void 0});function WR(e,t){t&&(e.patchPlugin_=lc(M1),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function I1(e){L1(e),e.drafts_.forEach(ipe),e.drafts_=null}function L1(e){e===Eh&&(Eh=e.parent_)}var YR=e=>Eh=rpe(Eh,e);function ipe(e){const t=e[Ir];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ZR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Ir].modified_&&(I1(t),oa(4)),pa(e)&&(e=XR(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Ir].base_,e,t)}else e=XR(t,n);return ape(t,e,!0),I1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==v6?e:void 0}function XR(e,t){if(hx(t))return t;const n=t[Ir];if(!n)return zy(t,e.handledSet_,e);if(!px(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);N6(n,e)}return n.copy_}function ape(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&uC(t,n)}function j6(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var px=(e,t)=>e.scope_===t,spe=[];function S6(e,t,n,r){const i=bs(e),a=e.type_;if(r!==void 0&&R1(i,r,a)===t){Ey(i,r,n,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;cx(i,(d,f)=>{if(zs(f)){const p=u.get(f)||[];p.push(d),u.set(f,p)}})}const l=e.draftLocations_.get(t)??spe;for(const u of l)Ey(i,u,n,a)}function ope(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!px(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const l=cC(a);S6(e,a.draft_??a,l,n),N6(a,i)})}function N6(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)}j6(e)}}function lpe(e,t,n){const{scope_:r}=e;if(zs(n)){const i=n[Ir];px(i,r)&&i.callbacks_.push(function(){Hg(e);const l=cC(i);S6(e,n,l,t)})}else pa(n)&&e.callbacks_.push(function(){const a=bs(e);e.type_===3?a.has(n)&&zy(n,r.handledSet_,r):R1(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&zy(R1(e.copy_,t,e.type_),r.handledSet_,r)})}function zy(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||zs(e)||t.has(e)||!pa(e)||hx(e)||(t.add(e),cx(e,(r,i)=>{if(zs(i)){const a=i[Ir];if(px(a,n)){const l=cC(a);Ey(e,r,l,e.type_),j6(a)}}else pa(i)&&zy(i,t,n)})),e}function cpe(e,t){const n=ux(e),r={type_:n?1:0,scope_:t?t.scope_:w6(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,a=Ty;n&&(i=[r],a=_h);const{revoke:l,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=l,[u,r]}var Ty={get(e,t){if(t===Ir)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=bs(e);if(!GR(i,t,e.type_))return upe(e,i,t);const a=i[t];if(e.finalized_||!pa(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&tpe(t))return a;if(a===Qj(e.base_,t)){Hg(e);const l=e.type_===1?+t:t,u=B1(e.scope_,a,e,l);return e.copy_[l]=u}return a},has(e,t){return t in bs(e)},ownKeys(e){return Reflect.ownKeys(bs(e))},set(e,t,n){const r=k6(bs(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Qj(bs(e),t),a=i?.[Ir];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(epe(n,i)&&(n!==void 0||GR(e.base_,t,e.type_)))return!0;Hg(e),$1(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),lpe(e,t,n)),!0},deleteProperty(e,t){return Hg(e),Qj(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),$1(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=bs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Fg]:!0,[P1]:e.type_!==1||t!=="length",[Oy]:r[Oy],[Oh]:n[t]}},defineProperty(){oa(11)},getPrototypeOf(e){return rd(e.base_)},setPrototypeOf(){oa(12)}},_h={};for(let e in Ty){let t=Ty[e];_h[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}_h.deleteProperty=function(e,t){return _h.set.call(this,e,t,void 0)};_h.set=function(e,t,n){return Ty.set.call(this,e[0],t,n,e[0])};function Qj(e,t){const n=e[Ir];return(n?bs(n):e)[t]}function upe(e,t,n){const r=k6(t,n);return r?Oh in r?r[Oh]:r.get?.call(e.draft_):void 0}function k6(e,t){if(!(t in e))return;let n=rd(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=rd(n)}}function $1(e){e.modified_||(e.modified_=!0,e.parent_&&$1(e.parent_))}function Hg(e){e.copy_||(e.assigned_=new Map,e.copy_=D1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var dpe=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Cu(n)&&!Cu(r)){const l=r;r=n;const u=this;return function(f=l,...p){return u.produce(f,m=>r.call(this,m,...p))}}Cu(r)||oa(6),i!==void 0&&!Cu(i)&&oa(7);let a;if(pa(n)){const l=YR(this),u=B1(l,n,void 0);let d=!0;try{a=r(u),d=!1}finally{d?I1(l):L1(l)}return WR(l,i),ZR(a,l)}else if(!n||!lC(n)){if(a=r(n),a===void 0&&(a=n),a===v6&&(a=void 0),this.autoFreeze_&&uC(a,!0),i){const l=[],u=[];lc(M1).generateReplacementPatches_(n,a,{patches_:l,inversePatches_:u}),i(l,u)}return a}else oa(1,n)},this.produceWithPatches=(n,r)=>{if(Cu(n))return(u,...d)=>this.produceWithPatches(u,f=>n(f,...d));let i,a;return[this.produce(n,r,(u,d)=>{i=u,a=d}),i,a]},Vj(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Vj(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Vj(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){pa(t)||oa(8),zs(t)&&(t=Ui(t));const n=YR(this),r=B1(n,t,void 0);return r[Ir].isManual_=!0,L1(n),r}finishDraft(t,n){const r=t&&t[Ir];(!r||!r.isManual_)&&oa(9);const{scope_:i}=r;return WR(i,n),ZR(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=lc(M1).applyPatches_;return zs(t)?i(t,n):this.produce(t,a=>i(a,n))}};function B1(e,t,n,r){const[i,a]=dx(t)?lc(_y).proxyMap_(t,n):fx(t)?lc(_y).proxySet_(t,n):cpe(t,n);return(n?.scope_??w6()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?ope(n,a,r):a.callbacks_.push(function(d){d.mapSetPlugin_?.fixSetContents(a);const{patchPlugin_:f}=d;a.modified_&&f&&f.generatePatches_(a,[],d)}),i}function Ui(e){return zs(e)||oa(10,e),C6(e)}function C6(e){if(!pa(e)||hx(e))return e;const t=e[Ir];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=D1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=D1(e,!0);return cx(n,(i,a)=>{Ey(n,i,C6(a))},r),t&&(t.finalized_=!1),n}var fpe=new dpe,A6=fpe.produce;function O6(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var hpe=O6(),ppe=O6,mpe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Cy:Cy.apply(null,arguments)};function yi(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(mi(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>y6(r)&&r.type===e,n}var E6=class th extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,th.prototype)}static get[Symbol.species](){return th}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new th(...t[0].concat(this)):new th(...t.concat(this))}};function JR(e){return pa(e)?A6(e,()=>{}):e}function pg(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function gpe(e){return typeof e=="boolean"}var ype=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let l=new E6;return n&&(gpe(n)?l.push(hpe):l.push(ppe(n.extraArgument))),l},_6="RTK_autoBatch",an=()=>e=>({payload:e,meta:{[_6]:!0}}),eD=e=>t=>{setTimeout(t,e)},z6=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,l=!1;const u=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:eD(10):e.type==="callback"?e.queueNotification:eD(e.timeout),f=()=>{l=!1,a&&(a=!1,u.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const m=()=>i&&p(),g=r.subscribe(m);return u.add(p),()=>{g(),u.delete(p)}},dispatch(p){try{return i=!p?.meta?.[_6],a=!i,a&&(l||(l=!0,d(f))),r.dispatch(p)}finally{i=!0}}})},vpe=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new E6(e);return r&&i.push(z6(typeof r=="object"?r:void 0)),i};function xpe(e){const t=ype(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:l=void 0}=e||{};let u;if(typeof n=="function")u=n;else if(oC(n))u=g6(n);else throw new Error(mi(1));let d;typeof r=="function"?d=r(t):d=t();let f=Cy;i&&(f=mpe({trace:!1,...typeof i=="object"&&i}));const p=Xhe(...d),m=vpe(p);let g=typeof l=="function"?l(m):m();const v=f(...g);return m6(u,a,v)}function T6(e){const t={},n=[];let r;const i={addCase(a,l){const u=typeof a=="string"?a:a.type;if(!u)throw new Error(mi(28));if(u in t)throw new Error(mi(29));return t[u]=l,i},addAsyncThunk(a,l){return l.pending&&(t[a.pending.type]=l.pending),l.rejected&&(t[a.rejected.type]=l.rejected),l.fulfilled&&(t[a.fulfilled.type]=l.fulfilled),l.settled&&n.push({matcher:a.settled,reducer:l.settled}),i},addMatcher(a,l){return n.push({matcher:a,reducer:l}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function bpe(e){return typeof e=="function"}function wpe(e,t){let[n,r,i]=T6(t),a;if(bpe(e))a=()=>JR(e());else{const u=JR(e);a=()=>u}function l(u=a(),d){let f=[n[d.type],...r.filter(({matcher:p})=>p(d)).map(({reducer:p})=>p)];return f.filter(p=>!!p).length===0&&(f=[i]),f.reduce((p,m)=>{if(m)if(zs(p)){const v=m(p,d);return v===void 0?p:v}else{if(pa(p))return A6(p,g=>m(g,d));{const g=m(p,d);if(g===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}}return p},u)}return l.getInitialState=a,l}var jpe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Spe=(e=21)=>{let t="",n=e;for(;n--;)t+=jpe[Math.random()*64|0];return t},Npe=Symbol.for("rtk-slice-createasyncthunk");function kpe(e,t){return`${e}/${t}`}function Cpe({creators:e}={}){const t=e?.asyncThunk?.[Npe];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(mi(11));const l=(typeof r.reducers=="function"?r.reducers(Ope()):r.reducers)||{},u=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(C,A){const T=typeof C=="string"?C:C.type;if(!T)throw new Error(mi(12));if(T in d.sliceCaseReducersByType)throw new Error(mi(13));return d.sliceCaseReducersByType[T]=A,f},addMatcher(C,A){return d.sliceMatchers.push({matcher:C,reducer:A}),f},exposeAction(C,A){return d.actionCreators[C]=A,f},exposeCaseReducer(C,A){return d.sliceCaseReducersByName[C]=A,f}};u.forEach(C=>{const A=l[C],T={reducerName:C,type:kpe(i,C),createNotation:typeof r.reducers=="function"};_pe(A)?Tpe(T,A,f,t):Epe(T,A,f)});function p(){const[C={},A=[],T=void 0]=typeof r.extraReducers=="function"?T6(r.extraReducers):[r.extraReducers],O={...C,...d.sliceCaseReducersByType};return wpe(r.initialState,_=>{for(let P in O)_.addCase(P,O[P]);for(let P of d.sliceMatchers)_.addMatcher(P.matcher,P.reducer);for(let P of A)_.addMatcher(P.matcher,P.reducer);T&&_.addDefaultCase(T)})}const m=C=>C,g=new Map,v=new WeakMap;let j;function b(C,A){return j||(j=p()),j(C,A)}function S(){return j||(j=p()),j.getInitialState()}function k(C,A=!1){function T(_){let P=_[C];return typeof P>"u"&&A&&(P=pg(v,T,S)),P}function O(_=m){const P=pg(g,A,()=>new WeakMap);return pg(P,_,()=>{const $={};for(const[F,U]of Object.entries(r.selectors??{}))$[F]=Ape(U,_,()=>pg(v,_,S),A);return $})}return{reducerPath:C,getSelectors:O,get selectors(){return O(T)},selectSlice:T}}const E={name:i,reducer:b,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:S,...k(a),injectInto(C,{reducerPath:A,...T}={}){const O=A??a;return C.inject({reducerPath:O,reducer:b},T),{...E,...k(O,!0)}}};return E}}function Ape(e,t,n,r){function i(a,...l){let u=t(a);return typeof u>"u"&&r&&(u=n()),e(u,...l)}return i.unwrapped=e,i}var Or=Cpe();function Ope(){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 Epe({type:e,reducerName:t,createNotation:n},r,i){let a,l;if("reducer"in r){if(n&&!zpe(r))throw new Error(mi(17));a=r.reducer,l=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,l?yi(e,l):yi(e))}function _pe(e){return e._reducerDefinitionType==="asyncThunk"}function zpe(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Tpe({type:e,reducerName:t},n,r,i){if(!i)throw new Error(mi(18));const{payloadCreator:a,fulfilled:l,pending:u,rejected:d,settled:f,options:p}=n,m=i(e,a,p);r.exposeAction(t,m),l&&r.addCase(m.fulfilled,l),u&&r.addCase(m.pending,u),d&&r.addCase(m.rejected,d),f&&r.addMatcher(m.settled,f),r.exposeCaseReducer(t,{fulfilled:l||mg,pending:u||mg,rejected:d||mg,settled:f||mg})}function mg(){}var Ppe="task",P6="listener",R6="completed",dC="cancelled",Rpe=`task-${dC}`,Dpe=`task-${R6}`,U1=`${P6}-${dC}`,Mpe=`${P6}-${R6}`,mx=class{constructor(e){this.code=e,this.message=`${Ppe} ${dC} (reason: ${e})`}name="TaskAbortError";message},fC=(e,t)=>{if(typeof e!="function")throw new TypeError(mi(32))},Py=()=>{},D6=(e,t=Py)=>(e.catch(t),e),M6=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Wl=e=>{if(e.aborted)throw new mx(e.reason)};function I6(e,t){let n=Py;return new Promise((r,i)=>{const a=()=>i(new mx(e.reason));if(e.aborted){a();return}n=M6(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Py})}var Ipe=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof mx?"cancelled":"rejected",error:n}}finally{t?.()}},Ry=e=>t=>D6(I6(e,t).then(n=>(Wl(e),n))),L6=e=>{const t=Ry(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Fu}=Object,tD={},gx="listenerMiddleware",Lpe=(e,t)=>{const n=r=>M6(e,()=>r.abort(e.reason));return(r,i)=>{fC(r);const a=new AbortController;n(a);const l=Ipe(async()=>{Wl(e),Wl(a.signal);const u=await r({pause:Ry(a.signal),delay:L6(a.signal),signal:a.signal});return Wl(a.signal),u},()=>a.abort(Dpe));return i?.autoJoin&&t.push(l.catch(Py)),{result:Ry(e)(l),cancel(){a.abort(Rpe)}}}},$pe=(e,t)=>{const n=async(r,i)=>{Wl(t);let a=()=>{};const u=[new Promise((d,f)=>{let p=e({predicate:r,effect:(m,g)=>{g.unsubscribe(),d([m,g.getState(),g.getOriginalState()])}});a=()=>{p(),f()}})];i!=null&&u.push(new Promise(d=>setTimeout(d,i,null)));try{const d=await I6(t,Promise.race(u));return Wl(t),d}finally{a()}};return(r,i)=>D6(n(r,i))},$6=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=yi(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(mi(21));return fC(a),{predicate:i,type:t,effect:a}},B6=Fu(e=>{const{type:t,predicate:n,effect:r}=$6(e);return{id:Spe(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(mi(22))}}},{withTypes:()=>B6}),nD=(e,t)=>{const{type:n,effect:r,predicate:i}=$6(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},q1=e=>{e.pending.forEach(t=>{t.abort(U1)})},Bpe=(e,t)=>()=>{for(const n of t.keys())q1(n);e.clear()},rD=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},U6=Fu(yi(`${gx}/add`),{withTypes:()=>U6}),Upe=yi(`${gx}/removeAll`),q6=Fu(yi(`${gx}/remove`),{withTypes:()=>q6}),qpe=(...e)=>{console.error(`${gx}/error`,...e)},np=(e={})=>{const t=new Map,n=new Map,r=v=>{const j=n.get(v)??0;n.set(v,j+1)},i=v=>{const j=n.get(v)??1;j===1?n.delete(v):n.set(v,j-1)},{extra:a,onError:l=qpe}=e;fC(l);const u=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),j=>{v.unsubscribe(),j?.cancelActive&&q1(v)}),d=v=>{const j=nD(t,v)??B6(v);return u(j)};Fu(d,{withTypes:()=>d});const f=v=>{const j=nD(t,v);return j&&(j.unsubscribe(),v.cancelActive&&q1(j)),!!j};Fu(f,{withTypes:()=>f});const p=async(v,j,b,S)=>{const k=new AbortController,E=$pe(d,k.signal),C=[];try{v.pending.add(k),r(v),await Promise.resolve(v.effect(j,Fu({},b,{getOriginalState:S,condition:(A,T)=>E(A,T).then(Boolean),take:E,delay:L6(k.signal),pause:Ry(k.signal),extra:a,signal:k.signal,fork:Lpe(k.signal,C),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((A,T,O)=>{A!==k&&(A.abort(U1),O.delete(A))})},cancel:()=>{k.abort(U1),v.pending.delete(k)},throwIfCancelled:()=>{Wl(k.signal)}})))}catch(A){A instanceof mx||rD(l,A,{raisedBy:"effect"})}finally{await Promise.all(C),k.abort(Mpe),i(v),v.pending.delete(k)}},m=Bpe(t,n);return{middleware:v=>j=>b=>{if(!y6(b))return j(b);if(U6.match(b))return d(b.payload);if(Upe.match(b)){m();return}if(q6.match(b))return f(b.payload);let S=v.getState();const k=()=>{if(S===tD)throw new Error(mi(23));return S};let E;try{if(E=j(b),t.size>0){const C=v.getState(),A=Array.from(t.values());for(const T of A){let O=!1;try{O=T.predicate(b,C,S)}catch(_){O=!1,rD(l,_,{raisedBy:"predicate"})}O&&p(T,b,v,k)}}}finally{S=tD}return E},startListening:d,stopListening:f,clearListeners:m}};function mi(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Fpe={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},F6=Or({name:"chartLayout",initialState:Fpe,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,a;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:Hpe,setLayout:Kpe,setChartSize:Gpe,setScale:Vpe}=F6.actions,Qpe=F6.reducer;function H6(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function ht(e){return Number.isFinite(e)}function Ha(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function iD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iD(Object(n),!0).forEach(function(r){Wpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wpe(e,t,n){return(t=Ype(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ype(e){var t=Zpe(e,"string");return typeof t=="symbol"?t:t+""}function Zpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vn(e,t,n){return on(e)||on(t)?n:Fa(t)?nd(e,t,n):typeof t=="function"?t(e):n}var Xpe=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:l,layout:u}=t;if((u==="vertical"||u==="horizontal"&&l==="middle")&&a!=="center"&&Te(e[a]))return Tu(Tu({},e),{},{[a]:e[a]+(r||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&l!=="middle"&&Te(e[l]))return Tu(Tu({},e),{},{[l]:e[l]+(i||0)})}return e},xa=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",K6=(e,t,n,r)=>{if(r)return e.map(u=>u.coordinate);var i,a,l=e.map(u=>(u.coordinate===t&&(i=!0),u.coordinate===n&&(a=!0),u.coordinate));return i||l.push(t),a||l.push(n),l},G6=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:l,realScaleType:u,isCategorical:d,categoricalDomain:f,tickCount:p,ticks:m,niceTicks:g,axisType:v}=e;if(!l)return null;var j=u==="scaleBand"&&l.bandwidth?l.bandwidth()/2:2,b=i==="category"&&l.bandwidth?l.bandwidth()/j:0;if(b=v==="angleAxis"&&a&&a.length>=2?Wr(a[0]-a[1])*2*b:b,m||g){var S=(m||g||[]).map((k,E)=>{var C=r?r.indexOf(k):k,A=l.map(C);return ht(A)?{coordinate:A+b,value:k,offset:b,index:E}:null}).filter(Yr);return S}return d&&f?f.map((k,E)=>{var C=l.map(k);return ht(C)?{coordinate:C+b,value:k,index:E,offset:b}:null}).filter(Yr):l.ticks&&p!=null?l.ticks(p).map((k,E)=>{var C=l.map(k);return ht(C)?{coordinate:C+b,value:k,index:E,offset:b}:null}).filter(Yr):l.domain().map((k,E)=>{var C=l.map(k);return ht(C)?{coordinate:C+b,value:r?r[k]:k,index:E,offset:b}:null}).filter(Yr)},Jpe=(e,t)=>{if(!t||t.length!==2||!Te(t[0])||!Te(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Te(e[0])||e[0]<n)&&(i[0]=n),(!Te(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},eme=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,l=0,u=0;u<n;++u){var d=e[u],f=d?.[i];if(f!=null){var p=f[1],m=f[0],g=fa(p)?m:p;g>=0?(f[0]=a,a+=g,f[1]=a):(f[0]=l,l+=g,f[1]=l)}}}},tme=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,l=0;l<n;++l){var u=e[l],d=u?.[i];if(d!=null){var f=fa(d[1])?d[0]:d[1];f>=0?(d[0]=a,a+=f,d[1]=a):(d[0]=0,d[1]=0)}}}},nme={sign:eme,expand:Afe,none:sc,silhouette:Ofe,wiggle:Efe,positive:tme},rme=(e,t,n)=>{var r,i=(r=nme[n])!==null&&r!==void 0?r:sc,a=Cfe().keys(t).value((u,d)=>Number(vn(u,d,0))).order(z1).offset(i),l=a(e);return l.forEach((u,d)=>{u.forEach((f,p)=>{var m=vn(e[p],t[d],0);Array.isArray(m)&&m.length===2&&Te(m[0])&&Te(m[1])&&(f[0]=m[0],f[1]=m[1])})}),l};function V6(e){return e==null?void 0:String(e)}function Dy(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:l}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!on(i[t.dataKey])){var u=YB(n,"value",i[t.dataKey]);if(u)return u.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var d=vn(i,on(l)?t.dataKey:l),f=t.scale.map(d);return Te(f)?f:null}var aD=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:l}=e;if(t.type==="category")return n[l]?n[l].coordinate+r:null;var u=vn(a,t.dataKey,t.scale.domain()[l]);if(on(u))return null;var d=t.scale.map(u);return Te(d)?d-i/2+r:null},ime=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},ame=e=>{var t=e.flat(2).filter(Te);return[Math.min(...t),Math.max(...t)]},sme=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],ome=(e,t,n)=>{if(e!=null)return sme(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:l}=a,u=l.reduce((d,f)=>{var p=H6(f,t,n),m=ame(p);return!ht(m[0])||!ht(m[1])?d:[Math.min(d[0],m[0]),Math.max(d[1],m[1])]},[1/0,-1/0]);return[Math.min(u[0],r[0]),Math.max(u[1],r[1])]},[1/0,-1/0]))},sD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,oD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Go=(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=ox(t,p=>p.coordinate),a=1/0,l=1,u=i.length;l<u;l++){var d=i[l],f=i[l-1];a=Math.min((d?.coordinate||0)-(f?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function lD(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Tu(Tu({},t),{},{dataKey:n,payload:r,value:i,name:a})}function kd(e,t){if(e)return String(e);if(typeof t=="string")return t}var lme=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},cme=(e,t)=>t==="centric"?e.angle:e.radius,Bs=e=>e.layout.width,Us=e=>e.layout.height,ume=e=>e.layout.scale,Q6=e=>e.layout.margin,yx=re(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),vx=re(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),dme="data-recharts-item-index",fme="data-recharts-item-id",rp=60;function cD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cD(Object(n),!0).forEach(function(r){hme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hme(e,t,n){return(t=pme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pme(e){var t=mme(e,"string");return typeof t=="symbol"?t:t+""}function mme(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 gme=e=>e.brush.height;function yme(e){var t=vx(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:rp;return n+i}return n},0)}function vme(e){var t=vx(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:rp;return n+i}return n},0)}function xme(e){var t=yx(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function bme(e){var t=yx(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var nr=re([Bs,Us,Q6,gme,yme,vme,xme,bme,h6,Khe],(e,t,n,r,i,a,l,u,d,f)=>{var p={left:(n.left||0)+i,right:(n.right||0)+a},m={top:(n.top||0)+l,bottom:(n.bottom||0)+u},g=gg(gg({},m),p),v=g.bottom;g.bottom+=r,g=Xpe(g,d,f);var j=e-g.left-g.right,b=t-g.top-g.bottom;return gg(gg({brushBottom:v},g),{},{width:Math.max(j,0),height:Math.max(b,0)})}),wme=re(nr,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),hC=re(Bs,Us,(e,t)=>({x:0,y:0,width:e,height:t})),jme=x.createContext(null),rr=()=>x.useContext(jme)!=null,xx=e=>e.brush,bx=re([xx,nr,Q6],(e,t,n)=>({height:e.height,x:Te(e.x)?e.x:t.left,y:Te(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Te(e.width)?e.width:t.width})),Wj={},Yj={},Zj={},uD;function Sme(){return uD||(uD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let l,u=null;const d=a!=null&&a.includes("leading"),f=a==null||a.includes("trailing"),p=()=>{u!==null&&(n.apply(l,u),l=void 0,u=null)},m=()=>{f&&p(),b()};let g=null;const v=()=>{g!=null&&clearTimeout(g),g=setTimeout(()=>{g=null,m()},r)},j=()=>{g!==null&&(clearTimeout(g),g=null)},b=()=>{j(),l=void 0,u=null},S=()=>{p()},k=function(...E){if(i?.aborted)return;l=this,u=E;const C=g==null;v(),d&&C&&p()};return k.schedule=v,k.cancel=b,k.flush=S,i?.addEventListener("abort",b,{once:!0}),k}e.debounce=t})(Zj)),Zj}var dD;function Nme(){return dD||(dD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Sme();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:l=!1,trailing:u=!0,maxWait:d}=a,f=Array(2);l&&(f[0]="leading"),u&&(f[1]="trailing");let p,m=null;const g=t.debounce(function(...b){p=r.apply(this,b),m=null},i,{edges:f}),v=function(...b){return d!=null&&(m===null&&(m=Date.now()),Date.now()-m>=d)?(p=r.apply(this,b),m=Date.now(),g.cancel(),g.schedule(),p):(g.apply(this,b),p)},j=()=>(g.flush(),p);return v.cancel=g.cancel,v.flush=j,v}e.debounce=n})(Yj)),Yj}var fD;function kme(){return fD||(fD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Nme();function n(r,i=0,a={}){const{leading:l=!0,trailing:u=!0}=a;return t.debounce(r,i,{leading:l,maxWait:i,trailing:u})}e.throttle=n})(Wj)),Wj}var Xj,hD;function Cme(){return hD||(hD=1,Xj=kme().throttle),Xj}var Ame=Cme();const Ome=ma(Ame);var My=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},Ia={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},W6=(e,t,n)=>{var{width:r=Ia.width,height:i=Ia.height,aspect:a,maxHeight:l}=n,u=oc(r)?e:Number(r),d=oc(i)?t:Number(i);return a&&a>0&&(u?d=u/a:d&&(u=d*a),l&&d!=null&&d>l&&(d=l)),{calculatedWidth:u,calculatedHeight:d}},Eme={width:0,height:0,overflow:"visible"},_me={width:0,overflowX:"visible"},zme={height:0,overflowY:"visible"},Tme={},Pme=e=>{var{width:t,height:n}=e,r=oc(t),i=oc(n);return r&&i?Eme:r?_me:i?zme:Tme};function Rme(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=Ia.width,a=Ia.height):i===void 0?i=r&&r>0?void 0:Ia.width:a===void 0&&(a=r&&r>0?void 0:Ia.height),{width:i,height:a}}function F1(){return F1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F1.apply(null,arguments)}function pD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pD(Object(n),!0).forEach(function(r){Dme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dme(e,t,n){return(t=Mme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mme(e){var t=Ime(e,"string");return typeof t=="symbol"?t:t+""}function Ime(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Y6=x.createContext(Ia.initialDimension);function Lme(e){return Ha(e.width)&&Ha(e.height)}function Z6(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return Lme(i)?x.createElement(Y6.Provider,{value:i},t):null}var pC=()=>x.useContext(Y6),$me=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Ia.initialDimension,width:i,height:a,minWidth:l=Ia.minWidth,minHeight:u,maxHeight:d,children:f,debounce:p=Ia.debounce,id:m,className:g,onResize:v,style:j={}}=e,b=x.useRef(null),S=x.useRef();S.current=v,x.useImperativeHandle(t,()=>b.current);var[k,E]=x.useState({containerWidth:r.width,containerHeight:r.height}),C=x.useCallback((P,$)=>{E(F=>{var U=Math.round(P),B=Math.round($);return F.containerWidth===U&&F.containerHeight===B?F:{containerWidth:U,containerHeight:B}})},[]);x.useEffect(()=>{if(b.current==null||typeof ResizeObserver>"u")return el;var P=B=>{var V,X=B[0];if(X!=null){var{width:Z,height:H}=X.contentRect;C(Z,H),(V=S.current)===null||V===void 0||V.call(S,Z,H)}};p>0&&(P=Ome(P,p,{trailing:!0,leading:!1}));var $=new ResizeObserver(P),{width:F,height:U}=b.current.getBoundingClientRect();return C(F,U),$.observe(b.current),()=>{$.disconnect()}},[C,p]);var{containerWidth:A,containerHeight:T}=k;My(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:O,calculatedHeight:_}=W6(A,T,{width:i,height:a,aspect:n,maxHeight:d});return My(O!=null&&O>0||_!=null&&_>0,`The width(%s) and height(%s) of chart should be greater than 0,
258
+ please check the style of container, or the props width(%s) and height(%s),
259
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
260
+ height and width.`,O,_,i,a,l,u,n),x.createElement("div",{id:m?"".concat(m):void 0,className:Ot("recharts-responsive-container",g),style:mD(mD({},j),{},{width:i,height:a,minWidth:l,minHeight:u,maxHeight:d}),ref:b},x.createElement("div",{style:Pme({width:i,height:a})},x.createElement(Z6,{width:O,height:_},f)))}),Ts=x.forwardRef((e,t)=>{var n=pC();if(Ha(n.width)&&Ha(n.height))return e.children;var{width:r,height:i}=Rme({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=W6(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Te(a)&&Te(l)?x.createElement(Z6,{width:a,height:l},e.children):x.createElement($me,F1({},e,{width:r,height:i,ref:t}))});function mC(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var wx=()=>{var e,t=rr(),n=Ue(wme),r=Ue(bx),i=(e=Ue(xx))===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}},Bme={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},X6=()=>{var e;return(e=Ue(nr))!==null&&e!==void 0?e:Bme},gC=()=>Ue(Bs),yC=()=>Ue(Us),Ume=()=>Ue(e=>e.layout.margin),_t=e=>e.layout.layoutType,tl=()=>Ue(_t),vC=()=>{var e=tl();if(e==="horizontal"||e==="vertical")return e},J6=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},qme=()=>{var e=tl();return e!==void 0},ip=e=>{var t=ln(),n=rr(),{width:r,height:i}=e,a=pC(),l=r,u=i;return a&&(l=a.width>0?a.width:r,u=a.height>0?a.height:i),x.useEffect(()=>{!n&&Ha(l)&&Ha(u)&&t(Gpe({width:l,height:u}))},[t,n,l,u]),null},eU=Symbol.for("immer-nothing"),gD=Symbol.for("immer-draftable"),vi=Symbol.for("immer-state");function la(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var zh=Object.getPrototypeOf;function id(e){return!!e&&!!e[vi]}function cc(e){return e?tU(e)||Array.isArray(e)||!!e[gD]||!!e.constructor?.[gD]||ap(e)||Sx(e):!1}var Fme=Object.prototype.constructor.toString(),yD=new WeakMap;function tU(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=yD.get(n);return r===void 0&&(r=Function.toString.call(n),yD.set(n,r)),r===Fme}function Iy(e,t,n=!0){jx(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 jx(e){const t=e[vi];return t?t.type_:Array.isArray(e)?1:ap(e)?2:Sx(e)?3:0}function H1(e,t){return jx(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function nU(e,t,n){const r=jx(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Hme(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ap(e){return e instanceof Map}function Sx(e){return e instanceof Set}function Pl(e){return e.copy_||e.base_}function K1(e,t){if(ap(e))return new Map(e);if(Sx(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=tU(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[vi];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],u=r[l];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(r[l]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[l]})}return Object.create(zh(e),r)}else{const r=zh(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function xC(e,t=!1){return Nx(e)||id(e)||!cc(e)||(jx(e)>1&&Object.defineProperties(e,{set:yg,add:yg,clear:yg,delete:yg}),Object.freeze(e),t&&Object.values(e).forEach(n=>xC(n,!0))),e}function Kme(){la(2)}var yg={value:Kme};function Nx(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Gme={};function uc(e){const t=Gme[e];return t||la(0,e),t}var Th;function rU(){return Th}function Vme(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function vD(e,t){t&&(uc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function G1(e){V1(e),e.drafts_.forEach(Qme),e.drafts_=null}function V1(e){e===Th&&(Th=e.parent_)}function xD(e){return Th=Vme(Th,e)}function Qme(e){const t=e[vi];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function bD(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[vi].modified_&&(G1(t),la(4)),cc(e)&&(e=Ly(t,e),t.parent_||$y(t,e)),t.patches_&&uc("Patches").generateReplacementPatches_(n[vi].base_,e,t.patches_,t.inversePatches_)):e=Ly(t,n,[]),G1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==eU?e:void 0}function Ly(e,t,n){if(Nx(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[vi];if(!i)return Iy(t,(a,l)=>wD(e,i,t,a,l,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return $y(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let l=a,u=!1;i.type_===3&&(l=new Set(a),a.clear(),u=!0),Iy(l,(d,f)=>wD(e,i,a,d,f,n,u),r),$y(e,a,!1),n&&e.patches_&&uc("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function wD(e,t,n,r,i,a,l){if(i==null||typeof i!="object"&&!l)return;const u=Nx(i);if(!(u&&!l)){if(id(i)){const d=a&&t&&t.type_!==3&&!H1(t.assigned_,r)?a.concat(r):void 0,f=Ly(e,i,d);if(nU(n,r,f),id(f))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(cc(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&u)return;Ly(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(ap(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&$y(e,i)}}}function $y(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&xC(t,n)}function Wme(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:rU(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=bC;n&&(i=[r],a=Ph);const{revoke:l,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=l,u}var bC={get(e,t){if(t===vi)return e;const n=Pl(e);if(!H1(n,t))return Yme(e,n,t);const r=n[t];return e.finalized_||!cc(r)?r:r===Jj(e.base_,t)?(eS(e),e.copy_[t]=W1(r,e)):r},has(e,t){return t in Pl(e)},ownKeys(e){return Reflect.ownKeys(Pl(e))},set(e,t,n){const r=iU(Pl(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Jj(Pl(e),t),a=i?.[vi];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Hme(n,i)&&(n!==void 0||H1(e.base_,t)))return!0;eS(e),Q1(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Jj(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,eS(e),Q1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Pl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){la(11)},getPrototypeOf(e){return zh(e.base_)},setPrototypeOf(){la(12)}},Ph={};Iy(bC,(e,t)=>{Ph[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ph.deleteProperty=function(e,t){return Ph.set.call(this,e,t,void 0)};Ph.set=function(e,t,n){return bC.set.call(this,e[0],t,n,e[0])};function Jj(e,t){const n=e[vi];return(n?Pl(n):e)[t]}function Yme(e,t,n){const r=iU(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function iU(e,t){if(!(t in e))return;let n=zh(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=zh(n)}}function Q1(e){e.modified_||(e.modified_=!0,e.parent_&&Q1(e.parent_))}function eS(e){e.copy_||(e.copy_=K1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Zme=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const l=this;return function(d=a,...f){return l.produce(d,p=>n.call(this,p,...f))}}typeof n!="function"&&la(6),r!==void 0&&typeof r!="function"&&la(7);let i;if(cc(t)){const a=xD(this),l=W1(t,void 0);let u=!0;try{i=n(l),u=!1}finally{u?G1(a):V1(a)}return vD(a,r),bD(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===eU&&(i=void 0),this.autoFreeze_&&xC(i,!0),r){const a=[],l=[];uc("Patches").generateReplacementPatches_(t,i,a,l),r(a,l)}return i}else la(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...u)=>this.produceWithPatches(l,d=>t(d,...u));let r,i;return[this.produce(t,n,(l,u)=>{r=l,i=u}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){cc(e)||la(8),id(e)&&(e=Xme(e));const t=xD(this),n=W1(e,void 0);return n[vi].isManual_=!0,V1(t),n}finishDraft(e,t){const n=e&&e[vi];(!n||!n.isManual_)&&la(9);const{scope_:r}=n;return vD(r,t),bD(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=uc("Patches").applyPatches_;return id(e)?r(e,t):this.produce(e,i=>r(i,t))}};function W1(e,t){const n=ap(e)?uc("MapSet").proxyMap_(e,t):Sx(e)?uc("MapSet").proxySet_(e,t):Wme(e,t);return(t?t.scope_:rU()).drafts_.push(n),n}function Xme(e){return id(e)||la(10,e),aU(e)}function aU(e){if(!cc(e)||Nx(e))return e;const t=e[vi];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=K1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=K1(e,!0);return Iy(n,(i,a)=>{nU(n,i,aU(a))},r),t&&(t.finalized_=!1),n}var Jme=new Zme;Jme.produce;var ege={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},sU=Or({name:"legend",initialState:ege,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:an()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Ui(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:an()},removeLegendPayload:{reducer(e,t){var n=Ui(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:an()}}}),{setLegendSize:jD,setLegendSettings:tge,addLegendPayload:nge,replaceLegendPayload:rge,removeLegendPayload:ige}=sU.actions,age=sU.reducer,tS={exports:{}},nS={};var SD;function sge(){if(SD)return nS;SD=1;var e=md();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,l=e.useMemo,u=e.useDebugValue;return nS.useSyncExternalStoreWithSelector=function(d,f,p,m,g){var v=i(null);if(v.current===null){var j={hasValue:!1,value:null};v.current=j}else j=v.current;v=l(function(){function S(T){if(!k){if(k=!0,E=T,T=m(T),g!==void 0&&j.hasValue){var O=j.value;if(g(O,T))return C=O}return C=T}if(O=C,n(E,T))return O;var _=m(T);return g!==void 0&&g(O,_)?(E=T,O):(E=T,C=_)}var k=!1,E,C,A=p===void 0?null:p;return[function(){return S(f())},A===null?void 0:function(){return S(A())}]},[f,p,m,g]);var b=r(d,v[0],v[1]);return a(function(){j.hasValue=!0,j.value=b},[b]),u(b),b},nS}var ND;function oge(){return ND||(ND=1,tS.exports=sge()),tS.exports}oge();function lge(e){e()}function cge(){let e=null,t=null;return{clear(){e=null,t=null},notify(){lge(()=>{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 kD={notify(){},get:()=>[]};function uge(e,t){let n,r=kD,i=0,a=!1;function l(b){p();const S=r.subscribe(b);let k=!1;return()=>{k||(k=!0,S(),m())}}function u(){r.notify()}function d(){j.onStateChange&&j.onStateChange()}function f(){return a}function p(){i++,n||(n=e.subscribe(d),r=cge())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=kD)}function g(){a||(a=!0,p())}function v(){a&&(a=!1,m())}const j={addNestedSub:l,notifyNestedSubs:u,handleChangeWrapper:d,isSubscribed:f,trySubscribe:g,tryUnsubscribe:v,getListeners:()=>r};return j}var dge=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",fge=dge(),hge=()=>typeof navigator<"u"&&navigator.product==="ReactNative",pge=hge(),mge=()=>fge||pge?x.useLayoutEffect:x.useEffect,gge=mge();function CD(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function yge(e,t){if(CD(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])||!CD(e[n[i]],t[n[i]]))return!1;return!0}var vge=Symbol.for("react-redux-context"),xge=typeof globalThis<"u"?globalThis:{};function bge(){if(!x.createContext)return{};const e=xge[vge]??=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var wge=bge();function jge(e){const{children:t,context:n,serverState:r,store:i}=e,a=x.useMemo(()=>{const d=uge(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),l=x.useMemo(()=>i.getState(),[i]);gge(()=>{const{subscription:d}=a;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),l!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[a,l]);const u=n||wge;return x.createElement(u.Provider,{value:a},t)}var Sge=jge,Nge=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function kge(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Nc(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Nge.has(r)){if(e[r]==null&&t[r]==null)continue;if(!yge(e[r],t[r]))return!1}else if(!kge(e[r],t[r]))return!1;return!0}var Cge=["contextPayload"];function Y1(){return Y1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y1.apply(null,arguments)}function AD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ad(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AD(Object(n),!0).forEach(function(r){Age(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Age(e,t,n){return(t=Oge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oge(e){var t=Ege(e,"string");return typeof t=="symbol"?t:t+""}function Ege(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _ge(e,t){if(e==null)return{};var n,r,i=zge(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zge(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 Tge(e){return e.value}function Pge(e){var{contextPayload:t}=e,n=_ge(e,Cge),r=c6(t,e.payloadUniqBy,Tge),i=ad(ad({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content=="function"?x.createElement(e.content,i):x.createElement(ihe,i)}function Rge(e,t,n,r,i,a){var{layout:l,align:u,verticalAlign:d}=t,f,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(u==="center"&&l==="vertical"?f={left:((r||0)-a.width)/2}:f=u==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(d==="middle"?p={top:((i||0)-a.height)/2}:p=d==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),ad(ad({},f),p)}function Dge(e){var t=ln();return x.useEffect(()=>{t(tge(e))},[t,e]),null}function Mge(e){var t=ln();return x.useEffect(()=>(t(jD(e)),()=>{t(jD({width:0,height:0}))}),[t,e]),null}function Ige(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Lge={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function $ge(e){var t=tr(e,Lge),n=Qhe(),r=Yde(),i=Ume(),{width:a,height:l,wrapperStyle:u,portal:d}=t,[f,p]=p6([n]),m=gC(),g=yC();if(m==null||g==null)return null;var v=m-(i?.left||0)-(i?.right||0),j=Ige(t.layout,l,a,v),b=d?u:ad(ad({position:"absolute",width:j?.width||a||"auto",height:j?.height||l||"auto"},Rge(u,t,i,m,g,f)),u),S=d??r;if(S==null||n==null)return null;var k=x.createElement("div",{className:"recharts-legend-wrapper",style:b,ref:p},x.createElement(Dge,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&x.createElement(Mge,{width:f.width,height:f.height}),x.createElement(Pge,Y1({},t,j,{margin:i,chartWidth:m,chartHeight:g,contextPayload:n})));return yc.createPortal(k,S)}var oU=x.memo($ge,Nc);oU.displayName="Legend";function Z1(){return Z1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Z1.apply(null,arguments)}function OD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Uf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OD(Object(n),!0).forEach(function(r){Bge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bge(e,t,n){return(t=Uge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uge(e){var t=qge(e,"string");return typeof t=="symbol"?t:t+""}function qge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fge(e){return Array.isArray(e)&&Fa(e[0])&&Fa(e[1])?e.join(" ~ "):e}var gu={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function Hge(e,t){return t==null?e:ox(e,t)}var Kge=e=>{var{separator:t=gu.separator,contentStyle:n,itemStyle:r,labelStyle:i=gu.labelStyle,payload:a,formatter:l,itemSorter:u,wrapperClassName:d,labelClassName:f,label:p,labelFormatter:m,accessibilityLayer:g=gu.accessibilityLayer}=e,v=()=>{if(a&&a.length){var T={padding:0,margin:0},O=Hge(a,u),_=O.map((P,$)=>{if(!P||P.type==="none")return null;var F=P.formatter||l||Fge,{value:U,name:B}=P,V=U,X=B;if(F){var Z=F(U,B,P,$,a);if(Array.isArray(Z))[V,X]=Z;else if(Z!=null)V=Z;else return null}var H=Uf(Uf({},gu.itemStyle),{},{color:P.color||gu.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat($),style:H},Fa(X)?x.createElement("span",{className:"recharts-tooltip-item-name"},X):null,Fa(X)?x.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,x.createElement("span",{className:"recharts-tooltip-item-value"},V),x.createElement("span",{className:"recharts-tooltip-item-unit"},P.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:T},_)}return null},j=Uf(Uf({},gu.contentStyle),n),b=Uf({margin:0},i),S=!on(p),k=S?p:"",E=Ot("recharts-default-tooltip",d),C=Ot("recharts-tooltip-label",f);S&&m&&a!==void 0&&a!==null&&(k=m(p,a));var A=g?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",Z1({className:E,style:j},A),x.createElement("p",{className:C,style:b},x.isValidElement(k)?k:"".concat(k)),v())},qf="recharts-tooltip-wrapper",Gge={visibility:"hidden"};function Vge(e){var{coordinate:t,translateX:n,translateY:r}=e;return Ot(qf,{["".concat(qf,"-right")]:Te(n)&&t&&Te(t.x)&&n>=t.x,["".concat(qf,"-left")]:Te(n)&&t&&Te(t.x)&&n<t.x,["".concat(qf,"-bottom")]:Te(r)&&t&&Te(t.y)&&r>=t.y,["".concat(qf,"-top")]:Te(r)&&t&&Te(t.y)&&r<t.y})}function ED(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:l,tooltipDimension:u,viewBox:d,viewBoxDimension:f}=e;if(a&&Te(a[r]))return a[r];var p=n[r]-u-(i>0?i:0),m=n[r]+i;if(t[r])return l[r]?p:m;var g=d[r];if(g==null)return 0;if(l[r]){var v=p,j=g;return v<j?Math.max(m,g):Math.max(p,g)}if(f==null)return 0;var b=m+u,S=g+f;return b>S?Math.max(p,g):Math.max(m,g)}function Qge(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 Wge(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:l,tooltipBox:u,useTranslate3d:d,viewBox:f}=e,p,m,g;return u.height>0&&u.width>0&&n?(m=ED({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:l,tooltipDimension:u.width,viewBox:f,viewBoxDimension:f.width}),g=ED({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:l,tooltipDimension:u.height,viewBox:f,viewBoxDimension:f.height}),p=Qge({translateX:m,translateY:g,useTranslate3d:d})):p=Gge,{cssProperties:p,cssClasses:Vge({translateX:m,translateY:g,coordinate:n})}}var Yge=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),sp={isSsr:Yge()};function lU(){var[e,t]=x.useState(()=>sp.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 _D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_D(Object(n),!0).forEach(function(r){Zge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_D(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zge(e,t,n){return(t=Xge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xge(e){var t=Jge(e,"string");return typeof t=="symbol"?t:t+""}function Jge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eye(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function tye(e){var t,n,r,i,a,l,u=lU(),[d,f]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var j=b=>{if(b.key==="Escape"){var S,k,E,C;f({dismissed:!0,dismissedAtCoordinate:{x:(S=(k=e.coordinate)===null||k===void 0?void 0:k.x)!==null&&S!==void 0?S:0,y:(E=(C=e.coordinate)===null||C===void 0?void 0:C.y)!==null&&E!==void 0?E:0}})}};return document.addEventListener("keydown",j),()=>{document.removeEventListener("keydown",j)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),d.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==d.dismissedAtCoordinate.x||((a=(l=e.coordinate)===null||l===void 0?void 0:l.y)!==null&&a!==void 0?a:0)!==d.dismissedAtCoordinate.y)&&f(yu(yu({},d),{},{dismissed:!1}));var{cssClasses:p,cssProperties:m}=Wge({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),g=e.hasPortalFromProps?{}:yu(yu({transition:eye({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},m),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=yu(yu({},g),{},{visibility:!d.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return x.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:v,ref:e.innerRef},e.children)}var nye=x.memo(tye),cU=()=>{var e;return(e=Ue(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function X1(){return X1=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},X1.apply(null,arguments)}function zD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function TD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zD(Object(n),!0).forEach(function(r){rye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rye(e,t,n){return(t=iye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iye(e){var t=aye(e,"string");return typeof t=="symbol"?t:t+""}function aye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var PD={curveBasisClosed:mfe,curveBasisOpen:gfe,curveBasis:pfe,curveBumpX:efe,curveBumpY:tfe,curveLinearClosed:yfe,curveLinear:ix,curveMonotoneX:vfe,curveMonotoneY:xfe,curveNatural:bfe,curveStep:wfe,curveStepAfter:Sfe,curveStepBefore:jfe},By=e=>ht(e.x)&&ht(e.y),RD=e=>e.base!=null&&By(e.base)&&By(e),Ff=e=>e.x,Hf=e=>e.y,sye=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(ep(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=PD["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return PD[n]||ix},DD={connectNulls:!1,type:"linear"},oye=e=>{var{type:t=DD.type,points:n=[],baseLine:r,layout:i,connectNulls:a=DD.connectNulls}=e,l=sye(t,i),u=a?n.filter(By):n;if(Array.isArray(r)){var d,f=n.map((j,b)=>TD(TD({},j),{},{base:r[b]}));i==="vertical"?d=ug().y(Hf).x1(Ff).x0(j=>j.base.x):d=ug().x(Ff).y1(Hf).y0(j=>j.base.y);var p=d.defined(RD).curve(l),m=a?f.filter(RD):f;return p(m)}var g;i==="vertical"&&Te(r)?g=ug().y(Hf).x1(Ff).x0(r):Te(r)?g=ug().x(Ff).y1(Hf).y0(r):g=IB().x(Ff).y(Hf);var v=g.defined(By).curve(l);return v(u)},fh=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=tl();if((!n||!n.length)&&!r)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},u=n&&n.length?oye(l):r;return x.createElement("path",X1({},gi(e),iC(e),{className:Ot("recharts-curve",t),d:u===null?void 0:u,ref:i}))},lye=["x","y","top","left","width","height","className"];function J1(){return J1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J1.apply(null,arguments)}function MD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MD(Object(n),!0).forEach(function(r){uye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uye(e,t,n){return(t=dye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dye(e){var t=fye(e,"string");return typeof t=="symbol"?t:t+""}function fye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hye(e,t){if(e==null)return{};var n,r,i=pye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function pye(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 mye=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),gye=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:l=0,className:u}=e,d=hye(e,lye),f=cye({x:t,y:n,top:r,left:i,width:a,height:l},d);return!Te(t)||!Te(n)||!Te(a)||!Te(l)||!Te(r)||!Te(i)?null:x.createElement("path",J1({},kr(f),{className:Ot("recharts-cross",u),d:mye(t,n,a,l,r,i)}))};function yye(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 ID(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function LD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ID(Object(n),!0).forEach(function(r){vye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ID(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vye(e,t,n){return(t=xye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xye(e){var t=bye(e,"string");return typeof t=="symbol"?t:t+""}function bye(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 wye=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),uU=(e,t,n)=>e.map(r=>"".concat(wye(r)," ").concat(t,"ms ").concat(n)).join(","),jye=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Rh=(e,t)=>Object.keys(t).reduce((n,r)=>LD(LD({},n),{},{[r]:e(r,t[r])}),{});function $D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Qn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$D(Object(n),!0).forEach(function(r){Sye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$D(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sye(e,t,n){return(t=Nye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nye(e){var t=kye(e,"string");return typeof t=="symbol"?t:t+""}function kye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Uy=(e,t,n)=>e+(t-e)*n,eN=e=>{var{from:t,to:n}=e;return t!==n},dU=(e,t,n)=>{var r=Rh((i,a)=>{if(eN(a)){var[l,u]=e(a.from,a.to,a.velocity);return Qn(Qn({},a),{},{from:l,velocity:u})}return a},t);return n<1?Rh((i,a)=>eN(a)&&r[i]!=null?Qn(Qn({},a),{},{velocity:Uy(a.velocity,r[i].velocity,n),from:Uy(a.from,r[i].from,n)}):a,t):dU(e,r,n-1)};function Cye(e,t,n,r,i,a){var l,u=r.reduce((g,v)=>Qn(Qn({},g),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),d=()=>Rh((g,v)=>v.from,u),f=()=>!Object.values(u).filter(eN).length,p=null,m=g=>{l||(l=g);var v=g-l,j=v/n.dt;u=dU(n,u,j),i(Qn(Qn(Qn({},e),t),d())),l=g,f()||(p=a.setTimeout(m))};return()=>(p=a.setTimeout(m),()=>{var g;(g=p)===null||g===void 0||g()})}function Aye(e,t,n,r,i,a,l){var u=null,d=i.reduce((m,g)=>{var v=e[g],j=t[g];return v==null||j==null?m:Qn(Qn({},m),{},{[g]:[v,j]})},{}),f,p=m=>{f||(f=m);var g=(m-f)/r,v=Rh((b,S)=>Uy(...S,n(g)),d);if(a(Qn(Qn(Qn({},e),t),v)),g<1)u=l.setTimeout(p);else{var j=Rh((b,S)=>Uy(...S,n(1)),d);a(Qn(Qn(Qn({},e),t),j))}};return()=>(u=l.setTimeout(p),()=>{var m;(m=u)===null||m===void 0||m()})}const Oye=(e,t,n,r,i,a)=>{var l=jye(e,t);return n==null?()=>(i(Qn(Qn({},e),t)),()=>{}):n.isStepper===!0?Cye(e,t,n,l,i,a):Aye(e,t,n,r,l,i,a)};var qy=1e-4,fU=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],hU=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),BD=(e,t)=>n=>{var r=fU(e,t);return hU(r,n)},Eye=(e,t)=>n=>{var r=fU(e,t),i=[...r.map((a,l)=>a*l).slice(1),0];return hU(i,n)},_ye=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},zye=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=_ye(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},Tye=(e,t,n,r)=>{var i=BD(e,n),a=BD(t,r),l=Eye(e,n),u=f=>f>1?1:f<0?0:f,d=f=>{for(var p=f>1?1:f,m=p,g=0;g<8;++g){var v=i(m)-p,j=l(m);if(Math.abs(v-p)<qy||j<qy)return a(m);m=u(m-v/j)}return a(m)};return d.isStepper=!1,d},UD=function(){return Tye(...zye(...arguments))},Pye=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(l,u,d)=>{var f=-(l-u)*n,p=d*r,m=d+(f-p)*i/1e3,g=d*i/1e3+l;return Math.abs(g-u)<qy&&Math.abs(m)<qy?[u,0]:[g,m]};return a.isStepper=!0,a.dt=i,a},Rye=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return UD(e);case"spring":return Pye();default:if(e.split("(")[0]==="cubic-bezier")return UD(e)}return typeof e=="function"?e:null};function Dye(e){var t,n=()=>null,r=!1,i=null,a=l=>{if(!r){if(Array.isArray(l)){if(!l.length)return;var u=l,[d,...f]=u;if(typeof d=="number"){i=e.setTimeout(a.bind(null,f),d);return}a(d),i=e.setTimeout(a.bind(null,f));return}typeof l=="string"&&(t=l,n(t)),typeof l=="object"&&(t=l,n(t)),typeof l=="function"&&l()}};return{stop:()=>{r=!0},start:l=>{r=!1,i&&(i(),i=null),a(l)},subscribe:l=>(n=l,()=>{n=()=>null}),getTimeoutController:()=>e}}class Mye{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=l=>{l-r>=n?t(l):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function Iye(){return Dye(new Mye)}var Lye=x.createContext(Iye);function $ye(e,t){var n=x.useContext(Lye);return x.useMemo(()=>t??n(e),[e,t,n])}var Bye={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},qD={t:0},rS={t:1};function op(e){var t=tr(e,Bye),{isActive:n,canBegin:r,duration:i,easing:a,begin:l,onAnimationEnd:u,onAnimationStart:d,children:f}=t,p=lU(),m=n==="auto"?!sp.isSsr&&!p:n,g=$ye(t.animationId,t.animationManager),[v,j]=x.useState(m?qD:rS),b=x.useRef(null);return x.useEffect(()=>{m||j(rS)},[m]),x.useEffect(()=>{if(!m||!r)return el;var S=Oye(qD,rS,Rye(a),i,j,g.getTimeoutController()),k=()=>{b.current=S()};return g.start([d,l,k,i,u]),()=>{g.stop(),b.current&&b.current(),u()}},[m,r,i,a,l,d,u,g]),f(v.t)}function lp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(Ah(t)),r=x.useRef(e);return r.current!==e&&(n.current=Ah(t),r.current=e),n.current}var Uye=["radius"],qye=["radius"],FD,HD,KD,GD,VD,QD,WD,YD,ZD,XD;function JD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function eM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JD(Object(n),!0).forEach(function(r){Fye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fye(e,t,n){return(t=Hye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hye(e){var t=Kye(e,"string");return typeof t=="symbol"?t:t+""}function Kye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fy(){return Fy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fy.apply(null,arguments)}function tM(e,t){if(e==null)return{};var n,r,i=Gye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Gye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Oa(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var nM=(e,t,n,r,i)=>{var a=Do(n),l=Do(r),u=Math.min(Math.abs(a)/2,Math.abs(l)/2),d=l>=0?1:-1,f=a>=0?1:-1,p=l>=0&&a>=0||l<0&&a<0?1:0,m;if(u>0&&Array.isArray(i)){for(var g=[0,0,0,0],v=0,j=4;v<j;v++){var b,S=(b=i[v])!==null&&b!==void 0?b:0;g[v]=S>u?u:S}m=kn(FD||(FD=Oa(["M",",",""])),e,t+d*g[0]),g[0]>0&&(m+=kn(HD||(HD=Oa(["A ",",",",0,0,",",",",",""])),g[0],g[0],p,e+f*g[0],t)),m+=kn(KD||(KD=Oa(["L ",",",""])),e+n-f*g[1],t),g[1]>0&&(m+=kn(GD||(GD=Oa(["A ",",",",0,0,",`,
261
+ `,",",""])),g[1],g[1],p,e+n,t+d*g[1])),m+=kn(VD||(VD=Oa(["L ",",",""])),e+n,t+r-d*g[2]),g[2]>0&&(m+=kn(QD||(QD=Oa(["A ",",",",0,0,",`,
262
+ `,",",""])),g[2],g[2],p,e+n-f*g[2],t+r)),m+=kn(WD||(WD=Oa(["L ",",",""])),e+f*g[3],t+r),g[3]>0&&(m+=kn(YD||(YD=Oa(["A ",",",",0,0,",`,
263
+ `,",",""])),g[3],g[3],p,e,t+r-d*g[3])),m+="Z"}else if(u>0&&i===+i&&i>0){var k=Math.min(u,i);m=kn(ZD||(ZD=Oa(["M ",",",`
264
+ A `,",",",0,0,",",",",",`
265
+ L `,",",`
266
+ A `,",",",0,0,",",",",",`
267
+ L `,",",`
268
+ A `,",",",0,0,",",",",",`
269
+ L `,",",`
270
+ A `,",",",0,0,",",",","," Z"])),e,t+d*k,k,k,p,e+f*k,t,e+n-f*k,t,k,k,p,e+n,t+d*k,e+n,t+r-d*k,k,k,p,e+n-f*k,t+r,e+f*k,t+r,k,k,p,e,t+r-d*k)}else m=kn(XD||(XD=Oa(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},rM={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},pU=e=>{var t=tr(e,rM),n=x.useRef(null),[r,i]=x.useState(-1);x.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var J=n.current.getTotalLength();J&&i(J)}catch{}},[]);var{x:a,y:l,width:u,height:d,radius:f,className:p}=t,{animationEasing:m,animationDuration:g,animationBegin:v,isAnimationActive:j,isUpdateAnimationActive:b}=t,S=x.useRef(u),k=x.useRef(d),E=x.useRef(a),C=x.useRef(l),A=x.useMemo(()=>({x:a,y:l,width:u,height:d,radius:f}),[a,l,u,d,f]),T=lp(A,"rectangle-");if(a!==+a||l!==+l||u!==+u||d!==+d||u===0||d===0)return null;var O=Ot("recharts-rectangle",p);if(!b){var _=kr(t),{radius:P}=_,$=tM(_,Uye);return x.createElement("path",Fy({},$,{x:Do(a),y:Do(l),width:Do(u),height:Do(d),radius:typeof f=="number"?f:void 0,className:O,d:nM(a,l,u,d,f)}))}var F=S.current,U=k.current,B=E.current,V=C.current,X="0px ".concat(r===-1?1:r,"px"),Z="".concat(r,"px ").concat(r,"px"),H=uU(["strokeDasharray"],g,typeof m=="string"?m:rM.animationEasing);return x.createElement(op,{animationId:T,key:T,canBegin:r>0,duration:g,easing:m,isActive:b,begin:v},J=>{var oe=Ft(F,u,J),ye=Ft(U,d,J),I=Ft(B,a,J),M=Ft(V,l,J);n.current&&(S.current=oe,k.current=ye,E.current=I,C.current=M);var q;j?J>0?q={transition:H,strokeDasharray:Z}:q={strokeDasharray:X}:q={strokeDasharray:Z};var D=kr(t),{radius:G}=D,se=tM(D,qye);return x.createElement("path",Fy({},se,{radius:typeof f=="number"?f:void 0,className:O,d:nM(I,M,oe,ye,f),ref:n,style:eM(eM({},q),t.style)}))})};function iM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function aM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iM(Object(n),!0).forEach(function(r){Vye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vye(e,t,n){return(t=Qye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qye(e){var t=Wye(e,"string");return typeof t=="symbol"?t:t+""}function Wye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hy=Math.PI/180,Yye=e=>e*180/Math.PI,mr=(e,t,n,r)=>({x:e+Math.cos(-Hy*r)*n,y:t+Math.sin(-Hy*r)*n}),Zye=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},Xye=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},Jye=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,l=Xye({x:n,y:r},{x:i,y:a});if(l<=0)return{radius:l,angle:0};var u=(n-i)/l,d=Math.acos(u);return r>a&&(d=2*Math.PI-d),{radius:l,angle:Yye(d),angleInRadian:d}},eve=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},tve=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),l=Math.min(i,a);return e+l*360},nve=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=Jye({x:n,y:r},t),{innerRadius:l,outerRadius:u}=t;if(i<l||i>u||i===0)return null;var{startAngle:d,endAngle:f}=eve(t),p=a,m;if(d<=f){for(;p>f;)p-=360;for(;p<d;)p+=360;m=p>=d&&p<=f}else{for(;p>d;)p-=360;for(;p<f;)p+=360;m=p>=f&&p<=d}return m?aM(aM({},t),{},{radius:i,angle:tve(p,t)}):null};function mU(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,l=mr(t,n,r,i),u=mr(t,n,r,a);return{points:[l,u],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var sM,oM,lM,cM,uM,dM,fM;function tN(){return tN=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},tN.apply(null,arguments)}function Ul(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var rve=(e,t)=>{var n=Wr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},vg=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:l,cornerRadius:u,cornerIsExternal:d}=e,f=u*(l?1:-1)+r,p=Math.asin(u/f)/Hy,m=d?i:i+a*p,g=mr(t,n,f,m),v=mr(t,n,r,m),j=d?i-a*p:i,b=mr(t,n,f*Math.cos(p*Hy),j);return{center:g,circleTangency:v,lineTangency:b,theta:p}},gU=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:l}=e,u=rve(a,l),d=a+u,f=mr(t,n,i,a),p=mr(t,n,i,d),m=kn(sM||(sM=Ul(["M ",",",`
271
+ A `,",",`,0,
272
+ `,",",`,
273
+ `,",",`
274
+ `])),f.x,f.y,i,i,+(Math.abs(u)>180),+(a>d),p.x,p.y);if(r>0){var g=mr(t,n,r,a),v=mr(t,n,r,d);m+=kn(oM||(oM=Ul(["L ",",",`
275
+ A `,",",`,0,
276
+ `,",",`,
277
+ `,","," Z"])),v.x,v.y,r,r,+(Math.abs(u)>180),+(a<=d),g.x,g.y)}else m+=kn(lM||(lM=Ul(["L ",","," Z"])),t,n);return m},ive=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:l,cornerIsExternal:u,startAngle:d,endAngle:f}=e,p=Wr(f-d),{circleTangency:m,lineTangency:g,theta:v}=vg({cx:t,cy:n,radius:i,angle:d,sign:p,cornerRadius:a,cornerIsExternal:u}),{circleTangency:j,lineTangency:b,theta:S}=vg({cx:t,cy:n,radius:i,angle:f,sign:-p,cornerRadius:a,cornerIsExternal:u}),k=u?Math.abs(d-f):Math.abs(d-f)-v-S;if(k<0)return l?kn(cM||(cM=Ul(["M ",",",`
278
+ a`,",",",0,0,1,",`,0
279
+ a`,",",",0,0,1,",`,0
280
+ `])),g.x,g.y,a,a,a*2,a,a,-a*2):gU({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:f});var E=kn(uM||(uM=Ul(["M ",",",`
281
+ A`,",",",0,0,",",",",",`
282
+ A`,",",",0,",",",",",",",`
283
+ A`,",",",0,0,",",",",",`
284
+ `])),g.x,g.y,a,a,+(p<0),m.x,m.y,i,i,+(k>180),+(p<0),j.x,j.y,a,a,+(p<0),b.x,b.y);if(r>0){var{circleTangency:C,lineTangency:A,theta:T}=vg({cx:t,cy:n,radius:r,angle:d,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),{circleTangency:O,lineTangency:_,theta:P}=vg({cx:t,cy:n,radius:r,angle:f,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),$=u?Math.abs(d-f):Math.abs(d-f)-T-P;if($<0&&a===0)return"".concat(E,"L").concat(t,",").concat(n,"Z");E+=kn(dM||(dM=Ul(["L",",",`
285
+ A`,",",",0,0,",",",",",`
286
+ A`,",",",0,",",",",",",",`
287
+ A`,",",",0,0,",",",",","Z"])),_.x,_.y,a,a,+(p<0),O.x,O.y,r,r,+($>180),+(p>0),C.x,C.y,a,a,+(p<0),A.x,A.y)}else E+=kn(fM||(fM=Ul(["L",",","Z"])),t,n);return E},ave={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},yU=e=>{var t=tr(e,ave),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:l,forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p,className:m}=t;if(a<i||f===p)return null;var g=Ot("recharts-sector",m),v=a-i,j=ha(l,v,0,!0),b;return j>0&&Math.abs(f-p)<360?b=ive({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(j,v/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p}):b=gU({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:p}),x.createElement("path",tN({},kr(t),{className:g,d:b}))};function sve(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(XB(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:l,angle:u}=t,d=mr(r,i,a,u),f=mr(r,i,l,u);return[{x:d.x,y:d.y},{x:f.x,y:f.y}]}return mU(t)}}var iS={},aS={},sS={},hM;function ove(){return hM||(hM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=d6();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(sS)),sS}var pM;function lve(){return pM||(pM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ove();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})(aS)),aS}var mM;function cve(){return mM||(mM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=f6(),n=lve();function r(i,a,l){l&&typeof l!="number"&&t.isIterateeCall(i,a,l)&&(a=l=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),l=l===void 0?i<a?1:-1:n.toFinite(l);const u=Math.max(Math.ceil((a-i)/(l||1)),0),d=new Array(u);for(let f=0;f<u;f++)d[f]=i,i+=l;return d}e.range=r})(iS)),iS}var oS,gM;function uve(){return gM||(gM=1,oS=cve().range),oS}var dve=uve();const vU=ma(dve);var ba=e=>e.chartData,wC=re([ba],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),cp=(e,t,n,r)=>r?wC(e):ba(e),xU=(e,t,n)=>n?wC(e):ba(e),fve=re([cp],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});re([wC],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var hve=re([ba],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function $a(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(ht(t)&&ht(n))return!0}return!1}function yM(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function bU(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(ht(n))i=n;else if(typeof n=="function")return;if(ht(r))a=r;else if(typeof r=="function")return;var l=[i,a];if($a(l))return l}}function pve(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if($a(r))return yM(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,l,u;if(i==="auto")t!=null&&(l=Math.min(...t));else if(Te(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t?.[0]))}catch{}else if(typeof i=="string"&&sD.test(i)){var d=sD.exec(i);if(d==null||d[1]==null||t==null)l=void 0;else{var f=+d[1];l=t[0]-f}}else l=t?.[0];if(a==="auto")t!=null&&(u=Math.max(...t));else if(Te(a))u=a;else if(typeof a=="function")try{t!=null&&(u=a(t?.[1]))}catch{}else if(typeof a=="string"&&oD.test(a)){var p=oD.exec(a);if(p==null||p[1]==null||t==null)u=void 0;else{var m=+p[1];u=t[1]+m}}else u=t?.[1];var g=[l,u];if($a(g))return t==null?g:yM(g,t,n)}}}var Cd=1e9,mve={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},SC,hn=!0,Vi="[DecimalError] ",Yl=Vi+"Invalid argument: ",jC=Vi+"Exponent out of range: ",Ad=Math.floor,Rl=Math.pow,gve=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fi,Jn=1e7,sn=7,wU=9007199254740991,Ky=Ad(wU/sn),Re={};Re.absoluteValue=Re.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Re.comparedTo=Re.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};Re.decimalPlaces=Re.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*sn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Re.dividedBy=Re.div=function(e){return As(this,new this.constructor(e))};Re.dividedToIntegerBy=Re.idiv=function(e){var t=this,n=t.constructor;return Qt(As(t,new n(e),0,1),n.precision)};Re.equals=Re.eq=function(e){return!this.cmp(e)};Re.exponent=function(){return qn(this)};Re.greaterThan=Re.gt=function(e){return this.cmp(e)>0};Re.greaterThanOrEqualTo=Re.gte=function(e){return this.cmp(e)>=0};Re.isInteger=Re.isint=function(){return this.e>this.d.length-2};Re.isNegative=Re.isneg=function(){return this.s<0};Re.isPositive=Re.ispos=function(){return this.s>0};Re.isZero=function(){return this.s===0};Re.lessThan=Re.lt=function(e){return this.cmp(e)<0};Re.lessThanOrEqualTo=Re.lte=function(e){return this.cmp(e)<1};Re.logarithm=Re.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(fi))throw Error(Vi+"NaN");if(n.s<1)throw Error(Vi+(n.s?"NaN":"-Infinity"));return n.eq(fi)?new r(0):(hn=!1,t=As(Dh(n,a),Dh(e,a),a),hn=!0,Qt(t,i))};Re.minus=Re.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?NU(t,e):jU(t,(e.s=-e.s,e))};Re.modulo=Re.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Vi+"NaN");return n.s?(hn=!1,t=As(n,e,0,1).times(e),hn=!0,n.minus(t)):Qt(new r(n),i)};Re.naturalExponential=Re.exp=function(){return SU(this)};Re.naturalLogarithm=Re.ln=function(){return Dh(this)};Re.negated=Re.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Re.plus=Re.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?jU(t,e):NU(t,(e.s=-e.s,e))};Re.precision=Re.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Yl+e);if(t=qn(i)+1,r=i.d.length-1,n=r*sn+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Re.squareRoot=Re.sqrt=function(){var e,t,n,r,i,a,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(Vi+"NaN")}for(e=qn(u),hn=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=La(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Ad((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(i.toString()),n=d.precision,i=l=n+3;;)if(a=r,r=a.plus(As(u,a,l+2)).times(.5),La(a.d).slice(0,l)===(t=La(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(Qt(a,n+1,0),a.times(a).eq(u)){r=a;break}}else if(t!="9999")break;l+=4}return hn=!0,Qt(r,n)};Re.times=Re.mul=function(e){var t,n,r,i,a,l,u,d,f,p=this,m=p.constructor,g=p.d,v=(e=new m(e)).d;if(!p.s||!e.s)return new m(0);for(e.s*=p.s,n=p.e+e.e,d=g.length,f=v.length,d<f&&(a=g,g=v,v=a,l=d,d=f,f=l),a=[],l=d+f,r=l;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=d+r;i>r;)u=a[i]+v[r]*g[i-r-1]+t,a[i--]=u%Jn|0,t=u/Jn|0;a[i]=(a[i]+t)%Jn|0}for(;!a[--l];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,hn?Qt(e,m.precision):e};Re.toDecimalPlaces=Re.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ka(e,0,Cd),t===void 0?t=r.rounding:Ka(t,0,8),Qt(n,e+qn(n)+1,t))};Re.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=dc(r,!0):(Ka(e,0,Cd),t===void 0?t=i.rounding:Ka(t,0,8),r=Qt(new i(r),e+1,t),n=dc(r,!0,e+1)),n};Re.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?dc(i):(Ka(e,0,Cd),t===void 0?t=a.rounding:Ka(t,0,8),r=Qt(new a(i),e+qn(i)+1,t),n=dc(r.abs(),!1,e+qn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Re.toInteger=Re.toint=function(){var e=this,t=e.constructor;return Qt(new t(e),qn(e)+1,t.rounding)};Re.toNumber=function(){return+this};Re.toPower=Re.pow=function(e){var t,n,r,i,a,l,u=this,d=u.constructor,f=12,p=+(e=new d(e));if(!e.s)return new d(fi);if(u=new d(u),!u.s){if(e.s<1)throw Error(Vi+"Infinity");return u}if(u.eq(fi))return u;if(r=d.precision,e.eq(fi))return Qt(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,a=u.s,l){if((n=p<0?-p:p)<=wU){for(i=new d(fi),t=Math.ceil(r/sn+4),hn=!1;n%2&&(i=i.times(u),xM(i.d,t)),n=Ad(n/2),n!==0;)u=u.times(u),xM(u.d,t);return hn=!0,e.s<0?new d(fi).div(i):Qt(i,r)}}else if(a<0)throw Error(Vi+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,hn=!1,i=e.times(Dh(u,r+f)),hn=!0,i=SU(i),i.s=a,i};Re.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=qn(i),r=dc(i,n<=a.toExpNeg||n>=a.toExpPos)):(Ka(e,1,Cd),t===void 0?t=a.rounding:Ka(t,0,8),i=Qt(new a(i),e,t),n=qn(i),r=dc(i,e<=n||n<=a.toExpNeg,e)),r};Re.toSignificantDigits=Re.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ka(e,1,Cd),t===void 0?t=r.rounding:Ka(t,0,8)),Qt(new r(n),e,t)};Re.toString=Re.valueOf=Re.val=Re.toJSON=Re[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=qn(e),n=e.constructor;return dc(e,t<=n.toExpNeg||t>=n.toExpPos)};function jU(e,t){var n,r,i,a,l,u,d,f,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),hn?Qt(t,m):t;if(d=e.d,f=t.d,l=e.e,i=t.e,d=d.slice(),a=l-i,a){for(a<0?(r=d,a=-a,u=f.length):(r=f,i=l,u=d.length),l=Math.ceil(m/sn),u=l>u?l+1:u+1,a>u&&(a=u,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(u=d.length,a=f.length,u-a<0&&(a=u,r=f,f=d,d=r),n=0;a;)n=(d[--a]=d[a]+f[a]+n)/Jn|0,d[a]%=Jn;for(n&&(d.unshift(n),++i),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=i,hn?Qt(t,m):t}function Ka(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Yl+e)}function La(e){var t,n,r,i=e.length-1,a="",l=e[0];if(i>0){for(a+=l,t=1;t<i;t++)r=e[t]+"",n=sn-r.length,n&&(a+=Oo(n)),a+=r;l=e[t],r=l+"",n=sn-r.length,n&&(a+=Oo(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return a+l}var As=(function(){function e(r,i){var a,l=0,u=r.length;for(r=r.slice();u--;)a=r[u]*i+l,r[u]=a%Jn|0,l=a/Jn|0;return l&&r.unshift(l),r}function t(r,i,a,l){var u,d;if(a!=l)d=a>l?1:-1;else for(u=d=0;u<a;u++)if(r[u]!=i[u]){d=r[u]>i[u]?1:-1;break}return d}function n(r,i,a){for(var l=0;a--;)r[a]-=l,l=r[a]<i[a]?1:0,r[a]=l*Jn+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,l){var u,d,f,p,m,g,v,j,b,S,k,E,C,A,T,O,_,P,$=r.constructor,F=r.s==i.s?1:-1,U=r.d,B=i.d;if(!r.s)return new $(r);if(!i.s)throw Error(Vi+"Division by zero");for(d=r.e-i.e,_=B.length,T=U.length,v=new $(F),j=v.d=[],f=0;B[f]==(U[f]||0);)++f;if(B[f]>(U[f]||0)&&--d,a==null?E=a=$.precision:l?E=a+(qn(r)-qn(i))+1:E=a,E<0)return new $(0);if(E=E/sn+2|0,f=0,_==1)for(p=0,B=B[0],E++;(f<T||p)&&E--;f++)C=p*Jn+(U[f]||0),j[f]=C/B|0,p=C%B|0;else{for(p=Jn/(B[0]+1)|0,p>1&&(B=e(B,p),U=e(U,p),_=B.length,T=U.length),A=_,b=U.slice(0,_),S=b.length;S<_;)b[S++]=0;P=B.slice(),P.unshift(0),O=B[0],B[1]>=Jn/2&&++O;do p=0,u=t(B,b,_,S),u<0?(k=b[0],_!=S&&(k=k*Jn+(b[1]||0)),p=k/O|0,p>1?(p>=Jn&&(p=Jn-1),m=e(B,p),g=m.length,S=b.length,u=t(m,b,g,S),u==1&&(p--,n(m,_<g?P:B,g))):(p==0&&(u=p=1),m=B.slice()),g=m.length,g<S&&m.unshift(0),n(b,m,S),u==-1&&(S=b.length,u=t(B,b,_,S),u<1&&(p++,n(b,_<S?P:B,S))),S=b.length):u===0&&(p++,b=[0]),j[f++]=p,u&&b[0]?b[S++]=U[A]||0:(b=[U[A]],S=1);while((A++<T||b[0]!==void 0)&&E--)}return j[0]||j.shift(),v.e=d,Qt(v,l?a+qn(v)+1:a)}})();function SU(e,t){var n,r,i,a,l,u,d=0,f=0,p=e.constructor,m=p.precision;if(qn(e)>16)throw Error(jC+qn(e));if(!e.s)return new p(fi);for(hn=!1,u=m,l=new p(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(r=Math.log(Rl(2,f))/Math.LN10*2+5|0,u+=r,n=i=a=new p(fi),p.precision=u;;){if(i=Qt(i.times(e),u),n=n.times(++d),l=a.plus(As(i,n,u)),La(l.d).slice(0,u)===La(a.d).slice(0,u)){for(;f--;)a=Qt(a.times(a),u);return p.precision=m,t==null?(hn=!0,Qt(a,m)):a}a=l}}function qn(e){for(var t=e.e*sn,n=e.d[0];n>=10;n/=10)t++;return t}function lS(e,t,n){if(t>e.LN10.sd())throw hn=!0,n&&(e.precision=n),Error(Vi+"LN10 precision limit exceeded");return Qt(new e(e.LN10),t)}function Oo(e){for(var t="";e--;)t+="0";return t}function Dh(e,t){var n,r,i,a,l,u,d,f,p,m=1,g=10,v=e,j=v.d,b=v.constructor,S=b.precision;if(v.s<1)throw Error(Vi+(v.s?"NaN":"-Infinity"));if(v.eq(fi))return new b(0);if(t==null?(hn=!1,f=S):f=t,v.eq(10))return t==null&&(hn=!0),lS(b,f);if(f+=g,b.precision=f,n=La(j),r=n.charAt(0),a=qn(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=La(v.d),r=n.charAt(0),m++;a=qn(v),r>1?(v=new b("0."+n),a++):v=new b(r+"."+n.slice(1))}else return d=lS(b,f+2,S).times(a+""),v=Dh(new b(r+"."+n.slice(1)),f-g).plus(d),b.precision=S,t==null?(hn=!0,Qt(v,S)):v;for(u=l=v=As(v.minus(fi),v.plus(fi),f),p=Qt(v.times(v),f),i=3;;){if(l=Qt(l.times(p),f),d=u.plus(As(l,new b(i),f)),La(d.d).slice(0,f)===La(u.d).slice(0,f))return u=u.times(2),a!==0&&(u=u.plus(lS(b,f+2,S).times(a+""))),u=As(u,new b(m),f),b.precision=S,t==null?(hn=!0,Qt(u,S)):u;u=d,i+=2}}function vM(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=Ad(n/sn),e.d=[],r=(n+1)%sn,n<0&&(r+=sn),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=sn;r<i;)e.d.push(+t.slice(r,r+=sn));t=t.slice(r),r=sn-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),hn&&(e.e>Ky||e.e<-Ky))throw Error(jC+n)}else e.s=0,e.e=0,e.d=[0];return e}function Qt(e,t,n){var r,i,a,l,u,d,f,p,m=e.d;for(l=1,a=m[0];a>=10;a/=10)l++;if(r=t-l,r<0)r+=sn,i=t,f=m[p=0];else{if(p=Math.ceil((r+1)/sn),a=m.length,p>=a)return e;for(f=a=m[p],l=1;a>=10;a/=10)l++;r%=sn,i=r-sn+l}if(n!==void 0&&(a=Rl(10,l-i-1),u=f/a%10|0,d=t<0||m[p+1]!==void 0||f%a,d=n<4?(u||d)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||d||n==6&&(r>0?i>0?f/Rl(10,l-i):0:m[p-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return d?(a=qn(e),m.length=1,t=t-a-1,m[0]=Rl(10,(sn-t%sn)%sn),e.e=Ad(-t/sn)||0):(m.length=1,m[0]=e.e=e.s=0),e;if(r==0?(m.length=p,a=1,p--):(m.length=p+1,a=Rl(10,sn-r),m[p]=i>0?(f/Rl(10,l-i)%Rl(10,i)|0)*a:0),d)for(;;)if(p==0){(m[0]+=a)==Jn&&(m[0]=1,++e.e);break}else{if(m[p]+=a,m[p]!=Jn)break;m[p--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(hn&&(e.e>Ky||e.e<-Ky))throw Error(jC+qn(e));return e}function NU(e,t){var n,r,i,a,l,u,d,f,p,m,g=e.constructor,v=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),hn?Qt(t,v):t;if(d=e.d,m=t.d,r=t.e,f=e.e,d=d.slice(),l=f-r,l){for(p=l<0,p?(n=d,l=-l,u=m.length):(n=m,r=f,u=d.length),i=Math.max(Math.ceil(v/sn),u)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=d.length,u=m.length,p=i<u,p&&(u=i),i=0;i<u;i++)if(d[i]!=m[i]){p=d[i]<m[i];break}l=0}for(p&&(n=d,d=m,m=n,t.s=-t.s),u=d.length,i=m.length-u;i>0;--i)d[u++]=0;for(i=m.length;i>l;){if(d[--i]<m[i]){for(a=i;a&&d[--a]===0;)d[a]=Jn-1;--d[a],d[i]+=Jn}d[i]-=m[i]}for(;d[--u]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,hn?Qt(t,v):t):new g(0)}function dc(e,t,n){var r,i=qn(e),a=La(e.d),l=a.length;return t?(n&&(r=n-l)>0?a=a.charAt(0)+"."+a.slice(1)+Oo(r):l>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Oo(-i-1)+a,n&&(r=n-l)>0&&(a+=Oo(r))):i>=l?(a+=Oo(i+1-l),n&&(r=n-i-1)>0&&(a=a+"."+Oo(r))):((r=i+1)<l&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(a+="."),a+=Oo(r))),e.s<0?"-"+a:a}function xM(e,t){if(e.length>t)return e.length=t,!0}function kU(e){var t,n,r;function i(a){var l=this;if(!(l instanceof i))return new i(a);if(l.constructor=i,a instanceof i){l.s=a.s,l.e=a.e,l.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Yl+a);if(a>0)l.s=1;else if(a<0)a=-a,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(a===~~a&&a<1e7){l.e=0,l.d=[a];return}return vM(l,a.toString())}else if(typeof a!="string")throw Error(Yl+a);if(a.charCodeAt(0)===45?(a=a.slice(1),l.s=-1):l.s=1,gve.test(a))vM(l,a);else throw Error(Yl+a)}if(i.prototype=Re,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=kU,i.config=i.set=yve,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 yve(e){if(!e||typeof e!="object")throw Error(Vi+"Object expected");var t,n,r,i=["precision",1,Cd,"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(Ad(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Yl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Yl+n+": "+r);return this}var SC=kU(mve);fi=new SC(1);const jt=SC;function CU(e){var t;return e===0?t=1:t=Math.floor(new jt(e).abs().log(10).toNumber())+1,t}function AU(e,t,n){for(var r=new jt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var OU=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},NC=(e,t,n)=>{if(e.lte(0))return new jt(0);var r=CU(e.toNumber()),i=new jt(10).pow(r),a=e.div(i),l=r!==1?.05:.1,u=new jt(Math.ceil(a.div(l).toNumber())).add(n).mul(l),d=u.mul(i);return t?new jt(d.toNumber()):new jt(Math.ceil(d.toNumber()))},EU=(e,t,n)=>{var r;if(e.lte(0))return new jt(0);var i=[1,2,2.5,5],a=e.toNumber(),l=Math.floor(new jt(a).abs().log(10).toNumber()),u=new jt(10).pow(l),d=e.div(u).toNumber(),f=i.findIndex(v=>v>=d-1e-10);if(f===-1&&(u=u.mul(10),f=0),f+=n,f>=i.length){var p=Math.floor(f/i.length);f%=i.length,u=u.mul(new jt(10).pow(p))}var m=(r=i[f])!==null&&r!==void 0?r:1,g=new jt(m).mul(u);return t?g:new jt(Math.ceil(g.toNumber()))},vve=(e,t,n)=>{var r=new jt(1),i=new jt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new jt(10).pow(CU(e)-1),i=new jt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new jt(Math.floor(e)))}else e===0?i=new jt(Math.floor((t-1)/2)):n||(i=new jt(Math.floor(e)));for(var l=Math.floor((t-1)/2),u=[],d=0;d<t;d++)u.push(i.add(new jt(d-l).mul(r)).toNumber());return u},_U=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:NC;if(!Number.isFinite((n-t)/(r-1)))return{step:new jt(0),tickMin:new jt(0),tickMax:new jt(0)};var u=l(new jt(n).sub(t).div(r-1),i,a),d;t<=0&&n>=0?d=new jt(0):(d=new jt(t).add(n).div(2),d=d.sub(new jt(d).mod(u)));var f=Math.ceil(d.sub(t).div(u).toNumber()),p=Math.ceil(new jt(n).sub(d).div(u).toNumber()),m=f+p+1;return m>r?_U(t,n,r,i,a+1,l):(m<r&&(p=n>0?p+(r-m):p,f=n>0?f:f+(r-m)),{step:u,tickMin:d.sub(new jt(f).mul(u)),tickMax:d.add(new jt(p).mul(u))})},bM=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",u=Math.max(i,2),[d,f]=OU([n,r]);if(d===-1/0||f===1/0){var p=f===1/0?[d,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),f];return n>r?p.reverse():p}if(d===f)return vve(d,i,a);var m=l==="snap125"?EU:NC,{step:g,tickMin:v,tickMax:j}=_U(d,f,u,a,0,m),b=AU(v,j.add(new jt(.1).mul(g)),g);return n>r?b.reverse():b},wM=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[u,d]=OU([r,i]);if(u===-1/0||d===1/0)return[r,i];if(u===d)return[u];var f=l==="snap125"?EU:NC,p=Math.max(n,2),m=f(new jt(d).sub(u).div(p-1),a,0),g=[...AU(new jt(u),new jt(d),m),d];return a===!1&&(g=g.map(v=>Math.round(v))),r>i?g.reverse():g},zU=e=>e.rootProps.maxBarSize,xve=e=>e.rootProps.barGap,TU=e=>e.rootProps.barCategoryGap,bve=e=>e.rootProps.barSize,kx=e=>e.rootProps.stackOffset,PU=e=>e.rootProps.reverseStackOrder,kC=e=>e.options.chartName,CC=e=>e.rootProps.syncId,RU=e=>e.rootProps.syncMethod,AC=e=>e.options.eventEmitter,wve=e=>e.rootProps.baseValue,Wn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Cl={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Ea={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Cx=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Ax(e,t,n){if(n!=="auto")return n;if(e!=null)return xa(e,t)?"category":"number"}function jM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jM(Object(n),!0).forEach(function(r){jve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jve(e,t,n){return(t=Sve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sve(e){var t=Nve(e,"string");return typeof t=="symbol"?t:t+""}function Nve(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 SM={allowDataOverflow:Cl.allowDataOverflow,allowDecimals:Cl.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Cl.angleAxisId,includeHidden:!1,name:void 0,reversed:Cl.reversed,scale:Cl.scale,tick:Cl.tick,tickCount:void 0,ticks:void 0,type:Cl.type,unit:void 0,niceTicks:"auto"},NM={allowDataOverflow:Ea.allowDataOverflow,allowDecimals:Ea.allowDecimals,allowDuplicatedCategory:Ea.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Ea.radiusAxisId,includeHidden:Ea.includeHidden,name:void 0,reversed:Ea.reversed,scale:Ea.scale,tick:Ea.tick,tickCount:Ea.tickCount,ticks:void 0,type:Ea.type,unit:void 0,niceTicks:"auto"},kve=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},OC=re([kve,J6],(e,t)=>{var n;if(e!=null)return e;var r=(n=Ax(t,"angleAxis",SM.type))!==null&&n!==void 0?n:"category";return Gy(Gy({},SM),{},{type:r})}),Cve=(e,t)=>e.polarAxis.radiusAxis[t],EC=re([Cve,J6],(e,t)=>{var n;if(e!=null)return e;var r=(n=Ax(t,"radiusAxis",NM.type))!==null&&n!==void 0?n:"category";return Gy(Gy({},NM),{},{type:r})}),Ox=e=>e.polarOptions,_C=re([Bs,Us,nr],Zye),DU=re([Ox,_C],(e,t)=>{if(e!=null)return ha(e.innerRadius,t,0)}),MU=re([Ox,_C],(e,t)=>{if(e!=null)return ha(e.outerRadius,t,t*.8)}),Ave=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},IU=re([Ox],Ave);re([OC,IU],Cx);var LU=re([_C,DU,MU],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});re([EC,LU],Cx);var $U=re([_t,Ox,DU,MU,Bs,Us],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:l,cy:u,startAngle:d,endAngle:f}=t;return{cx:ha(l,i,i/2),cy:ha(u,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:f,clockWise:!1}}}),ir=(e,t)=>t,Ex=(e,t,n)=>n;function _x(e){return e?.id}function BU(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,l=new Map;return e.forEach(u=>{var d,f=(d=u.data)!==null&&d!==void 0?d:r;if(!(f==null||f.length===0)){var p=_x(u);f.forEach((m,g)=>{var v=a==null||i?g:String(vn(m,a,null)),j=vn(m,u.dataKey,0),b;l.has(v)?b=l.get(v):b={},Object.assign(b,{[p]:j}),l.set(v,b)})}}),Array.from(l.values())}function zx(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Tx=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Px(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Ove(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 ar=e=>{var t=_t(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Od=e=>e.tooltip.settings.axisId;function zC(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(a){function l(){return a.apply(this,arguments)}return l.toString=function(){return a.toString()},l})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var l=i[0],u=i[1];return l<=u?a>=l&&a<=u:a>=u&&a<=l},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,l)=>{var u=e(a);if(u!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var d=e.bandwidth();switch(l.position){case"middle":u+=d/2;break;case"end":u+=d;break}}return u}}}}}var Eve=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!$a(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];ht(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function Uo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function _ve(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function TC(e){let t,n,r;e.length!==2?(t=Uo,n=(u,d)=>Uo(e(u),d),r=(u,d)=>e(u)-d):(t=e===Uo||e===_ve?e:zve,n=e,r=e);function i(u,d,f=0,p=u.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(u[m],d)<0?f=m+1:p=m}while(f<p)}return f}function a(u,d,f=0,p=u.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(u[m],d)<=0?f=m+1:p=m}while(f<p)}return f}function l(u,d,f=0,p=u.length){const m=i(u,d,f,p-1);return m>f&&r(u[m-1],d)>-r(u[m],d)?m-1:m}return{left:i,center:l,right:a}}function zve(){return 0}function UU(e){return e===null?NaN:+e}function*Tve(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Pve=TC(Uo),up=Pve.right;TC(UU).center;class kM extends Map{constructor(t,n=Mve){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(CM(this,t))}has(t){return super.has(CM(this,t))}set(t,n){return super.set(Rve(this,t),n)}delete(t){return super.delete(Dve(this,t))}}function CM({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Rve({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Dve({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Mve(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Ive(e=Uo){if(e===Uo)return qU;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 qU(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Lve=Math.sqrt(50),$ve=Math.sqrt(10),Bve=Math.sqrt(2);function Vy(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),l=a>=Lve?10:a>=$ve?5:a>=Bve?2:1;let u,d,f;return i<0?(f=Math.pow(10,-i)/l,u=Math.round(e*f),d=Math.round(t*f),u/f<e&&++u,d/f>t&&--d,f=-f):(f=Math.pow(10,i)*l,u=Math.round(e/f),d=Math.round(t/f),u*f<e&&++u,d*f>t&&--d),d<u&&.5<=n&&n<2?Vy(e,t,n*2):[u,d,f]}function nN(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,l]=r?Vy(t,e,n):Vy(e,t,n);if(!(a>=i))return[];const u=a-i+1,d=new Array(u);if(r)if(l<0)for(let f=0;f<u;++f)d[f]=(a-f)/-l;else for(let f=0;f<u;++f)d[f]=(a-f)*l;else if(l<0)for(let f=0;f<u;++f)d[f]=(i+f)/-l;else for(let f=0;f<u;++f)d[f]=(i+f)*l;return d}function rN(e,t,n){return t=+t,e=+e,n=+n,Vy(e,t,n)[2]}function iN(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?rN(t,e,n):rN(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function AM(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function OM(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function FU(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?qU:Ive(i);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,p=Math.log(d),m=.5*Math.exp(2*p/3),g=.5*Math.sqrt(p*m*(d-m)/d)*(f-d/2<0?-1:1),v=Math.max(n,Math.floor(t-f*m/d+g)),j=Math.min(r,Math.floor(t+(d-f)*m/d+g));FU(e,t,v,j,i)}const a=e[t];let l=n,u=r;for(Kf(e,n,t),i(e[r],a)>0&&Kf(e,n,r);l<u;){for(Kf(e,l,u),++l,--u;i(e[l],a)<0;)++l;for(;i(e[u],a)>0;)--u}i(e[n],a)===0?Kf(e,n,u):(++u,Kf(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function Kf(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Uve(e,t,n){if(e=Float64Array.from(Tve(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return OM(e);if(t>=1)return AM(e);var r,i=(r-1)*t,a=Math.floor(i),l=AM(FU(e,a).subarray(0,a+1)),u=OM(e.subarray(a+1));return l+(u-l)*(i-a)}}function qve(e,t,n=UU){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),l=+n(e[a],a,e),u=+n(e[a+1],a+1,e);return l+(u-l)*(i-a)}}function Fve(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function Zi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function qs(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 aN=Symbol("implicit");function PC(){var e=new kM,t=[],n=[],r=aN;function i(a){let l=e.get(a);if(l===void 0){if(r!==aN)return r;e.set(a,l=t.push(a)-1)}return n[l%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new kM;for(const l of a)e.has(l)||e.set(l,t.push(l)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return PC(t,n).unknown(r)},Zi.apply(i,arguments),i}function RC(){var e=PC().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,l,u=!1,d=0,f=0,p=.5;delete e.unknown;function m(){var g=t().length,v=i<r,j=v?i:r,b=v?r:i;a=(b-j)/Math.max(1,g-d+f*2),u&&(a=Math.floor(a)),j+=(b-j-a*(g-d))*p,l=a*(1-d),u&&(j=Math.round(j),l=Math.round(l));var S=Fve(g).map(function(k){return j+a*k});return n(v?S.reverse():S)}return e.domain=function(g){return arguments.length?(t(g),m()):t()},e.range=function(g){return arguments.length?([r,i]=g,r=+r,i=+i,m()):[r,i]},e.rangeRound=function(g){return[r,i]=g,r=+r,i=+i,u=!0,m()},e.bandwidth=function(){return l},e.step=function(){return a},e.round=function(g){return arguments.length?(u=!!g,m()):u},e.padding=function(g){return arguments.length?(d=Math.min(1,f=+g),m()):d},e.paddingInner=function(g){return arguments.length?(d=Math.min(1,g),m()):d},e.paddingOuter=function(g){return arguments.length?(f=+g,m()):f},e.align=function(g){return arguments.length?(p=Math.max(0,Math.min(1,g)),m()):p},e.copy=function(){return RC(t(),[r,i]).round(u).paddingInner(d).paddingOuter(f).align(p)},Zi.apply(m(),arguments)}function HU(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return HU(t())},e}function Hve(){return HU(RC.apply(null,arguments).paddingInner(1))}function DC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function KU(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function dp(){}var Mh=.7,Qy=1/Mh,Hu="\\s*([+-]?\\d+)\\s*",Ih="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ba="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Kve=/^#([0-9a-f]{3,8})$/,Gve=new RegExp(`^rgb\\(${Hu},${Hu},${Hu}\\)$`),Vve=new RegExp(`^rgb\\(${Ba},${Ba},${Ba}\\)$`),Qve=new RegExp(`^rgba\\(${Hu},${Hu},${Hu},${Ih}\\)$`),Wve=new RegExp(`^rgba\\(${Ba},${Ba},${Ba},${Ih}\\)$`),Yve=new RegExp(`^hsl\\(${Ih},${Ba},${Ba}\\)$`),Zve=new RegExp(`^hsla\\(${Ih},${Ba},${Ba},${Ih}\\)$`),EM={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};DC(dp,Lh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_M,formatHex:_M,formatHex8:Xve,formatHsl:Jve,formatRgb:zM,toString:zM});function _M(){return this.rgb().formatHex()}function Xve(){return this.rgb().formatHex8()}function Jve(){return GU(this).formatHsl()}function zM(){return this.rgb().formatRgb()}function Lh(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Kve.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?TM(t):n===3?new Zr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?xg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?xg(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Gve.exec(e))?new Zr(t[1],t[2],t[3],1):(t=Vve.exec(e))?new Zr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Qve.exec(e))?xg(t[1],t[2],t[3],t[4]):(t=Wve.exec(e))?xg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Yve.exec(e))?DM(t[1],t[2]/100,t[3]/100,1):(t=Zve.exec(e))?DM(t[1],t[2]/100,t[3]/100,t[4]):EM.hasOwnProperty(e)?TM(EM[e]):e==="transparent"?new Zr(NaN,NaN,NaN,0):null}function TM(e){return new Zr(e>>16&255,e>>8&255,e&255,1)}function xg(e,t,n,r){return r<=0&&(e=t=n=NaN),new Zr(e,t,n,r)}function exe(e){return e instanceof dp||(e=Lh(e)),e?(e=e.rgb(),new Zr(e.r,e.g,e.b,e.opacity)):new Zr}function sN(e,t,n,r){return arguments.length===1?exe(e):new Zr(e,t,n,r??1)}function Zr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}DC(Zr,sN,KU(dp,{brighter(e){return e=e==null?Qy:Math.pow(Qy,e),new Zr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Mh:Math.pow(Mh,e),new Zr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Zr(Zl(this.r),Zl(this.g),Zl(this.b),Wy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:PM,formatHex:PM,formatHex8:txe,formatRgb:RM,toString:RM}));function PM(){return`#${ql(this.r)}${ql(this.g)}${ql(this.b)}`}function txe(){return`#${ql(this.r)}${ql(this.g)}${ql(this.b)}${ql((isNaN(this.opacity)?1:this.opacity)*255)}`}function RM(){const e=Wy(this.opacity);return`${e===1?"rgb(":"rgba("}${Zl(this.r)}, ${Zl(this.g)}, ${Zl(this.b)}${e===1?")":`, ${e})`}`}function Wy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ql(e){return e=Zl(e),(e<16?"0":"")+e.toString(16)}function DM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ca(e,t,n,r)}function GU(e){if(e instanceof ca)return new ca(e.h,e.s,e.l,e.opacity);if(e instanceof dp||(e=Lh(e)),!e)return new ca;if(e instanceof ca)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),l=NaN,u=a-i,d=(a+i)/2;return u?(t===a?l=(n-r)/u+(n<r)*6:n===a?l=(r-t)/u+2:l=(t-n)/u+4,u/=d<.5?a+i:2-a-i,l*=60):u=d>0&&d<1?0:l,new ca(l,u,d,e.opacity)}function nxe(e,t,n,r){return arguments.length===1?GU(e):new ca(e,t,n,r??1)}function ca(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}DC(ca,nxe,KU(dp,{brighter(e){return e=e==null?Qy:Math.pow(Qy,e),new ca(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Mh:Math.pow(Mh,e),new ca(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Zr(cS(e>=240?e-240:e+120,i,r),cS(e,i,r),cS(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ca(MM(this.h),bg(this.s),bg(this.l),Wy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Wy(this.opacity);return`${e===1?"hsl(":"hsla("}${MM(this.h)}, ${bg(this.s)*100}%, ${bg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function MM(e){return e=(e||0)%360,e<0?e+360:e}function bg(e){return Math.max(0,Math.min(1,e||0))}function cS(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 MC=e=>()=>e;function rxe(e,t){return function(n){return e+n*t}}function ixe(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 axe(e){return(e=+e)==1?VU:function(t,n){return n-t?ixe(t,n,e):MC(isNaN(t)?n:t)}}function VU(e,t){var n=t-e;return n?rxe(e,n):MC(isNaN(e)?t:e)}const IM=(function e(t){var n=axe(t);function r(i,a){var l=n((i=sN(i)).r,(a=sN(a)).r),u=n(i.g,a.g),d=n(i.b,a.b),f=VU(i.opacity,a.opacity);return function(p){return i.r=l(p),i.g=u(p),i.b=d(p),i.opacity=f(p),i+""}}return r.gamma=e,r})(1);function sxe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function oxe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function lxe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),l;for(l=0;l<r;++l)i[l]=Ed(e[l],t[l]);for(;l<n;++l)a[l]=t[l];return function(u){for(l=0;l<r;++l)a[l]=i[l](u);return a}}function cxe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Yy(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function uxe(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]=Ed(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var oN=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uS=new RegExp(oN.source,"g");function dxe(e){return function(){return e}}function fxe(e){return function(t){return e(t)+""}}function hxe(e,t){var n=oN.lastIndex=uS.lastIndex=0,r,i,a,l=-1,u=[],d=[];for(e=e+"",t=t+"";(r=oN.exec(e))&&(i=uS.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),u[l]?u[l]+=a:u[++l]=a),(r=r[0])===(i=i[0])?u[l]?u[l]+=i:u[++l]=i:(u[++l]=null,d.push({i:l,x:Yy(r,i)})),n=uS.lastIndex;return n<t.length&&(a=t.slice(n),u[l]?u[l]+=a:u[++l]=a),u.length<2?d[0]?fxe(d[0].x):dxe(t):(t=d.length,function(f){for(var p=0,m;p<t;++p)u[(m=d[p]).i]=m.x(f);return u.join("")})}function Ed(e,t){var n=typeof t,r;return t==null||n==="boolean"?MC(t):(n==="number"?Yy:n==="string"?(r=Lh(t))?(t=r,IM):hxe:t instanceof Lh?IM:t instanceof Date?cxe:oxe(t)?sxe:Array.isArray(t)?lxe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?uxe:Yy)(e,t)}function IC(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function pxe(e,t){t===void 0&&(t=e,e=Ed);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(l){var u=Math.max(0,Math.min(r-1,Math.floor(l*=r)));return a[u](l-u)}}function mxe(e){return function(){return e}}function Zy(e){return+e}var LM=[0,1];function Rr(e){return e}function lN(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:mxe(isNaN(t)?NaN:.5)}function gxe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function yxe(e,t,n){var r=e[0],i=e[1],a=t[0],l=t[1];return i<r?(r=lN(i,r),a=n(l,a)):(r=lN(r,i),a=n(a,l)),function(u){return a(r(u))}}function vxe(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),l=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<r;)i[l]=lN(e[l],e[l+1]),a[l]=n(t[l],t[l+1]);return function(u){var d=up(e,u,1,r)-1;return a[d](i[d](u))}}function fp(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Rx(){var e=LM,t=LM,n=Ed,r,i,a,l=Rr,u,d,f;function p(){var g=Math.min(e.length,t.length);return l!==Rr&&(l=gxe(e[0],e[g-1])),u=g>2?vxe:yxe,d=f=null,m}function m(g){return g==null||isNaN(g=+g)?a:(d||(d=u(e.map(r),t,n)))(r(l(g)))}return m.invert=function(g){return l(i((f||(f=u(t,e.map(r),Yy)))(g)))},m.domain=function(g){return arguments.length?(e=Array.from(g,Zy),p()):e.slice()},m.range=function(g){return arguments.length?(t=Array.from(g),p()):t.slice()},m.rangeRound=function(g){return t=Array.from(g),n=IC,p()},m.clamp=function(g){return arguments.length?(l=g?!0:Rr,p()):l!==Rr},m.interpolate=function(g){return arguments.length?(n=g,p()):n},m.unknown=function(g){return arguments.length?(a=g,m):a},function(g,v){return r=g,i=v,p()}}function LC(){return Rx()(Rr,Rr)}function xxe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Xy(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function sd(e){return e=Xy(Math.abs(e)),e?e[1]:NaN}function bxe(e,t){return function(n,r){for(var i=n.length,a=[],l=0,u=e[0],d=0;i>0&&u>0&&(d+u+1>r&&(u=Math.max(1,r-d)),a.push(n.substring(i-=u,i+u)),!((d+=u+1)>r));)u=e[l=(l+1)%e.length];return a.reverse().join(t)}}function wxe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var jxe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $h(e){if(!(t=jxe.exec(e)))throw new Error("invalid format: "+e);var t;return new $C({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]})}$h.prototype=$C.prototype;function $C(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+""}$C.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 Sxe(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Jy;function Nxe(e,t){var n=Xy(e,t);if(!n)return Jy=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Jy=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return a===l?r:a>l?r+new Array(a-l+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Xy(e,Math.max(0,t+a-1))[0]}function $M(e,t){var n=Xy(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const BM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:xxe,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)=>$M(e*100,t),r:$M,s:Nxe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function UM(e){return e}var qM=Array.prototype.map,FM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function kxe(e){var t=e.grouping===void 0||e.thousands===void 0?UM:bxe(qM.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?UM:wxe(qM.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(m,g){m=$h(m);var v=m.fill,j=m.align,b=m.sign,S=m.symbol,k=m.zero,E=m.width,C=m.comma,A=m.precision,T=m.trim,O=m.type;O==="n"?(C=!0,O="g"):BM[O]||(A===void 0&&(A=12),T=!0,O="g"),(k||v==="0"&&j==="=")&&(k=!0,v="0",j="=");var _=(g&&g.prefix!==void 0?g.prefix:"")+(S==="$"?n:S==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),P=(S==="$"?r:/[%p]/.test(O)?l:"")+(g&&g.suffix!==void 0?g.suffix:""),$=BM[O],F=/[defgprs%]/.test(O);A=A===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function U(B){var V=_,X=P,Z,H,J;if(O==="c")X=$(B)+X,B="";else{B=+B;var oe=B<0||1/B<0;if(B=isNaN(B)?d:$(Math.abs(B),A),T&&(B=Sxe(B)),oe&&+B==0&&b!=="+"&&(oe=!1),V=(oe?b==="("?b:u:b==="-"||b==="("?"":b)+V,X=(O==="s"&&!isNaN(B)&&Jy!==void 0?FM[8+Jy/3]:"")+X+(oe&&b==="("?")":""),F){for(Z=-1,H=B.length;++Z<H;)if(J=B.charCodeAt(Z),48>J||J>57){X=(J===46?i+B.slice(Z+1):B.slice(Z))+X,B=B.slice(0,Z);break}}}C&&!k&&(B=t(B,1/0));var ye=V.length+B.length+X.length,I=ye<E?new Array(E-ye+1).join(v):"";switch(C&&k&&(B=t(I+B,I.length?E-X.length:1/0),I=""),j){case"<":B=V+B+X+I;break;case"=":B=V+I+B+X;break;case"^":B=I.slice(0,ye=I.length>>1)+V+B+X+I.slice(ye);break;default:B=I+V+B+X;break}return a(B)}return U.toString=function(){return m+""},U}function p(m,g){var v=Math.max(-8,Math.min(8,Math.floor(sd(g)/3)))*3,j=Math.pow(10,-v),b=f((m=$h(m),m.type="f",m),{suffix:FM[8+v/3]});return function(S){return b(j*S)}}return{format:f,formatPrefix:p}}var wg,BC,QU;Cxe({thousands:",",grouping:[3],currency:["$",""]});function Cxe(e){return wg=kxe(e),BC=wg.format,QU=wg.formatPrefix,wg}function Axe(e){return Math.max(0,-sd(Math.abs(e)))}function Oxe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(sd(t)/3)))*3-sd(Math.abs(e)))}function Exe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,sd(t)-sd(e))+1}function WU(e,t,n,r){var i=iN(e,t,n),a;switch(r=$h(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Oxe(i,l))&&(r.precision=a),QU(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Exe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Axe(i))&&(r.precision=a-(r.type==="%")*2);break}}return BC(r)}function nl(e){var t=e.domain;return e.ticks=function(n){var r=t();return nN(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return WU(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,l=r[i],u=r[a],d,f,p=10;for(u<l&&(f=l,l=u,u=f,f=i,i=a,a=f);p-- >0;){if(f=rN(l,u,n),f===d)return r[i]=l,r[a]=u,t(r);if(f>0)l=Math.floor(l/f)*f,u=Math.ceil(u/f)*f;else if(f<0)l=Math.ceil(l*f)/f,u=Math.floor(u*f)/f;else break;d=f}return e},e}function YU(){var e=LC();return e.copy=function(){return fp(e,YU())},Zi.apply(e,arguments),nl(e)}function ZU(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Zy),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return ZU(e).unknown(t)},e=arguments.length?Array.from(e,Zy):[0,1],nl(n)}function XU(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],l;return a<i&&(l=n,n=r,r=l,l=i,i=a,a=l),e[n]=t.floor(i),e[r]=t.ceil(a),e}function HM(e){return Math.log(e)}function KM(e){return Math.exp(e)}function _xe(e){return-Math.log(-e)}function zxe(e){return-Math.exp(-e)}function Txe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Pxe(e){return e===10?Txe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Rxe(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 GM(e){return(t,n)=>-e(-t,n)}function UC(e){const t=e(HM,KM),n=t.domain;let r=10,i,a;function l(){return i=Rxe(r),a=Pxe(r),n()[0]<0?(i=GM(i),a=GM(a),e(_xe,zxe)):e(HM,KM),t}return t.base=function(u){return arguments.length?(r=+u,l()):r},t.domain=function(u){return arguments.length?(n(u),l()):n()},t.ticks=u=>{const d=n();let f=d[0],p=d[d.length-1];const m=p<f;m&&([f,p]=[p,f]);let g=i(f),v=i(p),j,b;const S=u==null?10:+u;let k=[];if(!(r%1)&&v-g<S){if(g=Math.floor(g),v=Math.ceil(v),f>0){for(;g<=v;++g)for(j=1;j<r;++j)if(b=g<0?j/a(-g):j*a(g),!(b<f)){if(b>p)break;k.push(b)}}else for(;g<=v;++g)for(j=r-1;j>=1;--j)if(b=g>0?j/a(-g):j*a(g),!(b<f)){if(b>p)break;k.push(b)}k.length*2<S&&(k=nN(f,p,S))}else k=nN(g,v,Math.min(v-g,S)).map(a);return m?k.reverse():k},t.tickFormat=(u,d)=>{if(u==null&&(u=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=$h(d)).precision==null&&(d.trim=!0),d=BC(d)),u===1/0)return d;const f=Math.max(1,r*u/t.ticks().length);return p=>{let m=p/a(Math.round(i(p)));return m*r<r-.5&&(m*=r),m<=f?d(p):""}},t.nice=()=>n(XU(n(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function JU(){const e=UC(Rx()).domain([1,10]);return e.copy=()=>fp(e,JU()).base(e.base()),Zi.apply(e,arguments),e}function VM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function QM(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function qC(e){var t=1,n=e(VM(t),QM(t));return n.constant=function(r){return arguments.length?e(VM(t=+r),QM(t)):t},nl(n)}function eq(){var e=qC(Rx());return e.copy=function(){return fp(e,eq()).constant(e.constant())},Zi.apply(e,arguments)}function WM(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Dxe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Mxe(e){return e<0?-e*e:e*e}function FC(e){var t=e(Rr,Rr),n=1;function r(){return n===1?e(Rr,Rr):n===.5?e(Dxe,Mxe):e(WM(n),WM(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},nl(t)}function HC(){var e=FC(Rx());return e.copy=function(){return fp(e,HC()).exponent(e.exponent())},Zi.apply(e,arguments),e}function Ixe(){return HC.apply(null,arguments).exponent(.5)}function YM(e){return Math.sign(e)*e*e}function Lxe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function tq(){var e=LC(),t=[0,1],n=!1,r;function i(a){var l=Lxe(e(a));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(a){return e.invert(YM(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Zy)).map(YM)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return tq(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Zi.apply(i,arguments),nl(i)}function nq(){var e=[],t=[],n=[],r;function i(){var l=0,u=Math.max(1,t.length);for(n=new Array(u-1);++l<u;)n[l-1]=qve(e,l/u);return a}function a(l){return l==null||isNaN(l=+l)?r:t[up(n,l)]}return a.invertExtent=function(l){var u=t.indexOf(l);return u<0?[NaN,NaN]:[u>0?n[u-1]:e[0],u<n.length?n[u]:e[e.length-1]]},a.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let u of l)u!=null&&!isNaN(u=+u)&&e.push(u);return e.sort(Uo),i()},a.range=function(l){return arguments.length?(t=Array.from(l),i()):t.slice()},a.unknown=function(l){return arguments.length?(r=l,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return nq().domain(e).range(t).unknown(r)},Zi.apply(a,arguments)}function rq(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function l(d){return d!=null&&d<=d?i[up(r,d,0,n)]:a}function u(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return l}return l.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,u()):[e,t]},l.range=function(d){return arguments.length?(n=(i=Array.from(d)).length-1,u()):i.slice()},l.invertExtent=function(d){var f=i.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},l.unknown=function(d){return arguments.length&&(a=d),l},l.thresholds=function(){return r.slice()},l.copy=function(){return rq().domain([e,t]).range(i).unknown(a)},Zi.apply(nl(l),arguments)}function iq(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[up(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var l=t.indexOf(a);return[e[l-1],e[l]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return iq().domain(e).range(t).unknown(n)},Zi.apply(i,arguments)}const dS=new Date,fS=new Date;function Yn(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const l=i(a),u=i.ceil(a);return a-l<u-a?l:u},i.offset=(a,l)=>(t(a=new Date(+a),l==null?1:Math.floor(l)),a),i.range=(a,l,u)=>{const d=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a<l)||!(u>0))return d;let f;do d.push(f=new Date(+a)),t(a,u),e(a);while(f<a&&a<l);return d},i.filter=a=>Yn(l=>{if(l>=l)for(;e(l),!a(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!a(l););else for(;--u>=0;)for(;t(l,1),!a(l););}),n&&(i.count=(a,l)=>(dS.setTime(+a),fS.setTime(+l),e(dS),e(fS),Math.floor(n(dS,fS))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?l=>r(l)%a===0:l=>i.count(0,l)%a===0):i)),i}const ev=Yn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ev.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Yn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ev);ev.range;const Ns=1e3,qi=Ns*60,ks=qi*60,Ps=ks*24,KC=Ps*7,ZM=Ps*30,hS=Ps*365,Fl=Yn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ns)},(e,t)=>(t-e)/Ns,e=>e.getUTCSeconds());Fl.range;const GC=Yn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ns)},(e,t)=>{e.setTime(+e+t*qi)},(e,t)=>(t-e)/qi,e=>e.getMinutes());GC.range;const VC=Yn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*qi)},(e,t)=>(t-e)/qi,e=>e.getUTCMinutes());VC.range;const QC=Yn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ns-e.getMinutes()*qi)},(e,t)=>{e.setTime(+e+t*ks)},(e,t)=>(t-e)/ks,e=>e.getHours());QC.range;const WC=Yn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ks)},(e,t)=>(t-e)/ks,e=>e.getUTCHours());WC.range;const hp=Yn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*qi)/Ps,e=>e.getDate()-1);hp.range;const Dx=Yn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ps,e=>e.getUTCDate()-1);Dx.range;const aq=Yn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ps,e=>Math.floor(e/Ps));aq.range;function kc(e){return Yn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*qi)/KC)}const Mx=kc(0),tv=kc(1),$xe=kc(2),Bxe=kc(3),od=kc(4),Uxe=kc(5),qxe=kc(6);Mx.range;tv.range;$xe.range;Bxe.range;od.range;Uxe.range;qxe.range;function Cc(e){return Yn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/KC)}const Ix=Cc(0),nv=Cc(1),Fxe=Cc(2),Hxe=Cc(3),ld=Cc(4),Kxe=Cc(5),Gxe=Cc(6);Ix.range;nv.range;Fxe.range;Hxe.range;ld.range;Kxe.range;Gxe.range;const YC=Yn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());YC.range;const ZC=Yn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());ZC.range;const Rs=Yn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Rs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Rs.range;const Ds=Yn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ds.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Ds.range;function sq(e,t,n,r,i,a){const l=[[Fl,1,Ns],[Fl,5,5*Ns],[Fl,15,15*Ns],[Fl,30,30*Ns],[a,1,qi],[a,5,5*qi],[a,15,15*qi],[a,30,30*qi],[i,1,ks],[i,3,3*ks],[i,6,6*ks],[i,12,12*ks],[r,1,Ps],[r,2,2*Ps],[n,1,KC],[t,1,ZM],[t,3,3*ZM],[e,1,hS]];function u(f,p,m){const g=p<f;g&&([f,p]=[p,f]);const v=m&&typeof m.range=="function"?m:d(f,p,m),j=v?v.range(f,+p+1):[];return g?j.reverse():j}function d(f,p,m){const g=Math.abs(p-f)/m,v=TC(([,,S])=>S).right(l,g);if(v===l.length)return e.every(iN(f/hS,p/hS,m));if(v===0)return ev.every(Math.max(iN(f,p,m),1));const[j,b]=l[g/l[v-1][2]<l[v][2]/g?v-1:v];return j.every(b)}return[u,d]}const[Vxe,Qxe]=sq(Ds,ZC,Ix,aq,WC,VC),[Wxe,Yxe]=sq(Rs,YC,Mx,hp,QC,GC);function pS(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 mS(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 Gf(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Zxe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,l=e.shortDays,u=e.months,d=e.shortMonths,f=Vf(i),p=Qf(i),m=Vf(a),g=Qf(a),v=Vf(l),j=Qf(l),b=Vf(u),S=Qf(u),k=Vf(d),E=Qf(d),C={a:J,A:oe,b:ye,B:I,c:null,d:rI,e:rI,f:b0e,g:_0e,G:T0e,H:y0e,I:v0e,j:x0e,L:oq,m:w0e,M:j0e,p:M,q,Q:sI,s:oI,S:S0e,u:N0e,U:k0e,V:C0e,w:A0e,W:O0e,x:null,X:null,y:E0e,Y:z0e,Z:P0e,"%":aI},A={a:D,A:G,b:se,B:ne,c:null,d:iI,e:iI,f:I0e,g:V0e,G:W0e,H:R0e,I:D0e,j:M0e,L:cq,m:L0e,M:$0e,p:Ce,q:Se,Q:sI,s:oI,S:B0e,u:U0e,U:q0e,V:F0e,w:H0e,W:K0e,x:null,X:null,y:G0e,Y:Q0e,Z:Y0e,"%":aI},T={a:F,A:U,b:B,B:V,c:X,d:tI,e:tI,f:h0e,g:eI,G:JM,H:nI,I:nI,j:c0e,L:f0e,m:l0e,M:u0e,p:$,q:o0e,Q:m0e,s:g0e,S:d0e,u:n0e,U:r0e,V:i0e,w:t0e,W:a0e,x:Z,X:H,y:eI,Y:JM,Z:s0e,"%":p0e};C.x=O(n,C),C.X=O(r,C),C.c=O(t,C),A.x=O(n,A),A.X=O(r,A),A.c=O(t,A);function O(ee,pe){return function(Ee){var Y=[],He=-1,Pe=0,at=ee.length,Ve,Ht,Lt;for(Ee instanceof Date||(Ee=new Date(+Ee));++He<at;)ee.charCodeAt(He)===37&&(Y.push(ee.slice(Pe,He)),(Ht=XM[Ve=ee.charAt(++He)])!=null?Ve=ee.charAt(++He):Ht=Ve==="e"?" ":"0",(Lt=pe[Ve])&&(Ve=Lt(Ee,Ht)),Y.push(Ve),Pe=He+1);return Y.push(ee.slice(Pe,He)),Y.join("")}}function _(ee,pe){return function(Ee){var Y=Gf(1900,void 0,1),He=P(Y,ee,Ee+="",0),Pe,at;if(He!=Ee.length)return null;if("Q"in Y)return new Date(Y.Q);if("s"in Y)return new Date(Y.s*1e3+("L"in Y?Y.L:0));if(pe&&!("Z"in Y)&&(Y.Z=0),"p"in Y&&(Y.H=Y.H%12+Y.p*12),Y.m===void 0&&(Y.m="q"in Y?Y.q:0),"V"in Y){if(Y.V<1||Y.V>53)return null;"w"in Y||(Y.w=1),"Z"in Y?(Pe=mS(Gf(Y.y,0,1)),at=Pe.getUTCDay(),Pe=at>4||at===0?nv.ceil(Pe):nv(Pe),Pe=Dx.offset(Pe,(Y.V-1)*7),Y.y=Pe.getUTCFullYear(),Y.m=Pe.getUTCMonth(),Y.d=Pe.getUTCDate()+(Y.w+6)%7):(Pe=pS(Gf(Y.y,0,1)),at=Pe.getDay(),Pe=at>4||at===0?tv.ceil(Pe):tv(Pe),Pe=hp.offset(Pe,(Y.V-1)*7),Y.y=Pe.getFullYear(),Y.m=Pe.getMonth(),Y.d=Pe.getDate()+(Y.w+6)%7)}else("W"in Y||"U"in Y)&&("w"in Y||(Y.w="u"in Y?Y.u%7:"W"in Y?1:0),at="Z"in Y?mS(Gf(Y.y,0,1)).getUTCDay():pS(Gf(Y.y,0,1)).getDay(),Y.m=0,Y.d="W"in Y?(Y.w+6)%7+Y.W*7-(at+5)%7:Y.w+Y.U*7-(at+6)%7);return"Z"in Y?(Y.H+=Y.Z/100|0,Y.M+=Y.Z%100,mS(Y)):pS(Y)}}function P(ee,pe,Ee,Y){for(var He=0,Pe=pe.length,at=Ee.length,Ve,Ht;He<Pe;){if(Y>=at)return-1;if(Ve=pe.charCodeAt(He++),Ve===37){if(Ve=pe.charAt(He++),Ht=T[Ve in XM?pe.charAt(He++):Ve],!Ht||(Y=Ht(ee,Ee,Y))<0)return-1}else if(Ve!=Ee.charCodeAt(Y++))return-1}return Y}function $(ee,pe,Ee){var Y=f.exec(pe.slice(Ee));return Y?(ee.p=p.get(Y[0].toLowerCase()),Ee+Y[0].length):-1}function F(ee,pe,Ee){var Y=v.exec(pe.slice(Ee));return Y?(ee.w=j.get(Y[0].toLowerCase()),Ee+Y[0].length):-1}function U(ee,pe,Ee){var Y=m.exec(pe.slice(Ee));return Y?(ee.w=g.get(Y[0].toLowerCase()),Ee+Y[0].length):-1}function B(ee,pe,Ee){var Y=k.exec(pe.slice(Ee));return Y?(ee.m=E.get(Y[0].toLowerCase()),Ee+Y[0].length):-1}function V(ee,pe,Ee){var Y=b.exec(pe.slice(Ee));return Y?(ee.m=S.get(Y[0].toLowerCase()),Ee+Y[0].length):-1}function X(ee,pe,Ee){return P(ee,t,pe,Ee)}function Z(ee,pe,Ee){return P(ee,n,pe,Ee)}function H(ee,pe,Ee){return P(ee,r,pe,Ee)}function J(ee){return l[ee.getDay()]}function oe(ee){return a[ee.getDay()]}function ye(ee){return d[ee.getMonth()]}function I(ee){return u[ee.getMonth()]}function M(ee){return i[+(ee.getHours()>=12)]}function q(ee){return 1+~~(ee.getMonth()/3)}function D(ee){return l[ee.getUTCDay()]}function G(ee){return a[ee.getUTCDay()]}function se(ee){return d[ee.getUTCMonth()]}function ne(ee){return u[ee.getUTCMonth()]}function Ce(ee){return i[+(ee.getUTCHours()>=12)]}function Se(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var pe=O(ee+="",C);return pe.toString=function(){return ee},pe},parse:function(ee){var pe=_(ee+="",!1);return pe.toString=function(){return ee},pe},utcFormat:function(ee){var pe=O(ee+="",A);return pe.toString=function(){return ee},pe},utcParse:function(ee){var pe=_(ee+="",!0);return pe.toString=function(){return ee},pe}}}var XM={"-":"",_:" ",0:"0"},sr=/^\s*\d+/,Xxe=/^%/,Jxe=/[\\^$*+?|[\]().{}]/g;function Et(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function e0e(e){return e.replace(Jxe,"\\$&")}function Vf(e){return new RegExp("^(?:"+e.map(e0e).join("|")+")","i")}function Qf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function t0e(e,t,n){var r=sr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function n0e(e,t,n){var r=sr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function r0e(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function i0e(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function a0e(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function JM(e,t,n){var r=sr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function eI(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function s0e(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 o0e(e,t,n){var r=sr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function l0e(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function tI(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function c0e(e,t,n){var r=sr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function nI(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function u0e(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function d0e(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function f0e(e,t,n){var r=sr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function h0e(e,t,n){var r=sr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function p0e(e,t,n){var r=Xxe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function m0e(e,t,n){var r=sr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function g0e(e,t,n){var r=sr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function rI(e,t){return Et(e.getDate(),t,2)}function y0e(e,t){return Et(e.getHours(),t,2)}function v0e(e,t){return Et(e.getHours()%12||12,t,2)}function x0e(e,t){return Et(1+hp.count(Rs(e),e),t,3)}function oq(e,t){return Et(e.getMilliseconds(),t,3)}function b0e(e,t){return oq(e,t)+"000"}function w0e(e,t){return Et(e.getMonth()+1,t,2)}function j0e(e,t){return Et(e.getMinutes(),t,2)}function S0e(e,t){return Et(e.getSeconds(),t,2)}function N0e(e){var t=e.getDay();return t===0?7:t}function k0e(e,t){return Et(Mx.count(Rs(e)-1,e),t,2)}function lq(e){var t=e.getDay();return t>=4||t===0?od(e):od.ceil(e)}function C0e(e,t){return e=lq(e),Et(od.count(Rs(e),e)+(Rs(e).getDay()===4),t,2)}function A0e(e){return e.getDay()}function O0e(e,t){return Et(tv.count(Rs(e)-1,e),t,2)}function E0e(e,t){return Et(e.getFullYear()%100,t,2)}function _0e(e,t){return e=lq(e),Et(e.getFullYear()%100,t,2)}function z0e(e,t){return Et(e.getFullYear()%1e4,t,4)}function T0e(e,t){var n=e.getDay();return e=n>=4||n===0?od(e):od.ceil(e),Et(e.getFullYear()%1e4,t,4)}function P0e(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Et(t/60|0,"0",2)+Et(t%60,"0",2)}function iI(e,t){return Et(e.getUTCDate(),t,2)}function R0e(e,t){return Et(e.getUTCHours(),t,2)}function D0e(e,t){return Et(e.getUTCHours()%12||12,t,2)}function M0e(e,t){return Et(1+Dx.count(Ds(e),e),t,3)}function cq(e,t){return Et(e.getUTCMilliseconds(),t,3)}function I0e(e,t){return cq(e,t)+"000"}function L0e(e,t){return Et(e.getUTCMonth()+1,t,2)}function $0e(e,t){return Et(e.getUTCMinutes(),t,2)}function B0e(e,t){return Et(e.getUTCSeconds(),t,2)}function U0e(e){var t=e.getUTCDay();return t===0?7:t}function q0e(e,t){return Et(Ix.count(Ds(e)-1,e),t,2)}function uq(e){var t=e.getUTCDay();return t>=4||t===0?ld(e):ld.ceil(e)}function F0e(e,t){return e=uq(e),Et(ld.count(Ds(e),e)+(Ds(e).getUTCDay()===4),t,2)}function H0e(e){return e.getUTCDay()}function K0e(e,t){return Et(nv.count(Ds(e)-1,e),t,2)}function G0e(e,t){return Et(e.getUTCFullYear()%100,t,2)}function V0e(e,t){return e=uq(e),Et(e.getUTCFullYear()%100,t,2)}function Q0e(e,t){return Et(e.getUTCFullYear()%1e4,t,4)}function W0e(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ld(e):ld.ceil(e),Et(e.getUTCFullYear()%1e4,t,4)}function Y0e(){return"+0000"}function aI(){return"%"}function sI(e){return+e}function oI(e){return Math.floor(+e/1e3)}var vu,dq,fq;Z0e({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 Z0e(e){return vu=Zxe(e),dq=vu.format,vu.parse,fq=vu.utcFormat,vu.utcParse,vu}function X0e(e){return new Date(e)}function J0e(e){return e instanceof Date?+e:+new Date(+e)}function XC(e,t,n,r,i,a,l,u,d,f){var p=LC(),m=p.invert,g=p.domain,v=f(".%L"),j=f(":%S"),b=f("%I:%M"),S=f("%I %p"),k=f("%a %d"),E=f("%b %d"),C=f("%B"),A=f("%Y");function T(O){return(d(O)<O?v:u(O)<O?j:l(O)<O?b:a(O)<O?S:r(O)<O?i(O)<O?k:E:n(O)<O?C:A)(O)}return p.invert=function(O){return new Date(m(O))},p.domain=function(O){return arguments.length?g(Array.from(O,J0e)):g().map(X0e)},p.ticks=function(O){var _=g();return e(_[0],_[_.length-1],O??10)},p.tickFormat=function(O,_){return _==null?T:f(_)},p.nice=function(O){var _=g();return(!O||typeof O.range!="function")&&(O=t(_[0],_[_.length-1],O??10)),O?g(XU(_,O)):p},p.copy=function(){return fp(p,XC(e,t,n,r,i,a,l,u,d,f))},p}function ebe(){return Zi.apply(XC(Wxe,Yxe,Rs,YC,Mx,hp,QC,GC,Fl,dq).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function tbe(){return Zi.apply(XC(Vxe,Qxe,Ds,ZC,Ix,Dx,WC,VC,Fl,fq).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Lx(){var e=0,t=1,n,r,i,a,l=Rr,u=!1,d;function f(m){return m==null||isNaN(m=+m)?d:l(i===0?.5:(m=(a(m)-n)*i,u?Math.max(0,Math.min(1,m)):m))}f.domain=function(m){return arguments.length?([e,t]=m,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(m){return arguments.length?(u=!!m,f):u},f.interpolator=function(m){return arguments.length?(l=m,f):l};function p(m){return function(g){var v,j;return arguments.length?([v,j]=g,l=m(v,j),f):[l(0),l(1)]}}return f.range=p(Ed),f.rangeRound=p(IC),f.unknown=function(m){return arguments.length?(d=m,f):d},function(m){return a=m,n=m(e),r=m(t),i=n===r?0:1/(r-n),f}}function rl(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function hq(){var e=nl(Lx()(Rr));return e.copy=function(){return rl(e,hq())},qs.apply(e,arguments)}function pq(){var e=UC(Lx()).domain([1,10]);return e.copy=function(){return rl(e,pq()).base(e.base())},qs.apply(e,arguments)}function mq(){var e=qC(Lx());return e.copy=function(){return rl(e,mq()).constant(e.constant())},qs.apply(e,arguments)}function JC(){var e=FC(Lx());return e.copy=function(){return rl(e,JC()).exponent(e.exponent())},qs.apply(e,arguments)}function nbe(){return JC.apply(null,arguments).exponent(.5)}function gq(){var e=[],t=Rr;function n(r){if(r!=null&&!isNaN(r=+r))return t((up(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(Uo),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>Uve(e,a/r))},n.copy=function(){return gq(t).domain(e)},qs.apply(n,arguments)}function $x(){var e=0,t=.5,n=1,r=1,i,a,l,u,d,f=Rr,p,m=!1,g;function v(b){return isNaN(b=+b)?g:(b=.5+((b=+p(b))-a)*(r*b<r*a?u:d),f(m?Math.max(0,Math.min(1,b)):b))}v.domain=function(b){return arguments.length?([e,t,n]=b,i=p(e=+e),a=p(t=+t),l=p(n=+n),u=i===a?0:.5/(a-i),d=a===l?0:.5/(l-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(b){return arguments.length?(m=!!b,v):m},v.interpolator=function(b){return arguments.length?(f=b,v):f};function j(b){return function(S){var k,E,C;return arguments.length?([k,E,C]=S,f=pxe(b,[k,E,C]),v):[f(0),f(.5),f(1)]}}return v.range=j(Ed),v.rangeRound=j(IC),v.unknown=function(b){return arguments.length?(g=b,v):g},function(b){return p=b,i=b(e),a=b(t),l=b(n),u=i===a?0:.5/(a-i),d=a===l?0:.5/(l-a),r=a<i?-1:1,v}}function yq(){var e=nl($x()(Rr));return e.copy=function(){return rl(e,yq())},qs.apply(e,arguments)}function vq(){var e=UC($x()).domain([.1,1,10]);return e.copy=function(){return rl(e,vq()).base(e.base())},qs.apply(e,arguments)}function xq(){var e=qC($x());return e.copy=function(){return rl(e,xq()).constant(e.constant())},qs.apply(e,arguments)}function eA(){var e=FC($x());return e.copy=function(){return rl(e,eA()).exponent(e.exponent())},qs.apply(e,arguments)}function rbe(){return eA.apply(null,arguments).exponent(.5)}const bq=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:RC,scaleDiverging:yq,scaleDivergingLog:vq,scaleDivergingPow:eA,scaleDivergingSqrt:rbe,scaleDivergingSymlog:xq,scaleIdentity:ZU,scaleImplicit:aN,scaleLinear:YU,scaleLog:JU,scaleOrdinal:PC,scalePoint:Hve,scalePow:HC,scaleQuantile:nq,scaleQuantize:rq,scaleRadial:tq,scaleSequential:hq,scaleSequentialLog:pq,scaleSequentialPow:JC,scaleSequentialQuantile:gq,scaleSequentialSqrt:nbe,scaleSequentialSymlog:mq,scaleSqrt:Ixe,scaleSymlog:eq,scaleThreshold:iq,scaleTime:ebe,scaleUtc:tbe,tickFormat:WU},Symbol.toStringTag,{value:"Module"}));function ibe(e){var t=bq;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(ep(e));if(n in t&&typeof t[n]=="function")return t[n]()}function lI(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=ibe(e);if(r!=null)return r.domain(t).range(n),r}}function tA(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?lI(e.scale,n,r):lI(t,n,r)}function abe(e){return"scale".concat(ep(e))}function sbe(e){return abe(e)in bq}var wq=(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 sbe(r)?r:"point"}};function obe(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function jq(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var l;return(l=e(a))!==null&&l!==void 0?l:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var l,u,d=obe(r,a);if(d<=0)return n[0];if(d>=n.length)return n[n.length-1];var f=(l=r[d-1])!==null&&l!==void 0?l:0,p=(u=r[d])!==null&&u!==void 0?u:0;return Math.abs(a-f)<=Math.abs(a-p)?n[d-1]:n[d]}}}function lbe(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):jq(e,void 0)}function cI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cI(Object(n),!0).forEach(function(r){cbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cbe(e,t,n){return(t=ube(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ube(e){var t=dbe(e,"string");return typeof t=="symbol"?t:t+""}function dbe(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 cN=[0,"auto"],Gn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},Sq=(e,t)=>e.cartesianAxis.xAxis[t],Fs=(e,t)=>{var n=Sq(e,t);return n??Gn},Vn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:cN,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:rp},Nq=(e,t)=>e.cartesianAxis.yAxis[t],Hs=(e,t)=>{var n=Nq(e,t);return n??Vn},fbe={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:""},nA=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??fbe},Lr=(e,t,n)=>{switch(t){case"xAxis":return Fs(e,n);case"yAxis":return Hs(e,n);case"zAxis":return nA(e,n);case"angleAxis":return OC(e,n);case"radiusAxis":return EC(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},hbe=(e,t,n)=>{switch(t){case"xAxis":return Fs(e,n);case"yAxis":return Hs(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},pp=(e,t,n)=>{switch(t){case"xAxis":return Fs(e,n);case"yAxis":return Hs(e,n);case"angleAxis":return OC(e,n);case"radiusAxis":return EC(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},kq=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function Cq(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var mp=e=>e.graphicalItems.cartesianItems,pbe=re([ir,Ex],Cq),Aq=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),_d=re([mp,Lr,pbe],Aq,{memoizeOptions:{resultEqualityCheck:Px}}),Oq=re([_d],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(zx)),Eq=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),mbe=re([_d],Eq),_q=e=>e.map(t=>t.data).filter(Boolean).flat(1),gbe=re([_d],e=>e.some(t=>!t.data)),zq=re([_d],_q,{memoizeOptions:{resultEqualityCheck:Px}}),Tq=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},rA=re([zq,cp],Tq),ybe=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:vn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:vn(i,r)}))):e.map(r=>({value:r})),Pq=(e,t,n,r,i,a)=>{var{chartData:l=[],dataStartIndex:u,dataEndIndex:d}=r,f=ybe(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=l.slice(u,d+1),m=p.map(g=>({value:vn(g,t.dataKey)})).filter(g=>g.value!=null);return[...m,...f]}return f},gp=re([rA,Lr,_d,cp,gbe,zq],Pq);function Ku(e){if(Fa(e)||e instanceof Date){var t=Number(e);if(ht(t))return t}}function uI(e){if(Array.isArray(e)){var t=[Ku(e[0]),Ku(e[1])];return $a(t)?t:void 0}var n=Ku(e);if(n!=null)return[n,n]}function Ga(e){return e.map(Ku).filter(Yr)}function vbe(e,t){var n=Ku(e),r=Ku(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var xbe=re([gp],e=>e?.map(t=>t.value).sort(vbe));function Rq(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function bbe(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!fa(t))r=t;else if(Array.isArray(t)){var i=Ga(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Ga(n.flatMap(a=>{var l=vn(e,a.dataKey),u,d;if(Array.isArray(l)?[u,d]=l:u=d=l,!(!ht(u)||!ht(d)))return[r-u,r+d]}))}var Zn=e=>{var t=ar(e),n=Od(e);return pp(e,t,n)},cd=re([Zn],e=>e?.dataKey),wbe=re([Oq,cp,Zn],BU),Dq=(e,t,n,r)=>{var i={},a=t.reduce((l,u)=>{if(u.stackId==null)return l;var d=l[u.stackId];return d==null&&(d=[]),d.push(u),l[u.stackId]=d,l},i);return Object.fromEntries(Object.entries(a).map(l=>{var[u,d]=l,f=r?[...d].reverse():d,p=f.map(_x);return[u,{stackedData:rme(e,p,n),graphicalItems:f}]}))},iv=re([wbe,Oq,kx,PU],Dq),Mq=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var l=ome(e,i,a);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},jbe=re([Lr],e=>e.allowDataOverflow),iA=e=>{var t;if(e==null||!("domain"in e))return cN;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Ga(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:cN},Iq=re([Lr],iA),Lq=re([Iq,jbe],bU),Sbe=re([iv,ba,ir,Lq],Mq,{memoizeOptions:{resultEqualityCheck:Tx}}),aA=e=>e.errorBars,Nbe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>Rq(n,r)),av=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),l=Math.min(...a),u=Math.max(...a);return[l,u]}},$q=function(t,n,r,i,a){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],u,d;if(r.length>0&&r.forEach(f=>{var p,m=f.data!=null?[...f.data]:l,g=(p=i[f.id])===null||p===void 0?void 0:p.filter(v=>Rq(a,v));m.forEach(v=>{var j,b=vn(v,(j=n.dataKey)!==null&&j!==void 0?j:f.dataKey),S=bbe(v,b,g);if(S.length>=2){var k=Math.min(...S),E=Math.max(...S);(u==null||k<u)&&(u=k),(d==null||E>d)&&(d=E)}var C=uI(b);C!=null&&(u=u==null?C[0]:Math.min(u,C[0]),d=d==null?C[1]:Math.max(d,C[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(f=>{var p=uI(vn(f,n.dataKey));p!=null&&(u=u==null?p[0]:Math.min(u,p[0]),d=d==null?p[1]:Math.max(d,p[1]))}),ht(u)&&ht(d))return[u,d]},kbe=re([rA,Lr,mbe,aA,ir,fve],$q,{memoizeOptions:{resultEqualityCheck:Tx}});function Cbe(e){var{value:t}=e;if(Fa(t)||t instanceof Date)return t}var Abe=(e,t,n)=>{var r=e.map(Cbe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&WB(r))?vU(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},Bq=e=>e.referenceElements.dots,zd=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),Obe=re([Bq,ir,Ex],zd),Uq=e=>e.referenceElements.areas,Ebe=re([Uq,ir,Ex],zd),qq=e=>e.referenceElements.lines,_be=re([qq,ir,Ex],zd),Fq=(e,t)=>{if(e!=null){var n=Ga(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},zbe=re(Obe,ir,Fq),Hq=(e,t)=>{if(e!=null){var n=Ga(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Tbe=re([Ebe,ir],Hq);function Pbe(e){var t;if(e.x!=null)return Ga([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Ga(n)}function Rbe(e){var t;if(e.y!=null)return Ga([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Ga(n)}var Kq=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?Pbe(r):Rbe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Dbe=re([_be,ir],Kq),Mbe=re(zbe,Dbe,Tbe,(e,t,n)=>av(e,n,t)),Gq=(e,t,n,r,i,a,l,u)=>{if(n!=null)return n;var d=l==="vertical"&&u==="xAxis"||l==="horizontal"&&u==="yAxis",f=d?av(r,a,i):av(a,i);return pve(t,f,e.allowDataOverflow)},Ibe=re([Lr,Iq,Lq,Sbe,kbe,Mbe,_t,ir],Gq,{memoizeOptions:{resultEqualityCheck:Tx}}),Lbe=[0,1],Vq=(e,t,n,r,i,a,l)=>{if(!((e==null||n==null||n.length===0)&&l===void 0)){var{dataKey:u,type:d}=e,f=xa(t,a);if(f&&u==null){var p;return vU(0,(p=n?.length)!==null&&p!==void 0?p:0)}return d==="category"?Abe(r,e,f):i==="expand"&&!f?Lbe:l}},sA=re([Lr,_t,rA,gp,kx,ir,Ibe],Vq),Td=re([Lr,kq,kC],wq),Qq=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=iA(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&$a(e)){if(a)return bM(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return wM(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&$a(e))return bM(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&$a(e))return wM(e,t.tickCount,t.allowDecimals,"adaptive")}}},oA=re([sA,pp,Td],Qq),Wq=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&$a(t)&&Array.isArray(n)&&n.length>0){var i,a,l=t[0],u=(i=n[0])!==null&&i!==void 0?i:0,d=t[1],f=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(l,u),Math.max(d,f)]}return t},$be=re([Lr,sA,oA,ir],Wq),Bbe=re(gp,Lr,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Ga(e.map(m=>m.value))).sort((m,g)=>m-g),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var l=a-i;if(l===0)return 1/0;for(var u=0;u<r.length-1;u++){var d=r[u],f=r[u+1];if(!(d==null||f==null)){var p=f-d;n=Math.min(n,p)}}return n/l}}),Yq=re(Bbe,_t,TU,nr,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!ht(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var l=ha(n,e*a),u=e*a/2;return u-l-(u-l)/a*l}return 0}),Ube=(e,t,n)=>{var r=Fs(e,t);return r==null||typeof r.padding!="string"?0:Yq(e,"xAxis",t,n,r.padding)},qbe=(e,t,n)=>{var r=Hs(e,t);return r==null||typeof r.padding!="string"?0:Yq(e,"yAxis",t,n,r.padding)},Fbe=re(Fs,Ube,(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}}),Hbe=re(Hs,qbe,(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}}),Kbe=re([nr,Fbe,bx,xx,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),Gbe=re([nr,_t,Hbe,bx,xx,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:l}=i;return a?[r.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),yp=(e,t,n,r)=>{var i;switch(t){case"xAxis":return Kbe(e,n,r);case"yAxis":return Gbe(e,n,r);case"zAxis":return(i=nA(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return IU(e);case"radiusAxis":return LU(e,n);default:return}},Zq=re([Lr,yp],Cx),Vbe=re([Td,$be],Eve),lA=re([Lr,Td,Vbe,Zq],tA),Xq=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,l=xa(e,r);if(l&&(i==="number"||a!=="auto"))return t.map(u=>u.value)}},cA=re([_t,gp,pp,ir],Xq),Bx=re([lA],zC);re([lA],lbe);re([lA,xbe],jq);re([_d,aA,ir],Nbe);function Jq(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Ux=(e,t)=>t,qx=(e,t,n)=>n,Qbe=re(yx,Ux,qx,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(Jq)),Wbe=re(vx,Ux,qx,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(Jq)),e8=(e,t)=>({width:e.width,height:t.height}),Ybe=(e,t)=>{var n=typeof t.width=="number"?t.width:rp;return{width:n,height:e.height}},t8=re(nr,Fs,e8),Zbe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},Xbe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},Jbe=re(Us,nr,Qbe,Ux,qx,(e,t,n,r,i)=>{var a={},l;return n.forEach(u=>{var d=e8(t,u);l==null&&(l=Zbe(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[u.id]=l-Number(f)*d.height,l+=(f?-1:1)*d.height}),a}),ewe=re(Bs,nr,Wbe,Ux,qx,(e,t,n,r,i)=>{var a={},l;return n.forEach(u=>{var d=Ybe(t,u);l==null&&(l=Xbe(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[u.id]=l-Number(f)*d.width,l+=(f?-1:1)*d.width}),a}),twe=(e,t)=>{var n=Fs(e,t);if(n!=null)return Jbe(e,n.orientation,n.mirror)},nwe=re([nr,Fs,twe,(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}}}),rwe=(e,t)=>{var n=Hs(e,t);if(n!=null)return ewe(e,n.orientation,n.mirror)},iwe=re([nr,Hs,rwe,(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}}}),n8=re(nr,Hs,(e,t)=>{var n=typeof t.width=="number"?t.width:rp;return{width:n,height:e.height}}),dI=(e,t,n)=>{switch(t){case"xAxis":return t8(e,n).width;case"yAxis":return n8(e,n).height;default:return}},r8=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:l}=n,u=xa(e,r),d=t.map(p=>p.value),f=d.filter(p=>p!=null);if(l&&u&&a==="category"&&i&&WB(f))return d}},uA=re([_t,gp,Lr,ir],r8),fI=re([_t,hbe,Td,Bx,uA,cA,yp,oA,ir],(e,t,n,r,i,a,l,u,d)=>{if(t!=null){var f=xa(e,d);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:d,categoricalDomain:a,duplicateDomain:i,isCategorical:f,niceTicks:u,range:l,realScaleType:n,scale:r}}}),awe=(e,t,n,r,i,a,l,u,d)=>{if(!(t==null||r==null)){var f=xa(e,d),{type:p,ticks:m,tickCount:g}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,j=p==="category"&&r.bandwidth?r.bandwidth()/v:0;j=d==="angleAxis"&&a!=null&&a.length>=2?Wr(a[0]-a[1])*2*j:j;var b=m||i;return b?b.map((S,k)=>{var E=l?l.indexOf(S):S,C=r.map(E);return ht(C)?{index:k,coordinate:C+j,value:S,offset:j}:null}).filter(Yr):f&&u?u.map((S,k)=>{var E=r.map(S);return ht(E)?{coordinate:E+j,value:S,index:k,offset:j}:null}).filter(Yr):r.ticks?r.ticks(g).map((S,k)=>{var E=r.map(S);return ht(E)?{coordinate:E+j,value:S,index:k,offset:j}:null}).filter(Yr):r.domain().map((S,k)=>{var E=r.map(S);return ht(E)?{coordinate:E+j,value:l?l[S]:S,index:k,offset:j}:null}).filter(Yr)}},i8=re([_t,pp,Td,Bx,oA,yp,uA,cA,ir],awe),swe=(e,t,n,r,i,a,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var u=xa(e,l),{tickCount:d}=t,f=0;return f=l==="angleAxis"&&r?.length>=2?Wr(r[0]-r[1])*2*f:f,u&&a?a.map((p,m)=>{var g=n.map(p);return ht(g)?{coordinate:g+f,value:p,index:m,offset:f}:null}).filter(Yr):n.ticks?n.ticks(d).map((p,m)=>{var g=n.map(p);return ht(g)?{coordinate:g+f,value:p,index:m,offset:f}:null}).filter(Yr):n.domain().map((p,m)=>{var g=n.map(p);return ht(g)?{coordinate:g+f,value:i?i[p]:p,index:m,offset:f}:null}).filter(Yr)}},Va=re([_t,pp,Bx,yp,uA,cA,ir],swe),Qa=re(Lr,Bx,(e,t)=>{if(!(e==null||t==null))return rv(rv({},e),{},{scale:t})}),owe=re([Lr,Td,sA,Zq],tA),lwe=re([owe],zC);re((e,t,n)=>nA(e,n),lwe,(e,t)=>{if(!(e==null||t==null))return rv(rv({},e),{},{scale:t})});var cwe=re([_t,yx,vx],(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}}),uwe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};re([uwe],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var l=Math.abs(a.coordinate-t);l<r&&(r=l,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var a8=e=>e.options.defaultTooltipEventType,s8=e=>e.options.validateTooltipEventTypes;function o8(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function vp(e,t){var n=a8(e),r=s8(e);return o8(t,n,r)}function dwe(e){return Ue(t=>vp(t,e))}var l8=(e,t)=>{var n,r=Number(t);if(!(fa(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},fwe=e=>e.tooltip.settings,zo={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},hwe={itemInteraction:{click:zo,hover:zo},axisInteraction:{click:zo,hover:zo},keyboardInteraction:zo,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}},c8=Or({name:"tooltip",initialState:hwe,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:an()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Ui(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:an()},removeTooltipEntrySettings:{reducer(e,t){var n=Ui(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:an()},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:pwe,replaceTooltipEntrySettings:mwe,removeTooltipEntrySettings:gwe,setTooltipSettingsState:ywe,setActiveMouseOverItemIndex:u8,mouseLeaveItem:vwe,mouseLeaveChart:d8,setActiveClickItemIndex:xwe,setMouseOverAxisIndex:f8,setMouseClickAxisIndex:bwe,setSyncInteraction:nh,setKeyboardInteraction:sv}=c8.actions,wwe=c8.reducer;function hI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hI(Object(n),!0).forEach(function(r){jwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jwe(e,t,n){return(t=Swe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Swe(e){var t=Nwe(e,"string");return typeof t=="symbol"?t:t+""}function Nwe(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 kwe(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Cwe(e){return e.index!=null}var h8=(e,t,n,r)=>{if(t==null)return zo;var i=kwe(e,t,n);if(i==null)return zo;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(Cwe(i)){if(a)return jg(jg({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return jg(jg({},zo),{},{coordinate:i.coordinate})};function Awe(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 Owe(e,t){var n=Awe(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),l=Math.max(r,i);return n>=a&&n<=l}function Ewe(e,t,n){if(n==null||t==null)return!0;var r=vn(e,t);return r==null||!$a(n)?!0:Owe(r,n)}var hh=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!ht(a))return i;var l=0,u=1/0;t.length>0&&(u=t.length-1);var d=Math.max(l,Math.min(a,u)),f=t[d];return f==null||Ewe(f,n,r)?String(d):null},p8=(e,t,n,r,i,a,l)=>{if(a!=null){var u=l[0],d=u?.getPosition(a);if(d!=null)return d;var f=i?.[Number(a)];if(f)return n==="horizontal"?{x:f.coordinate,y:(r.top+t)/2}:{x:(r.left+e)/2,y:f.coordinate}}},m8=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(l=>{var u;return((u=l.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},g8=e=>e.options.tooltipPayloadSearcher,Pd=e=>e.tooltip;function pI(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 mI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pI(Object(n),!0).forEach(function(r){_we(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _we(e,t,n){return(t=zwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zwe(e){var t=Twe(e,"string");return typeof t=="symbol"?t:t+""}function Twe(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 Pwe(e){if(typeof e=="string"||typeof e=="number")return e}function Rwe(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Dwe(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function gI(e){if(typeof e=="string")return e}function Mwe(e){if(!(e==null||typeof e!="object")){var t="name"in e?Pwe(e.name):void 0,n="unit"in e?Rwe(e.unit):void 0,r="dataKey"in e?Dwe(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?gI(e.color):void 0,l="fill"in e?gI(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:l}}}function Iwe(e,t){return e??t}var y8=(e,t,n,r,i,a,l)=>{if(!(t==null||a==null)){var{chartData:u,computedData:d,dataStartIndex:f,dataEndIndex:p}=n,m=[];return e.reduce((g,v)=>{var j,{dataDefinedOnItem:b,settings:S}=v,k=Iwe(b,u),E=Array.isArray(k)?H6(k,f,p):k,C=(j=S?.dataKey)!==null&&j!==void 0?j:r,A=S?.nameKey,T;if(r&&Array.isArray(E)&&!Array.isArray(E[0])&&l==="axis"?T=YB(E,r,i):T=a(E,t,d,A),Array.isArray(T))T.forEach(_=>{var P,$,F=Mwe(_),U=F?.name,B=F?.dataKey,V=F?.payload,X=mI(mI({},S),{},{name:U,unit:F?.unit,color:(P=F?.color)!==null&&P!==void 0?P:S?.color,fill:($=F?.fill)!==null&&$!==void 0?$:S?.fill});g.push(lD({tooltipEntrySettings:X,dataKey:B,payload:V,value:vn(V,B),name:U==null?void 0:String(U)}))});else{var O;g.push(lD({tooltipEntrySettings:S,dataKey:C,payload:T,value:vn(T,C),name:(O=vn(T,A))!==null&&O!==void 0?O:S?.name}))}return g},m)}},dA=re([Zn,kq,kC],wq),Lwe=re([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),$we=re([ar,Od],Cq),Ac=re([Lwe,Zn,$we],Aq,{memoizeOptions:{resultEqualityCheck:Px}}),Bwe=re([Ac],e=>e.filter(zx)),v8=re([Ac],_q,{memoizeOptions:{resultEqualityCheck:Px}}),Uwe=re([Ac],e=>e.some(t=>!t.data)),fc=re([v8,ba],Tq),qwe=re([Bwe,ba,Zn],BU),fA=re([fc,Zn,Ac,ba,Uwe,v8],Pq),x8=re([Zn],iA),Fwe=re([Zn],e=>e.allowDataOverflow),b8=re([x8,Fwe],bU),Hwe=re([Ac],e=>e.filter(zx)),Kwe=re([qwe,Hwe,kx,PU],Dq),Gwe=re([Kwe,ba,ar,b8],Mq),Vwe=re([Ac],Eq),Qwe=re([fc,Zn,Vwe,aA,ar,hve],$q,{memoizeOptions:{resultEqualityCheck:Tx}}),Wwe=re([Bq,ar,Od],zd),Ywe=re([Wwe,ar],Fq),Zwe=re([Uq,ar,Od],zd),Xwe=re([Zwe,ar],Hq),Jwe=re([qq,ar,Od],zd),eje=re([Jwe,ar],Kq),tje=re([Ywe,eje,Xwe],av),nje=re([Zn,x8,b8,Gwe,Qwe,tje,_t,ar],Gq),ud=re([Zn,_t,fc,fA,kx,ar,nje],Vq),rje=re([ud,Zn,dA],Qq),ije=re([Zn,ud,rje,ar],Wq),w8=e=>{var t=ar(e),n=Od(e),r=!1;return yp(e,t,n,r)},j8=re([Zn,w8],Cx),aje=re([Zn,dA,ije,j8],tA),S8=re([aje],zC),sje=re([_t,fA,Zn,ar],r8),oje=re([_t,fA,Zn,ar],Xq),lje=(e,t,n,r,i,a,l,u)=>{if(t){var{type:d}=t,f=xa(e,u);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,m=d==="category"&&r.bandwidth?r.bandwidth()/p:0;return m=u==="angleAxis"&&i!=null&&i?.length>=2?Wr(i[0]-i[1])*2*m:m,f&&l?l.map((g,v)=>{var j=r.map(g);return ht(j)?{coordinate:j+m,value:g,index:v,offset:m}:null}).filter(Yr):r.domain().map((g,v)=>{var j=r.map(g);return ht(j)?{coordinate:j+m,value:a?a[g]:g,index:v,offset:m}:null}).filter(Yr)}}},Ks=re([_t,Zn,dA,S8,w8,sje,oje,ar],lje),hA=re([a8,s8,fwe],(e,t,n)=>o8(n.shared,e,t)),N8=e=>e.tooltip.settings.trigger,pA=e=>e.tooltip.settings.defaultIndex,xp=re([Pd,hA,N8,pA],h8),hc=re([xp,fc,cd,ud],hh),k8=re([Ks,hc],l8),C8=re([xp],e=>{if(e)return e.dataKey}),cje=re([xp],e=>{if(e)return e.graphicalItemId}),A8=re([Pd,hA,N8,pA],m8),uje=re([Bs,Us,_t,nr,Ks,pA,A8],p8),dje=re([xp,uje],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),fje=re([xp],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),hje=re([A8,hc,ba,cd,k8,g8,hA],y8),pje=re([hje],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function yI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yI(Object(n),!0).forEach(function(r){mje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mje(e,t,n){return(t=gje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gje(e){var t=yje(e,"string");return typeof t=="symbol"?t:t+""}function yje(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 vje=()=>Ue(Zn),xje=()=>{var e=vje(),t=Ue(Ks),n=Ue(S8);return Go(!e||!n?void 0:vI(vI({},e),{},{scale:n}),t)};function xI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xI(Object(n),!0).forEach(function(r){bje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bje(e,t,n){return(t=wje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wje(e){var t=jje(e,"string");return typeof t=="symbol"?t:t+""}function jje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Sje=(e,t,n,r)=>{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},Nje=(e,t,n,r)=>{var i=t.find(f=>f&&f.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:l}=r;return xu(xu(xu({},r),mr(r.cx,r.cy,l,a)),{},{angle:a,radius:l})}var u=i.coordinate,{angle:d}=r;return xu(xu(xu({},r),mr(r.cx,r.cy,u,d)),{},{angle:d,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function kje(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 O8=(e,t,n,r,i)=>{var a,l=(a=t?.length)!==null&&a!==void 0?a:0;if(l<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var u=0;u<l;u++){var d,f,p,m,g,v=u>0?(d=n[u-1])===null||d===void 0?void 0:d.coordinate:(f=n[l-1])===null||f===void 0?void 0:f.coordinate,j=(p=n[u])===null||p===void 0?void 0:p.coordinate,b=u>=l-1?(m=n[0])===null||m===void 0?void 0:m.coordinate:(g=n[u+1])===null||g===void 0?void 0:g.coordinate,S=void 0;if(!(v==null||j==null||b==null))if(Wr(j-v)!==Wr(b-j)){var k=[];if(Wr(b-j)===Wr(i[1]-i[0])){S=b;var E=j+i[1]-i[0];k[0]=Math.min(E,(E+v)/2),k[1]=Math.max(E,(E+v)/2)}else{S=v;var C=b+i[1]-i[0];k[0]=Math.min(j,(C+j)/2),k[1]=Math.max(j,(C+j)/2)}var A=[Math.min(j,(S+j)/2),Math.max(j,(S+j)/2)];if(e>A[0]&&e<=A[1]||e>=k[0]&&e<=k[1]){var T;return(T=n[u])===null||T===void 0?void 0:T.index}}else{var O=Math.min(v,b),_=Math.max(v,b);if(e>(O+j)/2&&e<=(_+j)/2){var P;return(P=n[u])===null||P===void 0?void 0:P.index}}}else if(t)for(var $=0;$<l;$++){var F=t[$];if(F!=null){var U=t[$+1],B=t[$-1];if($===0&&U!=null&&e<=(F.coordinate+U.coordinate)/2||$===l-1&&B!=null&&e>(F.coordinate+B.coordinate)/2||$>0&&$<l-1&&B!=null&&U!=null&&e>(F.coordinate+B.coordinate)/2&&e<=(F.coordinate+U.coordinate)/2)return F.index}}return-1},E8=()=>Ue(kC),mA=(e,t)=>t,_8=(e,t,n)=>n,gA=(e,t,n,r)=>r,Cje=re(Ks,e=>ox(e,t=>t.coordinate)),yA=re([Pd,mA,_8,gA],h8),vA=re([yA,fc,cd,ud],hh),Aje=(e,t,n)=>{if(t!=null){var r=Pd(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},z8=re([Pd,mA,_8,gA],m8),ov=re([Bs,Us,_t,nr,Ks,gA,z8],p8),Oje=re([yA,ov],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),T8=re([Ks,vA],l8),Eje=re([z8,vA,ba,cd,T8,g8,mA],y8),_je=re([yA,vA],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),zje=(e,t,n,r,i,a,l)=>{if(!(!e||!n||!r||!i)&&kje(e,l)){var u=lme(e,t),d=O8(u,a,i,n,r),f=Sje(t,i,d,e);return{activeIndex:String(d),activeCoordinate:f}}},Tje=(e,t,n,r,i,a,l)=>{if(!(!e||!r||!i||!a||!n)){var u=nve(e,n);if(u){var d=cme(u,t),f=O8(d,l,a,r,i),p=Nje(t,a,f,u);return{activeIndex:String(f),activeCoordinate:p}}}},Pje=(e,t,n,r,i,a,l,u)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?zje(e,t,r,i,a,l,u):Tje(e,t,n,r,i,a,l)},Rje=re(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),Dje=re(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Wn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:Ove}});function bI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bI(Object(n),!0).forEach(function(r){Mje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mje(e,t,n){return(t=Ije(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ije(e){var t=Lje(e,"string");return typeof t=="symbol"?t:t+""}function Lje(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 $je={},Bje={zIndexMap:Object.values(Wn).reduce((e,t)=>wI(wI({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),$je)},Uje=new Set(Object.values(Wn));function qje(e){return Uje.has(e)}var P8=Or({name:"zIndex",initialState:Bje,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:an()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!qje(n)&&delete e.zIndexMap[n])},prepare:an()},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:an()},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:an()}}}),{registerZIndexPortal:Fje,unregisterZIndexPortal:gS,registerZIndexPortalElement:Hje,unregisterZIndexPortalElement:Kje}=P8.actions,Gje=P8.reducer;function bi(e){var{zIndex:t,children:n}=e,r=qme(),i=r&&t!==void 0&&t!==0,a=rr(),l=x.useRef(void 0),u=x.useRef(new Set),d=ln(),f=Ue(m=>Rje(m,t,a));if(x.useLayoutEffect(()=>{if(!i){var m=u.current;m.forEach(v=>{d(gS({zIndex:v}))}),m.clear(),l.current=void 0;return}if(u.current.has(t)||(d(Fje({zIndex:t})),u.current.add(t)),f){l.current=f;var g=u.current;g.forEach(v=>{v!==t&&(d(gS({zIndex:v})),g.delete(v))})}},[d,t,i,f]),x.useLayoutEffect(()=>{var m=u.current;return()=>{m.forEach(g=>{d(gS({zIndex:g}))}),m.clear()}},[d]),!i)return n;var p=f??l.current;return p?yc.createPortal(n,p):null}function uN(){return uN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uN.apply(null,arguments)}function jI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jI(Object(n),!0).forEach(function(r){Vje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vje(e,t,n){return(t=Qje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qje(e){var t=Wje(e,"string");return typeof t=="symbol"?t:t+""}function Wje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yje(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function Zje(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:l,layout:u,cursor:d,tooltipEventType:f,chartName:p}=e,m=n,g=r,v=i;if(!d||!m||p!=="ScatterChart"&&f!=="axis")return null;var j,b,S;if(p==="ScatterChart")j=m,b=gye,S=Wn.cursorLine;else if(p==="BarChart")j=yye(u,m,a,l),b=pU,S=Wn.cursorRectangle;else if(u==="radial"&&XB(m)){var{cx:k,cy:E,radius:C,startAngle:A,endAngle:T}=mU(m);j={cx:k,cy:E,startAngle:A,endAngle:T,innerRadius:C,outerRadius:C},b=yU,S=Wn.cursorLine}else j={points:sve(u,m,a)},b=fh,S=Wn.cursorLine;var O=typeof d=="object"&&"className"in d?d.className:void 0,_=Sg(Sg(Sg(Sg({stroke:"#ccc",pointerEvents:"none"},a),j),Jh(d)),{},{payload:g,payloadIndex:v,className:Ot("recharts-tooltip-cursor",O)});return x.createElement(bi,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:S},x.createElement(Yje,{cursor:d,cursorComp:b,cursorProps:_}))}function Xje(e){var t=xje(),n=X6(),r=tl(),i=E8();return t==null||n==null||r==null||i==null?null:x.createElement(Zje,uN({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var R8=x.createContext(null),Jje=()=>x.useContext(R8),yS={exports:{}},SI;function eSe(){return SI||(SI=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(d,f,p){this.fn=d,this.context=f,this.once=p||!1}function a(d,f,p,m,g){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new i(p,m||d,g),j=n?n+f:f;return d._events[j]?d._events[j].fn?d._events[j]=[d._events[j],v]:d._events[j].push(v):(d._events[j]=v,d._eventsCount++),d}function l(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],p,m;if(this._eventsCount===0)return f;for(m in p=this._events)t.call(p,m)&&f.push(n?m.slice(1):m);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},u.prototype.listeners=function(f){var p=n?n+f:f,m=this._events[p];if(!m)return[];if(m.fn)return[m.fn];for(var g=0,v=m.length,j=new Array(v);g<v;g++)j[g]=m[g].fn;return j},u.prototype.listenerCount=function(f){var p=n?n+f:f,m=this._events[p];return m?m.fn?1:m.length:0},u.prototype.emit=function(f,p,m,g,v,j){var b=n?n+f:f;if(!this._events[b])return!1;var S=this._events[b],k=arguments.length,E,C;if(S.fn){switch(S.once&&this.removeListener(f,S.fn,void 0,!0),k){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,p),!0;case 3:return S.fn.call(S.context,p,m),!0;case 4:return S.fn.call(S.context,p,m,g),!0;case 5:return S.fn.call(S.context,p,m,g,v),!0;case 6:return S.fn.call(S.context,p,m,g,v,j),!0}for(C=1,E=new Array(k-1);C<k;C++)E[C-1]=arguments[C];S.fn.apply(S.context,E)}else{var A=S.length,T;for(C=0;C<A;C++)switch(S[C].once&&this.removeListener(f,S[C].fn,void 0,!0),k){case 1:S[C].fn.call(S[C].context);break;case 2:S[C].fn.call(S[C].context,p);break;case 3:S[C].fn.call(S[C].context,p,m);break;case 4:S[C].fn.call(S[C].context,p,m,g);break;default:if(!E)for(T=1,E=new Array(k-1);T<k;T++)E[T-1]=arguments[T];S[C].fn.apply(S[C].context,E)}}return!0},u.prototype.on=function(f,p,m){return a(this,f,p,m,!1)},u.prototype.once=function(f,p,m){return a(this,f,p,m,!0)},u.prototype.removeListener=function(f,p,m,g){var v=n?n+f:f;if(!this._events[v])return this;if(!p)return l(this,v),this;var j=this._events[v];if(j.fn)j.fn===p&&(!g||j.once)&&(!m||j.context===m)&&l(this,v);else{for(var b=0,S=[],k=j.length;b<k;b++)(j[b].fn!==p||g&&!j[b].once||m&&j[b].context!==m)&&S.push(j[b]);S.length?this._events[v]=S.length===1?S[0]:S:l(this,v)}return this},u.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&l(this,p)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(yS)),yS.exports}var tSe=eSe();const nSe=ma(tSe);var Bh=new nSe,dN="recharts.syncEvent.tooltip",NI="recharts.syncEvent.brush",xA=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!fa(n))return e[n]}},rSe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},D8=Or({name:"options",initialState:rSe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),iSe=D8.reducer,{createEventEmitter:aSe}=D8.actions;function sSe(e){return e.tooltip.syncInteraction}var oSe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},M8=Or({name:"chartData",initialState:oSe,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:kI,setDataStartEndIndexes:lSe,setComputedData:pze}=M8.actions,cSe=M8.reducer,uSe=["x","y"];function CI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CI(Object(n),!0).forEach(function(r){dSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function 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)}function pSe(e,t){if(e==null)return{};var n,r,i=mSe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mSe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function gSe(){var e=Ue(CC),t=Ue(AC),n=ln(),r=Ue(RU),i=Ue(Ks),a=tl(),l=wx(),u=Ue(d=>d.rootProps.className);x.useEffect(()=>{if(e==null)return el;var d=(f,p,m)=>{if(t!==m&&e===f){if(p.payload.active===!1){n(nh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var g;if(l&&p!==null&&p!==void 0&&(g=p.payload)!==null&&g!==void 0&&g.coordinate&&p.payload.sourceViewBox){var v=p.payload.coordinate,{x:j,y:b}=v,S=pSe(v,uSe),{x:k,y:E,width:C,height:A}=p.payload.sourceViewBox,T=bu(bu({},S),{},{x:l.x+(C?(j-k)/C:0)*l.width,y:l.y+(A?(b-E)/A:0)*l.height});n(bu(bu({},p),{},{payload:bu(bu({},p.payload),{},{coordinate:T})}))}else n(p);return}if(i!=null){var O;if(typeof r=="function"){var _={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},P=r(i,_);O=i[P]}else r==="value"&&(O=i.find(H=>String(H.value)===p.payload.label));var{coordinate:$}=p.payload;if($==null||l==null){n(nh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(O==null){n(nh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:F,y:U}=$,B=Math.min(F,l.x+l.width),V=Math.min(U,l.y+l.height),X={x:a==="horizontal"?O.coordinate:B,y:a==="horizontal"?V:O.coordinate},Z=nh({active:p.payload.active,coordinate:X,dataKey:p.payload.dataKey,index:String(O.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(Z)}}};return Bh.on(dN,d),()=>{Bh.off(dN,d)}},[u,n,t,e,r,i,a,l])}function ySe(){var e=Ue(CC),t=Ue(AC),n=ln();x.useEffect(()=>{if(e==null)return el;var r=(i,a,l)=>{t!==l&&e===i&&n(lSe(a))};return Bh.on(NI,r),()=>{Bh.off(NI,r)}},[n,t,e])}function vSe(){var e=ln();x.useEffect(()=>{e(aSe())},[e]),gSe(),ySe()}function xSe(e,t,n,r,i,a){var l=Ue(j=>Aje(j,e,t)),u=Ue(cje),d=Ue(AC),f=Ue(CC),p=Ue(RU),m=Ue(sSe),g=m?.sourceViewBox!=null,v=wx();x.useEffect(()=>{if(!g&&f!=null&&d!=null){var j=nh({active:a,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:u});Bh.emit(dN,f,j,d)}},[g,n,l,u,i,r,d,f,p,a,v])}function AI(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 OI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AI(Object(n),!0).forEach(function(r){bSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bSe(e,t,n){return(t=wSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wSe(e){var t=jSe(e,"string");return typeof t=="symbol"?t:t+""}function jSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function SSe(e){return e.dataKey}function NSe(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(Kge,t)}var EI=[],kSe={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 Ms(e){var t,n,r=tr(e,kSe),{active:i,allowEscapeViewBox:a,animationDuration:l,animationEasing:u,content:d,filterNull:f,isAnimationActive:p,offset:m,payloadUniqBy:g,position:v,reverseDirection:j,useTranslate3d:b,wrapperStyle:S,cursor:k,shared:E,trigger:C,defaultIndex:A,portal:T,axisId:O}=r,_=ln(),P=typeof A=="number"?String(A):A;x.useEffect(()=>{_(ywe({shared:E,trigger:C,axisId:O,active:i,defaultIndex:P}))},[_,E,C,O,i,P]);var $=wx(),F=cU(),U=dwe(E),{activeIndex:B,isActive:V}=(t=Ue(Se=>_je(Se,U,C,P)))!==null&&t!==void 0?t:{},X=Ue(Se=>Eje(Se,U,C,P)),Z=Ue(Se=>T8(Se,U,C,P)),H=Ue(Se=>Oje(Se,U,C,P)),J=X,oe=Jje(),ye=(n=i??V)!==null&&n!==void 0?n:!1,[I,M]=p6([J,ye]),q=U==="axis"?Z:void 0;xSe(U,C,H,q,B,ye);var D=T??oe;if(D==null||$==null||U==null)return null;var G=J??EI;ye||(G=EI),f&&G.length&&(G=c6(G.filter(Se=>Se.value!=null&&(Se.hide!==!0||r.includeHidden)),g,SSe));var se=G.length>0,ne=OI(OI({},r),{},{payload:G,label:q,active:ye,activeIndex:B,coordinate:H,accessibilityLayer:F}),Ce=x.createElement(nye,{allowEscapeViewBox:a,animationDuration:l,animationEasing:u,isAnimationActive:p,active:ye,coordinate:H,hasPayload:se,offset:m,position:v,reverseDirection:j,useTranslate3d:b,viewBox:$,wrapperStyle:S,lastBoundingBox:I,innerRef:M,hasPortalFromProps:!!T},NSe(d,ne));return x.createElement(x.Fragment,null,yc.createPortal(Ce,D),ye&&x.createElement(Xje,{cursor:k,tooltipEventType:U,coordinate:H,payload:G,index:B}))}var lv=e=>null;lv.displayName="Cell";function CSe(e,t,n){return(t=ASe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ASe(e){var t=OSe(e,"string");return typeof t=="symbol"?t:t+""}function OSe(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 ESe{constructor(t){CSe(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 _I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _Se(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_I(Object(n),!0).forEach(function(r){zSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_I(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zSe(e,t,n){return(t=TSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TSe(e){var t=PSe(e,"string");return typeof t=="symbol"?t:t+""}function PSe(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 RSe={cacheSize:2e3,enableCache:!0},I8=_Se({},RSe),zI=new ESe(I8.cacheSize),DSe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},TI="recharts_measurement_span";function MSe(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",l=t.letterSpacing||"",u=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(l,"|").concat(u)}var PI=(e,t)=>{try{var n=document.getElementById(TI);n||(n=document.createElement("span"),n.setAttribute("id",TI),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,DSe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},ph=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||sp.isSsr)return{width:0,height:0};if(!I8.enableCache)return PI(t,n);var r=MSe(t,n),i=zI.get(r);if(i)return i;var a=PI(t,n);return zI.set(r,a),a},L8;function ISe(e,t,n){return(t=LSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LSe(e){var t=$Se(e,"string");return typeof t=="symbol"?t:t+""}function $Se(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 RI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,DI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,BSe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,USe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,qSe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},FSe=["cm","mm","pt","pc","in","Q","px"];function HSe(e){return FSe.includes(e)}var Pu="NaN";function KSe(e,t){return e*qSe[t]}class fr{static parse(t){var n,[,r,i]=(n=USe.exec(t))!==null&&n!==void 0?n:[];return r==null?fr.NaN:new fr(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,fa(t)&&(this.unit=""),n!==""&&!BSe.test(n)&&(this.num=NaN,this.unit=""),HSe(n)&&(this.num=KSe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new fr(NaN,""):new fr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new fr(NaN,""):new fr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new fr(NaN,""):new fr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new fr(NaN,""):new fr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return fa(this.num)}}L8=fr;ISe(fr,"NaN",new L8(NaN,""));function $8(e){if(e==null||e.includes(Pu))return Pu;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=RI.exec(t))!==null&&n!==void 0?n:[],l=fr.parse(r??""),u=fr.parse(a??""),d=i==="*"?l.multiply(u):l.divide(u);if(d.isNaN())return Pu;t=t.replace(RI,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,p,m,g]=(f=DI.exec(t))!==null&&f!==void 0?f:[],v=fr.parse(p??""),j=fr.parse(g??""),b=m==="+"?v.add(j):v.subtract(j);if(b.isNaN())return Pu;t=t.replace(DI,b.toString())}return t}var MI=/\(([^()]*)\)/;function GSe(e){for(var t=e,n;(n=MI.exec(t))!=null;){var[,r]=n;t=t.replace(MI,$8(r))}return t}function VSe(e){var t=e.replace(/\s+/g,"");return t=GSe(t),t=$8(t),t}function QSe(e){try{return VSe(e)}catch{return Pu}}function vS(e){var t=QSe(e.slice(5,-1));return t===Pu?"":t}var WSe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],YSe=["dx","dy","angle","className","breakAll"];function fN(){return fN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fN.apply(null,arguments)}function II(e,t){if(e==null)return{};var n,r,i=ZSe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ZSe(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 B8=/[ \f\n\r\t\v\u2028\u2029]+/,U8=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];on(t)||(n?i=t.toString().split(""):i=t.toString().split(B8));var a=i.map(u=>({word:u,width:ph(u,r).width})),l=n?0:ph(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:l}}catch{return null}};function q8(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function XSe(e){return on(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var F8=(e,t,n,r)=>e.reduce((i,a)=>{var{word:l,width:u}=a,d=i[i.length-1];if(d&&u!=null&&(t==null||r||d.width+u+n<Number(t)))d.words.push(l),d.width+=u+n;else{var f={words:[l],width:u};i.push(f)}return i},[]),H8=e=>e.reduce((t,n)=>t.width>n.width?t:n),JSe="…",LI=(e,t,n,r,i,a,l,u)=>{var d=e.slice(0,t),f=U8({breakAll:n,style:r,children:d+JSe});if(!f)return[!1,[]];var p=F8(f.wordsWithComputedWidth,a,l,u),m=p.length>i||H8(p).width>Number(a);return[m,p]},e1e=(e,t,n,r,i)=>{var{maxLines:a,children:l,style:u,breakAll:d}=e,f=Te(a),p=String(l),m=F8(t,r,n,i);if(!f||i)return m;var g=m.length>a||H8(m).width>Number(r);if(!g)return m;for(var v=0,j=p.length-1,b=0,S;v<=j&&b<=p.length-1;){var k=Math.floor((v+j)/2),E=k-1,[C,A]=LI(p,E,d,u,a,r,n,i),[T]=LI(p,k,d,u,a,r,n,i);if(!C&&!T&&(v=k+1),C&&T&&(j=k-1),!C&&T){S=A;break}b++}return S||m},$I=e=>{var t=on(e)?[]:e.toString().split(B8);return[{words:t,width:void 0}]},t1e=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:l}=e;if((t||n)&&!sp.isSsr){var u,d,f=U8({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:p,spaceWidth:m}=f;u=p,d=m}else return $I(r);return e1e({breakAll:a,children:r,maxLines:l,style:i},u,d,t,!!n)}return $I(r)},K8="#808080",n1e={angle:0,breakAll:!1,capHeight:"0.71em",fill:K8,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},bA=x.forwardRef((e,t)=>{var n=tr(e,n1e),{x:r,y:i,lineHeight:a,capHeight:l,fill:u,scaleToFit:d,textAnchor:f,verticalAnchor:p}=n,m=II(n,WSe),g=x.useMemo(()=>t1e({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:d,style:m.style,width:m.width}),[m.breakAll,m.children,m.maxLines,d,m.style,m.width]),{dx:v,dy:j,angle:b,className:S,breakAll:k}=m,E=II(m,YSe);if(!Fa(r)||!Fa(i)||g.length===0)return null;var C=Number(r)+(Te(v)?v:0),A=Number(i)+(Te(j)?j:0);if(!ht(C)||!ht(A))return null;var T;switch(p){case"start":T=vS("calc(".concat(l,")"));break;case"middle":T=vS("calc(".concat((g.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:T=vS("calc(".concat(g.length-1," * -").concat(a,")"));break}var O=[],_=g[0];if(d&&_!=null){var P=_.width,{width:$}=m;O.push("scale(".concat(Te($)&&Te(P)?$/P:1,")"))}return b&&O.push("rotate(".concat(b,", ").concat(C,", ").concat(A,")")),O.length&&(E.transform=O.join(" ")),x.createElement("text",fN({},kr(E),{ref:t,x:C,y:A,className:Ot("recharts-text",S),textAnchor:f,fill:u.includes("url")?K8:u}),g.map((F,U)=>{var B=F.words.join(k?"":" ");return x.createElement("tspan",{x:C,dy:U===0?T:a,key:"".concat(B,"-").concat(U)},B)}))});bA.displayName="Text";function BI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _a(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BI(Object(n),!0).forEach(function(r){r1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function r1e(e,t,n){return(t=i1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i1e(e){var t=a1e(e,"string");return typeof t=="symbol"?t:t+""}function a1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var s1e=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:l,height:u,upperWidth:d,lowerWidth:f}=mC(t),p=a,m=a+(d-f)/2,g=(p+m)/2,v=(d+f)/2,j=p+d/2,b=u>=0?1:-1,S=b*r,k=b>0?"end":"start",E=b>0?"start":"end",C=d>=0?1:-1,A=C*r,T=C>0?"end":"start",O=C>0?"start":"end",_=i;if(n==="top"){var P={x:p+d/2,y:l-S,horizontalAnchor:"middle",verticalAnchor:k};return _&&(P.height=Math.max(l-_.y,0),P.width=d),P}if(n==="bottom"){var $={x:m+f/2,y:l+u+S,horizontalAnchor:"middle",verticalAnchor:E};return _&&($.height=Math.max(_.y+_.height-(l+u),0),$.width=f),$}if(n==="left"){var F={x:g-A,y:l+u/2,horizontalAnchor:T,verticalAnchor:"middle"};return _&&(F.width=Math.max(F.x-_.x,0),F.height=u),F}if(n==="right"){var U={x:g+v+A,y:l+u/2,horizontalAnchor:O,verticalAnchor:"middle"};return _&&(U.width=Math.max(_.x+_.width-U.x,0),U.height=u),U}var B=_?{width:v,height:u}:{};return n==="insideLeft"?_a({x:g+A,y:l+u/2,horizontalAnchor:O,verticalAnchor:"middle"},B):n==="insideRight"?_a({x:g+v-A,y:l+u/2,horizontalAnchor:T,verticalAnchor:"middle"},B):n==="insideTop"?_a({x:p+d/2,y:l+S,horizontalAnchor:"middle",verticalAnchor:E},B):n==="insideBottom"?_a({x:m+f/2,y:l+u-S,horizontalAnchor:"middle",verticalAnchor:k},B):n==="insideTopLeft"?_a({x:p+A,y:l+S,horizontalAnchor:O,verticalAnchor:E},B):n==="insideTopRight"?_a({x:p+d-A,y:l+S,horizontalAnchor:T,verticalAnchor:E},B):n==="insideBottomLeft"?_a({x:m+A,y:l+u-S,horizontalAnchor:O,verticalAnchor:k},B):n==="insideBottomRight"?_a({x:m+f-A,y:l+u-S,horizontalAnchor:T,verticalAnchor:k},B):n&&typeof n=="object"&&(Te(n.x)||oc(n.x))&&(Te(n.y)||oc(n.y))?_a({x:a+ha(n.x,v),y:l+ha(n.y,u),horizontalAnchor:"end",verticalAnchor:"end"},B):_a({x:j,y:l+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},B)},o1e=["labelRef"],l1e=["content"];function UI(e,t){if(e==null)return{};var n,r,i=c1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function c1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function qI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qI(Object(n),!0).forEach(function(r){u1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function u1e(e,t,n){return(t=d1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d1e(e){var t=f1e(e,"string");return typeof t=="symbol"?t:t+""}function f1e(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 js(){return js=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},js.apply(null,arguments)}var G8=x.createContext(null),h1e=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l,children:u}=e,d=x.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l}),[t,n,r,i,a,l]);return x.createElement(G8.Provider,{value:d},u)},V8=()=>{var e=x.useContext(G8),t=wx();return e||(t?mC(t):void 0)},p1e=x.createContext(null),m1e=()=>{var e=x.useContext(p1e),t=Ue($U);return e||t},g1e=e=>{var{value:t,formatter:n}=e,r=on(e.children)?t:e.children;return typeof n=="function"?n(r):r},wA=e=>e!=null&&typeof e=="function",y1e=(e,t)=>{var n=Wr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},v1e=(e,t,n,r,i)=>{var{offset:a,className:l}=e,{cx:u,cy:d,innerRadius:f,outerRadius:p,startAngle:m,endAngle:g,clockWise:v}=i,j=(f+p)/2,b=y1e(m,g),S=b>=0?1:-1,k,E;switch(t){case"insideStart":k=m+S*a,E=v;break;case"insideEnd":k=g-S*a,E=!v;break;case"end":k=g+S*a,E=v;break;default:throw new Error("Unsupported position ".concat(t))}E=b<=0?E:!E;var C=mr(u,d,j,k),A=mr(u,d,j,k+(E?1:-1)*359),T="M".concat(C.x,",").concat(C.y,`
288
+ A`).concat(j,",").concat(j,",0,1,").concat(E?0:1,`,
289
+ `).concat(A.x,",").concat(A.y),O=on(e.id)?Ah("recharts-radial-line-"):e.id;return x.createElement("text",js({},r,{dominantBaseline:"central",className:Ot("recharts-radial-bar-label",l)}),x.createElement("defs",null,x.createElement("path",{id:O,d:T})),x.createElement("textPath",{xlinkHref:"#".concat(O)},n))},x1e=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:l,startAngle:u,endAngle:d}=e,f=(u+d)/2;if(n==="outside"){var{x:p,y:m}=mr(r,i,l+t,f);return{x:p,y:m,textAnchor:p>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var g=(a+l)/2,{x:v,y:j}=mr(r,i,g,f);return{x:v,y:j,textAnchor:"middle",verticalAnchor:"middle"}},Kg=e=>e!=null&&"cx"in e&&Te(e.cx),b1e={angle:0,offset:5,zIndex:Wn.label,position:"middle",textBreakAll:!1};function w1e(e){if(!Kg(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function Eo(e){var t=tr(e,b1e),{viewBox:n,parentViewBox:r,position:i,value:a,children:l,content:u,className:d="",textBreakAll:f,labelRef:p}=t,m=m1e(),g=V8(),v=i==="center"?g:m??g,j,b,S;n==null?j=v:Kg(n)?j=n:j=mC(n);var k=w1e(j);if(!j||on(a)&&on(l)&&!x.isValidElement(u)&&typeof u!="function")return null;var E=rh(rh({},t),{},{viewBox:j});if(x.isValidElement(u)){var{labelRef:C}=E,A=UI(E,o1e);return x.cloneElement(u,A)}if(typeof u=="function"){var{content:T}=E,O=UI(E,l1e);if(b=x.createElement(u,O),x.isValidElement(b))return b}else b=g1e(t);var _=kr(t);if(Kg(j)){if(i==="insideStart"||i==="insideEnd"||i==="end")return v1e(t,i,b,_,j);S=x1e(j,t.offset,t.position)}else{if(!k)return null;var P=s1e({viewBox:k,position:i,offset:t.offset,parentViewBox:Kg(r)?void 0:r});S=rh(rh({x:P.x,y:P.y,textAnchor:P.horizontalAnchor,verticalAnchor:P.verticalAnchor},P.width!==void 0?{width:P.width}:{}),P.height!==void 0?{height:P.height}:{})}return x.createElement(bi,{zIndex:t.zIndex},x.createElement(bA,js({ref:p,className:Ot("recharts-label",d)},_,S,{textAnchor:q8(_.textAnchor)?_.textAnchor:S.textAnchor,breakAll:f}),b))}Eo.displayName="Label";var j1e=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(Eo,js({key:"label-implicit"},r)):Fa(e)?x.createElement(Eo,js({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===Eo?x.cloneElement(e,rh({key:"label-implicit"},r)):x.createElement(Eo,js({key:"label-implicit",content:e},r)):wA(e)?x.createElement(Eo,js({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(Eo,js({},e,{key:"label-implicit"},r)):null};function S1e(e){var{label:t,labelRef:n}=e,r=V8();return j1e(t,r,n)||null}var N1e=["valueAccessor"],k1e=["dataKey","clockWise","id","textBreakAll","zIndex"];function cv(){return cv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cv.apply(null,arguments)}function FI(e,t){if(e==null)return{};var n,r,i=C1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function C1e(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 A1e=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(XSe(t))return t},Q8=x.createContext(void 0),jA=Q8.Provider,W8=x.createContext(void 0);W8.Provider;function O1e(){return x.useContext(Q8)}function E1e(){return x.useContext(W8)}function Gg(e){var{valueAccessor:t=A1e}=e,n=FI(e,N1e),{dataKey:r,clockWise:i,id:a,textBreakAll:l,zIndex:u}=n,d=FI(n,k1e),f=O1e(),p=E1e(),m=f||p;return!m||!m.length?null:x.createElement(bi,{zIndex:u??Wn.label},x.createElement(gr,{className:"recharts-label-list"},m.map((g,v)=>{var j,b=on(r)?t(g,v):vn(g.payload,r),S=on(a)?{}:{id:"".concat(a,"-").concat(v)};return x.createElement(Eo,cv({key:"label-".concat(v)},kr(g),d,S,{fill:(j=n.fill)!==null&&j!==void 0?j:g.fill,parentViewBox:g.parentViewBox,value:b,textBreakAll:l,viewBox:g.viewBox,index:v,zIndex:0}))})))}Gg.displayName="LabelList";function SA(e){var{label:t}=e;return t?t===!0?x.createElement(Gg,{key:"labelList-implicit"}):x.isValidElement(t)||wA(t)?x.createElement(Gg,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(Gg,cv({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function hN(){return hN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hN.apply(null,arguments)}var Y8=e=>{var{cx:t,cy:n,r,className:i}=e,a=Ot("recharts-dot",i);return Te(t)&&Te(n)&&Te(r)?x.createElement("circle",hN({},gi(e),iC(e),{className:a,cx:t,cy:n,r})):null},_1e={radiusAxis:{},angleAxis:{}},Z8=Or({name:"polarAxis",initialState:_1e,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:mze,removeRadiusAxis:gze,addAngleAxis:yze,removeAngleAxis:vze}=Z8.actions,z1e=Z8.reducer;function T1e(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var xS={exports:{}},qt={};var HI;function P1e(){if(HI)return qt;HI=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.view_transition"),v=Symbol.for("react.client.reference");function j(b){if(typeof b=="object"&&b!==null){var S=b.$$typeof;switch(S){case e:switch(b=b.type,b){case n:case i:case r:case d:case f:case g:return b;default:switch(b=b&&b.$$typeof,b){case l:case u:case m:case p:return b;case a:return b;default:return S}}case t:return S}}}return qt.ContextConsumer=a,qt.ContextProvider=l,qt.Element=e,qt.ForwardRef=u,qt.Fragment=n,qt.Lazy=m,qt.Memo=p,qt.Portal=t,qt.Profiler=i,qt.StrictMode=r,qt.Suspense=d,qt.SuspenseList=f,qt.isContextConsumer=function(b){return j(b)===a},qt.isContextProvider=function(b){return j(b)===l},qt.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},qt.isForwardRef=function(b){return j(b)===u},qt.isFragment=function(b){return j(b)===n},qt.isLazy=function(b){return j(b)===m},qt.isMemo=function(b){return j(b)===p},qt.isPortal=function(b){return j(b)===t},qt.isProfiler=function(b){return j(b)===i},qt.isStrictMode=function(b){return j(b)===r},qt.isSuspense=function(b){return j(b)===d},qt.isSuspenseList=function(b){return j(b)===f},qt.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===i||b===r||b===d||b===f||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===p||b.$$typeof===l||b.$$typeof===a||b.$$typeof===u||b.$$typeof===v||b.getModuleId!==void 0)},qt.typeOf=j,qt}var KI;function R1e(){return KI||(KI=1,xS.exports=P1e()),xS.exports}var D1e=R1e(),GI=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",VI=null,bS=null,X8=e=>{if(e===VI&&Array.isArray(bS))return bS;var t=[];return x.Children.forEach(e,n=>{on(n)||(D1e.isFragment(n)?t=t.concat(X8(n.props.children)):t.push(n))}),bS=t,VI=e,t};function M1e(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>GI(i)):r=[GI(t)],X8(e).forEach(i=>{var a=nd(i,"type.displayName")||nd(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var NA=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,wS={},QI;function I1e(){return QI||(QI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const i=n[Symbol.toStringTag];return i==null||!Object.getOwnPropertyDescriptor(n,Symbol.toStringTag)?.writable?!1:n.toString()===`[object ${i}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(wS)),wS}var jS,WI;function L1e(){return WI||(WI=1,jS=I1e().isPlainObject),jS}var $1e=L1e();const B1e=ma($1e);var YI,ZI,XI,JI,eL;function tL(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 nL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tL(Object(n),!0).forEach(function(r){U1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function U1e(e,t,n){return(t=q1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q1e(e){var t=F1e(e,"string");return typeof t=="symbol"?t:t+""}function F1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uv(){return uv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uv.apply(null,arguments)}function Wf(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var rL=(e,t,n,r,i)=>{var a=n-r,l;return l=kn(YI||(YI=Wf(["M ",",",""])),e,t),l+=kn(ZI||(ZI=Wf(["L ",",",""])),e+n,t),l+=kn(XI||(XI=Wf(["L ",",",""])),e+n-a/2,t+i),l+=kn(JI||(JI=Wf(["L ",",",""])),e+n-a/2-r,t+i),l+=kn(eL||(eL=Wf(["L ",","," Z"])),e,t),l},H1e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},K1e=e=>{var t=tr(e,H1e),{x:n,y:r,upperWidth:i,lowerWidth:a,height:l,className:u}=t,{animationEasing:d,animationDuration:f,animationBegin:p,isUpdateAnimationActive:m}=t,g=x.useRef(null),[v,j]=x.useState(-1),b=x.useRef(i),S=x.useRef(a),k=x.useRef(l),E=x.useRef(n),C=x.useRef(r),A=lp(e,"trapezoid-");if(x.useEffect(()=>{if(g.current&&g.current.getTotalLength)try{var X=g.current.getTotalLength();X&&j(X)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||l!==+l||i===0&&a===0||l===0)return null;var T=Ot("recharts-trapezoid",u);if(!m)return x.createElement("g",null,x.createElement("path",uv({},kr(t),{className:T,d:rL(n,r,i,a,l)})));var O=b.current,_=S.current,P=k.current,$=E.current,F=C.current,U="0px ".concat(v===-1?1:v,"px"),B="".concat(v,"px ").concat(v,"px"),V=uU(["strokeDasharray"],f,d);return x.createElement(op,{animationId:A,key:A,canBegin:v>0,duration:f,easing:d,isActive:m,begin:p},X=>{var Z=Ft(O,i,X),H=Ft(_,a,X),J=Ft(P,l,X),oe=Ft($,n,X),ye=Ft(F,r,X);g.current&&(b.current=Z,S.current=H,k.current=J,E.current=oe,C.current=ye);var I=X>0?{transition:V,strokeDasharray:B}:{strokeDasharray:U};return x.createElement("path",uv({},kr(t),{className:T,d:rL(oe,ye,Z,H,J),ref:g,style:nL(nL({},I),t.style)}))})},G1e=["option","shapeType","activeClassName","inActiveClassName"];function V1e(e,t){if(e==null)return{};var n,r,i=Q1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Q1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function iL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iL(Object(n),!0).forEach(function(r){W1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function W1e(e,t,n){return(t=Y1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y1e(e){var t=Z1e(e,"string");return typeof t=="symbol"?t:t+""}function Z1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function X1e(e,t){return dv(dv({},t),e)}function J1e(e,t){return e==="symbols"}function aL(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return x.createElement(pU,n);case"trapezoid":return x.createElement(K1e,n);case"sector":return x.createElement(yU,n);case"symbols":if(J1e(t))return x.createElement(rC,n);break;case"curve":return x.createElement(fh,n);default:return null}}function eNe(e){return x.isValidElement(e)?e.props:e}function J8(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=V1e(e,G1e),l;if(x.isValidElement(t))l=x.cloneElement(t,dv(dv({},a),eNe(t)));else if(typeof t=="function")l=t(a,a.index);else if(B1e(t)&&typeof t!="boolean"){var u=X1e(t,a);l=x.createElement(aL,{shapeType:n,elementProps:u})}else{var d=a;l=x.createElement(aL,{shapeType:n,elementProps:d})}return a.isActive?x.createElement(gr,{className:r},l):x.createElement(gr,{className:i},l)}var eF=(e,t,n)=>{var r=ln();return(i,a)=>l=>{e?.(i,a,l),r(u8({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},tF=e=>{var t=ln();return(n,r)=>i=>{e?.(n,r,i),t(vwe())}},nF=(e,t,n)=>{var r=ln();return(i,a)=>l=>{e?.(i,a,l),r(xwe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function kA(e){var{tooltipEntrySettings:t}=e,n=ln(),r=rr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(pwe(t)):i.current!==t&&n(mwe({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(gwe(i.current)),i.current=null)},[n]),null}function CA(e){var{legendPayload:t}=e,n=ln(),r=rr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(nge(t)):i.current!==t&&n(rge({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(ige(i.current)),i.current=null)},[n]),null}var SS,tNe=()=>{var[e]=x.useState(()=>Ah("uid-"));return e},nNe=(SS=bv.useId)!==null&&SS!==void 0?SS:tNe;function rNe(e,t){var n=nNe();return t||(e?"".concat(e,"-").concat(n):n)}var iNe=x.createContext(void 0),AA=e=>{var{id:t,type:n,children:r}=e,i=rNe("recharts-".concat(n),t);return x.createElement(iNe.Provider,{value:i},r(i))},aNe={cartesianItems:[],polarItems:[]},rF=Or({name:"graphicalItems",initialState:aNe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:an()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Ui(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:an()},removeCartesianGraphicalItem:{reducer(e,t){var n=Ui(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:an()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:an()},removePolarGraphicalItem:{reducer(e,t){var n=Ui(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:an()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Ui(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:an()}}}),{addCartesianGraphicalItem:sNe,replaceCartesianGraphicalItem:oNe,removeCartesianGraphicalItem:lNe,addPolarGraphicalItem:xze,removePolarGraphicalItem:bze,replacePolarGraphicalItem:wze}=rF.actions,cNe=rF.reducer,uNe=e=>{var t=ln(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(sNe(e)):n.current!==e&&t(oNe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(lNe(n.current)),n.current=null)},[t]),null},OA=x.memo(uNe),dNe=["points"];function sL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function NS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sL(Object(n),!0).forEach(function(r){fNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fNe(e,t,n){return(t=hNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hNe(e){var t=pNe(e,"string");return typeof t=="symbol"?t:t+""}function pNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fv(){return fv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fv.apply(null,arguments)}function mNe(e,t){if(e==null)return{};var n,r,i=gNe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function gNe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function yNe(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=Ot(r,typeof t!="boolean"?t.className:""),a=n??{},{points:l}=a,u=mNe(a,dNe);return x.createElement(Y8,fv({},u,{className:i}))}function vNe(e,t){return e==null?!1:t?!0:e.length===1}function iF(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:l,needClip:u,clipPathId:d,zIndex:f=Wn.scatter}=e;if(!vNe(t,n))return null;var p=NA(n),m=Fde(n),g=t.map((j,b)=>{var S,k,E=NS(NS(NS({r:3},l),m),{},{index:b,cx:(S=j.x)!==null&&S!==void 0?S:void 0,cy:(k=j.y)!==null&&k!==void 0?k:void 0,dataKey:a,value:j.value,payload:j.payload,points:t});return x.createElement(yNe,{key:"dot-".concat(b),option:n,dotProps:E,className:i})}),v={};return u&&d!=null&&(v.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(d,")")),x.createElement(bi,{zIndex:f},x.createElement(gr,fv({className:r},v),g))}function oL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function lL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oL(Object(n),!0).forEach(function(r){xNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xNe(e,t,n){return(t=bNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bNe(e){var t=wNe(e,"string");return typeof t=="symbol"?t:t+""}function wNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var aF=0,jNe={xAxis:{},yAxis:{},zAxis:{}},sF=Or({name:"cartesianAxis",initialState:jNe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:an()},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:an()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:an()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:an()},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:an()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:an()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:an()},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:an()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:an()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,l=i.widthHistory||[];if(l.length===3&&l[0]===l[2]&&r===l[1]&&r!==i.width&&Math.abs(r-((a=l[0])!==null&&a!==void 0?a:0))<=1)return;var u=[...l,r].slice(-3);e.yAxis[n]=lL(lL({},i),{},{width:r,widthHistory:u})}}}}),{addXAxis:SNe,replaceXAxis:NNe,removeXAxis:kNe,addYAxis:CNe,replaceYAxis:ANe,removeYAxis:ONe,addZAxis:jze,replaceZAxis:Sze,removeZAxis:Nze,updateYAxisWidth:ENe}=sF.actions,_Ne=sF.reducer,zNe=re([nr],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),TNe=re([zNe,Bs,Us],(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)}}),Fx=()=>Ue(TNe),PNe=()=>Ue(pje);function cL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cL(Object(n),!0).forEach(function(r){RNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RNe(e,t,n){return(t=DNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DNe(e){var t=MNe(e,"string");return typeof t=="symbol"?t:t+""}function MNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var INe=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:l}=e;if(i===!1||t.x==null||t.y==null)return null;var u={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},d=kS(kS(kS({},u),Jh(i)),iC(i)),f;return x.isValidElement(i)?f=x.cloneElement(i,d):typeof i=="function"?f=i(d):f=x.createElement(Y8,d),x.createElement(gr,{className:"recharts-active-dot",clipPath:l},f)};function pN(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:l=Wn.activeDot}=e,u=Ue(hc),d=PNe();if(t==null||d==null)return null;var f=t.find(p=>d.includes(p.payload));return on(f)?null:x.createElement(bi,{zIndex:l},x.createElement(INe,{point:f,childIndex:Number(u),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var uL=(e,t,n)=>{var r=n??e;if(!on(r))return ha(r,t,0)},LNe=(e,t,n)=>{var r={},i=e.filter(zx),a=e.filter(f=>f.stackId==null),l=i.reduce((f,p)=>{var m=f[p.stackId];return m==null&&(m=[]),m.push(p),f[p.stackId]=m,f},r),u=Object.entries(l).map(f=>{var p,[m,g]=f,v=g.map(b=>b.dataKey),j=uL(t,n,(p=g[0])===null||p===void 0?void 0:p.barSize);return{stackId:m,dataKeys:v,barSize:j}}),d=a.map(f=>{var p=[f.dataKey].filter(g=>g!=null),m=uL(t,n,f.barSize);return{stackId:void 0,dataKeys:p,barSize:m}});return[...u,...d]};function dL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ng(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dL(Object(n),!0).forEach(function(r){$Ne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Ne(e,t,n){return(t=BNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BNe(e){var t=UNe(e,"string");return typeof t=="symbol"?t:t+""}function UNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qNe(e,t,n,r,i){var a,l=r.length;if(!(l<1)){var u=ha(e,n,0,!0),d,f=[];if(ht((a=r[0])===null||a===void 0?void 0:a.barSize)){var p=!1,m=n/l,g=r.reduce((E,C)=>E+(C.barSize||0),0);g+=(l-1)*u,g>=n&&(g-=(l-1)*u,u=0),g>=n&&m>0&&(p=!0,m*=.9,g=l*m);var v=(n-g)/2>>0,j={offset:v-u,size:0};d=r.reduce((E,C)=>{var A,T={stackId:C.stackId,dataKeys:C.dataKeys,position:{offset:j.offset+j.size+u,size:p?m:(A=C.barSize)!==null&&A!==void 0?A:0}},O=[...E,T];return j=T.position,O},f)}else{var b=ha(t,n,0,!0);n-2*b-(l-1)*u<=0&&(u=0);var S=(n-2*b-(l-1)*u)/l;S>1&&(S>>=0);var k=ht(i)?Math.min(S,i):S;d=r.reduce((E,C,A)=>[...E,{stackId:C.stackId,dataKeys:C.dataKeys,position:{offset:b+(S+u)*A+(S-k)/2,size:k}}],f)}return d}}var FNe=(e,t,n,r,i,a,l)=>{var u=on(l)?t:l,d=qNe(n,r,i!==a?i:a,e,u);return i!==a&&d!=null&&(d=d.map(f=>Ng(Ng({},f),{},{position:Ng(Ng({},f.position),{},{offset:f.position.offset-i/2})}))),d},HNe=(e,t)=>{var n=_x(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(l=>l.key===n)}}}},KNe=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function GNe(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&ht(e.zIndex)?e.zIndex:t}var VNe=e=>{var{chartData:t}=e,n=ln(),r=rr();return x.useEffect(()=>r?()=>{}:(n(kI(t)),()=>{n(kI(void 0))}),[t,n,r]),null},fL={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},oF=Or({name:"brush",initialState:fL,reducers:{setBrushSettings(e,t){return t.payload==null?fL:t.payload}}}),{setBrushSettings:kze}=oF.actions,QNe=oF.reducer;function WNe(e){return(e%180+180)%180}var YNe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=WNe(i),l=a*Math.PI/180,u=Math.atan(r/n),d=l>u&&l<Math.PI-u?r/Math.sin(l):n/Math.cos(l);return Math.abs(d)},ZNe={dots:[],areas:[],lines:[]},lF=Or({name:"referenceElements",initialState:ZNe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Ui(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=Ui(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=Ui(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:Cze,removeDot:Aze,addArea:Oze,removeArea:Eze,addLine:_ze,removeLine:zze}=lF.actions,XNe=lF.reducer,JNe=x.createContext(void 0),eke=e=>{var{children:t}=e,[n]=x.useState("".concat(Ah("recharts"),"-clip")),r=Fx();if(r==null)return null;var{x:i,y:a,width:l,height:u}=r;return x.createElement(JNe.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:i,y:a,height:u,width:l}))),t)};function cF(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function tke(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return YNe(r,n)}function nke(e,t,n){var r=n==="width",{x:i,y:a,width:l,height:u}=e;return t===1?{start:r?i:a,end:r?i+l:a+u}:{start:r?i+l:a+u,end:r?i:a}}function Uh(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function rke(e,t){return cF(e,t+1)}function ike(e,t,n,r,i){for(var a=(r||[]).slice(),{start:l,end:u}=t,d=0,f=1,p=l,m=function(){var j=r?.[d];if(j===void 0)return{v:cF(r,f)};var b=d,S,k=()=>(S===void 0&&(S=n(j,b)),S),E=j.coordinate,C=d===0||Uh(e,E,k,p,u);C||(d=0,p=l,f+=1),C&&(p=E+e*(k()/2+i),d+=f)},g;f<=a.length;)if(g=m(),g)return g.v;return[]}function ake(e,t,n,r,i){var a=(r||[]).slice(),l=a.length;if(l===0)return[];for(var{start:u,end:d}=t,f=1;f<=l;f++){for(var p=(l-1)%f,m=u,g=!0,v=function(){var A=r[b];if(A==null)return 0;var T=b,O,_=()=>(O===void 0&&(O=n(A,T)),O),P=A.coordinate,$=b===p||Uh(e,P,_,m,d);if(!$)return g=!1,1;$&&(m=P+e*(_()/2+i))},j,b=p;b<l&&(j=v(),!(j!==0&&j===1));b+=f);if(g){for(var S=[],k=p;k<l;k+=f){var E=r[k];E!=null&&S.push(E)}return S}}return[]}function hL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hL(Object(n),!0).forEach(function(r){ske(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ske(e,t,n){return(t=oke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oke(e){var t=lke(e,"string");return typeof t=="symbol"?t:t+""}function lke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cke(e,t,n,r,i){for(var a=(r||[]).slice(),l=a.length,{start:u}=t,{end:d}=t,f=function(g){var v=a[g];if(v==null)return 1;var j=v,b,S=()=>(b===void 0&&(b=n(v,g)),b);if(g===l-1){var k=e*(j.coordinate+e*S()/2-d);a[g]=j=xr(xr({},j),{},{tickCoord:k>0?j.coordinate-k*e:j.coordinate})}else a[g]=j=xr(xr({},j),{},{tickCoord:j.coordinate});if(j.tickCoord!=null){var E=Uh(e,j.tickCoord,S,u,d);E&&(d=j.tickCoord-e*(S()/2+i),a[g]=xr(xr({},j),{},{isShow:!0}))}},p=l-1;p>=0;p--)f(p);return a}function uke(e,t,n,r,i,a){var l=(r||[]).slice(),u=l.length,{start:d,end:f}=t;if(a){var p=r[u-1];if(p!=null){var m=n(p,u-1),g=e*(p.coordinate+e*m/2-f);if(l[u-1]=p=xr(xr({},p),{},{tickCoord:g>0?p.coordinate-g*e:p.coordinate}),p.tickCoord!=null){var v=Uh(e,p.tickCoord,()=>m,d,f);v&&(f=p.tickCoord-e*(m/2+i),l[u-1]=xr(xr({},p),{},{isShow:!0}))}}}for(var j=a?u-1:u,b=function(E){var C=l[E];if(C==null)return 1;var A=C,T,O=()=>(T===void 0&&(T=n(C,E)),T);if(E===0){var _=e*(A.coordinate-e*O()/2-d);l[E]=A=xr(xr({},A),{},{tickCoord:_<0?A.coordinate-_*e:A.coordinate})}else l[E]=A=xr(xr({},A),{},{tickCoord:A.coordinate});if(A.tickCoord!=null){var P=Uh(e,A.tickCoord,O,d,f);P&&(d=A.tickCoord+e*(O()/2+i),l[E]=xr(xr({},A),{},{isShow:!0}))}},S=0;S<j;S++)b(S);return l}function EA(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:l,orientation:u,interval:d,tickFormatter:f,unit:p,angle:m}=e;if(!i||!i.length||!r)return[];if(Te(d)||sp.isSsr){var g;return(g=rke(i,Te(d)?d:0))!==null&&g!==void 0?g:[]}var v=[],j=u==="top"||u==="bottom"?"width":"height",b=p&&j==="width"?ph(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},S=(T,O)=>{var _=typeof f=="function"?f(T.value,O):T.value;return j==="width"?tke(ph(_,{fontSize:t,letterSpacing:n}),b,m):ph(_,{fontSize:t,letterSpacing:n})[j]},k=i[0],E=i[1],C=i.length>=2&&k!=null&&E!=null?Wr(E.coordinate-k.coordinate):1,A=nke(a,C,j);return d==="equidistantPreserveStart"?ike(C,A,S,i,l):d==="equidistantPreserveEnd"?ake(C,A,S,i,l):(d==="preserveStart"||d==="preserveStartEnd"?v=uke(C,A,S,i,l,d==="preserveStartEnd"):v=cke(C,A,S,i,l),v.filter(T=>T.isShow))}var dke=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,l=0;if(t){Array.from(t).forEach(p=>{if(p){var m=p.getBoundingClientRect();m.width>l&&(l=m.width)}});var u=n?n.getBoundingClientRect().width:0,d=i+a,f=l+d+u+(n?r:0);return Math.round(f)}return 0},fke={xAxis:{},yAxis:{}},uF=Or({name:"renderedTicks",initialState:fke,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=i},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:hke,removeRenderedTicks:pke}=uF.actions,mke=uF.reducer,gke=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function yke(e,t){if(e==null)return{};var n,r,i=vke(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function vke(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function pc(){return pc=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},pc.apply(null,arguments)}function pL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Nn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pL(Object(n),!0).forEach(function(r){xke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xke(e,t,n){return(t=bke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bke(e){var t=wke(e,"string");return typeof t=="symbol"?t:t+""}function wke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Os={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:Wn.axis};function jke(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:l,axisLine:u,otherSvgProps:d}=e;if(!u)return null;var f=Nn(Nn(Nn({},d),gi(u)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!l||a==="bottom"&&l);f=Nn(Nn({},f),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var m=+(a==="left"&&!l||a==="right"&&l);f=Nn(Nn({},f),{},{x1:t+m*r,y1:n,x2:t+m*r,y2:n+i})}return x.createElement("line",pc({},f,{className:Ot("recharts-cartesian-axis-line",nd(u,"className"))}))}function Ske(e,t,n,r,i,a,l,u,d){var f,p,m,g,v,j,b=u?-1:1,S=e.tickSize||l,k=Te(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=p=e.coordinate,g=n+ +!u*i,m=g-b*S,j=m-b*d,v=k;break;case"left":m=g=e.coordinate,p=t+ +!u*r,f=p-b*S,v=f-b*d,j=k;break;case"right":m=g=e.coordinate,p=t+ +u*r,f=p+b*S,v=f+b*d,j=k;break;default:f=p=e.coordinate,g=n+ +u*i,m=g+b*S,j=m+b*d,v=k;break}return{line:{x1:f,y1:m,x2:p,y2:g},tick:{x:v,y:j}}}function Nke(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function kke(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function Cke(e){var{option:t,tickProps:n,value:r}=e,i,a=Ot(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))i=x.cloneElement(t,Nn(Nn({},n),{},{className:a}));else if(typeof t=="function")i=t(Nn(Nn({},n),{},{className:a}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=Ot(l,T1e(t))),i=x.createElement(bA,pc({},n,{className:l}),r)}return i}function Ake(e){var{ticks:t,axisType:n,axisId:r}=e,i=ln();return x.useEffect(()=>{if(r==null||n==null)return el;var a=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(hke({ticks:a,axisId:r,axisType:n})),()=>{i(pke({axisId:r,axisType:n}))}},[i,t,r,n]),null}var Oke=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:l,unit:u,padding:d,tickTextProps:f,orientation:p,mirror:m,x:g,y:v,width:j,height:b,tickSize:S,tickMargin:k,fontSize:E,letterSpacing:C,getTicksConfig:A,events:T,axisType:O,axisId:_}=e,P=EA(Nn(Nn({},A),{},{ticks:n}),E,C),$=gi(A),F=Jh(r),U=q8($.textAnchor)?$.textAnchor:Nke(p,m),B=kke(p,m),V={};typeof i=="object"&&(V=i);var X=Nn(Nn({},$),{},{fill:"none"},V),Z=P.map(oe=>Nn({entry:oe},Ske(oe,g,v,j,b,p,S,m,k))),H=Z.map(oe=>{var{entry:ye,line:I}=oe;return x.createElement(gr,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(ye.value,"-").concat(ye.coordinate,"-").concat(ye.tickCoord)},i&&x.createElement("line",pc({},X,I,{className:Ot("recharts-cartesian-axis-tick-line",nd(i,"className"))})))}),J=Z.map((oe,ye)=>{var I,M,{entry:q,tick:D}=oe,G=Nn(Nn(Nn(Nn({verticalAnchor:B},$),{},{textAnchor:U,stroke:"none",fill:a},D),{},{index:ye,payload:q,visibleTicksCount:P.length,tickFormatter:l,padding:d},f),{},{angle:(I=(M=f?.angle)!==null&&M!==void 0?M:$.angle)!==null&&I!==void 0?I:0}),se=Nn(Nn({},G),F);return x.createElement(gr,pc({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(q.value,"-").concat(q.coordinate,"-").concat(q.tickCoord)},sx(T,q,ye)),r&&x.createElement(Cke,{option:r,tickProps:se,value:"".concat(typeof l=="function"?l(q.value,ye):q.value).concat(u||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(O,"-ticks")},x.createElement(Ake,{ticks:P,axisId:_,axisType:O}),J.length>0&&x.createElement(bi,{zIndex:Wn.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(O,"-tick-labels"),ref:t},J)),H.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(O,"-tick-lines")},H))}),Eke=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:l,ticks:u,axisType:d,axisId:f}=e,p=yke(e,gke),[m,g]=x.useState(""),[v,j]=x.useState(""),b=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return dke({ticks:b.current,label:(k=e.labelRef)===null||k===void 0?void 0:k.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var S=x.useCallback(k=>{if(k){var E=k.getElementsByClassName("recharts-cartesian-axis-tick-value");b.current=E;var C=E[0];if(C){var A=window.getComputedStyle(C),T=A.fontSize,O=A.letterSpacing;(T!==m||O!==v)&&(g(T),j(O))}}},[m,v]);return l||r!=null&&r<=0||i!=null&&i<=0?null:x.createElement(bi,{zIndex:e.zIndex},x.createElement(gr,{className:Ot("recharts-cartesian-axis",a)},x.createElement(jke,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:gi(e)}),x.createElement(Oke,{ref:S,axisType:d,events:p,fontSize:m,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:u,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:f}),x.createElement(h1e,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(S1e,{label:e.label,labelRef:e.labelRef}),e.children)))}),_A=x.forwardRef((e,t)=>{var n=tr(e,Os);return x.createElement(Eke,pc({},n,{ref:t}))});_A.displayName="CartesianAxis";var _ke=["x1","y1","x2","y2","key"],zke=["offset"],Tke=["xAxisId","yAxisId"],Pke=["xAxisId","yAxisId"];function mL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mL(Object(n),!0).forEach(function(r){Rke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rke(e,t,n){return(t=Dke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dke(e){var t=Mke(e,"string");return typeof t=="symbol"?t:t+""}function Mke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hl(){return Hl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hl.apply(null,arguments)}function hv(e,t){if(e==null)return{};var n,r,i=Ike(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ike(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Lke=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:l,ry:u}=e;return x.createElement("rect",{x:r,y:i,ry:u,width:a,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function dF(e){var{option:t,lineItemProps:n}=e,r;if(x.isValidElement(t))r=x.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:l,x2:u,y2:d,key:f}=n,p=hv(n,_ke),m=(i=gi(p))!==null&&i!==void 0?i:{},{offset:g}=m,v=hv(m,zke);r=x.createElement("line",Hl({},v,{x1:a,y1:l,x2:u,y2:d,fill:"none",key:f}))}return r}function $ke(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:l}=e,u=hv(e,Tke),d=i.map((f,p)=>{var m=Sr(Sr({},u),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(p),index:p});return x.createElement(dF,{key:"line-".concat(p),option:r,lineItemProps:m})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function Bke(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:l}=e,u=hv(e,Pke),d=i.map((f,p)=>{var m=Sr(Sr({},u),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(p),index:p});return x.createElement(dF,{option:r,lineItemProps:m,key:"line-".concat(p)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function Uke(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:l,horizontalPoints:u,horizontal:d=!0}=e;if(!d||!t||!t.length||u==null)return null;var f=u.map(m=>Math.round(m+i-i)).sort((m,g)=>m-g);i!==f[0]&&f.unshift(0);var p=f.map((m,g)=>{var v=f[g+1],j=v==null,b=j?i+l-m:v-m;if(b<=0)return null;var S=g%t.length;return x.createElement("rect",{key:"react-".concat(g),y:m,x:r,height:b,width:a,stroke:"none",fill:t[S],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function qke(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:l,height:u,verticalPoints:d}=e;if(!t||!n||!n.length)return null;var f=d.map(m=>Math.round(m+i-i)).sort((m,g)=>m-g);i!==f[0]&&f.unshift(0);var p=f.map((m,g)=>{var v=f[g+1],j=v==null,b=j?i+l-m:v-m;if(b<=0)return null;var S=g%n.length;return x.createElement("rect",{key:"react-".concat(g),x:m,y:a,width:b,height:u,stroke:"none",fill:n[S],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var Fke=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return K6(EA(Sr(Sr(Sr({},Os),n),{},{ticks:G6(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},Hke=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return K6(EA(Sr(Sr(Sr({},Os),n),{},{ticks:G6(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},Kke={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Wn.grid};function mc(e){var t=gC(),n=yC(),r=X6(),i=Sr(Sr({},tr(e,Kke)),{},{x:Te(e.x)?e.x:r.left,y:Te(e.y)?e.y:r.top,width:Te(e.width)?e.width:r.width,height:Te(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:l,x:u,y:d,width:f,height:p,syncWithTicks:m,horizontalValues:g,verticalValues:v}=i,j=rr(),b=Ue($=>fI($,"xAxis",a,j)),S=Ue($=>fI($,"yAxis",l,j));if(!Ha(f)||!Ha(p)||!Te(u)||!Te(d))return null;var k=i.verticalCoordinatesGenerator||Fke,E=i.horizontalCoordinatesGenerator||Hke,{horizontalPoints:C,verticalPoints:A}=i;if((!C||!C.length)&&typeof E=="function"){var T=g&&g.length,O=E({yAxis:S?Sr(Sr({},S),{},{ticks:T?g:S.ticks}):void 0,width:t??f,height:n??p,offset:r},T?!0:m);My(Array.isArray(O),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof O,"]")),Array.isArray(O)&&(C=O)}if((!A||!A.length)&&typeof k=="function"){var _=v&&v.length,P=k({xAxis:b?Sr(Sr({},b),{},{ticks:_?v:b.ticks}):void 0,width:t??f,height:n??p,offset:r},_?!0:m);My(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(A=P)}return x.createElement(bi,{zIndex:i.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(Lke,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(Uke,Hl({},i,{horizontalPoints:C})),x.createElement(qke,Hl({},i,{verticalPoints:A})),x.createElement($ke,Hl({},i,{offset:r,horizontalPoints:C,xAxis:b,yAxis:S})),x.createElement(Bke,Hl({},i,{offset:r,verticalPoints:A,xAxis:b,yAxis:S}))))}mc.displayName="CartesianGrid";var Gke={},fF=Or({name:"errorBars",initialState:Gke,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(a=>a.dataKey===r.dataKey&&a.direction===r.direction?i:a))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:Tze,replaceErrorBar:Pze,removeErrorBar:Rze}=fF.actions,Vke=fF.reducer,Qke=["children"];function Wke(e,t){if(e==null)return{};var n,r,i=Yke(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Yke(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 Zke={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},Xke=x.createContext(Zke);function hF(e){var{children:t}=e,n=Wke(e,Qke);return x.createElement(Xke.Provider,{value:n},t)}function Hx(e,t){var n,r,i=Ue(f=>Fs(f,e)),a=Ue(f=>Hs(f,t)),l=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:Gn.allowDataOverflow,u=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Vn.allowDataOverflow,d=l||u;return{needClip:d,needClipX:l,needClipY:u}}function zA(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=Fx(),{needClipX:a,needClipY:l,needClip:u}=Hx(t,n);if(!u||!i)return null;var{x:d,y:f,width:p,height:m}=i;return x.createElement("clipPath",{id:"clipPath-".concat(r)},x.createElement("rect",{x:a?d:d-p/2,y:l?f:f-m/2,width:a?p:p*2,height:l?m:m*2}))}var pF=(e,t,n,r)=>Qa(e,"xAxis",t,r),mF=(e,t,n,r)=>Va(e,"xAxis",t,r),gF=(e,t,n,r)=>Qa(e,"yAxis",n,r),yF=(e,t,n,r)=>Va(e,"yAxis",n,r),Jke=re([_t,pF,gF,mF,yF],(e,t,n,r,i)=>xa(e,"xAxis")?Go(t,r,!1):Go(n,i,!1)),eCe=(e,t,n,r,i)=>i;function tCe(e){return e.type==="line"}var nCe=re([mp,eCe],(e,t)=>e.filter(tCe).find(n=>n.id===t)),rCe=re([_t,pF,gF,mF,yF,nCe,Jke,cp],(e,t,n,r,i,a,l,u)=>{var{chartData:d,dataStartIndex:f,dataEndIndex:p}=u;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||l==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:m,data:g}=a,v;if(g!=null&&g.length>0?v=g:v=d?.slice(f,p+1),v!=null)return SCe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:m,bandSize:l,displayedData:v})}});function vF(e){var t=Jh(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,l=Number(i),u=Number(a);return(Number.isNaN(l)||l<0)&&(l=n),(Number.isNaN(u)||u<0)&&(u=r),{r:l,strokeWidth:u}}return{r:n,strokeWidth:r}}var iCe=["id"],aCe=["type","layout","connectNulls","needClip","shape"],sCe=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function qh(){return qh=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},qh.apply(null,arguments)}function gL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ra(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gL(Object(n),!0).forEach(function(r){oCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oCe(e,t,n){return(t=lCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lCe(e){var t=cCe(e,"string");return typeof t=="symbol"?t:t+""}function cCe(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 TA(e,t){if(e==null)return{};var n,r,i=uCe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function uCe(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 dCe=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:kd(n,t),payload:e}]},fCe=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:l,hide:u,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:el,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:kd(l,t),hide:u,type:f,color:r,unit:d,graphicalItemId:p}};return x.createElement(kA,{tooltipEntrySettings:m})}),xF=(e,t)=>"".concat(t,"px ").concat(e,"px");function hCe(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var pCe=(e,t,n)=>{var r=n.reduce((g,v)=>g+v,0);if(!r)return xF(t,e);for(var i=Math.floor(e/r),a=e%r,l=[],u=0,d=0;u<n.length;d+=(f=n[u])!==null&&f!==void 0?f:0,++u){var f,p=n[u];if(p!=null&&d+p>a){l=[...n.slice(0,u),a-d];break}}var m=l.length%2===0?[0,t]:[t];return[...hCe(n,i),...l,...m].map(g=>"".concat(g,"px")).join(", ")};function mCe(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:l}=r,{id:u}=r,d=TA(r,iCe),f=gi(d);return x.createElement(iF,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:f,needClip:l,clipPathId:t})}function gCe(e){var{showLabels:t,children:n,points:r}=e,i=x.useMemo(()=>r?.map(a=>{var l,u,d={x:(l=a.x)!==null&&l!==void 0?l:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Ra(Ra({},d),{},{value:a.value,payload:a.payload,viewBox:d,parentViewBox:void 0,fill:void 0})}),[r]);return x.createElement(jA,{value:t?i:void 0},n)}function yL(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:l,layout:u,connectNulls:d,needClip:f,shape:p}=a,m=TA(a,aCe),g=Ra(Ra({},kr(m)),{},{fill:"none",className:"recharts-line-curve",clipPath:f?"url(#clipPath-".concat(t,")"):void 0,points:r,type:l,layout:u,connectNulls:d,strokeDasharray:i??a.strokeDasharray});return x.createElement(x.Fragment,null,r?.length>1&&x.createElement(J8,qh({shapeType:"curve",option:p},g,{pathRef:n})),x.createElement(mCe,{points:r,clipPathId:t,props:a}))}function yCe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function vCe(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:l,strokeDasharray:u,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,animateNewValues:g,width:v,height:j,onAnimationEnd:b,onAnimationStart:S}=n,k=i.current,E=lp(l,"recharts-line-"),C=x.useRef(E),[A,T]=x.useState(!1),O=!A,_=x.useCallback(()=>{typeof b=="function"&&b(),T(!1)},[b]),P=x.useCallback(()=>{typeof S=="function"&&S(),T(!0)},[S]),$=yCe(r.current),F=x.useRef(0);C.current!==E&&(F.current=a.current,C.current=E);var U=F.current;return x.createElement(gCe,{points:l,showLabels:O},n.children,x.createElement(op,{animationId:E,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:_,onAnimationStart:P,key:E},B=>{var V=Ft(U,$+U,B),X=Math.min(V,$),Z;if(d)if(u){var H="".concat(u).split(/[,\s]+/gim).map(ye=>parseFloat(ye));Z=pCe(X,$,H)}else Z=xF($,X);else Z=u==null?void 0:String(u);if(B>0&&$>0&&(i.current=l,a.current=Math.max(a.current,X)),k){var J=k.length/l.length,oe=B===1?l:l.map((ye,I)=>{var M=Math.floor(I*J);if(k[M]){var q=k[M];return Ra(Ra({},ye),{},{x:Ft(q.x,ye.x,B),y:Ft(q.y,ye.y,B)})}return g?Ra(Ra({},ye),{},{x:Ft(v*2,ye.x,B),y:Ft(j/2,ye.y,B)}):Ra(Ra({},ye),{},{x:ye.x,y:ye.y})});return i.current=oe,x.createElement(yL,{props:n,points:oe,clipPathId:t,pathRef:r,strokeDasharray:Z})}return x.createElement(yL,{props:n,points:l,clipPathId:t,pathRef:r,strokeDasharray:Z})}),x.createElement(SA,{label:n.label}))}function xCe(e){var{clipPathId:t,props:n}=e,r=x.useRef(null),i=x.useRef(0),a=x.useRef(null);return x.createElement(vCe,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var bCe=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:vn(e.payload,t)}};class wCe extends x.Component{render(){var{hide:t,dot:n,points:r,className:i,xAxisId:a,yAxisId:l,top:u,left:d,width:f,height:p,id:m,needClip:g,zIndex:v}=this.props;if(t)return null;var j=Ot("recharts-line",i),b=m,{r:S,strokeWidth:k}=vF(n),E=NA(n),C=S*2+k,A=g?"url(#clipPath-".concat(E?"":"dots-").concat(b,")"):void 0;return x.createElement(bi,{zIndex:v},x.createElement(gr,{className:j},g&&x.createElement("defs",null,x.createElement(zA,{clipPathId:b,xAxisId:a,yAxisId:l}),!E&&x.createElement("clipPath",{id:"clipPath-dots-".concat(b)},x.createElement("rect",{x:d-C/2,y:u-C/2,width:f+C,height:p+C}))),x.createElement(hF,{xAxisId:a,yAxisId:l,data:r,dataPointFormatter:bCe,errorBarOffset:0},x.createElement(xCe,{props:this.props,clipPathId:b}))),x.createElement(pN,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:A}))}}var bF={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:Wn.line,type:"linear"};function jCe(e){var t=tr(e,bF),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:l,connectNulls:u,dot:d,hide:f,isAnimationActive:p,label:m,legendType:g,xAxisId:v,yAxisId:j,id:b}=t,S=TA(t,sCe),{needClip:k}=Hx(v,j),E=Fx(),C=tl(),A=rr(),T=Ue(F=>rCe(F,v,j,A,b));if(C!=="horizontal"&&C!=="vertical"||T==null||E==null)return null;var{height:O,width:_,x:P,y:$}=E;return x.createElement(wCe,qh({},S,{id:b,connectNulls:u,dot:d,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:l,isAnimationActive:p,hide:f,label:m,legendType:g,xAxisId:v,yAxisId:j,points:T,layout:C,height:O,width:_,left:P,top:$,needClip:k}))}function SCe(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:l,bandSize:u,displayedData:d}=e;return d.map((f,p)=>{var m=vn(f,l);if(t==="horizontal"){var g=Dy({axis:n,ticks:i,bandSize:u,entry:f,index:p}),v=on(m)?null:r.scale.map(m);return{x:g,y:v??null,value:m,payload:f}}var j=on(m)?null:n.scale.map(m),b=Dy({axis:r,ticks:a,bandSize:u,entry:f,index:p});return j==null||b==null?null:{x:j,y:b,value:m,payload:f}}).filter(Boolean)}function NCe(e){var t=tr(e,bF),n=rr();return x.createElement(AA,{id:t.id,type:"line"},r=>x.createElement(x.Fragment,null,x.createElement(CA,{legendPayload:dCe(t)}),x.createElement(fCe,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),x.createElement(OA,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),x.createElement(jCe,qh({},t,{id:r}))))}var Kx=x.memo(NCe,Nc);Kx.displayName="Line";function Za(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:aF}function Xa(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:aF}var wF=(e,t,n)=>Qa(e,"xAxis",Za(e,t),n),jF=(e,t,n)=>Va(e,"xAxis",Za(e,t),n),SF=(e,t,n)=>Qa(e,"yAxis",Xa(e,t),n),NF=(e,t,n)=>Va(e,"yAxis",Xa(e,t),n),kCe=re([_t,wF,SF,jF,NF],(e,t,n,r,i)=>xa(e,"xAxis")?Go(t,r,!1):Go(n,i,!1)),CCe=(e,t)=>t,kF=re([mp,CCe],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),CF=e=>{var t=_t(e),n=xa(t,"xAxis");return n?"yAxis":"xAxis"},ACe=(e,t)=>{var n=CF(e);return n==="yAxis"?Xa(e,t):Za(e,t)},OCe=(e,t,n)=>iv(e,CF(e),ACe(e,t),n),ECe=re([kF,OCe],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=_x(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,l=a?.find(u=>u.key===i);if(l!=null)return l.map(u=>[u[0],u[1]])}}}),_Ce=re([_t,wF,SF,jF,NF,ECe,xU,kCe,kF,wve],(e,t,n,r,i,a,l,u,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:g}=l;if(!(d==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||u==null)){var{data:v}=d,j;if(v&&v.length>0?j=v:j=p?.slice(m,g+1),j!=null)return YCe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:m,areaSettings:d,stackedData:a,displayedData:j,chartBaseValue:f,bandSize:u})}}),zCe=["id"],TCe=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Xl(){return Xl=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},Xl.apply(null,arguments)}function AF(e,t){if(e==null)return{};var n,r,i=PCe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function PCe(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 vL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ru(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vL(Object(n),!0).forEach(function(r){RCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RCe(e,t,n){return(t=DCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DCe(e){var t=MCe(e,"string");return typeof t=="symbol"?t:t+""}function MCe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pv(e,t){return e&&e!=="none"?e:t}var ICe=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:l}=e;return[{inactive:l,dataKey:t,type:a,color:pv(r,i),value:kd(n,t),payload:e}]},LCe=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:l,hide:u,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:el,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:kd(l,t),hide:u,type:f,color:pv(r,a),unit:d,graphicalItemId:p}};return x.createElement(kA,{tooltipEntrySettings:m})});function $Ce(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:l}=r,u=gi(r);return x.createElement(iF,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:u,needClip:i,clipPathId:t})}function BCe(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var l,u,d={x:(l=a.x)!==null&&l!==void 0?l:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Ru(Ru({},d),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return x.createElement(jA,{value:t?i:void 0},n)}function xL(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:l,type:u,stroke:d,connectNulls:f,isRange:p}=a,{id:m}=a,g=AF(a,zCe),v=gi(g),j=kr(g);return x.createElement(x.Fragment,null,t?.length>1&&x.createElement(gr,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},x.createElement(fh,Xl({},j,{id:m,points:t,connectNulls:f,type:u,baseLine:n,layout:l,stroke:"none",className:"recharts-area-area"})),d!=="none"&&x.createElement(fh,Xl({},v,{className:"recharts-area-curve",layout:l,type:u,connectNulls:f,fill:"none",points:t})),d!=="none"&&p&&Array.isArray(n)&&x.createElement(fh,Xl({},v,{className:"recharts-area-curve",layout:l,type:u,connectNulls:f,fill:"none",points:n}))),x.createElement($Ce,{points:t,props:g,clipPathId:i}))}function UCe(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:l}=e,u=(t=a[0])===null||t===void 0?void 0:t.y,d=(n=a[a.length-1])===null||n===void 0?void 0:n.y;if(!ht(u)||!ht(d))return null;var f=r*Math.abs(u-d),p=Math.max(...a.map(m=>m.x||0));return Te(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.x||0),p)),Te(p)?x.createElement("rect",{x:0,y:u<d?u:u-f,width:p+(l?parseInt("".concat(l),10):1),height:Math.floor(f)}):null}function qCe(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:l}=e,u=(t=a[0])===null||t===void 0?void 0:t.x,d=(n=a[a.length-1])===null||n===void 0?void 0:n.x;if(!ht(u)||!ht(d))return null;var f=r*Math.abs(u-d),p=Math.max(...a.map(m=>m.y||0));return Te(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.y||0),p)),Te(p)?x.createElement("rect",{x:u<d?u:u-f,y:0,width:f,height:Math.floor(p+(l?parseInt("".concat(l),10):1))}):null}function FCe(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?x.createElement(UCe,{alpha:t,points:r,baseLine:i,strokeWidth:a}):x.createElement(qCe,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function HCe(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:l,baseLine:u,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,onAnimationStart:g,onAnimationEnd:v}=r,j=x.useMemo(()=>({points:l,baseLine:u}),[l,u]),b=lp(j,"recharts-area-"),S=vC(),[k,E]=x.useState(!1),C=!k,A=x.useCallback(()=>{typeof v=="function"&&v(),E(!1)},[v]),T=x.useCallback(()=>{typeof g=="function"&&g(),E(!0)},[g]);if(S==null)return null;var O=i.current,_=a.current;return x.createElement(BCe,{showLabels:C,points:l},r.children,x.createElement(op,{animationId:b,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:A,onAnimationStart:T,key:b},P=>{if(O){var $=O.length/l.length,F=P===1?l:l.map((B,V)=>{var X=Math.floor(V*$);if(O[X]){var Z=O[X];return Ru(Ru({},B),{},{x:Ft(Z.x,B.x,P),y:Ft(Z.y,B.y,P)})}return B}),U;return Te(u)?U=Ft(_,u,P):on(u)||fa(u)?U=Ft(_,0,P):U=u.map((B,V)=>{var X=Math.floor(V*$);if(Array.isArray(_)&&_[X]){var Z=_[X];return Ru(Ru({},B),{},{x:Ft(Z.x,B.x,P),y:Ft(Z.y,B.y,P)})}return B}),P>0&&(i.current=F,a.current=U),x.createElement(xL,{points:F,baseLine:U,needClip:t,clipPathId:n,props:r})}return P>0&&(i.current=l,a.current=u),x.createElement(gr,null,d&&x.createElement("defs",null,x.createElement("clipPath",{id:"animationClipPath-".concat(n)},x.createElement(FCe,{alpha:P,points:l,baseLine:u,layout:S,strokeWidth:r.strokeWidth}))),x.createElement(gr,{clipPath:"url(#animationClipPath-".concat(n,")")},x.createElement(xL,{points:l,baseLine:u,needClip:t,clipPathId:n,props:r})))}),x.createElement(SA,{label:r.label}))}function KCe(e){var{needClip:t,clipPathId:n,props:r}=e,i=x.useRef(null),a=x.useRef();return x.createElement(HCe,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class GCe extends x.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:l,needClip:u,xAxisId:d,yAxisId:f,width:p,height:m,id:g,baseLine:v,zIndex:j}=this.props;if(t)return null;var b=Ot("recharts-area",i),S=g,{r:k,strokeWidth:E}=vF(n),C=NA(n),A=k*2+E,T=u?"url(#clipPath-".concat(C?"":"dots-").concat(S,")"):void 0;return x.createElement(bi,{zIndex:j},x.createElement(gr,{className:b},u&&x.createElement("defs",null,x.createElement(zA,{clipPathId:S,xAxisId:d,yAxisId:f}),!C&&x.createElement("clipPath",{id:"clipPath-dots-".concat(S)},x.createElement("rect",{x:l-A/2,y:a-A/2,width:p+A,height:m+A}))),x.createElement(KCe,{needClip:u,clipPathId:S,props:this.props})),x.createElement(pN,{points:r,mainColor:pv(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}),this.props.isRange&&Array.isArray(v)&&x.createElement(pN,{points:v,mainColor:pv(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}))}}var VCe={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:Wn.area};function QCe(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:l,dot:u,fill:d,fillOpacity:f,hide:p,isAnimationActive:m,legendType:g,stroke:v,xAxisId:j,yAxisId:b}=e,S=AF(e,TCe),k=tl(),E=E8(),{needClip:C}=Hx(j,b),A=rr(),{points:T,isRange:O,baseLine:_}=(t=Ue(V=>_Ce(V,e.id,A)))!==null&&t!==void 0?t:{},P=Fx();if(k!=="horizontal"&&k!=="vertical"||P==null||E!=="AreaChart"&&E!=="ComposedChart")return null;var{height:$,width:F,x:U,y:B}=P;return!T||!T.length?null:x.createElement(GCe,Xl({},S,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:_,connectNulls:l,dot:u,fill:d,fillOpacity:f,height:$,hide:p,layout:k,isAnimationActive:m,isRange:O,legendType:g,needClip:C,points:T,stroke:v,width:F,left:U,top:B,xAxisId:j,yAxisId:b}))}var WCe=(e,t,n,r,i)=>{var a=n??t;if(Te(a))return a;var l=e==="horizontal"?i:r,u=l.scale.domain();if(l.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return a==="dataMin"?f:a==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return a==="dataMin"?u[0]:a==="dataMax"?u[1]:u[0]};function YCe(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:l,xAxis:u,yAxis:d,displayedData:f,dataStartIndex:p,xAxisTicks:m,yAxisTicks:g,bandSize:v}=e,j=i&&i.length,b=WCe(a,l,n,u,d),S=a==="horizontal",k=!1,E=f.map((A,T)=>{var O,_,P,$;if(j)$=i[p+T];else{var F=vn(A,r);Array.isArray(F)?($=F,k=!0):$=[b,F]}var U=(O=(_=$)===null||_===void 0?void 0:_[1])!==null&&O!==void 0?O:null,B=U==null||j&&!t&&vn(A,r)==null;if(S){var V;return{x:Dy({axis:u,ticks:m,bandSize:v,entry:A,index:T}),y:B?null:(V=d.scale.map(U))!==null&&V!==void 0?V:null,value:$,payload:A}}return{x:B?null:(P=u.scale.map(U))!==null&&P!==void 0?P:null,y:Dy({axis:d,ticks:g,bandSize:v,entry:A,index:T}),value:$,payload:A}}),C;return j||k?C=E.map(A=>{var T,O=Array.isArray(A.value)?A.value[0]:null;if(S){var _;return{x:A.x,y:O!=null&&A.y!=null&&(_=d.scale.map(O))!==null&&_!==void 0?_:null,payload:A.payload}}return{x:O!=null&&(T=u.scale.map(O))!==null&&T!==void 0?T:null,y:A.y,payload:A.payload}}):C=S?d.scale.map(b):u.scale.map(b),{points:E,baseLine:C??0,isRange:k}}function ZCe(e){var t=tr(e,VCe),n=rr();return x.createElement(AA,{id:t.id,type:"area"},r=>x.createElement(x.Fragment,null,x.createElement(CA,{legendPayload:ICe(t)}),x.createElement(LCe,{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(OA,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:V6(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),x.createElement(QCe,Xl({},t,{id:r}))))}var Du=x.memo(ZCe,Nc);Du.displayName="Area";function mN(){return mN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mN.apply(null,arguments)}function PA(e){return x.createElement(J8,mN({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var XCe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Te(t))return t;var a=Te(r)||on(r);return a?t(r,i):(a||_s(!1),n)}},JCe=(e,t,n)=>n,eAe=(e,t)=>t,bp=re([mp,eAe],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),tAe=re([bp],e=>e?.maxBarSize),nAe=(e,t,n,r)=>r,rAe=re([_t,mp,Za,Xa,JCe],(e,t,n,r,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===n:a.yAxisId===r).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),iAe=(e,t,n)=>{var r=_t(e),i=Za(e,t),a=Xa(e,t);if(!(i==null||a==null))return r==="horizontal"?iv(e,"yAxis",a,n):iv(e,"xAxis",i,n)},aAe=(e,t)=>{var n=_t(e),r=Za(e,t),i=Xa(e,t);if(!(r==null||i==null))return n==="horizontal"?dI(e,"xAxis",r):dI(e,"yAxis",i)},sAe=re([rAe,bve,aAe],LNe),oAe=(e,t,n)=>{var r,i,a=bp(e,t);if(a==null)return 0;var l=Za(e,t),u=Xa(e,t);if(l==null||u==null)return 0;var d=_t(e),f=zU(e),{maxBarSize:p}=a,m=on(p)?f:p,g,v;return d==="horizontal"?(g=Qa(e,"xAxis",l,n),v=Va(e,"xAxis",l,n)):(g=Qa(e,"yAxis",u,n),v=Va(e,"yAxis",u,n)),(r=(i=Go(g,v,!0))!==null&&i!==void 0?i:m)!==null&&r!==void 0?r:0},OF=(e,t,n)=>{var r=_t(e),i=Za(e,t),a=Xa(e,t);if(!(i==null||a==null)){var l,u;return r==="horizontal"?(l=Qa(e,"xAxis",i,n),u=Va(e,"xAxis",i,n)):(l=Qa(e,"yAxis",a,n),u=Va(e,"yAxis",a,n)),Go(l,u)}},lAe=re([sAe,zU,xve,TU,oAe,OF,tAe],FNe),cAe=(e,t,n)=>{var r=Za(e,t);if(r!=null)return Qa(e,"xAxis",r,n)},uAe=(e,t,n)=>{var r=Xa(e,t);if(r!=null)return Qa(e,"yAxis",r,n)},dAe=(e,t,n)=>{var r=Za(e,t);if(r!=null)return Va(e,"xAxis",r,n)},fAe=(e,t,n)=>{var r=Xa(e,t);if(r!=null)return Va(e,"yAxis",r,n)},hAe=re([lAe,bp],KNe),pAe=re([iAe,bp],HNe),mAe=re([nr,hC,cAe,uAe,dAe,fAe,hAe,_t,xU,OF,pAe,bp,nAe],(e,t,n,r,i,a,l,u,d,f,p,m,g)=>{var{chartData:v,dataStartIndex:j,dataEndIndex:b}=d;if(!(m==null||l==null||t==null||u!=="horizontal"&&u!=="vertical"||n==null||r==null||i==null||a==null||f==null)){var{data:S}=m,k;if(S!=null&&S.length>0?k=S:k=v?.slice(j,b+1),k!=null)return FAe({layout:u,barSettings:m,pos:l,parentViewBox:t,bandSize:f,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:p,displayedData:k,offset:e,cells:g,dataStartIndex:j})}}),gAe=["index"];function gN(){return gN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gN.apply(null,arguments)}function yAe(e,t){if(e==null)return{};var n,r,i=vAe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function vAe(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 EF=x.createContext(void 0),xAe=e=>{var t=x.useContext(EF);if(t!=null)return t.stackId;if(e!=null)return V6(e)},bAe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),wAe=e=>{var t=x.useContext(EF);if(t!=null){var{stackId:n}=t;return"url(#".concat(bAe(n,e),")")}},_F=e=>{var{index:t}=e,n=yAe(e,gAe),r=wAe(t);return x.createElement(gr,gN({className:"recharts-bar-stack-layer",clipPath:r},n))},jAe=["onMouseEnter","onMouseLeave","onClick"],SAe=["value","background","tooltipPosition"],NAe=["id"],kAe=["onMouseEnter","onClick","onMouseLeave"];function Vo(){return Vo=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},Vo.apply(null,arguments)}function bL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bL(Object(n),!0).forEach(function(r){CAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CAe(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=OAe(e,"string");return typeof t=="symbol"?t:t+""}function OAe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mv(e,t){if(e==null)return{};var n,r,i=EAe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function 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 _Ae=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:kd(n,t),payload:e}]},zAe=x.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:l,unit:u,tooltipType:d,id:f}=e,p={dataDefinedOnItem:void 0,getPosition:el,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:kd(a,t),hide:l,type:d,color:i,unit:u,graphicalItemId:f}};return x.createElement(kA,{tooltipEntrySettings:p})});function TAe(e){var t=Ue(hc),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:l,onMouseLeave:u,onClick:d}=a,f=mv(a,jAe),p=eF(l,r,a.id),m=tF(u),g=nF(d,r,a.id);if(!i||n==null)return null;var v=Jh(i);return x.createElement(bi,{zIndex:GNe(i,Wn.barBackground)},n.map((j,b)=>{var{value:S,background:k,tooltipPosition:E}=j,C=mv(j,SAe);if(!k)return null;var A=p(j,b),T=m(j,b),O=g(j,b),_=Pr(Pr(Pr(Pr(Pr({option:i,isActive:String(b)===t},C),{},{fill:"#eee"},k),v),sx(f,j,b)),{},{onMouseEnter:A,onMouseLeave:T,onClick:O,dataKey:r,index:b,className:"recharts-bar-background-rectangle"});return x.createElement(PA,Vo({key:"background-bar-".concat(b)},_))}))}function PAe(e){var{showLabels:t,children:n,rects:r}=e,i=r?.map(a=>{var l={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return Pr(Pr({},l),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:l,fill:a.fill})});return x.createElement(jA,{value:t?i:void 0},n)}function RAe(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:l}=e,u=Ue(hc),d=Ue(C8),f=n&&String(i.originalDataIndex)===u&&(d==null||l===d),[p,m]=x.useState(!1),[g,v]=x.useState(!1);x.useEffect(()=>{var C;return f?(m(!0),C=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(C)}},[f]);var j=x.useCallback(()=>{f||m(!1)},[f]),b=f&&g,S=f||p,k;f?n===!0?k=t:k=n:k=t;var E=x.createElement(PA,Vo({},r,{name:String(r.name)},i,{isActive:b,option:k,index:a,dataKey:l,onTransitionEnd:j}));return S?x.createElement(bi,{zIndex:Wn.activeBar},x.createElement(_F,{index:i.originalDataIndex},E)):E}function DAe(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return x.createElement(PA,Vo({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function MAe(e){var t,{data:n,props:r}=e,i=(t=gi(r))!==null&&t!==void 0?t:{},{id:a}=i,l=mv(i,NAe),{shape:u,dataKey:d,activeBar:f}=r,{onMouseEnter:p,onClick:m,onMouseLeave:g}=r,v=mv(r,kAe),j=eF(p,d,a),b=tF(g),S=nF(m,d,a);return n?x.createElement(x.Fragment,null,n.map((k,E)=>x.createElement(_F,Vo({index:k.originalDataIndex,key:"rectangle-".concat(k?.x,"-").concat(k?.y,"-").concat(k?.value,"-").concat(E),className:"recharts-bar-rectangle"},sx(v,k,E),{onMouseEnter:j(k,E),onMouseLeave:b(k,E),onClick:S(k,E)}),f?x.createElement(RAe,{shape:u,activeBar:f,baseProps:l,entry:k,index:E,dataKey:d}):x.createElement(DAe,{shape:u,baseProps:l,entry:k,index:E,dataKey:d})))):null}function IAe(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationEnd:f,onAnimationStart:p}=t,m=n.current,g=lp(t,"recharts-bar-"),[v,j]=x.useState(!1),b=!v,S=x.useCallback(()=>{typeof f=="function"&&f(),j(!1)},[f]),k=x.useCallback(()=>{typeof p=="function"&&p(),j(!0)},[p]);return x.createElement(PAe,{showLabels:b,rects:r},x.createElement(op,{animationId:g,begin:l,duration:u,isActive:a,easing:d,onAnimationEnd:S,onAnimationStart:k,key:g},E=>{var C=E===1?r:r?.map((A,T)=>{var O=m&&m[T];if(O)return Pr(Pr({},A),{},{x:Ft(O.x,A.x,E),y:Ft(O.y,A.y,E),width:Ft(O.width,A.width,E),height:Ft(O.height,A.height,E)});if(i==="horizontal"){var _=Ft(0,A.height,E),P=Ft(A.stackedBarStart,A.y,E);return Pr(Pr({},A),{},{y:P,height:_})}var $=Ft(0,A.width,E),F=Ft(A.stackedBarStart,A.x,E);return Pr(Pr({},A),{},{width:$,x:F})});return E>0&&(n.current=C??null),C==null?null:x.createElement(gr,null,x.createElement(MAe,{props:t,data:C}))}),x.createElement(SA,{label:t.label}),t.children)}function LAe(e){var t=x.useRef(null);return x.createElement(IAe,{previousRectanglesRef:t,props:e})}var zF=0,$Ae=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:vn(e,t)}};class BAe extends x.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:l,needClip:u,background:d,id:f}=this.props;if(t||n==null)return null;var p=Ot("recharts-bar",i),m=f;return x.createElement(gr,{className:p,id:f},u&&x.createElement("defs",null,x.createElement(zA,{clipPathId:m,xAxisId:a,yAxisId:l})),x.createElement(gr,{className:"recharts-bar-rectangles",clipPath:u?"url(#clipPath-".concat(m,")"):void 0},x.createElement(TAe,{data:n,dataKey:r,background:d,allOtherBarProps:this.props}),x.createElement(LAe,this.props)))}}var UAe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:zF,xAxisId:0,yAxisId:0,zIndex:Wn.bar};function qAe(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:u,animationDuration:d,animationEasing:f,isAnimationActive:p}=e,{needClip:m}=Hx(t,n),g=tl(),v=rr(),j=M1e(e.children,lv),b=Ue(E=>mAe(E,e.id,v,j));if(g!=="vertical"&&g!=="horizontal")return null;var S,k=b?.[0];return k==null||k.height==null||k.width==null?S=0:S=g==="vertical"?k.height/2:k.width/2,x.createElement(hF,{xAxisId:t,yAxisId:n,data:b,dataPointFormatter:$Ae,errorBarOffset:S},x.createElement(BAe,Vo({},e,{layout:g,needClip:m,data:b,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:u,animationDuration:d,animationEasing:f,isAnimationActive:p})))}function FAe(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:l,xAxis:u,yAxis:d,xAxisTicks:f,yAxisTicks:p,stackedData:m,displayedData:g,offset:v,cells:j,parentViewBox:b,dataStartIndex:S}=e,k=t==="horizontal"?d:u,E=m?k.scale.domain():null,C=ime({numericAxis:k}),A=k.scale.map(C);return g.map((T,O)=>{var _,P,$,F,U,B;if(m){var V=m[O+S];if(V==null)return null;_=Jpe(V,E)}else _=vn(T,n),Array.isArray(_)||(_=[C,_]);var X=XCe(r,zF)(_[1],O);if(t==="horizontal"){var Z,H=d.scale.map(_[0]),J=d.scale.map(_[1]);if(H==null||J==null)return null;P=aD({axis:u,ticks:f,bandSize:l,offset:a.offset,entry:T,index:O}),$=(Z=J??H)!==null&&Z!==void 0?Z:void 0,F=a.size;var oe=H-J;if(U=fa(oe)?0:oe,B={x:P,y:v.top,width:F,height:v.height},Math.abs(X)>0&&Math.abs(U)<Math.abs(X)){var ye=Wr(U||X)*(Math.abs(X)-Math.abs(U));$-=ye,U+=ye}}else{var I=u.scale.map(_[0]),M=u.scale.map(_[1]);if(I==null||M==null)return null;if(P=I,$=aD({axis:d,ticks:p,bandSize:l,offset:a.offset,entry:T,index:O}),F=M-I,U=a.size,B={x:v.left,y:$,width:v.width,height:U},Math.abs(X)>0&&Math.abs(F)<Math.abs(X)){var q=Wr(F||X)*(Math.abs(X)-Math.abs(F));F+=q}}if(P==null||$==null||F==null||U==null||!i&&(F===0||U===0))return null;var D=Pr(Pr({},T),{},{stackedBarStart:A,x:P,y:$,width:F,height:U,value:m?_:_[1],payload:T,background:B,tooltipPosition:{x:P+F/2,y:$+U/2},parentViewBox:b,originalDataIndex:O},j&&j[O]&&j[O].props);return D}).filter(Boolean)}function HAe(e){var t=tr(e,UAe),n=xAe(t.stackId),r=rr();return x.createElement(AA,{id:t.id,type:"bar"},i=>x.createElement(x.Fragment,null,x.createElement(CA,{legendPayload:_Ae(t)}),x.createElement(zAe,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:i}),x.createElement(OA,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),x.createElement(bi,{zIndex:t.zIndex},x.createElement(qAe,Vo({},t,{id:i})))))}var gv=x.memo(HAe,Nc);gv.displayName="Bar";var KAe=["domain","range"],GAe=["domain","range"];function wL(e,t){if(e==null)return{};var n,r,i=VAe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function VAe(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 jL(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 TF(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=wL(e,KAe),{domain:a,range:l}=t,u=wL(t,GAe);return!jL(n,a)||!jL(r,l)?!1:Nc(i,u)}var QAe=["type"],WAe=["dangerouslySetInnerHTML","ticks","scale"],YAe=["id","scale"];function yN(){return yN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yN.apply(null,arguments)}function SL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function NL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SL(Object(n),!0).forEach(function(r){ZAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZAe(e,t,n){return(t=XAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XAe(e){var t=JAe(e,"string");return typeof t=="symbol"?t:t+""}function JAe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vN(e,t){if(e==null)return{};var n,r,i=eOe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function eOe(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 tOe(e){var t=ln(),n=x.useRef(null),r=vC(),{type:i}=e,a=vN(e,QAe),l=Ax(r,"xAxis",i),u=x.useMemo(()=>{if(l!=null)return NL(NL({},a),{},{type:l})},[a,l]);return x.useLayoutEffect(()=>{u!=null&&(n.current===null?t(SNe(u)):n.current!==u&&t(NNe({prev:n.current,next:u})),n.current=u)},[u,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(kNe(n.current)),n.current=null)},[t]),null}var nOe=e=>{var{xAxisId:t,className:n}=e,r=Ue(hC),i=rr(),a="xAxis",l=Ue(k=>i8(k,a,t,i)),u=Ue(k=>t8(k,t)),d=Ue(k=>nwe(k,t)),f=Ue(k=>Sq(k,t));if(u==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:p,ticks:m,scale:g}=e,v=vN(e,WAe),{id:j,scale:b}=f,S=vN(f,YAe);return x.createElement(_A,yN({},v,S,{x:d.x,y:d.y,width:u.width,height:u.height,className:Ot("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:l,axisType:a,axisId:t}))},rOe={allowDataOverflow:Gn.allowDataOverflow,allowDecimals:Gn.allowDecimals,allowDuplicatedCategory:Gn.allowDuplicatedCategory,angle:Gn.angle,axisLine:Os.axisLine,height:Gn.height,hide:!1,includeHidden:Gn.includeHidden,interval:Gn.interval,label:!1,minTickGap:Gn.minTickGap,mirror:Gn.mirror,orientation:Gn.orientation,padding:Gn.padding,reversed:Gn.reversed,scale:Gn.scale,tick:Gn.tick,tickCount:Gn.tickCount,tickLine:Os.tickLine,tickSize:Os.tickSize,type:Gn.type,niceTicks:Gn.niceTicks,xAxisId:0},iOe=e=>{var t=tr(e,rOe);return x.createElement(x.Fragment,null,x.createElement(tOe,{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(nOe,t))},Wa=x.memo(iOe,TF);Wa.displayName="XAxis";var aOe=["type"],sOe=["dangerouslySetInnerHTML","ticks","scale"],oOe=["id","scale"];function xN(){return xN=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},xN.apply(null,arguments)}function kL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function CL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kL(Object(n),!0).forEach(function(r){lOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lOe(e,t,n){return(t=cOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cOe(e){var t=uOe(e,"string");return typeof t=="symbol"?t:t+""}function uOe(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 bN(e,t){if(e==null)return{};var n,r,i=dOe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function dOe(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 fOe(e){var t=ln(),n=x.useRef(null),r=vC(),{type:i}=e,a=bN(e,aOe),l=Ax(r,"yAxis",i),u=x.useMemo(()=>{if(l!=null)return CL(CL({},a),{},{type:l})},[l,a]);return x.useLayoutEffect(()=>{u!=null&&(n.current===null?t(CNe(u)):n.current!==u&&t(ANe({prev:n.current,next:u})),n.current=u)},[u,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(ONe(n.current)),n.current=null)},[t]),null}function hOe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=x.useRef(null),l=x.useRef(null),u=Ue(hC),d=rr(),f=ln(),p="yAxis",m=Ue(O=>n8(O,t)),g=Ue(O=>iwe(O,t)),v=Ue(O=>i8(O,p,t,d)),j=Ue(O=>Nq(O,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!m||wA(i)||x.isValidElement(i)||j==null)){var O=a.current;if(O){var _=O.getCalculatedWidth();Math.round(m.width)!==Math.round(_)&&f(ENe({id:t,width:_}))}}},[v,m,f,i,t,r,j]),m==null||g==null||j==null)return null;var{dangerouslySetInnerHTML:b,ticks:S,scale:k}=e,E=bN(e,sOe),{id:C,scale:A}=j,T=bN(j,oOe);return x.createElement(_A,xN({},E,T,{ref:a,labelRef:l,x:g.x,y:g.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:m.width,height:m.height,className:Ot("recharts-".concat(p," ").concat(p),n),viewBox:u,ticks:v,axisType:p,axisId:t}))}var pOe={allowDataOverflow:Vn.allowDataOverflow,allowDecimals:Vn.allowDecimals,allowDuplicatedCategory:Vn.allowDuplicatedCategory,angle:Vn.angle,axisLine:Os.axisLine,hide:!1,includeHidden:Vn.includeHidden,interval:Vn.interval,label:!1,minTickGap:Vn.minTickGap,mirror:Vn.mirror,orientation:Vn.orientation,padding:Vn.padding,reversed:Vn.reversed,scale:Vn.scale,tick:Vn.tick,tickCount:Vn.tickCount,tickLine:Os.tickLine,tickSize:Os.tickSize,type:Vn.type,niceTicks:Vn.niceTicks,width:Vn.width,yAxisId:0},mOe=e=>{var t=tr(e,pOe);return x.createElement(x.Fragment,null,x.createElement(fOe,{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(hOe,t))},Ya=x.memo(mOe,TF);Ya.displayName="YAxis";var gOe=(e,t)=>t,RA=re([gOe,_t,$U,ar,j8,Ks,Cje,nr],Pje);function yOe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function DA(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(yOe(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var l=(u,d)=>({relativeX:Math.round((u-t.left)/n),relativeY:Math.round((d-t.top)/r)});return"touches"in e?Array.from(e.touches).map(u=>l(u.clientX,u.clientY)):l(e.clientX,e.clientY)}var PF=yi("mouseClick"),RF=np();RF.startListening({actionCreator:PF,effect:(e,t)=>{var n=e.payload,r=RA(t.getState(),DA(n));r?.activeIndex!=null&&t.dispatch(bwe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var wN=yi("mouseMove"),DF=np(),wu=null,Al=null,CS=null;DF.startListening({actionCreator:wN,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,l=a==="all"||a?.includes("mousemove");wu!==null&&(cancelAnimationFrame(wu),wu=null),Al!==null&&(typeof i!="number"||!l)&&(clearTimeout(Al),Al=null),CS=DA(n);var u=()=>{var d=t.getState(),f=vp(d,d.tooltip.settings.shared);if(!CS){wu=null,Al=null;return}if(f==="axis"){var p=RA(d,CS);p?.activeIndex!=null?t.dispatch(f8({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(d8())}wu=null,Al=null};if(!l){u();return}i==="raf"?wu=requestAnimationFrame(u):typeof i=="number"&&Al===null&&(Al=setTimeout(u,i))}});function vOe(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 AL={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},MF=Or({name:"rootProps",initialState:AL,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:AL.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}}}),xOe=MF.reducer,{updateOptions:bOe}=MF.actions,wOe=null,jOe={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)},IF=Or({name:"polarOptions",initialState:wOe,reducers:jOe}),{updatePolarOptions:Dze}=IF.actions,SOe=IF.reducer,LF=yi("keyDown"),$F=yi("focus"),BF=yi("blur"),Gx=np(),ju=null,Ol=null,kg=null;Gx.startListening({actionCreator:LF,effect:(e,t)=>{kg=e.payload,ju!==null&&(cancelAnimationFrame(ju),ju=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");Ol!==null&&(typeof r!="number"||!a)&&(clearTimeout(Ol),Ol=null);var l=()=>{try{var u=t.getState(),d=u.rootProps.accessibilityLayer!==!1;if(!d)return;var{keyboardInteraction:f}=u.tooltip,p=kg;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var m=hh(f,fc(u),cd(u),ud(u)),g=m==null?-1:Number(m),v=!Number.isFinite(g)||g<0,j=Ks(u),b=fc(u),S=vp(u,u.tooltip.settings.shared);if(p==="Enter"){if(v)return;var k=ov(u,S,"hover",String(f.index));t.dispatch(sv({active:!f.active,activeIndex:f.index,activeCoordinate:k}));return}var E=cwe(u),C=E==="left-to-right"?1:-1,A=p==="ArrowRight"?1:-1,T;if(v){var O=cd(u),_=ud(u),P=A*C,$=X=>({active:!1,index:String(X),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(T=-1,P>0){for(var F=0;F<b.length;F++)if(hh($(F),b,O,_)!=null){T=F;break}}else for(var U=b.length-1;U>=0;U--)if(hh($(U),b,O,_)!=null){T=U;break}if(T<0)return}else{T=g+A*C;var B=j?.length||b.length;if(B===0||T>=B||T<0)return}var V=ov(u,S,"hover",String(T));t.dispatch(sv({active:!0,activeIndex:T.toString(),activeCoordinate:V}))}finally{ju=null,Ol=null}};if(!a){l();return}r==="raf"?ju=requestAnimationFrame(l):typeof r=="number"&&Ol===null&&(l(),kg=null,Ol=setTimeout(()=>{kg?l():(Ol=null,ju=null)},r))}});Gx.startListening({actionCreator:$F,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var a="0",l=vp(n,n.tooltip.settings.shared),u=ov(n,l,"hover",String(a));t.dispatch(sv({active:!0,activeIndex:a,activeCoordinate:u}))}}}});Gx.startListening({actionCreator:BF,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(sv({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function UF(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 Di=yi("externalEvent"),qF=np(),Cg=new Map,Yf=new Map,AS=new Map;qF.startListening({actionCreator:Di,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=UF(r);AS.set(i,{handler:n,reactEvent:a});var l=Cg.get(i);l!==void 0&&(cancelAnimationFrame(l),Cg.delete(i));var u=t.getState(),{throttleDelay:d,throttledEvents:f}=u.eventSettings,p=f,m=p==="all"||p?.includes(i),g=Yf.get(i);g!==void 0&&(typeof d!="number"||!m)&&(clearTimeout(g),Yf.delete(i));var v=()=>{var S=AS.get(i);try{if(!S)return;var{handler:k,reactEvent:E}=S,C=t.getState(),A={activeCoordinate:dje(C),activeDataKey:C8(C),activeIndex:hc(C),activeLabel:k8(C),activeTooltipIndex:hc(C),isTooltipActive:fje(C)};k&&k(A,E)}finally{Cg.delete(i),Yf.delete(i),AS.delete(i)}};if(!m){v();return}if(d==="raf"){var j=requestAnimationFrame(v);Cg.set(i,j)}else if(typeof d=="number"){if(!Yf.has(i)){v();var b=setTimeout(v,d);Yf.set(i,b)}}else v()}}});var NOe=re([Pd],e=>e.tooltipItemPayloads),kOe=re([NOe,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),FF=yi("touchMove"),HF=np(),El=null,No=null,OL=null,Zf=null;HF.startListening({actionCreator:FF,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Zf=UF(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,l=a==="all"||a.includes("touchmove");El!==null&&(cancelAnimationFrame(El),El=null),No!==null&&(typeof i!="number"||!l)&&(clearTimeout(No),No=null),OL=Array.from(n.touches).map(d=>DA({clientX:d.clientX,clientY:d.clientY,currentTarget:n.currentTarget}));var u=()=>{if(Zf!=null){var d=t.getState(),f=vp(d,d.tooltip.settings.shared);if(f==="axis"){var p,m=(p=OL)===null||p===void 0?void 0:p[0];if(m==null){El=null,No=null;return}var g=RA(d,m);g?.activeIndex!=null&&t.dispatch(f8({activeIndex:g.activeIndex,activeDataKey:void 0,activeCoordinate:g.activeCoordinate}))}else if(f==="item"){var v,j=Zf.touches[0];if(document.elementFromPoint==null||j==null)return;var b=document.elementFromPoint(j.clientX,j.clientY);if(!b||!b.getAttribute)return;var S=b.getAttribute(dme),k=(v=b.getAttribute(fme))!==null&&v!==void 0?v:void 0,E=Ac(d).find(T=>T.id===k);if(S==null||E==null||k==null)return;var{dataKey:C}=E,A=kOe(d,S,k);t.dispatch(u8({activeDataKey:C,activeIndex:S,activeCoordinate:A,activeGraphicalItemId:k}))}El=null,No=null}};if(!l){u();return}i==="raf"?El=requestAnimationFrame(u):typeof i=="number"&&No===null&&(u(),Zf=null,No=setTimeout(()=>{Zf?u():(No=null,El=null)},i))}}});var KF={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},GF=Or({name:"eventSettings",initialState:KF,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:COe}=GF.actions,AOe=GF.reducer,OOe=g6({brush:QNe,cartesianAxis:_Ne,chartData:cSe,errorBars:Vke,eventSettings:AOe,graphicalItems:cNe,layout:Qpe,legend:age,options:iSe,polarAxis:z1e,polarOptions:SOe,referenceElements:XNe,renderedTicks:mke,rootProps:xOe,tooltip:wwe,zIndex:Gje}),EOe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return xpe({reducer:OOe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([RF.middleware,DF.middleware,Gx.middleware,qF.middleware,HF.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(z6({type:"raf"}))},devTools:{serialize:{replacer:vOe},name:"recharts-".concat(n)}})};function _Oe(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=rr(),a=x.useRef(null);if(i)return n;a.current==null&&(a.current=EOe(t,r));var l=sC;return x.createElement(Sge,{context:l,store:a.current},n)}function zOe(e){var{layout:t,margin:n}=e,r=ln(),i=rr();return x.useEffect(()=>{i||(r(Kpe(t)),r(Hpe(n)))},[r,i,t,n]),null}var TOe=x.memo(zOe,Nc);function POe(e){var t=ln();return x.useEffect(()=>{t(bOe(e))},[t,e]),null}var ROe=e=>{var t=ln();return x.useEffect(()=>{t(COe(e))},[t,e]),null},DOe=x.memo(ROe,Nc);function EL(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=ln();return x.useLayoutEffect(()=>(r.current&&i(Hje({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Kje({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function _L(e){var{children:t,isPanorama:n}=e,r=Ue(Dje);if(!r||r.length===0)return t;var i=r.filter(l=>l<0),a=r.filter(l=>l>0);return x.createElement(x.Fragment,null,i.map(l=>x.createElement(EL,{key:l,zIndex:l,isPanorama:n})),t,a.map(l=>x.createElement(EL,{key:l,zIndex:l,isPanorama:n})))}var MOe=["children"];function IOe(e,t){if(e==null)return{};var n,r,i=LOe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function LOe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function yv(){return yv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yv.apply(null,arguments)}var $Oe={width:"100%",height:"100%",display:"block"},BOe=x.forwardRef((e,t)=>{var n=gC(),r=yC(),i=cU();if(!Ha(n)||!Ha(r))return null;var{children:a,otherAttributes:l,title:u,desc:d}=e,f,p;return l!=null&&(typeof l.tabIndex=="number"?f=l.tabIndex:f=i?0:void 0,typeof l.role=="string"?p=l.role:p=i?"application":void 0),x.createElement(Yk,yv({},l,{title:u,desc:d,role:p,tabIndex:f,width:n,height:r,style:$Oe,ref:t}),a)}),UOe=e=>{var{children:t}=e,n=Ue(bx);if(!n)return null;var{width:r,height:i,y:a,x:l}=n;return x.createElement(Yk,{width:r,height:i,x:l,y:a},t)},zL=x.forwardRef((e,t)=>{var{children:n}=e,r=IOe(e,MOe),i=rr();return i?x.createElement(UOe,null,x.createElement(_L,{isPanorama:!0},n)):x.createElement(BOe,yv({ref:t},r),x.createElement(_L,{isPanorama:!1},n))});function qOe(){var e=ln(),[t,n]=x.useState(null),r=Ue(ume);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;ht(a)&&a!==r&&e(Vpe(a))}},[t,e,r]),n}function TL(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 FOe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TL(Object(n),!0).forEach(function(r){HOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HOe(e,t,n){return(t=KOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KOe(e){var t=GOe(e,"string");return typeof t=="symbol"?t:t+""}function GOe(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 qo(){return qo=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},qo.apply(null,arguments)}var VOe=()=>(vSe(),null);function vv(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var QOe=x.forwardRef((e,t)=>{var n,r,i=x.useRef(null),[a,l]=x.useState({containerWidth:vv((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:vv((r=e.style)===null||r===void 0?void 0:r.height)}),u=x.useCallback((f,p)=>{l(m=>{var g=Math.round(f),v=Math.round(p);return m.containerWidth===g&&m.containerHeight===v?m:{containerWidth:g,containerHeight:v}})},[]),d=x.useCallback(f=>{if(typeof t=="function"&&t(f),i.current!=null&&(i.current.disconnect(),i.current=null),f!=null&&typeof ResizeObserver<"u"){var{width:p,height:m}=f.getBoundingClientRect();u(p,m);var g=j=>{var b=j[0];if(b!=null){var{width:S,height:k}=b.contentRect;u(S,k)}},v=new ResizeObserver(g);v.observe(f),i.current=v}},[t,u]);return x.useEffect(()=>()=>{var f=i.current;f?.disconnect()},[u]),x.createElement(x.Fragment,null,x.createElement(ip,{width:a.containerWidth,height:a.containerHeight}),x.createElement("div",qo({ref:d},e)))}),WOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=x.useState({containerWidth:vv(n),containerHeight:vv(r)}),l=x.useCallback((d,f)=>{a(p=>{var m=Math.round(d),g=Math.round(f);return p.containerWidth===m&&p.containerHeight===g?p:{containerWidth:m,containerHeight:g}})},[]),u=x.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:f,height:p}=d.getBoundingClientRect();l(f,p)}},[t,l]);return x.createElement(x.Fragment,null,x.createElement(ip,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",qo({ref:u},e)))}),YOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(ip,{width:n,height:r}),x.createElement("div",qo({ref:t},e)))}),ZOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(WOe,qo({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(YOe,qo({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(ip,{width:n,height:r}),x.createElement("div",qo({ref:t},e)))});function XOe(e){return e?QOe:ZOe}var JOe=x.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:l,onDoubleClick:u,onMouseDown:d,onMouseEnter:f,onMouseLeave:p,onMouseMove:m,onMouseUp:g,onTouchEnd:v,onTouchMove:j,onTouchStart:b,style:S,width:k,responsive:E,dispatchTouchEvents:C=!0}=e,A=x.useRef(null),T=ln(),[O,_]=x.useState(null),[P,$]=x.useState(null),F=qOe(),U=pC(),B=U?.width>0?U.width:k,V=U?.height>0?U.height:i,X=x.useCallback(pe=>{F(pe),typeof t=="function"&&t(pe),_(pe),$(pe),pe!=null&&(A.current=pe)},[F,t,_,$]),Z=x.useCallback(pe=>{T(PF(pe)),T(Di({handler:a,reactEvent:pe}))},[T,a]),H=x.useCallback(pe=>{T(wN(pe)),T(Di({handler:f,reactEvent:pe}))},[T,f]),J=x.useCallback(pe=>{T(d8()),T(Di({handler:p,reactEvent:pe}))},[T,p]),oe=x.useCallback(pe=>{T(wN(pe)),T(Di({handler:m,reactEvent:pe}))},[T,m]),ye=x.useCallback(()=>{T($F())},[T]),I=x.useCallback(()=>{T(BF())},[T]),M=x.useCallback(pe=>{T(LF(pe.key))},[T]),q=x.useCallback(pe=>{T(Di({handler:l,reactEvent:pe}))},[T,l]),D=x.useCallback(pe=>{T(Di({handler:u,reactEvent:pe}))},[T,u]),G=x.useCallback(pe=>{T(Di({handler:d,reactEvent:pe}))},[T,d]),se=x.useCallback(pe=>{T(Di({handler:g,reactEvent:pe}))},[T,g]),ne=x.useCallback(pe=>{T(Di({handler:b,reactEvent:pe}))},[T,b]),Ce=x.useCallback(pe=>{C&&T(FF(pe)),T(Di({handler:j,reactEvent:pe}))},[T,C,j]),Se=x.useCallback(pe=>{T(Di({handler:v,reactEvent:pe}))},[T,v]),ee=XOe(E);return x.createElement(R8.Provider,{value:O},x.createElement(zB.Provider,{value:P},x.createElement(ee,{width:B??S?.width,height:V??S?.height,className:Ot("recharts-wrapper",r),style:FOe({position:"relative",cursor:"default",width:B,height:V},S),onClick:Z,onContextMenu:q,onDoubleClick:D,onFocus:ye,onBlur:I,onKeyDown:M,onMouseDown:G,onMouseEnter:H,onMouseLeave:J,onMouseMove:oe,onMouseUp:se,onTouchEnd:Se,onTouchMove:Ce,onTouchStart:ne,ref:X},x.createElement(VOe,null),n)))}),eEe=["width","height","responsive","children","className","style","compact","title","desc"];function tEe(e,t){if(e==null)return{};var n,r,i=nEe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function nEe(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 rEe=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:l,style:u,compact:d,title:f,desc:p}=e,m=tEe(e,eEe),g=gi(m);return d?x.createElement(x.Fragment,null,x.createElement(ip,{width:n,height:r}),x.createElement(zL,{otherAttributes:g,title:f,desc:p},a)):x.createElement(JOe,{className:l,style:u,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},x.createElement(zL,{otherAttributes:g,title:f,desc:p,ref:t},x.createElement(eke,null,a)))});function jN(){return jN=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},jN.apply(null,arguments)}function PL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function iEe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PL(Object(n),!0).forEach(function(r){aEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aEe(e,t,n){return(t=sEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sEe(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)}var lEe={top:5,right:5,bottom:5,left:5},cEe=iEe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:lEe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},KF),MA=x.forwardRef(function(t,n){var r,i=tr(t.categoricalChartProps,cEe),{chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,categoricalChartProps:f}=t,p={chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,eventEmitter:void 0};return x.createElement(_Oe,{preloadedState:{options:p},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},x.createElement(VNe,{chartData:f.data}),x.createElement(TOe,{layout:i.layout,margin:i.margin}),x.createElement(DOe,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(POe,{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(rEe,jN({},i,{ref:n})))}),uEe=["axis"],IA=x.forwardRef((e,t)=>x.createElement(MA,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:uEe,tooltipPayloadSearcher:xA,categoricalChartProps:e,ref:t})),dEe=["axis","item"],SN=x.forwardRef((e,t)=>x.createElement(MA,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:dEe,tooltipPayloadSearcher:xA,categoricalChartProps:e,ref:t})),fEe=["axis"],NN=x.forwardRef((e,t)=>x.createElement(MA,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:fEe,tooltipPayloadSearcher:xA,categoricalChartProps:e,ref:t}));const da={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},er={fill:"#71717a",fontSize:11},dd="#27272a",Nr="#27272a",An=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function VF(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function fd(e){return VF(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function hd(e){const t=VF(e);return`${t.getMonth()+1}/${t.getDate()}`}const hEe=6,pd="__other__",Gu="_socialTotal";function pEe(e,t=hEe){const n=new Map;for(const p of e)n.set(p.source,(n.get(p.source)??0)+p.sessions);const r=[...n.entries()].sort((p,m)=>m[1]!==p[1]?m[1]-p[1]:p[0].localeCompare(m[0])),i=r.slice(0,t),a=new Set(i.map(([p])=>p)),l=Math.max(0,r.length-t),u=new Map;for(const p of e){let m=u.get(p.date);m||(m={date:p.date,[Gu]:0},u.set(p.date,m));const g=a.has(p.source)?p.source:pd;m[g]=(m[g]??0)+p.sessions,m[Gu]=(m[Gu]??0)+p.sessions}const d=[...u.values()].sort((p,m)=>String(p.date).localeCompare(String(m.date))),f=i.map(([p])=>p);return l>0&&f.push(pd),{data:d,sources:f,otherCount:l}}function Vu(e){return e.replace(/\+/g," ")}function QF(e,t=30){return e.length<=t?e:e.slice(0,Math.max(1,t-1))+"…"}const mEe=["7d","30d","90d","all"],_o=An,kN="#71717a",WF="#52525b",Xf=25;function Ag(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function gEe(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 yEe({projectName:e}){const t=xi(),[n,r]=x.useState(null),[i,a]=x.useState(null),[l,u]=x.useState(!0),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[g,v]=x.useState(null),[j,b]=x.useState(null),[S,k]=x.useState("sessions"),[E,C]=x.useState("desc"),[A,T]=x.useState("sessions"),[O,_]=x.useState("desc"),[P,$]=x.useState("sessions"),[F,U]=x.useState("desc"),[B,V]=x.useState("sessions"),[X,Z]=x.useState("desc"),[H,J]=x.useState([]),[oe,ye]=x.useState([]),[I,M]=x.useState([]),[q,D]=x.useState(!1),[G,se]=x.useState("30d");async function ne(de){u(!0),v(null);try{const ze=await t.fetchQuery({queryKey:qe.traffic.status(e),queryFn:()=>tQ(e),staleTime:Pf});if(de.current)return;if(r(ze),!ze.connected){a(null),J([]),ye([]),M([]),u(!1);return}const[he,Qe,Fn,wi]=await Promise.all([t.fetchQuery({queryKey:qe.traffic.summary(e,G),queryFn:()=>nQ(e,void 0,G),staleTime:Pf}),t.fetchQuery({queryKey:qe.traffic.aiHistory(e,G),queryFn:()=>iQ(e,G).catch(()=>[]),staleTime:Pf}),t.fetchQuery({queryKey:qe.traffic.sessionHistory(e,G),queryFn:()=>sQ(e,G).catch(()=>[]),staleTime:Pf}),t.fetchQuery({queryKey:qe.traffic.socialHistory(e,G),queryFn:()=>aQ(e,G).catch(()=>[]),staleTime:Pf})]);if(de.current)return;a(he),J(Qe),ye(Fn),M(wi),u(!1)}catch(ze){if(de.current)return;v(ze instanceof Error?ze.message:"Failed to load GA4 data"),u(!1)}}x.useEffect(()=>{const de={current:!1};return ne(de),()=>{de.current=!0}},[e,G,t]);async function Ce(){f(!0),v(null),b(null);try{const de=await M5(e);b(`Synced ${de.rowCount.toLocaleString()} page rows, ${de.aiReferralCount.toLocaleString()} AI and ${de.socialReferralCount.toLocaleString()} social referral rows (${de.days} days)`),await t.invalidateQueries({queryKey:qe.traffic.project(e)}),await ne({current:!1})}catch(de){v(de instanceof Error?de.message:"Sync failed")}finally{f(!1)}}async function Se(){m(!0),v(null),b(null);try{await oQ(e),await t.invalidateQueries({queryKey:qe.traffic.project(e)}),r({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),a(null),b("GA4 disconnected")}catch(de){v(de instanceof Error?de.message:"Disconnect failed")}finally{m(!1)}}function ee(de){S===de?C(ze=>ze==="desc"?"asc":"desc"):(k(de),C("desc"))}function pe(de){A===de?_(ze=>ze==="desc"?"asc":"desc"):(T(de),_("desc"))}function Ee(de){P===de?U(ze=>ze==="desc"?"asc":"desc"):($(de),U("desc"))}function Y(de){B===de?Z(ze=>ze==="desc"?"asc":"desc"):(V(de),Z("desc"))}const He=x.useMemo(()=>i?.topPages?[...i.topPages].sort((de,ze)=>{const he=de[S],Qe=ze[S];return typeof he=="string"&&typeof Qe=="string"?E==="asc"?he.localeCompare(Qe):Qe.localeCompare(he):E==="asc"?he-Qe:Qe-he}):[],[i?.topPages,S,E]),Pe=x.useMemo(()=>i?.aiReferrals?[...i.aiReferrals].sort((de,ze)=>{const he=de[A],Qe=ze[A];return typeof he=="string"&&typeof Qe=="string"?O==="asc"?he.localeCompare(Qe):Qe.localeCompare(he):O==="asc"?he-Qe:Qe-he}):[],[i?.aiReferrals,A,O]),at=x.useMemo(()=>i?.aiReferralLandingPages?[...i.aiReferralLandingPages].sort((de,ze)=>{const he=de[B],Qe=ze[B];return typeof he=="string"&&typeof Qe=="string"?X==="asc"?he.localeCompare(Qe):Qe.localeCompare(he):X==="asc"?he-Qe:Qe-he}):[],[i?.aiReferralLandingPages,B,X]),Ve=x.useMemo(()=>i?.socialReferrals?[...i.socialReferrals].sort((de,ze)=>{const he=de[P],Qe=ze[P];return typeof he=="string"&&typeof Qe=="string"?F==="asc"?he.localeCompare(Qe):Qe.localeCompare(he):F==="asc"?he-Qe:Qe-he}):[],[i?.socialReferrals,P,F]),{socialChartData:Ht,socialChartSources:Lt,socialOtherCount:cn}=x.useMemo(()=>{const de=pEe(I);return{socialChartData:de.data,socialChartSources:de.sources,socialOtherCount:de.otherCount}},[I]),{chartData:en,chartSources:je,dateRange:Ze}=x.useMemo(()=>{const de=[...new Set(H.map(tn=>tn.source))],ze=new Map;for(const tn of oe)ze.set(tn.date,{_totalSessions:tn.sessions,_organicSessions:tn.organicSessions});const he=new Map;for(const tn of H){const En=`${tn.date}::${tn.source}`,$r=he.get(En)??0;he.set(En,Math.max($r,tn.sessions))}for(const[tn,En]of he){const[$r,Xi]=tn.split("::");let wa=ze.get($r);wa||(wa={_totalSessions:0,_organicSessions:0},ze.set($r,wa)),wa[Xi]=(wa[Xi]??0)+En}const Qe=[...ze.entries()].sort(([tn],[En])=>tn.localeCompare(En)).map(([tn,En])=>({date:tn,...En})),Fn=Qe.map(tn=>tn.date),wi=Fn.length>0?{start:Fn[0],end:Fn[Fn.length-1]}:null;return{chartData:Qe,chartSources:de,dateRange:wi}},[H,oe]);if(l&&!n)return s.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!n?.connected)return s.jsx(vEe,{projectName:e,onConnected:()=>{(async()=>(await t.invalidateQueries({queryKey:qe.traffic.project(e)}),await ne({current:!1})))()}});const Rt=i?.organicSharePctDisplay??"0%",mt=i?.totalOrganicSessions??0,et=i?.aiSessionsDeduped??0,ce=i?.aiSessionsBySession??0,Ne=i?.aiSharePctBySessionDisplay??"0%",Me=i?new Set(i.aiReferrals.map(de=>de.source.toLowerCase())).size:0,Ge=Pe[0]??null,pt=i?.totalDirectSessions??0,mn=i?.directSharePctDisplay??"0%",On=i?.socialSessions??0,gn=i?.socialSharePctDisplay??"0%",We=i?new Set(i.socialReferrals.map(de=>de.source.toLowerCase())).size:0,Kt=Ve[0]??null;return s.jsxs(s.Fragment,{children:[g&&s.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:g}),j&&s.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-emerald-900/20 border border-emerald-800/60 text-sm text-emerald-300",children:j}),s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),s.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",s.jsx("span",{className:"text-zinc-300",children:n.propertyId}),n.clientEmail&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("span",{className:"text-zinc-500",children:n.clientEmail})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(be,{variant:"outline",size:"sm",disabled:d,onClick:Ce,children:[s.jsx(z2,{className:`w-3.5 h-3.5 mr-1.5 ${d?"animate-spin":""}`}),d?"Syncing…":"Sync"]}),s.jsxs(be,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:p,onClick:Se,children:[s.jsx(OW,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),s.jsxs("section",{children:[s.jsxs("div",{className:"mb-4 flex items-start justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),s.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",s.jsx(pr,{text:`Aggregated traffic metrics from Google Analytics 4. Sessions and users are summed across the selected period.${i?.periodStart&&i?.periodEnd?` Data available: ${new Date(i.periodStart+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})} – ${new Date(i.periodEnd+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}.`:""} Organic sessions are Google organic search sessions specifically.`})]})]}),s.jsx("div",{className:"flex gap-1",children:mEe.map(de=>s.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${G===de?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>se(de),children:de==="all"?"All":de},de))})]}),i?s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsx(OS,{value:Ag(i.totalSessions),label:"Total Sessions",subtitle:i.totalSessions.toLocaleString(),tone:"neutral"}),s.jsx(OS,{value:Ag(i.totalOrganicSessions),label:"Organic Sessions",subtitle:`${Rt} of total`,tone:"positive"}),s.jsx(OS,{value:Ag(i.totalUsers),label:"Total Users",subtitle:i.totalUsers.toLocaleString(),tone:"neutral"})]}):s.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[s.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),s.jsxs(be,{variant:"outline",size:"sm",disabled:d,onClick:Ce,children:[s.jsx(z2,{className:`w-3.5 h-3.5 mr-1.5 ${d?"animate-spin":""}`}),"Sync from GA4"]})]})]}),i&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"page-section-divider"}),s.jsxs("section",{children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Attribution"}),s.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Traffic by channel",s.jsx(pr,{text:"Decomposes GA4 sessions into four disjoint channels — organic search, social, direct, and known AI referrers. The AI cell is rendered separately so AI-driven traffic never inflates the Direct count. Detected via sessionDefaultChannelGrouping plus AI-source matching on sessionSource/firstUserSource/sessionManualSource (generic search sources excluded)."})]})]}),Ze&&s.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(Ze.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(Ze.end+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),en.length>0&&s.jsxs($e,{className:"surface-card p-5 mb-4",children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:je.length>0?"AI vs. total sessions":"All sessions (baseline)"}),je.length===0&&s.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),je.length===0&&s.jsx("p",{className:"text-xs text-zinc-500",children:"No AI referrals detected yet"})]}),s.jsx("div",{className:"h-64",children:s.jsx(Ts,{width:"100%",height:"100%",children:s.jsxs(NN,{data:en,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx(Wa,{dataKey:"date",tick:er,tickLine:!1,axisLine:{stroke:Nr},tickFormatter:hd}),s.jsx(Ya,{tick:er,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),s.jsx(Ms,{...da,labelFormatter:fd,formatter:(de,ze)=>{const he=typeof de=="number"?de.toLocaleString():String(de??0),Qe=String(ze??"");return Qe==="_totalSessions"?[he,"Total Sessions"]:Qe==="_organicSessions"?[he,"Organic Sessions"]:[he,Qe]}}),s.jsx(oU,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:de=>de==="_totalSessions"?"Total Sessions":de==="_organicSessions"?"Organic Sessions":de}),s.jsx(Du,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),je.map((de,ze)=>s.jsx(Du,{type:"monotone",dataKey:de,stackId:"ai",stroke:_o[ze%_o.length],fill:_o[ze%_o.length],fillOpacity:.4,strokeWidth:1.5},de))]})})})]}),s.jsxs($e,{className:"surface-card p-5 mb-4",children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Channel breakdown"})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(za,{label:"Organic",value:Rt,hint:`${mt.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions from Google organic search (sessionDefaultChannelGrouping = 'Organic Search')."}),s.jsx(za,{label:"Social",value:gn,hint:`${On.toLocaleString()} sessions`,tone:"neutral",tooltip:"Sessions from social platforms (sessionDefaultChannelGrouping = 'Organic Social' or 'Paid Social')."}),s.jsx(za,{label:"Direct",value:mn,hint:`${pt.toLocaleString()} sessions`,tone:"neutral",tooltip:"Sessions with no source — bookmarks, typed URLs, untagged email, in-app browsers, and AI-driven traffic whose referrer header was stripped."}),s.jsx(za,{label:"Known AI referrers (lower bound)",value:Ne,hint:`${ce.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions whose current sessionSource matched a known AI engine (e.g. chatgpt.com, claude.ai, gemini.google.com). Disjoint from Direct/Organic/Social. This is a strict lower bound: most AI traffic strips the referrer and falls into Direct, so the true AI share is typically higher than what's shown here. The detail table below also surfaces firstUserSource and UTM-tagged AI signals."})]}),Ge&&s.jsxs("div",{className:"mt-4 rounded-lg border border-emerald-800/40 bg-emerald-500/6 px-4 py-3 text-sm text-emerald-100",children:["Top AI referrer: ",s.jsx("span",{className:"font-medium",children:Ge.source})," via ",Ge.medium,", accounting for ",Ge.sessions.toLocaleString()," sessions."]})]}),s.jsxs($e,{className:"surface-card p-5 mb-4",children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Detail"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Known AI referrers — sources detected"})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:i.aiReferrals.length>0?`${Me} unique sources, ${i.aiReferrals.length} rows`:"No source rows"})]}),i.aiReferrals.length>0?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[s.jsx(vr,{label:"Source",sortKey:"source",current:A,dir:O,onSort:pe,align:"left"}),s.jsx(vr,{label:"Medium",sortKey:"medium",current:A,dir:O,onSort:pe,align:"left"}),s.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),s.jsx(vr,{label:"Sessions",sortKey:"sessions",current:A,dir:O,onSort:pe,align:"right"}),s.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),s.jsx(vr,{label:"Users",sortKey:"users",current:A,dir:O,onSort:pe,align:"right"})]})}),s.jsx("tbody",{children:Pe.map(de=>s.jsx(bEe,{referral:de,totalSessions:et},`${de.source}:${de.medium}:${de.sourceDimension}`))})]})}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[s.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI referrer sessions detected yet"}),s.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"AI engines that preserve a referrer (Perplexity, copy/paste from ChatGPT, etc.) will appear here. Most AI traffic strips the referrer — see the Direct cell above for the upper bound."})]})]}),s.jsxs($e,{className:"surface-card p-5",children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Detail"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Known AI referrers — landing pages"})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:at.length>0?`${at.length} rows`:"No landing-page rows"})]}),at.length>0?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[s.jsx(vr,{label:"Landing Page",sortKey:"landingPage",current:B,dir:X,onSort:Y,align:"left"}),s.jsx(vr,{label:"Source",sortKey:"source",current:B,dir:X,onSort:Y,align:"left"}),s.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),s.jsx(vr,{label:"Sessions",sortKey:"sessions",current:B,dir:X,onSort:Y,align:"right"}),s.jsx(vr,{label:"Users",sortKey:"users",current:B,dir:X,onSort:Y,align:"right"})]})}),s.jsx("tbody",{children:at.map(de=>s.jsx(wEe,{row:de},`${de.landingPage}:${de.source}:${de.medium}:${de.sourceDimension}`))})]})}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[s.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI landing pages detected yet"}),s.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"Known-AI landing pages appear after a GA4 sync records visits from AI referrers."})]})]})]})]}),i&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"page-section-divider"}),s.jsxs("section",{children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Social Attribution"}),s.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Social Media Traffic",s.jsx(pr,{text:"Tracks sessions classified as social traffic by GA4's default channel grouping (Organic Social and Paid Social). Google maintains the source-to-channel mapping."})]})]}),Ht.length>0&&s.jsxs($e,{className:"surface-card p-5 mb-4",children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social sessions over time"})]}),cn>0&&s.jsxs("p",{className:"text-xs text-zinc-500",children:["Showing top ",Lt.length-1," sources · ",cn," more grouped as Other"]})]}),s.jsx("div",{className:"h-64",children:s.jsx(Ts,{width:"100%",height:"100%",children:s.jsxs(NN,{data:Ht,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx(Wa,{dataKey:"date",tick:er,tickLine:!1,axisLine:{stroke:Nr},tickFormatter:hd}),s.jsx(Ya,{tick:er,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),s.jsx(Ms,{...da,labelFormatter:fd,formatter:(de,ze)=>{const he=typeof de=="number"?de.toLocaleString():String(de??0),Qe=String(ze??"");if(Qe===Gu)return[he,"Total Social"];if(Qe===pd){const Fn=`Other (${cn} source${cn===1?"":"s"})`;return[he,Fn]}return[he,Vu(Qe)]}}),s.jsx(Du,{type:"monotone",dataKey:Gu,stroke:WF,fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Lt.map((de,ze)=>{const Qe=de===pd?kN:_o[ze%_o.length];return s.jsx(Du,{type:"monotone",dataKey:de,stackId:"social",stroke:Qe,fill:Qe,fillOpacity:.4,strokeWidth:1.5},de)})]})})}),s.jsx(SEe,{sources:Lt,otherCount:cn})]}),s.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[s.jsxs($e,{className:"surface-card p-5",children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social media visits"})]}),i.socialReferrals.length>0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[s.jsx(za,{label:"Social Sessions",value:Ag(On),hint:`${On.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions classified as Organic Social or Paid Social by GA4's default channel grouping."}),s.jsx(za,{label:"Share of Traffic",value:gn,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from social media platforms."}),s.jsx(za,{label:"Platforms",value:String(We),hint:`${i.socialReferrals.length} source rows`,tone:"neutral",tooltip:"Number of distinct social media platforms detected. Each unique source/medium combination counts as one source row."})]}),Kt&&s.jsxs("div",{className:"mt-4 rounded-lg border border-sky-800/40 bg-sky-500/6 px-4 py-3 text-sm text-sky-100",children:[s.jsx("p",{className:"text-xs uppercase tracking-wider text-sky-300/70 mb-1",children:"Top social source"}),s.jsx("p",{className:"font-medium truncate",title:`${Kt.source} via ${Kt.medium}`,children:QF(Vu(Kt.source),64)}),s.jsxs("p",{className:"text-xs text-sky-200/70 mt-0.5 truncate",title:Kt.medium,children:["via ",Vu(Kt.medium)," · ",Kt.sessions.toLocaleString()," sessions"]})]})]}):s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[s.jsx(za,{label:"Social Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to social media platforms."}),s.jsx(za,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions from social media."}),s.jsx(za,{label:"Platforms",value:"0",hint:"known platforms",tone:"neutral",tooltip:"Number of distinct social media platforms detected."})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3 text-sm text-zinc-400",children:[s.jsx("p",{className:"mb-1.5 text-zinc-300",children:"Monitoring social media traffic via GA4 channel grouping"}),s.jsx("p",{className:"text-xs text-zinc-500",children:"Sessions classified as Organic Social or Paid Social by GA4 will appear here. Google maintains the source-to-channel mapping, which includes Facebook, Instagram, X/Twitter, LinkedIn, Reddit, Pinterest, Snapchat, and other platforms."})]})]})]}),s.jsxs($e,{className:"surface-card p-5",children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Breakdown"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Source / medium"})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:i.socialReferrals.length>0?Ve.length>Xf&&!q?`Top ${Xf} of ${Ve.length}`:`${Ve.length} rows`:"No source rows"})]}),i.socialReferrals.length>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm table-fixed",children:[s.jsxs("colgroup",{children:[s.jsx("col",{className:"w-[32%]"}),s.jsx("col",{className:"w-[22%]"}),s.jsx("col",{className:"w-[12%]"}),s.jsx("col",{className:"w-[11%]"}),s.jsx("col",{className:"w-[11%]"}),s.jsx("col",{className:"w-[12%]"})]}),s.jsx("thead",{children:s.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[s.jsx(vr,{label:"Source",sortKey:"source",current:P,dir:F,onSort:Ee,align:"left"}),s.jsx(vr,{label:"Medium",sortKey:"medium",current:P,dir:F,onSort:Ee,align:"left"}),s.jsx("th",{className:"py-1 font-medium text-left",children:"Channel"}),s.jsx(vr,{label:"Sessions",sortKey:"sessions",current:P,dir:F,onSort:Ee,align:"right"}),s.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),s.jsx(vr,{label:"Users",sortKey:"users",current:P,dir:F,onSort:Ee,align:"right"})]})}),s.jsx("tbody",{children:(q?Ve:Ve.slice(0,Xf)).map(de=>s.jsx(jEe,{referral:de,totalSessions:On},`${de.source}:${de.medium}:${de.channelGroup}`))})]})}),Ve.length>Xf&&s.jsx("div",{className:"mt-3 flex justify-center",children:s.jsx("button",{type:"button",onClick:()=>D(de=>!de),className:"text-xs text-zinc-400 hover:text-zinc-200 px-3 py-1 rounded-full border border-zinc-800 hover:border-zinc-700 transition-colors",children:q?`Show top ${Xf}`:`Show all ${Ve.length} sources`})})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[s.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No social media sessions detected yet"}),s.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"When visitors arrive from Facebook, X/Twitter, LinkedIn, or other social platforms, their sessions will be broken down here by source and medium."})]})]})]})]})]}),i&&i.topPages.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"page-section-divider"}),s.jsxs("section",{children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),s.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",s.jsx(pr,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[s.jsx(vr,{label:"Landing Page",sortKey:"landingPage",current:S,dir:E,onSort:ee,align:"left"}),s.jsx(vr,{label:"Sessions",sortKey:"sessions",current:S,dir:E,onSort:ee,align:"right"}),s.jsx(vr,{label:"Organic",sortKey:"organicSessions",current:S,dir:E,onSort:ee,align:"right"}),s.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),s.jsx(vr,{label:"Users",sortKey:"users",current:S,dir:E,onSort:ee,align:"right"})]})}),s.jsx("tbody",{children:He.map(de=>s.jsx(xEe,{page:de},de.landingPage))})]})})]})]}),s.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[s.jsx("span",{children:i?.lastSyncedAt?`Last synced ${gEe(i.lastSyncedAt)}`:"Never synced"}),s.jsx("span",{children:i?`${i.topPages.length} pages · ${i.aiReferrals.length} AI rows · ${i.socialReferrals.length} social rows`:""})]})]})}function vEe({projectName:e,onConnected:t}){const[n,r]=x.useState(""),[i,a]=x.useState(null),[l,u]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(null),g=x.useRef(null),v=x.useCallback(b=>{const S=b.target.files?.[0];if(!S)return;m(null),a(S.name);const k=new FileReader;k.onload=()=>{const E=k.result;try{const C=JSON.parse(E);if(!C.client_email||!C.private_key){m("JSON file is missing required fields: client_email and private_key. Make sure you downloaded a service account key (not an OAuth client)."),u(null);return}u(E)}catch{m("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),u(null)}},k.onerror=()=>{m("Failed to read file."),u(null)},k.readAsText(S)},[]);async function j(){if(m(null),!n.trim()){m("Property ID is required.");return}if(!l){m("Please upload a service account key file.");return}f(!0);try{await rQ(e,{propertyId:n.trim(),keyJson:l});try{await M5(e)}catch{}t()}catch(b){m(b instanceof Error?b.message:"Failed to connect GA4")}finally{f(!1)}}return s.jsxs($e,{className:"surface-card p-6",children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-1",children:"Connect Google Analytics 4"}),s.jsx("p",{className:"text-sm text-zinc-400 mb-5",children:"Connect a GA4 property to see traffic data for this project. You'll need a service account key file from Google Cloud Console."}),p&&s.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:p}),s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{htmlFor:"ga4-property-id",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"GA4 Property ID"}),s.jsx("input",{id:"ga4-property-id",type:"text",placeholder:"e.g. 123456789",value:n,onChange:b=>r(b.target.value),className:"w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 px-3 py-2 text-sm text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:ring-1 focus:ring-zinc-600"}),s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Find this in GA4 → Admin → Property Settings. It's a numeric ID, not the Measurement ID (G-XXXXXX)."})]}),s.jsxs("div",{className:"mb-5",children:[s.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Service Account Key File"}),s.jsx("input",{ref:g,type:"file",accept:".json,application/json",onChange:v,className:"hidden"}),s.jsxs("button",{type:"button",onClick:()=>g.current?.click(),className:"flex items-center gap-2 w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 border-dashed px-4 py-3 text-sm text-zinc-400 hover:border-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:[s.jsx(_W,{className:"w-4 h-4 shrink-0"}),i?s.jsx("span",{className:"text-zinc-200 truncate",children:i}):s.jsx("span",{children:"Upload .json key file"})]}),s.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Download from Google Cloud Console → IAM & Admin → Service Accounts → Keys → Add Key → JSON. The service account must have ",s.jsx("span",{className:"text-zinc-400",children:"Viewer"})," access on the GA4 property."]})]}),s.jsx(be,{variant:"default",size:"sm",disabled:d||!n.trim()||!l,onClick:j,children:d?"Connecting & syncing…":"Connect GA4"})]})}function vr({label:e,sortKey:t,current:n,dir:r,onSort:i,align:a}){const l=n===t;return s.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${a==="right"?"text-right":"text-left"}`,onClick:()=>i(t),children:[e,l&&s.jsx("span",{className:"ml-0.5",children:r==="asc"?"↑":"↓"})]})}const YF={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function OS({value:e,label:t,subtitle:n,tone:r}){return s.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),s.jsx("p",{className:`text-2xl font-bold tabular-nums ${YF[r]}`,children:e}),s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function za({value:e,label:t,hint:n,tone:r,tooltip:i}){return s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-4 py-3 flex flex-col",children:[s.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1 flex items-center gap-1",children:[t,i&&s.jsx(pr,{text:i})]}),s.jsx("p",{className:`text-xl font-semibold tabular-nums ${YF[r]}`,children:e}),s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function xEe({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return s.jsxs("tr",{className:"border-t border-zinc-800/40",children:[s.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),s.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),s.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),s.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),s.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}const ZF={session:"Session",first_user:"First Visit",manual_utm:"UTM"},XF={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 bEe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=ZF[e.sourceDimension]??e.sourceDimension,i=XF[e.sourceDimension]??"";return s.jsxs("tr",{className:"border-t border-zinc-800/40",children:[s.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),s.jsx("td",{className:"py-1.5 text-zinc-500 max-w-[180px] truncate",title:e.medium,children:e.medium}),s.jsx("td",{className:"py-1.5",children:s.jsx("span",{className:"inline-block text-[10px] px-1.5 py-0.5 rounded-full border border-zinc-700 text-zinc-400",title:i,children:r})}),s.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),s.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),s.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function wEe({row:e}){const t=ZF[e.sourceDimension]??e.sourceDimension,n=XF[e.sourceDimension]??"";return s.jsxs("tr",{className:"border-t border-zinc-800/40",children:[s.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[360px] truncate",title:e.landingPage,children:e.landingPage}),s.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),s.jsx("td",{className:"py-1.5",children:s.jsx("span",{className:"inline-block text-[10px] px-1.5 py-0.5 rounded-full border border-zinc-700 text-zinc-400",title:n,children:t})}),s.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),s.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function jEe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=e.channelGroup==="Paid Social"?"Paid":"Organic",i=Vu(e.source),a=Vu(e.medium);return s.jsxs("tr",{className:"border-t border-zinc-800/40",children:[s.jsx("td",{className:"py-1.5 pr-3 text-zinc-200 truncate",title:e.source,children:i}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-500 truncate",title:e.medium,children:a}),s.jsx("td",{className:"py-1.5 pr-3",children:s.jsx("span",{className:"inline-block text-[10px] px-1.5 py-0.5 rounded-full border border-zinc-700 text-zinc-400",title:`GA4 channel group: ${e.channelGroup}`,children:r})}),s.jsx("td",{className:"py-1.5 text-right text-sky-400 tabular-nums",children:e.sessions.toLocaleString()}),s.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),s.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function SEe({sources:e,otherCount:t}){const n=[{key:Gu,color:WF,label:"Total",tooltip:"All social sessions across every source."}];for(let r=0;r<e.length;r++){const i=e[r];if(i===pd)n.push({key:pd,color:kN,label:`Other (${t})`,tooltip:`${t} smaller source${t===1?"":"s"} grouped together`});else{const a=Vu(i);n.push({key:i,color:_o[r%_o.length]??kN,label:QF(a,32),tooltip:a})}}return s.jsx("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1.5 text-[11px] text-zinc-400",children:n.map(r=>s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 max-w-[260px]",title:r.tooltip,children:[s.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-sm shrink-0",style:{backgroundColor:r.color},"aria-hidden":"true"}),s.jsx("span",{className:"truncate",children:r.label})]},r.key))})}function JF(e){e.invalidateQueries({queryKey:qe.runs.all}),e.invalidateQueries({queryKey:qe.projects.all})}function NEe(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function kEe(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 Vx(e,t){e$({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),vt({title:NEe(e.kind),detail:kEe(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function CEe(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){vt({title:"No runs queued",detail:n.length>0?`${n.length} project${n.length===1?"":"s"} already had a run in progress.`:"No projects were available to queue.",tone:"caution",durationMs:8e3,dedupeKey:"run-all:conflict",dedupeMode:"replace"});return}for(const i of t)e$({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=Jte({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});vt({title:"Run-all batch queued",detail:n.length>0?`${t.length} project${t.length===1?"":"s"} queued, ${n.length} skipped because a run is already active.`:`${t.length} project${t.length===1?"":"s"} queued.`,tone:n.length>0?"caution":"neutral",dedupeKey:`batch:${r}`,dedupeMode:"replace"})}function Qx(e,t){if(e instanceof ei&&e.code==="RUN_IN_PROGRESS"){vt({title:"Run already in progress",detail:t?.projectLabel?`${t.projectLabel} already has an active run. Wait for it to finish, then retry.`:"This project already has an active run. Wait for it to finish, then retry.",tone:"caution",durationMs:8e3,dedupeKey:`run-in-progress:${t?.projectKey??"project"}:${t?.sourceAction??"run"}`,dedupeMode:"replace"});return}vt({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function e9(){const e=xi();return Fh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>fV(t,n),onSuccess:(t,n)=>{JF(e),Vx(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{Qx(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function AEe(){const e=xi();return Fh({meta:{skipGlobalErrorToast:!0},mutationFn:t=>zV(t),onSuccess:t=>{JF(e),CEe(t)},onError:t=>{vt({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function OEe(){const e=xi();return Fh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>T5(t,n),onSuccess:(t,n)=>{Gv(e,Tt["gsc-sync"],n.projectName),Vx(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{Qx(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function EEe(){const e=xi();return Fh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>HV(t),onSuccess:(t,n)=>{Gv(e,t.run.kind,n.projectName),Vx(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{Qx(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function _Ee(){const e=xi();return Fh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>qV(t,n),onSuccess:(t,n)=>{Gv(e,Tt["inspect-sitemap"],n.projectName),Vx(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{Qx(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}const zEe=["7d","30d","90d","all"];function TEe({projectName:e}){const t=xi(),[n,r]=x.useState(!1),[i,a]=x.useState([]),[l,u]=x.useState([]),[d,f]=x.useState([]),[p,m]=x.useState([]),[g,v]=x.useState([]),[j,b]=x.useState(null),[S,k]=x.useState(""),[E,C]=x.useState(""),[A,T]=x.useState("30"),[O,_]=x.useState(!1),[P,$]=x.useState("30d"),[F,U]=x.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[B,V]=x.useState(""),[X,Z]=x.useState(!0),[H,J]=x.useState(!1),[oe,ye]=x.useState(!1),[I,M]=x.useState(!1),[q,D]=x.useState(!1),[G,se]=x.useState(!1),[ne,Ce]=x.useState(!1),[Se,ee]=x.useState(null),[pe,Ee]=x.useState(!1),[Y,He]=x.useState(!1),[Pe,at]=x.useState(null),[Ve,Ht]=x.useState(""),[Lt,cn]=x.useState(!1),[en,je]=x.useState(!1),[Ze,Rt]=x.useState("indexed"),[mt,et]=x.useState(null),ce=x.useMemo(()=>{if(!mt)return d;const{key:Q,dir:ke}=mt;return[...d].sort((nt,St)=>{const _n=Q===Ro.CTR?Number.isFinite(nt.ctr)?nt.ctr:0:nt[Q],ja=Q===Ro.CTR?Number.isFinite(St.ctr)?St.ctr:0:St[Q];return ke==="asc"?_n-ja:ja-_n})},[d,mt]),[Ne,Me]=x.useState([]),[Ge,pt]=x.useState(null),[mn,On]=x.useState(!1),[gn,We]=x.useState(null),[Kt,de]=x.useState(null),ze=i.find(Q=>Q.connectionType==="gsc"),he=d.length>0||p.length>0||g.length>0,Qe=OEe(),Fn=EEe(),wi=_Ee();async function tn(Q){if(!Q){u([]),k("");return}ye(!0);try{const{sites:ke}=await t.fetchQuery({queryKey:qe.gsc.properties(e),queryFn:()=>RV(e),staleTime:jr});u(ke),k(Q.propertyId??ke[0]?.siteUrl??"")}catch(ke){u([]),We(ke instanceof Error?ke.message:"Failed to load Search Console properties")}finally{ye(!1)}}async function En(){D(!0);try{const Q={startDate:F.startDate,endDate:F.endDate,query:F.query,page:F.page,limit:F.limit,window:P},ke=await t.fetchQuery({queryKey:qe.gsc.performance(e,Q),queryFn:()=>IV(e,{startDate:F.startDate||void 0,endDate:F.endDate||void 0,query:F.query||void 0,page:F.page||void 0,limit:parseInt(F.limit,10)||20,window:P}),staleTime:jr});f(ke)}catch(Q){f([]),We(Q instanceof Error?Q.message:"Failed to load GSC performance data")}finally{D(!1)}}async function $r(){se(!0);try{const Q=B.trim()||void 0,[ke,nt]=await Promise.all([t.fetchQuery({queryKey:qe.gsc.inspections(e,Q),queryFn:()=>$V(e,{url:Q,limit:20}),staleTime:jr}),t.fetchQuery({queryKey:qe.gsc.deindexed(e),queryFn:()=>BV(e),staleTime:jr})]);m(ke),v(nt)}catch(Q){m([]),v([]),We(Q instanceof Error?Q.message:"Failed to load GSC inspection history")}finally{se(!1)}}async function Xi(){Ee(!0);try{const[Q,ke]=await Promise.all([t.fetchQuery({queryKey:qe.gsc.coverage(e),queryFn:()=>QN(e),staleTime:jr}),t.fetchQuery({queryKey:qe.gsc.coverageHistory(e),queryFn:()=>UV(e).catch(()=>[]),staleTime:jr})]);ee(Q),Me(ke)}catch(Q){ee(null),Me([]),We(Q instanceof Error?Q.message:"Failed to load coverage data")}finally{Ee(!1)}}async function wa(Q){On(!0),We(null);try{const ke=await k2(e,{urls:Q}),{succeeded:nt,failed:St,total:_n}=ke.summary;vt({title:"Indexing requested",detail:St===0?`${nt} URL${nt!==1?"s":""} submitted for indexing.`:`${nt}/${_n} submitted successfully, ${St} failed.`,tone:St===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(ke){We(ke instanceof Error?ke.message:"Failed to request indexing")}finally{On(!1)}}async function Sp(){On(!0),We(null);try{const Q=await k2(e,{urls:[],allUnindexed:!0}),{succeeded:ke,failed:nt,total:St}=Q.summary;vt({title:"Indexing requested",detail:nt===0?`${ke} unindexed URL${ke!==1?"s":""} submitted for indexing.`:`${ke}/${St} submitted successfully, ${nt} failed.`,tone:nt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(Q){We(Q instanceof Error?Q.message:"Failed to request indexing")}finally{On(!1)}}async function Gs(){if(Ve.trim()){cn(!0),We(null);try{await MV(e,"gsc",Ve.trim()),await t.invalidateQueries({queryKey:qe.gsc.project(e)}),a(Q=>Q.map(ke=>ke.connectionType==="gsc"?{...ke,sitemapUrl:Ve.trim()}:ke)),vt({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),Ht("")}catch(Q){We(Q instanceof Error?Q.message:"Failed to save sitemap URL")}finally{cn(!1)}}}async function Vs(){We(null);try{const Q=await Fn.mutateAsync({projectName:e,projectLabel:e});at(Q.sitemaps),a(ke=>ke.map(nt=>nt.connectionType==="gsc"?{...nt,sitemapUrl:Q.primarySitemapUrl}:nt))}catch{}}async function Wx(){He(!0),We(null);try{const Q=await FV(e);t.setQueryData(qe.gsc.sitemaps(e),Q),at(Q.sitemaps),Q.sitemaps.length===0&&de("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(Q){We(Q instanceof Error?Q.message:"Failed to list sitemaps")}finally{He(!1)}}async function Dd(){Z(!0),We(null);try{const[Q,ke]=await Promise.all([VN().catch(()=>null),t.fetchQuery({queryKey:qe.gsc.connections(e),queryFn:()=>z5(e).catch(()=>[]),staleTime:jr})]);r(!!Q?.google?.configured),a(ke);const nt=ke.find(St=>St.connectionType==="gsc");await Promise.all([tn(nt),En(),$r(),Xi()])}finally{Z(!1)}}x.useEffect(()=>{Dd()},[e]),x.useEffect(()=>{En()},[P]);async function Np(){if(!n){We("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}J(!0),We(null),de(null);try{const{authUrl:Q}=await TV(e,"gsc");if(!Q.startsWith("https://accounts.google.com/")){We("Unexpected OAuth redirect URL. Please try again.");return}const ke=window.open(Q,"_blank","width=600,height=700");if(!ke){window.location.assign(Q);return}de("Finish the Google consent flow in the popup, then close it to refresh this project.");const nt=window.setInterval(()=>{ke.closed&&(window.clearInterval(nt),de(null),t.invalidateQueries({queryKey:qe.gsc.project(e)}),Dd())},1e3)}catch(Q){We(Q instanceof Error?Q.message:"Failed to start OAuth flow")}finally{J(!1)}}async function kp(){We(null),de(null);try{await PV(e,"gsc"),await t.invalidateQueries({queryKey:qe.gsc.project(e)}),a(Q=>Q.filter(ke=>ke.connectionType!=="gsc")),u([]),k("")}catch(Q){We(Q instanceof Error?Q.message:"Failed to disconnect")}}async function Md(){if(S){M(!0),We(null);try{await DV(e,"gsc",S),await t.invalidateQueries({queryKey:qe.gsc.project(e)}),a(Q=>Q.map(ke=>ke.connectionType==="gsc"?{...ke,propertyId:S}:ke)),vt({title:"GSC property updated",detail:`${e} is now linked to ${S}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(Q){We(Q instanceof Error?Q.message:"Failed to save GSC property")}finally{M(!1)}}}async function Id(){We(null),de(null);try{await Qe.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(A,10)||void 0,full:O||void 0}}),await t.invalidateQueries({queryKey:qe.gsc.project(e)})}catch{}}async function Ld(){if(E.trim()){Ce(!0),We(null),de(null);try{const Q=await LV(e,E.trim());await t.invalidateQueries({queryKey:qe.gsc.project(e)}),b(Q),C(""),await $r()}catch(Q){We(Q instanceof Error?Q.message:"Failed to inspect URL")}finally{Ce(!1)}}}return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),s.jsx("h2",{children:"Google Search Console"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex gap-1",children:zEe.map(Q=>s.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${P===Q?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>$(Q),children:Q==="all"?"All":Q},Q))}),ze&&s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:q,onClick:()=>{En()},children:q?"Refreshing…":"Refresh data"})]})]}),gn&&s.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[gn,s.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>We(null),children:"×"})]}),Kt&&s.jsxs("div",{className:"mb-3 rounded-lg border border-emerald-800/40 bg-emerald-950/20 px-3 py-2 text-sm text-emerald-300",children:[Kt,s.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>de(null),children:"×"})]}),X?s.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):s.jsxs("div",{className:"space-y-3",children:[s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),s.jsx("h3",{children:"Domain authorization"})]}),s.jsx(Xe,{tone:ze?"positive":n?"caution":"negative",children:ze?"Connected":n?"Ready to connect":"App credentials missing"})]}),ze?s.jsxs("div",{className:"mt-3 space-y-3",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),s.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),s.jsx("span",{className:"text-xs text-zinc-500",children:ze.domain}),s.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:kp,children:"Disconnect"})]}),s.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",s.jsx("code",{children:ze.domain}),"."]})]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ze.propertyId??"No property selected yet"})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:sa(ze.updatedAt)})]})]})]}):s.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[s.jsx("p",{className:"text-sm text-zinc-300",children:n?"Generate a Google OAuth link for this project and have the client sign in with a Google account that already has access to the correct Search Console property.":"Set Google OAuth client credentials first. Once configured, you can generate a consent link for this project domain."}),s.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[n?s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:H,onClick:Np,children:H?"Opening…":"Connect Google Search Console"}):s.jsx(be,{type:"button",variant:"outline",size:"sm",asChild:!0,children:s.jsx(Yt,{to:"/settings",children:"Open Settings"})}),!n&&s.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),ze&&!ze.sitemapUrl&&s.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"mt-0.5 text-amber-400",children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5","aria-hidden":"true",children:s.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),s.jsx("p",{className:"mt-1 text-xs text-amber-400/70",children:"Canonry uses your sitemap to discover URLs for index coverage inspection. Auto-discover from GSC or enter it manually."}),s.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[s.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[s.jsx(be,{type:"button",size:"sm",disabled:Fn.isPending||!ze.propertyId,onClick:Vs,children:Fn.isPending?"Discovering…":"Auto-discover from GSC"}),s.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),s.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[s.jsx("input",{className:"flex-1 rounded border border-amber-800/40 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-500 focus:border-amber-600 focus:outline-none",type:"url",placeholder:"https://example.com/sitemap.xml",value:Ve,onChange:Q=>Ht(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&void Gs()}),s.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:Lt||!Ve.trim(),onClick:Gs,children:Lt?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ze||he)&&s.jsxs(s.Fragment,{children:[s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),s.jsx("h3",{children:"Index coverage"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[Se&&Se.notIndexed.length>0&&s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:mn,onClick:()=>{Sp()},children:mn?"Requesting…":`Request indexing (${Se.notIndexed.length})`}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:pe,onClick:()=>{Xi()},children:pe?"Loading…":"Refresh coverage"})]})]}),Se&&Se.summary.total>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const Q=Se.summary.indexed+Se.summary.notIndexed,ke=Q>0?Se.summary.indexed/Q:0,nt=Q>0?Se.summary.notIndexed/Q:0,St=54,_n=2*Math.PI*St,ja=_n*(1-ke),Ja=_n*nt,Qs=_n*ke;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative h-48 w-48",children:[s.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[s.jsx("circle",{cx:"64",cy:"64",r:St,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),s.jsx("circle",{cx:"64",cy:"64",r:St,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:_n,strokeDashoffset:ja,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),Se.summary.notIndexed>0&&s.jsx("circle",{cx:"64",cy:"64",r:St,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Ja} ${_n-Ja}`,strokeDashoffset:-Qs,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),s.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[s.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(ke*100).toFixed(0),"%"]}),s.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),s.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:Se.summary.indexed.toLocaleString()}),s.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),s.jsx("div",{className:"h-8 w-px bg-zinc-800"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:Se.summary.notIndexed.toLocaleString()}),s.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(Se.reasonGroups??[]).length>0&&s.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(Se.reasonGroups??[]).length," ",(Se.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),Se.summary.deindexed>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"h-8 w-px bg-zinc-800"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:Se.summary.deindexed.toLocaleString()}),s.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),s.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(Q=>{const ke=Q==="indexed"?Se.indexed.length:Q==="notIndexed"?Se.notIndexed.length:Se.deindexed.length,nt=Q==="indexed"?"Indexed":Q==="notIndexed"?"Not Indexed":"Deindexed";return s.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${Ze===Q?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Rt(Q),pt(null)},children:[nt," (",ke,")"]},Q)})}),s.jsxs("div",{className:"mt-3 overflow-x-auto",children:[Ze==="indexed"&&Se.indexed.length>0&&s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Verdict"}),s.jsx("th",{className:"text-left",children:"Last Crawl"}),s.jsx("th",{className:"text-left",children:"Mobile"})]})}),s.jsx("tbody",{children:Se.indexed.map(Q=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),s.jsx("td",{className:"text-zinc-400",children:Q.verdict??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:Q.crawlTime?Q.crawlTime.split("T")[0]:"—"}),s.jsx("td",{className:"text-zinc-400",children:Q.isMobileFriendly===!0?"Yes":Q.isMobileFriendly===!1?"No":"—"})]},Q.id))})]}),Ze==="notIndexed"&&!Ge&&(Se.reasonGroups??[]).length>0&&s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"Reason"}),s.jsx("th",{className:"text-right",children:"Pages"})]})}),s.jsx("tbody",{children:(Se.reasonGroups??[]).map(Q=>s.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>pt(Q.reason),children:[s.jsx("td",{className:"text-zinc-200",children:Q.reason}),s.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.count})]},Q.reason))})]}),Ze==="notIndexed"&&!Ge&&(Se.reasonGroups??[]).length===0&&Se.notIndexed.length>0&&s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Indexing State"}),s.jsx("th",{className:"text-left",children:"Coverage"})]})}),s.jsx("tbody",{children:Se.notIndexed.map(Q=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),s.jsx("td",{className:"text-zinc-400",children:Q.indexingState??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:Q.coverageState??"Unknown"})]},Q.id))})]}),Ze==="notIndexed"&&Ge&&(()=>{const Q=(Se.reasonGroups??[]).find(ke=>ke.reason===Ge);return Q?s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center gap-2 mb-3",children:s.jsxs("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>pt(null),children:["←"," Back to reasons"]})}),s.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Q.reason}),s.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[Q.count," affected page",Q.count!==1?"s":""]})]}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:mn,onClick:()=>{wa(Q.urls.map(ke=>ke.url))},children:mn?"Requesting…":`Request indexing (${Q.count})`})]}),s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Last Crawl"}),s.jsx("th",{className:"w-8"})]})}),s.jsx("tbody",{children:Q.urls.map(ke=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:ke.url}),s.jsx("td",{className:"text-zinc-400",children:ke.crawlTime?ke.crawlTime.split("T")[0]:"—"}),s.jsx("td",{children:s.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:mn,onClick:()=>{wa([ke.url])},title:"Request indexing",children:"Index"})})]},ke.id))})]})]}):null})(),Ze==="deindexed"&&Se.deindexed.length>0&&s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Previous"}),s.jsx("th",{className:"text-left",children:"Current"}),s.jsx("th",{className:"text-left",children:"Detected"})]})}),s.jsx("tbody",{children:Se.deindexed.map((Q,ke)=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),s.jsx("td",{className:"text-zinc-400",children:Q.previousState}),s.jsx("td",{className:"text-zinc-400",children:Q.currentState}),s.jsx("td",{className:"text-zinc-400",children:Q.transitionDate.split("T")[0]})]},`${Q.url}-${ke}`))})]}),(Ze==="indexed"&&Se.indexed.length===0||Ze==="notIndexed"&&!Ge&&Se.notIndexed.length===0||Ze==="deindexed"&&Se.deindexed.length===0)&&s.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):s.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:pe?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),s.jsx("h3",{children:"Search performance"})]}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:q,onClick:()=>{En()},children:q?"Loading…":"Apply filters"})]}),d.length>0&&(()=>{const Q=new Map;for(const ut of d){const Gt=Q.get(ut.date);Gt?(Gt.clicks+=ut.clicks,Gt.impressions+=ut.impressions):Q.set(ut.date,{clicks:ut.clicks,impressions:ut.impressions})}const ke=[...Q.entries()].sort(([ut],[Gt])=>ut.localeCompare(Gt));if(ke.length===0)return null;const nt=Math.max(...ke.map(([,ut])=>ut.impressions),1),St=ke.reduce((ut,[,Gt])=>ut+Gt.clicks,0),_n=ke.reduce((ut,[,Gt])=>ut+Gt.impressions,0),ja=_n>0?(St/_n*100).toFixed(1):"0.0",Ja=700,Qs=220,Er={top:12,bottom:36,left:48,right:12},il=Ja-Er.left-Er.right,Sa=Qs-Er.top-Er.bottom,ji=il/ke.length,Ji=Math.max(Math.min(ji*.35,24),4),Ws=Math.max(Ji*.15,1),Ys=ut=>{if(ut<=0)return 1;const Gt=Math.pow(10,Math.floor(Math.log10(ut))),Br=ut/Gt,ea=Br<=1.5?1.5:Br<=3?3:Br<=5?5:10;return Math.ceil(ea*Gt)},yn=4,al=Math.ceil(Ys(nt)/yn)*yn,Cp=Array.from({length:yn+1},(ut,Gt)=>al/yn*Gt),es=ut=>ut>=1e3?`${(ut/1e3).toFixed(ut>=1e4?0:1)}k`:String(ut);return s.jsxs("div",{className:"mt-3",children:[s.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),s.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",s.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:St.toLocaleString()})]})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),s.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",s.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:_n.toLocaleString()})]})]}),s.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",s.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[ja,"%"]})]})]}),s.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Ja} / ${Qs}`},children:s.jsxs("svg",{viewBox:`0 0 ${Ja} ${Qs}`,className:"h-full w-full",children:[Cp.map((ut,Gt)=>{const Br=Er.top+Sa-ut/al*Sa;return s.jsxs("g",{children:[s.jsx("line",{x1:Er.left,y1:Br,x2:Ja-Er.right,y2:Br,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),s.jsx("text",{x:Er.left-6,y:Br+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:es(ut)})]},`t-${Gt}`)}),ke.map(([ut,Gt],Br)=>{const ea=Er.left+ji*Br+ji/2,Oc=Gt.impressions/al*Sa,sl=Gt.clicks/al*Sa;return s.jsxs("g",{children:[s.jsx("title",{children:`${ut}
290
+ Clicks: ${Gt.clicks}
291
+ Impressions: ${Gt.impressions}
292
+ CTR: ${Gt.impressions>0?(Gt.clicks/Gt.impressions*100).toFixed(1):0}%`}),s.jsx("rect",{x:ea-Ji-Ws/2,y:Er.top+Sa-Oc,width:Ji,height:Math.max(Oc,1),rx:2,fill:"#3b82f6",opacity:.85}),s.jsx("rect",{x:ea+Ws/2,y:Er.top+Sa-sl,width:Ji,height:Math.max(sl,1),rx:2,fill:"#10b981",opacity:.85})]},ut)}),(()=>{const ut=Math.min(ke.length,7);return Array.from({length:ut},(Gt,Br)=>{const ea=ke.length===1?0:Math.round(Br/(ut-1)*(ke.length-1)),Oc=Er.left+ji*ea+ji/2;return s.jsx("text",{x:Oc,y:Qs-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:ke[ea][0].slice(5)},`xl-${ea}`)})})()]})})]})})(),s.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[s.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:F.startDate,onChange:Q=>U(ke=>({...ke,startDate:Q.target.value}))}),s.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:F.endDate,onChange:Q=>U(ke=>({...ke,endDate:Q.target.value}))}),s.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter query",value:F.query,onChange:Q=>U(ke=>({...ke,query:Q.target.value}))}),s.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter page",value:F.page,onChange:Q=>U(ke=>({...ke,page:Q.target.value}))}),s.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"number",min:"1",placeholder:"Limit",value:F.limit,onChange:Q=>U(ke=>({...ke,limit:Q.target.value}))})]}),d.length>0?s.jsx("div",{className:"mt-3 overflow-x-auto",children:s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"Date"}),s.jsx("th",{className:"text-left",children:"Query"}),s.jsx("th",{className:"text-left",children:"Page"}),Object.values(Ro).map(Q=>s.jsx("th",{className:"text-right","aria-sort":mt?.key===Q?mt.dir==="asc"?"ascending":"descending":"none",children:s.jsxs("button",{type:"button",className:"w-full cursor-pointer select-none text-right hover:text-zinc-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-zinc-400 rounded px-1 -mx-1",onClick:()=>et(ke=>ke?.key===Q?ke.dir==="desc"?{key:Q,dir:"asc"}:null:{key:Q,dir:"desc"}),children:[Ite[Q],mt?.key===Q?mt.dir==="desc"?" ↓":" ↑":""]})},Q))]})}),s.jsx("tbody",{children:ce.map((Q,ke)=>s.jsxs("tr",{children:[s.jsx("td",{className:"text-zinc-400",children:Q.date}),s.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:Q.query}),s.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:Q.page}),s.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:Q.clicks.toLocaleString()}),s.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.impressions.toLocaleString()}),s.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(Q.ctr)?Q.ctr*100:0).toFixed(1),"%"]}),s.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.position.toFixed(1)})]},`${Q.date}:${Q.query}:${Q.page}:${ke}`))})]})}):s.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),s.jsxs($e,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),s.jsx("h3",{children:"Inspect a URL"})]})}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[s.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://example.com/page",value:E,onChange:Q=>C(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&void Ld()}),s.jsx(be,{type:"button",size:"sm",disabled:ne||!ze?.propertyId||!E.trim(),onClick:Ld,children:ne?"Inspecting…":"Inspect URL"})]}),j&&s.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:j.indexingState??"Unknown"})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:j.verdict??"Unknown"})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:sT(j.isMobileFriendly)})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:sa(j.crawlTime)})]})]})]}),s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),s.jsx("h3",{children:"Inspection log"})]}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:G,onClick:()=>{$r()},children:G?"Loading…":"Refresh history"})]}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[s.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter exact URL",value:B,onChange:Q=>V(Q.target.value)}),s.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:G,onClick:()=>{$r()},children:"Apply filter"})]}),p.length>0?s.jsx("div",{className:"mt-3 overflow-x-auto",children:s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Indexing"}),s.jsx("th",{className:"text-left",children:"Verdict"}),s.jsx("th",{className:"text-left",children:"Coverage"}),s.jsx("th",{className:"text-left",children:"Mobile"}),s.jsx("th",{className:"text-left",children:"Inspected"})]})}),s.jsx("tbody",{children:p.map(Q=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),s.jsx("td",{className:"text-zinc-300",children:Q.indexingState??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:Q.verdict??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:Q.coverageState??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:sT(Q.isMobileFriendly)}),s.jsx("td",{className:"text-zinc-400",children:sa(Q.inspectedAt)})]},Q.id))})]})}):s.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),s.jsxs($e,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),s.jsx("h3",{children:"Recent indexing losses"})]})}),g.length>0?s.jsx("div",{className:"mt-3 overflow-x-auto",children:s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Previous"}),s.jsx("th",{className:"text-left",children:"Current"}),s.jsx("th",{className:"text-left",children:"Changed at"})]})}),s.jsx("tbody",{children:g.map(Q=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),s.jsx("td",{className:"text-zinc-400",children:Q.previousState??"Unknown"}),s.jsx("td",{className:"text-zinc-300",children:Q.currentState??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:sa(Q.transitionDate)})]},`${Q.url}:${Q.transitionDate}`))})]})}):s.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ze&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:s.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>je(Q=>!Q),children:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`h-4 w-4 text-zinc-500 transition-transform ${en?"rotate-90":""}`,"aria-hidden":"true",children:s.jsx("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})}),s.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),en&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[s.jsxs($e,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),s.jsx("h3",{children:"Pick the Search Console property"})]})}),s.jsxs("div",{className:"mt-3 space-y-2",children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),s.jsx("select",{id:`gsc-property-${e}`,className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:S,disabled:oe||l.length===0,onChange:Q=>k(Q.target.value),children:l.length===0?s.jsx("option",{value:"",children:oe?"Loading properties…":"No properties available"}):l.map(Q=>s.jsxs("option",{value:Q.siteUrl,children:[Q.siteUrl," · ",Q.permissionLevel]},Q.siteUrl))}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:oe,onClick:()=>{tn(ze)},children:oe?"Refreshing…":"Refresh properties"}),s.jsx(be,{type:"button",size:"sm",disabled:!S||I,onClick:Md,children:I?"Saving…":"Save property"})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),s.jsxs($e,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),s.jsx("h3",{children:"Import GSC performance data"})]})}),s.jsxs("div",{className:"mt-3 space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),s.jsx("input",{id:`gsc-sync-days-${e}`,type:"number",min:"1",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",value:A,onChange:Q=>T(Q.target.value)})]}),s.jsxs("label",{className:"flex items-center gap-2 rounded border border-zinc-800/60 bg-zinc-900/20 px-3 py-2 text-sm text-zinc-300",children:[s.jsx("input",{type:"checkbox",checked:O,onChange:Q=>_(Q.target.checked)}),"Replace existing imported rows for the requested range"]})]}),s.jsx(be,{type:"button",size:"sm",disabled:Qe.isPending||!ze.propertyId,onClick:Id,children:Qe.isPending?"Queueing…":"Queue sync"}),!ze.propertyId&&s.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),s.jsxs($e,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),s.jsx("h3",{children:"Sitemap configuration"})]})}),s.jsxs("div",{className:"mt-3 space-y-3",children:[ze.sitemapUrl&&s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:ze.sitemapUrl})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:Y||!ze.propertyId,onClick:()=>{Wx()},children:Y?"Loading…":"Browse sitemaps from GSC"}),s.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:Fn.isPending||!ze.propertyId,onClick:Vs,children:Fn.isPending?"Discovering…":"Auto-discover and queue inspection"})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:"Browse lists available sitemaps without queueing a run. Auto-discover saves the primary sitemap and queues an inspection."}),Pe&&Pe.length>0&&s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[s.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",Pe.length,")"]}),Pe.map(Q=>{const ke=Q.contents?.[0];return s.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-zinc-200 break-all",children:Q.path}),Q.lastSubmitted&&s.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",Q.lastSubmitted.split("T")[0]]})]}),s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[ke&&s.jsxs("div",{className:"text-right",children:[s.jsxs("p",{className:"text-zinc-300",children:[ke.indexed," / ",ke.submitted]}),s.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),s.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Ht(Q.path),children:"Use"})]})]},Q.path)})]}),s.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[s.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:ze.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Ve,onChange:Q=>Ht(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&Ve.trim()&&void Gs()}),s.jsx(be,{type:"button",size:"sm",disabled:Lt||!Ve.trim(),onClick:Gs,children:Lt?"Saving…":ze.sitemapUrl?"Update":"Save"})]}),s.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[s.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"Sitemap URL for inspection (leave empty for saved default)",id:`gsc-sitemap-inspect-${e}`}),s.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:wi.isPending||!ze.propertyId,onClick:async()=>{const ke=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ze.sitemapUrl||void 0;We(null),de(null);try{await wi.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:ke}})}catch{}},children:wi.isPending?"Queueing…":"Inspect sitemap"})]}),!ze.propertyId&&s.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function ES({children:e,label:t="More info",placement:n="top",className:r}){const i=x.useId(),[a,l]=x.useState(!1);return s.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[s.jsx("button",{type:"button","aria-label":t,"aria-describedby":a?i:void 0,className:"inline-flex h-4 w-4 items-center justify-center rounded-full text-zinc-500 hover:text-zinc-200 focus:text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onFocus:()=>l(!0),onBlur:()=>l(!1),children:s.jsx(F5,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&s.jsx("span",{id:i,role:"tooltip",className:`absolute z-50 w-64 rounded border border-zinc-700 bg-zinc-900 px-3 py-2 text-xs font-normal leading-relaxed text-zinc-200 shadow-lg ${n==="top"?"bottom-full mb-2":"top-full mt-2"} left-1/2 -translate-x-1/2 whitespace-normal`,children:e})]})}const _l=50;function Su(e){return typeof window>"u"?e:`${window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??""}${e}`}function Og(e){return e.toLocaleString()}function PEe(e){const t=Number(e);return Number.isFinite(t)?`${(t*100).toFixed(1)}%`:"—"}function REe(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 DEe(e){const t=e.filter(n=>n.kind===Tt["backlink-extract"]&&!ck(n.status));return t.length===0?null:t.reduce((n,r)=>n.createdAt>r.createdAt?n:r)}function MEe(e,t){const n=new Date(e??t).getTime(),r=Math.max(0,Math.floor((Date.now()-n)/1e3));if(r<60)return`${r}s`;const i=Math.floor(r/60),a=r%60;return a===0?`${i}m`:`${i}m ${a}s`}function IEe({projectName:e}){const[t,n]=x.useState(null),[r,i]=x.useState(null),[a,l]=x.useState([]),[u,d]=x.useState(null),[f,p]=x.useState(null),[m,g]=x.useState(null),[v,j]=x.useState(Date.now()),[b,S]=x.useState(0),[k,E]=x.useState(!0),[C,A]=x.useState(!1),[T,O]=x.useState(null),_=x.useRef(null),P=x.useCallback(async()=>{E(!0),O(null);try{const[oe,ye,I,M,q]=await Promise.all([I5().catch(()=>null),vQ(e,{excludeCrawlers:!0}).catch(()=>null),xQ(e,{limit:_l,offset:b,excludeCrawlers:!0}).catch(G=>{if(G instanceof ei&&G.code==="NOT_FOUND")return null;throw G}),bQ(e).catch(()=>[]),sV(e).catch(()=>[])]);d(oe),n(ye),i(I),l(M);const D=DEe(q);p(D),_.current=D?.id??null}catch(oe){O(oe instanceof Error?oe.message:"Failed to load backlinks")}finally{E(!1)}},[e,b]);x.useEffect(()=>{P()},[P]),x.useEffect(()=>{if(!f)return;const oe=f.id;let ye=!1;const I=async()=>{try{const q=await tc(oe);if(ye)return;ck(q.status)?(p(null),g(q),await P()):p(D=>D?.id===q.id?{...D,...q}:D)}catch{}},M=window.setInterval(()=>{I()},3e3);return()=>{ye=!0,window.clearInterval(M)}},[f,P]),x.useEffect(()=>{if(!f)return;const oe=window.setInterval(()=>j(Date.now()),1e3);return()=>window.clearInterval(oe)},[f]),x.useEffect(()=>{if(!m||m.status==="failed")return;const oe=window.setTimeout(()=>g(null),1e4);return()=>window.clearTimeout(oe)},[m]);async function $(){A(!0),O(null);try{const oe=await wQ(e);p(oe),_.current=oe.id}catch(oe){oe instanceof ei&&oe.code==="MISSING_DEPENDENCY"?O("DuckDB is not installed. Visit the Backlinks admin page to install it."):O(oe instanceof Error?oe.message:"Failed to trigger extract")}finally{A(!1)}}const F=x.useMemo(()=>a.slice().sort((oe,ye)=>oe.queriedAt.localeCompare(ye.queriedAt)).map(oe=>({date:oe.queriedAt,linkingDomains:oe.totalLinkingDomains})),[a]),U=r?.rows??[],B=r?.total??0,V=t?.excludedLinkingDomains??0,X=B>_l,Z=Math.floor(b/_l)+1,H=Math.max(1,Math.ceil(B/_l));return x.useEffect(()=>{b>0&&b>=B&&S(0)},[b,B]),s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Backlinks"}),s.jsx("h2",{children:"Referring domains"}),s.jsxs("p",{className:"text-sm text-zinc-500 mt-1 max-w-2xl",children:["Domains linking to "," ",s.jsx("span",{className:"text-zinc-300",children:e}),", extracted from the Common Crawl hyperlink graph. Updates when a release sync completes — no live scraping, no paid API."]})]})}),T&&s.jsx($e,{className:"surface-card p-4 mb-4 border-rose-800/60",children:s.jsx("p",{className:"text-sm text-rose-300",children:T})}),f&&s.jsx($e,{className:"surface-card p-4 mb-4 border-sky-800/60",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(K5,{className:"h-5 w-5 text-sky-400 animate-spin shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("p",{className:"text-sm font-medium text-zinc-100",children:"Extract running"}),s.jsx(Xe,{tone:"neutral",children:f.status}),s.jsxs("span",{className:"text-xs text-zinc-500 tabular-nums",children:[MEe(f.startedAt,f.createdAt)," elapsed · refreshing every 3s"]}),s.jsxs("span",{className:"sr-only",children:["now=",v]})]}),s.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Re-querying the cached Common Crawl release for"," ",s.jsx("span",{className:"text-zinc-300",children:e}),". No re-download — the ~16 GB dump already lives at"," ",s.jsx("code",{className:"text-zinc-400",children:"~/.canonry/cache/commoncrawl/"}),". Typically takes ~5 minutes."]})]})]})}),m&&!f&&s.jsx($e,{className:`surface-card p-4 mb-4 ${m.status==="failed"?"border-rose-800/60":"border-emerald-800/60"}`,children:s.jsxs("div",{className:"flex items-start gap-3",children:[m.status==="failed"?s.jsx("span",{className:"h-5 w-5 shrink-0 mt-0.5 text-rose-400 text-lg leading-none","aria-hidden":!0,children:"!"}):s.jsx(q5,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:`text-sm font-medium ${m.status==="failed"?"text-rose-300":"text-emerald-300"}`,children:m.status==="failed"?"Extract failed":"Extract complete"}),m.error?s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:Lte(m.error)}):m.status!=="failed"?s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Backlinks refreshed from the cached release."}):null]})]})}),J()]});function J(){if(k)return s.jsx($e,{className:"surface-card p-6",children:s.jsx("p",{className:"text-sm text-zinc-500",children:"Loading backlinks…"})});const oe=t!==null&&t.totalLinkingDomains>0,ye=m?.status==="failed",I=t!==null&&t.totalLinkingDomains===0&&!ye,M=u?.status==="ready",q=u?.status==="failed",D=u&&(u.status==="downloading"||u.status==="querying"||u.status==="queued");return oe?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"gauge-row",children:[s.jsxs("div",{className:"metric-card",children:[s.jsx("p",{className:"metric-card-eyebrow",children:"Referring domains"}),s.jsx("p",{className:"metric-card-big-value",children:s.jsx("span",{className:"text-zinc-50",children:Og(t.totalLinkingDomains)})}),s.jsxs("p",{className:"metric-card-sub",children:["unique domains linking to ",t.targetDomain]})]}),s.jsxs("div",{className:"metric-card",children:[s.jsx("p",{className:"metric-card-eyebrow",children:"Total linking hosts"}),s.jsx("p",{className:"metric-card-big-value",children:s.jsx("span",{className:"text-zinc-50",children:Og(t.totalHosts)})}),s.jsx("p",{className:"metric-card-sub",children:"aggregate host count across referring domains"})]}),s.jsxs("div",{className:"metric-card",children:[s.jsx("p",{className:"metric-card-eyebrow",children:"Top-10 concentration"}),s.jsx("p",{className:"metric-card-big-value",children:s.jsx("span",{className:"text-zinc-50",children:PEe(t.top10HostsShare)})}),s.jsx("p",{className:"metric-card-sub",children:"share of hosts from the 10 largest linking domains"})]})]}),s.jsxs("p",{className:"text-xs text-zinc-600 mt-2",children:["Release ",s.jsx("code",{className:"text-zinc-400",children:t.release})," · queried ",REe(t.queriedAt),V>0&&s.jsxs(s.Fragment,{children:[" · ",s.jsxs("span",{className:"text-zinc-500",children:[V," crawler/proxy domain",V===1?"":"s"," hidden"]})]})]}),F.length>=2&&s.jsxs($e,{className:"surface-card p-4 mt-4",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Referring domains over releases"}),s.jsx("div",{className:"h-40 mt-2",children:s.jsx(Ts,{width:"100%",height:"100%",children:s.jsxs(NN,{data:F,margin:{top:8,right:12,bottom:0,left:12},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"bl-gradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"0%",stopColor:An[0],stopOpacity:.4}),s.jsx("stop",{offset:"100%",stopColor:An[0],stopOpacity:0})]})}),s.jsx(Wa,{dataKey:"date",tick:er,stroke:Nr,tickFormatter:hd}),s.jsx(Ya,{tick:er,stroke:Nr,allowDecimals:!1}),s.jsx(Ms,{contentStyle:da.contentStyle,labelStyle:da.labelStyle,itemStyle:da.itemStyle,labelFormatter:fd}),s.jsx(Du,{type:"monotone",dataKey:"linkingDomains",name:"Referring domains",stroke:An[0],fill:"url(#bl-gradient)",strokeWidth:2})]})})})]}),s.jsxs("div",{className:"mt-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Top referring domains"}),X&&s.jsxs("p",{className:"text-xs text-zinc-600",children:["Page ",Z," of ",H," · ",Og(B)," total"]})]}),s.jsx($e,{className:"surface-card overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[s.jsx("th",{className:"px-4 py-2 font-medium",children:"Domain"}),s.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Linking hosts"})]})}),s.jsxs("tbody",{children:[U.map(G=>s.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[s.jsx("td",{className:"px-4 py-2 text-zinc-200",children:G.linkingDomain}),s.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:Og(G.numHosts)})]},G.linkingDomain)),U.length===0&&s.jsx("tr",{children:s.jsx("td",{className:"px-4 py-4 text-sm text-zinc-500",colSpan:2,children:V>0&&B===0?`Every referring domain in this release was a crawler/proxy host (${V} hidden).`:"No referring domains in this release."})})]})]})}),X&&s.jsxs("div",{className:"flex items-center justify-end gap-2 mt-2",children:[s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:b===0,onClick:()=>S(G=>Math.max(0,G-_l)),children:"Previous"}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:b+_l>=B,onClick:()=>S(G=>G+_l),children:"Next"})]})]}),s.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[s.jsxs(be,{type:"button",variant:"outline",size:"sm",disabled:C||f!==null,onClick:$,children:[s.jsx(Ov,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Re-run extract"]}),s.jsxs(ES,{label:"What does Re-run extract do?",children:[s.jsxs("span",{className:"block",children:["Re-queries the ",s.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," for ",s.jsx("span",{className:"text-zinc-200",children:e}),". Replaces existing backlink rows for this project under the current release."]}),s.jsxs("span",{className:"mt-2 block text-zinc-400",children:[s.jsx("span",{className:"text-zinc-200",children:"No re-download"})," of the ~16 GB dump. Typically ",s.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]}),s.jsx(be,{asChild:!0,type:"button",variant:"outline",size:"sm",children:s.jsx("a",{href:Su("/backlinks"),children:"Open admin"})})]})]}):s.jsx($e,{className:"surface-card p-6",children:s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-zinc-900 text-zinc-400",children:s.jsx(H5,{className:"h-5 w-5","aria-hidden":!0})}),s.jsxs("div",{className:"flex-1",children:[!u&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No release sync yet"}),s.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:"Run a workspace release sync to populate backlinks for every project in this workspace."}),s.jsx("div",{className:"mt-4",children:s.jsx(be,{asChild:!0,type:"button",size:"sm",children:s.jsx("a",{href:Su("/backlinks"),children:"Set up backlinks"})})})]}),D&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Sync in progress"}),s.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["A workspace release sync is running (",u.status,u.phaseDetail?` — ${u.phaseDetail}`:"","). Backlinks will appear here once it finishes."]}),s.jsx("div",{className:"mt-4",children:s.jsx(be,{asChild:!0,type:"button",variant:"outline",size:"sm",children:s.jsx("a",{href:Su("/backlinks"),children:"View sync status"})})})]}),q&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last sync failed"}),s.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:u.error??"The workspace release sync failed. Retry from the Backlinks admin page."}),s.jsx("div",{className:"mt-4",children:s.jsx(be,{asChild:!0,type:"button",size:"sm",children:s.jsx("a",{href:Su("/backlinks"),children:"Go to Backlinks admin"})})})]}),M&&!D&&!I&&!ye&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No backlinks yet for this project"}),s.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["Release ",s.jsx("code",{className:"text-zinc-300",children:u.release})," is ready but no backlinks have been extracted for"," ",s.jsx("code",{className:"text-zinc-300",children:e}),". Run an extract to populate data using the cached release."]}),s.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[s.jsxs(be,{type:"button",size:"sm",disabled:C||f!==null,onClick:$,children:[s.jsx(ry,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Run extract"]}),s.jsxs(ES,{label:"What does Run extract do?",children:[s.jsxs("span",{className:"block",children:["Runs a DuckDB query against the ",s.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," to find referring domains for ",s.jsx("span",{className:"text-zinc-200",children:e}),"."]}),s.jsxs("span",{className:"mt-2 block text-zinc-400",children:["No re-download. Typically takes ",s.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]})]})]}),ye&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last extract failed"}),s.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["See the error above for details. If the cache files for release"," ",s.jsx("code",{className:"text-zinc-300",children:u?.release})," are missing, re-sync the release from the Backlinks admin to restore the ~16 GB dump, then re-run the extract."]}),s.jsx("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:s.jsx(be,{asChild:!0,type:"button",size:"sm",children:s.jsx("a",{href:Su("/backlinks"),children:"Go to Backlinks admin"})})})]}),I&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No referring domains found"}),s.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["The last extract against release ",s.jsx("code",{className:"text-zinc-300",children:t.release})," found"," ",s.jsx("span",{className:"text-zinc-300",children:"0 referring domains"})," for"," ",s.jsx("code",{className:"text-zinc-300",children:t.targetDomain}),". This can happen when:"]}),s.jsxs("ul",{className:"mt-2 space-y-1 text-xs text-zinc-500 list-disc list-inside",children:[s.jsx("li",{children:"the domain is newer than the release’s crawl window"}),s.jsx("li",{children:"the Common Crawl snapshot didn’t capture pages that link to it"}),s.jsx("li",{children:"the extract ran against a cache that was missing or incomplete"})]}),s.jsx("p",{className:"text-sm text-zinc-500 mt-3",children:"Try syncing a newer release — each Common Crawl dump is a different snapshot of the web graph."}),s.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[s.jsx(be,{asChild:!0,type:"button",size:"sm",children:s.jsx("a",{href:Su("/backlinks"),children:"Go to Backlinks admin"})}),s.jsxs(be,{type:"button",variant:"outline",size:"sm",disabled:C||f!==null,onClick:$,children:[s.jsx(ry,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Re-run extract"]}),s.jsxs(ES,{label:"What does Re-run extract do?",children:[s.jsxs("span",{className:"block",children:["Re-queries the cached release for ",s.jsx("span",{className:"text-zinc-200",children:t.targetDomain}),". Only useful if the cache files were incomplete last time."]}),s.jsx("span",{className:"mt-2 block text-zinc-400",children:"No re-download. ~5 min. If the release genuinely has no links for your domain, this won’t help — sync a different release instead."})]})]})]})]})]})})}}function LEe({projectName:e}){const t=ua({queryKey:qe.citationVisibility(e),queryFn:()=>cQ(e),staleTime:$5}),n=t.data??null,r=t.error;if(t.isLoading&&!n)return null;if(r)return s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),s.jsx("h2",{children:"Citation + answer-mention coverage"})]})}),s.jsx("p",{className:"text-sm text-rose-400",children:r instanceof Error?r.message:String(r)})]});if(!n)return null;if(n.status==="no-data")return s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),s.jsx("h2",{children:"Citation + answer-mention coverage"})]})}),s.jsx("p",{className:"text-sm text-zinc-500",children:n.reason==="no-queries"?"Add queries to start tracking AI citations.":"Run a sweep to see which engines cite this project."})]});const{providersCiting:i,providersMentioning:a,providersConfigured:l}=n.summary;return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),s.jsxs("h2",{className:"flex items-center gap-2",children:["Cited by ",i," of ",l," engines",s.jsx(pr,{text:"An engine is ‘citing’ when our domain appears in its grounding source list (the structured citation/search-result attribution it returns alongside the answer). Counts each configured engine that cites the project on at least one tracked query in the latest snapshot per (query × provider)."})]}),s.jsxs("p",{className:"text-base text-zinc-300 flex items-center gap-2",children:["Mentioned in ",a," of ",l," engine answers",s.jsx(pr,{text:"An engine is ‘mentioning’ when our brand or domain appears inside the prose of the answer text — independent of whether it’s in the citation list. Models often name-drop from training without citing a fresh page."})]})]}),n.summary.latestRunAt&&s.jsxs("p",{className:"supporting-copy",children:["Latest run ",new Date(n.summary.latestRunAt).toLocaleString()]})]}),s.jsx($Ee,{data:n}),s.jsx(BEe,{data:n}),n.competitorGaps.length>0&&s.jsx(HEe,{data:n})]})}function $Ee({data:e}){const{totalQueries:t,queriesCitedAndMentioned:n,queriesCitedOnly:r,queriesMentionedOnly:i,queriesInvisible:a}=e.summary;return s.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4 mb-4",children:[s.jsx(Eg,{label:"Cited + mentioned",value:`${n} / ${t}`,helper:"In sources AND named in answer",tone:n>0?"positive":"neutral"}),s.jsx(Eg,{label:"Cited only",value:`${r} / ${t}`,helper:"In sources, not named in answer",tone:r>0?"positive-dim":"neutral"}),s.jsx(Eg,{label:"Mentioned only",value:`${i} / ${t}`,helper:"Named in answer, no source link",tone:i>0?"caution":"neutral"}),s.jsx(Eg,{label:"Invisible",value:`${a} / ${t}`,helper:"No engine cites or mentions",tone:a>0?"negative":"neutral"})]})}function Eg({label:e,value:t,helper:n,tone:r}){const i=r==="positive"?"text-emerald-300":r==="positive-dim"?"text-emerald-400/70":r==="caution"?"text-amber-300":r==="negative"?"text-rose-300":"text-zinc-100";return s.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:e}),s.jsx("p",{className:`mt-1 text-2xl font-semibold tabular-nums ${i}`,children:t}),s.jsx("p",{className:"text-[11px] text-zinc-500",children:n})]})}function BEe({data:e}){const t=x.useMemo(()=>{const n=new Set;for(const r of e.byQuery)for(const i of r.providers)n.add(i.provider);return Array.from(n).sort()},[e.byQuery]);return e.byQuery.length===0?s.jsx("p",{className:"text-sm text-zinc-500",children:"No query coverage rows."}):s.jsxs("div",{children:[s.jsx(UEe,{}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Query"}),t.map(n=>s.jsx("th",{className:"text-center",children:s.jsx(rc,{provider:n})},n)),s.jsx("th",{className:"text-right",children:"Cite"}),s.jsx("th",{className:"text-right",children:"Ment"})]})}),s.jsx("tbody",{children:e.byQuery.map(n=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-medium text-zinc-100",children:n.query}),t.map(r=>{const i=n.providers.find(a=>a.provider===r);return s.jsx("td",{className:"text-center",children:i==null?s.jsx(mW,{className:"inline h-3.5 w-3.5 text-zinc-700","aria-label":"no data"}):s.jsx(qEe,{provider:i})},r)}),s.jsx("td",{className:"text-right tabular-nums",children:s.jsxs("span",{className:n.totalProviders>0&&n.citedCount===n.totalProviders?"text-emerald-300":n.citedCount>0?"text-emerald-400/70":"text-zinc-500",children:[n.citedCount,"/",n.totalProviders]})}),s.jsx("td",{className:"text-right tabular-nums",children:s.jsxs("span",{className:n.totalProviders>0&&n.mentionedCount===n.totalProviders?"text-sky-300":n.mentionedCount>0?"text-sky-400/70":"text-zinc-500",children:[n.mentionedCount,"/",n.totalProviders]})})]},n.queryId))})]})})]})}function UEe(){return s.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-3 text-[11px] text-zinc-500",children:[s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Mu,{active:!0,tone:"cited"}),s.jsx("span",{children:"cited (in sources)"})]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Mu,{active:!0,tone:"mentioned"}),s.jsx("span",{children:"mentioned (in answer)"})]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Mu,{active:!1,tone:"cited"}),s.jsx(Mu,{active:!1,tone:"mentioned"}),s.jsx("span",{children:"neither"})]})]})}function qEe({provider:e}){const t=FEe(e);return s.jsxs("span",{className:"inline-flex items-center justify-center gap-1",title:t,children:[s.jsx(Mu,{active:e.cited,tone:"cited"}),s.jsx(Mu,{active:e.mentioned,tone:"mentioned"})]})}function FEe(e){return e.cited&&e.mentioned?"Cited in sources and mentioned in answer":e.cited?"Cited in sources, not mentioned in answer":e.mentioned?"Mentioned in answer, not in sources":"Not cited and not mentioned"}function Mu({active:e,tone:t}){if(!e)return s.jsx("span",{className:"inline-block h-2 w-2 rounded-full border border-zinc-700/80 bg-transparent","aria-hidden":"true"});const n=t==="cited"?"inline-block h-2 w-2 rounded-full bg-emerald-400 shadow-[0_0_0_1px_rgba(16,185,129,0.25)]":"inline-block h-2 w-2 rounded-full bg-sky-400 shadow-[0_0_0_1px_rgba(56,189,248,0.25)]";return s.jsx("span",{className:n,"aria-hidden":"true"})}function HEe({data:e}){return s.jsxs("div",{className:"mt-4",children:[s.jsxs("h3",{className:"text-sm font-semibold text-zinc-200 mb-2 flex items-center gap-2",children:["Competitor gaps",s.jsx(pr,{text:"Queries where the project is not cited but a configured competitor is. Each row maps to one (query, engine) pair — the same query may surface for multiple engines."}),s.jsxs("span",{className:"text-[10px] font-normal uppercase tracking-wide text-zinc-500",children:[e.competitorGaps.length," ",e.competitorGaps.length===1?"gap":"gaps"]})]}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Engine"}),s.jsx("th",{children:"Competitors cited"})]})}),s.jsx("tbody",{children:e.competitorGaps.map(t=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-medium text-zinc-100",children:t.query}),s.jsx("td",{children:s.jsx(rc,{provider:t.provider})}),s.jsx("td",{className:"text-zinc-300",children:t.citingCompetitors.join(", ")})]},`${t.queryId}::${t.provider}`))})]})})]})}const t9=4;function KEe(e){return e.length<t9}const n9={critical:"negative",high:"negative",medium:"caution",low:"neutral"},GEe={positive:"Positive",caution:"Caution",negative:"Negative",neutral:"Neutral"};function ft(e){return Number.isFinite(e)?Math.abs(e)>=1e6?`${(e/1e6).toFixed(1)}M`:Math.abs(e)>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString("en-US"):"—"}function xv(e,t=1){return Number.isFinite(e)?`${e.toFixed(t)}%`:"—"}function LA(e){return Number.isFinite(e)?`${(e*100).toFixed(1)}%`:"—"}function Es(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function r9(e){switch(e){case"up":return"positive";case"down":return"negative";case"flat":return"neutral";case"unknown":return"neutral"}}function i9(e){const t=[e.city,e.region,e.country].filter(Boolean).join(", ");return t?`${e.label} (${t})`:e.label}function VEe(e){switch(e){case"request-param":case"prompt":return"positive";case"browser-geo":return"caution";case"ignored":return"negative"}}const QEe={"request-param":"Request parameter",prompt:"Prompt-injected","browser-geo":"Browser geo",ignored:"Ignored"};function WEe({cell:e}){if(!e)return s.jsxs("span",{className:"inline-flex items-center gap-1 font-mono text-[12px] text-zinc-700",children:[s.jsx("span",{children:"—"}),s.jsx("span",{children:"—"})]});const t=e.citationState===Ju.cited,n=e.answerMentioned;return s.jsxs("span",{className:"inline-flex items-center gap-1 font-mono text-[12px]",children:[s.jsx("span",{className:t?"text-emerald-300":"text-zinc-500",title:t?"Cited (your domain in source list)":"Not cited",children:t?"C":"c"}),s.jsx("span",{className:n===!0?"text-emerald-300":n===!1?"text-zinc-500":"text-zinc-700",title:n===!0?"Mentioned (your brand in answer text)":n===!1?"Not mentioned":"No answer text",children:n===!0?"M":n===!1?"m":"–"})]})}function YEe(e){switch(e){case"High":return"negative";case"Moderate":return"caution";case"Low":return"neutral";case"None":return"neutral"}}function ZEe({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(null),[a,l]=x.useState("agency"),u=ua({queryKey:qe.report(e),queryFn:()=>XV(e)});async function d(){n(!0),i(null);try{await eQ(e,a)}catch(p){const m=p instanceof ei||p instanceof Error?p.message:"Download failed";i(m)}finally{n(!1)}}if(u.isLoading)return s.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading report…"});if(u.error){const p=u.error instanceof Error?u.error.message:"Failed to load report";return s.jsx("div",{className:"py-8 text-center",children:s.jsx("p",{className:"text-sm text-rose-400",children:p})})}const f=u.data;return f?s.jsxs("div",{children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsx("p",{className:"eyebrow",children:"AEO Report"}),s.jsx("h1",{className:"page-title",children:f.meta.project.displayName}),s.jsxs("p",{className:"page-subtitle",children:[f.meta.project.canonicalDomain," · ",f.meta.project.country," / ",f.meta.project.language.toUpperCase(),f.meta.location?` · Location: ${i9(f.meta.location)}`:" · No location set"," · ","Generated ",Es(f.meta.generatedAt)]}),r&&s.jsx("p",{className:"mt-2 text-xs text-rose-400",children:r})]}),s.jsxs("div",{className:"page-header-right",children:[s.jsx("div",{className:"inline-flex rounded-lg border border-zinc-800/70 bg-zinc-950/60 p-1",role:"tablist","aria-label":"Report audience",children:["agency","client"].map(p=>s.jsx("button",{type:"button",role:"tab","aria-selected":a===p,onClick:()=>l(p),className:`rounded-md px-3 py-1.5 text-xs font-medium transition ${a===p?"bg-zinc-100 text-zinc-950":"text-zinc-400 hover:text-zinc-100"}`,children:p==="agency"?"Agency":"Client"},p))}),s.jsxs(be,{variant:"secondary",size:"sm",onClick:d,disabled:t,children:[s.jsx(Ov,{className:"size-4"}),t?"Preparing…":"Download report HTML"]})]})]}),a==="client"?s.jsxs(s.Fragment,{children:[s.jsx(JEe,{report:f}),s.jsx(IL,{report:f}),s.jsx(RL,{report:f,audience:"client"}),s.jsx(t_e,{report:f})]}):s.jsxs(s.Fragment,{children:[s.jsx(n_e,{report:f}),s.jsx(IL,{report:f}),s.jsx(RL,{report:f,audience:"agency"}),s.jsx(e_e,{report:f}),s.jsx(s_e,{report:f}),s.jsx(o_e,{report:f}),s.jsx(l_e,{report:f}),s.jsx(c_e,{report:f}),s.jsx(d_e,{report:f}),s.jsx(f_e,{report:f}),s.jsx(h_e,{report:f}),s.jsx(p_e,{report:f}),s.jsx(g_e,{report:f}),s.jsx(v_e,{report:f}),s.jsx(x_e,{report:f}),s.jsx(b_e,{report:f}),s.jsx(w_e,{report:f})]})]}):null}function XEe(e,t){return e.audience==="both"||e.audience===t}function JEe({report:e}){const t=e.executiveSummary;return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Client summary",title:"How you're appearing",subtitle:e.clientSummary.overview}),s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsx("p",{className:"text-sm font-medium text-zinc-100",children:e.clientSummary.headline}),s.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:e.clientSummary.overview})]}),s.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(fn,{label:"Citation coverage",value:xv(t.citationRate,0),tone:r9(t.trend),subtitle:`${t.citedQueryCount}/${t.totalQueryCount} tracked queries cited`}),s.jsx(fn,{label:"Mention coverage",value:xv(t.mentionRate,0),subtitle:`${t.mentionedQueryCount}/${t.totalQueryCount} tracked queries mentioned`}),s.jsx(fn,{label:"Providers checked",value:ft(t.providerCount),subtitle:`${ft(t.queryCount)} tracked queries`}),t.gsc&&s.jsx(fn,{label:"Search impressions",value:ft(t.gsc.impressions),subtitle:`${ft(t.gsc.clicks)} clicks`})]}),e.clientSummary.confidenceNotes.length>0&&s.jsx("div",{className:"mt-4 grid gap-2",children:e.clientSummary.confidenceNotes.map((n,r)=>s.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-3 py-2 text-xs text-zinc-400",children:n},r))})]})}function RL({report:e,audience:t}){const n=t==="client"?e.clientSummary.actionItems:e.agencyDiagnostics.priorities.length>0?e.agencyDiagnostics.priorities:e.actionPlan.filter(i=>XEe(i,t)),r=Q4(e,n);return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:t==="client"?"Client actions":"Agency actions",title:t==="client"?"What We Recommend Next":"Agency Action Plan",subtitle:t==="client"?"The short list to approve and execute.":"The highest-leverage work, sorted by urgency and evidence strength."}),r.length===0?s.jsx(Cr,{message:"No prioritized actions yet."}):s.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:r.map((i,a)=>{const l=i.evidence.length>0?i.evidence:i.why,u=i.why.length>0||i.evidence.length>0;return s.jsxs("article",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-zinc-800/80 text-sm font-semibold text-zinc-100",title:"Impact rank — 1 is the highest-leverage action",children:a+1}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"mb-2 flex flex-wrap gap-2",children:[s.jsx(Xe,{tone:Ste(i),children:F4(i.horizon)}),s.jsx(Xe,{tone:"neutral",children:Nte(i.category)}),s.jsxs(Xe,{tone:"neutral",children:[kte(i.confidence)," confidence"]})]}),s.jsx("p",{className:"text-sm font-medium text-zinc-100",children:i.title})]})]}),s.jsx("p",{className:"mt-3 text-sm text-zinc-400",children:i.action}),s.jsx(UA,{items:l,limit:3,className:"mt-3"}),u&&s.jsxs("details",{className:"mt-3 text-xs text-zinc-400",children:[s.jsx("summary",{className:"cursor-pointer text-zinc-500 hover:text-zinc-300",children:"Evidence details"}),i.why.length>0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"eyebrow-soft mb-1",children:"Why"}),s.jsx("ul",{className:"list-disc space-y-1 pl-4",children:i.why.map((d,f)=>s.jsx("li",{children:d},f))})]}),i.evidence.length>0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"eyebrow-soft mb-1",children:"Evidence"}),s.jsx("ul",{className:"list-disc space-y-1 pl-4",children:i.evidence.map((d,f)=>s.jsx("li",{children:d},f))})]})]}),s.jsxs("p",{className:"mt-3 border-t border-zinc-800/60 pt-3 text-xs text-zinc-300",children:[s.jsx("span",{className:"font-medium",children:"Win condition:"})," ",i.successMetric]})]},`${i.priority}-${i.title}`)})})]})}function e_e({report:e}){const t=e.agencyDiagnostics.diagnostics.filter(n=>n.title!=="Location caveat");return t.length===0?null:s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Agency diagnostics",title:"Technical Diagnostics",subtitle:"Fast-read operator flags behind the action plan."}),s.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:t.map(n=>s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[s.jsx(Xe,{tone:n.severity,children:n.severity}),s.jsx("p",{className:"text-sm font-medium text-zinc-100",children:n.title})]}),s.jsx("p",{className:"text-sm text-zinc-400",children:n.detail}),s.jsx(UA,{items:n.evidence,limit:3,className:"mt-3"})]},n.title))})]})}function t_e({report:e}){const t=[];e.aiSourceOrigin.topDomains.length>0&&t.push({key:"source-domains",tone:"neutral",title:"Sources AI engines trust",detail:"These domains appeared most often as cited sources outside your owned domain.",items:e.aiSourceOrigin.topDomains.slice(0,5).map(r=>`${r.domain}: ${ft(r.count)} citation${r.count===1?"":"s"}`)}),e.gsc&&t.push({key:"search-demand",tone:"neutral",title:"Search demand",detail:`Search Console shows ${ft(e.gsc.totalImpressions)} impressions and ${ft(e.gsc.totalClicks)} clicks in the report window.`,items:e.gsc.topQueries.slice(0,5).map(r=>`${r.query}: ${ft(r.impressions)} impressions`)}),e.indexingHealth&&t.push({key:"indexing",tone:e.indexingHealth.indexedPct>=90?"positive":e.indexingHealth.indexedPct>=70?"caution":"negative",title:"Indexing readiness",detail:`${e.indexingHealth.indexedPct}% of inspected URLs are indexed.`,items:[`${ft(e.indexingHealth.indexed)} indexed`,`${ft(e.indexingHealth.notIndexed)} not indexed`]});const n=W4(e);return n.length>0&&t.push({key:"content",tone:"caution",title:"Content opportunities",detail:"Canonry found topics where better content could improve AI citations.",items:n.slice(0,5).map(r=>`${r.query}: ${r.action} (${Math.round(r.score)})`)}),s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Evidence",title:"Why this is the plan",subtitle:"Concise support for the client summary. Switch to Agency for the detailed tables and matrices."}),t.length===0?s.jsx(Cr,{message:"No supporting evidence sections are populated yet."}):s.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:t.map(r=>s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[s.jsx(Xe,{tone:r.tone,children:r.tone}),s.jsx("p",{className:"text-sm font-medium text-zinc-100",children:r.title})]}),s.jsx("p",{className:"text-sm text-zinc-400",children:r.detail}),r.items.length>0&&s.jsx("ul",{className:"mt-3 list-disc space-y-1 pl-4 text-xs text-zinc-500",children:r.items.map((i,a)=>s.jsx("li",{children:i},a))})]},r.key))})]})}function n_e({report:e}){const t=e.executiveSummary,n=t.trend==="up"?"↑ Up":t.trend==="down"?"↓ Down":t.trend==="flat"?"→ Flat":"—",r=t.totalQueryCount===1?"query":"queries",i=t.totalQueryCount>0?`${t.citedQueryCount}/${t.totalQueryCount} ${r} cited`:"no queries",a=t.totalQueryCount>0?`${t.mentionedQueryCount}/${t.totalQueryCount} ${r} mentioned`:"no queries",l=`${n} · ${i} · ${t.providerCount} provider${t.providerCount===1?"":"s"}`,u=`${t.competitorCount} competitor${t.competitorCount===1?"":"s"} tracked`,d=t.totalQueryCount>0?`${t.citedQueryCount} of ${t.totalQueryCount} tracked ${r} cite ${e.meta.project.displayName}`:"No AI citation data yet",f=t.totalQueryCount>0?`${t.citationRate}% citation coverage and ${t.mentionRate}% mention coverage across ${t.providerCount} provider${t.providerCount===1?"":"s"}.`:"Run a check to populate the first citation and mention baseline.",p=e.agencyDiagnostics.priorities.length>0?e.agencyDiagnostics.priorities:e.actionPlan,m=Q4(e,p).length,g=a9(e);return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 1",title:"Executive Summary",subtitle:"Citation = source list. Mention = answer text. They are independent signals."}),s.jsxs("div",{className:"mb-4 grid gap-3 lg:grid-cols-[2fr_3fr]",children:[s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[s.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Latest AI visibility check"}),s.jsx("p",{className:"mt-2 text-lg font-semibold tracking-tight text-zinc-100",children:d}),s.jsx("p",{className:"mt-2 text-sm text-zinc-400",children:f})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:"Citation trend"}),s.jsx("p",{className:`text-xl font-semibold tracking-tight ${t.trend==="up"?"text-emerald-400":t.trend==="down"?"text-rose-400":"text-zinc-100"}`,children:n}),s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:i})]}),s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:"Mention coverage"}),s.jsxs("p",{className:"text-xl font-semibold tracking-tight text-zinc-100",children:[t.mentionRate,"%"]}),s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:a})]}),s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:"Prioritized actions"}),s.jsx("p",{className:"text-xl font-semibold tracking-tight text-zinc-100",children:ft(m)}),s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Sorted for agency follow-up."})]})]})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(fn,{label:"Citation rate",value:xv(t.citationRate,0),tone:r9(t.trend),subtitle:l}),s.jsx(fn,{label:"Mention rate",value:xv(t.mentionRate,0),subtitle:a}),s.jsx(fn,{label:"Queries tracked",value:ft(t.queryCount),subtitle:u}),t.gsc&&s.jsx(fn,{label:"GSC clicks",value:ft(t.gsc.clicks),subtitle:`${ft(t.gsc.impressions)} imp · ${LA(t.gsc.ctr)} CTR${g?` · ${g}`:""}`}),t.ga&&s.jsx(fn,{label:"GA sessions",value:ft(t.ga.sessions),subtitle:`${ft(t.ga.users)} users · ${Es(t.ga.periodStart)} → ${Es(t.ga.periodEnd)}`})]}),t.findings.length>0&&s.jsx("div",{className:"mt-5 space-y-2",children:t.findings.map((v,j)=>s.jsxs("div",{className:`insight-card rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-4 ${v.tone==="positive"?"insight-card-positive":v.tone==="caution"?"insight-card-caution":v.tone==="negative"?"insight-card-negative":""}`,children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Xe,{tone:v.tone,children:GEe[v.tone]}),s.jsx("span",{className:"text-sm font-medium text-zinc-100",children:v.title})]}),s.jsx("p",{className:"text-sm text-zinc-400",children:v.detail})]},j))}),s.jsx(a_e,{report:e})]})}const r_e=14;function $A(e){return e==="up"?"positive":e==="down"?"negative":"neutral"}function BA(e){return e==="up"?"↑":e==="down"?"↓":"→"}function _S({label:e,delta:t,unit:n}){if(!t)return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsx("p",{className:"text-2xl font-semibold tracking-tight text-zinc-500",children:"—"}),s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"No prior data"})]});const r=n==="%"?"%":"",i=t.deltaAbs>0?"+":"",a=$A(t.direction),l=a==="positive"?"text-emerald-400":a==="negative"?"text-rose-400":"text-zinc-100";return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsxs("p",{className:`text-2xl font-semibold tracking-tight ${l}`,children:[t.current,r," ",s.jsx("span",{className:"text-sm font-medium",children:BA(t.direction)})]}),s.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:[i,n==="%"?t.deltaAbs.toFixed(1):t.deltaAbs,r," vs ",t.prior,r]})]})}function DL({label:e,delta:t,countLabel:n}){if(!t)return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsx("p",{className:"text-2xl font-semibold tracking-tight text-zinc-500",children:"—"}),s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Not enough trend data"})]});const r=t.deltaAbs>0?"+":"",i=$A(t.direction),a=i==="positive"?"text-emerald-400":i==="negative"?"text-rose-400":"text-zinc-100";return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsxs("p",{className:`text-2xl font-semibold tracking-tight ${a}`,children:[ft(t.current)," ",s.jsx("span",{className:"text-sm font-medium",children:BA(t.direction)})]}),s.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:[r,ft(t.deltaAbs)," ",n," vs prior ",r_e," days"]})]})}function i_e({movements:e}){const t=e.filter(n=>n.direction!=="flat");return t.length===0?null:s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"AI engine movements"}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Engine"}),s.jsx("th",{children:"Prior"}),s.jsx("th",{children:"Current"}),s.jsx("th",{children:"Change"})]})}),s.jsx("tbody",{children:t.map(n=>{const r=n.deltaAbs>0?"+":"",i=$A(n.direction),a=i==="positive"?"text-emerald-400":i==="negative"?"text-rose-400":"text-zinc-300";return s.jsxs("tr",{children:[s.jsx("td",{children:n.provider}),s.jsxs("td",{children:[n.prior,"%"]}),s.jsxs("td",{children:[n.current,"%"]}),s.jsxs("td",{className:a,children:[r,n.deltaAbs.toFixed(1),"% ",BA(n.direction)]})]},n.provider)})})]})})]})}function ML({insights:e,heading:t,emptyMessage:n}){return e.length===0?s.jsxs("div",{className:"mt-4 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsx("p",{className:"eyebrow mb-1",children:t}),s.jsx("p",{className:"text-xs text-zinc-500",children:n})]}):s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:t}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Severity"}),s.jsx("th",{children:"Title"}),s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Provider"})]})}),s.jsx("tbody",{children:e.map(r=>s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsx(Xe,{tone:n9[r.severity],children:q4(r.severity)}),r.instanceCount>1&&s.jsxs("span",{className:"ml-2 text-[11px] text-zinc-500",children:["×",r.instanceCount]})]}),s.jsx("td",{className:"evidence-query-cell",children:r.title}),s.jsx("td",{className:"text-xs text-zinc-400",children:r.query}),s.jsx("td",{className:"text-xs text-zinc-400",children:r.provider})]},r.id))})]})})]})}function IL({report:e}){const t=e.whatsChanged;return!t.enoughHistory&&!t.gscClicksDelta&&!t.aiReferralsDelta&&t.wins.length===0&&t.regressions.length===0?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 2",title:"What's Changed",subtitle:t.headline}),s.jsx(Cr,{message:"Trends will appear after a few more checks."})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 2",title:"What's Changed",subtitle:t.headline}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-5",children:[s.jsx(_S,{label:"Citation rate",delta:t.citationRate,unit:"%"}),s.jsx(_S,{label:"Mention rate",delta:t.mentionRate,unit:"%"}),s.jsx(_S,{label:"Cited queries",delta:t.citedQueryCount,unit:"count"}),s.jsx(DL,{label:"GSC clicks",delta:t.gscClicksDelta,countLabel:"clicks"}),s.jsx(DL,{label:"AI referral sessions",delta:t.aiReferralsDelta,countLabel:"sessions"})]}),s.jsx(i_e,{movements:t.providerMovements}),s.jsx(ML,{insights:t.wins,heading:"Wins",emptyMessage:"No new gains in the latest check."}),s.jsx(ML,{insights:t.regressions,heading:"Regressions",emptyMessage:"No new regressions in the latest check."})]})}function a_e({report:e}){const t=e.meta.location,n=e.meta.providerLocationHandling;return!t&&n.length===0?null:s.jsxs("div",{className:"mt-5 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"Location handling"}),s.jsxs("p",{className:"text-sm text-zinc-300",children:[s.jsx("span",{className:"font-medium",children:"Location for this run: "}),t?i9(t):"none — providers received the queries verbatim with no geographic hint.",t&&t.otherConfiguredLabels.length>0&&s.jsxs("span",{className:"text-zinc-500",children:[" ","— other configured locations (",t.otherConfiguredLabels.join(", "),") need their own check to compare."]})]}),n.length>0&&s.jsx("div",{className:"evidence-table-wrap mt-3",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Provider"}),s.jsx("th",{children:"Treatment"}),s.jsx("th",{children:"How the location reached the model"})]})}),s.jsx("tbody",{children:n.map(r=>s.jsxs("tr",{children:[s.jsx("td",{children:r.provider}),s.jsx("td",{children:s.jsx(Xe,{tone:VEe(r.treatment),children:QEe[r.treatment]})}),s.jsx("td",{className:"text-zinc-400",children:r.description})]},r.provider))})]})})]})}function fn({label:e,value:t,tone:n,subtitle:r}){const i=n==="positive"?"text-emerald-400":n==="caution"?"text-amber-400":n==="negative"?"text-rose-400":"text-zinc-100";return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsx("p",{className:`text-2xl font-semibold tracking-tight ${i}`,children:t}),r&&s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:r})]})}function s_e({report:e}){const t=e.citationScorecard;return t.providers.length===0||t.queries.length===0?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 3",title:"Citation Scorecard",subtitle:"Per-engine citation and mention coverage from the latest check."}),s.jsx(Cr,{message:"No completed answer-visibility runs yet."})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 3",title:"Citation Scorecard",subtitle:"Per-engine citation and mention coverage from the latest check."}),s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"Provider citation rate"}),s.jsx("div",{className:"h-48 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:s.jsx(Ts,{width:"100%",height:"100%",children:s.jsxs(SN,{data:t.providerRates,layout:"vertical",margin:{left:20,right:20,top:8,bottom:8},children:[s.jsx(mc,{stroke:dd,horizontal:!1}),s.jsx(Wa,{type:"number",domain:[0,100],tick:er,stroke:Nr}),s.jsx(Ya,{type:"category",dataKey:"provider",tick:er,stroke:Nr,width:90}),s.jsx(Ms,{...da,formatter:(n,r,i)=>{const a=i?.payload;return a?`${a.citationRate}% (${a.citedCount}/${a.totalCount})`:""}}),s.jsx(gv,{dataKey:"citationRate",fill:An[0],radius:[0,4,4,0]})]})})}),s.jsx("ul",{className:"mt-2 space-y-0.5 text-[11px] text-zinc-500",children:t.providerRates.map(n=>s.jsxs("li",{children:[s.jsx("span",{className:"font-medium text-zinc-300",children:n.provider}),": ",n.citationRate,"% (",n.citedCount,"/",n.totalCount,")"]},n.provider))})]}),s.jsx("p",{className:"eyebrow mb-2",children:"Query × provider"}),s.jsxs("p",{className:"mb-2 text-[11px] text-zinc-500",children:["Each cell shows two flags —"," ",s.jsx("span",{className:"font-mono text-emerald-300",children:"C"}),"/",s.jsx("span",{className:"font-mono text-zinc-500",children:"c"})," = cited / not cited (your domain in the source list),"," ",s.jsx("span",{className:"font-mono text-emerald-300",children:"M"}),"/",s.jsx("span",{className:"font-mono text-zinc-500",children:"m"})," = mentioned / not mentioned (your brand in the answer text),"," ",s.jsx("span",{className:"font-mono text-zinc-700",children:"–"})," = no data."]}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Query"}),t.providers.map(n=>s.jsx("th",{children:n},n))]})}),s.jsx("tbody",{children:t.queries.map((n,r)=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:n}),t.providers.map((i,a)=>{const l=t.matrix[r]?.[a]??null;return s.jsx("td",{children:s.jsx(WEe,{cell:l})},i)})]},n))})]})}),s.jsx("p",{className:"mt-2 text-[11px] text-zinc-500",children:"Cited = domain in source list · Not cited = absent · Pending = run incomplete · — = no snapshot"})]})}function o_e({report:e}){const t=e.competitorLandscape,n=e.mentionLandscape,r=e.meta.project.canonicalDomain,i=t.competitors.length===0&&t.projectCitationCount===0,a=n.competitors.length===0&&n.projectMentionCount===0;if(i&&a)return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 4",title:"Competitor Landscape",subtitle:"Who AI engines cite and mention instead of the client."}),s.jsx(Cr,{message:"No competitor data yet. Add competitors and run a check."})]});const l=[{label:r,count:t.projectCitationCount,isProject:!0},...t.competitors.map(m=>({label:m.domain,count:m.citationCount,isProject:!1}))],u=[{label:r,count:n.projectMentionCount,isProject:!0},...n.competitors.map(m=>({label:m.domain,count:m.mentionCount,isProject:!1}))],d=l.length>1,f=u.length>1,p=new Map(n.competitors.map(m=>[m.domain,m]));return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 4",title:"Competitor Landscape",subtitle:"Who AI engines cite and mention instead of the client."}),s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[d&&s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow mb-2",children:"Citations per domain"}),s.jsx("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",style:{height:l.length*32+32},children:s.jsx(Ts,{width:"100%",height:"100%",children:s.jsxs(SN,{data:l,layout:"vertical",margin:{left:20,right:32,top:8,bottom:8},children:[s.jsx(mc,{stroke:dd,horizontal:!1}),s.jsx(Wa,{type:"number",tick:er,stroke:Nr}),s.jsx(Ya,{type:"category",dataKey:"label",tick:er,stroke:Nr,width:140}),s.jsx(Ms,{...da}),s.jsx(gv,{dataKey:"count",radius:[0,4,4,0],children:l.map((m,g)=>s.jsx(lv,{fill:m.isProject?"#3b82f6":An[(g+1)%An.length]},g))})]})})})]}),f&&s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow mb-2",children:"Mentions per domain"}),s.jsx("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",style:{height:u.length*32+32},children:s.jsx(Ts,{width:"100%",height:"100%",children:s.jsxs(SN,{data:u,layout:"vertical",margin:{left:20,right:32,top:8,bottom:8},children:[s.jsx(mc,{stroke:dd,horizontal:!1}),s.jsx(Wa,{type:"number",tick:er,stroke:Nr}),s.jsx(Ya,{type:"category",dataKey:"label",tick:er,stroke:Nr,width:140}),s.jsx(Ms,{...da}),s.jsx(gv,{dataKey:"count",radius:[0,4,4,0],children:u.map((m,g)=>s.jsx(lv,{fill:m.isProject?"#3b82f6":An[(g+1)%An.length]},g))})]})})})]})]}),s.jsx("p",{className:"mt-2 text-[11px] text-zinc-500",children:"Citations = domain in source list · Mentions = brand or domain in answer text — independent signals."}),t.competitors.length===0?s.jsx(Cr,{message:"No competitors configured."}):s.jsx("div",{className:"competitor-table-wrap mt-4",children:s.jsxs("table",{className:"competitor-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Domain"}),s.jsx("th",{children:"Pressure"}),s.jsx("th",{children:"Citations"}),s.jsx("th",{children:"Mentions"}),s.jsx("th",{children:"SOV"}),s.jsx("th",{children:"Cited queries"})]})}),s.jsx("tbody",{children:t.competitors.map(m=>{const g=p.get(m.domain),v=g?.mentionCount??0,j=g?.totalCount??n.totalAnswerSnapshots;return s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:m.domain}),s.jsx("td",{children:s.jsx(Xe,{tone:YEe(m.pressureLabel),children:m.pressureLabel})}),s.jsxs("td",{children:[m.citationCount," / ",m.totalCount]}),s.jsxs("td",{children:[v," / ",j]}),s.jsxs("td",{children:[m.sharePct,"%"]}),s.jsxs("td",{className:"text-xs text-zinc-400",children:[m.citedQueries.slice(0,5).join(", "),m.citedQueries.length>5?"…":"",m.theirCitedPages.length>0&&s.jsxs("details",{className:"mt-1",children:[s.jsxs("summary",{className:"cursor-pointer text-zinc-500 hover:text-zinc-300",children:[m.theirCitedPages.length," cited URL",m.theirCitedPages.length>1?"s":""]}),s.jsx("ul",{className:"mt-1 space-y-1 pl-3",children:m.theirCitedPages.map((b,S)=>s.jsxs("li",{children:[s.jsx("a",{href:b.url,className:"break-all text-blue-400 hover:underline",target:"_blank",rel:"noreferrer",children:b.url}),s.jsx("span",{className:"ml-2 text-zinc-500",children:b.citedFor.join(", ")})]},S))})]})]})]},m.domain)})})]})})]})}function l_e({report:e}){const t=e.aiSourceOrigin;if(t.categories.length===0&&t.topDomains.length===0)return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 5",title:"AI Citation Sources",subtitle:"External domains AI engines cited most in the latest check."}),s.jsx(Cr,{message:"No source data yet. Run a check first."})]});const n=t.categories.reduce((i,a)=>i+a.count,0),r=t.categories.find(i=>i.category==="competitor");return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 5",title:"AI Citation Sources",subtitle:"External domains AI engines cited most in the latest check."}),r&&s.jsxs("p",{className:"mb-3 text-sm text-zinc-300",children:[s.jsxs("span",{className:"font-semibold",children:[r.sharePct,"%"]})," of citations went to tracked competitors (",r.count," of ",n,")."]}),t.topDomains.length>0&&s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsx("p",{className:"eyebrow mb-3",children:"Top sources"}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Domain"}),s.jsx("th",{children:"Citations"}),s.jsx("th",{children:"Tag"})]})}),s.jsx("tbody",{children:t.topDomains.map(i=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell text-xs",children:i.domain}),s.jsx("td",{children:i.count}),s.jsx("td",{children:i.isCompetitor?s.jsx(Xe,{tone:"negative",children:"Tracked competitor"}):s.jsx(Xe,{tone:"neutral",children:"External"})})]},i.domain))})]})})]}),t.categories.length>0&&s.jsx("div",{className:"mt-4",children:s.jsx(wp,{heading:"By source type",rows:t.categories.map(i=>{const a=i.category==="competitor"?"#f43f5e":i.category==="directory"||i.category==="forum"?"#f59e0b":"#3b82f6";return{label:i.label,count:i.count,sharePct:i.sharePct,color:a}}),countLabel:"citations"})})]})}function a9(e){const t=e.executiveSummary.gsc,n=e.gsc,r=t?.periodStart||n?.periodStart||n?.trend[0]?.date||"",i=t?.periodEnd||n?.periodEnd||n?.trend.at(-1)?.date||"";return!r&&!i?"":r&&i?`${Es(r)} → ${Es(i)}`:Es(r||i)}function c_e({report:e}){const t=e.gsc;if(!t)return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 6",title:"GSC Performance",subtitle:"Search demand signals to compare against AI visibility."}),s.jsx(Cr,{message:"Google Search Console is not connected for this project."})]});const n=a9(e);return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 6",title:"GSC Performance",subtitle:`Search demand signals to compare against AI visibility${n?` for ${n}`:""}.`}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(fn,{label:"Clicks",value:ft(t.totalClicks)}),s.jsx(fn,{label:"Impressions",value:ft(t.totalImpressions)}),s.jsx(fn,{label:"CTR",value:LA(t.ctr)}),s.jsx(fn,{label:"Avg position",value:t.avgPosition.toFixed(1)})]}),t.trend.length>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"Clicks over time"}),s.jsx("div",{className:"h-56 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:s.jsx(Ts,{width:"100%",height:"100%",children:s.jsxs(IA,{data:t.trend,margin:{left:8,right:12,top:8,bottom:8},children:[s.jsx(mc,{stroke:dd}),s.jsx(Wa,{dataKey:"date",tick:er,stroke:Nr,tickFormatter:hd}),s.jsx(Ya,{tick:er,stroke:Nr}),s.jsx(Ms,{...da,labelFormatter:fd}),s.jsx(Kx,{type:"monotone",dataKey:"clicks",stroke:An[0],strokeWidth:2,dot:!0})]})})})]}),t.topQueries.length>0&&s.jsx(u_e,{rows:t.topQueries}),t.categoryBreakdown.length>0&&s.jsx("div",{className:"mt-4",children:s.jsx(wp,{heading:"Search demand by intent",rows:t.categoryBreakdown.map((r,i)=>({label:r.category,count:r.clicks,sharePct:r.sharePct,color:An[i%An.length]})),countLabel:"clicks"})}),(t.trackedButNoGsc.length>0||t.gscButNotTracked.length>0)&&s.jsxs("div",{className:"mt-4 grid gap-3 lg:grid-cols-2",children:[t.trackedButNoGsc.length>0&&s.jsx(LL,{title:"Tracked but no GSC impressions",tone:"caution",items:t.trackedButNoGsc}),t.gscButNotTracked.length>0&&s.jsx(LL,{title:"GSC queries not yet tracked",tone:"neutral",items:t.gscButNotTracked})]})]})}function u_e({rows:e}){return s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"Top queries"}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Clicks"}),s.jsx("th",{children:"Imp."}),s.jsx("th",{children:"CTR"}),s.jsx("th",{children:"Pos."}),s.jsx("th",{children:"Category"})]})}),s.jsx("tbody",{children:e.map(t=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:t.query}),s.jsx("td",{children:ft(t.clicks)}),s.jsx("td",{children:ft(t.impressions)}),s.jsx("td",{children:LA(t.ctr)}),s.jsx("td",{children:t.avgPosition.toFixed(1)}),s.jsx("td",{children:s.jsx(Xe,{tone:"neutral",children:t.category})})]},t.query))})]})})]})}function LL({title:e,items:t,tone:n}){return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"eyebrow",children:e}),s.jsx(Xe,{tone:n,children:t.length})]}),s.jsxs("ul",{className:"mt-2 space-y-1 text-xs text-zinc-400",children:[t.slice(0,8).map(r=>s.jsxs("li",{className:"truncate",children:["· ",r]},r)),t.length>8&&s.jsxs("li",{className:"text-zinc-600",children:["+ ",t.length-8," more"]})]})]})}function d_e({report:e}){const t=e.ga;return t?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 7",title:"GA4 Traffic",subtitle:`Site traffic from ${Es(t.periodStart)} to ${Es(t.periodEnd)}.`}),s.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-3",children:[s.jsx(fn,{label:"Sessions",value:ft(t.totalSessions)}),s.jsx(fn,{label:"Users",value:ft(t.totalUsers)}),s.jsx(fn,{label:"Organic sessions",value:ft(t.totalOrganicSessions)})]}),t.topLandingPages.length>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"Top landing pages"}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Page"}),s.jsx("th",{children:"Sessions"}),s.jsx("th",{children:"Users"}),s.jsx("th",{children:"Organic"})]})}),s.jsx("tbody",{children:t.topLandingPages.map(n=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell text-xs",children:n.page}),s.jsx("td",{children:ft(n.sessions)}),s.jsx("td",{children:ft(n.users)}),s.jsx("td",{children:ft(n.organicSessions)})]},n.page))})]})})]}),t.channelBreakdown.length>0&&s.jsx("div",{className:"mt-4",children:s.jsx(wp,{heading:"Channel mix",rows:t.channelBreakdown.map((n,r)=>({label:n.channel,count:n.sessions,sharePct:n.sharePct,color:An[r%An.length]})),countLabel:"sessions"})})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 7",title:"GA4 Traffic",subtitle:"Site traffic from the connected Google Analytics 4 property."}),s.jsx(Cr,{message:"Google Analytics 4 is not connected for this project."})]})}function f_e({report:e}){const t=e.socialReferrals;return t?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 8",title:"Social Referrals",subtitle:"Social traffic split by channel and campaign."}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[s.jsx(fn,{label:"Total sessions",value:ft(t.totalSessions)}),s.jsx(fn,{label:"Organic",value:ft(t.organicSessions)}),s.jsx(fn,{label:"Paid",value:ft(t.paidSessions)})]}),t.channels.length>0&&s.jsx("div",{className:"mt-4",children:s.jsx(wp,{heading:"Social channel mix",rows:t.channels.map((n,r)=>({label:n.channelGroup,count:n.sessions,sharePct:n.sharePct,color:An[r%An.length]})),countLabel:"sessions"})}),t.topCampaigns.length>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"Top campaigns"}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Source"}),s.jsx("th",{children:"Medium"}),s.jsx("th",{children:"Sessions"})]})}),s.jsx("tbody",{children:t.topCampaigns.map((n,r)=>s.jsxs("tr",{children:[s.jsx("td",{children:n.source}),s.jsx("td",{className:"text-xs text-zinc-400",children:n.medium}),s.jsx("td",{children:ft(n.sessions)})]},`${n.source}-${n.medium}-${r}`))})]})})]})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 8",title:"Social Referrals",subtitle:"Social traffic split by channel and campaign."}),s.jsx(Cr,{message:"No social referral data."})]})}function h_e({report:e}){const t=e.aiReferrals;return t?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 9",title:"AI Referral Traffic",subtitle:"Traffic arriving from AI answer engines."}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsx(fn,{label:"Sessions",value:ft(t.totalSessions)}),s.jsx(fn,{label:"Users",value:ft(t.totalUsers)})]}),t.trend.length>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"AI sessions trend"}),s.jsx("div",{className:"h-48 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:s.jsx(Ts,{width:"100%",height:"100%",children:s.jsxs(IA,{data:t.trend,margin:{left:8,right:12,top:8,bottom:8},children:[s.jsx(mc,{stroke:dd}),s.jsx(Wa,{dataKey:"date",tick:er,stroke:Nr,tickFormatter:hd}),s.jsx(Ya,{tick:er,stroke:Nr}),s.jsx(Ms,{...da,labelFormatter:fd}),s.jsx(Kx,{type:"monotone",dataKey:"sessions",stroke:An[0],strokeWidth:2,dot:!1})]})})})]}),t.bySource.length>0&&s.jsx("div",{className:"mt-4",children:s.jsx(wp,{heading:"AI sessions by source",rows:t.bySource.map((n,r)=>({label:n.source,count:n.sessions,sharePct:n.sharePct,color:An[(r+2)%An.length]})),countLabel:"sessions"})}),t.topLandingPages.length>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"Top AI landing pages"}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Page"}),s.jsx("th",{children:"Sessions"}),s.jsx("th",{children:"Users"})]})}),s.jsx("tbody",{children:t.topLandingPages.map(n=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell text-xs",children:n.page}),s.jsx("td",{children:ft(n.sessions)}),s.jsx("td",{children:ft(n.users)})]},n.page))})]})})]})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 9",title:"AI Referral Traffic",subtitle:"Traffic arriving from AI answer engines."}),s.jsx(Cr,{message:"No AI referral data."})]})}function p_e({report:e}){const t=e.indexingHealth;if(!t||!t.provider)return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 10",title:"Indexing Health",subtitle:"Connect Google Search Console or Bing Webmaster Tools to populate this section."}),s.jsx(Cr,{message:"No indexing data — connect Google Search Console or Bing Webmaster Tools."})]});const n=`Pages absent from ${t.provider==="google"?"Google":"Bing"} are harder for AI engines to retrieve.`;return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 10",title:"Indexing Health",subtitle:n}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[s.jsx(fn,{label:"Indexed",value:ft(t.indexed),tone:"positive"}),s.jsx(fn,{label:"Total inspected",value:ft(t.total)}),s.jsx(fn,{label:"Indexed share",value:`${t.indexedPct}%`})]}),s.jsx(m_e,{ih:t})]})}function m_e({ih:e}){const t=[{label:"Indexed",count:e.indexed,color:"#10b981"},{label:"Not indexed",count:e.notIndexed,color:"#f59e0b"},{label:"Deindexed",count:e.deindexed,color:"#f43f5e"},{label:"Unknown",count:e.unknown,color:"#71717a"}].filter(r=>r.count>0),n=t.reduce((r,i)=>r+i.count,0)||1;return t.length===0?null:s.jsxs("div",{className:"mt-4 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsx("p",{className:"eyebrow mb-3",children:"Coverage breakdown"}),s.jsx("div",{className:"flex h-7 w-full overflow-hidden rounded-md",children:t.map(r=>s.jsx("div",{style:{width:`${r.count/n*100}%`,background:r.color},title:`${r.label}: ${r.count}`},r.label))}),s.jsx("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-2 text-xs text-zinc-400",children:t.map(r=>s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx("span",{className:"inline-block size-2.5 rounded-sm",style:{background:r.color}}),s.jsxs("span",{className:"text-zinc-300",children:[r.label,":"]}),s.jsx("span",{className:"tabular-nums text-zinc-100",children:r.count})]},r.label))})]})}function g_e({report:e}){const t=e.citationsTrend;return t.length===0?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 11",title:"Citations Over Time",subtitle:"Citation coverage across recent checks."}),s.jsx(Cr,{message:"Run multiple checks to see a trend."})]}):KEe(t)?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 11",title:"Citations Over Time",subtitle:"Citation coverage across recent checks."}),s.jsx(Cr,{message:`Building baseline (${t.length} of ${t9} checks completed). Trend will appear once more checks are recorded.`})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 11",title:"Citations Over Time",subtitle:"Citation coverage across recent checks."}),s.jsx("div",{className:"h-64 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:s.jsx(Ts,{width:"100%",height:"100%",children:s.jsxs(IA,{data:t,margin:{left:8,right:12,top:8,bottom:8},children:[s.jsx(mc,{stroke:dd}),s.jsx(Wa,{dataKey:"date",tick:er,stroke:Nr,tickFormatter:hd}),s.jsx(Ya,{tick:er,stroke:Nr,domain:[0,100],tickFormatter:n=>`${n}%`}),s.jsx(Ms,{...da,labelFormatter:fd,formatter:n=>`${n}%`}),s.jsx(Kx,{type:"monotone",dataKey:"citationRate",stroke:An[0],strokeWidth:2,dot:!0})]})})}),s.jsx(y_e,{trend:t})]})}function y_e({trend:e}){return e.length===0?null:s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"Check-by-check breakdown"}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Check"}),s.jsx("th",{children:"Cited queries"}),s.jsx("th",{children:"Per-engine rates"})]})}),s.jsx("tbody",{children:e.map(t=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:Es(t.date)}),s.jsxs("td",{children:[t.citationRate,"% ",s.jsxs("span",{className:"text-zinc-500",children:["(",t.citedQueryCount,"/",t.totalQueryCount,")"]})]}),s.jsx("td",{className:"text-xs text-zinc-400",children:t.providerRates.map(n=>`${n.provider}: ${n.citationRate}%`).join(" · ")})]},t.runId))})]})})]})}function v_e({report:e}){return e.insights.length===0?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 12",title:"Insights & Alerts",subtitle:"Regressions, gains, and recurring alerts ordered by severity."}),s.jsx(Cr,{message:"No active insights — everything looks stable."})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 12",title:"Insights & Alerts",subtitle:"Regressions, gains, and recurring alerts ordered by severity."}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Severity"}),s.jsx("th",{children:"Title"}),s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Provider"}),s.jsx("th",{children:"Recommendation"})]})}),s.jsx("tbody",{children:e.insights.map(t=>s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsx(Xe,{tone:n9[t.severity],children:q4(t.severity)}),t.instanceCount>1&&s.jsxs("span",{className:"ml-2 text-[11px] text-zinc-500",children:["×",t.instanceCount]})]}),s.jsx("td",{className:"evidence-query-cell",children:t.title}),s.jsx("td",{className:"text-xs text-zinc-400",children:t.query}),s.jsx("td",{className:"text-xs text-zinc-400",children:t.provider}),s.jsx("td",{className:"text-xs text-zinc-400",children:t.recommendation??"—"})]},t.id))})]})})]})}function x_e({report:e}){const t=W4(e);if(t.length===0)return null;const n=e.meta.project.canonicalDomain,r=t.slice(0,3);return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 13",title:"Content Opportunities",subtitle:"Queries where content work has the clearest path to more AI citations. Opportunity score is 0–100, higher = stronger."}),s.jsx("div",{className:"mb-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:r.map(i=>s.jsxs("article",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsxs("div",{className:"text-2xl font-semibold tracking-tight text-zinc-100",title:"Opportunity score (0–100, higher = stronger)",children:[Math.round(i.score),s.jsx("span",{className:"ml-0.5 text-sm font-normal text-zinc-500",children:"/100"})]}),s.jsx("p",{className:"mt-2 text-sm font-medium text-zinc-100",children:i.query}),s.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[iT(i.action)," · ",aT(i.actionConfidence)," confidence"]}),s.jsx(UA,{items:i.drivers,limit:2,className:"mt-3"})]},i.targetRef))}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Action"}),s.jsx("th",{title:"Opportunity score (0–100)",children:"Score"}),s.jsx("th",{children:"Why"}),s.jsx("th",{children:"Our page"}),s.jsx("th",{children:"Winning competitor"}),s.jsx("th",{children:"Confidence"})]})}),s.jsx("tbody",{children:t.slice(0,10).map(i=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:i.query}),s.jsx("td",{children:s.jsx(Xe,{tone:"neutral",children:iT(i.action)})}),s.jsx("td",{title:"Opportunity score (0–100)",children:Math.round(i.score)}),s.jsx("td",{className:"text-xs text-zinc-400",children:i.drivers.length>0?s.jsx("ul",{className:"list-disc pl-4 space-y-0.5",children:i.drivers.map((a,l)=>s.jsx("li",{children:a},l))}):s.jsx("span",{className:"text-zinc-600",children:"No driver signal yet"})}),s.jsx("td",{className:"text-xs",children:i.ourBestPage?s.jsx("a",{href:vte(i.ourBestPage.url,n),target:"_blank",rel:"noreferrer",className:"text-blue-400 hover:underline break-all",children:i.ourBestPage.url}):s.jsx("span",{className:"text-zinc-600",children:"No page yet"})}),s.jsx("td",{className:"text-xs",children:i.winningCompetitor?s.jsx("a",{href:i.winningCompetitor.url,target:"_blank",rel:"noreferrer",className:"text-blue-400 hover:underline",children:i.winningCompetitor.domain}):s.jsx("span",{className:"text-zinc-600",children:"—"})}),s.jsx("td",{children:s.jsx(Xe,{tone:"neutral",children:aT(i.actionConfidence)})})]},i.targetRef))})]})})]})}function b_e({report:e}){return e.contentGaps.length===0?null:s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 14",title:"Content Gaps",subtitle:"Tracked queries where competitors are cited and the client is missing."}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Competitors cited"}),s.jsx("th",{children:"Domains"}),s.jsx("th",{children:"Miss rate"})]})}),s.jsx("tbody",{children:e.contentGaps.slice(0,10).map(t=>{const n=t.competitorDomains.slice(0,5),r=t.competitorDomains.length-n.length;return s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:t.query}),s.jsx("td",{children:t.competitorCount}),s.jsxs("td",{className:"text-xs text-zinc-400",children:[n.join(", "),r>0?`, +${r} more`:""]}),s.jsxs("td",{children:[Math.round(t.missRate*100),"%"]})]},t.query)})})]})})]})}function w_e({report:e}){return e.recommendedNextSteps.length===0?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 15",title:"Recommended Next Steps",subtitle:"Action items bucketed by timing."}),s.jsx(Cr,{message:"No prioritized actions yet."})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 15",title:"Recommended Next Steps",subtitle:"Action items bucketed by timing."}),s.jsx("div",{className:"space-y-2",children:e.recommendedNextSteps.map((t,n)=>s.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-3 py-2.5",children:[s.jsx("span",{className:"shrink-0 rounded-md border border-zinc-800/60 bg-zinc-950/40 px-2 py-0.5 text-[11px] uppercase tracking-wide text-zinc-400",children:F4(t.horizon)}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"text-sm font-medium text-zinc-100",children:t.title}),s.jsx("p",{className:"text-xs text-zinc-500",children:t.rationale})]})]},n))})]})}function At({eyebrow:e,title:t,subtitle:n}){return s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsx("h2",{className:"page-title",children:t}),n&&s.jsx("p",{className:"page-subtitle mt-1",children:n})]})}function UA({items:e,limit:t=3,className:n}){if(e.length===0)return null;const r=e.slice(0,t),i=e.length-r.length;return s.jsxs("div",{className:`flex flex-wrap gap-1.5 ${n??""}`,children:[r.map((a,l)=>s.jsx("span",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/40 px-2 py-0.5 text-[11px] text-zinc-300",children:a},l)),i>0&&s.jsxs("span",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/40 px-2 py-0.5 text-[11px] text-zinc-400",children:["+",i," more"]})]})}function wp({heading:e,rows:t,countLabel:n}){const r=t.filter(i=>i.count>0||i.sharePct>0);return r.length===0?null:s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsx("p",{className:"eyebrow mb-3",children:e}),s.jsx("div",{className:"space-y-2",children:r.map((i,a)=>{const l=Math.max(0,Math.min(100,i.sharePct)),u=i.color??An[a%An.length];return s.jsxs("div",{className:"grid grid-cols-[160px_1fr_auto] items-center gap-3",children:[s.jsx("div",{className:"truncate text-xs text-zinc-400",children:i.label}),s.jsx("div",{className:"h-2 rounded-sm bg-zinc-800",children:s.jsx("div",{className:"h-full rounded-sm",style:{width:`${l.toFixed(1)}%`,background:u}})}),s.jsxs("div",{className:"text-right text-xs tabular-nums text-zinc-200",children:[ft(i.count)," ",s.jsxs("span",{className:"text-zinc-500",children:[n," · ",i.sharePct,"%"]})]})]},i.label)})})]})}function Cr({message:e}){return s.jsx("p",{className:"text-sm text-zinc-500 py-4 text-center",children:e})}function j_e({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=x.useState(!1),[a,l]=x.useState(!1),[u,d]=x.useState(null),[f,p]=x.useState(e.displayName),[m,g]=x.useState(e.canonicalDomain),[v,j]=x.useState(e.country),[b,S]=x.useState(e.language),[k,E]=x.useState(e.ownedDomains??[]),[C,A]=x.useState(""),[T,O]=x.useState(null),[_,P]=x.useState(!1),[$,F]=x.useState(!1),[U,B]=x.useState(""),[V,X]=x.useState(""),[Z,H]=x.useState(""),[J,oe]=x.useState(""),[ye,I]=x.useState("");x.useEffect(()=>{r||(p(e.displayName),g(e.canonicalDomain),j(e.country),S(e.language),E(e.ownedDomains??[]))},[e,r]);function M(){i(!1),d(null),p(e.displayName),g(e.canonicalDomain),j(e.country),S(e.language),E(e.ownedDomains??[]),A("")}function q(){const Y=C.trim();Y&&(k.includes(Y)||E([...k,Y]),A(""))}function D(Y){E(k.filter(He=>He!==Y))}async function G(){if(!(!f.trim()||!m.trim()||!v.trim()||!b.trim())){l(!0),d(null);try{await t(e.name,{displayName:f.trim(),canonicalDomain:m.trim(),ownedDomains:k,country:v.trim(),language:b.trim()}),i(!1),vt({title:"Project settings saved",detail:`${f.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(Y){d(Y instanceof Error?Y.message:"Failed to save")}finally{l(!1)}}}async function se(){const Y=U.trim(),He=V.trim(),Pe=Z.trim(),at=J.trim();if(!(!Y||!He||!Pe||!at)){P(!0),O(null);try{const Ve={label:Y,city:He,region:Pe,country:at};ye.trim()&&(Ve.timezone=ye.trim()),await hV(e.name,Ve),n(),B(""),X(""),H(""),oe(""),I(""),F(!1),vt({title:"Location added",detail:`${Y} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${Y}`,dedupeMode:"drop"})}catch(Ve){O(Ve instanceof Error?Ve.message:"Failed to add location")}finally{P(!1)}}}async function ne(Y){P(!0),O(null);try{await pV(e.name,Y),n(),vt({title:"Location removed",detail:`${Y} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${Y}`,dedupeMode:"drop"})}catch(He){O(He instanceof Error?He.message:"Failed to remove location")}finally{P(!1)}}async function Ce(Y){P(!0),O(null);try{await mV(e.name,Y),n(),vt({title:"Default location updated",detail:`${Y} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(He){O(He instanceof Error?He.message:"Failed to set default location")}finally{P(!1)}}const Se=f!==e.displayName||m!==e.canonicalDomain||v!==e.country||b!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),ee="w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",pe="block text-xs font-medium text-zinc-400 mb-1",Ee=U.trim()&&V.trim()&&Z.trim()&&J.trim();return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),s.jsx("h2",{children:"Project settings"})]}),!r&&s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!0),children:"Edit settings"})]}),u&&s.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[u,s.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>d(null),children:"×"})]}),r?s.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:pe,children:"Display name"}),s.jsx("input",{className:ee,type:"text",value:f,onChange:Y=>p(Y.target.value),placeholder:"My Project"})]}),s.jsxs("div",{children:[s.jsx("label",{className:pe,children:"Canonical domain"}),s.jsx("input",{className:ee,type:"text",value:m,onChange:Y=>g(Y.target.value),placeholder:"example.com"})]}),s.jsxs("div",{children:[s.jsx("label",{className:pe,children:"Country"}),s.jsx("input",{className:ee,type:"text",value:v,onChange:Y=>j(Y.target.value),placeholder:"US",maxLength:2})]}),s.jsxs("div",{children:[s.jsx("label",{className:pe,children:"Language"}),s.jsx("input",{className:ee,type:"text",value:b,onChange:Y=>S(Y.target.value),placeholder:"en"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:pe,children:"Owned domains"}),s.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(Y=>s.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[Y,s.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>D(Y),"aria-label":`Remove ${Y}`,children:"×"})]},Y))}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{className:`${ee} flex-1`,type:"text",placeholder:"docs.example.com",value:C,onChange:Y=>A(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&(Y.preventDefault(),q())}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:!C.trim(),onClick:q,children:"Add"})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[s.jsx(be,{type:"button",disabled:a||!Se||!f.trim()||!m.trim(),onClick:G,children:a?"Saving...":"Save changes"}),s.jsx(be,{type:"button",variant:"outline",disabled:a,onClick:M,children:"Cancel"})]})]}):s.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:s.jsx("table",{className:"w-full text-sm",children:s.jsxs("tbody",{children:[s.jsxs("tr",{className:"border-b border-zinc-800/40",children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),s.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),s.jsxs("tr",{className:"border-b border-zinc-800/40",children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),s.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),s.jsxs("tr",{className:"border-b border-zinc-800/40",children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),s.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?s.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(Y=>s.jsx("span",{className:"rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:Y},Y))}):s.jsx("span",{className:"text-zinc-500",children:"—"})})]}),s.jsxs("tr",{className:"border-b border-zinc-800/40",children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),s.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),s.jsxs("tr",{className:"border-b border-zinc-800/40",children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),s.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),s.jsxs("td",{className:"px-4 py-2.5",children:[T&&s.jsxs("div",{className:"mb-2 rounded border border-rose-800/40 bg-rose-950/20 px-2 py-1 text-xs text-rose-300",children:[T,s.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>O(null),children:"×"})]}),(e.locations??[]).length>0?s.jsxs("table",{className:"w-full text-xs mb-2",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"text-zinc-600",children:[s.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),s.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),s.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),s.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),s.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),s.jsx("th",{className:"pb-1"})]})}),s.jsx("tbody",{children:e.locations.map(Y=>s.jsxs("tr",{className:"border-t border-zinc-800/30",children:[s.jsx("td",{className:"py-1.5 pr-3",children:s.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${Y.label===e.defaultLocation?"border-emerald-700/60 bg-emerald-950/30 text-emerald-300":"border-zinc-700/60 bg-zinc-800/40 text-zinc-300"}`,children:[Y.label,Y.label===e.defaultLocation?" ★":""]})}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Y.city}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Y.region}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Y.country}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:Y.timezone??"—"}),s.jsx("td",{className:"py-1.5",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[Y.label!==e.defaultLocation&&s.jsx("button",{type:"button",disabled:_,onClick:()=>Ce(Y.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${Y.label} as default location`,children:"Set default"}),s.jsx("button",{type:"button",disabled:_,onClick:()=>ne(Y.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${Y.label}`,children:"Remove"})]})})]},Y.label))})]}):s.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),$?s.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[s.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),s.jsx("input",{className:ee,type:"text",value:U,onChange:Y=>B(Y.target.value),placeholder:"nyc"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),s.jsx("input",{className:ee,type:"text",value:V,onChange:Y=>X(Y.target.value),placeholder:"New York"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),s.jsx("input",{className:ee,type:"text",value:Z,onChange:Y=>H(Y.target.value),placeholder:"NY"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),s.jsx("input",{className:ee,type:"text",value:J,onChange:Y=>oe(Y.target.value),placeholder:"US",maxLength:2})]}),s.jsxs("div",{className:"col-span-2",children:[s.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),s.jsx("input",{className:ee,type:"text",value:ye,onChange:Y=>I(Y.target.value),placeholder:"America/New_York"})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[s.jsx(be,{type:"button",size:"sm",disabled:_||!Ee,onClick:se,children:_?"Adding...":"Add location"}),s.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:_,onClick:()=>{F(!1),O(null)},children:"Cancel"})]})]}):s.jsx(be,{type:"button",size:"sm",variant:"outline",onClick:()=>F(!0),children:"+ Add location"})]})]})]})})})]})}const S_e=[{value:"daily",label:"Every day"},{value:"weekly@mon",label:"Every Monday"},{value:"weekly@wed",label:"Every Wednesday"},{value:"weekly@fri",label:"Every Friday"},{value:"twice-daily",label:"Twice a day (6am & 6pm)"},{value:"custom",label:"Custom cron expression"}],$L=["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 N_e({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[a,l]=x.useState("daily"),[u,d]=x.useState(6),[f,p]=x.useState(""),[m,g]=x.useState("UTC"),[v,j]=x.useState(!1),[b,S]=x.useState(""),[k,E]=x.useState(!1),[C,A]=x.useState(!1),[T,O]=x.useState(null);x.useEffect(()=>{SV(e).then(n).catch(()=>n(null))},[e]);const _=()=>{if(t&&t!=="loading"){const U=Ute(t.preset??null,t.cronExpr);l(U.freq),d(U.hour),p(U.customCron);const B=$L.includes(t.timezone);g(B?t.timezone:"Other"),j(!B),S(B?"":t.timezone)}else l("daily"),d(6),p(""),g("UTC"),j(!1),S("");O(null),i(!0)},P=async()=>{E(!0),O(null);try{const B={timezone:v?b.trim()||"UTC":m};a==="custom"?B.cron=f.trim():B.preset=Bte(a,u);const V=await S2(e,B);n(V),i(!1),vt({title:"Schedule saved",detail:Sw(V.preset??null,V.cronExpr,V.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(U){O(U instanceof Error?U.message:"Failed to save schedule")}finally{E(!1)}},$=async()=>{if(!(!t||t==="loading")){E(!0),O(null);try{const U={timezone:t.timezone,enabled:!t.enabled};t.preset?U.preset=t.preset:U.cron=t.cronExpr;const B=await S2(e,U);n(B),vt({title:B.enabled?"Schedule resumed":"Schedule paused",detail:Sw(B.preset??null,B.cronExpr,B.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(U){O(U instanceof Error?U.message:"Failed to update schedule")}finally{E(!1)}}},F=async()=>{A(!0),O(null);try{await NV(e),n(null),i(!1),vt({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch(U){O(U instanceof Error?U.message:"Failed to remove schedule")}finally{A(!1)}};return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),s.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!r&&s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:_,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&s.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&s.jsx($e,{className:"surface-card compact-card",children:s.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!r&&t!==null&&s.jsxs($e,{className:"surface-card compact-card",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Sw(t.preset??null,t.cronExpr,t.timezone)}),s.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",s.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&s.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&s.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsx(Xe,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:$,children:t.enabled?"Pause":"Resume"}),s.jsx(be,{type:"button",variant:"ghost",size:"sm",disabled:C,onClick:F,children:C?"Removing...":"Remove"})]})]}),T&&s.jsx("p",{className:"text-rose-400 text-sm mt-2",children:T})]}),r&&s.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),s.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:a,onChange:U=>l(U.target.value),children:S_e.map(U=>s.jsx("option",{value:U.value,children:U.label},U.value))})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),s.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none disabled:opacity-40",value:u,disabled:a==="twice-daily"||a==="custom",onChange:U=>d(parseInt(U.target.value)),children:Array.from({length:24},(U,B)=>s.jsx("option",{value:B,children:t1(B)},B))})]})]}),a==="custom"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),s.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 font-mono focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"0 9 * * 1-5",value:f,onChange:U=>p(U.target.value)})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),s.jsxs("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:v?"Other":m,onChange:U=>{U.target.value==="Other"?(j(!0),g("Other")):(j(!1),g(U.target.value))},children:[$L.map(U=>s.jsx("option",{value:U,children:U},U)),s.jsxs("option",{value:"Other",children:["Other (enter manually)","…"]})]}),v&&s.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"e.g. America/New_York",value:b,onChange:U=>S(U.target.value)})]}),T&&s.jsx("p",{className:"text-rose-400 text-sm",children:T}),s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),O(null)},children:"Cancel"}),s.jsx(be,{type:"button",size:"sm",disabled:k||a==="custom"&&!f.trim(),onClick:P,children:k?"Saving...":"Save schedule"})]})]})]})}const k_e=[{value:"citation.lost",label:"Citation lost"},{value:"citation.gained",label:"Citation gained"},{value:"run.completed",label:"Run completed"},{value:"run.failed",label:"Run failed"}];function C_e({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[a,l]=x.useState(""),[u,d]=x.useState(["citation.lost","citation.gained"]),[f,p]=x.useState(!1),[m,g]=x.useState(null),[v,j]=x.useState({}),[b,S]=x.useState(new Set);x.useEffect(()=>{kV(e).then(n).catch(()=>n([]))},[e]);const k=T=>{d(O=>O.includes(T)?O.filter(_=>_!==T):[...O,T])},E=async()=>{if(!(!a.trim()||u.length===0)){p(!0),g(null);try{const T=await CV(e,{channel:"webhook",url:a.trim(),events:u});n(O=>O==="loading"?[T]:[...O,T]),l(""),d(["citation.lost","citation.gained"]),i(!1),vt({title:"Webhook added",detail:`Notifications will be sent to ${T.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(T){g(T instanceof Error?T.message:"Failed to add webhook")}finally{p(!1)}}},C=async T=>{if(!b.has(T)){S(O=>new Set(O).add(T));try{await AV(e,T),n(O=>O==="loading"?O:O.filter(_=>_.id!==T)),vt({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${T}`,dedupeMode:"drop"})}catch(O){g(O instanceof Error?O.message:"Failed to remove webhook")}finally{S(O=>{const _=new Set(O);return _.delete(T),_})}}},A=async T=>{j(O=>({...O,[T]:{state:"testing"}}));try{const O=await OV(e,T);j(_=>({..._,[T]:{state:O.ok?"ok":"fail",status:O.status}})),O.ok&&vt({title:"Test notification sent",detail:`Webhook returned status ${O.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${T}`,dedupeMode:"replace"})}catch{j(O=>({...O,[T]:{state:"fail"}}))}};return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),s.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),g(null)},children:r?"Cancel":"+ Add webhook"})]}),r&&s.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),s.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://hooks.example.com/canonry",value:a,onChange:T=>l(T.target.value)})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),s.jsx("div",{className:"flex flex-wrap gap-3",children:k_e.map(T=>s.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:u.includes(T.value),onChange:()=>k(T.value)}),s.jsx("span",{className:"text-sm text-zinc-300",children:T.label})]},T.value))})]}),m&&s.jsx("p",{className:"text-rose-400 text-sm",children:m}),s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),g(null)},children:"Cancel"}),s.jsx(be,{type:"button",size:"sm",disabled:f||!a.trim()||u.length===0,onClick:E,children:f?"Adding...":"Add webhook"})]})]}),t==="loading"&&s.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&s.jsx($e,{className:"surface-card compact-card",children:s.jsx("p",{className:"supporting-copy",children:"No webhooks configured. Add one to get alerted when citations change or runs complete."})}),t!=="loading"&&t.length>0&&s.jsxs("div",{className:"evidence-table-wrap",children:[s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Endpoint"}),s.jsx("th",{children:"Events"}),s.jsx("th",{children:"Status"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:t.map(T=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:s.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:T.urlHost,children:T.urlDisplay??T.url})}),s.jsx("td",{children:s.jsx("div",{className:"flex flex-wrap gap-1",children:T.events.map(O=>s.jsx("span",{className:"inline-flex items-center rounded-full border border-zinc-700 bg-zinc-800/60 px-2 py-0.5 text-[10px] font-medium text-zinc-400 uppercase tracking-wide",children:O.replace("."," ")},O))})}),s.jsx("td",{children:s.jsx(Xe,{tone:T.enabled?"positive":"neutral",children:T.enabled?"Active":"Paused"})}),s.jsx("td",{children:s.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[v[T.id]&&(()=>{const O=v[T.id],_=O.state==="testing"?"Sending…":O.state==="ok"?`Delivered${O.status?` (${O.status})`:""}`:`Failed${O.status?` (${O.status})`:""}`;return s.jsx(Xe,{tone:O.state==="ok"?"positive":O.state==="fail"?"negative":"neutral",children:_})})(),s.jsx(be,{variant:"ghost",size:"sm",type:"button",disabled:v[T.id]?.state==="testing",onClick:()=>A(T.id),children:"Test"}),s.jsx(be,{variant:"ghost",size:"sm",type:"button",disabled:b.has(T.id),onClick:()=>C(T.id),children:b.has(T.id)?"Removing…":"Remove"})]})})]},T.id))})]}),m&&s.jsx("p",{className:"text-rose-400 text-sm mt-2",children:m})]})]})}function A_e({projectName:e,refreshNonce:t}){const n=xi(),[r,i]=x.useState(null),[a,l]=x.useState([]),[u,d]=x.useState(null),[f,p]=x.useState([]),[m,g]=x.useState([]),[v,j]=x.useState(null),[b,S]=x.useState(""),[k,E]=x.useState(""),[C,A]=x.useState(""),[T,O]=x.useState(!0),[_,P]=x.useState(!1),[$,F]=x.useState(null),[U,B]=x.useState("coverage");x.useEffect(()=>{V()},[e,t]);async function V(){O(!0),F(null);try{const M=await n.fetchQuery({queryKey:qe.bing.status(e),queryFn:()=>P5(e),staleTime:jr});if(i(M),M.connected){const[q,D,G,se]=await Promise.all([n.fetchQuery({queryKey:qe.bing.coverage(e),queryFn:()=>WN(e).catch(()=>null),staleTime:jr}),n.fetchQuery({queryKey:qe.bing.inspections(e),queryFn:()=>R5(e).catch(()=>[]),staleTime:jr}),n.fetchQuery({queryKey:qe.bing.performance(e),queryFn:()=>YV(e).catch(()=>[]),staleTime:jr}),M.siteUrl?Promise.resolve([]):n.fetchQuery({queryKey:qe.bing.sites(e),queryFn:()=>QV(e).then(ne=>ne.sites).catch(()=>[]),staleTime:jr})]);d(q),p(D),g(G),l(se)}else d(null),p([]),g([]),l([])}catch(M){F(M instanceof Error?M.message:"Failed to load Bing data")}finally{O(!1)}}async function X(){if(k.trim()){F(null);try{const M=await GV(e,k.trim());await n.invalidateQueries({queryKey:qe.bing.project(e)}),E(""),M.availableSites.length>0&&l(M.availableSites),await V()}catch(M){F(M instanceof Error?M.message:"Failed to connect")}}}async function Z(){try{await VV(e),await n.invalidateQueries({queryKey:qe.bing.project(e)}),i(null),l([]),d(null),p([]),g([]),j(null),A(""),F(null)}catch(M){F(M instanceof Error?M.message:"Failed to disconnect")}}async function H(){if(C)try{await WV(e,C),await n.invalidateQueries({queryKey:qe.bing.project(e)}),await V()}catch(M){F(M instanceof Error?M.message:"Failed to set site")}}async function J(){if(b.trim())try{const M=await D5(e,b.trim());await n.invalidateQueries({queryKey:qe.bing.project(e)}),j(M),p(q=>[M,...q])}catch(M){F(M instanceof Error?M.message:"Inspection failed")}}async function oe(M){P(!0),F(null);try{const q=await C2(e,{urls:[M]}),{succeeded:D,failed:G,total:se}=q.summary;vt({title:"Bing submission requested",detail:G===0?`${D} URL submitted to Bing.`:`${D}/${se} submitted successfully, ${G} failed.`,tone:G===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${M}`,dedupeMode:"replace"})}catch(q){const D=q instanceof Error?q.message:"Submission failed";F(D),vt({title:"Bing submission failed",detail:D,tone:"negative",dedupeKey:`bing:indexing:${e}:${M}`,dedupeMode:"replace"})}finally{P(!1)}}async function ye(){P(!0),F(null),vt({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const M=await C2(e,{allUnindexed:!0}),{succeeded:q,failed:D,total:G}=M.summary;vt({title:"Bing submissions requested",detail:D===0?`${q}/${G} URL${G!==1?"s":""} submitted to Bing.`:`${q}/${G} submitted successfully, ${D} failed.`,tone:D===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(M){const q=M instanceof Error?M.message:"Batch submission failed";F(q),vt({title:"Bing submissions failed",detail:q,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{P(!1)}}if(T)return s.jsx($e,{className:"surface-card",children:s.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!r?.connected)return s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),s.jsx("h3",{children:"Domain authorization"})]}),s.jsx(Xe,{tone:"caution",children:"Not connected"})]}),s.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),s.jsxs("div",{className:"mt-3",children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[s.jsx("input",{id:"bing-api-key",type:"password",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:k,onChange:M=>E(M.target.value),onKeyDown:M=>M.key==="Enter"&&X()}),s.jsx(be,{size:"sm",disabled:!k.trim(),onClick:X,children:"Connect"})]}),s.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",s.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]})]}),$&&s.jsx("p",{className:"mt-3 text-xs text-rose-400",children:$})]});if(!r.siteUrl)return s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),s.jsx("h3",{children:"Domain authorization"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Xe,{tone:"positive",children:"Connected"}),s.jsx(be,{size:"sm",variant:"ghost",onClick:Z,children:"Disconnect"})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),s.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),s.jsx("span",{className:"text-xs text-zinc-500",children:r.domain})]}),s.jsx("p",{className:"mt-2 text-xs text-zinc-500",children:"The API key is connected, but no Bing site is selected yet. Pick the verified site that should receive inspections and indexing requests."})]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.domain})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.updatedAt?sa(r.updatedAt):"—"})]})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),a.length>0?s.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[s.jsxs("select",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:C,onChange:M=>A(M.target.value),children:[s.jsx("option",{value:"",children:"Select a site..."}),a.map(M=>s.jsxs("option",{value:M.url,children:[M.url,M.verified?" (verified)":""]},M.url))]}),s.jsx(be,{size:"sm",disabled:!C,onClick:H,children:"Set Site"})]}):s.jsx("p",{className:"mt-3 text-xs text-zinc-500",children:"No verified Bing sites are available yet. Verify the domain in Bing Webmaster Tools, then use the page-level refresh to reload everything."})]})]}),$&&s.jsx("p",{className:"mt-3 text-xs text-rose-400",children:$})]});const I=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return s.jsxs("div",{className:"space-y-3",children:[s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),s.jsx("h3",{children:"Domain authorization"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Xe,{tone:"positive",children:"Connected"}),s.jsx(be,{size:"sm",variant:"ghost",onClick:Z,children:"Disconnect"})]})]}),$&&s.jsx("p",{className:"mb-3 text-xs text-rose-400",children:$}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),s.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),s.jsx("span",{className:"text-xs text-zinc-500",children:r.domain})]}),s.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",s.jsx("code",{children:r.siteUrl}),"."]})]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.siteUrl})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.updatedAt?sa(r.updatedAt):"—"})]})]})]})]}),s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),s.jsx("h3",{children:"Index monitoring"})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:u?.lastInspectedAt?`Last inspected ${sa(u.lastInspectedAt)}`:"No inspection history yet"})]}),s.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:I.map(M=>s.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${U===M.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>B(M.key),children:M.label},M.key))}),U==="coverage"&&u&&s.jsxs("div",{className:"mt-4 space-y-4",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[s.jsx(cg,{label:"Indexed",value:u.summary.indexed,tone:"positive"}),s.jsx(cg,{label:"Not in index",value:u.summary.notIndexed+(u.summary.unknown??0),tone:"negative"}),s.jsx(cg,{label:"Status unknown",value:u.summary.unknown??0,tone:"neutral"}),s.jsx(cg,{label:"Coverage",value:`${u.summary.percentage}%`,tone:"neutral"})]}),u.notIndexed.length>0&&s.jsxs("div",{children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[s.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",u.notIndexed.length,")"]}),s.jsx(be,{size:"sm",variant:"ghost",disabled:_,onClick:ye,children:_?"Submitting…":"Submit all to Bing"})]}),s.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800",children:[s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),s.jsx("tbody",{children:u.notIndexed.map(M=>s.jsxs("tr",{className:"border-b border-zinc-800/50",children:[s.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.url}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:M.httpCode??"—"}),s.jsx("td",{className:"py-1.5 px-3 text-right",children:s.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:_,onClick:()=>oe(M.url),children:"Submit"})})]},M.id))})]})})]}),(u.unknown??[]).length>0&&s.jsxs("div",{children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[s.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(u.unknown??[]).length,")"]}),s.jsx(be,{size:"sm",variant:"ghost",disabled:_,onClick:ye,children:_?"Submitting…":"Submit all to Bing"})]}),s.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800",children:[s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),s.jsx("tbody",{children:(u.unknown??[]).map(M=>s.jsxs("tr",{className:"border-b border-zinc-800/50",children:[s.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.url}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:M.lastCrawledDate?sa(M.lastCrawledDate):"—"}),s.jsx("td",{className:"py-1.5 px-3 text-right",children:s.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:_,onClick:()=>oe(M.url),children:"Submit"})})]},M.id))})]})})]}),u.indexed.length>0&&s.jsxs("div",{children:[s.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",u.indexed.length,")"]}),s.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800",children:[s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),s.jsx("tbody",{children:u.indexed.map(M=>s.jsxs("tr",{className:"border-b border-zinc-800/50",children:[s.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.url}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:M.lastCrawledDate?sa(M.lastCrawledDate):"—"})]},M.id))})]})})]})]}),U==="coverage"&&!u&&s.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),U==="inspections"&&s.jsxs("div",{className:"mt-4 space-y-3",children:[s.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[s.jsx("input",{type:"text",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"URL to inspect",value:b,onChange:M=>S(M.target.value),onKeyDown:M=>M.key==="Enter"&&J()}),s.jsx(be,{size:"sm",disabled:!b.trim(),onClick:J,children:"Inspect"})]}),v&&s.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[s.jsx("div",{className:"font-medium text-zinc-200",children:v.url}),s.jsxs("div",{className:"text-zinc-400",children:["In Index: ",s.jsx("span",{className:v.inIndex?"text-emerald-400":"text-rose-400",children:v.inIndex?"Yes":"No"})," · ","HTTP: ",v.httpCode??"—"," · ","Crawled: ",v.lastCrawledDate??"—"]})]}),f.length>0&&s.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800",children:[s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),s.jsx("tbody",{children:f.map(M=>s.jsxs("tr",{className:"border-b border-zinc-800/50",children:[s.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.url}),s.jsx("td",{className:"py-1.5 px-3",children:s.jsx(Xe,{tone:M.inIndex?"positive":"negative",children:M.inIndex?"Yes":"No"})}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:M.httpCode??"—"}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:sa(M.inspectedAt)})]},M.id))})]})})]}),U==="performance"&&s.jsx("div",{className:"mt-4",children:m.length===0?s.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):s.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800",children:[s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Km[Ro.Clicks]}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Km[Ro.Impressions]}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Km[Ro.CTR]}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Km[Ro.Position]})]})}),s.jsx("tbody",{children:m.map((M,q)=>s.jsxs("tr",{className:"border-b border-zinc-800/50",children:[s.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.query}),s.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:M.clicks}),s.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:M.impressions}),s.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(M.ctr)?M.ctr*100:0).toFixed(1),"%"]}),s.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:M.averagePosition.toFixed(1)})]},q))})]})})})]})]})}function O_e({projectName:e}){const t=xi(),[n,r]=x.useState("google"),[i,a]=x.useState(!0),[l,u]=x.useState("idle"),[d,f]=x.useState(null),p=x.useRef(null),[m,g]=x.useState(!1),[v,j]=x.useState(null),[b,S]=x.useState(null),[k,E]=x.useState(!1),[C,A]=x.useState(null),[T,O]=x.useState(null),[_,P]=x.useState(0);async function $(q=!1){q||a(!0),f(null);try{const[D,G,se]=await Promise.all([VN().catch(()=>null),t.fetchQuery({queryKey:qe.gsc.connections(e),queryFn:()=>z5(e).catch(()=>[]),staleTime:jr}),t.fetchQuery({queryKey:qe.bing.status(e),queryFn:()=>P5(e).catch(()=>null),staleTime:jr})]),ne=G.find(ee=>ee.connectionType==="gsc")??null;g(!!D?.google?.configured),E(!!D?.bing?.configured),j(ne),A(se);const[Ce,Se]=await Promise.all([ne?t.fetchQuery({queryKey:qe.gsc.coverage(e),queryFn:()=>QN(e).catch(()=>null),staleTime:jr}):Promise.resolve(null),se?.connected?t.fetchQuery({queryKey:qe.bing.coverage(e),queryFn:()=>WN(e).catch(()=>null),staleTime:jr}):Promise.resolve(null)]);S(Ce),O(Se)}catch(D){f(D instanceof Error?D.message:"Failed to load search console overview")}finally{a(!1)}}async function F(){if(l!=="idle")return;p.current?.abort();const q=new AbortController;p.current=q;const D=q.signal;u("syncing"),f(null);const G=[];try{async function se(){if(!v)return;const ee=await T5(e);if(!ee?.id)return;const pe=2e3,Y=Date.now()+12e4;for(;Date.now()<Y;){if(D.aborted||(await new Promise(Pe=>setTimeout(Pe,pe)),D.aborted))return;const He=await tc(ee.id).catch(()=>null);if(!He)break;if(["completed","failed","cancelled"].includes(He.status)){He.status!=="completed"&&G.push(`Google sync ${He.status}`);break}}}const ne=10;async function Ce(){if(!C?.connected)return;const ee=await R5(e).catch(()=>[]),pe=[...new Set(ee.map(Ee=>Ee.url))];if(pe.length!==0)for(let Ee=0;Ee<pe.length;Ee+=ne){if(D.aborted)return;const Y=pe.slice(Ee,Ee+ne),Pe=(await Promise.allSettled(Y.map(at=>D5(e,at)))).filter(at=>at.status==="rejected").length;Pe>0&&G.push(`${Pe} Bing inspection(s) failed`)}}const Se=await Promise.allSettled([se(),Ce()]);for(const ee of Se)ee.status==="rejected"&&G.push(ee.reason instanceof Error?ee.reason.message:"Sync failed");if(D.aborted)return;u("reloading"),await Promise.all([t.invalidateQueries({queryKey:qe.gsc.project(e)}),t.invalidateQueries({queryKey:qe.bing.project(e)})]),await $(!0),P(ee=>ee+1),G.length>0&&f(`Partial refresh: ${G.join("; ")}`)}catch(se){D.aborted||f(se instanceof Error?se.message:"Refresh failed")}finally{D.aborted||u("idle")}}x.useEffect(()=>($(),()=>{p.current?.abort()}),[e]);const U=v?"positive":m?"caution":"negative",B=v?"Connected":m?"Ready to connect":"Needs setup",V=b?`${b.summary.percentage}% indexed`:v?"Awaiting coverage":"No coverage data",X=b?`${b.summary.notIndexed} not indexed${b.summary.deindexed>0?` · ${b.summary.deindexed} deindexed`:""}`:v?"Run sitemap inspection to populate coverage":m?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",Z=b?.lastSyncedAt??b?.lastInspectedAt??v?.updatedAt??null,H=C?.connected?"positive":k?"caution":"negative",J=C?.connected?"Connected":k?"Ready to connect":"Needs setup",oe=T?`${T.summary.percentage}% indexed`:C?.connected?"Awaiting coverage":"No coverage data",ye=T?T.summary.notIndexed+(T.summary.unknown??0):0,I=T?`${ye} not in index`:C?.connected?"Inspect URLs to populate coverage":k?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",M=T?.lastInspectedAt??C?.updatedAt??null;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),s.jsx("h2",{children:"Search Engine Intelligence"}),s.jsx("p",{className:"mt-1 max-w-3xl text-sm leading-6 text-zinc-500",children:"Scan both engines at a glance, then open the Google or Bing workspace when you need to inspect coverage or take action."})]}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:i||l!=="idle",onClick:()=>{F()},children:i?"Loading…":l==="syncing"?"Refreshing Google & Bing…":l==="reloading"?"Reloading workspaces…":"Refresh all"})]}),d&&s.jsx("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:d}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsx(UP,{eyebrow:"Google",title:"Google Search Console",status:i?"Loading…":B,tone:i?"neutral":U,targetLabel:"Selected property",targetValue:v?.propertyId??"No property selected",coverageValue:i?"Loading…":V,note:i?"Loading overview…":X,updatedAt:Z,active:n==="google",onClick:()=>r("google")}),s.jsx(UP,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:i?"Loading…":J,tone:i?"neutral":H,targetLabel:"Selected site",targetValue:C?.siteUrl??"No site selected",coverageValue:i?"Loading…":oe,note:i?"Loading overview…":I,updatedAt:M,active:n==="bing",onClick:()=>r("bing")})]})]}),s.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([q,D])=>s.jsx("button",{type:"button",role:"tab","aria-selected":n===q,className:`project-subnav-link ${n===q?"project-subnav-link-active":""}`,onClick:()=>r(q),children:D},q))}),n==="google"&&s.jsx(TEe,{projectName:e}),n==="bing"&&s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),s.jsx("h2",{children:"Bing Webmaster Tools"})]})}),s.jsx(A_e,{projectName:e,refreshNonce:_})]})]})}function E_e({insights:e}){const{openEvidence:t}=vd(),[n,r]=x.useState(null);return s.jsx("div",{className:"insight-list",children:e.map(i=>{const a=n===i.id,l=i.affectedPhrases.length>0;return s.jsxs("div",{children:[s.jsxs("div",{className:`insight-row insight-row-${i.tone} ${l?"cursor-pointer":""}`,onClick:l?()=>r(a?null:i.id):void 0,children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l&&s.jsx(Hh,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${a?"rotate-90":""}`}),s.jsx(Xe,{tone:i.tone,children:i.actionLabel}),s.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:i.title}),s.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:i.detail})]}),l&&s.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[i.affectedPhrases.length," phrase",i.affectedPhrases.length>1?"s":""]})]}),a&&s.jsx("div",{className:"divide-y divide-zinc-800/20",children:i.affectedPhrases.map((u,d)=>s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(k1,{state:u.citationState}),s.jsx("span",{className:"text-sm text-zinc-200 truncate",children:u.query}),s.jsx("div",{className:"hidden sm:flex gap-1",children:u.provider&&s.jsx(rc,{provider:u.provider})})]}),u.evidenceId&&s.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:f=>{f.stopPropagation(),t(u.evidenceId)},children:"View →"})]},u.evidenceId||`${i.id}-${d}`))})]},i.id)})})}function jp({tab:e}){const{projectId:t}=kv({from:"/projects/$projectId"}),n=Wo(),{dashboard:r,isLoading:i,refetch:a}=wc();if(!r||i)return s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-48"}),s.jsx("div",{className:"skeleton-text-sm w-32"})]}),s.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(je=>s.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[s.jsx("div",{className:"skeleton-circle size-20"}),s.jsx("div",{className:"skeleton-text w-16 mt-3"})]},je))}),s.jsxs("div",{className:"page-skeleton-card",children:[s.jsx("div",{className:"skeleton-text w-28"}),s.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(je=>s.jsx("div",{className:"skeleton-text-sm w-full"},je))})]})]});const l=Yie(r,t),[u,d]=x.useState(!1),[f,p]=x.useState(!1),[m,g]=x.useState(!1),[v,j]=x.useState(""),[b,S]=x.useState(!1),[k,E]=x.useState(!1),[C,A]=x.useState(""),[T,O]=x.useState(!1),[_,P]=x.useState(!1),[$,F]=x.useState(""),[U,B]=x.useState(!1),[V,X]=x.useState(void 0),[Z,H]=x.useState(!1),[J,oe]=x.useState(null),[ye,I]=x.useState(!1),M=l?.visibilityEvidence??[],q=l?.project.name??"",D=l?.project.displayName||l?.project.name||q,G=e9(),se=(l?.recentRuns??[]).some(je=>je.kind===Tt["answer-visibility"]&&(je.status===hr.running||je.status===hr.queued)),ne=x.useMemo(()=>new Set(M.map(je=>je.location??"")),[M]),Ce=ne.has(""),Se=x.useMemo(()=>[...ne].filter(Boolean),[ne]);x.useEffect(()=>{if(V===void 0||V===""||!q){oe(null),I(!1);return}I(!0),E5(q,V).then(je=>{oe(je),I(!1)}).catch(()=>{oe(null),I(!1)})},[V,q]);const ee=x.useMemo(()=>{if(!J)return null;const je=new Map;for(const Ze of J){for(const[Rt,mt]of Object.entries(Ze.providerRuns??{}))je.set(`${Ze.query}::${Rt}`,mt.map(et=>({runId:et.runId,citationState:et.citationState,createdAt:et.createdAt,answerMentioned:et.answerMentioned,visibilityState:et.visibilityState,visibilityTransition:et.visibilityTransition})));(!Ze.providerRuns||Object.keys(Ze.providerRuns).length===0)&&je.set(`${Ze.query}::`,Ze.runs.map(Rt=>({runId:Rt.runId,citationState:Rt.citationState,createdAt:Rt.createdAt,answerMentioned:Rt.answerMentioned,visibilityState:Rt.visibilityState,visibilityTransition:Rt.visibilityTransition})))}return je},[J]),pe=x.useMemo(()=>{const je=V!==void 0?M.filter(Ze=>V===""?!Ze.location:Ze.location===V):M;return ee?je.map(Ze=>{const Rt=ee.get(`${Ze.query}::${Ze.provider}`)??ee.get(`${Ze.query}::`);return Rt?{...Ze,runHistory:Rt}:Ze}):je},[M,V,ee]);if(!l)return s.jsx("div",{className:"page-container",children:s.jsxs($e,{className:"surface-card empty-card",children:[s.jsx("h1",{children:"Project not found"}),s.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),s.jsx(be,{asChild:!0,children:s.jsx(Yt,{to:"/",children:"Return to overview"})})]})});async function Ee(){try{await G.mutateAsync({projectName:q,projectLabel:D,sourceAction:"project-run"}),a()}catch{}}async function Y(){p(!0);try{await gV(q),vt({title:"Project deleted",detail:`${D} was removed.`,tone:"positive",dedupeKey:`project:delete:${q}`,dedupeMode:"drop"}),n({to:"/"}),a()}catch(je){console.error("Failed to delete project:",je)}finally{p(!1)}}async function He(){try{const je=await yV(q),Ze=typeof je=="string"?je:JSON.stringify(je,null,2),Rt=new Blob([Ze],{type:"text/yaml"}),mt=URL.createObjectURL(Rt),et=document.createElement("a");et.href=mt,et.download=`${q}.yaml`,et.click()}catch(je){vt({title:"Export failed",detail:je instanceof Error?je.message:"Could not export project YAML.",tone:"negative"})}}async function Pe(){const je=v.split(`
293
+ `).map(Ze=>Ze.trim()).filter(Boolean);if(je.length!==0){S(!0);try{await uV(q,je),a(),j(""),g(!1)}finally{S(!1)}}}async function at(){const je=C.trim();if(je){O(!0);try{const Rt=(await O5(q)).map(et=>et.domain),mt=[...new Set([...Rt,je])];await _5(q,mt),a(),A(""),E(!1)}finally{O(!1)}}}async function Ve(){const je=$.trim();if(je){B(!0);try{const Ze=l?.project.ownedDomains??[];await j2(q,[...Ze,je]),a(),F(""),P(!1)}finally{B(!1)}}}async function Ht(je){B(!0);try{const Ze=l?.project.ownedDomains??[];await j2(q,Ze.filter(Rt=>Rt!==je)),a()}finally{B(!1)}}async function Lt(je,Ze){await dV(je,Ze),a()}const cn=je=>!Number.isNaN(Number.parseInt(je,10)),en=[{key:"overview",label:"Overview",href:`/projects/${l.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${l.project.id}/search-console`},{key:"traffic",label:"Traffic",href:`/projects/${l.project.id}/traffic`},{key:"report",label:"Report",href:`/projects/${l.project.id}/report`},{key:"inbound",label:"Inbound",href:`/projects/${l.project.id}/inbound`}];return s.jsxs("div",{className:"page-container",children:[u?s.jsxs($e,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[s.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),s.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",s.jsx("strong",{className:"text-zinc-200",children:l.project.displayName||l.project.name})," and all its queries, competitors, runs, and snapshots. This cannot be undone."]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(be,{type:"button",variant:"destructive",disabled:f,onClick:Y,children:f?"Deleting...":"Yes, delete project"}),s.jsx(be,{type:"button",variant:"outline",disabled:f,onClick:()=>d(!1),children:"Cancel"})]})]}):null,s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:l.project.displayName||l.project.name}),s.jsxs("p",{className:"page-subtitle",children:[l.project.canonicalDomain,(l.project.ownedDomains??[]).length===0&&!_&&s.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>P(!0),children:"+ add domain"})," "," · ",l.contextLabel]}),s.jsxs("div",{className:"tag-row",children:[s.jsx("span",{className:"tag",children:l.project.country}),s.jsx("span",{className:"tag",children:l.project.language.toUpperCase()}),l.project.tags.map(je=>s.jsx("span",{className:"tag",children:je},je))]}),((l.project.ownedDomains??[]).length>0||_)&&s.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[s.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(l.project.ownedDomains??[]).map(je=>s.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[je,s.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:U,onClick:()=>Ht(je),"aria-label":`Remove ${je}`,children:"×"})]},je)),_?s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-1.5 py-0.5 text-xs text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none w-40",type:"text",placeholder:"docs.example.com",value:$,onChange:je=>F(je.target.value),onKeyDown:je=>je.key==="Enter"&&Ve(),autoFocus:!0}),s.jsx(be,{type:"button",size:"sm",disabled:!$.trim()||U,onClick:Ve,children:U?"...":"Add"}),s.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{P(!1),F("")},children:"Cancel"})]}):s.jsx("button",{type:"button",className:"rounded-full border border-dashed border-zinc-700 px-2 py-0.5 text-[10px] uppercase tracking-wide text-zinc-500 hover:text-zinc-300 hover:border-zinc-500 transition-colors",onClick:()=>P(!0),children:"+ domain"})]})]}),s.jsxs("div",{className:"page-header-right",children:[s.jsx("p",{className:"text-sm text-zinc-500",children:l.dateRangeLabel}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(be,{type:"button",variant:"outline",size:"icon",onClick:He,"aria-label":"Export project as YAML",children:s.jsx(Ov,{className:"h-4 w-4 text-zinc-400"})}),s.jsx(be,{type:"button",variant:"outline",size:"icon",onClick:()=>d(!0),"aria-label":"Delete project",children:s.jsx(V5,{className:"h-4 w-4 text-zinc-400"})}),s.jsx(be,{type:"button",disabled:G.isPending||se,onClick:Ee,children:G.isPending?"Starting…":se?"Sweep running…":"Run now"})]})]})]}),s.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:en.map(je=>s.jsx(Yt,{to:je.href,className:`project-subnav-link ${je.key===e?"project-subnav-link-active":""}`,"aria-current":je.key===e?"page":void 0,children:je.label},je.key))}),e==="overview"?s.jsxs(s.Fragment,{children:[s.jsxs("section",{className:"gauge-row",children:[s.jsx(Dde,{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:cn(l.visibilitySummary.value),progress:l.visibilitySummary.progress,providerCoverage:l.visibilitySummary.providerCoverage}),s.jsxs("div",{className:"metric-card",children:[s.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Queries",s.jsx(pr,{text:"Tracked queries where competitors are cited in the latest completed visibility run but your domain is not."})]}),s.jsxs("p",{className:"metric-card-big-value",children:[s.jsx("span",{className:"text-zinc-50",children:l.gapQueries.value}),s.jsxs("span",{className:"text-zinc-600",children:[" / ",l.queryCounts.total]})]}),s.jsx("div",{className:"metric-card-bar",children:s.jsx("div",{className:`metric-card-bar-fill progress-fill-${l.gapQueries.tone}`,style:{width:l.gapQueries.progress!==void 0?`${Math.min(Math.max(l.gapQueries.progress,0),100)}%`:"0%"}})}),s.jsx("p",{className:"metric-card-detail",children:l.gapQueries.delta}),s.jsx("p",{className:"metric-card-sub",children:l.gapQueries.description})]}),s.jsxs("div",{className:"metric-card",children:[s.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",s.jsx(pr,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),s.jsxs("p",{className:"metric-card-big-value",children:[s.jsx("span",{className:"text-zinc-50",children:l.indexCoverage.value}),s.jsx("span",{className:"text-zinc-600",children:"%"})]}),s.jsx("div",{className:"metric-card-bar",children:s.jsx("div",{className:`metric-card-bar-fill progress-fill-${l.indexCoverage.tone}`,style:{width:`${Number.parseInt(l.indexCoverage.value,10)||0}%`}})}),s.jsx("p",{className:"metric-card-detail",children:l.indexCoverage.delta}),s.jsx("p",{className:"metric-card-sub",children:l.indexCoverage.description})]}),s.jsxs("div",{className:"metric-card",children:[s.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",s.jsx(pr,{text:"Query-level citation changes compared to the previous completed run."})]}),l.movementSummary.hasPreviousRun?s.jsxs("div",{className:"metric-card-movement",children:[s.jsxs("span",{className:l.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",l.movementSummary.gained," gained"]}),s.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),s.jsxs("span",{className:l.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",l.movementSummary.lost," lost"]})]}):s.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),s.jsx("p",{className:"metric-card-sub mt-auto",children:l.movementSummary.gained===0&&l.movementSummary.lost===0&&l.movementSummary.hasPreviousRun?"No changes since last run":l.movementSummary.gained>l.movementSummary.lost?"Visibility improving":l.movementSummary.lost>l.movementSummary.gained?"Visibility declining":""})]})]}),s.jsx(LEe,{projectName:l.project.name}),l.providerScores.length>1&&s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),s.jsxs("h2",{children:["Visibility by model ",s.jsx(pr,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked queries. Switching models can significantly affect citation rates."})]})]})}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Model"}),s.jsx("th",{children:"Score"}),s.jsx("th",{children:"Cited queries"})]})}),s.jsx("tbody",{children:l.providerScores.map(je=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[s.jsx(rc,{provider:je.provider}),je.model&&s.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:je.model})]})}),s.jsx("td",{children:s.jsxs("span",{className:`font-semibold ${je.score>=70?"text-emerald-400":je.score>=40?"text-amber-400":"text-rose-400"}`,children:[je.score,"%"]})}),s.jsxs("td",{className:"text-zinc-500",children:[je.cited," of ",je.total]})]},`${je.provider}::${je.model??"unknown"}`))})]})})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),s.jsx("h2",{children:"Citation signals"})]})}),s.jsx(E_e,{insights:l.insights})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),s.jsx("h2",{children:"Query citation tracking"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("p",{className:"supporting-copy",children:[new Set(l.visibilityEvidence.map(je=>je.query)).size," queries tracked"]}),s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>g(!m),children:m?"Cancel":"+ Add queries"})]})]}),m&&s.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[s.jsx("textarea",{className:"w-full resize-none rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",rows:3,placeholder:"Enter queries, one per line",value:v,onChange:je=>j(je.target.value)}),s.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[s.jsxs("p",{className:"text-xs text-zinc-500",children:[v.split(`
294
+ `).filter(je=>je.trim()).length," queries"]}),s.jsx(be,{type:"button",size:"sm",disabled:!v.trim()||b,onClick:Pe,children:b?"Adding...":"Add queries"})]})]}),l.project.locations&&l.project.locations.length>0&&s.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[s.jsx("button",{className:`filter-chip ${V===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":V===void 0,onClick:()=>{X(void 0)},children:"All locations"}),l.project.locations.map(je=>ne.has(je.label)&&s.jsx("button",{className:`filter-chip ${V===je.label?"filter-chip-active":""}`,type:"button","aria-pressed":V===je.label,onClick:()=>{X(je.label),H(!1)},children:je.label},je.label)),Ce&&s.jsx("button",{className:`filter-chip ${V===""?"filter-chip-active":""}`,type:"button","aria-pressed":V==="",onClick:()=>{X(""),H(!1)},children:"No location"}),Se.length>1&&V===void 0&&s.jsx("button",{className:`filter-chip filter-chip-compare ${Z?"filter-chip-active":""}`,type:"button","aria-pressed":Z,onClick:()=>H(je=>!je),title:"Side-by-side location comparison",children:"Compare"})]}),s.jsx(Lde,{evidence:pe})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),s.jsx("h2",{children:"Competitive landscape"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("p",{className:"supporting-copy",children:[l.competitors.length," tracked"]}),s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>E(!k),children:k?"Cancel":"+ Add competitor"})]})]}),k&&s.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[s.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"competitor.com",value:C,onChange:je=>A(je.target.value),onKeyDown:je=>je.key==="Enter"&&at()}),s.jsx(be,{type:"button",size:"sm",disabled:!C.trim()||T,onClick:at,children:T?"Adding...":"Add"})]}),s.jsx($de,{competitors:l.competitors})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),s.jsx("h2",{children:"Recent execution history"})]})}),s.jsx("div",{className:"run-list",children:l.recentRuns.map(je=>s.jsx(OB,{run:je},je.id))})]}),s.jsx(j_e,{project:{...l.project,displayName:l.project.displayName??l.project.name,defaultLocation:l.project.defaultLocation??null},onUpdateProject:Lt,onRefresh:()=>{a()}}),s.jsx(N_e,{projectName:l.project.name}),s.jsx(C_e,{projectName:l.project.name})]}):e==="report"?s.jsx(ZEe,{projectName:l.project.name}):e==="traffic"?s.jsx(yEe,{projectName:l.project.name}):e==="inbound"?s.jsx(IEe,{projectName:l.project.name}):s.jsx(O_e,{projectName:l.project.name})]})}function __e(){const{dashboard:e,isLoading:t}=wc(),n=AEe();if(!e||t)return s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-20"}),s.jsx("div",{className:"skeleton-text-sm w-72"})]}),s.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(d=>s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1 space-y-1.5",children:[s.jsx("div",{className:"skeleton-text w-40"}),s.jsx("div",{className:"skeleton-text-sm w-56"})]}),s.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},d))})]});const r=e.runs,[i,a]=x.useState("all"),l=i==="all"?r:r.filter(d=>d.status===i),u=async()=>{try{await n.mutateAsync(void 0)}catch{}};return s.jsxs("div",{className:"page-container",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Runs"}),s.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{u()},children:n.isPending?"Queueing…":"Run all projects"})]}),s.jsxs("section",{children:[s.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(d=>s.jsx("button",{className:`filter-chip ${i===d?"filter-chip-active":""}`,type:"button","aria-pressed":i===d,onClick:()=>a(d),children:d==="all"?"All runs":Pv(d)},d))}),s.jsx("div",{className:"run-list",children:l.length>0?l.map(d=>s.jsx(OB,{run:d},d.id)):s.jsxs($e,{className:"surface-card empty-card",children:[s.jsx("h2",{children:"No runs match this filter"}),s.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function z_e({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[a,l]=x.useState(""),[u,d]=x.useState(""),[f,p]=x.useState(""),[m,g]=x.useState(""),[v,j]=x.useState(""),[b,S]=x.useState(""),[k,E]=x.useState(!1),[C,A]=x.useState(null),[T,O]=x.useState(!1),_=i?u.trim().length>0:a.trim().length>0;async function P(){if(_){E(!0),A(null),O(!1);try{const F=Z=>{const H=parseInt(Z.trim(),10);return Number.isFinite(H)&&H>0?H:void 0},U={},B=F(m);B!==void 0&&(U.maxConcurrency=B);const V=F(v);V!==void 0&&(U.maxRequestsPerMinute=V);const X=F(b);X!==void 0&&(U.maxRequestsPerDay=X),await wV(e.toLowerCase(),{...a.trim()?{apiKey:a.trim()}:{},...u.trim()?{baseUrl:u.trim()}:{},...f.trim()?{model:f.trim()}:{},...Object.keys(U).length>0?{quota:U}:{}}),l(""),d(""),p(""),g(""),j(""),S(""),O(!0),vt({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(F){A(F instanceof Error?F.message:"Failed to update provider")}finally{E(!1)}}}const $=n??"Use default model";return s.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[i&&s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),s.jsx("input",{id:`base-url-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"http://localhost:11434/v1",value:u,onChange:F=>d(F.target.value)}),s.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",i?" (optional)":""]}),t&&s.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:["Get API key ","↗"]})]}),s.jsx("input",{id:`api-key-${e}`,type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:i?"Optional — most local servers don't need one":`Enter ${e} API key`,value:a,onChange:F=>l(F.target.value)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),s.jsx("input",{id:`model-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:$,value:f,onChange:F=>p(F.target.value)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),s.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[s.jsxs("div",{children:[s.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Concurrent",value:m,onChange:F=>g(F.target.value)}),s.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),s.jsxs("div",{children:[s.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/min",value:v,onChange:F=>j(F.target.value)}),s.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),s.jsxs("div",{children:[s.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/day",value:b,onChange:F=>S(F.target.value)}),s.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),C&&s.jsx("p",{className:"text-xs text-rose-400",children:C}),T&&s.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),s.jsx(be,{type:"button",size:"sm",disabled:!_||k,onClick:P,children:k?"Saving...":"Save"})]})}function T_e({onSaved:e}){const[t,n]=x.useState(""),[r,i]=x.useState(""),[a,l]=x.useState(!1),[u,d]=x.useState(null),[f,p]=x.useState(!1),m=t.trim().length>0&&r.trim().length>0;async function g(){if(m){l(!0),d(null),p(!1);try{await jV({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),p(!0),vt({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),e()}catch(v){d(v instanceof Error?v.message:"Failed to update Google OAuth credentials")}finally{l(!1)}}}return s.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),s.jsxs("a",{href:"https://console.cloud.google.com/apis/credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:["Google Cloud ","↗"]})]}),s.jsx("input",{id:"google-client-id",type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client ID",value:t,onChange:v=>n(v.target.value)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),s.jsx("input",{id:"google-client-secret",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client secret",value:r,onChange:v=>i(v.target.value)})]}),s.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",s.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),u&&s.jsx("p",{className:"text-xs text-rose-400",children:u}),f&&s.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),s.jsx(be,{type:"button",size:"sm",disabled:!m||a,onClick:g,children:a?"Saving...":"Save Google OAuth app"})]})}function P_e(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState(!1),[l,u]=x.useState("localhost"),[d,f]=x.useState("9222"),[p,m]=x.useState(!1);return x.useEffect(()=>{N2().then(t).catch(g=>{const v=g instanceof Error?g.message:String(g);v.includes("501")||r(v)})},[]),s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),s.jsx("h2",{children:"ChatGPT (CDP)"})]}),s.jsx(Xe,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),s.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&s.jsxs("div",{children:[s.jsx("dt",{children:"Endpoint"}),s.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&s.jsxs("div",{children:[s.jsx("dt",{children:"Browser"}),s.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&s.jsxs("div",{children:[s.jsx("dt",{children:"Tabs"}),s.jsx("dd",{children:e.targets.map(g=>s.jsxs("span",{className:"mr-2",children:[g.name,": ",g.alive?"● alive":"○ idle"]},g.name))})]})]}),s.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:e?.connected?"Connected to Chrome via CDP. Launch Chrome with --remote-debugging-port to use this provider.":n||"Not configured. Set an endpoint below or run: canonry cdp connect --host localhost --port 9222"}),s.jsx("div",{className:"mt-2",children:s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!i),children:i?"Cancel":e?.connected?"Update endpoint":"Configure"})}),i&&s.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async g=>{g.preventDefault(),m(!0);try{await KV(l,parseInt(d,10)||9222);const v=await N2().catch(()=>null);v&&t(v),a(!1),vt({title:"CDP endpoint saved",detail:`${l}:${parseInt(d,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}catch(v){r(v instanceof Error?v.message:String(v))}finally{m(!1)}},children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"localhost",value:l,onChange:g=>u(g.target.value),"aria-label":"CDP host"}),s.jsx("input",{className:"w-24 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"9222",value:d,onChange:g=>f(g.target.value),"aria-label":"CDP port"})]}),s.jsx("div",{children:s.jsx(be,{type:"submit",size:"sm",disabled:p,children:p?"Saving…":"Save endpoint"})})]})]})}const R_e={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function D_e(){const e=Gh(),{dashboard:t}=wc(),n=t?.settings??e?.dashboard?.settings,a=Uv(!e,e?.health).data??e?.health??R_e,[l,u]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[g,v]=x.useState(""),[j,b]=x.useState(!1),[S,k]=x.useState(null),[E,C]=x.useState(!1);return n?s.jsxs("div",{className:"page-container",children:[s.jsx("div",{className:"page-header",children:s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Settings"}),s.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),s.jsxs("section",{className:"settings-grid",children:[n.providerStatuses.map(A=>s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),s.jsx("h2",{children:A.displayName??A.name})]}),s.jsx(Xe,{tone:A.state==="ready"?"positive":"caution",children:A.state==="ready"?"Ready":"Needs config"})]}),s.jsxs("dl",{className:"definition-list mt-3",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Model"}),s.jsx("dd",{className:"font-mono text-xs",children:A.model})]}),A.quota&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Concurrency"}),s.jsx("dd",{children:A.quota.maxConcurrency})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Rate limit"}),s.jsxs("dd",{children:[A.quota.maxRequestsPerMinute,"/min · ",A.quota.maxRequestsPerDay,"/day"]})]})]})]}),s.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:A.detail}),s.jsx("div",{className:"mt-2",children:s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>u(l===A.name?null:A.name),children:l===A.name?"Cancel":A.state==="ready"?A.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),l===A.name&&s.jsx(z_e,{providerName:A.name,keyUrl:A.keyUrl,modelHint:A.modelHint,onSaved:()=>{u(null)}})]},A.name)),s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),s.jsx("h2",{children:"Search Console OAuth"})]}),s.jsx(Xe,{tone:n.google.state==="ready"?"positive":"caution",children:n.google.state==="ready"?"Ready":"Needs config"})]}),s.jsxs("dl",{className:"definition-list mt-3",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Auth model"}),s.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Storage"}),s.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),s.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.google.detail}),s.jsx("div",{className:"mt-2",children:s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>f(!d),children:d?"Cancel":n.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),d&&s.jsx(T_e,{onSaved:()=>{f(!1)}})]}),s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),s.jsx("h2",{children:"Webmaster Tools"})]}),s.jsx(Xe,{tone:n.bing.state==="ready"?"positive":"caution",children:n.bing.state==="ready"?"Ready":"Needs config"})]}),s.jsxs("dl",{className:"definition-list mt-3",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Auth model"}),s.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Storage"}),s.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),s.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.bing.detail}),s.jsx("div",{className:"mt-2",children:s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":n.bing.state==="ready"?"Update API key":"Configure Bing"})}),p&&s.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),s.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]}),s.jsx("input",{id:"bing-api-key",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:g,onChange:A=>v(A.target.value)})]}),s.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",s.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),S&&s.jsx("p",{className:"text-xs text-rose-400",children:S}),E&&s.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),s.jsx(be,{type:"button",size:"sm",disabled:!g.trim()||j,onClick:async()=>{if(g.trim()){b(!0),k(null),C(!1);try{await ZV(g.trim()),v(""),C(!0),m(!1),vt({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(A){k(A instanceof Error?A.message:"Failed to update Bing API key")}finally{b(!1)}}},children:j?"Saving...":"Save Bing API key"})]})]}),s.jsx(P_e,{}),s.jsxs($e,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),s.jsx("h2",{children:"API and worker"})]})}),s.jsxs("div",{className:"compact-stack",children:[s.jsxs("div",{className:"health-row",children:[s.jsxs("div",{children:[s.jsx("p",{className:"run-row-title",children:"API"}),s.jsx("p",{className:"supporting-copy",children:a.apiStatus.detail})]}),s.jsx(Xe,{tone:dy(a.apiStatus),title:Ko(a.apiStatus),children:a.apiStatus.state==="ok"?"Healthy":"Attention"})]}),s.jsxs("div",{className:"health-row",children:[s.jsxs("div",{children:[s.jsx("p",{className:"run-row-title",children:"Worker"}),s.jsx("p",{className:"supporting-copy",children:a.workerStatus.detail})]}),s.jsx(Xe,{tone:dy(a.workerStatus),title:Ko(a.workerStatus),children:a.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),s.jsx("section",{className:"page-section",children:s.jsxs($e,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),s.jsx("h2",{children:"Operational guidance"})]})}),s.jsx("ul",{className:"detail-list",children:n.selfHostNotes.map(A=>s.jsx("li",{children:A},A))}),s.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const M_e=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Queries",description:"Add queries to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function I_e({current:e,labels:t}){return s.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((n,r)=>{const i=r<e,a=r===e;return s.jsxs("div",{className:`setup-step ${i?"setup-step-done":""} ${a?"setup-step-active":""}`,role:"listitem","aria-current":a?"step":void 0,children:[s.jsx("span",{className:"setup-step-number",children:i?"✓":r+1}),s.jsx("span",{className:"setup-step-label",children:n.label})]},n.label)})})}function L_e(){const e=Gh(),{dashboard:t,isLoading:n,refetch:r}=wc(),i=t??e?.dashboard;if(!i||n)return s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-24"}),s.jsx("div",{className:"skeleton-text-sm w-80"})]}),s.jsxs("div",{className:"page-skeleton-card",children:[s.jsx("div",{className:"skeleton-text w-32"}),s.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(he=>s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-1 flex-1",children:[s.jsx("div",{className:"skeleton-text w-24"}),s.jsx("div",{className:"skeleton-text-sm w-48"})]}),s.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},he))})]})]});const a=i.settings,d=Uv(!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=Vte(i.setup,d,a),p=Wo(),[m,g]=x.useState(0),[v,j]=x.useState(""),[b,S]=x.useState(""),[k,E]=x.useState(""),[C,A]=x.useState("US"),[T,O]=x.useState("en"),[_,P]=x.useState(!1),[$,F]=x.useState(null),[U,B]=x.useState(null),[V,X]=x.useState(null),[Z,H]=x.useState(!1),[J,oe]=x.useState(""),[ye,I]=x.useState(!1),[M,q]=x.useState(null),[D,G]=x.useState(!1),se=a.providerStatuses.filter(he=>he.state==="ready"),[ne,Ce]=x.useState(se[0]?.name??""),[Se,ee]=x.useState(5),[pe,Ee]=x.useState(!1),[Y,He]=x.useState(null),[Pe,at]=x.useState(""),[Ve,Ht]=x.useState(!1),[Lt,cn]=x.useState(null),[en,je]=x.useState(!1),[Ze,Rt]=x.useState(!1),[mt,et]=x.useState(!1),ce=e9(),Ne=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Me=J.split(`
295
+ `).map(he=>he.trim()).filter(Boolean),Ge=Pe.split(`
296
+ `).map(he=>he.trim()).filter(Boolean),pt=f.healthChecks.some(he=>he.id==="api"&&he.state==="ready"),mn=async()=>{if(!(!Ne||!k)){H(!0),X(null);try{const he=await Av(Ne,{displayName:b||v,canonicalDomain:k,country:C,language:T,autoExtractBacklinks:_});F(Ne),B(he.id),vt({title:"Project created",detail:`${he.displayName||he.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${he.name}`,dedupeMode:"drop"}),r(),g(2)}catch(he){X(he instanceof Error?he.message:"Failed to create project")}finally{H(!1)}}},On=async()=>{if(!$)return;const he=Me;if(he.length!==0){G(!0),q(null);try{await cV($,he),I(!0),r(),g(3)}catch(Qe){q(Qe instanceof Error?Qe.message:"Failed to save queries")}finally{G(!1)}}},gn=async()=>{if(!(!$||!ne)){Ee(!0),He(null);try{const he=await EV($,ne,Se);if(he.queries.length>0){const Qe=J?J.trimEnd()+`
297
+ `+he.queries.join(`
298
+ `):he.queries.join(`
299
+ `);oe(Qe)}}catch(he){He(he instanceof Error?he.message:"Failed to generate queries")}finally{Ee(!1)}}},We=async()=>{if(!$)return;const he=Ge;if(he.length!==0){je(!0),cn(null);try{await _5($,he),Ht(!0),r(),g(4)}catch(Qe){cn(Qe instanceof Error?Qe.message:"Failed to save competitors")}finally{je(!1)}}},Kt=async()=>{if($){et(!0);try{await ce.mutateAsync({projectName:$,projectLabel:b||v||$,sourceAction:"setup-launch"}),Rt(!0),r()}catch{}finally{et(!1)}}},de=()=>g(he=>Math.max(0,he-1)),ze=(()=>{switch(m){case 0:return s.jsxs($e,{className:"surface-card step-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),s.jsx("h2",{children:"System ready"})]})}),s.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),s.jsx("div",{className:"compact-stack",children:f.healthChecks.map(he=>s.jsxs("div",{className:"health-check-row",children:[s.jsxs("div",{children:[s.jsx("p",{className:"run-row-title",children:he.label}),s.jsx("p",{className:"supporting-copy",children:he.detail}),he.id==="provider"&&he.state!=="ready"&&s.jsx(Yt,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),s.jsx(Xe,{tone:he.state==="ready"?"positive":"caution",title:he.id==="api"?Ko(d.apiStatus):he.id==="worker"?Ko(d.workerStatus):he.detail,children:he.state==="ready"?"Ready":"Attention"})]},he.id))}),s.jsxs("div",{className:"setup-nav",children:[s.jsx("span",{}),s.jsx(be,{type:"button",disabled:!pt,onClick:()=>g(1),children:"Continue"})]})]});case 1:return s.jsxs($e,{className:"surface-card step-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),s.jsx("h2",{children:"Create project"})]}),$?s.jsx(Xe,{tone:"positive",children:"Created"}):null]}),$?s.jsxs("div",{className:"compact-stack",children:[s.jsxs("p",{className:"text-zinc-300",children:["Project ",s.jsx("span",{className:"text-zinc-100 font-medium",children:$})," created successfully."]}),s.jsxs("div",{className:"setup-nav",children:[s.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),s.jsx(be,{type:"button",onClick:()=>g(2),children:"Continue"})]})]}):s.jsxs("div",{className:"compact-stack",children:[s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),s.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:v,onChange:he=>j(he.target.value)}),Ne&&Ne!==v?s.jsxs("p",{className:"supporting-copy",children:["Slug: ",Ne]}):null]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),s.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:b,onChange:he=>S(he.target.value)})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),s.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:k,onChange:he=>E(he.target.value)})]}),s.jsxs("div",{className:"setup-field-row",children:[s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),s.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:C,onChange:he=>A(he.target.value.toUpperCase())})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),s.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:T,onChange:he=>O(he.target.value.toLowerCase())})]})]}),s.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 cursor-pointer hover:border-zinc-700",children:[s.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-zinc-700 bg-zinc-950",checked:_,onChange:he=>P(he.target.checked)}),s.jsxs("span",{className:"flex-1",children:[s.jsx("span",{className:"block text-sm text-zinc-100",children:"Auto-extract backlinks"}),s.jsxs("span",{className:"block text-xs text-zinc-500 mt-0.5",children:["When a new Common Crawl release syncs, automatically extract backlinks for this project."," ",s.jsx(Yt,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),V?s.jsx("p",{className:"text-rose-400 text-sm",children:V}):null,s.jsxs("div",{className:"setup-nav",children:[s.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),s.jsx(be,{type:"button",disabled:!Ne||!k||Z,onClick:mn,children:Z?"Creating...":"Create project"})]})]})]});case 2:return s.jsxs($e,{className:"surface-card step-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),s.jsx("h2",{children:"Add queries"})]}),ye?s.jsxs(Xe,{tone:"positive",children:[Me.length," saved"]}):s.jsxs(Xe,{tone:"neutral",children:[Me.length," quer",Me.length!==1?"ies":"y"]})]}),s.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),ye?s.jsxs("div",{className:"compact-stack",children:[s.jsx("ul",{className:"detail-list",children:Me.map(he=>s.jsx("li",{children:he},he))}),s.jsxs("div",{className:"setup-nav",children:[s.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),s.jsx(be,{type:"button",onClick:()=>g(3),children:"Continue"})]})]}):s.jsxs("div",{className:"compact-stack",children:[se.length>0?s.jsxs("div",{className:"compact-stack",children:[s.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[s.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",s.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"setup-field flex-1",children:[s.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),s.jsx("select",{id:"gen-provider",className:"setup-input",value:ne,onChange:he=>Ce(he.target.value),children:se.map(he=>s.jsxs("option",{value:he.name,children:[he.displayName??he.name,he.model?` (${he.model})`:""]},he.name))})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),s.jsx("select",{id:"gen-count",className:"setup-input",value:Se,onChange:he=>ee(Number(he.target.value)),children:[3,5,10,15,20].map(he=>s.jsx("option",{value:he,children:he},he))})]}),s.jsx(be,{type:"button",variant:"outline",disabled:pe||!ne,onClick:gn,children:pe?"Analyzing site...":"Generate"})]}),Y?s.jsx("p",{className:"text-rose-400 text-sm",children:Y}):null]}):null,s.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[s.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",s.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),s.jsx("textarea",{id:"queries",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
300
+ best invisalign downtown brooklyn
301
+ pediatric dentist brooklyn heights`,value:J,onChange:he=>oe(he.target.value)})]}),M?s.jsx("p",{className:"text-rose-400 text-sm",children:M}):null,s.jsxs("div",{className:"setup-nav",children:[s.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),s.jsx(be,{type:"button",disabled:Me.length===0||D,onClick:On,children:D?"Saving...":`Save ${Me.length} quer${Me.length!==1?"ies":"y"}`})]})]})]});case 3:return s.jsxs($e,{className:"surface-card step-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),s.jsx("h2",{children:"Add competitors"})]}),Ve?s.jsx(Xe,{tone:"positive",children:"Saved"}):null]}),s.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),Ve?s.jsxs("div",{className:"compact-stack",children:[s.jsx("ul",{className:"detail-list",children:Ge.map(he=>s.jsx("li",{children:he},he))}),s.jsxs("div",{className:"setup-nav",children:[s.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),s.jsx(be,{type:"button",onClick:()=>g(4),children:"Continue"})]})]}):s.jsxs("div",{className:"compact-stack",children:[s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),s.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
302
+ competitor2.com`,value:Pe,onChange:he=>at(he.target.value)})]}),Lt?s.jsx("p",{className:"text-rose-400 text-sm",children:Lt}):null,s.jsxs("div",{className:"setup-nav",children:[s.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(be,{type:"button",variant:"outline",onClick:()=>g(4),children:"Skip"}),s.jsx(be,{type:"button",disabled:Ge.length===0||en,onClick:We,children:en?"Saving...":`Save ${Ge.length} competitor${Ge.length!==1?"s":""}`})]})]})]})]});case 4:return s.jsxs($e,{className:"surface-card step-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),s.jsx("h2",{children:"Launch first run"})]}),Ze?s.jsx(Xe,{tone:"positive",children:"Queued"}):null]}),Ze?s.jsxs("div",{className:"compact-stack",children:[s.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),s.jsxs("div",{className:"setup-nav",children:[s.jsx("span",{}),s.jsx(be,{type:"button",onClick:()=>p({to:U?`/projects/${U}`:"/"}),children:"Open project"})]})]}):s.jsxs("div",{className:"compact-stack",children:[s.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",s.jsx("span",{className:"text-zinc-100 font-medium",children:$}),"."]}),s.jsxs("div",{className:"setup-nav",children:[s.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),s.jsx(be,{type:"button",disabled:mt,onClick:Kt,children:mt?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return s.jsxs("div",{className:"page-container",children:[s.jsx("div",{className:"page-header",children:s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Setup"}),s.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),s.jsx(I_e,{current:m,labels:M_e}),s.jsx("section",{className:"setup-wizard",children:ze})]})}function Nu({children:e,label:t="More info",placement:n="top",className:r}){const i=x.useId(),[a,l]=x.useState(!1);return s.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[s.jsx("button",{type:"button","aria-label":t,"aria-describedby":a?i:void 0,className:"inline-flex h-4 w-4 items-center justify-center rounded-full text-zinc-500 hover:text-zinc-200 focus:text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onFocus:()=>l(!0),onBlur:()=>l(!1),children:s.jsx(F5,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&s.jsx("span",{id:i,role:"tooltip",className:`absolute z-50 w-64 rounded border border-zinc-700 bg-zinc-900 px-3 py-2 text-xs font-normal leading-relaxed text-zinc-200 shadow-lg ${n==="top"?"bottom-full mb-2":"top-full mt-2"} left-1/2 -translate-x-1/2 whitespace-normal`,children:e})]})}const $_e="https://commoncrawl.org/web-graphs";function zS(e){return e==null?"—":e>=1e12?`${(e/1e12).toFixed(1)} TB`:e>=1e9?`${(e/1e9).toFixed(1)} GB`:e>=1e6?`${(e/1e6).toFixed(1)} MB`:e>=1e3?`${(e/1e3).toFixed(1)} KB`:`${e} B`}function _g(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function TS(e){switch(e){case"ready":return"positive";case"failed":return"negative";case"downloading":case"querying":case"queued":return"caution"}}function B_e(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState([]),[l,u]=x.useState([]),[d,f]=x.useState(null),[p,m]=x.useState(!0),[g,v]=x.useState(!1),[j,b]=x.useState(!1),[S,k]=x.useState(""),[E,C]=x.useState(!1),[A,T]=x.useState(null),[O,_]=x.useState(null),P=x.useCallback(async()=>{m(!0),T(null);try{const[V,X,Z,H,J]=await Promise.all([dQ(),I5().catch(()=>null),hQ().catch(()=>[]),mQ().catch(()=>[]),gQ().catch(()=>null)]);t(V),r(X),a(Z),u(H),f(J)}catch(V){T(V instanceof Error?V.message:"Failed to load backlinks status")}finally{m(!1)}},[]);x.useEffect(()=>{P()},[P]);async function $(){v(!0),T(null),_(null);try{const V=await fQ();_(V.alreadyPresent?`DuckDB already installed (${V.version}).`:`Installed DuckDB ${V.version}.`),await P()}catch(V){T(V instanceof Error?V.message:"Failed to install DuckDB")}finally{v(!1)}}async function F(){const V=S.trim()||void 0;b(!0),T(null),_(null);try{const X=await pQ(V);_(V?`Queued sync for ${X.release}. Download + query runs in the background.`:`Queued sync for auto-discovered release ${X.release}. Download + query runs in the background.`),k(""),C(!1),await P()}catch(X){X instanceof ei&&X.code==="MISSING_DEPENDENCY"?T("DuckDB is not installed. Install it first."):T(X instanceof Error?X.message:"Failed to trigger sync")}finally{b(!1)}}async function U(V){T(null),_(null);try{await yQ(V),_(`Pruned cached release ${V}.`),await P()}catch(X){T(X instanceof Error?X.message:"Failed to prune release")}}const B=n?.status==="ready"&&l.every(V=>V.release!==n.release);return s.jsxs("div",{className:"page-container",children:[s.jsx("div",{className:"page-header",children:s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Backlinks"}),s.jsx("p",{className:"page-subtitle",children:"Find domains that link to your projects, computed from the open Common Crawl web graph. Runs entirely on your machine — nothing is sent to third parties."})]})}),s.jsx($e,{className:"surface-card p-4 mb-6 border-amber-800/60",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(iy,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{className:"text-sm text-zinc-300 leading-relaxed",children:[s.jsx("p",{className:"font-medium text-amber-200",children:"Heads up — a release sync is a large download."}),s.jsxs("ul",{className:"mt-1.5 space-y-1 text-zinc-400",children:[s.jsxs("li",{children:[s.jsx("span",{className:"text-zinc-200",children:"~16 GB"})," of gzipped vertex + edge files per release, stored at"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),"."]}),s.jsxs("li",{children:[s.jsx("span",{className:"text-zinc-200",children:"10–20 min on a fast connection"})," for the download, then ~5 min for the DuckDB query."]}),s.jsx("li",{children:"One sync covers every project in this workspace. Releases are immutable, so the download only happens once per release."})]})]})]})}),s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"About"}),s.jsx("h2",{children:"How it works"})]})}),s.jsxs($e,{className:"surface-card p-5",children:[s.jsxs("p",{className:"text-sm text-zinc-400 leading-relaxed max-w-3xl mb-4",children:["Common Crawl publishes a quarterly snapshot of the public web’s hyperlink graph. Canonry downloads one"," ",s.jsx("span",{className:"text-zinc-200",children:"release"})," at a time and extracts backlinks for every project in this workspace in a single pass."]}),s.jsxs("ol",{className:"space-y-3 text-sm text-zinc-400 max-w-3xl",children:[s.jsxs("li",{className:"flex gap-3",children:[s.jsx("span",{className:"shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-full border border-zinc-700 bg-zinc-900 text-xs font-semibold text-zinc-300 tabular-nums",children:"1"}),s.jsxs("span",{children:[s.jsx("span",{className:"text-zinc-200 font-medium",children:"Download (one-time, ~16 GB)"})," — vertex + edge files cached to"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),". Runs once per release; subsequent operations reuse the cache."]})]}),s.jsxs("li",{className:"flex gap-3",children:[s.jsx("span",{className:"shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-full border border-zinc-700 bg-zinc-900 text-xs font-semibold text-zinc-300 tabular-nums",children:"2"}),s.jsxs("span",{children:[s.jsx("span",{className:"text-zinc-200 font-medium",children:"Query (~5 min)"})," — one DuckDB pass scans the cached files and extracts referring domains for every project’s canonical domain. DuckDB is only used to ",s.jsx("span",{className:"text-zinc-200",children:"read"})," these dumps; it doesn’t store any canonry state."]})]}),s.jsxs("li",{className:"flex gap-3",children:[s.jsx("span",{className:"shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-full border border-zinc-700 bg-zinc-900 text-xs font-semibold text-zinc-300 tabular-nums",children:"3"}),s.jsxs("span",{children:[s.jsx("span",{className:"text-zinc-200 font-medium",children:"Persist"})," — results land in the same SQLite database the rest of canonry uses. After the first sync, per-project reads (and re-run extracts against the cached release) are instant."]})]})]})]})]}),A&&s.jsx($e,{className:"surface-card p-4 mb-4 border-rose-800/60",children:s.jsx("p",{className:"text-sm text-rose-300",children:A})}),O&&s.jsx($e,{className:"surface-card p-4 mb-4 border-emerald-800/60",children:s.jsx("p",{className:"text-sm text-emerald-300",children:O})}),s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dependency"}),s.jsxs("h2",{className:"flex items-center gap-2",children:["DuckDB install status",s.jsxs(Nu,{label:"Why DuckDB?",children:[s.jsx("span",{className:"block",children:"DuckDB is a query engine canonry uses to scan the ~16 GB Common Crawl dumps and pull out your referring domains."}),s.jsxs("span",{className:"mt-2 block text-zinc-400",children:["It does ",s.jsx("span",{className:"text-zinc-200",children:"not"})," store any canonry data — your backlink results live in SQLite alongside the rest of your projects. DuckDB is purely a tool for processing the raw CSV files."]}),s.jsxs("span",{className:"mt-2 block text-zinc-500",children:["Installed on demand (not bundled) into ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/plugins/"})," so users who never run backlinks don’t pay the ~40 MB install cost."]})]})]})]}),e?.duckdbInstalled?s.jsx(Xe,{tone:"positive",children:"Installed"}):s.jsx(Xe,{tone:"caution",children:"Not installed"})]}),s.jsx($e,{className:"surface-card p-5",children:p?s.jsx("p",{className:"text-sm text-zinc-500",children:"Checking…"}):e?.duckdbInstalled?s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(q5,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-sm text-zinc-200",children:["Version ",e.duckdbVersion??"unknown"," installed at"," ",s.jsx("code",{className:"text-zinc-300",children:e.pluginDir})]}),s.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Required spec: ",e.duckdbSpec]})]})]}):s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(HQ,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:"text-sm text-zinc-200",children:"DuckDB is not installed. It’s the query engine canonry uses to scan Common Crawl dumps — required before you can run a release sync or per-project extract."}),s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Installing doesn’t touch your project data. DuckDB only reads the downloaded CSV files; backlink results are written to the same SQLite database canonry already uses."}),e&&s.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Will be installed into ",s.jsx("code",{className:"text-zinc-300",children:e.pluginDir})," (~40 MB)."]}),s.jsx("div",{className:"mt-3",children:s.jsxs(be,{type:"button",size:"sm",disabled:g,onClick:$,children:[s.jsx(Ov,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),g?"Installing…":"Install DuckDB"]})})]})]})})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Latest sync"}),s.jsxs("h2",{className:"flex items-center gap-2",children:["Release sync",s.jsx(Nu,{label:"What is a release sync?",children:"A release sync downloads one Common Crawl dump (~16 GB) and extracts backlinks for every project in this workspace in one pass. This is the heavy job — subsequent per-project re-runs skip the download and just re-query the cached files."})]})]}),n&&s.jsx(Xe,{tone:TS(n.status),children:n.status})]}),s.jsxs($e,{className:"surface-card p-5",children:[s.jsxs("p",{className:"text-xs text-zinc-500 max-w-3xl mb-4",children:["A release is one Common Crawl dump (e.g. ",s.jsx("code",{className:"text-zinc-400",children:"cc-main-2026-jan-feb-mar"}),"). Syncing it downloads the graph and populates backlinks for every project in this workspace."]}),n?s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("p",{className:"text-zinc-200",children:["Release ",s.jsx("code",{className:"text-zinc-300",children:n.release})]}),n.phaseDetail&&s.jsx("p",{className:"text-zinc-500",children:n.phaseDetail}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-xs text-zinc-500 pt-2",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Projects"}),s.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.projectsProcessed??"—"})]}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-zinc-600 uppercase tracking-wide flex items-center gap-1",children:["Rows",s.jsx(Nu,{label:"What are rows?",children:"Total number of (project, referring domain) pairs persisted in SQLite from this sync, across every project in the workspace."})]}),s.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.domainsDiscovered??"—"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Started"}),s.jsx("p",{className:"text-zinc-300 mt-0.5",children:_g(n.downloadStartedAt??n.createdAt)})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Finished"}),s.jsx("p",{className:"text-zinc-300 mt-0.5",children:_g(n.queryFinishedAt)})]})]}),n.error&&s.jsx("p",{className:"text-sm text-rose-400 pt-2",children:n.error})]}):s.jsx("p",{className:"text-sm text-zinc-500",children:"No release sync has run in this workspace yet."}),B&&s.jsx("div",{className:"mt-4 rounded border border-amber-800/60 bg-amber-950/20 p-3",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(iy,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{className:"text-xs text-zinc-300 leading-relaxed",children:[s.jsx("p",{className:"font-medium text-amber-200",children:"Cached files for this release are missing."}),s.jsxs("p",{className:"mt-1 text-zinc-400",children:["The sync record in the database says this release finished successfully, but the ~16 GB dump at"," ",s.jsxs("code",{className:"text-zinc-300",children:["~/.canonry/cache/commoncrawl/",n?.release,"/"]})," isn’t on disk. Your backlink data is still intact (it lives in SQLite), but per-project re-run extracts will fail until you either re-sync this release or start a new one."]})]})]})}),s.jsxs("div",{className:"mt-4 rounded border border-zinc-800 bg-zinc-900/40 p-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Auto-detected release"}),d?s.jsxs("p",{className:"text-sm text-zinc-200 mt-0.5",children:[s.jsx("code",{className:"text-zinc-100",children:d.release}),s.jsxs("span",{className:"ml-2 text-xs text-zinc-500",children:["— vertex ",zS(d.vertexBytes),", edges ",zS(d.edgesBytes)]})]}):s.jsx("p",{className:"text-sm text-zinc-500 mt-0.5",children:p?"Probing Common Crawl…":"Could not auto-detect — pass an explicit release below."}),s.jsxs("a",{href:$_e,target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-flex items-center gap-1 text-xs text-zinc-400 hover:text-zinc-200 focus:text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500 rounded",children:["Browse all Common Crawl web-graph releases",s.jsx(ZQ,{className:"h-3 w-3","aria-hidden":!0})]})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(be,{type:"button",size:"sm",disabled:j||!e?.duckdbInstalled||!d&&!S.trim(),onClick:F,children:[s.jsx(ry,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),j?"Queuing…":"Run sync"]}),s.jsxs(Nu,{label:"What does Run sync do?",children:[s.jsxs("span",{className:"block",children:["Downloads the auto-detected (or chosen) Common Crawl release (~16 GB) to"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),", then runs a single DuckDB query that extracts referring domains for every project in this workspace."]}),s.jsxs("span",{className:"mt-2 block text-zinc-400",children:["First time for a release: ",s.jsx("span",{className:"text-zinc-200",children:"~10–20 min download + ~5 min query"}),". Re-running the same release later: ",s.jsx("span",{className:"text-zinc-200",children:"skips download, just re-queries"})," (~5 min)."]})]})]})]}),E?s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("input",{type:"text",className:"flex-1 min-w-[240px] rounded border border-zinc-700 bg-transparent px-2.5 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"cc-main-2026-jan-feb-mar",value:S,onChange:V=>k(V.target.value),disabled:j,autoFocus:!0}),s.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300 focus:text-zinc-300 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500 rounded",onClick:()=>{k(""),C(!1)},disabled:j,children:"Cancel"})]}):s.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300 focus:text-zinc-300 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500 rounded",onClick:()=>C(!0),disabled:j,children:"Use a different release →"})]}),!e?.duckdbInstalled&&s.jsx("p",{className:"text-xs text-zinc-600 mt-2",children:"Install DuckDB first to enable sync."})]})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Cached releases"}),s.jsxs("h2",{className:"flex items-center gap-2",children:["Local disk cache",s.jsxs(Nu,{label:"What is this?",children:[s.jsxs("span",{className:"block",children:["Raw Common Crawl dumps stored at"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/<release>/"}),". Each release takes ~16 GB."]}),s.jsxs("span",{className:"mt-2 block text-zinc-400",children:["These files are needed to re-run per-project extracts against a release without re-downloading. Pruning here ",s.jsx("span",{className:"text-zinc-200",children:"does not delete your backlink data"})," — that lives in SQLite."]})]})]})]})}),s.jsx("p",{className:"text-xs text-zinc-500 mb-3 max-w-3xl",children:"Each cached release is a ~16 GB pair of gzipped files. They’re needed to re-query the graph (e.g. for a newly-added project) without re-downloading. Safe to prune — backlink results persist in SQLite."}),s.jsx($e,{className:"surface-card overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[s.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"Sync status"}),s.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Size"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"Last used"}),s.jsx("th",{className:"px-4 py-2 font-medium sr-only",children:"Actions"})]})}),s.jsxs("tbody",{children:[l.map(V=>s.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[s.jsx("td",{className:"px-4 py-2 text-zinc-200",children:s.jsx("code",{children:V.release})}),s.jsx("td",{className:"px-4 py-2",children:V.syncStatus?s.jsx(Xe,{tone:TS(V.syncStatus),children:V.syncStatus}):s.jsx("span",{className:"text-zinc-600",children:"—"})}),s.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:zS(V.bytes)}),s.jsx("td",{className:"px-4 py-2 text-zinc-400",children:_g(V.lastUsedAt)}),s.jsx("td",{className:"px-4 py-2 text-right",children:s.jsxs("div",{className:"inline-flex items-center gap-1",children:[s.jsxs(be,{type:"button",variant:"outline",size:"sm",onClick:()=>U(V.release),children:[s.jsx(V5,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),"Prune"]}),s.jsx(Nu,{label:"What does Prune do?",placement:"top",children:"Deletes the ~16 GB cache for this release from disk. Backlink results already in SQLite remain untouched. To re-run extracts against this release, you’d have to sync it again (another ~16 GB download)."})]})})]},V.release)),l.length===0&&s.jsx("tr",{children:s.jsx("td",{className:"px-4 py-4 text-sm text-zinc-500",colSpan:5,children:"No cached releases on this machine. If you ran a sync from a different machine (or deleted the cache), the backlink data is still in the database — but you’ll need to re-sync a release to run new extracts."})})]})]})})]}),i.length>1&&s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),s.jsx("h2",{children:"Past release syncs"})]})}),s.jsx($e,{className:"surface-card overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[s.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"Status"}),s.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Projects"}),s.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Rows"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"Finished"})]})}),s.jsx("tbody",{children:i.map(V=>s.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[s.jsx("td",{className:"px-4 py-2 text-zinc-200",children:s.jsx("code",{children:V.release})}),s.jsx("td",{className:"px-4 py-2",children:s.jsx(Xe,{tone:TS(V.status),children:V.status})}),s.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:V.projectsProcessed??"—"}),s.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:V.domainsDiscovered??"—"}),s.jsx("td",{className:"px-4 py-2 text-zinc-400",children:_g(V.queryFinishedAt??V.updatedAt)})]},V.id))})]})})]})]})}function U_e(){return s.jsx("div",{className:"page-container",children:s.jsx("section",{className:"page-section",children:s.jsxs($e,{className:"surface-card empty-card",children:[s.jsx("h1",{children:"Route not found"}),s.jsx("p",{children:"The current path does not map to a dashboard view."}),s.jsx(be,{asChild:!0,children:s.jsx(Yt,{to:"/",children:"Return to overview"})})]})})})}function q_e(){return s.jsx(xue,{children:s.jsx(vue,{})})}const Hi=UG()({component:q_e,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),F_e=ti({getParentRoute:()=>Hi,path:"/",component:jue,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(qe.projects.all);if(t&&t.length===0)throw MN({to:"/setup"})}}),H_e=ti({getParentRoute:()=>Hi,path:"/projects",component:Rde}),Rd=ti({getParentRoute:()=>Hi,path:"/projects/$projectId",component:()=>s.jsx(KN,{})}),K_e=ti({getParentRoute:()=>Rd,path:"/",component:()=>s.jsx(jp,{tab:"overview"})}),G_e=ti({getParentRoute:()=>Rd,path:"/search-console",component:()=>s.jsx(jp,{tab:"search-console"})}),V_e=ti({getParentRoute:()=>Rd,path:"/report",component:()=>s.jsx(jp,{tab:"report"})}),Q_e=ti({getParentRoute:()=>Rd,path:"/traffic",component:()=>s.jsx(jp,{tab:"traffic"})}),W_e=ti({getParentRoute:()=>Rd,path:"/inbound",component:()=>s.jsx(jp,{tab:"inbound"})}),Y_e=ti({getParentRoute:()=>Hi,path:"/runs",component:__e}),Z_e=ti({getParentRoute:()=>Hi,path:"/settings",component:D_e,beforeLoad:({context:e})=>{}}),X_e=ti({getParentRoute:()=>Hi,path:"/setup",component:L_e,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(qe.projects.all);if(t&&t.length>0)throw MN({to:"/"})}}),J_e=ti({getParentRoute:()=>Hi,path:"/backlinks",component:B_e}),eze=ti({getParentRoute:()=>Hi,path:"*",component:U_e}),tze=Hi.addChildren([F_e,H_e,Rd.addChildren([K_e,G_e,V_e,Q_e,W_e]),Y_e,Z_e,X_e,J_e,eze]);function nze(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const BL=nze(),rze=BL==="/"?"":BL.replace(/\/$/,"");function ize(e,t){return ZG({routeTree:tze,basepath:rze||"/",context:{queryClient:e},...t?.initialEntries})}const s9=EQ(),aze=ize(s9),o9=document.getElementById("root");if(!o9)throw new Error("Expected #root element for web app bootstrap.");function sze(){const[e,t]=x.useState(w2()?"ready":"checking"),[n,r]=x.useState(""),[i,a]=x.useState(""),[l,u]=x.useState(null),[d,f]=x.useState(!1);x.useEffect(()=>{if(w2())return;let g=!1;return vV().then(v=>{g||(v.authenticated?t("ready"):t(v.setupRequired?"setup":"login"))}).catch(v=>{g||(u(v instanceof Error?v.message:"Failed to reach the Canonry API"),t("login"))}),()=>{g=!0}},[]);const p=async g=>{if(g.preventDefault(),!n.trim()||n.trim().length<8){u("Password must be at least 8 characters");return}if(n!==i){u("Passwords do not match");return}f(!0),u(null);try{if(!(await xV(n.trim())).authenticated){u("Setup failed");return}r(""),a(""),t("ready")}catch(v){u(v instanceof ei||v instanceof Error?v.message:"Setup failed")}finally{f(!1)}},m=async g=>{if(g.preventDefault(),!!n.trim()){f(!0),u(null);try{if(!(await bV(n.trim())).authenticated){u("Incorrect password");return}r(""),t("ready")}catch(v){u(v instanceof ei||v instanceof Error?v.message:"Authentication failed")}finally{f(!1)}}};return e==="ready"?s.jsx(WK,{client:s9,children:s.jsx(eV,{router:aze})}):s.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:s.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:s.jsx($e,{className:"surface-card w-full",children:e==="checking"?s.jsx(Lg,{className:"py-8",children:s.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?s.jsxs(s.Fragment,{children:[s.jsxs(g1,{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),s.jsx(y1,{children:"Create a dashboard password"}),s.jsx(v1,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),s.jsx(Lg,{children:s.jsxs("form",{className:"space-y-4",onSubmit:p,children:[s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),s.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:n,onChange:g=>r(g.target.value),placeholder:"At least 8 characters"})]}),s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),s.jsx("input",{className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:g=>a(g.target.value),placeholder:"Re-enter password"})]}),l?s.jsx("p",{className:"text-sm text-rose-400",children:l}):null,s.jsx(be,{type:"submit",disabled:d||!n.trim()||!i.trim(),children:d?"Setting up…":"Create password & open dashboard"})]})})]}):s.jsxs(s.Fragment,{children:[s.jsxs(g1,{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),s.jsx(y1,{children:"Sign in to Canonry"}),s.jsx(v1,{children:"Enter your dashboard password to continue."})]}),s.jsx(Lg,{children:s.jsxs("form",{className:"space-y-4",onSubmit:m,children:[s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),s.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:n,onChange:g=>r(g.target.value),placeholder:"Dashboard password"})]}),l?s.jsx("p",{className:"text-sm text-rose-400",children:l}):null,s.jsx(be,{type:"submit",disabled:d||!n.trim(),children:d?"Signing in…":"Open dashboard"})]})})]})})})})}NK.createRoot(o9).render(s.jsx(x.StrictMode,{children:s.jsx(sze,{})}));