@ainyc/canonry 4.12.1 → 4.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,302 +0,0 @@
1
- function yK(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 Ez;function vK(){if(Ez)return Af;Ez=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 xK(){return Oz||(Oz=1,rw.exports=vK()),rw.exports}var s=xK(),iw={exports:{}},rt={};var _z;function bK(){if(_z)return rt;_z=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 O(){}O.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 O;A.constructor=C,b(A,k.prototype),A.isPureReactComponent=!0;var T=Array.isArray;function E(){}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(E,E):(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(me){return me})):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(E,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 zz;function md(){return zz||(zz=1,iw.exports=bK()),iw.exports}var x=md();const Li=ma(x),bv=yK({__proto__:null,default:Li},[x]);var aw={exports:{}},Ef={},sw={exports:{}},ow={};var Tz;function wK(){return Tz||(Tz=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,O=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,E||(E=!0,B());else{var J=n(f);J!==null&&Z(T,J.startTime-H)}}var E=!1,_=-1,P=5,$=-1;function F(){return S?!0:!(e.unstable_now()-$<P)}function U(){if(S=!1,E){var H=e.unstable_now();$=H;var J=!0;try{e:{j=!1,b&&(b=!1,O(_),_=-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():E=!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?(O(_),_=-1):b=!0,Z(T,oe-ye))):(H.sortIndex=I,t(d,H),j||v||(j=!0,E||(E=!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 Pz;function jK(){return Pz||(Pz=1,sw.exports=wK()),sw.exports}var lw={exports:{}},yr={};var Rz;function SK(){if(Rz)return yr;Rz=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 Dz;function qL(){if(Dz)return lw.exports;Dz=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=SK(),lw.exports}var Mz;function NK(){if(Mz)return Ef;Mz=1;var e=jK(),t=md(),n=qL();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"),O=Symbol.for("react.consumer"),C=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),E=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 E:return"SuspenseList";case $:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case j:return"Portal";case C:return o.displayName||"Context";case O: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)?Z_(o):0;break;default:if(o=c.tagName,c=c.namespaceURI)c=Z_(c),o=X_(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 me(o){o.memoizedState!==null&&D(Ce,o);var c=G.current,h=X_(c,o.type);c!==h&&(D(se,o),D(G,h))}function Oe(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(de){var le=de}Reflect.construct(o,[],we)}else{try{we.call()}catch(de){le=de}o.call(we.prototype)}}else{try{throw Error()}catch(de){le=de}(we=o())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(de){if(de&&le&&typeof de.stack=="string")return[de.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,Xe=e.unstable_shouldYield,Rt=e.unstable_requestPaint,mt=e.unstable_now,et=e.unstable_getCurrentPriorityLevel,ue=e.unstable_ImmediatePriority,Ne=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,Ge=e.unstable_LowPriority,pt=e.unstable_IdlePriority,mn=e.log,En=e.unstable_setDisableYieldValue,gn=null,We=null;function Kt(o){if(typeof mn=="function"&&En(o),We&&typeof We.setStrictMode=="function")try{We.setStrictMode(gn,o)}catch{}}var fe=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 On(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=On(y):(z&=L,z!==0?w=On(z):h||(h=L&~o,h!==0&&(w=On(h))))):(L=y&~N,L!==0?w=On(L):z!==0?w=On(z):h||(h=y&~o,h!==0&&(w=On(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-fe(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 de=le[ge];de!==null&&(de.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-fe(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-fe(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:wz(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,es="__reactListeners$"+ke,Qs="__reactHandles$"+ke,Or="__reactResources$"+ke,il="__reactMarker$"+ke;function Sa(o){delete o[nt],delete o[St],delete o[ja],delete o[es],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=az(o);o!==null;){if(h=o[nt])return h;o=az(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[Or];return c||(c=o[Or]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function yn(o){o[il]=!0}var al=new Set,Cp={};function ts(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 ns(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 FA(o){var c=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function u9(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=FA(o)?"checked":"value";o._valueTracker=u9(o,c,""+o[c])}}function HA(o){if(!o)return!1;var c=o._valueTracker;if(!c)return!0;var h=c.getValue(),y="";return o&&(y=FA(o)?o.checked?"true":"false":o.value),o=y,o!==h?(c.setValue(o),!0):!1}function Ep(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 d9=/[\n"\\]/g;function Ni(o){return o.replace(d9,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 KA(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"&&Ep(o.ownerDocument)===o||o.defaultValue===""+h||(o.defaultValue=""+h)}function _c(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 GA(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 VA(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 zc(o,c){if(c){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=c;return}}o.textContent=c}var f9=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 QA(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||f9.has(c)?c==="float"?o.cssFloat=h:o[c]=(""+h).trim():o[c]=h+"px"}function WA(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&&QA(o,w,y)}else for(var N in c)c.hasOwnProperty(N)&&QA(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 h9=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"]]),p9=/^[\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 Op(o){return p9.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function rs(){}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 Tc=null,Pc=null;function YA(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&&HA(y)}break e;case"textarea":GA(o,h.value,h.defaultValue);break e;case"select":c=h.value,c!=null&&_c(o,!!h.multiple,c,!1)}}}var n0=!1;function ZA(o,c,h){if(n0)return o(c,h);n0=!0;try{var y=o(c);return y}finally{if(n0=!1,(Tc!==null||Pc!==null)&&(gm(),Tc&&(c=Tc,o=Pc,Pc=Tc=null,YA(c),o)))for(c=0;c<o.length;c++)YA(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 is=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),r0=!1;if(is)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 XA(){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 JA(){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:JA,this.isPropagationStopped=JA,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}),m9=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}}),eE=Ur(Rp),g9=m({},Rp,{dataTransfer:0}),y9=Ur(g9),v9=m({},Ud,{relatedTarget:0}),o0=Ur(v9),x9=m({},ol,{animationName:0,elapsedTime:0,pseudoElement:0}),b9=Ur(x9),w9=m({},ol,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),j9=Ur(w9),S9=m({},ol,{data:0}),tE=Ur(S9),N9={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},k9={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"},C9={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function A9(o){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(o):(o=C9[o])?!!c[o]:!1}function l0(){return A9}var E9=m({},Ud,{key:function(o){if(o.key){var c=N9[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"?k9[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}}),O9=Ur(E9),_9=m({},Rp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nE=Ur(_9),z9=m({},Ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:l0}),T9=Ur(z9),P9=m({},ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),R9=Ur(P9),D9=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}),M9=Ur(D9),I9=m({},ol,{newState:0,oldState:0}),L9=Ur(I9),$9=[9,13,27,32],c0=is&&"CompositionEvent"in window,Fd=null;is&&"documentMode"in document&&(Fd=document.documentMode);var B9=is&&"TextEvent"in window&&!Fd,rE=is&&(!c0||Fd&&8<Fd&&11>=Fd),iE=" ",aE=!1;function sE(o,c){switch(o){case"keyup":return $9.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oE(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Rc=!1;function U9(o,c){switch(o){case"compositionend":return oE(c);case"keypress":return c.which!==32?null:(aE=!0,iE);case"textInput":return o=c.data,o===iE&&aE?null:o;default:return null}}function q9(o,c){if(Rc)return o==="compositionend"||!c0&&sE(o,c)?(o=XA(),_p=i0=Zs=null,Rc=!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 rE&&c.locale!=="ko"?null:c.data;default:return null}}var F9={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 lE(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c==="input"?!!F9[o.type]:c==="textarea"}function cE(o,c,h,y){Tc?Pc?Pc.push(y):Pc=[y]:Tc=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 H9(o){K_(o,0)}function Dp(o){var c=Ws(o);if(HA(c))return o}function uE(o,c){if(o==="change")return c}var dE=!1;if(is){var u0;if(is){var d0="oninput"in document;if(!d0){var fE=document.createElement("div");fE.setAttribute("oninput","return;"),d0=typeof fE.oninput=="function"}u0=d0}else u0=!1;dE=u0&&(!document.documentMode||9<document.documentMode)}function hE(){Hd&&(Hd.detachEvent("onpropertychange",pE),Kd=Hd=null)}function pE(o){if(o.propertyName==="value"&&Dp(Kd)){var c=[];cE(c,Kd,o,t0(o)),ZA(H9,c)}}function K9(o,c,h){o==="focusin"?(hE(),Hd=c,Kd=h,Hd.attachEvent("onpropertychange",pE)):o==="focusout"&&hE()}function G9(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Dp(Kd)}function V9(o,c){if(o==="click")return Dp(c)}function Q9(o,c){if(o==="input"||o==="change")return Dp(c)}function W9(o,c){return o===c&&(o!==0||1/o===1/c)||o!==o&&c!==c}var ii=typeof Object.is=="function"?Object.is:W9;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 mE(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function gE(o,c){var h=mE(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=mE(h)}}function yE(o,c){return o&&c?o===c?!0:o&&o.nodeType===3?!1:c&&c.nodeType===3?yE(o,c.parentNode):"contains"in o?o.contains(c):o.compareDocumentPosition?!!(o.compareDocumentPosition(c)&16):!1:!1}function vE(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var c=Ep(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=Ep(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 Y9=is&&"documentMode"in document&&11>=document.documentMode,Dc=null,h0=null,Vd=null,p0=!1;function xE(o,c,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;p0||Dc==null||Dc!==Ep(y)||(y=Dc,"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=Dc)))}function ll(o,c){var h={};return h[o.toLowerCase()]=c.toLowerCase(),h["Webkit"+o]="webkit"+c,h["Moz"+o]="moz"+c,h}var Mc={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={},bE={};is&&(bE=document.createElement("div").style,"AnimationEvent"in window||(delete Mc.animationend.animation,delete Mc.animationiteration.animation,delete Mc.animationstart.animation),"TransitionEvent"in window||delete Mc.transitionend.transition);function cl(o){if(m0[o])return m0[o];if(!Mc[o])return o;var c=Mc[o],h;for(h in c)if(c.hasOwnProperty(h)&&h in bE)return m0[o]=c[h];return o}var wE=cl("animationend"),jE=cl("animationiteration"),SE=cl("animationstart"),Z9=cl("transitionrun"),X9=cl("transitionstart"),J9=cl("transitioncancel"),NE=cl("transitionend"),kE=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){kE.set(o,c),ts(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=[],Ic=0,y0=0;function Ip(){for(var o=Ic,c=y0=Ic=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&&CE(h,w,N)}}function Lp(o,c,h,y){ki[Ic++]=o,ki[Ic++]=c,ki[Ic++]=h,ki[Ic++]=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 CE(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-fe(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 Lc={};function eH(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 eH(o,c,h,y)}function x0(o){return o=o.prototype,!(!o||!o.isReactComponent)}function as(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 AE(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=aK(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 E:return o=ai(19,h,c,w),o.elementType=E,o.lanes=N,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case C:z=10;break e;case O: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 EE(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 OE=new WeakMap;function Ci(o,c){if(typeof o=="object"&&o!==null){var h=OE.get(o);return h!==void 0?h:(c={value:o,source:c,stack:Lt(c)},OE.set(o,c),c)}return{value:o,source:c,stack:Lt(c)}}var $c=[],Bc=0,Up=null,Qd=0,Ai=[],Ei=0,Xs=null,Na=1,ka="";function ss(o,c){$c[Bc++]=Qd,$c[Bc++]=Up,Up=o,Qd=c}function _E(o,c,h){Ai[Ei++]=Na,Ai[Ei++]=ka,Ai[Ei++]=Xs,Xs=o;var y=Na;o=ka;var w=32-fe(y)-1;y&=~(1<<w),h+=1;var N=32-fe(c)+w;if(30<N){var z=w-w%5;N=(y&(1<<z)-1).toString(32),y>>=z,w-=z,Na=1<<32-fe(c)+w|h<<w|y,ka=N+o}else Na=1<<N|h<<w|y,ka=o}function j0(o){o.return!==null&&(ss(o,1),_E(o,1,0))}function S0(o){for(;o===Up;)Up=$c[--Bc],$c[Bc]=null,Qd=$c[--Bc],$c[Bc]=null;for(;o===Xs;)Xs=Ai[--Ei],Ai[Ei]=null,ka=Ai[--Ei],Ai[Ei]=null,Na=Ai[--Ei],Ai[Ei]=null}function zE(o,c){Ai[Ei++]=Na,Ai[Ei++]=ka,Ai[Ei++]=Xs,Na=c.id,ka=c.overflow,Xs=o}var or=null,nn=null,wt=!1,Js=null,Oi=!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 TE(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),KA(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),VA(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||W_(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=rs),c=!0):c=!1,c||eo(o,!0)}function PE(o){for(or=o.return;or;)switch(or.tag){case 5:case 31:case 13:Oi=!1;return;case 27:case 3:Oi=!0;return;default:or=or.return}}function Uc(o){if(o!==or)return!1;if(!wt)return PE(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),PE(o),c===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));nn=iz(o)}else if(c===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));nn=iz(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,os=null;function to(o,c,h){D(C0,c._currentValue),c._currentValue=h}function ls(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 E0(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 qc(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&&E0(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,os=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function lr(o){return RE(hl,o)}function Fp(o,c){return hl===null&&pl(o),RE(o,c)}function RE(o,c){var h=c._currentValue;if(c={context:c,memoizedValue:h,next:null},os===null){if(o===null)throw Error(r(308));os=c,o.dependencies={lanes:0,firstContext:c},o.flags|=524288}else os=os.next=c;return h}var tH=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()})}},nH=e.unstable_scheduleCallback,rH=e.unstable_NormalPriority,Mn={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function O0(){return{controller:new tH,data:new Map,refCount:0}}function Yd(o){o.refCount--,o.refCount===0&&nH(rH,function(){o.controller.abort()})}var Zd=null,_0=0,Fc=0,Hc=null;function iH(o,c){if(Zd===null){var h=Zd=[];_0=0,Fc=Pb(),Hc={status:"pending",value:void 0,then:function(y){h.push(y)}}}return _0++,c.then(DE,DE),c}function DE(){if(--_0===0&&Zd!==null){Hc!==null&&(Hc.status="fulfilled");var o=Zd;Zd=null,Fc=0,Hc=null;for(var c=0;c<o.length;c++)(0,o[c])()}}function aH(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 ME=H.S;H.S=function(o,c){x_=mt(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&iH(o,c),ME!==null&&ME(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 IE(){var o=z0();return o===null?null:{parent:Mn._currentValue,pool:o}}var Kc=Error(r(460)),T0=Error(r(474)),Kp=Error(r(542)),Gp={then:function(){}};function LE(o){return o=o.status,o==="fulfilled"||o==="rejected"}function $E(o,c,h){switch(h=o[h],h===void 0?o.push(c):h!==c&&(c.then(rs,rs),c=h),c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,UE(o),o;default:if(typeof c.status=="string")c.then(rs,rs);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,UE(o),o}throw yl=c,Kc}}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,Kc):h}}var yl=null;function BE(){if(yl===null)throw Error(r(459));var o=yl;return yl=null,o}function UE(o){if(o===Kc||o===Kp)throw Error(r(483))}var Gc=null,Xd=0;function Vp(o){var c=Xd;return Xd+=1,Gc===null&&(Gc=[]),$E(Gc,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 qE(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=as(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 de(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),de(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 de(te,W,ie,Vp(xe),Ke);if(xe.$$typeof===C)return de(te,W,ie,Fp(W,xe),Ke);Qp(W,xe)}return null}function De(te,W,ie,xe){for(var Ke=null,Ct=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 At=le(te,Be,ie[ot],xe);if(At===null){Be===null&&(Be=bt);break}o&&Be&&At.alternate===null&&c(te,Be),W=N(At,W,ot),Ct===null?Ke=At:Ct.sibling=At,Ct=At,Be=bt}if(ot===ie.length)return h(te,Be),wt&&ss(te,ot),Ke;if(Be===null){for(;ot<ie.length;ot++)Be=we(te,ie[ot],xe),Be!==null&&(W=N(Be,W,ot),Ct===null?Ke=Be:Ct.sibling=Be,Ct=Be);return wt&&ss(te,ot),Ke}for(Be=y(Be);ot<ie.length;ot++)bt=de(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),Ct===null?Ke=bt:Ct.sibling=bt,Ct=bt);return o&&Be.forEach(function(bo){return c(te,bo)}),wt&&ss(te,ot),Ke}function Ye(te,W,ie,xe){if(ie==null)throw Error(r(151));for(var Ke=null,Ct=null,Be=W,ot=W=0,bt=null,At=ie.next();Be!==null&&!At.done;ot++,At=ie.next()){Be.index>ot?(bt=Be,Be=null):bt=Be.sibling;var bo=le(te,Be,At.value,xe);if(bo===null){Be===null&&(Be=bt);break}o&&Be&&bo.alternate===null&&c(te,Be),W=N(bo,W,ot),Ct===null?Ke=bo:Ct.sibling=bo,Ct=bo,Be=bt}if(At.done)return h(te,Be),wt&&ss(te,ot),Ke;if(Be===null){for(;!At.done;ot++,At=ie.next())At=we(te,At.value,xe),At!==null&&(W=N(At,W,ot),Ct===null?Ke=At:Ct.sibling=At,Ct=At);return wt&&ss(te,ot),Ke}for(Be=y(Be);!At.done;ot++,At=ie.next())At=de(Be,te,ot,At.value,xe),At!==null&&(o&&At.alternate!==null&&Be.delete(At.key===null?ot:At.key),W=N(At,W,ot),Ct===null?Ke=At:Ct.sibling=At,Ct=At);return o&&Be.forEach(function(gK){return c(te,gK)}),wt&&ss(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 Gc=null,Ke}catch(Be){if(Be===Kc||Be===Kp)throw Be;var Ct=ai(29,Be,null,te.mode);return Ct.lanes=xe,Ct.return=te,Ct}}}var vl=qE(!0),FE=qE(!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,(Tt&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),CE(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=Hc;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,de=le!==L.lane;if(de?(xt&le)===le:(y&le)===le){le!==0&&le===Fc&&(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,de&&(o.flags|=8192),de=w.callbacks,de===null?w.callbacks=[le]:de.push(le))}else de={lane:le,tag:L.tag,payload:L.payload,callback:L.callback,next:null},ge===null?(ae=ge=de,K=we):ge=ge.next=de,z|=le;if(L=L.next,L===null){if(L=w.shared.pending,L===null)break;de=L,L=de.next,de.next=null,w.lastBaseUpdate=de,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 HE(o,c){if(typeof o!="function")throw Error(r(191,o));o.call(c)}function KE(o,c){var h=o.callbacks;if(h!==null)for(o.callbacks=null,o=0;o<h.length;o++)HE(h[o],c)}var Vc=M(null),Wp=M(0);function GE(o,c){o=ys,D(Wp,o),D(Vc,c),ys=o|c.baseLanes}function I0(){D(Wp,ys),D(Vc,Vc.current)}function L0(){ys=Wp.current,q(Vc),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||Vc.current!==null||c.memoizedState!==null)&&(_i=o)}function $0(o){D(zn,zn.current),D(si,o),_i===null&&(_i=o)}function VE(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 cs=0,st=null,$t=null,In=null,Zp=!1,Qc=!1,xl=!1,Xp=0,rf=0,Wc=null,sH=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 cs=N,st=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,H.H=o===null||o.memoizedState===null?_O:nb,xl=!1,N=h(y,w),xl=!1,Qc&&(N=WE(c,h,y,w)),QE(o),N}function QE(o){H.H=of;var c=$t!==null&&$t.next!==null;if(cs=0,In=$t=st=null,Zp=!1,rf=0,Wc=null,c)throw Error(r(300));o===null||Ln||(o=o.dependencies,o!==null&&qp(o)&&(Ln=!0))}function WE(o,c,h,y){st=o;var w=0;do{if(Qc&&(Wc=null),rf=0,Qc=!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=zO,N=c(h,y)}while(Qc);return N}function oH(){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}cs=0,In=$t=st=null,Qc=!1,rf=Xp=0,Wc=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,Wc===null&&(Wc=[]),o=$E(Wc,o,c),c=st,(In===null?c.memoizedState:In.next)===null&&(c=c.alternate,H.H=c===null||c.memoizedState===null?_O: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 us(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:(cs&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===Fc&&(ge=!0);else if((cs&le)===le){ae=ae.next,le===Fc&&(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=Hc,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 YE(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(JE.bind(null,y,w,o),[o]),w.getSnapshot!==c||z||In!==null&&In.memoizedState.tag&1){if(y.flags|=2048,Yc(9,{destroy:void 0},XE.bind(null,y,w,h,c),null),Vt===null)throw Error(r(349));N||(cs&127)!==0||ZE(y,c,h)}return h}function ZE(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 XE(o,c,h,y){c.value=h,c.getSnapshot=y,eO(c)&&tO(o)}function JE(o,c,h){return h(function(){eO(c)&&tO(o)})}function eO(o){var c=o.getSnapshot;o=o.value;try{var h=c();return!ii(o,h)}catch{return!0}}function tO(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:us,lastRenderedState:o},c}function nO(o,c,h,y){return o.baseState=h,G0(o,$t,typeof y=="function"?y:us)}function lH(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,rO(c,N)):(N.next=h.next,c.pending=h.next=N)}}function rO(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),iO(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),iO(o,c,N)}catch(ae){W0(o,c,ae)}}function iO(o,c,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(y){aO(o,c,y)},function(y){return W0(o,c,y)}):aO(o,c,h)}function aO(o,c,h){c.status="fulfilled",c.value=h,sO(c),o.state=h,c=o.pending,c!==null&&(h=c.next,h===c?o.pending=null:(h=h.next,c.next=h,rO(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,sO(c),c=c.next;while(c!==y)}o.action=null}function sO(o){o=o.listeners;for(var c=0;c<o.length;c++)(0,o[c])()}function oO(o,c){return c}function lO(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=Oi;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:oO,lastRenderedState:c},h.queue=y,h=AO.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=lH.bind(null,st,w,N,h),w.dispatch=h,y.memoizedState=o,[c,h,!1]}function cO(o){var c=Tn();return uO(c,$t,o)}function uO(o,c,h){if(c=G0(o,c,oO)[0],o=tm(us)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var y=af(c)}catch(z){throw z===Kc?Kp:z}else y=c;c=Tn();var w=c.queue,N=w.dispatch;return h!==c.memoizedState&&(st.flags|=2048,Yc(9,{destroy:void 0},cH.bind(null,w,h),null)),[y,N,o]}function cH(o,c){o.action=c}function dO(o){var c=Tn(),h=$t;if(h!==null)return uO(c,h,o);Tn(),c=c.memoizedState,h=Tn();var y=h.queue.dispatch;return h.memoizedState=o,[c,y,!1]}function Yc(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 fO(){return Tn().memoizedState}function nm(o,c,h,y){var w=_r();st.flags|=o,w.memoizedState=Yc(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=Yc(c,N,h,y):(st.flags|=o,w.memoizedState=Yc(1|c,N,h,y))}function hO(o,c){nm(8390656,8,o,c)}function Y0(o,c){rm(2048,8,o,c)}function uH(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 pO(o){var c=Tn().memoizedState;return uH({ref:c,nextImpl:o}),function(){if((Tt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function mO(o,c){return rm(4,2,o,c)}function gO(o,c){return rm(4,4,o,c)}function yO(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 vO(o,c,h){h=h!=null?h.concat([o]):null,rm(4,4,yO.bind(null,c,o),h)}function Z0(){}function xO(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 bO(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||(cs&1073741824)!==0&&(xt&261930)===0?o.memoizedState=c:(o.memoizedState=h,o=w_(),st.lanes|=o,co|=o,h)}function wO(o,c,h,y){return ii(h,c)?h:Vc.current!==null?(o=X0(o,h,y),ii(o,c)||(Ln=!0),o):(cs&42)===0||(cs&1073741824)!==0&&(xt&261930)===0?(Ln=!0,o.memoizedState=h):(o=w_(),st.lanes|=o,co|=o,c)}function jO(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=aH(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 dH(){}function J0(o,c,h,y){if(o.tag!==5)throw Error(r(476));var w=SO(o).queue;jO(o,w,c,oe,h===null?dH:function(){return NO(o),h(y)})}function SO(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:us,lastRenderedState:oe},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:h},next:null},o.memoizedState=c,o=o.alternate,o!==null&&(o.memoizedState=c),c}function NO(o){var c=SO(o);c.next===null&&(c=o.alternate.memoizedState),sf(o,c.next.queue,{},ui())}function eb(){return lr(Sf)}function kO(){return Tn().memoizedState}function CO(){return Tn().memoizedState}function fH(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:O0()},o.payload=c;return}c=c.return}}function hH(o,c,h){var y=ui();h={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},im(o)?EO(c,h):(h=v0(o,c,h,y),h!==null&&(Gr(h,o,y),OO(h,c,y)))}function AO(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))EO(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),OO(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 EO(o,c){Qc=Zp=!0;var h=o.pending;h===null?c.next=c:(c.next=h.next,h.next=c),o.pending=c}function OO(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 _O={readContext:lr,use:em,useCallback:function(o,c){return _r().memoizedState=[o,c===void 0?null:c],o},useContext:lr,useEffect:hO,useImperativeHandle:function(o,c,h){h=h!=null?h.concat([o]):null,nm(4194308,4,yO.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=hH.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=AO.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=jO.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||ZE(y,c,h)}w.memoizedState=h;var N={value:h,getSnapshot:c};return w.queue=N,hO(JE.bind(null,y,N,o),[o]),y.flags|=2048,Yc(9,{destroy:void 0},XE.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-fe(y)-1)).toString(32)+h,c="_"+c+"R_"+h,h=Xp++,0<h&&(c+="H"+h.toString(32)),c+="_"}else h=sH++,c="_"+c+"r_"+h.toString(32)+"_";return o.memoizedState=c},useHostTransitionStatus:eb,useFormState:lO,useActionState:lO,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=fH.bind(null,st)},useEffectEvent:function(o){var c=_r(),h={impl:o};return c.memoizedState=h,function(){if((Tt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},nb={readContext:lr,use:em,useCallback:xO,useContext:lr,useEffect:Y0,useImperativeHandle:vO,useInsertionEffect:mO,useLayoutEffect:gO,useMemo:bO,useReducer:tm,useRef:fO,useState:function(){return tm(us)},useDebugValue:Z0,useDeferredValue:function(o,c){var h=Tn();return wO(h,$t.memoizedState,o,c)},useTransition:function(){var o=tm(us)[0],c=Tn().memoizedState;return[typeof o=="boolean"?o:af(o),c]},useSyncExternalStore:YE,useId:kO,useHostTransitionStatus:eb,useFormState:cO,useActionState:cO,useOptimistic:function(o,c){var h=Tn();return nO(h,$t,o,c)},useMemoCache:K0,useCacheRefresh:CO};nb.useEffectEvent=pO;var zO={readContext:lr,use:em,useCallback:xO,useContext:lr,useEffect:Y0,useImperativeHandle:vO,useInsertionEffect:mO,useLayoutEffect:gO,useMemo:bO,useReducer:V0,useRef:fO,useState:function(){return V0(us)},useDebugValue:Z0,useDeferredValue:function(o,c){var h=Tn();return $t===null?X0(h,o,c):wO(h,$t.memoizedState,o,c)},useTransition:function(){var o=V0(us)[0],c=Tn().memoizedState;return[typeof o=="boolean"?o:af(o),c]},useSyncExternalStore:YE,useId:kO,useHostTransitionStatus:eb,useFormState:dO,useActionState:dO,useOptimistic:function(o,c){var h=Tn();return $t!==null?nO(h,$t,o,c):(h.baseState=o,[o,h.queue.dispatch])},useMemoCache:K0,useCacheRefresh:CO};zO.useEffectEvent=pO;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 TO(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 PO(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 RO(o){Mp(o)}function DO(o){console.error(o)}function MO(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 IO(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 LO(o){return o=ro(o),o.tag=3,o}function $O(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(){IO(c,h,y)}}var z=h.stateNode;z!==null&&typeof z.componentDidCatch=="function"&&(o.callback=function(){IO(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 pH(o,c,h,y,w){if(h.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(c=h.alternate,c!==null&&qc(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=LO(w),$O(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?FE(c,null,h,y):vl(c,o.child,h,y)}function BO(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),ds(o,c,w)):(wt&&L&&j0(c),c.flags|=1,cr(o,c,y,w),c.child)}function UO(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,qO(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 ds(o,c,w)}return c.flags|=1,o=as(N,y),o.ref=c.ref,o.return=c,c.child=o}function qO(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,ds(o,c,w)}return ob(o,c,h,y,w)}function FO(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 HO(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?GE(c,N):I0(),VE(c);else return y=c.lanes=536870912,HO(o,c,N!==null?N.baseLanes|h:h,h,y)}else N!==null?(Hp(c,N.cachePool),GE(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 HO(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(),VE(c),o!==null&&qc(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 KO(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 mH(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=rz(o,Oi),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=EE(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=KO(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||qc(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=KO(o,c,h)}else o=N.treeContext,nn=zi(z.nextSibling),or=c,wt=!0,Js=null,Oi=!1,o!==null&&zE(c,o),c=sm(c,y),c.flags|=4096;return c}return o=as(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),ds(o,c,w)):(wt&&y&&j0(c),c.flags|=1,cr(o,c,h,w),c.child)}function GO(o,c,h,y,w,N){return pl(c),c.updateQueue=null,h=WE(c,y,h,w),QE(o),y=q0(),o!==null&&!Ln?(F0(o,c,N),ds(o,c,N)):(wt&&y&&j0(c),c.flags|=1,cr(o,c,h,N),c.child)}function VO(o,c,h,y,w){if(pl(c),c.stateNode===null){var N=Lc,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):Lc,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=Lc,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)&&PO(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||TO(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=Lc,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)&&PO(c,N,y,K),no=!1,le=c.memoizedState,N.state=le,nf(c,y,N,w),tf();var de=c.memoizedState;z!==we||le!==de||no||o!==null&&o.dependencies!==null&&qp(o.dependencies)?(typeof L=="function"&&(rb(c,h,L,y),de=c.memoizedState),(ge=no||TO(c,h,ge,y,le,de,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,de,K),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(y,de,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=de),N.props=y,N.state=de,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=ds(o,c,w),o}function QO(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:IE()}}function ub(o,c,h){return o=o!==null?o.childLanes&~h:0,c&&(o|=ci),o}function WO(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=rz(o,Oi),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=EE(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||qc(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,Oi=!1,o!==null&&zE(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=as(K,{mode:"hidden",children:y.children}),y.subtreeFlags=K.subtreeFlags&65011712,ae!==null?L=as(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=IE(),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=as(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 YO(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 ZO(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&&YO(o,h,c);else if(o.tag===19)YO(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 ds(o,c,h){if(o!==null&&(c.dependencies=o.dependencies),co|=c.lanes,(h&c.childLanes)===0)if(o!==null){if(qc(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=as(o,o.pendingProps),c.child=h,h.return=c;o.sibling!==null;)o=o.sibling,h=h.sibling=as(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 gH(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:me(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?WO(o,c,h):(ao(c),o=ds(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||(qc(o,c,h,!1),y=(h&c.childLanes)!==0),w){if(y)return ZO(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,FO(o,c,h,c.pendingProps);case 24:to(c,Mn,o.memoizedState.cache)}return ds(o,c,h)}function XO(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,gH(o,c,h);Ln=(o.flags&131072)!==0}else Ln=!1,wt&&(c.flags&1048576)!==0&&_E(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=VO(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=BO(null,c,o,y,h);break e}else if(w===_){c.tag=14,c=UO(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),VO(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&&E0(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=QO(o,c,y,h);break e}else if(y!==w){w=Ci(Error(r(424)),c),Wd(w),c=QO(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,Oi=!0,h=FE(c,null,y,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(fl(),y===w){c=ds(o,c,h);break e}cr(o,c,y,h)}c=c.child}return c;case 26:return om(o,c),o===null?(h=cz(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=cz(c.type,o.memoizedProps,c.pendingProps,o.memoizedState),null;case 27:return me(c),o===null&&wt&&(y=c.stateNode=sz(c.type,c.pendingProps,ne.current),or=c,Oi=!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=GH(y,c.type,c.pendingProps,Oi),y!==null?(c.stateNode=y,or=c,nn=zi(y.firstChild),Oi=!1,w=!0):w=!1),w||eo(c)),me(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,oH,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=VH(h,c.pendingProps,Oi),h!==null?(c.stateNode=h,or=c,nn=null,o=!0):o=!1),o||eo(c)),null;case 13:return WO(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 BO(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 UO(o,c,c.type,c.pendingProps,h);case 15:return qO(o,c,c.type,c.pendingProps,h);case 19:return ZO(o,c,h);case 31:return mH(o,c,h);case 22:return FO(o,c,h,c.pendingProps);case 24:return pl(c),y=lr(Mn),o===null?(w=z0(),w===null&&(w=Vt,N=O0(),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&&E0(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 fs(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(k_())o.flags|=8192;else throw yl=Gp,T0}else o.flags&=-16777217}function JO(o,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!pz(c))if(k_())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,eu|=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 yH(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),ls(Mn),ee(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(Uc(c)?fs(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?(fs(c),N!==null?(rn(c),JO(c,N)):(rn(c),mb(c,w,null,y,h))):N?N!==o.memoizedState?(fs(c),rn(c),JO(c,N)):(rn(c),c.flags&=-16777217):(o=o.memoizedProps,o!==y&&fs(c),rn(c),mb(c,w,o,y,h)),null;case 27:if(Oe(c),h=ne.current,w=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==y&&fs(c);else{if(!y){if(c.stateNode===null)throw Error(r(166));return rn(c),null}o=G.current,Uc(c)?TE(c):(o=sz(w,y,h),c.stateNode=o,fs(c))}return rn(c),null;case 5:if(Oe(c),w=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==y&&fs(c);else{if(!y){if(c.stateNode===null)throw Error(r(166));return rn(c),null}if(N=G.current,Uc(c))TE(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&&fs(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&&fs(c);else{if(typeof y!="string"&&c.stateNode===null)throw Error(r(166));if(o=ne.current,Uc(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||W_(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=Uc(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=Uc(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 ls(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;)AE(h,o),h=h.sibling;return D(zn,zn.current&1|2),wt&&ss(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&&ss(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),ls(Mn),rn(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function vH(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 ls(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 Oe(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 ls(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 ls(Mn),null;case 25:return null;default:return null}}function e_(o,c){switch(S0(c),c.tag){case 3:ls(Mn),ee();break;case 26:case 27:case 5:Oe(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:ls(c.type);break;case 22:case 23:oi(c),L0(),o!==null&&q(ml);break;case 24:ls(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 t_(o){var c=o.updateQueue;if(c!==null){var h=o.stateNode;try{KE(c,h)}catch(y){It(o,o.return,y)}}}function n_(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 r_(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;BH(y,o.type,h,c),y[St]=c}catch(w){It(o,o.return,w)}}function i_(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||i_(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=rs));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 a_(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 hs=!1,$n=!1,xb=!1,s_=typeof WeakSet=="function"?WeakSet:Set,Xn=null;function xH(o,c){if(o=o.containerInfo,Bb=zm,o=vE(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 de;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),(de=we.firstChild)!==null;)le=we,we=de;for(;;){if(we===o)break t;if(le===h&&++ae===w&&(L=z),le===N&&++ge===y&&(K=z),(de=we.nextSibling)!==null)break;we=le,le=we.parentNode}we=de}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 o_(o,c,h){var y=h.flags;switch(h.tag){case 0:case 11:case 15:ms(o,h),y&4&&uf(5,h);break;case 1:if(ms(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&&t_(h),y&512&&df(h,h.return);break;case 3:if(ms(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{KE(o,c)}catch(z){It(h,h.return,z)}}break;case 27:c===null&&y&4&&a_(h);case 26:case 5:ms(o,h),c===null&&y&4&&r_(h),y&512&&df(h,h.return);break;case 12:ms(o,h);break;case 31:ms(o,h),y&4&&u_(o,h);break;case 13:ms(o,h),y&4&&d_(o,h),y&64&&(o=h.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(h=EH.bind(null,h),QH(o,h))));break;case 22:if(y=h.memoizedState!==null||hs,!y){c=c!==null&&c.memoizedState!==null||$n,w=hs;var N=$n;hs=y,($n=c)&&!N?gs(o,h,(h.subtreeFlags&8772)!==0):ms(o,h),hs=w,$n=N}break;case 30:break;default:ms(o,h)}}function l_(o){var c=o.alternate;c!==null&&(o.alternate=null,l_(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 ps(o,c,h){for(h=h.child;h!==null;)c_(o,c,h),h=h.sibling}function c_(o,c,h){if(We&&typeof We.onCommitFiberUnmount=="function")try{We.onCommitFiberUnmount(gn,h)}catch{}switch(h.tag){case 26:$n||Ca(h,c),ps(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),ps(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,ps(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,tz(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,h.stateNode),lu(o)):tz(un,h.stateNode));break;case 4:y=un,w=qr,un=h.stateNode.containerInfo,qr=!0,ps(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),ps(o,c,h);break;case 1:$n||(Ca(h,c),y=h.stateNode,typeof y.componentWillUnmount=="function"&&n_(h,c,y)),ps(o,c,h);break;case 21:ps(o,c,h);break;case 22:$n=(y=$n)||h.memoizedState!==null,ps(o,c,h),$n=y;break;default:ps(o,c,h)}}function u_(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{lu(o)}catch(h){It(c,c.return,h)}}}function d_(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{lu(o)}catch(h){It(c,c.return,h)}}function bH(o){switch(o.tag){case 31:case 13:case 19:var c=o.stateNode;return c===null&&(c=o.stateNode=new s_),c;case 22:return o=o.stateNode,c=o._retryCache,c===null&&(c=o._retryCache=new s_),c;default:throw Error(r(435,o.tag))}}function dm(o,c){var h=bH(o);c.forEach(function(y){if(!h.has(y)){h.add(y);var w=OH.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));c_(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;)f_(c,o),c=c.sibling}var na=null;function f_(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&&hs&&(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=fz("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=fz("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 hz(w,o.type,o.stateNode);else o.stateNode=dz(w,y,o.memoizedProps);else N!==y?(N===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):N.count--,y===null?hz(w,o.type,o.stateNode):dz(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{zc(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{lu(c.containerInfo)}catch(De){It(o,o.return,De)}xb&&(xb=!1,h_(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=hs,ge=$n;if(hs=ae||w,$n=ge||K,Fr(c,o),$n=ge,hs=ae,Hr(o),y&8192)e:for(c=o.stateNode,c._visibility=w?c._visibility&-2:c._visibility|1,w&&(h===null||K||hs||$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 de=K.stateNode;w?nz(de,!0):nz(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(i_(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&&(zc(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 h_(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var c=o;h_(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),o=o.sibling}}function ms(o,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)o_(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"&&n_(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 gs(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:gs(w,N,h),uf(4,N);break;case 1:if(gs(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++)HE(K[w],L)}catch(ae){It(y,y.return,ae)}}h&&z&64&&t_(N),df(N,N.return);break;case 27:a_(N);case 26:case 5:gs(w,N,h),h&&y===null&&z&4&&r_(N),df(N,N.return);break;case 12:gs(w,N,h);break;case 31:gs(w,N,h),h&&z&4&&u_(w,N);break;case 13:gs(w,N,h),h&&z&4&&d_(w,N);break;case 22:N.memoizedState===null&&gs(w,N,h),df(N,N.return);break;case 30:break;default:gs(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;)p_(o,c,h,y),c=c.sibling}function p_(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,Zc(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 Zc(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:Zc(N,z,L,K,w),uf(8,z);break;case 23:break;case 22:var ge=z.stateNode;z.memoizedState!==null?ge._visibility&2?Zc(N,z,L,K,w):ff(N,z):(ge._visibility|=2,Zc(N,z,L,K,w)),w&&ae&2048&&bb(z.alternate,z);break;case 24:Zc(N,z,L,K,w),w&&ae&2048&&wb(z.alternate,z);break;default:Zc(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 Xc(o,c,h){if(o.subtreeFlags&hf)for(o=o.child;o!==null;)m_(o,c,h),o=o.sibling}function m_(o,c,h){switch(o.tag){case 26:Xc(o,c,h),o.flags&hf&&o.memoizedState!==null&&sK(h,na,o.memoizedState,o.memoizedProps);break;case 5:Xc(o,c,h);break;case 3:case 4:var y=na;na=km(o.stateNode.containerInfo),Xc(o,c,h),na=y;break;case 22:o.memoizedState===null&&(y=o.alternate,y!==null&&y.memoizedState!==null?(y=hf,hf=16777216,Xc(o,c,h),hf=y):Xc(o,c,h));break;default:Xc(o,c,h)}}function g_(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,v_(y,o)}g_(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)y_(o),o=o.sibling}function y_(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,v_(y,o)}g_(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 v_(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(l_(y),y===h){Xn=null;break e}if(w!==null){w.return=N,Xn=w;break e}Xn=N}}}var wH={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}},jH=typeof WeakMap=="function"?WeakMap:Map,Tt=0,Vt=null,gt=null,xt=0,Mt=0,li=null,lo=!1,Jc=!1,jb=!1,ys=0,Sn=0,co=0,jl=0,Sb=0,ci=0,eu=0,mf=null,Kr=null,Nb=!1,hm=0,x_=0,pm=1/0,mm=null,uo=null,Hn=0,fo=null,tu=null,vs=0,kb=0,Cb=null,b_=null,gf=0,Ab=null;function ui(){return(Tt&2)!==0&&xt!==0?xt&-xt:H.T!==null?Pb():Ld()}function w_(){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)&&(nu(o,0),ho(o,xt,ci,!1)),Vs(o,h),((Tt&2)===0||o!==Vt)&&(o===Vt&&((Tt&2)===0&&(jl|=h),Sn===4&&ho(o,xt,ci,!1)),Aa(o))}function j_(o,c,h){if((Tt&6)!==0)throw Error(r(327));var y=!h&&(c&127)===0&&(c&o.expiredLanes)===0||Xi(o,c),w=y?kH(o,c):Ob(o,c,!0),N=y;do{if(w===0){Jc&&!y&&ho(o,c,0,!1);break}else{if(h=o.current.alternate,N&&!SH(h)){w=Ob(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&&(nu(L,z).flags|=256),z=Ob(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){nu(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;vs=c,y.timeoutHandle=J_(S_.bind(null,y,h,Kr,mm,Nb,c,ci,jl,eu,lo,N,"Throttled",-0,0),w);break e}S_(y,h,Kr,mm,Nb,c,ci,jl,eu,lo,N,null,-0,0)}}break}while(!0);Aa(o)}function S_(o,c,h,y,w,N,z,L,K,ae,ge,we,le,de){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:rs},m_(c,N,we);var De=(N&62914560)===N?hm-mt():(N&4194048)===N?x_-mt():0;if(De=oK(we,De),De!==null){vs=N,o.cancelPendingCommit=De(z_.bind(null,o,c,N,h,y,w,z,L,K,ge,we,null,le,de)),ho(o,N,z,!ae);return}}z_(o,c,N,h,y,w,z,L,K)}function SH(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-fe(w),z=1<<N;y[N]=-1,w&=~z}h!==0&&Dd(o,h,c)}function gm(){return(Tt&6)===0?(yf(0),!1):!0}function Eb(){if(gt!==null){if(Mt===0)var o=gt.return;else o=gt,os=hl=null,H0(o),Gc=null,Xd=0,o=gt;for(;o!==null;)e_(o.alternate,o),o=o.return;gt=null}}function nu(o,c){var h=o.timeoutHandle;h!==-1&&(o.timeoutHandle=-1,FH(h)),h=o.cancelPendingCommit,h!==null&&(o.cancelPendingCommit=null,h()),vs=0,Eb(),Vt=o,gt=h=as(o.current,null),xt=c,Mt=0,li=null,lo=!1,Jc=Xi(o,c),jb=!1,eu=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-fe(y),N=1<<w;c|=o[w],y&=~N}return ys=c,Ip(),h}function N_(o,c){st=null,H.H=of,c===Kc||c===Kp?(c=BE(),Mt=3):c===T0?(c=BE(),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 k_(){var o=si.current;return o===null?!0:(xt&4194048)===xt?_i===null:(xt&62914560)===xt||(xt&536870912)!==0?o===_i:!1}function C_(){var o=H.H;return H.H=of,o===null?of:o}function A_(){var o=H.A;return H.A=wH,o}function ym(){Sn=4,lo||(xt&4194048)!==xt&&si.current!==null||(Jc=!0),(co&134217727)===0&&(jl&134217727)===0||Vt===null||ho(Vt,xt,ci,!1)}function Ob(o,c,h){var y=Tt;Tt|=2;var w=C_(),N=A_();(Vt!==o||xt!==c)&&(mm=null,nu(o,c)),c=!1;var z=Sn;e:do try{if(Mt!==0&&gt!==null){var L=gt,K=li;switch(Mt){case 8:Eb(),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,ru(o,L,K,ae),h&&Jc){z=0;break e}break;default:ae=Mt,Mt=0,li=null,ru(o,L,K,ae)}}NH(),z=Sn;break}catch(ge){N_(o,ge)}while(!0);return c&&o.shellSuspendCounter++,os=hl=null,Tt=y,H.H=w,H.A=N,gt===null&&(Vt=null,xt=0,Ip()),z}function NH(){for(;gt!==null;)E_(gt)}function kH(o,c){var h=Tt;Tt|=2;var y=C_(),w=A_();Vt!==o||xt!==c?(mm=null,pm=mt()+500,nu(o,c)):Jc=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,ru(o,c,N,1);break;case 2:case 9:if(LE(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:LE(N)?(Mt=0,li=null,O_(c)):(Mt=0,li=null,ru(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?pz(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,ru(o,c,N,5);break;case 6:Mt=0,li=null,ru(o,c,N,6);break;case 8:Eb(),Sn=6;break e;default:throw Error(r(462))}}CH();break}catch(ge){N_(o,ge)}while(!0);return os=hl=null,H.H=y,H.A=w,Tt=h,gt!==null?0:(Vt=null,xt=0,Ip(),Sn)}function CH(){for(;gt!==null&&!Xe();)E_(gt)}function E_(o){var c=XO(o.alternate,o,ys);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=GO(h,c,c.pendingProps,c.type,void 0,xt);break;case 11:c=GO(h,c,c.pendingProps,c.type.render,c.ref,xt);break;case 5:H0(c);default:e_(h,c),c=gt=AE(c,ys),c=XO(h,c,ys)}o.memoizedProps=o.pendingProps,c===null?vm(o):gt=c}function ru(o,c,h,y){os=hl=null,H0(c),Gc=null,Xd=0;var w=c.return;try{if(pH(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:Jc||(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))),__(c,o)):vm(c)}function vm(o){var c=o;do{if((c.flags&32768)!==0){__(c,lo);return}o=c.return;var h=yH(c.alternate,c,ys);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 __(o,c){do{var h=vH(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 z_(o,c,h,y,w,N,z,L,K){o.cancelPendingCommit=null;do xm();while(Hn!==0);if((Tt&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),tu=c,fo=o,vs=h,kb=N,Cb=w,b_=y,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,_H(Me,function(){return M_(),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=Tt,Tt|=4;try{xH(o,c,h)}finally{Tt=z,J.p=w,H.T=y}}Hn=1,T_(),P_(),R_()}}function T_(){if(Hn===1){Hn=0;var o=fo,c=tu,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=Tt;Tt|=4;try{f_(c,o);var N=Ub,z=vE(o.containerInfo),L=N.focusedElem,K=N.selectionRange;if(z!==L&&L&&L.ownerDocument&&yE(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 de=le.getSelection(),De=L.textContent.length,Ye=Math.min(K.start,De),Ut=K.end===void 0?Ye:Math.min(K.end,De);!de.extend&&Ye>Ut&&(z=Ut,Ut=Ye,Ye=z);var te=gE(L,Ye),W=gE(L,Ut);if(te&&W&&(de.rangeCount!==1||de.anchorNode!==te.node||de.anchorOffset!==te.offset||de.focusNode!==W.node||de.focusOffset!==W.offset)){var ie=we.createRange();ie.setStart(te.node,te.offset),de.removeAllRanges(),Ye>Ut?(de.addRange(ie),de.extend(W.node,W.offset)):(ie.setEnd(W.node,W.offset),de.addRange(ie))}}}}for(we=[],de=L;de=de.parentNode;)de.nodeType===1&&we.push({element:de,left:de.scrollLeft,top:de.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{Tt=w,J.p=y,H.T=h}}o.current=c,Hn=2}}function P_(){if(Hn===2){Hn=0;var o=fo,c=tu,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=Tt;Tt|=4;try{o_(o,c.alternate,c)}finally{Tt=w,J.p=y,H.T=h}}Hn=3}}function R_(){if(Hn===4||Hn===3){Hn=0,Rt();var o=fo,c=tu,h=vs,y=b_;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Hn=5:(Hn=0,tu=fo=null,D_(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}}(vs&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 D_(o,c){(o.pooledCacheLanes&=c)===0&&(c=o.pooledCache,c!=null&&(o.pooledCache=null,Yd(c)))}function xm(){return T_(),P_(),R_(),M_()}function M_(){if(Hn!==5)return!1;var o=fo,c=kb;kb=0;var h=Id(vs),y=H.T,w=J.p;try{J.p=32>h?32:h,H.T=null,h=Cb,Cb=null;var N=fo,z=vs;if(Hn=0,tu=fo=null,vs=0,(Tt&6)!==0)throw Error(r(331));var L=Tt;if(Tt|=4,y_(N.current),p_(N,N.current,z,h),Tt=L,yf(0,!1),We&&typeof We.onPostCommitFiberRoot=="function")try{We.onPostCommitFiberRoot(gn,N)}catch{}return!0}finally{J.p=w,H.T=y,D_(o,c)}}function I_(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)I_(o,o,h);else for(;c!==null;){if(c.tag===3){I_(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=LO(2),y=io(c,h,2),y!==null&&($O(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 jH;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=AH.bind(null,o,c,h),c.then(o,o))}function AH(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?(Tt&2)===0&&nu(o,0):Sb|=h,eu===xt&&(eu=0)),Aa(o)}function L_(o,c){c===0&&(c=Sp()),o=ul(o,c),o!==null&&(Vs(o,c),Aa(o))}function EH(o){var c=o.memoizedState,h=0;c!==null&&(h=c.retryLane),L_(o,h)}function OH(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),L_(o,h)}function _H(o,c){return en(o,c)}var bm=null,iu=null,zb=!1,wm=!1,Tb=!1,po=0;function Aa(o){o!==iu&&o.next===null&&(iu===null?bm=iu=o:iu=iu.next=o),wm=!0,zb||(zb=!0,TH())}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-fe(42|o)+1)-1,N&=w&~(z&~L),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(h=!0,q_(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,q_(y,N));y=y.next}while(h);Tb=!1}}function zH(){$_()}function $_(){wm=zb=!1;var o=0;po!==0&&qH()&&(o=po);for(var c=mt(),h=null,y=bm;y!==null;){var w=y.next,N=B_(y,c);N===0?(y.next=null,h===null?bm=w:h.next=w,w===null&&(iu=h)):(h=y,(o!==0||(N&3)!==0)&&(wm=!0)),y=w}Hn!==0&&Hn!==5||yf(o),po!==0&&(po=0)}function B_(o,c){for(var h=o.suspendedLanes,y=o.pingedLanes,w=o.expirationTimes,N=o.pendingLanes&-62914561;0<N;){var z=31-fe(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=U_.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 U_(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:(j_(o,y,c),B_(o,mt()),o.callbackNode!=null&&o.callbackNode===h?U_.bind(null,o):null)}function q_(o,c){if(xm())return null;j_(o,c,!0)}function TH(){HH(function(){(Tt&6)!==0?en(ue,zH):$_()})}function Pb(){if(po===0){var o=Fc;o===0&&(o=Fn,Fn<<=1,(Fn&261888)===0&&(Fn=256)),po=o}return po}function F_(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Op(""+o)}function H_(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 PH(o,c,h,y,w){if(c==="submit"&&h&&h.stateNode===w){var N=F_((w[St]||null).action),z=y.submitter;z&&(c=(c=z[St]||null)?F_(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?H_(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?H_(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],RH=Db.toLowerCase(),DH=Db[0].toUpperCase()+Db.slice(1);ta(RH,"on"+DH)}ta(wE,"onAnimationEnd"),ta(jE,"onAnimationIteration"),ta(SE,"onAnimationStart"),ta("dblclick","onDoubleClick"),ta("focusin","onFocus"),ta("focusout","onBlur"),ta(Z9,"onTransitionRun"),ta(X9,"onTransitionStart"),ta(J9,"onTransitionCancel"),ta(NE,"onTransitionEnd"),ut("onMouseEnter",["mouseout","mouseover"]),ut("onMouseLeave",["mouseout","mouseover"]),ut("onPointerEnter",["pointerout","pointerover"]),ut("onPointerLeave",["pointerout","pointerover"]),ts("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ts("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ts("onBeforeInput",["compositionend","keypress","textInput","paste"]),ts("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ts("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ts("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(" "),MH=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vf));function K_(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)||(G_(c,o,2,!1),h.add(y))}function Mb(o,c,h){var y=0;c&&(y|=4),G_(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"&&(MH.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 G_(o,c,h,y){switch(wz(c)){case 2:var w=uK;break;case 8:w=dK;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}ZA(function(){var ae=N,ge=t0(h),we=[];e:{var le=kE.get(o);if(le!==void 0){var de=Pp,De=o;switch(o){case"keypress":if(zp(h)===0)break e;case"keydown":case"keyup":de=O9;break;case"focusin":De="focus",de=o0;break;case"focusout":De="blur",de=o0;break;case"beforeblur":case"afterblur":de=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":de=eE;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=y9;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=T9;break;case wE:case jE:case SE:de=b9;break;case NE:de=R9;break;case"scroll":case"scrollend":de=m9;break;case"wheel":de=M9;break;case"copy":case"cut":case"paste":de=j9;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=nE;break;case"toggle":case"beforetoggle":de=L9}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 de(le,De,null,h,ge),we.push({event:le,listeners:Ye}))}}if((c&7)===0){e:{if(le=o==="mouseover"||o==="pointerover",de=o==="mouseout"||o==="pointerout",le&&h!==e0&&(De=h.relatedTarget||h.fromElement)&&(ji(De)||De[_n]))break e;if((de||le)&&(le=ge.window===ge?ge:(le=ge.ownerDocument)?le.defaultView||le.parentWindow:window,de?(De=h.relatedTarget||h.toElement,de=ae,De=De?ji(De):null,De!==null&&(Ut=a(De),Ye=De.tag,De!==Ut||Ye!==5&&Ye!==27&&Ye!==6)&&(De=null)):(de=null,De=ae),de!==De)){if(Ye=eE,xe="onMouseLeave",te="onMouseEnter",W="mouse",(o==="pointerout"||o==="pointerover")&&(Ye=nE,xe="onPointerLeave",te="onPointerEnter",W="pointer"),Ut=de==null?le:Ws(de),ie=De==null?le:Ws(De),le=new Ye(xe,W+"leave",de,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,de&&De)t:{for(Ye=IH,te=de,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;de!==null&&V_(we,le,de,Ye,!1),De!==null&&Ut!==null&&V_(we,Ut,De,Ye,!0)}}e:{if(le=ae?Ws(ae):window,de=le.nodeName&&le.nodeName.toLowerCase(),de==="select"||de==="input"&&le.type==="file")var Ct=uE;else if(lE(le))if(dE)Ct=Q9;else{Ct=G9;var Be=K9}else de=le.nodeName,!de||de.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?ae&&Jx(ae.elementType)&&(Ct=uE):Ct=V9;if(Ct&&(Ct=Ct(o,ae))){cE(we,Ct,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":(lE(Be)||Be.contentEditable==="true")&&(Dc=Be,h0=ae,Vd=null);break;case"focusout":Vd=h0=Dc=null;break;case"mousedown":p0=!0;break;case"contextmenu":case"mouseup":case"dragend":p0=!1,xE(we,h,ge);break;case"selectionchange":if(Y9)break;case"keydown":case"keyup":xE(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 Rc?sE(o,h)&&(bt="onCompositionEnd"):o==="keydown"&&h.keyCode===229&&(bt="onCompositionStart");bt&&(rE&&h.locale!=="ko"&&(Rc||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&Rc&&(ot=XA()):(Zs=ge,i0="value"in Zs?Zs.value:Zs.textContent,Rc=!0)),Be=Sm(ae,bt),0<Be.length&&(bt=new tE(bt,o,null,h,ge),we.push({event:bt,listeners:Be}),ot?bt.data=ot:(ot=oE(h),ot!==null&&(bt.data=ot)))),(ot=B9?U9(o,h):q9(o,h))&&(bt=Sm(ae,"onBeforeInput"),0<bt.length&&(Be=new tE("onBeforeInput","beforeinput",null,h,ge),we.push({event:Be,listeners:bt}),Be.data=ot)),PH(we,o,ae,h,ge)}K_(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 IH(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function V_(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 LH=/\r\n?/g,$H=/\u0000|\uFFFD/g;function Q_(o){return(typeof o=="string"?o:""+o).replace(LH,`
9
- `).replace($H,"")}function W_(o,c){return c=Q_(c),Q_(o)===c}function Bt(o,c,h,y,w,N){switch(h){case"children":typeof y=="string"?c==="body"||c==="textarea"&&y===""||zc(o,y):(typeof y=="number"||typeof y=="bigint")&&c!=="body"&&zc(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":WA(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=Op(""+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=Op(""+y),o.setAttribute(h,y);break;case"onClick":y!=null&&(o.onclick=rs);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=Op(""+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":ns(o,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":ns(o,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":ns(o,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":ns(o,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":ns(o,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":ns(o,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":ns(o,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":ns(o,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":ns(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=h9.get(h)||h,sl(o,h,y))}}function $b(o,c,h,y,w,N){switch(h){case"style":WA(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"?zc(o,y):(typeof y=="number"||typeof y=="bigint")&&zc(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=rs);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)}}KA(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?_c(o,!!y,c,!1):h!=null&&_c(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)}VA(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 BH(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(de in h){var we=h[de];if(h.hasOwnProperty(de)&&we!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":K=we;default:y.hasOwnProperty(de)||Bt(o,c,de,null,y,we)}}for(var le in y){var de=y[le];if(we=h[le],y.hasOwnProperty(le)&&(de!=null||we!=null))switch(le){case"type":N=de;break;case"name":w=de;break;case"checked":ae=de;break;case"defaultChecked":ge=de;break;case"value":z=de;break;case"defaultValue":L=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,c));break;default:de!==we&&Bt(o,c,le,de,y,we)}}Zx(o,z,L,K,ae,ge,N,w);return;case"select":de=z=L=le=null;for(N in h)if(K=h[N],h.hasOwnProperty(N)&&K!=null)switch(N){case"value":break;case"multiple":de=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=de,le!=null?_c(o,!!h,le,!1):!!y!=!!h&&(c!=null?_c(o,!!h,c,!0):_c(o,!!h,h?[]:"",!1));return;case"textarea":de=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":de=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)}GA(o,le,de);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],de=h[K],y.hasOwnProperty(K)&&le!==de&&(le!=null||de!=null)&&(K==="selected"?o.selected=le&&typeof le!="function"&&typeof le!="symbol":Bt(o,c,K,le,y,de));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],de=h[ae],y.hasOwnProperty(ae)&&le!==de&&(le!=null||de!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,c));break;default:Bt(o,c,ae,le,y,de)}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],de=h[ge],!y.hasOwnProperty(ge)||le===de||le===void 0&&de===void 0||$b(o,c,ge,le,y,de);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],de=h[we],!y.hasOwnProperty(we)||le===de||le==null&&de==null||Bt(o,c,we,le,y,de)}function Y_(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function UH(){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&&Y_(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&&Y_(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 Z_(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 X_(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 qH(){var o=window.event;return o&&o.type==="popstate"?o===Fb?!1:(Fb=o,!0):(Fb=null,!1)}var J_=typeof setTimeout=="function"?setTimeout:void 0,FH=typeof clearTimeout=="function"?clearTimeout:void 0,ez=typeof Promise=="function"?Promise:void 0,HH=typeof queueMicrotask=="function"?queueMicrotask:typeof ez<"u"?function(o){return ez.resolve(null).then(o).catch(KH)}:J_;function KH(o){setTimeout(function(){throw o})}function mo(o){return o==="head"}function tz(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),lu(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);lu(c)}function nz(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 GH(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 VH(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 rz(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 QH(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 iz(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 az(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 sz(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,oz=new Set;function km(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var xs=J.d;J.d={f:WH,r:YH,D:ZH,C:XH,L:JH,m:eK,X:nK,S:tK,M:rK};function WH(){var o=xs.f(),c=gm();return o||c}function YH(o){var c=Ji(o);c!==null&&c.tag===5&&c.type==="form"?NO(c):xs.r(o)}var au=typeof document>"u"?null:document;function lz(o,c,h){var y=au;if(y&&typeof c=="string"&&c){var w=Ni(c);w='link[rel="'+o+'"][href="'+w+'"]',typeof h=="string"&&(w+='[crossorigin="'+h+'"]'),oz.has(w)||(oz.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 ZH(o){xs.D(o),lz("dns-prefetch",o,null)}function XH(o,c){xs.C(o,c),lz("preconnect",o,c)}function JH(o,c,h){xs.L(o,c,h);var y=au;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=su(o);break;case"script":N=ou(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 eK(o,c){xs.m(o,c);var h=au;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=ou(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 tK(o,c,h){xs.S(o,c,h);var y=au;if(y&&o){var w=Ys(y).hoistableStyles,N=su(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 nK(o,c){xs.X(o,c);var h=au;if(h&&o){var y=Ys(h).hoistableScripts,w=ou(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 rK(o,c){xs.M(o,c);var h=au;if(h&&o){var y=Ys(h).hoistableScripts,w=ou(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 cz(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=su(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=su(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||iK(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=ou(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 su(o){return'href="'+Ni(o)+'"'}function wf(o){return'link[rel="stylesheet"]['+o+"]"}function uz(o){return m({},o,{"data-precedence":o.precedence,precedence:null})}function iK(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 ou(o){return'[src="'+Ni(o)+'"]'}function jf(o){return"script[async]"+o}function dz(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=su(h.href);var N=o.querySelector(wf(w));if(N)return c.state.loading|=4,c.instance=N,yn(N),N;y=uz(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=ou(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 fz(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 hz(o,c,h){o=o.ownerDocument||o,o.head.insertBefore(h,c==="title"?o.querySelector("head > title"):null)}function aK(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 pz(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function sK(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=su(y.href),N=c.querySelector(wf(w));if(N){c=N._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(o.count++,o=Em.bind(o),c.then(o,o)),h.state.loading|=4,h.instance=N,yn(N);return}N=c.ownerDocument||c,y=uz(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=Em.bind(o),c.addEventListener("load",h),c.addEventListener("error",h))}}var Yb=0;function oK(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*UH());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 Em(){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 Om=null;function _m(o,c){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Om=new Map,c.forEach(lK,o),Om=null,Em.call(o))}function lK(o,c){if(!(c.state.loading&4)){var h=Om.get(o);if(h)var y=h.get(null);else{h=new Map,Om.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=Em.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 cK(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 mz(o,c,h,y,w,N,z,L,K,ae,ge,we){return o=new cK(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=O0(),c.refCount++,o.pooledCache=c,c.refCount++,N.memoizedState={element:y,isDehydrated:h,cache:c},P0(N),o}function gz(o){return o?(o=Lc,o):Lc}function yz(o,c,h,y,w,N){w=gz(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 vz(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){vz(o,c),(o=o.alternate)&&vz(o,c)}function xz(o){if(o.tag===13||o.tag===31){var c=ul(o,67108864);c!==null&&Gr(c,o,67108864),Zb(o,67108864)}}function bz(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 uK(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 dK(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),jz(o,y);else if(hK(w,o,c,h,y))y.stopPropagation();else if(jz(o,y),c&4&&-1<fK.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=On(N.pendingLanes);if(z!==0){var L=N;for(L.pendingLanes|=2,L.entangledLanes|=2;z;){var K=1<<31-fe(z);L.entanglements[1]|=K,z&=~K}Aa(N),(Tt&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 wz(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 ue: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=[],fK="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 jz(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&&xz(c)),o):(o.eventSystemFlags|=y,c=o.targetContainers,w!==null&&c.indexOf(w)===-1&&c.push(w),o)}function hK(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 Sz(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(){bz(h)});return}}else if(c===31){if(c=u(h),c!==null){o.blockedOn=c,Q(o.priority,function(){bz(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&&xz(c),o.blockedOn=h,!1;c.shift()}return!0}function Nz(o,c,h){Pm(o)&&h.delete(c)}function pK(){tw=!1,go!==null&&Pm(go)&&(go=null),yo!==null&&Pm(yo)&&(yo=null),vo!==null&&Pm(vo)&&(vo=null),Nf.forEach(Nz),kf.forEach(Nz)}function Rm(o,c){o.blockedOn===c&&(o.blockedOn=null,tw||(tw=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,pK)))}var Dm=null;function kz(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 lu(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);)Sz(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||kz(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),kz(h)}}}function Cz(){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();yz(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;yz(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&&Sz(o)}};var Az=t.version;if(Az!=="19.2.4")throw Error(r(527,Az,"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 mK={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(mK),We=Im}catch{}}return Ef.createRoot=function(o,c){if(!i(o))throw Error(r(299));var h=!1,y="",w=RO,N=DO,z=MO;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=mz(o,1,!1,null,null,h,y,null,w,N,z,Cz),o[_n]=c.current,Ib(o),new nw(c)},Ef.hydrateRoot=function(o,c,h){if(!i(o))throw Error(r(299));var y=!1,w="",N=RO,z=DO,L=MO,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=mz(o,1,!0,c,h??null,y,w,K,N,z,L,Cz),c.context=gz(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)},Ef.version="19.2.4",Ef}var Iz;function kK(){if(Iz)return aw.exports;Iz=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=NK(),aw.exports}var CK=kK(),yc=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(){}},AK={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},EK=class{#t=AK;#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 EK;function OK(e){setTimeout(e,0)}var Jl=typeof window>"u"||"Deno"in globalThis;function br(){}function _K(e,t){return typeof e=="function"?e(t):e}function PS(e){return typeof e=="number"&&e>=0&&e!==1/0}function FL(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 Lz(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 $z(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 zK=Object.prototype.hasOwnProperty;function AN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Bz(e)&&Bz(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:zK.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 Bz(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function RS(e){if(!Uz(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Uz(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Uz(e){return Object.prototype.toString.call(e)==="[object Object]"}function TK(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 PK(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function RK(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var EN=Symbol();function HL(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===EN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ON(e,t){return typeof e=="function"?e(...t):!!e}function DK(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 MK=class extends yc{#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 MK;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 IK=OK;function LK(){let e=[],t=0,n=u=>{u()},r=u=>{u()},i=IK;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=LK(),$K=class extends yc{#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 $K;function BK(e){return Math.min(1e3*2**e,3e4)}function KL(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 GL(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=()=>KL(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 O=e.retry??(Jl?0:3),C=e.retryDelay??BK,A=typeof C=="function"?C(n,k):C,T=O===!0||typeof O=="number"&&n<O||typeof O=="function"&&O(n,k);if(t||!T){g(k);return}n++,e.onFail?.(n,k),TK(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 VL=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)}},UK=class extends VL{#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=Fz(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=Fz(this.options);t.data!==void 0&&(this.setState(qz(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===EN||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:!FL(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=HL(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=GL({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,...QL(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...qz(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 QL(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:KL(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function qz(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Fz(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 yc{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),Hz(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&&Kz(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 FK(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=FL(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&&Hz(e,t),F=P&&Kz(e,n,t,r);($||F)&&(p={...p,...QL(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",O=b==="pending",C=b==="error",A=O&&k,T=g!==void 0,_={status:b,fetchStatus:p.fetchStatus,isPending:O,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&&!O,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 qK(e,t){return Ii(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Hz(e,t){return qK(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 Kz(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 FK(e,t){return!gh(e.getCurrentResult(),t)}function Gz(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=>{DK(j,()=>t.signal,()=>p=!0)},g=HL(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 O=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:b,direction:S?"backward":"forward",meta:t.options.meta};return m(E),E})(),C=await g(O),{maxPages:A}=t.options,T=S?RK:PK;return{pages:T(j.pages,C,A),pageParams:T(j.pageParams,b,A)}};if(i&&a.length){const j=i==="backward",b=j?HK:Vz,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:Vz(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 Vz(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 HK(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var KK=class extends VL{#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||WL(),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=GL({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 WL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var YL=class extends yc{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 KK({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=>$z(t,n))}findAll(e={}){return this.getAll().filter(t=>$z(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 GK=class extends yc{#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??WL();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 Qz(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function VK(e,t,n){const r=e.slice(0);return r[t]=n,r}var QK=class extends yc{#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&&(Qz(n,i).forEach(p=>{p.destroy()}),Qz(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=VK(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)})})}}},WK=class extends yc{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 UK({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=>Lz(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Lz(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()})})}},YK=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new WK,this.#e=e.mutationCache||new YL,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=_K(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=Gz(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(br).catch(br)}ensureInfiniteQueryData(e){return e.behavior=Gz(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===EN&&(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()}},ZL=x.createContext(void 0),xi=e=>{const t=x.useContext(ZL);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ZK=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(ZL.Provider,{value:e,children:t})),XL=x.createContext(!1),JL=()=>x.useContext(XL);XL.Provider;function XK(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var JK=x.createContext(XK()),e5=()=>x.useContext(JK),t5=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?ON(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},n5=e=>{x.useEffect(()=>{e.clearReset()},[e])},r5=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ON(n,[e.error,r])),i5=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))}},e7=(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 t7({queries:e,...t},n){const r=xi(),i=JL(),a=e5(),l=x.useMemo(()=>e.map(b=>{const S=r.defaultQueryOptions(b);return S._optimisticResults=i?"isRestoring":"optimistic",S}),[e,r,i]);l.forEach(b=>{i5(b);const S=r.getQueryCache().get(b.queryHash);t5(b,a,S)}),n5(a);const[u]=x.useState(()=>new QK(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 O=new zN(r,k);return BS(k,O,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const j=d.find((b,S)=>{const k=l[S];return k&&r5({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 n7(e,t,n){const r=JL(),i=e5(),a=xi(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const u=a.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",i5(l),t5(l,i,u),n5(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(r5({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&&e7(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 n7(e,zN)}function Fh(e,t){const n=xi(),[r]=x.useState(()=>new GK(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&&ON(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 r7(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 i7(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}var a7=!1;function yh(e){return e[e.length-1]}function s7(e){return typeof e=="function"}function To(e,t){return s7(e)?e(t):e}var o7=Object.prototype.hasOwnProperty,Wz=Object.prototype.propertyIsEnumerable,l7=()=>Object.create(null),Sl=(e,t)=>Ml(e,t,l7);function Ml(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=Xz(e)&&Xz(i);if(!a&&!(Qg(e)&&Qg(i)))return i;const l=a?e:Yz(e);if(!l)return i;const u=a?i:Yz(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:o7.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 Yz(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!Wz.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(!Wz.call(e,i))return!1;r.push(i)}return r}function Qg(e){if(!Zz(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Zz(n)||!n.hasOwnProperty("isPrototypeOf"))}function Zz(e){return Object.prototype.toString.call(e)==="[object Object]"}function Xz(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 Wu(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 c7(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Jz(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 c7(t)}var u7=["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 Of(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+=Jz(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+Jz(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function d7(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 f7="Invariant failed";function zs(e,t){if(!e)throw new Error(f7)}var Il=4,a5=5;function h7(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=h7(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 O=i.static?.get(k);if(O)j=O;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 O=k.toLowerCase(),C=i.staticInsensitive?.get(O);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(O,A)}}break}case 1:{const k=d.substring(b,v[1]),O=d.substring(v[4],S),C=p&&!!(k||O),A=k?C?k:k.toLowerCase():void 0,T=O?C?O:O.toLowerCase():void 0,E=!m&&i.dynamic?.find(_=>!_.skipOnParamError&&_.caseSensitive===C&&_.prefix===A&&_.suffix===T);if(E)j=E;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]),O=d.substring(v[4],S),C=p&&!!(k||O),A=k?C?k:k.toLowerCase():void 0,T=O?C?O:O.toLowerCase():void 0,E=!m&&i.optional?.find(_=>!_.skipOnParamError&&_.caseSensitive===C&&_.prefix===A&&_.suffix===T);if(E)j=E;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]),O=d.substring(v[4],S),C=p&&!!(k||O),A=k?C?k:k.toLowerCase():void 0,T=O?C?O:O.toLowerCase():void 0,E=dw(2,n.fullPath??n.from,C,A,T);j=E,E.parent=i,E.depth=a,i.wildcard??=[],i.wildcard.push(E)}}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=a5,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 p7(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 m7(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 g7(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 y7(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=b7(a.route)),t.matchCache.set(r,a),a}function v7(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function x7(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),zs(!(d.id in a),`Duplicate routes found with id: ${String(d.id)}`),a[d.id]=d,u!==0&&d.path){const f=v7(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=j7(e,r,t,n);if(!i)return null;const[a]=s5(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function s5(e,t,n){const r=w7(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===a5){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 b7(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function w7(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function j7(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:O}=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 E=v===l;if(E&&(g.route&&!a&&_f(p,m)&&(p=m),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const _=E?void 0:t[v];let P;if(E&&g.index){const $={node:g.index,index:v,skipped:j,depth:b+1,statics:S,dynamics:k,optionals:O,extract:C,rawParams:A,parsedParams:T};let F=!0;if(g.index.skipOnParamError&&(fw(e,t,$)||(F=!1)),F){if(S===l&&!k&&!O&&!j)return $;_f(p,$)&&(p=$)}}if(g.wildcard&&_f(d,m))for(const $ of g.wildcard){const{prefix:F,suffix:U}=$;if(F&&(E||!($.caseSensitive?_:P??=_.toLowerCase()).startsWith(F)))continue;if(U){if(E)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:O,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:O,extract:C,rawParams:A,parsedParams:T})}if(!E)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:O+1,extract:C,rawParams:A,parsedParams:T})}}if(!E&&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:O,extract:C,rawParams:A,parsedParams:T})}if(!E&&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:O,extract:C,rawParams:A,parsedParams:T})}if(!E&&g.static){const $=g.static.get(_);$&&u.push({node:$,index:v+1,skipped:j,depth:b+1,statics:S+1,dynamics:k,optionals:O,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:O,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]=s5(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 o5(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 l5(e){return Io(o5(e))}function Zg(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function S7(e,t,n){return Zg(e,n)===Zg(t,n)}function N7({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 k7(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=>t2(i,n)).join("/"):t2(r,n)}function e2({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 t2(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function Dr(e){return!!e?.isNotFound}function C7(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var US="tsr-scroll-restoration-v1_3",A7=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function E7(){const e=C7();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=E7(),O7=e=>e.state.__TSR_key||e.href;function _7(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 z7({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 T7(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||O7;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=_7(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",A7(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})||(z7({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 P7(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function R7(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 D7(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 M7=L7(JSON.parse),I7=$7(JSON.stringify,JSON.parse);function L7(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=D7(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function $7(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=R7(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 B7(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=c5(e[n],t);return t}}}function U7(e){const t=l5(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 c5(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 u5({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 O=f.nextDep;if(O!==void 0){f=O;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 js=[],{link:uze,unlink:d5,propagate:dze,checkDirty:q7,shallowPropagate:fze}=u5({update(e){return e.depsTail!==void 0?G7(e):V7(e)},notify(e){let t=ih,n=t;do if(js[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=js[n];js[n++]=js[t],js[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,jv(e)):Y7.call(e)}});function F7(){return IN}function H7(){++IN}function K7(){--IN||W7()}function G7(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 V7(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Q7(e){const t=e.flags;if(t&16||t&32&&q7(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,jv(e)}}else e.flags=2}function W7(){try{for(;Nl<ih;){const e=js[Nl];js[Nl++]=void 0,Q7(e)}}finally{for(;Nl<ih;){const e=js[Nl];js[Nl++]=void 0,e.flags|=10}Nl=0,ih=0}}function Y7(){this.depsTail=void 0,this.flags=0,jv(this);const e=this.subs;e!==void 0&&d5(e)}function jv(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=d5(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:n2,unlink:Z7,propagate:X7,checkDirty:f5,shallowPropagate:r2}=u5({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=Z7(n,e)}function h5(){if(!(F7()>0)){for(;Um<HS;){const e=FS[Um];FS[Um++]=void 0,e.notify()}Um=0,HS=0}}function p5(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&&n2(i,Pa,Tg),i._snapshot},subscribe(a){const l=LN(a),u={current:!1},d=J7(()=>{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&&f5(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&r2(l)}}else a&dn.Pending&&(i.flags=a&~dn.Pending);return Pa!==void 0&&n2(i,Pa,Tg),i._snapshot}):i.set=function(a){if(i._update(a)){const l=i.subs;l!==void 0&&(X7(l),r2(l),h5())}},i}function J7(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&&f5(this.deps,this)?t():this.flags=dn.Watching},stop(){this.flags=dn.None,this.depsTail=void 0,Jg(this)}};return t(),n}class eG{constructor(t){this.atom=p5(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 tG{constructor(t){this.atom=p5(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(LN(t))}}function nG(e){return typeof e=="function"?new tG(e):new eG(e)}function rG(e){try{H7(),e()}finally{K7(),h5()}}function ah(e){let t;return rG(()=>{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},i2=(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},m5=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},a2=(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)},g5=(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||v5(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{KS(e)},i);r._nonReactive.pendingTimeout=a}},iG=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;g5(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()},aG=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Wu(()=>{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"),g5(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=Wu();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},O=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(O)}catch(A){p(),zf(e,n,A,"BEFORE_LOAD")}O(C)},sG=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>u(),l=()=>aG(e,n,t,i),u=()=>{if(m5(e,n))return;const d=iG(e,n,i);return vh(d)?d.then(l):l()};return a()},oG=(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}))},y5=(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}},s2=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(a7??e.router.isServer)||a.ssr===!0)&&xh(i);const l=i.options.loader,u=typeof l=="function"?l:l?.handler,d=u?.(y5(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)}},lG=async(e,t,n)=>{async function r(v,j,b,S,k){const O=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(y5(e,t,i,n,k)):A,{status:E,invalid:_}=S,P=O>C&&(!!e.forceStaleReload||S.cause==="enter"||b!==void 0&&b!==S.id);l=E==="success"&&(_||(T??P)),v&&k.options.preload===!1||(l&&!e.sync&&p?(u=!0,(async()=>{try{await s2(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)}})()):E!=="success"||l?await s2(e,t,i,n,k):a2(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(m5(e,i)){if(!e.router.getMatch(i))return e.matches[n];a2(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(O=>O.id===i),k=e.router.getMatch(i);k._nonReactive.loaderPromise=Wu(),S!==k.preload&&e.updateMatch(i,O=>({...O,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 o2(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=sG(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?i2(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(lG(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=i2(t,f);zs(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=oG(t,v,b);if(S){const k=await S;t.updateMatch(v,O=>({...O,...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 l2(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=l2(e,Pg);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():l2(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function v5(e){for(const t of Pg)if(e.options[t]?.preload)return!0;return!1}var Pg=["component","errorComponent","pendingComponent","notFoundComponent"],Lo="__TSR_index",c2="popstate",u2="beforeunload";function cG(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=d2(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=d2(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 d2(e,t){t||(t={});const n=$N();return{...t,key:n,__TSR_key:n,[Lo]:e}}function uG(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 O=()=>{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(()=>O()))},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)},E=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=""},_=cG({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:O,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(u2,E,{capture:!0}),t.removeEventListener(c2,T)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(u2,E,{capture:!0}),t.addEventListener(c2,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 dG(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function ey(e,t){const n=dG(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 fG(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var hG=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=k7(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=uG()),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=nG(mG(this.latestLocation)),T7(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=l5(u);p&&p!=="/"&&f.push(U7({basepath:u})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:B7(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=x7(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&p7(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:Of(u).path,external:!1,searchStr:k,search:Sl(n?.search,S),hash:Of(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:Of(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:b,search:Sl(n?.search,j),hash:Of(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)=>N7({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=>gG({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:Of(e2({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=yG({search:S,dest:i,destRoutes:j,_includeValidateSearch:t._includeValidateSearch}),S=Sl(f,S);const k=this.options.stringifySearch(S),O=i.hash===!0?a.hash:i.hash?To(i.hash,a.hash):void 0,C=O?`#${O}`:"";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 E,_,P=!1;if(this.rewrite){const $=new URL(T,this.origin),F=c5(this.rewrite,$);E=$.href.replace($.origin,""),F.origin!==this.origin?(_=F.href,P=!0):_=F.pathname+F.search+F.hash}else E=d7(T),_=E;return{publicHref:_,href:E,pathname:b,search:S,searchStr:k,state:A,hash:O??"",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=m7(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=Wu(()=>{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 o2({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(O=>O.id===k.id)),m=b.filter(k=>!S.some(O=>O.routeId===k.routeId)),g=S.filter(k=>!b.some(O=>O.routeId===k.routeId)),v=S.filter(k=>b.some(O=>O.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:fG(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 o2({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=g7(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??I7,parseSearch:e.parseSearch??M7,protocolAllowlist:e.protocolAllowlist??u7}),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?xG(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})??"",O=k?JSON.stringify(k):"",{interpolatedPath:C,usedParams:A}=e2({path:g.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),T=g.id+C+O,E=this.getMatch(T),_=p.get(g.id),P=E?._strictParams??A;let $;if(!E)try{f2(g,A,a,P)}catch(V){if(Dr(V)||Qr(V)?$=V:$=new pG(V.message,{cause:V}),t?.throwOnError)throw $}Object.assign(i,P);const F=_?"stay":"enter";let U;if(E)U={...E,cause:F,params:_?.params??i,_strictParams:P,search:Sl(_?_.search:E.search,j),_strictSearch:b};else{const V=g.options.loader||g.options.beforeLoad||g.lazyFn||v5(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:Wu()},__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 O={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(O)??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{f2(p,n,r??{},f)}catch{}d=f}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:d}}},ty=class extends Error{},pG=class extends Error{};function mG(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 gG({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=Io(e);let a,l;const u=y7(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 yG({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return vG(n)(e,t,r??!1)}function vG(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 xG(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 f2(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 bG="Error preloading route! ☝️",x5=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||zs(!1);let i=r?Gl:n?.path;i&&i!=="/"&&(i=o5(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.")}},wG=class extends x5{constructor(e){super(e)}};function BN(e){const t=e.errorComponent??UN;return s.jsx(jG,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?x.createElement(t,{error:n,reset:r}):e.children})}var jG=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 SG({children:e,fallback:t=null}){return b5()?s.jsx(Li.Fragment,{children:e}):s.jsx(Li.Fragment,{children:t})}function b5(){return Li.useSyncExternalStore(NG,()=>!0,()=>!1)}function NG(){return()=>{}}var w5=x.createContext(null);function Qi(e){const t=x.useContext(w5);return e?.warn,t}var mw={exports:{}},gw={},yw={exports:{}},vw={};var h2;function kG(){if(h2)return vw;h2=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 p2;function CG(){return p2||(p2=1,yw.exports=kG()),yw.exports}var m2;function AG(){if(m2)return gw;m2=1;var e=md(),t=CG();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(E){if(!O){if(O=!0,C=E,E=g(E),v!==void 0&&b.hasValue){var _=b.value;if(v(_,E))return A=_}return A=E}if(_=A,r(C,E))return _;var P=g(E);return v!==void 0&&v(_,P)?(C=E,_):(C=E,A=P)}var O=!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 g2;function EG(){return g2||(g2=1,mw.exports=AG()),mw.exports}var j5=EG();function OG(e,t){return e===t}function _G(e,t,n=OG){const r=x.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(l);return u},[e]),i=x.useCallback(()=>e?.get(),[e]);return j5.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 _G(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),zG=x.createContext(void 0);function Qo(e){const t=x.useContext(e.from?zG:Nv);return Xr({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(zs(!((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 vc=qL();const TG=ma(vc);function PG(e,t){const n=Qi(),r=i7(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:O,className:C,onClick:A,onBlur:T,onFocus:E,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=b5(),q=Xr({select:et=>{const ue=et.matches[et.matches.length-1];return{search:ue?.search,hash:et.location.hash,path:ue?.pathname}},structuralSharing:!0}),D=e.from,G=x.useMemo(()=>({...e,from:D}),[n,q,D,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),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(()=>$G(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(!BG(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),Wg(u,n.protocolAllowlist)?void 0:u}catch{}},[u,Se,n.protocolAllowlist]),me=Xr({select:et=>{if(ee)return!1;if(l?.exact){if(!S7(et.location.pathname,se.pathname,n.basepath))return!1}else{const ue=Zg(et.location.pathname,n.basepath),Ne=Zg(se.pathname,n.basepath);if(!(ue.startsWith(Ne)&&(ue.length===Ne.length||ue[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}}),Oe=me?To(i,{})??RG:xw,Y=me?xw:To(a,{})??xw,He=[C,Oe.className,Y.className].filter(Boolean).join(" "),Pe=(O||Oe.style||Y.style)&&{...O,...Oe.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(bG)})},[n,G,se]);r7(r,x.useCallback(et=>{et?.isIntersecting&&en()},[en]),LG,{disabled:!!k||Lt!=="viewport"}),x.useEffect(()=>{Ht.current||!k&&Lt==="render"&&(en(),Ht.current=!0)},[k,en,Lt]);const je=et=>{const ue=et.currentTarget.getAttribute("target"),Ne=S!==void 0?S:ue;if(!k&&!UG(et)&&!et.defaultPrevented&&(!Ne||Ne==="_self")&&et.button===0){et.preventDefault(),vc.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},...O&&{style:O},...C&&{className:C},...A&&{onClick:A},...T&&{onBlur:T},...E&&{onFocus:E},..._&&{onMouseEnter:_},...P&&{onMouseLeave:P},...$&&{onTouchStart:$}};const Xe=et=>{if(k||Lt!=="intent")return;if(!cn){en();return}const ue=et.currentTarget;if(Tf.has(ue))return;const Ne=setTimeout(()=>{Tf.delete(ue),en()},cn);Tf.set(ue,Ne)},Rt=et=>{k||Lt!=="intent"||en()},mt=et=>{if(k||!Lt||!cn)return;const ue=et.currentTarget,Ne=Tf.get(ue);Ne&&(clearTimeout(Ne),Tf.delete(ue))};return{...I,...Oe,...Y,href:Se?.href,ref:r,onClick:cu([A,je]),onBlur:cu([T,mt]),onFocus:cu([E,Xe]),onMouseEnter:cu([_,Xe]),onMouseLeave:cu([P,mt]),onTouchStart:cu([$,Rt]),disabled:!!k,target:S,...Pe&&{style:Pe},...He&&{className:He},...k&&DG,...me&&MG,...M&&at&&IG}}var xw={},RG={className:"active"},DG={role:"link","aria-disabled":!0},MG={"data-status":"active","aria-current":"page"},IG={"data-transitioning":"transitioning"},Tf=new WeakMap,LG={rootMargin:"100px"},cu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function $G(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function BG(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}=PG(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 UG(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var qG=class extends x5{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 qG(e)}function FG(){return e=>KG(e)}var HG=class extends wG{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 KG(e){return new HG(e)}function y2(e){return typeof e=="object"?new v2(e,{silent:!0}).createRoute(e):new v2(e,{silent:!0}).createRoute}var v2=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=ti(n);return r.isRoot=!1,r},this.silent=t?.silent}},x2=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 b2(e){return typeof e=="object"?new x2(e):t=>new x2({id:e,...t})}function GG(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 VG(){return s.jsx("p",{children:"Not Found"})}function Cu(e){return s.jsx(s.Fragment,{children:e.children})}function S5(e,t,n){return t.options.notFoundComponent?s.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?s.jsx(e.options.defaultNotFoundComponent,{...n}):s.jsx(VG,{})}function QG(){return Qi().isScrollRestoring,null}var N5=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 zs(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:Cu,g=u?BN:Cu,v=f?GG:Cu;return s.jsxs(i.isRoot?i.options.shellComponent??Cu:Cu,{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(SG,{fallback:l,children:s.jsx(w2,{matchId:t})}):s.jsx(w2,{matchId:t})})})})}),r.parentRouteId===Gl&&n.options.scrollRestoration?s.jsxs(s.Fragment,{children:[s.jsx(WG,{}),s.jsx(QG,{})]}):null]})});function WG(){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 w2=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=Wu();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 zs(Dr(r.error)),S5(n,l,r.error);if(r.status==="redirected")throw zs(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 zs(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 S5(t,i,void 0);if(!l)return null;const d=s.jsx(N5,{matchId:l});return r===Gl?s.jsx(x.Suspense,{fallback:u,children:d}):d});function YG(){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&&P7(e)}},[u,d,e]),null}function ZG(){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?Cu:x.Suspense,{fallback:n,children:[s.jsx(YG,{}),s.jsx(XG,{})]});return e.options.InnerWrap?s.jsx(e.options.InnerWrap,{children:r}):r}function XG(){const e=Qi(),t=Xr({select:i=>i.matches[0]?.id}),n=Xr({select:i=>i.loadedAt}),r=t?s.jsx(N5,{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 JG=e=>new eV(e),eV=class extends hG{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=y2,globalThis.createLazyFileRoute=b2):typeof window<"u"&&(window.createFileRoute=y2,window.createLazyFileRoute=b2);function tV({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(w5.Provider,{value:e,children:t});return e.options.Wrap?s.jsx(e.options.Wrap,{children:r}):r}function nV({router:e,...t}){return s.jsx(tV,{router:e,...t,children:s.jsx(ZG,{})})}function k5(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 rV(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const C5=rV();function iV(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function aV(e){return`${iV()}${e}`}function sV(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 oV(){return""}function j2(){return!!oV()}async function _e(e,t){const n=t?.body!=null,r=await fetch(`${C5}${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 A5(e){return _e(`/projects/${encodeURIComponent(e)}`)}function E5(){return _e("/runs")}function lV(e){return _e(`/projects/${encodeURIComponent(e)}/runs`)}function tc(e){return _e(`/runs/${encodeURIComponent(e)}`)}function cV(e){return _e(`/projects/${encodeURIComponent(e)}/queries`)}function O5(e){return _e(`/projects/${encodeURIComponent(e)}/competitors`)}function _5(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 uV(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 dV(e,t){return _e(`/projects/${encodeURIComponent(e)}/queries`,{method:"PUT",body:JSON.stringify({queries:t})})}function fV(e,t){return _e(`/projects/${encodeURIComponent(e)}/queries`,{method:"POST",body:JSON.stringify({queries:t})})}function z5(e,t){return _e(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function S2(e,t){const n=await A5(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 hV(e,t){const n=await A5(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 pV(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 mV(e,t){return _e(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function gV(e,t){await _e(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function yV(e,t){return _e(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function vV(e){await _e(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function xV(e){return _e(`/projects/${encodeURIComponent(e)}/export`)}function VN(){return _e("/settings")}function bV(){return _e("/session")}function wV(e){return _e("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function jV(e){return _e("/session",{method:"POST",body:JSON.stringify({password:e})})}function SV(e,t){return _e(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function NV(e){return _e("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function kV(e){try{return await _e(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof ei&&t.statusCode===404)return null;throw t}}function N2(e,t){return _e(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function CV(e){await _e(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function AV(e){return _e(`/projects/${encodeURIComponent(e)}/notifications`)}function EV(e,t){return _e(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function OV(e,t){await _e(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function _V(e,t){return _e(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function zV(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/queries/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function TV(e){return _e("/apply",{method:"POST",body:JSON.stringify(e)})}function PV(e){return _e("/runs",{method:"POST",body:JSON.stringify(e??{})})}function T5(e){return _e(`/projects/${encodeURIComponent(e)}/google/connections`)}function RV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function DV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function MV(e){return _e(`/projects/${encodeURIComponent(e)}/google/properties`)}function IV(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function LV(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function P5(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function $V(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 BV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function UV(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 qV(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function QN(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function FV(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return _e(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function HV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function KV(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function GV(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function k2(){return _e("/cdp/status")}function VV(e,t){return _e("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function C2(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function R5(e){return _e(`/projects/${encodeURIComponent(e)}/bing/status`)}function QV(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function WV(e){return _e(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function YV(e){return _e(`/projects/${encodeURIComponent(e)}/bing/sites`)}function ZV(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 D5(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return _e(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function M5(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function A2(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function XV(e){return _e(`/projects/${encodeURIComponent(e)}/bing/performance`)}function JV(e){return _e("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function eQ(e){return _e(`/projects/${encodeURIComponent(e)}/report`)}function tQ(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function nQ(e,t="agency"){const n=new URLSearchParams({audience:t}),r=await fetch(`${C5}/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=tQ(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 rQ(e){return _e(`/projects/${encodeURIComponent(e)}/ga/status`)}function iQ(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 I5(e,t){return _e(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function aQ(e,t){return _e(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function sQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history${n}`)}function oQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/social-referral-history${n}`)}function lQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/session-history${n}`)}function cQ(e){return _e(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function uQ(e,t){const n=t?`?runId=${encodeURIComponent(t)}`:"";return _e(`/projects/${encodeURIComponent(e)}/insights${n}`)}function dQ(e){return _e(`/projects/${encodeURIComponent(e)}/citations/visibility`)}async function fQ(e,t){const n=aV(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:sV(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 hQ(){return _e("/backlinks/status")}function pQ(){return _e("/backlinks/install",{method:"POST"})}function L5(){return _e("/backlinks/syncs/latest")}function mQ(){return _e("/backlinks/syncs")}function gQ(e){return _e("/backlinks/syncs",{method:"POST",body:JSON.stringify(e?{release:e}:{})})}function yQ(){return _e("/backlinks/releases")}function vQ(){return _e("/backlinks/latest-release")}function xQ(e){return _e(`/backlinks/cache/${encodeURIComponent(e)}`,{method:"DELETE"})}function bQ(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 wQ(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 jQ(e){return _e(`/projects/${encodeURIComponent(e)}/backlinks/history`)}function SQ(e,t){return _e(`/projects/${encodeURIComponent(e)}/backlinks/extract`,{method:"POST",body:JSON.stringify({release:void 0})})}const NQ=6e3,kQ=5,CQ=180;let wr=[],AQ=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 $5(e){YN(e);const t=wr.length;wr=wr.filter(n=>n.id!==e),wr.length!==t&&ny()}function E2(e){YN(e.id),VS.set(e.id,setTimeout(()=>{WS(e.id)},e.durationMs))}function EQ(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function vt(e,t="negative",n=NQ){const r=EQ(e,t,n),i={id:String(++AQ),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(),E2(l),a.id}}return wr.length>=kQ&&$5(wr[0].id),wr=[...wr,i],ny(),E2(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(()=>{$5(e)},CQ)))}function OQ(e){return GS.add(e),()=>{GS.delete(e)}}function O2(){return wr}const _Q=5*6e4,B5=30*6e4,Pf=3e4,jr=6e4,YS=3e4;function zQ(){return new YK({defaultOptions:{queries:{staleTime:_Q,retry:1,refetchOnWindowFocus:!1}},mutationCache:new YL({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||vt({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const TQ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),PQ=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),_2=e=>{const t=PQ(e);return t.charAt(0).toUpperCase()+t.slice(1)},U5=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),RQ=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var DQ={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 MQ=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,...DQ,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:U5("lucide",i),...!a&&!RQ(u)&&{"aria-hidden":"true"},...u},[...l.map(([f,p])=>x.createElement(f,p)),...Array.isArray(a)?a:[a]]));const kt=(e,t)=>{const n=x.forwardRef(({className:r,...i},a)=>x.createElement(MQ,{ref:a,iconNode:t,className:U5(`lucide-${TQ(_2(e))}`,`lucide-${e}`,r),...i}));return n.displayName=_2(e),n};const IQ=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],LQ=kt("arrow-up",IQ);const $Q=[["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"}]],BQ=kt("book-open",$Q);const UQ=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],q5=kt("check",UQ);const qQ=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],FQ=kt("chevron-down",qQ);const HQ=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Hh=kt("chevron-right",HQ);const KQ=[["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"}]],GQ=kt("circle-alert",KQ);const VQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],F5=kt("circle-check",VQ);const QQ=[["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"}]],H5=kt("circle-question-mark",QQ);const WQ=[["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"}]],YQ=kt("copy",WQ);const ZQ=[["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"}]],Ev=kt("download",ZQ);const XQ=[["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"}]],JQ=kt("external-link",XQ);const eW=[["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"}]],tW=kt("file-text",eW);const nW=[["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"}]],rW=kt("github",nW);const iW=[["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"}]],aW=kt("globe",iW);const sW=[["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"}]],oW=kt("layout-dashboard",sW);const lW=[["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"}]],K5=kt("link-2",lW);const cW=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],G5=kt("loader-circle",cW);const uW=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],dW=kt("maximize-2",uW);const fW=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],hW=kt("menu",fW);const pW=[["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"}]],mW=kt("minimize-2",pW);const gW=[["path",{d:"M5 12h14",key:"1ays0h"}]],yW=kt("minus",gW);const vW=[["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=kt("play",vW);const xW=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],z2=kt("plus",xW);const bW=[["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"}]],T2=kt("refresh-cw",bW);const wW=[["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"}]],jW=kt("rocket",wW);const SW=[["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"}]],V5=kt("rotate-ccw",SW);const NW=[["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"}]],kW=kt("settings",NW);const CW=[["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"}]],P2=kt("sparkles",CW);const AW=[["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"}]],Q5=kt("trash-2",AW);const EW=[["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=kt("triangle-alert",EW);const OW=[["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"}]],_W=kt("unplug",OW);const zW=[["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"}]],TW=kt("upload",zW);const PW=[["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"}]],RW=kt("wrench",PW);const DW=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Kh=kt("x",DW);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 Lu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class W5 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Y5={};function Fo(e){return Y5}function Z5(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 Ov(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 MW(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 R2=Symbol("evaluating");function Dt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==R2)return r===void 0&&(r=R2,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function xc(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 D2(e){return JSON.stringify(e)}function IW(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X5="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function bh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const LW=Ov(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Yu(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 J5(e){return Yu(e)?{...e}:Array.isArray(e)?[...e]:e}const $W=new Set(["string","number","symbol"]);function Zu(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 BW(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const UW={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 qW(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 xc(this,"shape",l),l},checks:[]});return Zo(e,a)}function FW(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 xc(this,"shape",l),l},checks:[]});return Zo(e,a)}function HW(e,t){if(!Yu(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 xc(this,"shape",a),a}});return Zo(e,i)}function KW(e,t){if(!Yu(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 xc(this,"shape",r),r}});return Zo(e,n)}function GW(e,t){const n=Yo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return xc(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Zo(e,n)}function VW(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 xc(this,"shape",d),d},checks:[]});return Zo(t,l)}function QW(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 xc(this,"shape",a),a}});return Zo(t,r)}function Eu(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 e4=(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})},t4=ve("$ZodError",e4),n4=ve("$ZodError",e4,{Parent:Error});function WW(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 YW(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 Lu;if(l.issues.length){const u=new(i?.Err??e)(l.issues.map(d=>Ho(d,a,Fo())));throw X5(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 X5(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 Lu;return a.issues.length?{success:!1,error:new(e??t4)(a.issues.map(l=>Ho(l,i,Fo())))}:{success:!0,data:a.value}},ZW=_v(n4),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}},XW=zv(n4),JW=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ek(e)(t,n,i)},eY=e=>(t,n,r)=>ek(e)(t,n,r),tY=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return tk(e)(t,n,i)},nY=e=>async(t,n,r)=>tk(e)(t,n,r),rY=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return _v(e)(t,n,i)},iY=e=>(t,n,r)=>_v(e)(t,n,r),aY=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return zv(e)(t,n,i)},sY=e=>async(t,n,r)=>zv(e)(t,n,r),oY=/^[cC][^\s-]{8,}$/,lY=/^[0-9a-z]+$/,cY=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,uY=/^[0-9a-vA-V]{20}$/,dY=/^[A-Za-z0-9]{27}$/,fY=/^[a-zA-Z0-9_-]{21}$/,hY=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,pY=/^([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})$/,M2=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)$/,mY=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,gY="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function yY(){return new RegExp(gY,"u")}const 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])$/,xY=/^(([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}|:))$/,bY=/^((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])$/,wY=/^(([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])$/,jY=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,r4=/^[A-Za-z0-9_-]*$/,SY=/^\+[1-9]\d{6,14}$/,i4="(?:(?:\\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])))",NY=new RegExp(`^${i4}$`);function a4(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 kY(e){return new RegExp(`^${a4(e)}$`)}function CY(e){const t=a4({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(`^${i4}T(?:${r})$`)}const AY=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},EY=/^-?\d+$/,s4=/^-?\d+(?:\.\d+)?$/,OY=/^(?:true|false)$/i,_Y=/^[^A-Z]*$/,zY=/^[^a-z]*$/,ni=ve("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),o4={number:"number",bigint:"bigint",object:"date"},l4=ve("$ZodCheckLessThan",(e,t)=>{ni.init(e,t);const n=o4[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})}}),c4=ve("$ZodCheckGreaterThan",(e,t)=>{ni.init(e,t);const n=o4[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})}}),TY=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):MW(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})}}),PY=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]=UW[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=EY)}),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})}}),RY=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})}}),DY=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})}}),MY=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=()=>{})}),IY=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})}}),LY=ve("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=_Y),Tv.init(e,t)}),$Y=ve("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=zY),Tv.init(e,t)}),BY=ve("$ZodCheckIncludes",(e,t)=>{ni.init(e,t);const n=Zu(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})}}),UY=ve("$ZodCheckStartsWith",(e,t)=>{ni.init(e,t);const n=new RegExp(`^${Zu(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})}}),qY=ve("$ZodCheckEndsWith",(e,t)=>{ni.init(e,t);const n=new RegExp(`.*${Zu(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})}}),FY=ve("$ZodCheckOverwrite",(e,t)=>{ni.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class HY{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 KY={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=KY;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=Eu(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 Lu;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,l.issues.length!==g&&(f||(f=Eu(l,g)))});else{if(l.issues.length===g)continue;f||(f=Eu(l,g))}}return p?p.then(()=>l):l},a=(l,u,d)=>{if(Eu(l))return l.aborted=!0,l;const f=i(u,r,d);if(f instanceof Promise){if(d.async===!1)throw new Lu;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 Lu;return d.then(f=>i(f,r,u))}return i(d,r,u)}}Dt(e,"~standard",()=>({validate:i=>{try{const a=ZW(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return XW(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()??AY(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)}),GY=ve("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=pY),pn.init(e,t)}),VY=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=M2(r))}else t.pattern??(t.pattern=M2());pn.init(e,t)}),QY=ve("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=mY),pn.init(e,t)}),WY=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})}}}),YY=ve("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=yY()),pn.init(e,t)}),ZY=ve("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=fY),pn.init(e,t)}),XY=ve("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=oY),pn.init(e,t)}),JY=ve("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=lY),pn.init(e,t)}),eZ=ve("$ZodULID",(e,t)=>{t.pattern??(t.pattern=cY),pn.init(e,t)}),tZ=ve("$ZodXID",(e,t)=>{t.pattern??(t.pattern=uY),pn.init(e,t)}),nZ=ve("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=dY),pn.init(e,t)}),rZ=ve("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=CY(t)),pn.init(e,t)}),iZ=ve("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=NY),pn.init(e,t)}),aZ=ve("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=kY(t)),pn.init(e,t)}),sZ=ve("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=hY),pn.init(e,t)}),oZ=ve("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=vY),pn.init(e,t),e._zod.bag.format="ipv4"}),lZ=ve("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=xY),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})}}}),cZ=ve("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=bY),pn.init(e,t)}),uZ=ve("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=wY),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 u4(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const dZ=ve("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=jY),pn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{u4(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function fZ(e){if(!r4.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return u4(n)}const hZ=ve("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=r4),pn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{fZ(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),pZ=ve("$ZodE164",(e,t)=>{t.pattern??(t.pattern=SY),pn.init(e,t)});function mZ(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 gZ=ve("$ZodJWT",(e,t)=>{pn.init(e,t),e._zod.check=n=>{mZ(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),d4=ve("$ZodNumber",(e,t)=>{xn.init(e,t),e._zod.pattern=e._zod.bag.pattern??s4,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}}),yZ=ve("$ZodNumberFormat",(e,t)=>{PY.init(e,t),d4.init(e,t)}),vZ=ve("$ZodBoolean",(e,t)=>{xn.init(e,t),e._zod.pattern=OY,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}}),xZ=ve("$ZodUnknown",(e,t)=>{xn.init(e,t),e._zod.parse=n=>n}),bZ=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 I2(e,t,n){e.issues.length&&t.issues.push(...Ou(n,e.issues)),t.value[n]=e.value}const wZ=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=>I2(f,n,l))):I2(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 f4(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=BW(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function h4(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 jZ=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=Ov(()=>f4(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?h4(p,f,u,d,r.value,e):p.length?Promise.all(p).then(()=>u):u}}),SZ=ve("$ZodObjectJIT",(e,t)=>{jZ.init(e,t);const n=e._zod.parse,r=Ov(()=>f4(t)),i=g=>{const v=new HY(["shape","payload","ctx"]),j=r.value,b=C=>{const A=D2(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=D2(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 O=v.compile();return(C,A)=>O(g,C,A)};let a;const l=bh,u=!Y5.jitless,f=u&&LW.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?h4([],j,g,v,m,e):g):n(g,v):(g.issues.push({expected:"object",code:"invalid_type",input:j,inst:e}),g)}});function L2(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=>!Eu(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 p4=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=>L2(d,i,e,a)):L2(u,i,e,a)}}),NZ=ve("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,p4.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=Ov(()=>{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)}}),kZ=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])=>$2(n,d,f)):$2(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(Yu(e)&&Yu(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 $2(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}),Eu(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 CZ=ve("$ZodRecord",(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Yu(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"&&s4.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}}),AZ=ve("$ZodEnum",(e,t)=>{xn.init(e,t);const n=Z5(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>$W.has(typeof i)).map(i=>typeof i=="string"?Zu(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}}),EZ=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"?Zu(r):r?Zu(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}}),OZ=ve("$ZodTransform",(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new W5(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 Lu;return n.value=i,n}});function B2(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const m4=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=>B2(a,n.value)):B2(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),_Z=ve("$ZodExactOptional",(e,t)=>{m4.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)}),zZ=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)}),TZ=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=>U2(a,t)):U2(i,t)}});function U2(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const PZ=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))}),RZ=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=>q2(a,e)):q2(i,e)}});function q2(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 DZ=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)}}),MZ=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 IZ=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(F2):F2(i)}});function F2(e){return e.value=Object.freeze(e.value),e}const LZ=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=>H2(a,n,r,e));H2(i,n,r,e)}});function H2(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 K2;class $Z{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 BZ(){return new $Z}(K2=globalThis).__zod_globalRegistry??(K2.__zod_globalRegistry=BZ());const Jf=globalThis.__zod_globalRegistry;function UZ(e,t){return new e({type:"string",...Fe(t)})}function qZ(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Fe(t)})}function G2(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Fe(t)})}function FZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Fe(t)})}function HZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Fe(t)})}function KZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Fe(t)})}function GZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Fe(t)})}function VZ(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Fe(t)})}function QZ(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Fe(t)})}function WZ(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Fe(t)})}function YZ(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Fe(t)})}function ZZ(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Fe(t)})}function XZ(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Fe(t)})}function JZ(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Fe(t)})}function eX(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Fe(t)})}function tX(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Fe(t)})}function nX(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Fe(t)})}function rX(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Fe(t)})}function iX(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Fe(t)})}function aX(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Fe(t)})}function sX(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Fe(t)})}function oX(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Fe(t)})}function lX(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Fe(t)})}function cX(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Fe(t)})}function uX(e,t){return new e({type:"string",format:"date",check:"string_format",...Fe(t)})}function dX(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Fe(t)})}function fX(e,t){return new e({type:"string",format:"duration",check:"string_format",...Fe(t)})}function hX(e,t){return new e({type:"number",checks:[],...Fe(t)})}function pX(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Fe(t)})}function mX(e,t){return new e({type:"boolean",...Fe(t)})}function gX(e){return new e({type:"unknown"})}function yX(e,t){return new e({type:"never",...Fe(t)})}function V2(e,t){return new l4({check:"less_than",...Fe(t),value:e,inclusive:!1})}function bw(e,t){return new l4({check:"less_than",...Fe(t),value:e,inclusive:!0})}function Q2(e,t){return new c4({check:"greater_than",...Fe(t),value:e,inclusive:!1})}function ww(e,t){return new c4({check:"greater_than",...Fe(t),value:e,inclusive:!0})}function W2(e,t){return new TY({check:"multiple_of",...Fe(t),value:e})}function g4(e,t){return new RY({check:"max_length",...Fe(t),maximum:e})}function sy(e,t){return new DY({check:"min_length",...Fe(t),minimum:e})}function y4(e,t){return new MY({check:"length_equals",...Fe(t),length:e})}function vX(e,t){return new IY({check:"string_format",format:"regex",...Fe(t),pattern:e})}function xX(e){return new LY({check:"string_format",format:"lowercase",...Fe(e)})}function bX(e){return new $Y({check:"string_format",format:"uppercase",...Fe(e)})}function wX(e,t){return new BY({check:"string_format",format:"includes",...Fe(t),includes:e})}function jX(e,t){return new UY({check:"string_format",format:"starts_with",...Fe(t),prefix:e})}function SX(e,t){return new qY({check:"string_format",format:"ends_with",...Fe(t),suffix:e})}function gd(e){return new FY({check:"overwrite",tx:e})}function NX(e){return gd(t=>t.normalize(e))}function kX(){return gd(e=>e.trim())}function CX(){return gd(e=>e.toLowerCase())}function AX(){return gd(e=>e.toUpperCase())}function EX(){return gd(e=>IW(e))}function OX(e,t,n){return new e({type:"array",element:t,...Fe(n)})}function _X(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Fe(n)})}function zX(e){const t=TX(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 TX(e,t){const n=new ni({check:"custom",...Fe(t)});return n._zod.check=e,n}function v4(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 x4(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 b4(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const 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 PX=(e,t={})=>n=>{const r=v4({...n,processors:t});return Un(e,r),x4(r,e),b4(r,e)},oy=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},l=v4({...i??{},target:a,io:t,processors:n});return Un(e,l),x4(l,e),b4(l,e)},RX={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},DX=(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=RX[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}))])}},MX=(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)},IX=(e,t,n,r)=>{n.type="boolean"},LX=(e,t,n,r)=>{n.not={}},$X=(e,t,n,r)=>{},BX=(e,t,n,r)=>{const i=e._zod.def,a=Z5(i.entries);a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),n.enum=a},UX=(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},qX=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},FX=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},HX=(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"]})},KX=(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)},GX=(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},VX=(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},QX=(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)}},WX=(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"}]},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},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,n.default=JSON.parse(JSON.stringify(i.defaultValue))},XX=(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)))},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;let l;try{l=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},eJ=(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},tJ=(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},w4=(e,t,n,r)=>{const i=e._zod.def;Un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},nJ=ve("ZodISODateTime",(e,t)=>{rZ.init(e,t),wn.init(e,t)});function rJ(e){return cX(nJ,e)}const iJ=ve("ZodISODate",(e,t)=>{iZ.init(e,t),wn.init(e,t)});function aJ(e){return uX(iJ,e)}const sJ=ve("ZodISOTime",(e,t)=>{aZ.init(e,t),wn.init(e,t)});function oJ(e){return dX(sJ,e)}const lJ=ve("ZodISODuration",(e,t)=>{sZ.init(e,t),wn.init(e,t)});function cJ(e){return fX(lJ,e)}const uJ=(e,t)=>{t4.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>YW(e,n)},flatten:{value:n=>WW(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",uJ,{Parent:Error}),dJ=ek(Wi),fJ=tk(Wi),hJ=_v(Wi),pJ=zv(Wi),mJ=JW(Wi),gJ=eY(Wi),yJ=tY(Wi),vJ=nY(Wi),xJ=rY(Wi),bJ=iY(Wi),wJ=aY(Wi),jJ=sY(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=PX(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)=>dJ(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>hJ(e,n,r),e.parseAsync=async(n,r)=>fJ(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>pJ(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>mJ(e,n,r),e.decode=(n,r)=>gJ(e,n,r),e.encodeAsync=async(n,r)=>yJ(e,n,r),e.decodeAsync=async(n,r)=>vJ(e,n,r),e.safeEncode=(n,r)=>xJ(e,n,r),e.safeDecode=(n,r)=>bJ(e,n,r),e.safeEncodeAsync=async(n,r)=>wJ(e,n,r),e.safeDecodeAsync=async(n,r)=>jJ(e,n,r),e.refine=(n,r)=>e.check(yee(n,r)),e.superRefine=n=>e.check(vee(n)),e.overwrite=n=>e.check(gd(n)),e.optional=()=>X2(e),e.exactOptional=()=>iee(e),e.nullable=()=>J2(e),e.nullish=()=>X2(J2(e)),e.nonoptional=n=>uee(e,n),e.array=()=>Ae(e),e.or=n=>QJ([e,n]),e.and=n=>XJ(e,n),e.transform=n=>eT(e,nee(n)),e.default=n=>oee(e,n),e.prefault=n=>cee(e,n),e.catch=n=>fee(e,n),e.pipe=n=>eT(e,n),e.readonly=()=>mee(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)),j4=ve("_ZodString",(e,t)=>{nk.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>DX(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(vX(...r)),e.includes=(...r)=>e.check(wX(...r)),e.startsWith=(...r)=>e.check(jX(...r)),e.endsWith=(...r)=>e.check(SX(...r)),e.min=(...r)=>e.check(sy(...r)),e.max=(...r)=>e.check(g4(...r)),e.length=(...r)=>e.check(y4(...r)),e.nonempty=(...r)=>e.check(sy(1,...r)),e.lowercase=r=>e.check(xX(r)),e.uppercase=r=>e.check(bX(r)),e.trim=()=>e.check(kX()),e.normalize=(...r)=>e.check(NX(...r)),e.toLowerCase=()=>e.check(CX()),e.toUpperCase=()=>e.check(AX()),e.slugify=()=>e.check(EX())}),SJ=ve("ZodString",(e,t)=>{nk.init(e,t),j4.init(e,t),e.email=n=>e.check(qZ(NJ,n)),e.url=n=>e.check(VZ(kJ,n)),e.jwt=n=>e.check(lX(BJ,n)),e.emoji=n=>e.check(QZ(CJ,n)),e.guid=n=>e.check(G2(Y2,n)),e.uuid=n=>e.check(FZ(Hm,n)),e.uuidv4=n=>e.check(HZ(Hm,n)),e.uuidv6=n=>e.check(KZ(Hm,n)),e.uuidv7=n=>e.check(GZ(Hm,n)),e.nanoid=n=>e.check(WZ(AJ,n)),e.guid=n=>e.check(G2(Y2,n)),e.cuid=n=>e.check(YZ(EJ,n)),e.cuid2=n=>e.check(ZZ(OJ,n)),e.ulid=n=>e.check(XZ(_J,n)),e.base64=n=>e.check(aX(IJ,n)),e.base64url=n=>e.check(sX(LJ,n)),e.xid=n=>e.check(JZ(zJ,n)),e.ksuid=n=>e.check(eX(TJ,n)),e.ipv4=n=>e.check(tX(PJ,n)),e.ipv6=n=>e.check(nX(RJ,n)),e.cidrv4=n=>e.check(rX(DJ,n)),e.cidrv6=n=>e.check(iX(MJ,n)),e.e164=n=>e.check(oX($J,n)),e.datetime=n=>e.check(rJ(n)),e.date=n=>e.check(aJ(n)),e.time=n=>e.check(oJ(n)),e.duration=n=>e.check(cJ(n))});function R(e){return UZ(SJ,e)}const wn=ve("ZodStringFormat",(e,t)=>{pn.init(e,t),j4.init(e,t)}),NJ=ve("ZodEmail",(e,t)=>{QY.init(e,t),wn.init(e,t)}),Y2=ve("ZodGUID",(e,t)=>{GY.init(e,t),wn.init(e,t)}),Hm=ve("ZodUUID",(e,t)=>{VY.init(e,t),wn.init(e,t)}),kJ=ve("ZodURL",(e,t)=>{WY.init(e,t),wn.init(e,t)}),CJ=ve("ZodEmoji",(e,t)=>{YY.init(e,t),wn.init(e,t)}),AJ=ve("ZodNanoID",(e,t)=>{ZY.init(e,t),wn.init(e,t)}),EJ=ve("ZodCUID",(e,t)=>{XY.init(e,t),wn.init(e,t)}),OJ=ve("ZodCUID2",(e,t)=>{JY.init(e,t),wn.init(e,t)}),_J=ve("ZodULID",(e,t)=>{eZ.init(e,t),wn.init(e,t)}),zJ=ve("ZodXID",(e,t)=>{tZ.init(e,t),wn.init(e,t)}),TJ=ve("ZodKSUID",(e,t)=>{nZ.init(e,t),wn.init(e,t)}),PJ=ve("ZodIPv4",(e,t)=>{oZ.init(e,t),wn.init(e,t)}),RJ=ve("ZodIPv6",(e,t)=>{lZ.init(e,t),wn.init(e,t)}),DJ=ve("ZodCIDRv4",(e,t)=>{cZ.init(e,t),wn.init(e,t)}),MJ=ve("ZodCIDRv6",(e,t)=>{uZ.init(e,t),wn.init(e,t)}),IJ=ve("ZodBase64",(e,t)=>{dZ.init(e,t),wn.init(e,t)}),LJ=ve("ZodBase64URL",(e,t)=>{hZ.init(e,t),wn.init(e,t)}),$J=ve("ZodE164",(e,t)=>{pZ.init(e,t),wn.init(e,t)}),BJ=ve("ZodJWT",(e,t)=>{gZ.init(e,t),wn.init(e,t)}),S4=ve("ZodNumber",(e,t)=>{d4.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>MX(e,r,i),e.gt=(r,i)=>e.check(Q2(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(V2(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(Z2(r)),e.safe=r=>e.check(Z2(r)),e.positive=r=>e.check(Q2(0,r)),e.nonnegative=r=>e.check(ww(0,r)),e.negative=r=>e.check(V2(0,r)),e.nonpositive=r=>e.check(bw(0,r)),e.multipleOf=(r,i)=>e.check(W2(r,i)),e.step=(r,i)=>e.check(W2(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 ce(e){return hX(S4,e)}const UJ=ve("ZodNumberFormat",(e,t)=>{yZ.init(e,t),S4.init(e,t)});function Z2(e){return pX(UJ,e)}const qJ=ve("ZodBoolean",(e,t)=>{vZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>IX(e,n,r)});function ct(e){return mX(qJ,e)}const FJ=ve("ZodUnknown",(e,t)=>{xZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>$X()});function nc(){return gX(FJ)}const HJ=ve("ZodNever",(e,t)=>{bZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>LX(e,n,r)});function KJ(e){return yX(HJ,e)}const GJ=ve("ZodArray",(e,t)=>{wZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>HX(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(g4(n,r)),e.length=(n,r)=>e.check(y4(n,r)),e.unwrap=()=>e.element});function Ae(e,t){return OX(GJ,e,t)}const VJ=ve("ZodObject",(e,t)=>{SZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>KX(e,n,r,i),Dt(e,"shape",()=>t.shape),e.keyof=()=>Ze(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:nc()}),e.loose=()=>e.clone({...e._zod.def,catchall:nc()}),e.strict=()=>e.clone({...e._zod.def,catchall:KJ()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>HW(e,n),e.safeExtend=n=>KW(e,n),e.merge=n=>GW(e,n),e.pick=n=>qW(e,n),e.omit=n=>FW(e,n),e.partial=(...n)=>VW(k4,e,n[0]),e.required=(...n)=>QW(C4,e,n[0])});function pe(e,t){const n={type:"object",shape:e??{},...Fe(t)};return new VJ(n)}const N4=ve("ZodUnion",(e,t)=>{p4.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>GX(e,n,r,i),e.options=t.options});function QJ(e,t){return new N4({type:"union",options:e,...Fe(t)})}const WJ=ve("ZodDiscriminatedUnion",(e,t)=>{N4.init(e,t),NZ.init(e,t)});function YJ(e,t,n){return new WJ({type:"union",options:t,discriminator:e,...Fe(n)})}const ZJ=ve("ZodIntersection",(e,t)=>{kZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>VX(e,n,r,i)});function XJ(e,t){return new ZJ({type:"intersection",left:e,right:t})}const JJ=ve("ZodRecord",(e,t)=>{CZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>QX(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function Za(e,t,n){return new JJ({type:"record",keyType:e,valueType:t,...Fe(n)})}const JS=ve("ZodEnum",(e,t)=>{AZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>BX(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 Ze(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 eee=ve("ZodLiteral",(e,t)=>{EZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>UX(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 eee({type:"literal",values:Array.isArray(e)?e:[e],...Fe(t)})}const tee=ve("ZodTransform",(e,t)=>{OZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>FX(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new W5(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 nee(e){return new tee({type:"transform",transform:e})}const k4=ve("ZodOptional",(e,t)=>{m4.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>w4(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function X2(e){return new k4({type:"optional",innerType:e})}const ree=ve("ZodExactOptional",(e,t)=>{_Z.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>w4(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function iee(e){return new ree({type:"optional",innerType:e})}const aee=ve("ZodNullable",(e,t)=>{zZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>WX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function J2(e){return new aee({type:"nullable",innerType:e})}const see=ve("ZodDefault",(e,t)=>{TZ.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.removeDefault=e.unwrap});function oee(e,t){return new see({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():J5(t)}})}const lee=ve("ZodPrefault",(e,t)=>{PZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>XX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function cee(e,t){return new lee({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():J5(t)}})}const C4=ve("ZodNonOptional",(e,t)=>{RZ.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 uee(e,t){return new C4({type:"nonoptional",innerType:e,...Fe(t)})}const dee=ve("ZodCatch",(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,e.removeCatch=e.unwrap});function fee(e,t){return new dee({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const hee=ve("ZodPipe",(e,t)=>{MZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>eJ(e,n,r,i),e.in=t.in,e.out=t.out});function eT(e,t){return new hee({type:"pipe",in:e,out:t})}const pee=ve("ZodReadonly",(e,t)=>{IZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>tJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function mee(e){return new pee({type:"readonly",innerType:e})}const gee=ve("ZodCustom",(e,t)=>{LZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>qX(e,n)});function yee(e,t={}){return _X(gee,e,t)}function vee(e){return zX(e)}pe({maxConcurrency:ce().int().positive(),maxRequestsPerMinute:ce().int().positive(),maxRequestsPerDay:ce().int().positive()});const Ls=R().min(1);R().min(1);const rk=pe({label:R().min(1),city:R().min(1),region:R().min(1),country:R().length(2),timezone:R().optional()}),ik=Ze(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);pe({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()});pe({channel:Ki("webhook"),url:R().url(),events:Ae(ik).min(1),source:R().optional()});const A4=Ze(["cli","api","config-file"]);function xee(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 bee(e,t){return t?e.some(n=>n.label===t):!0}pe({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:Za(R(),R()).optional(),providers:Ae(Ls).optional(),locations:Ae(rk).optional(),defaultLocation:R().nullable().optional(),autoExtractBacklinks:ct().optional(),configSource:A4.optional()});pe({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:Za(R(),R()).default({}),locations:Ae(rk).default([]),defaultLocation:R().nullable().optional(),autoExtractBacklinks:ct().default(!1),configSource:A4.default("cli"),configRevision:ce().int().positive().default(1),createdAt:R().optional(),updatedAt:R().optional()});pe({id:R(),query:R(),createdAt:R()});pe({id:R(),keyword:R(),createdAt:R()});pe({queries:Ae(R().trim().min(1)).min(1)});pe({keywords:Ae(R().trim().min(1)).min(1)});pe({provider:Ls,count:ce().int().min(1).max(20).optional()});pe({id:R(),domain:R(),createdAt:R()});pe({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 wee=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 jee(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 wee.has(i)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function See(e){const t=jee(e);return t?t.split(".")[0]??"":""}function Nee(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 kee=pe({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:Za(R(),R()).optional().default({})}),Cee=pe({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(),Aee=pe({channel:Ki("webhook"),url:R().url(),events:Ae(ik).min(1)}),Eee=pe({gsc:pe({propertyUrl:R()}).optional(),syncSchedule:pe({preset:R().optional(),cron:R().optional()}).optional()}).optional(),tT=Ae(R().min(1)),Oee=pe({displayName:R().min(1),canonicalDomain:R().min(1),ownedDomains:Ae(R().min(1)).optional().default([]),country:R().length(2),language:R().min(2),queries:tT.optional(),keywords:tT.optional(),competitors:Ae(R().min(1)).optional().default([]),providers:Ae(Ls).optional().default([]),locations:Ae(rk).optional().default([]),defaultLocation:R().optional(),schedule:Cee,notifications:Ae(Aee).optional().default([]),google:Eee,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=xee(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),bee(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});pe({apiVersion:Ki("canonry/v1"),kind:Ki("Project"),metadata:kee,spec:Oee});const _ee=Ze(["gsc","ga4"]);pe({id:R(),domain:R(),connectionType:_ee,propertyId:R().nullable().optional(),sitemapUrl:R().nullable().optional(),scopes:Ae(R()).default([]),createdAt:R(),updatedAt:R()});pe({date:R(),query:R(),page:R(),country:R().nullable().optional(),device:R().nullable().optional(),clicks:ce(),impressions:ce(),ctr:ce(),position:ce()});const e1=pe({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()});Ze(["stable","reindexed","deindexed","still-missing","new"]);const zee=pe({url:R(),previousState:R().nullable(),currentState:R().nullable(),transitionDate:R()}),Tee=pe({reason:R(),count:ce(),urls:Ae(e1).default([])});pe({summary:pe({total:ce(),indexed:ce(),notIndexed:ce(),deindexed:ce(),percentage:ce()}),lastInspectedAt:R().nullable(),lastSyncedAt:R().nullable(),indexed:Ae(e1).default([]),notIndexed:Ae(e1).default([]),deindexed:Ae(zee).default([]),reasonGroups:Ae(Tee).default([])});pe({url:R(),type:Ze(["URL_UPDATED","URL_DELETED"]),notifiedAt:R()});pe({url:R(),type:Ze(["URL_UPDATED","URL_DELETED"]),notifiedAt:R(),status:Ze(["success","error"]),error:R().optional()});pe({date:R(),indexed:ce(),notIndexed:ce(),reasonBreakdown:Za(R(),ce()).default({})});pe({id:R(),domain:R(),siteUrl:R().nullable().optional(),createdAt:R(),updatedAt:R()});const jw=pe({id:R(),url:R(),httpCode:ce().nullable().optional(),inIndex:ct().nullable().optional(),lastCrawledDate:R().nullable().optional(),inIndexDate:R().nullable().optional(),inspectedAt:R(),documentSize:ce().nullable().optional(),anchorCount:ce().nullable().optional(),discoveryDate:R().nullable().optional()});pe({summary:pe({total:ce(),indexed:ce(),notIndexed:ce(),unknown:ce().optional(),percentage:ce()}),lastInspectedAt:R().nullable(),indexed:Ae(jw).default([]),notIndexed:Ae(jw).default([]),unknown:Ae(jw).default([]).optional()});pe({query:R(),impressions:ce(),clicks:ce(),ctr:ce(),averagePosition:ce()});pe({date:R(),indexed:ce(),notIndexed:ce(),unknown:ce()});pe({url:R(),status:Ze(["success","error"]),submittedAt:R(),error:R().optional()});const yd=Ze(["live","staging"]);pe({projectName:R(),url:R(),stagingUrl:R().optional(),username:R(),defaultEnv:yd,createdAt:R(),updatedAt:R()});const nT=pe({url:R(),reachable:ct(),pageCount:ce().nullable().optional(),version:R().nullable().optional(),error:R().nullable().optional(),plugins:Ae(R()).optional(),authenticatedUser:pe({id:ce(),slug:R()}).nullable().optional()});pe({connected:ct(),projectName:R(),defaultEnv:yd,live:nT.nullable(),staging:nT.nullable(),adminUrl:R().nullable().optional()});const Pee=pe({id:ce(),slug:R(),title:R(),status:R(),modifiedAt:R().nullable().optional(),link:R().nullable().optional()}),E4=pe({title:R().nullable(),description:R().nullable(),noindex:ct().nullable(),writable:ct().default(!1),writeTargets:Ae(R()).default([])}),Ree=pe({type:R(),json:Za(R(),nc())}),Dee=Pee.extend({env:yd,content:R(),seo:E4,schemaBlocks:Ae(Ree).default([])}),rT=Dee.extend({contentHash:R(),contentSnippet:R()}),O4=pe({manualRequired:Ki(!0),targetUrl:R(),adminUrl:R().nullable().optional(),content:R(),nextSteps:Ae(R()).default([])}),Mee=pe({slug:R(),severity:Ze(["high","medium","low"]),code:Ze(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:R()});pe({slug:R(),title:R(),status:R(),wordCount:ce(),seo:E4,schemaPresent:ct(),issues:Ae(Mee).default([])});const Iee=pe({slug:R(),status:Ze(["applied","skipped","manual"]),error:R().optional(),manualAssist:O4.optional()});pe({env:yd,strategy:Ze(["plugin","manual"]),results:Ae(Iee)});const Lee=pe({slug:R(),status:Ze(["deployed","stripped","skipped","failed"]),schemasInjected:Ae(R()).optional(),manualAssist:O4.optional(),error:R().optional()});pe({env:yd,results:Ae(Lee)});const $ee=pe({slug:R(),title:R(),canonrySchemas:Ae(R()),thirdPartySchemas:Ae(R()),hasCanonrySchema:ct()});pe({env:yd,pages:Ae($ee)});const Bee=pe({name:R(),status:Ze(["completed","skipped","failed"]),summary:R().optional(),error:R().optional()});pe({projectName:R(),steps:Ae(Bee)});pe({slug:R(),live:rT,staging:rT,hasDifferences:ct(),differences:pe({title:ct(),slug:ct(),content:ct(),seoTitle:ct(),seoDescription:ct(),noindex:ct(),schema:ct()})});const _4=Ze(["queued","running","completed","partial","failed","cancelled"]),hr=_4.enum,z4=Ze(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","bing-inspect-sitemap","backlink-extract","traffic-sync"]),Nt=z4.enum,T4=Ze(["manual","scheduled","config-apply"]),sh=T4.enum,Xu=Ze(["cited","not-cited"]),Ju=Xu.enum,cy=Ze(["visible","not-visible"]);cy.enum;const P4=Ze(["new","cited","lost","emerging","not-cited"]);P4.enum;pe({kind:Ki(Nt["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 Uee=pe({message:R(),raw:nc().optional()}),qee=pe({message:R().optional(),providers:Za(R(),Uee).optional()}),Fee=pe({id:R(),projectId:R(),kind:z4,status:_4,trigger:T4.default("manual"),location:R().nullable().optional(),startedAt:R().nullable().optional(),finishedAt:R().nullable().optional(),error:qee.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 R4=pe({uri:R(),title:R()}),D4=pe({id:R(),runId:R(),queryId:R(),query:R().optional(),provider:Ls,citationState:Xu,answerMentioned:ct().optional(),visibilityState:cy.optional(),transition:P4.optional(),answerText:R().nullable().optional(),citedDomains:Ae(R()).default([]),competitorOverlap:Ae(R()).default([]),recommendedCompetitors:Ae(R()).default([]),matchedTerms:Ae(R()).default([]),groundingSources:Ae(R4).default([]),searchQueries:Ae(R()).default([]),model:R().nullable().optional(),location:R().nullable().optional(),createdAt:R()});pe({snapshots:Ae(D4),total:ce().int().nonnegative()});const Hee=pe({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()});pe({run1:R(),run2:R(),diff:Ae(Hee)});const Kee=Fee.extend({snapshots:Ae(D4).optional()});pe({totalRuns:ce().int().nonnegative(),run:Kee.nullable()});pe({id:R(),projectId:R().nullable().optional(),actor:R(),action:R(),entityType:R(),entityId:R().nullable().optional(),diff:nc().optional(),createdAt:R()});const Gee=Ze(["yes","no","unknown","not-mentioned"]),iT=Ae(R().min(1));pe({companyName:R().min(1),domain:R().min(1),queries:iT.optional(),phrases:iT.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 Vee=pe({name:R(),count:ce().int().nonnegative()}),Qee=pe({id:R(),name:R(),weight:ce(),score:ce(),grade:R(),status:Ze(["pass","partial","fail"]),findings:Ae(pe({type:R(),message:R()})).default([]),recommendations:Ae(R()).default([])}),Wee=pe({url:R(),finalUrl:R(),auditedAt:R(),overallScore:ce(),overallGrade:R(),summary:R(),factors:Ae(Qee).default([])}),Yee=pe({industry:R(),summary:R(),services:Ae(R()).default([]),categoryTerms:Ae(R()).default([])}),Zee=pe({provider:R(),displayName:R(),model:R().nullable().optional(),mentioned:ct(),cited:ct(),describedAccurately:Gee,accuracyNotes:R().nullable().optional(),incorrectClaims:Ae(R()).default([]),recommendedCompetitors:Ae(R()).default([]),citedDomains:Ae(R()).default([]),groundingSources:Ae(R4).default([]),searchQueries:Ae(R()).default([]),answerText:R(),error:R().nullable().optional()}),Xee=pe({query:R(),providerResults:Ae(Zee).default([])}),Jee=pe({totalQueries:ce().int().nonnegative(),totalProviders:ce().int().nonnegative(),totalComparisons:ce().int().nonnegative(),mentionCount:ce().int().nonnegative(),citationCount:ce().int().nonnegative(),topCompetitors:Ae(Vee).default([]),visibilityGap:R(),whatThisMeans:Ae(R()).default([]),recommendedActions:Ae(R()).default([])});pe({companyName:R(),domain:R(),homepageUrl:R(),generatedAt:R(),queries:Ae(R()).default([]),competitors:Ae(R()).default([]),profile:Yee,audit:Wee,queryResults:Ae(Xee).default([]),summary:Jee});pe({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()});pe({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 ete=Ze(["mentioned","cited"]);ete.enum;pe({id:R(),projectId:R(),propertyId:R(),clientEmail:R(),connected:ct(),createdAt:R(),updatedAt:R()});pe({date:R(),landingPage:R(),sessions:ce(),organicSessions:ce(),users:ce()});const sk=Ze(["session","first_user","manual_utm"]),tte=pe({source:R(),medium:R(),sessions:ce(),users:ce(),sourceDimension:sk}),nte=pe({source:R(),medium:R(),sourceDimension:sk,landingPage:R(),sessions:ce(),users:ce()}),rte=pe({source:R(),medium:R(),sessions:ce(),users:ce(),channelGroup:R()});pe({totalSessions:ce(),totalOrganicSessions:ce(),totalDirectSessions:ce(),totalUsers:ce(),topPages:Ae(pe({landingPage:R(),sessions:ce(),organicSessions:ce(),directSessions:ce(),users:ce()})),aiReferrals:Ae(tte),aiReferralLandingPages:Ae(nte),aiSessionsDeduped:ce(),aiUsersDeduped:ce(),aiSessionsBySession:ce(),aiUsersBySession:ce(),socialReferrals:Ae(rte),socialSessions:ce(),socialUsers:ce(),organicSharePct:ce(),aiSharePct:ce(),aiSharePctBySession:ce(),directSharePct:ce(),socialSharePct:ce(),organicSharePctDisplay:R(),aiSharePctDisplay:R(),aiSharePctBySessionDisplay:R(),directSharePctDisplay:R(),socialSharePctDisplay:R(),lastSyncedAt:R().nullable()});pe({date:R(),source:R(),medium:R(),landingPage:R(),sessions:ce(),users:ce(),sourceDimension:sk});pe({date:R(),source:R(),medium:R(),sessions:ce(),users:ce(),channelGroup:R()});pe({date:R(),sessions:ce(),organicSessions:ce(),users:ce()});function uy(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const ite=Ze(["aero","user","compaction"]);ite.enum;const M4=128;pe({key:R().min(1).max(M4),value:R().min(1)});pe({key:R().min(1).max(M4)});const ok=Ze(["queued","downloading","querying","ready","failed"]);ok.enum;pe({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:ce().int().nullable().optional(),edgesBytes:ce().int().nullable().optional(),projectsProcessed:ce().int().nullable().optional(),domainsDiscovered:ce().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 ate=pe({linkingDomain:R(),numHosts:ce().int()}),ste=pe({projectId:R(),release:R(),targetDomain:R(),totalLinkingDomains:ce().int(),totalHosts:ce().int(),top10HostsShare:R(),queriedAt:R(),excludedLinkingDomains:ce().int().optional(),excludedHosts:ce().int().optional()});pe({summary:ste.nullable(),total:ce().int(),rows:Ae(ate)});pe({release:R(),totalLinkingDomains:ce().int(),totalHosts:ce().int(),top10HostsShare:R(),queriedAt:R()});pe({duckdbInstalled:ct(),duckdbVersion:R().nullable().optional(),duckdbSpec:R(),pluginDir:R()});pe({installed:ct(),version:R(),path:R(),alreadyPresent:ct()});pe({release:R(),vertexUrl:R(),edgesUrl:R(),vertexBytes:ce().int().nullable(),edgesBytes:ce().int().nullable(),lastModified:R().nullable()});pe({release:R(),syncStatus:ok.nullable(),bytes:ce().int(),lastUsedAt:R().nullable()});Ze(["snapshot","insight"]);const ote=pe({kind:Ki("snapshot"),id:R(),runId:R(),query:R(),provider:R(),model:R().nullable(),citationState:Xu,matchedField:Ze(["answerText","citedDomains","searchQueries","query"]),snippet:R(),createdAt:R()}),lte=pe({kind:Ki("insight"),id:R(),runId:R().nullable(),type:Ze(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost"]),severity:Ze(["critical","high","medium","low"]),title:R(),query:R(),provider:R(),matchedField:Ze(["title","query","recommendation","cause"]),snippet:R(),dismissed:ct(),createdAt:R()}),cte=YJ("kind",[ote,lte]);pe({query:R(),totalHits:ce().int().nonnegative(),truncated:ct(),hits:Ae(cte)});const I4=Ze(["create","expand","refresh","add-schema"]);I4.enum;function aT(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}const L4=Ze(["gsc","competitor-evidence","both"]);L4.enum;const $4=Ze(["high","medium","low"]);$4.enum;function sT(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}const ute=Ze(["blog-post","comparison","listicle","how-to","guide","glossary"]);ute.enum;const B4=Ze(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);B4.enum;const dte=pe({url:R(),gscImpressions:ce().nonnegative(),gscClicks:ce().nonnegative(),gscAvgPosition:ce().nonnegative().nullable(),organicSessions:ce().nonnegative()}),fte=pe({domain:R(),url:R(),title:R(),citationCount:ce().int().nonnegative()}),hte=pe({demand:ce(),competitor:ce(),absence:ce(),gapSeverity:ce()}),pte=pe({actionId:R(),state:B4,lastUpdated:R()}),mte=pe({targetRef:R(),query:R(),action:I4,ourBestPage:dte.nullable(),winningCompetitor:fte.nullable(),score:ce(),scoreBreakdown:hte,drivers:Ae(R()),demandSource:L4,actionConfidence:$4,existingAction:pte.nullable()});pe({targets:Ae(mte),contextMetrics:pe({totalAiReferralSessions:ce().int().nonnegative(),latestRunId:R(),runTimestamp:R()})});const gte=pe({uri:R(),title:R(),domain:R(),isOurDomain:ct(),isCompetitor:ct(),citationCount:ce().int().nonnegative(),providers:Ae(Ls)}),yte=pe({query:R(),groundingSources:Ae(gte)});pe({sources:Ae(yte),latestRunId:R()});const vte=pe({query:R(),competitorDomains:Ae(R()),competitorCount:ce().int().nonnegative(),missRate:ce().min(0).max(1),lastSeenInRunId:R()});pe({gaps:Ae(vte),latestRunId:R()});const U4=Ze(["ok","warn","fail","skipped"]);U4.enum;const lk=Ze(["global","project"]);lk.enum;const q4=Ze(["auth","config","providers","integrations","database","schedules"]);q4.enum;const xte=pe({id:R(),category:q4,scope:lk,title:R(),status:U4,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:Za(R(),nc()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:ce().int().nonnegative().describe("How long the check took to execute.")});pe({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:ce().int().nonnegative(),summary:pe({total:ce().int().nonnegative(),ok:ce().int().nonnegative(),warn:ce().int().nonnegative(),fail:ce().int().nonnegative(),skipped:ce().int().nonnegative()}),checks:Ae(xte)});function bte(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 wte=pe({provider:R(),citationState:Xu,cited:ct(),mentioned:ct(),runId:R(),runCreatedAt:R()}),jte=pe({queryId:R(),query:R(),providers:Ae(wte),citedCount:ce().int().nonnegative(),mentionedCount:ce().int().nonnegative(),totalProviders:ce().int().nonnegative()}),Ste=pe({queryId:R(),query:R(),provider:R(),citingCompetitors:Ae(R()),runId:R(),runCreatedAt:R()}),Nte=pe({providersConfigured:ce().int().nonnegative(),providersCiting:ce().int().nonnegative(),providersMentioning:ce().int().nonnegative(),totalQueries:ce().int().nonnegative(),queriesCitedAndMentioned:ce().int().nonnegative(),queriesCitedOnly:ce().int().nonnegative(),queriesMentionedOnly:ce().int().nonnegative(),queriesInvisible:ce().int().nonnegative(),latestRunId:R().nullable(),latestRunAt:R().nullable()});pe({summary:Nte,byQuery:Ae(jte),competitorGaps:Ae(Ste),status:Ze(["ready","no-data"]),reason:Ze(["no-runs-yet","no-queries"]).optional()});function kte(e){return e.horizon==="immediate"?"negative":e.confidence==="high"?"caution":e.confidence==="low"?"neutral":"caution"}function F4(e){switch(e){case"critical":return"Critical";case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}function H4(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function Cte(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 Ate(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}const Ete=new Set(["a","an","and","for","from","in","near","of","on","or","the","to"]);function K4(e){return e.toLowerCase().match(/[a-z0-9]+/g)??[]}function G4(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 V4(e){const t=e.meta.location;return t?new Set([t.label,t.city,t.region,t.country].flatMap(K4).map(G4).filter(Boolean)):new Set}function Q4(e,t){const n=K4(e).map(G4).filter(Boolean).filter(r=>!Ete.has(r)).filter(r=>!t.has(r));return[...new Set(n)].sort().join(" ")}function Ote(e){return e.title.match(/"([^"]+)"/)?.[1]??e.successMetric.match(/"([^"]+)"/)?.[1]??e.title}function W4(e,t){const n=V4(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=Q4(Ote(a),n);!l||r.has(l)||(r.add(l),i.push(a))}return i}function Y4(e){const t=V4(e),n=e.contentOpportunities;if(n.length<=1||t.size===0)return n;const r=new Set;return n.filter(i=>{const a=Q4(i.query,t);return!a||r.has(a)?!1:(r.add(a),!0)})}const _te=Ze(["claude","codex"]);_te.enum;const zte=Ze(["claude","codex","all"]);zte.enum;const ck=Ze(["cloud-run","wordpress","cloudflare","vercel","generic-log"]);ck.enum;const Tte=Ze(["raw-request-events","aggregate-request-metrics","request-url","status-code","user-agent","remote-ip","referer","cursor-pull"]);Tte.enum;const Pte=Ze(["raw-request","aggregate-bucket"]),Rte=Pte.enum,Dte=Ze(["observed","provider-aggregated","inferred"]),Mte=Dte.enum,Ite=pe({type:R().nullable(),labels:Za(R(),R())}),Lte=pe({sourceType:ck,evidenceKind:Ki(Rte["raw-request"]),confidence:Ki(Mte.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:ce().int().nullable(),userAgent:R().nullable(),remoteIp:R().nullable(),referer:R().nullable(),latencyMs:ce().nullable(),requestSizeBytes:ce().int().nullable(),responseSizeBytes:ce().int().nullable(),providerResource:Ite,providerLabels:Za(R(),R())});pe({events:Ae(Lte),rawEntryCount:ce().int().nonnegative(),skippedEntryCount:ce().int().nonnegative(),nextPageToken:R().optional(),filter:R()});const Z4=Ze(["connected","paused","error","archived"]);Z4.enum;const X4=Ze(["oauth","service-account"]);X4.enum;pe({gcpProjectId:R().min(1),serviceName:R().nullable().optional(),location:R().nullable().optional(),authMode:X4});pe({id:R(),projectId:R(),sourceType:ck,displayName:R(),status:Z4,lastSyncedAt:R().nullable(),lastCursor:R().nullable(),lastError:R().nullable(),archivedAt:R().nullable(),config:Za(R(),nc()),createdAt:R(),updatedAt:R()});pe({gcpProjectId:R().min(1),serviceName:R().min(1).optional(),location:R().min(1).optional(),displayName:R().min(1).optional(),keyJson:R().optional()});pe({sourceId:R(),runId:R(),syncedAt:R(),pulledEvents:ce().int().nonnegative(),crawlerHits:ce().int().nonnegative(),aiReferralHits:ce().int().nonnegative(),unknownHits:ce().int().nonnegative(),crawlerBucketRows:ce().int().nonnegative(),aiReferralBucketRows:ce().int().nonnegative(),sampleRows:ce().int().nonnegative(),windowStart:R(),windowEnd:R()});var Ro=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(Ro||{});const $te={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},Km={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},Bte=ak;function Ute(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 oT(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 qte(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function Fte(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 J4(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 Hte(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 Kte(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function Gte(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 Vte(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=>Gte(d)).join(" · ");return{...r,label:"Providers",tone:l?"positive":"caution",detail:`${i} of ${a} configured`,meta:u||"None configured"}})}function Qte(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 Wte(e,t,n){const r=Qte(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 e$="canonry.run-tracker",n1=new Set;let lT=!1,Yte=0,Rv={runs:{},batches:{}};function Zte(){const e=rc();for(const t of n1)t(e)}function Xte(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function Jte(){typeof window>"u"||window.sessionStorage.setItem(e$,JSON.stringify(Rv))}function t$(){lT||(lT=!0,!(typeof window>"u")&&(Rv=Xte(window.sessionStorage.getItem(e$))))}function Dv(e){Rv=e,Jte(),Zte()}function rc(){return t$(),Rv}function ene(e){return t$(),n1.add(e),()=>{n1.delete(e)}}function n$(e){const t=rc();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 cT(e){const t=rc();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;Dv({...t,runs:r})}function tne(e){const t=rc(),n=`batch_${Date.now()}_${++Yte}`;return Dv({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function nne(e){const t=rc();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;Dv({...t,batches:r})}function uk(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function rne(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 uT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function dk(...e){return t=>{let n=!1;const r=e.map(i=>{const a=uT(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():uT(e[i],null)}}}}function bc(...e){return x.useCallback(dk(...e),e)}var ine=Symbol.for("react.lazy"),fy=bv[" use ".trim().toString()];function ane(e){return typeof e=="object"&&e!==null&&"then"in e}function r$(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ine&&"_payload"in e&&ane(e._payload)}function sne(e){const t=lne(e),n=x.forwardRef((r,i)=>{let{children:a,...l}=r;r$(a)&&typeof fy=="function"&&(a=fy(a._payload));const u=x.Children.toArray(a),d=u.find(une);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 one=sne("Slot");function lne(e){const t=x.forwardRef((n,r)=>{let{children:i,...a}=n;if(r$(i)&&typeof fy=="function"&&(i=fy(i._payload)),x.isValidElement(i)){const l=fne(i),u=dne(a,i.props);return i.type!==x.Fragment&&(u.ref=r?dk(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 cne=Symbol("radix.slottable");function une(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cne}function dne(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 fne(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 i$(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=i$(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=i$(e))&&(r&&(r+=" "),r+=t);return r}const dT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,fT=Ot,a$=(e,t)=>n=>{var r;if(t?.variants==null)return fT(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=dT(p)||dT(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 fT(e,l,d,n?.class,n?.className)},hne=(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},pne=(e,t)=>({classGroupId:e,validator:t}),s$=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),hy="-",hT=[],mne="arbitrary..",gne=e=>{const t=vne(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return yne(l);const u=l.split(hy),d=u[0]===""&&u.length>1?1:0;return o$(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],f=n[l];return d?f?hne(f,d):d:f||hT}return n[l]||hT}}},o$=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=o$(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}},yne=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?mne+r:void 0})(),vne=e=>{const{theme:t,classGroups:n}=e;return xne(n,t)},xne=(e,t)=>{const n=s$();for(const r in e){const i=e[r];fk(i,n,r,t)}return n},fk=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];bne(l,t,n,r)}},bne=(e,t,n,r)=>{if(typeof e=="string"){wne(e,t,n);return}if(typeof e=="function"){jne(e,t,n,r);return}Sne(e,t,n,r)},wne=(e,t,n)=>{const r=e===""?t:l$(t,e);r.classGroupId=n},jne=(e,t,n,r)=>{if(Nne(e)){fk(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(pne(n,e))},Sne=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[u,d]=i[l];fk(d,l$(t,u),n,r)}},l$=(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=s$(),n.nextPart.set(l,u)),n=u}return n},Nne=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,kne=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="!",pT=":",Cne=[],mT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ane=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===pT){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 mT(a,v,g,j)};if(t){const i=t+pT,a=r;r=l=>l.startsWith(i)?a(l.slice(i.length)):mT(Cne,!1,l,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},Ene=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}},One=e=>({cache:kne(e.cacheSize),parseClassName:Ane(e),sortModifiers:Ene(e),...gne(e)}),_ne=/\s+/,zne=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,l=[],u=e.trim().split(_ne);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 O=g.length===0?"":g.length===1?g[0]:a(g).join(":"),C=v?O+r1:O,A=C+k;if(l.indexOf(A)>-1)continue;l.push(A);const T=i(k,S);for(let E=0;E<T.length;++E){const _=T[E];l.push(C+_)}d=p+(d.length>0?" "+d:d)}return d},Tne=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=c$(n))&&(i&&(i+=" "),i+=r);return i},c$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=c$(e[r]))&&(n&&(n+=" "),n+=t);return n},Pne=(e,...t)=>{let n,r,i,a;const l=d=>{const f=t.reduce((p,m)=>m(p),e());return n=One(f),r=n.cache.get,i=n.cache.set,a=u,u(d)},u=d=>{const f=r(d);if(f)return f;const p=zne(d,n);return i(d,p),p};return a=l,(...d)=>a(Tne(...d))},Rne=[],Kn=e=>{const t=n=>n[e]||Rne;return t.isThemeGetter=!0,t},u$=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,d$=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Dne=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Mne=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ine=/\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$/,Lne=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$ne=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Bne=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wo=e=>Dne.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)),bs=e=>Mne.test(e),f$=()=>!0,Une=e=>Ine.test(e)&&!Lne.test(e),hk=()=>!1,qne=e=>$ne.test(e),Fne=e=>Bne.test(e),Hne=e=>!Ie(e)&&!Le(e),Kne=e=>Xo(e,m$,hk),Ie=e=>u$.test(e),kl=e=>Xo(e,g$,Une),gT=e=>Xo(e,Jne,dt),Gne=e=>Xo(e,v$,f$),Vne=e=>Xo(e,y$,hk),yT=e=>Xo(e,h$,hk),Qne=e=>Xo(e,p$,Fne),Gm=e=>Xo(e,x$,qne),Le=e=>d$.test(e),Rf=e=>wc(e,g$),Wne=e=>wc(e,y$),vT=e=>wc(e,h$),Yne=e=>wc(e,m$),Zne=e=>wc(e,p$),Vm=e=>wc(e,x$,!0),Xne=e=>wc(e,v$,!0),Xo=(e,t,n)=>{const r=u$.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},wc=(e,t,n=!1)=>{const r=d$.exec(e);return r?r[1]?t(r[1]):n:!1},h$=e=>e==="position"||e==="percentage",p$=e=>e==="image"||e==="url",m$=e=>e==="length"||e==="size"||e==="bg-size",g$=e=>e==="length",Jne=e=>e==="number",y$=e=>e==="family-name",v$=e=>e==="number"||e==="weight",x$=e=>e==="shadow",ere=()=>{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"),O=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],E=()=>["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(),vT,yT,{position:[Le,Ie]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",Yne,Kne,{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,vT,yT],me=()=>["","none",j,Le,Ie],Oe=()=>["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:[bs],breakpoint:[bs],color:[f$],container:[bs],"drop-shadow":[bs],ease:["in","out","in-out"],font:[Hne],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[bs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[bs],shadow:[bs],spacing:["px",dt],text:[bs],"text-shadow":[bs],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:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],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,Xne,Gne]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Nw,Ie]}],"font-family":[{font:[Wne,Vne,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,gT]}],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]},Zne,Qne]}],"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:me()}],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":me()}],"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",O,Le,Ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Le,Ie]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:Oe()}],"rotate-x":[{"rotate-x":Oe()}],"rotate-y":[{"rotate-y":Oe()}],"rotate-z":[{"rotate-z":Oe()}],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,gT]}],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"]}},tre=Pne(ere);function Yi(...e){return tre(Ot(e))}const nre=a$("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?one:"button";return s.jsx(l,{ref:a,className:Yi(nre({variant:t,size:n,className:e})),...i})});be.displayName="Button";const rre=a$("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 b$({className:e,variant:t,...n}){return s.jsx("div",{className:Yi(rre({variant:t}),e),...n})}function xT({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 ic({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 Je({tone:e,children:t,...n}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return s.jsx(b$,{variant:r,...n,children:t})}function Mv({status:e}){return s.jsx(Je,{tone:J4(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 ire(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 are(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,sre(i,...t)]}function sre(...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:()=>{},ore=bv[" useId ".trim().toString()]||(()=>{}),lre=0;function kw(e){const[t,n]=x.useState(ore());return jh(()=>{n(r=>r??String(lre++))},[e]),e||(t?`radix-${t}`:"")}var cre=bv[" useInsertionEffect ".trim().toString()]||jh;function ure({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,l]=dre({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=fre(p)?p(e):p;m!==e&&l.current?.(m)}else a(p)},[u,e,a,l]);return[d,f]}function dre({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),a=x.useRef(t);return cre(()=>{a.current=t},[t]),x.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function fre(e){return typeof e=="function"}function w$(e){const t=hre(e),n=x.forwardRef((r,i)=>{const{children:a,...l}=r,u=x.Children.toArray(a),d=u.find(mre);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 hre(e){const t=x.forwardRef((n,r)=>{const{children:i,...a}=n;if(x.isValidElement(i)){const l=yre(i),u=gre(a,i.props);return i.type!==x.Fragment&&(u.ref=r?dk(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 pre=Symbol("radix.slottable");function mre(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pre}function gre(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 yre(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 vre=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$s=vre.reduce((e,t)=>{const n=w$(`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 xre(e,t){e&&vc.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 bre(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 wre="DismissableLayer",i1="dismissableLayer.update",jre="dismissableLayer.pointerDownOutside",Sre="dismissableLayer.focusOutside",bT,j$=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),S$=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:l,onDismiss:u,...d}=e,f=x.useContext(j$),[p,m]=x.useState(null),g=p?.ownerDocument??globalThis?.document,[,v]=x.useState({}),j=bc(t,_=>m(_)),b=Array.from(f.layers),[S]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=b.indexOf(S),O=p?b.indexOf(p):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,A=O>=k,T=Cre(_=>{const P=_.target,$=[...f.branches].some(F=>F.contains(P));!A||$||(i?.(_),l?.(_),_.defaultPrevented||u?.())},g),E=Are(_=>{const P=_.target;[...f.branches].some(F=>F.contains(P))||(a?.(_),l?.(_),_.defaultPrevented||u?.())},g);return bre(_=>{O===f.layers.size-1&&(r?.(_),!_.defaultPrevented&&u&&(_.preventDefault(),u()))},g),x.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(bT=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),wT(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=bT)}},[p,g,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),wT())},[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,E.onFocusCapture),onBlurCapture:$o(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:$o(e.onPointerDownCapture,T.onPointerDownCapture)})});S$.displayName=wre;var Nre="DismissableLayerBranch",kre=x.forwardRef((e,t)=>{const n=x.useContext(j$),r=x.useRef(null),i=bc(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})});kre.displayName=Nre;function Cre(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(){N$(jre,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 Are(e,t=globalThis?.document){const n=Sh(e),r=x.useRef(!1);return x.useEffect(()=>{const i=a=>{a.target&&!r.current&&N$(Sre,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function wT(){const e=new CustomEvent(i1);document.dispatchEvent(e)}function N$(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?xre(i,a):i.dispatchEvent(a)}var Cw="focusScope.autoFocusOnMount",Aw="focusScope.autoFocusOnUnmount",jT={bubbles:!1,cancelable:!0},Ere="FocusScope",k$=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=bc(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 O=new MutationObserver(k);return u&&O.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",S),O.disconnect()}}},[r,u,v.paused]),x.useEffect(()=>{if(u){NT.add(v);const b=document.activeElement;if(!u.contains(b)){const k=new CustomEvent(Cw,jT);u.addEventListener(Cw,f),u.dispatchEvent(k),k.defaultPrevented||(Ore(Rre(C$(u)),{select:!0}),document.activeElement===b&&ko(u))}return()=>{u.removeEventListener(Cw,f),setTimeout(()=>{const k=new CustomEvent(Aw,jT);u.addEventListener(Aw,p),u.dispatchEvent(k),k.defaultPrevented||ko(b??document.body,{select:!0}),u.removeEventListener(Aw,p),NT.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 O=b.currentTarget,[C,A]=_re(O);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===O&&b.preventDefault()}},[n,r,v.paused]);return s.jsx($s.div,{tabIndex:-1,...l,ref:g,onKeyDown:j})});k$.displayName=Ere;function Ore(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ko(r,{select:t}),document.activeElement!==n)return}function _re(e){const t=C$(e),n=ST(t,e),r=ST(t.reverse(),e);return[n,r]}function C$(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 ST(e,t){for(const n of e)if(!zre(n,{upTo:t}))return n}function zre(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 Tre(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&&Tre(e)&&t&&e.select()}}var NT=Pre();function Pre(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=kT(e,t),e.unshift(t)},remove(t){e=kT(e,t),e[0]?.resume()}}}function kT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Rre(e){return e.filter(t=>t.tagName!=="A")}var Dre="Portal",A$=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?TG.createPortal(s.jsx($s.div,{...r,ref:t}),l):null});A$.displayName=Dre;function Mre(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Iv=e=>{const{present:t,children:n}=e,r=Ire(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=bc(r.ref,Lre(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:a}):null};Iv.displayName="Presence";function Ire(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),a=x.useRef("none"),l=e?"mounted":"unmounted",[u,d]=Mre(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 Lre(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 Ew=0;function $re(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??CT()),document.body.insertAdjacentElement("beforeend",e[1]??CT()),Ew++,()=>{Ew===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ew--}},[])}function CT(){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 E$(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 Bre(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",Ure="with-scroll-bars-hidden",qre="--removed-body-scroll-bar-size";function Ow(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Fre(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 Hre=typeof window<"u"?x.useLayoutEffect:x.useEffect,AT=new WeakMap;function Kre(e,t){var n=Fre(null,function(r){return e.forEach(function(i){return Ow(i,r)})});return Hre(function(){var r=AT.get(n);if(r){var i=new Set(r),a=new Set(e),l=n.current;i.forEach(function(u){a.has(u)||Ow(u,null)}),a.forEach(function(u){i.has(u)||Ow(u,l)})}AT.set(n,e)},[e]),n}function Gre(e){return e}function Vre(e,t){t===void 0&&(t=Gre);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 Qre(e){e===void 0&&(e={});var t=Vre(null);return t.options=Da({async:!0,ssr:!1},e),t}var O$=function(e){var t=e.sideCar,n=E$(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))};O$.isSideCarExport=!0;function Wre(e,t){return e.useMedium(t),O$}var _$=Qre(),_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,O=k===void 0?"div":k,C=e.gapMode,A=E$(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=g,E=Kre([n,t]),_=Da(Da({},A),i);return x.createElement(x.Fragment,null,p&&x.createElement(T,{sideCar:_$,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:E})):x.createElement(O,Da({},_,{className:d,ref:E}),u))});Lv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Lv.classNames={fullWidth:Mg,zeroRight:Dg};var Yre=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Zre(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Yre();return t&&e.setAttribute("nonce",t),e}function Xre(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Jre(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var eie=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Zre())&&(Xre(t,n),Jre(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tie=function(){var e=eie();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},z$=function(){var e=tie(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},nie={left:0,top:0,right:0,gap:0},zw=function(e){return parseInt(e||"",10)||0},rie=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)]},iie=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return nie;var t=rie(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])}},aie=z$(),$u="data-scroll-locked",sie=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(Ure,` {
54
- overflow: hidden `).concat(r,`;
55
- padding-right: `).concat(u,"px ").concat(r,`;
56
- }
57
- body[`).concat($u,`] {
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($u,`] {
87
- `).concat(qre,": ").concat(u,`px;
88
- }
89
- `)},ET=function(){var e=parseInt(document.body.getAttribute($u)||"0",10);return isFinite(e)?e:0},oie=function(){x.useEffect(function(){return document.body.setAttribute($u,(ET()+1).toString()),function(){var e=ET()-1;e<=0?document.body.removeAttribute($u):document.body.setAttribute($u,e.toString())}},[])},lie=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;oie();var a=x.useMemo(function(){return iie(i)},[i]);return x.createElement(aie,{styles:sie(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 uu=a1?{passive:!1}:!1,cie=function(e){return e.tagName==="TEXTAREA"},T$=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!cie(e)&&n[t]==="visible")},uie=function(e){return T$(e,"overflowY")},die=function(e){return T$(e,"overflowX")},OT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=P$(e,r);if(i){var a=R$(e,r),l=a[1],u=a[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fie=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},hie=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},P$=function(e,t){return e==="v"?uie(t):die(t)},R$=function(e,t){return e==="v"?fie(t):hie(t)},pie=function(e,t){return e==="h"&&t==="rtl"?-1:1},mie=function(e,t,n,r,i){var a=pie(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=R$(e,u),j=v[0],b=v[1],S=v[2],k=b-S-a*j;(j||k)&&P$(e,u)&&(m+=k,g+=j);var O=u.parentNode;u=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}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]},_T=function(e){return[e.deltaX,e.deltaY]},zT=function(e){return e&&"current"in e?e.current:e},gie=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yie=function(e){return`
90
- .block-interactivity-`.concat(e,` {pointer-events: none;}
91
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
92
- `)},vie=0,du=[];function xie(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(vie++)[0],a=x.useState(z$)[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=Bre([e.lockRef.current],(e.shards||[]).map(zT),!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),O=n.current,C="deltaX"in b?b.deltaX:O[0]-k[0],A="deltaY"in b?b.deltaY:O[1]-k[1],T,E=b.target,_=Math.abs(C)>Math.abs(A)?"h":"v";if("touches"in b&&_==="h"&&E.type==="range")return!1;var P=window.getSelection(),$=P&&P.anchorNode,F=$?$===E||$.contains(E):!1;if(F)return!1;var U=OT(_,E);if(!U)return!0;if(U?T=_:(T=_==="v"?"h":"v",U=OT(_,E)),!U)return!1;if(!r.current&&"changedTouches"in b&&(C||A)&&(r.current=T),!T)return!0;var B=r.current||T;return mie(B,S,b,B==="h"?C:A)},[]),d=x.useCallback(function(b){var S=b;if(!(!du.length||du[du.length-1]!==a)){var k="deltaY"in S?_T(S):Ym(S),O=t.current.filter(function(T){return T.name===S.type&&(T.target===S.target||S.target===T.shadowParent)&&gie(T.delta,k)})[0];if(O&&O.should){S.cancelable&&S.preventDefault();return}if(!O){var C=(l.current.shards||[]).map(zT).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,O){var C={name:b,delta:S,target:k,should:O,shadowParent:bie(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,_T(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 du.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",d,uu),document.addEventListener("touchmove",d,uu),document.addEventListener("touchstart",p,uu),function(){du=du.filter(function(b){return b!==a}),document.removeEventListener("wheel",d,uu),document.removeEventListener("touchmove",d,uu),document.removeEventListener("touchstart",p,uu)}},[]);var v=e.removeScrollBar,j=e.inert;return x.createElement(x.Fragment,null,j?x.createElement(a,{styles:yie(i)}):null,v?x.createElement(lie,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function bie(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wie=Wre(_$,xie);var D$=x.forwardRef(function(e,t){return x.createElement(Lv,Da({},e,{ref:t,sideCar:wie}))});D$.classNames=Lv.classNames;var jie=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},fu=new WeakMap,Zm=new WeakMap,Xm={},Tw=0,M$=function(e){return e&&(e.host||M$(e.parentNode))},Sie=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=M$(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})},Nie=function(e,t,n,r){var i=Sie(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=(fu.get(g)||0)+1,S=(a.get(g)||0)+1;fu.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=fu.get(m)-1,v=a.get(m)-1;fu.set(m,g),a.set(m,v),g||(Zm.has(m)||m.removeAttribute(r),Zm.delete(m)),v||m.removeAttribute(n)}),Tw--,Tw||(fu=new WeakMap,fu=new WeakMap,Zm=new WeakMap,Xm={})}},kie=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=jie(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Nie(r,i,n,"aria-hidden")):function(){return null}},$v="Dialog",[I$]=are($v),[Cie,ga]=I$($v),L$=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]=ure({prop:r,defaultProp:i??!1,onChange:a,caller:$v});return s.jsx(Cie,{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})};L$.displayName=$v;var $$="DialogTrigger",Aie=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ga($$,n),a=bc(t,i.triggerRef);return s.jsx($s.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":gk(i.open),...r,ref:a,onClick:$o(e.onClick,i.onOpenToggle)})});Aie.displayName=$$;var pk="DialogPortal",[Eie,B$]=I$(pk,{forceMount:void 0}),U$=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ga(pk,t);return s.jsx(Eie,{scope:t,forceMount:n,children:x.Children.map(r,l=>s.jsx(Iv,{present:n||a.open,children:s.jsx(A$,{asChild:!0,container:i,children:l})}))})};U$.displayName=pk;var py="DialogOverlay",q$=x.forwardRef((e,t)=>{const n=B$(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(_ie,{...i,ref:t})}):null});q$.displayName=py;var Oie=w$("DialogOverlay.RemoveScroll"),_ie=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ga(py,n);return s.jsx(D$,{as:Oie,allowPinchZoom:!0,shards:[i.contentRef],children:s.jsx($s.div,{"data-state":gk(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ac="DialogContent",F$=x.forwardRef((e,t)=>{const n=B$(ac,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ga(ac,e.__scopeDialog);return s.jsx(Iv,{present:r||a.open,children:a.modal?s.jsx(zie,{...i,ref:t}):s.jsx(Tie,{...i,ref:t})})});F$.displayName=ac;var zie=x.forwardRef((e,t)=>{const n=ga(ac,e.__scopeDialog),r=x.useRef(null),i=bc(t,n.contentRef,r);return x.useEffect(()=>{const a=r.current;if(a)return kie(a)},[]),s.jsx(H$,{...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())})}),Tie=x.forwardRef((e,t)=>{const n=ga(ac,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return s.jsx(H$,{...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()}})}),H$=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...l}=e,u=ga(ac,n),d=x.useRef(null),f=bc(t,d);return $re(),s.jsxs(s.Fragment,{children:[s.jsx(k$,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:s.jsx(S$,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":gk(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(Pie,{titleId:u.titleId}),s.jsx(Die,{contentRef:d,descriptionId:u.descriptionId})]})]})}),mk="DialogTitle",K$=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ga(mk,n);return s.jsx($s.h2,{id:i.titleId,...r,ref:t})});K$.displayName=mk;var G$="DialogDescription",V$=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ga(G$,n);return s.jsx($s.p,{id:i.descriptionId,...r,ref:t})});V$.displayName=G$;var Q$="DialogClose",W$=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ga(Q$,n);return s.jsx($s.button,{type:"button",...r,ref:t,onClick:$o(e.onClick,()=>i.onOpenChange(!1))})});W$.displayName=Q$;function gk(e){return e?"open":"closed"}var Y$="DialogTitleWarning",[hze,Z$]=ire(Y$,{contentName:ac,titleName:mk,docsSlug:"dialog"}),Pie=({titleId:e})=>{const t=Z$(Y$),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},Rie="DialogDescriptionWarning",Die=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Z$(Rie).contentName}}.`;return x.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},X$=L$,J$=U$,yk=q$,vk=F$,xk=K$,e3=V$,t3=W$;const Mie=X$,Iie=J$,n3=x.forwardRef(({className:e,...t},n)=>s.jsx(yk,{ref:n,className:Yi("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));n3.displayName=yk.displayName;const Lie=400,$ie=1200,Bie=720,r3=x.forwardRef(({className:e,children:t,...n},r)=>{const[i,a]=x.useState(Bie),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($ie,Math.max(Lie,d.current+v));a(j)},[]),m=x.useCallback(()=>{l.current=!1},[]);return s.jsxs(Iie,{children:[s.jsx(n3,{}),s.jsxs(vk,{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(t3,{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"})]})]})]})});r3.displayName=vk.displayName;const Uie=({className:e,...t})=>s.jsx("div",{className:Yi("flex flex-col gap-1.5 pr-10",e),...t}),i3=x.forwardRef(({className:e,...t},n)=>s.jsx(xk,{ref:n,className:Yi("text-lg font-medium text-zinc-50",e),...t}));i3.displayName=xk.displayName;const a3=x.forwardRef(({className:e,...t},n)=>s.jsx(e3,{ref:n,className:Yi("text-sm text-zinc-500",e),...t}));a3.displayName=e3.displayName;function qie({title:e,subtitle:t,children:n,open:r,onClose:i}){return s.jsx(Mie,{open:r,onOpenChange:a=>a?void 0:i(),children:s.jsxs(r3,{children:[s.jsxs(Uie,{className:"drawer-head",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),s.jsx(i3,{id:"drawer-title",children:e}),s.jsx(a3,{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&&vc.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 Fie=/[\s\-_]+/;function Hie(e){const t=e.split(Fie).filter(Boolean);return t.length===0?null:t.map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function TT(e,t){const n=Kie(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(Hie).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 Kie(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 Gie({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=Nee(t.project),S=new Set(b.map(ly)),k=e.runHistory,O=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 E=u>=0&&f!==null,_=E?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=See(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(Oe=>Oe.query===e.query&&Oe.provider===e.provider)??Se.snapshots.find(Oe=>Oe.query===e.query),me=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(Oe=>({...Oe,[Ce]:me})),p(me)}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=(E||e.historyScope!=="provider")&&_.model?`${_.provider} (${_.model}) · ${_.changeLabel.toLowerCase()}`:`${_.provider} · ${_.changeLabel.toLowerCase()}`,M=!E&&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:TT(ee,Z)},Ce++)),ne=[]};for(const ee of G){const me=ee.trim();if(/^[-\u2013\u2014]{3,}$/.test(me)){Se(),se.push(s.jsx("hr",{className:"border-zinc-800/60 my-3"},Ce++));continue}const Oe=me.match(/^(#{1,3})\s+(.+)$/);if(Oe){Se();const Y=Oe[1].length,He=Oe[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||Oe[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:TT(He,Z)},Ce++));continue}if(me===""){Se();continue}ne.push(me)}return Se(),se};return s.jsx(X$,{open:!0,onOpenChange:G=>{G||n()},children:s.jsxs(J$,{children:[s.jsx(yk,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),s.jsxs(vk,{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(xk,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),s.jsxs(t3,{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"})]})]}),O&&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",Oe=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 ${Oe}: ${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:Oe})]},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"]})]}),!E&&(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"}),!E&&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(me=>me.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 ",E?"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 ",E?"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 Vie=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"}),Qie=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"}),Wie=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"}),Yie=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"}),Zie=[{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 Xie(e,t){return e.projects.find(n=>n.project.id===t)}function Jie(e,t){return e.runs.find(n=>n.id===t)}function eae(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 tae={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral"},nae={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited"},rae={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor"};function iae(e){return{id:e.id,tone:tae[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??rae[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:nae[e.type]}]}}function aae(e){return e.filter(t=>!t.dismissed).map(iae)}function s3(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 PT(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function sae(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 o3(e){switch(e){case Nt["answer-visibility"]:return"Answer visibility sweep";case Nt["gsc-sync"]:return"GSC sync";case Nt["inspect-sitemap"]:return"Sitemap inspection";case Nt["ga-sync"]:return"GA sync";case Nt["traffic-sync"]:return"Traffic sync";case Nt["bing-inspect"]:return"Bing URL inspection";case Nt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Nt["site-audit"]:return"Site audit";case Nt["backlink-extract"]:return"Backlink extract"}}function oae(e){return e===sh.manual?"Manual":e===sh.scheduled?"Scheduled":e===sh["config-apply"]?"Config apply":e}function bk(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:o3(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?PT(e.startedAt):PT(e.createdAt),duration:sae(e.startedAt,e.finishedAt),statusDetail:e.error?l3(e.error):lae(e),summary:cae(e),triggerLabel:oae(e.trigger)}}function l3(e){const t=ak(e);return t.length>200?t.slice(0,200)+"…":t}function lae(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?l3(e.error):"Run failed.";case hr.cancelled:return"Run was cancelled.";default:return""}}function cae(e){const t=o3(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 uae(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 O=S?.model??null,C=O?`${b}:${O}`:null,A=C?g.modelRuns?.[C]:void 0,T=g.providerRuns?.[b],E=(T?.length?T:null)??(A?.length?A:null),_=T?.length?"provider":A?.length?"model":"query",P=E?E.at(-1).transition:j,$=E?E.at(-1).visibilityTransition??(E.at(-1).visibilityState==="visible"?"visible":"not-visible"):v?.visibilityTransition??(v?.visibilityState==="visible"?"visible":"not-visible"),F=E?.at(-1)?.citationState,U=E?.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=RT(E||g.runs),Z=DT(E||g.runs),H=dae(g,b),J=(E??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=fae(J),ye=_==="provider"&&oe.length<=1?"model":_,I=hae(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:MT($,Z,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:MT(P,X),answerSnippet:S?.answerText??"",citedDomains:S?.citedDomains??[],evidenceUrls:[],competitorDomains:S?.competitorOverlap??[],recommendedCompetitors:S?.recommendedCompetitors??[],matchedTerms:S?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:S?.groundingSources??[],summary:pae(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 dae(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 fae(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function hae(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 RT(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 DT(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 MT(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 pae(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 mae(e){const t=s3(e.project),n=uae(t.name,e.timeline,e.latestRunDetail,e.queries),i=[...e.runs].sort((a,l)=>l.createdAt.localeCompare(a.createdAt)).map(a=>bk(a,e.project.displayName||e.project.name));return e.overview?gae(t,e.overview,n,i):yae(t,n,i)}function gae(e,t,n,r){const i=aae(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 yae(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 vae(e){const t=s3(e.project),n=[...e.runs].sort((g,v)=>v.createdAt.localeCompare(g.createdAt)),r=n.find(g=>g.kind===Nt["answer-visibility"])??n[0],i=e.project.displayName||e.project.name,a=r?bk(r,i):xae(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 xae(e,t){return{id:"none",projectId:e,projectName:t,kind:Nt["answer-visibility"],kindLabel:"No runs yet",status:hr.queued,trigger:sh.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function bae(e,t){const n=[],r=[],i=[];for(const l of e){r.push(mae(l)),i.push(vae(l));const u=[...l.runs].sort((d,f)=>f.createdAt.localeCompare(d.createdAt));for(const d of u)n.push(bk(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?wae(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 wae(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]}},c3=x.createContext(null);c3.Provider;function Gh(){return x.useContext(c3)}function jc(e){const n=Gh()?.dashboard??null,r=ua({queryKey:qe.projects.all,queryFn:GN,enabled:!n}),i=ua({queryKey:qe.runs.all,queryFn:E5,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=t7({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,O)=>O.createdAt.localeCompare(k.createdAt));return{queryKey:qe.projects.detail(j.id,S[0]?.id),queryFn:async()=>{const k=S[0]?.id,[O,C,A,T,E,_,P,$,F]=await Promise.all([cV(j.name).catch(()=>[]),O5(j.name).catch(()=>[]),_5(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?uQ(j.name,k).catch(()=>null):Promise.resolve(null),uV(j.name).catch(()=>null)]);return{project:j,runs:b,queries:O,competitors:C,timeline:A,latestRunDetail:T,previousRunDetail:E,gscCoverage:_,bingCoverage:P,dbInsights:$,overview:F}},enabled:!n&&r.isSuccess&&i.isSuccess,staleTime:B5}})}),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 bae(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 jae(){const e=await fQ("/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:jae,enabled:e,refetchInterval:15e3,initialData:t})}function Sae(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 Nae={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function kae(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function Cae(){const e=x.useSyncExternalStore(OQ,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 ${Nae[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":kae(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 Aae(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Eae=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Oae=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_ae={};function IT(e,t){return(_ae.jsx?Oae:Eae).test(e)}const zae=/[ \t\n\f\r]/g;function Tae(e){return typeof e=="object"?e.type==="text"?LT(e.value):!1:LT(e)}function LT(e){return e.replace(zae,"")===""}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 u3(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 Pae=0;const lt=Sc(),Bn=Sc(),o1=Sc(),Ee=Sc(),Wt=Sc(),Bu=Sc(),di=Sc();function Sc(){return 2**++Pae}const l1=Object.freeze(Object.defineProperty({__proto__:null,boolean:lt,booleanish:Bn,commaOrSpaceSeparated:di,commaSeparated:Bu,number:Ee,overloadedBoolean:o1,spaceSeparated:Wt},Symbol.toStringTag,{value:"Module"})),Dw=Object.keys(l1);class wk extends ri{constructor(t,n,r,i){let a=-1;if(super(t,n),$T(this,"space",i),typeof r=="number")for(;++a<Dw.length;){const l=Dw[a];$T(this,Dw[a],(r&l1[l])===l1[l])}}}wk.prototype.defined=!0;function $T(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 wk(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 d3=xd({properties:{ariaActiveDescendant:null,ariaAtomic:Bn,ariaAutoComplete:null,ariaBusy:Bn,ariaChecked:Bn,ariaColCount:Ee,ariaColIndex:Ee,ariaColSpan:Ee,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:Ee,ariaLive:null,ariaModal:Bn,ariaMultiLine:Bn,ariaMultiSelectable:Bn,ariaOrientation:null,ariaOwns:Wt,ariaPlaceholder:null,ariaPosInSet:Ee,ariaPressed:Bn,ariaReadOnly:Bn,ariaRelevant:null,ariaRequired:Bn,ariaRoleDescription:Wt,ariaRowCount:Ee,ariaRowIndex:Ee,ariaRowSpan:Ee,ariaSelected:Bn,ariaSetSize:Ee,ariaSort:null,ariaValueMax:Ee,ariaValueMin:Ee,ariaValueNow:Ee,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function f3(e,t){return t in e?e[t]:t}function h3(e,t){return f3(e,t.toLowerCase())}const Rae=xd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Bu,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:Ee,colSpan:null,content:null,contentEditable:Bn,controls:lt,controlsList:Wt,coords:Ee|Bu,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:Ee,hidden:o1,high:Ee,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:Ee,manifest:null,max:null,maxLength:Ee,media:null,method:null,min:null,minLength:Ee,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:Ee,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:Ee,rowSpan:Ee,sandbox:Wt,scope:null,scoped:lt,seamless:lt,selected:lt,shadowRootClonable:lt,shadowRootDelegatesFocus:lt,shadowRootMode:null,shape:null,size:Ee,sizes:null,slot:null,span:Ee,spellCheck:Bn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ee,step:null,style:null,tabIndex:Ee,target:null,title:null,translate:null,type:null,typeMustMatch:lt,useMap:null,value:Bn,width:Ee,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Wt,axis:null,background:null,bgColor:null,border:Ee,borderColor:null,bottomMargin:Ee,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:lt,declare:lt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ee,leftMargin:Ee,link:null,longDesc:null,lowSrc:null,marginHeight:Ee,marginWidth:Ee,noResize:lt,noHref:lt,noShade:lt,noWrap:lt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ee,rules:null,scheme:null,scrolling:Bn,standby:null,summary:null,text:null,topMargin:Ee,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ee,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:lt,disableRemotePlayback:lt,prefix:null,property:null,results:Ee,security:null,unselectable:null},space:"html",transform:h3}),Dae=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:Ee,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ee,amplitude:Ee,arabicForm:null,ascent:Ee,attributeName:null,attributeType:null,azimuth:Ee,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ee,by:null,calcMode:null,capHeight:Ee,className: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:Ee,diffuseConstant:Ee,direction:null,display:null,dur:null,divisor:Ee,dominantBaseline:null,download:lt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ee,enableBackground:null,end:null,event:null,exponent:Ee,externalResourcesRequired:null,fill:null,fillOpacity:Ee,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Bu,g2:Bu,glyphName:Bu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ee,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ee,horizOriginX:Ee,horizOriginY:Ee,id:null,ideographic:Ee,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ee,k:Ee,k1:Ee,k2:Ee,k3:Ee,k4:Ee,kernelMatrix:di,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ee,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ee,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ee,overlineThickness:Ee,paintOrder:null,panose1:null,path:null,pathLength:Ee,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ee,pointsAtY:Ee,pointsAtZ:Ee,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:di,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:di,rev:di,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:di,requiredFeatures:di,requiredFonts:di,requiredFormats:di,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ee,specularExponent:Ee,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ee,strikethroughThickness:Ee,string:null,stroke:null,strokeDashArray:di,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ee,strokeOpacity:Ee,strokeWidth:null,style:null,surfaceScale:Ee,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:di,tabIndex:Ee,tableValues:null,target:null,targetX:Ee,targetY:Ee,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:di,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ee,underlineThickness:Ee,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ee,values:null,vAlphabetic:Ee,vMathematical:Ee,vectorEffect:null,vHanging:Ee,vIdeographic:Ee,version:null,vertAdvY:Ee,vertOriginX:Ee,vertOriginY:Ee,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ee,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:f3}),p3=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()}}),m3=xd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:h3}),g3=xd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Mae={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"},Iae=/[A-Z]/g,BT=/-[a-z]/g,Lae=/^data[-\w.:]+$/i;function $ae(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"&&Lae.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(BT,Uae);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!BT.test(a)){let l=a.replace(Iae,Bae);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=wk}return new i(r,t)}function Bae(e){return"-"+e.toLowerCase()}function Uae(e){return e.charAt(1).toUpperCase()}const qae=u3([d3,Rae,p3,m3,g3],"html"),jk=u3([d3,Dae,p3,m3,g3],"svg");function Fae(e){return e.join(" ").trim()}var hu={},Mw,UT;function Hae(){if(UT)return Mw;UT=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 O=1,C=1;function A(X){var Z=X.match(t);Z&&(O+=Z.length);var H=X.lastIndexOf(d);C=~H?X.length-H:C+X.length}function T(){var X={line:O,column:C};return function(Z){return Z.position=new E(X),$(),Z}}function E(X){this.start=X,this.end={line:O,column:C},this.source=k.source}E.prototype.content=S;function _(X){var Z=new Error(k.source+":"+O+":"+C+": "+X);if(Z.reason=X,Z.filename=k.source,Z.line=O,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 qT;function Kae(){if(qT)return hu;qT=1;var e=hu&&hu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(hu,"__esModule",{value:!0}),hu.default=n;const t=e(Hae());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 hu}var Mf={},FT;function Gae(){if(FT)return Mf;FT=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,HT;function Vae(){if(HT)return If;HT=1;var e=If&&If.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Kae()),n=Gae();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 Qae=Vae();const Wae=ma(Qae),y3=v3("end"),Sk=v3("start");function v3(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 Yae(e){const t=Sk(e),n=y3(e);if(t&&n)return{start:t,end:n}}function oh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?KT(e.position):"start"in e||"end"in e?KT(e):"line"in e||"column"in e?c1(e):""}function c1(e){return GT(e&&e.line)+":"+GT(e&&e.column)}function KT(e){return c1(e&&e.start)+"-"+c1(e&&e.end)}function GT(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 Nk={}.hasOwnProperty,Zae=new Map,Xae=/[A-Z]/g,Jae=new Set(["table","tbody","thead","tfoot","tr"]),ese=new Set(["td","th"]),x3="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function tse(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=cse(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=lse(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"?jk:qae,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=b3(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function b3(e,t,n){if(t.type==="element")return nse(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return rse(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ase(e,t,n);if(t.type==="mdxjsEsm")return ise(e,t);if(t.type==="root")return sse(e,t,n);if(t.type==="text")return ose(e,t)}function nse(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=jk,e.schema=i),e.ancestors.push(t);const a=j3(e,t.tagName,!1),l=use(e,t);let u=Ck(e,t);return Jae.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!Tae(d):!0})),w3(e,l,a,t),kk(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function rse(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 ise(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Nh(e,t.position)}function ase(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=jk,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:j3(e,t.name,!0),l=dse(e,t),u=Ck(e,t);return w3(e,l,a,t),kk(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function sse(e,t,n){const r={};return kk(r,Ck(e,t)),e.create(t,e.Fragment,r,n)}function ose(e,t){return t.value}function w3(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function kk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function lse(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 cse(e,t){return n;function n(r,i,a,l){const u=Array.isArray(a.children),d=Sk(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 use(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Nk.call(t.properties,i)){const a=fse(e,i,t.properties[i]);if(a){const[l,u]=a;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&ese.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 dse(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 Ck(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Zae;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=b3(e,a,l);u!==void 0&&n.push(u)}return n}function fse(e,t,n){const r=$ae(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Aae(n):Fae(n)),r.property==="style"){let i=typeof n=="object"?n:hse(e,String(n));return e.stylePropertyNameCase==="css"&&(i=pse(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Mae[r.property]||r.property:r.attribute,n]}}function hse(e,t){try{return Wae(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=x3+"#cannot-parse-style-attribute",i}}function j3(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=IT(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=IT(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Nk.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=x3+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pse(e){const t={};let n;for(n in e)Nk.call(e,n)&&(t[mse(n)]=e[n]);return t}function mse(e){let t=e.replace(Xae,gse);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function gse(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"]},yse={};function vse(e,t){const n=yse,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return S3(e,r,i)}function S3(e,t,n){if(xse(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 VT(e.children,t,n)}return Array.isArray(e)?VT(e,t,n):""}function VT(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=S3(e[i],t,n);return r.join("")}function xse(e){return!!(e&&typeof e=="object")}const QT=document.createElement("i");function Ak(e){const t="&"+e+";";QT.innerHTML=t;const n=QT.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 WT={}.hasOwnProperty;function bse(e){const t={};let n=-1;for(;++n<e.length;)wse(t,e[n]);return t}function wse(e,t){let n;for(n in t){const i=(WT.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){WT.call(i,l)||(i[l]=[]);const u=a[l];jse(i[l],Array.isArray(u)?u:u?[u]:[])}}}function jse(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 N3(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 Uu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ma=Jo(/[A-Za-z]/),hi=Jo(/[\dA-Za-z]/),Sse=Jo(/[#-'*+\--9=?A-Z^-~]/);function u1(e){return e!==null&&(e<32||e===127)}const d1=Jo(/\d/),Nse=Jo(/[\dA-Fa-f]/),kse=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 Cse=Jo(new RegExp("\\p{P}|\\p{S}","u")),Ase=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 Ese={tokenize:Ose};function Ose(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 _se={tokenize:zse},YT={tokenize:Tse};function zse(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&&O();const A=t.events.length;let T=A,E;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){E=t.events[T][1].end;break}k(r);let _=A;for(;_<t.events.length;)t.events[_][1].end={...E},_++;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(YT,p,m)(C)}function p(C){return i&&O(),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(YT,v,j)(C)}function v(C){return r++,n.push([t.currentConstruct,t.containerState]),g(C)}function j(C){if(C===null){i&&O(),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 E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<l&&(!i.events[E][1].end||i.events[E][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),E=_;E<t.events.length;)t.events[E][1].end={...F},E++;Ua(t.events,P+1,0,t.events.slice(_)),t.events.length=E}}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 O(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Tse(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 ZT(e){if(e===null||Jr(e)||Ase(e))return 1;if(Cse(e))return 2}function Ek(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:Pse,tokenize:Rse};function Pse(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};XT(m,-d),XT(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,Ek(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 Rse(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ZT(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=ZT(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 XT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Dse={name:"autolink",tokenize:Mse};function Mse(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):Sse(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:Ise};function Ise(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 k3={continuation:{tokenize:$se},exit:Bse,name:"blockQuote",tokenize:Lse};function Lse(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 $se(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(k3,t,n)(l)}}function Bse(e){e.exit("blockQuote")}const C3={name:"characterEscape",tokenize:Use};function Use(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 kse(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const A3={name:"characterReference",tokenize:qse};function qse(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=Nse,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&&!Ak(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 JT={partial:!0,tokenize:Hse},eP={concrete:!0,name:"codeFenced",tokenize:Fse};function Fse(e,t,n){const r=this,i={partial:!0,tokenize:T};let a=0,l=0,u;return d;function d(E){return f(E)}function f(E){const _=r.events[r.events.length-1];return a=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,u=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(E)}function p(E){return E===u?(l++,e.consume(E),p):l<3?n(E):(e.exit("codeFencedFenceSequence"),Pt(E)?Xt(e,m,"whitespace")(E):m(E))}function m(E){return E===null||tt(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(JT,b,A)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===null||tt(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(E)):Pt(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Xt(e,v,"whitespace")(E)):E===96&&E===u?n(E):(e.consume(E),g)}function v(E){return E===null||tt(E)?m(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),j(E))}function j(E){return E===null||tt(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(E)):E===96&&E===u?n(E):(e.consume(E),j)}function b(E){return e.attempt(i,A,S)(E)}function S(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),k}function k(E){return a>0&&Pt(E)?Xt(e,O,"linePrefix",a+1)(E):O(E)}function O(E){return E===null||tt(E)?e.check(JT,b,A)(E):(e.enter("codeFlowValue"),C(E))}function C(E){return E===null||tt(E)?(e.exit("codeFlowValue"),O(E)):(e.consume(E),C)}function A(E){return e.exit("codeFenced"),t(E)}function T(E,_,P){let $=0;return F;function F(Z){return E.enter("lineEnding"),E.consume(Z),E.exit("lineEnding"),U}function U(Z){return E.enter("codeFencedFence"),Pt(Z)?Xt(E,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):B(Z)}function B(Z){return Z===u?(E.enter("codeFencedFenceSequence"),V(Z)):P(Z)}function V(Z){return Z===u?($++,E.consume(Z),V):$>=l?(E.exit("codeFencedFenceSequence"),Pt(Z)?Xt(E,X,"whitespace")(Z):X(Z)):P(Z)}function X(Z){return Z===null||tt(Z)?(E.exit("codeFencedFence"),_(Z)):P(Z)}}}function Hse(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:Gse},Kse={partial:!0,tokenize:Vse};function Gse(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(Kse,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 Vse(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 Qse={name:"codeText",previous:Yse,resolve:Wse,tokenize:Zse};function Wse(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 Yse(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Zse(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 Xse{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 E3(e){const t={};let n=-1,r,i,a,l,u,d,f;const p=new Xse(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,Jse(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 Jse(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]),O=a.pop();d.push([O,O+k.length-1]),e.splice(O,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 eoe={resolve:noe,tokenize:roe},toe={partial:!0,tokenize:ioe};function noe(e){return E3(e),e}function roe(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(toe,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 ioe(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 O3(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 _3(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 z3(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 aoe={name:"definition",tokenize:ooe},soe={partial:!0,tokenize:loe};function ooe(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),l(v)}function l(v){return _3.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function u(v){return i=Uu(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 O3(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(soe,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 loe(e,t,n){return r;function r(u){return Jr(u)?lh(e,i)(u):n(u)}function i(u){return z3(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 coe={name:"hardBreakEscape",tokenize:uoe};function uoe(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 doe={name:"headingAtx",resolve:foe,tokenize:hoe};function foe(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 hoe(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 poe=["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"],tP=["pre","script","style","textarea"],moe={concrete:!0,name:"htmlFlow",resolveTo:voe,tokenize:xoe},goe={partial:!0,tokenize:woe},yoe={partial:!0,tokenize:boe};function voe(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 xoe(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&&tP.includes(se)?(i=1,r.interrupt?t(D):B(D)):poe.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?O(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 O(D){return Pt(D)?(e.consume(D),O):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),E):Pt(D)?(e.consume(D),T):C(D)}function E(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),E):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(goe,q,V)(D)):D===null||tt(D)?(e.exit("htmlFlowData"),V(D)):(e.consume(D),B)}function V(D){return e.check(yoe,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 tP.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 boe(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 woe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(qv,t,n)}}const joe={name:"htmlText",tokenize:Soe};function Soe(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),O):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 O(I){return I===null||I===62?H(I):tt(I)?(l=O,J(I)):(e.consume(I),O)}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),E):n(I)}function E(I){return I===45||hi(I)?(e.consume(I),E):_(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:Aoe,resolveTo:Eoe,tokenize:Ooe},Noe={tokenize:_oe},koe={tokenize:zoe},Coe={tokenize:Toe};function Aoe(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 Eoe(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,Ek(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 Ooe(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(Uu(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(Noe,p,l?p:m)(g):g===91?e.attempt(koe,p,l?f:m)(g):l?p(g):m(g)}function f(g){return e.attempt(Coe,p,m)(g)}function p(g){return t(g)}function m(g){return a._balanced=!0,n(g)}}function _oe(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):O3(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?z3(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 zoe(e,t,n){const r=this;return i;function i(u){return _3.call(r,e,a,l,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(Uu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function Toe(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 Poe={name:"labelStartImage",resolveAll:Ok.resolveAll,tokenize:Roe};function Roe(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 Doe={name:"labelStartLink",resolveAll:Ok.resolveAll,tokenize:Moe};function Moe(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:Ioe};function Ioe(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:Loe};function Loe(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:qoe},exit:Hoe,name:"list",tokenize:Uoe},$oe={partial:!0,tokenize:Koe},Boe={partial:!0,tokenize:Foe};function Uoe(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($oe,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 qoe(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(Boe,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 Foe(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 Hoe(e){e.exit(this.containerState.type)}function Koe(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 nP={name:"setextUnderline",resolveTo:Goe,tokenize:Voe};function Goe(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 Voe(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 Qoe={tokenize:Woe};function Woe(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(eoe,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 Yoe={resolveAll:P3()},Zoe=T3("string"),Xoe=T3("text");function T3(e){return{resolveAll:P3(e==="text"?Joe: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 P3(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 Joe(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 ele={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:k3},tle={91:aoe},nle={[-2]:Lw,[-1]:Lw,32:Lw},rle={35:doe,42:Ig,45:[nP,Ig],60:moe,61:nP,95:Ig,96:eP,126:eP},ile={38:A3,92:C3},ale={[-5]:$w,[-4]:$w,[-3]:$w,33:Poe,38:A3,42:f1,60:[Dse,joe],91:Doe,92:[coe,C3],93:Ok,95:f1,96:Qse},sle={null:[f1,Yoe]},ole={null:[42,95]},lle={null:[]},cle=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ole,contentInitial:tle,disable:lle,document:ele,flow:rle,flowInitial:nle,insideSpan:sle,string:ile,text:ale},Symbol.toStringTag,{value:"Module"}));function ule(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:_(E),consume:O,enter:C,exit:A,interrupt:_(E,{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=Ek(a,f.events,f),f.events)}function g(U,B){return fle(v(U),B)}function v(U){return dle(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 O(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 E(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],me=Se!==null&&ne.null,Oe=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(me)?me:me?[me]:[]];return q(Oe)(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 dle(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 fle(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 hle(e){const r={constructs:bse([cle,...(e||{}).extensions||[]]),content:i(Ese),defined:[],document:i(_se),flow:i(Qoe),lazy:{},string:i(Zoe),text:i(Xoe)};return r;function i(a){return l;function l(u){return ule(r,a,u)}}}function ple(e){for(;!E3(e););return e}const rP=/[\0\t\n\r]/g;function mle(){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(rP.lastIndex=m,f=rP.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 gle=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function yle(e){return e.replace(gle,vle)}function vle(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return N3(n.slice(a?2:1),a?16:10)}return Ak(n)||e}const R3={}.hasOwnProperty;function xle(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),ble(n)(ple(hle(n).document().write(mle()(e,t,!0))))}function ble(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(cn),autolinkProtocol:$,autolinkEmail:$,atxHeading:a(at),blockQuote:a(me),characterEscape:$,characterReference:$,codeFenced:a(Oe),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Oe,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(Xe),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:O,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:E,strong:d(),thematicBreak:d()}};D3(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ue){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<ue.length;)if(ue[pt][1].type==="listOrdered"||ue[pt][1].type==="listUnordered")if(ue[pt][0]==="enter")Ge.push(pt);else{const mn=Ge.pop();pt=i(ue,mn,pt)}for(pt=-1;++pt<ue.length;){const mn=t[ue[pt][0]];R3.call(mn,ue[pt][1].type)&&mn[ue[pt][1].type].call(Object.assign({sliceSerialize:ue[pt][2].sliceSerialize},Me),ue[pt][1])}if(Me.tokenStack.length>0){const mn=Me.tokenStack[Me.tokenStack.length-1];(mn[1]||iP).call(Me,void 0,mn[0])}for(Ne.position={start:So(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:So(ue.length>0?ue[ue.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(ue,Ne,Me){let Ge=Ne-1,pt=-1,mn=!1,En,gn,We,Kt;for(;++Ge<=Me;){const fe=ue[Ge];switch(fe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{fe[0]==="enter"?pt++:pt--,Kt=void 0;break}case"lineEndingBlank":{fe[0]==="enter"&&(En&&!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&&fe[0]==="enter"&&fe[1].type==="listItemPrefix"||pt===-1&&fe[0]==="exit"&&(fe[1].type==="listUnordered"||fe[1].type==="listOrdered")){if(En){let ze=Ge;for(gn=void 0;ze--;){const he=ue[ze];if(he[1].type==="lineEnding"||he[1].type==="lineEndingBlank"){if(he[0]==="exit")continue;gn&&(ue[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)&&(En._spread=!0),En.end=Object.assign({},gn?ue[gn][1].start:fe[1].end),ue.splice(gn||Ge,0,["exit",En,fe[2]]),Ge++,Me++}if(fe[1].type==="listItemPrefix"){const ze={type:"listItem",_spread:!1,start:Object.assign({},fe[1].start),end:void 0};En=ze,ue.splice(Ge,0,["enter",ze,fe[2]]),Ge++,Me++,We=void 0,Kt=!0}}}return ue[Ne][1]._spread=mn,Me}function a(ue,Ne){return Me;function Me(Ge){u.call(this,ue(Ge),Ge),Ne&&Ne.call(this,Ge)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(ue,Ne,Me){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([Ne,Me||void 0]),ue.position={start:So(Ne.start),end:void 0}}function d(ue){return Ne;function Ne(Me){ue&&ue.call(this,Me),f.call(this,Me)}}function f(ue,Ne){const Me=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==ue.type&&(Ne?Ne.call(this,ue,Ge[0]):(Ge[1]||iP).call(this,ue,Ge[0]));else throw new Error("Cannot close `"+ue.type+"` ("+oh({start:ue.start,end:ue.end})+"): it’s not open");Me.position.end=So(ue.end)}function p(){return vse(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function g(ue){if(this.data.expectingFirstListItemValue){const Ne=this.stack[this.stack.length-2];Ne.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.lang=ue}function j(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.meta=ue}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ue.replace(/(\r?\n|\r)$/g,"")}function O(ue){const Ne=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ne,Me.identifier=Uu(this.sliceSerialize(ue)).toLowerCase()}function C(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=ue}function A(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=ue}function T(ue){const Ne=this.stack[this.stack.length-1];if(!Ne.depth){const Me=this.sliceSerialize(ue).length;Ne.depth=Me}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function _(ue){const Ne=this.stack[this.stack.length-1];Ne.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function $(ue){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(ue.start),end:void 0},Me.push(Ge)),this.stack.push(Ge)}function F(ue){const Ne=this.stack.pop();Ne.value+=this.sliceSerialize(ue),Ne.position.end=So(ue.end)}function U(ue){const Ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=Ne.children[Ne.children.length-1];Me.position.end=So(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ne.type)&&($.call(this,ue),F.call(this,ue))}function B(){this.data.atHardBreak=!0}function V(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ue}function X(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ue}function Z(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ue}function H(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Ne,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function J(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Ne,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function oe(ue){const Ne=this.sliceSerialize(ue),Me=this.stack[this.stack.length-2];Me.label=yle(Ne),Me.identifier=Uu(Ne).toLowerCase()}function ye(){const ue=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=ue.children;Me.children=Ge}else Me.alt=Ne}function I(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=ue}function M(){const ue=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=ue}function q(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function G(ue){const Ne=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ne,Me.identifier=Uu(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function se(ue){this.data.characterReferenceType=ue.type}function ne(ue){const Ne=this.sliceSerialize(ue),Me=this.data.characterReferenceType;let Ge;Me?(Ge=N3(Ne,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=Ak(Ne);const pt=this.stack[this.stack.length-1];pt.value+=Ge}function Ce(ue){const Ne=this.stack.pop();Ne.position.end=So(ue.end)}function Se(ue){F.call(this,ue);const Ne=this.stack[this.stack.length-1];Ne.url=this.sliceSerialize(ue)}function ee(ue){F.call(this,ue);const Ne=this.stack[this.stack.length-1];Ne.url="mailto:"+this.sliceSerialize(ue)}function me(){return{type:"blockquote",children:[]}}function Oe(){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(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function je(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function Xe(){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 D3(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?D3(e,r):wle(e,r)}}function wle(e,t){let n;for(n in t)if(R3.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 iP(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 jle(e){const t=this;t.parser=n;function n(r){return xle(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Sle(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 Nle(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
101
- `}]}function kle(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 Cle(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ale(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ele(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 Ole(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 _le(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function M3(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 zle(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return M3(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 Tle(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 Ple(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 Rle(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return M3(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 Dle(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 Mle(e,t,n){const r=e.all(t),i=n?Ile(n):I3(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 Ile(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=I3(n[r])}return t}function I3(e){const t=e.spread;return t??e.children.length>1}function Lle(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 $le(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ble(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Ule(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qle(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=Sk(t.children[1]),d=y3(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 Fle(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 Hle(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const aP=9,sP=32;function Kle(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(oP(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(oP(t.slice(i),i>0,!1)),a.join("")}function oP(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===aP||a===sP;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===aP||a===sP;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Gle(e,t){const n={type:"text",value:Kle(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Vle(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Qle={blockquote:Sle,break:Nle,code:kle,delete:Cle,emphasis:Ale,footnoteReference:Ele,heading:Ole,html:_le,imageReference:zle,image:Tle,inlineCode:Ple,linkReference:Rle,link:Dle,listItem:Mle,list:Lle,paragraph:$le,root:Ble,strong:Ule,table:qle,tableCell:Hle,tableRow:Fle,text:Gle,thematicBreak:Vle,toml:Jm,yaml:Jm,definition:Jm,footnoteDefinition:Jm};function Jm(){}const L3=-1,Fv=0,ch=1,my=2,_k=3,zk=4,Tk=5,Pk=6,$3=7,B3=8,lP=typeof self=="object"?self:globalThis,Wle=(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 L3: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 _k:return n(new Date(l),i);case zk:{const{source:u,flags:d}=l;return n(new RegExp(u,d),i)}case Tk:{const u=n(new Map,i);for(const[d,f]of l)u.set(r(d),r(f));return u}case Pk:{const u=n(new Set,i);for(const d of l)u.add(r(d));return u}case $3:{const{name:u,message:d}=l;return n(new lP[u](d),i)}case B3: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 lP[a](l),i)};return r},cP=e=>Wle(new Map,e)(0),pu="",{toString:Yle}={},{keys:Zle}=Object,$f=e=>{const t=typeof e;if(t!=="object"||!e)return[Fv,t];const n=Yle.call(e).slice(8,-1);switch(n){case"Array":return[ch,pu];case"Object":return[my,pu];case"Date":return[_k,pu];case"RegExp":return[zk,pu];case"Map":return[Tk,pu];case"Set":return[Pk,pu];case"DataView":return[ch,n]}return n.includes("Array")?[ch,n]:n.includes("Error")?[$3,n]:[my,n]},eg=([e,t])=>e===Fv&&(t==="function"||t==="symbol"),Xle=(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=B3,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([L3],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 Zle(l))(e||!eg($f(l[g])))&&p.push([a(g),a(l[g])]);return m}case _k:return i([u,l.toISOString()],l);case zk:{const{source:p,flags:m}=l;return i([u,{source:p,flags:m}],l)}case Tk:{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 Pk:{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},uP=(e,{json:t,lossy:n}={})=>{const r=[];return Xle(!(t||n),!!t,new Map,r)(e),r},gy=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?cP(uP(e,t)):structuredClone(e):(e,t)=>cP(uP(e,t));function Jle(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 ece(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function tce(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Jle,r=e.options.footnoteBackLabel||ece,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 O=typeof n=="string"?n:n(d,v);typeof O=="string"&&(O={type:"text",value:O}),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(O)?O:[O]})}const S=p[p.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const O=S.children[S.children.length-1];O&&O.type==="text"?O.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 U3=(function(e){if(e==null)return ace;if(typeof e=="function")return Hv(e);if(typeof e=="object")return Array.isArray(e)?nce(e):rce(e);if(typeof e=="string")return ice(e);throw new Error("Expected function, string, or object as test")});function nce(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=U3(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 rce(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 ice(e){return Hv(t);function t(n){return n&&n.type===e}}function Hv(e){return t;function t(n,r,i){return!!(sce(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function ace(){return!0}function sce(e){return e!==null&&typeof e=="object"&&"type"in e}const q3=[],oce=!0,dP=!1,lce="skip";function cce(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=U3(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=q3,j,b,S;if((!t||a(d,f,p[p.length-1]||void 0))&&(v=uce(n(d,p)),v[0]===dP))return v;if("children"in d&&d.children){const k=d;if(k.children&&v[0]!==lce)for(b=(r?k.children.length:-1)+l,S=p.concat(k);b>-1&&b<k.children.length;){const O=k.children[b];if(j=u(O,b,S)(),j[0]===dP)return j;b=typeof j[1]=="number"?j[1]:b+l}}return v}}}function uce(e){return Array.isArray(e)?e:typeof e=="number"?[oce,e]:e==null?q3:[e]}function F3(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),cce(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,dce={};function fce(e,t){const n=t||dce,r=new Map,i=new Map,a=new Map,l={...Qle,...n.handlers},u={all:f,applyData:pce,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:hce,wrap:gce};return F3(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||mce)(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=fP(j.value)),!Array.isArray(j)&&j.type==="element")){const b=j.children[0];b&&b.type==="text"&&(b.value=fP(b.value))}Array.isArray(j)?m.push(...j):m.push(j)}}}return m}}function hce(e,t){e.position&&(t.position=Yae(e))}function pce(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 mce(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 gce(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 fP(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function hP(e,t){const n=fce(e,t),r=n.one(e,void 0),i=tce(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 yce(e,t){return e&&"run"in e?async function(n,r){const i=hP(n,{file:r,...t});await e.run(i,r)}:function(n,r){return hP(n,{file:r,...e||t})}}function pP(e){if(e)throw e}var Bw,mP;function vce(){if(mP)return Bw;mP=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,O=!1;for(typeof b=="boolean"&&(O=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&&(O&&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(O,j,g)})):typeof g<"u"&&l(b,{name:p,newValue:g}));return b},Bw}var xce=vce();const Uw=ma(xce);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 bce(){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?wce(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 wce(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:jce,dirname:Sce,extname:Nce,join:kce,sep:"/"};function jce(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 Sce(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 Nce(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 kce(...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?".":Cce(n)}function Cce(e){Qh(e);const t=e.codePointAt(0)===47;let n=Ace(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Ace(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 Ece={cwd:Oce};function Oce(){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 _ce(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 zce(e)}function zce(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 H3{constructor(t){let n;t?m1(t)?n={path:t}:typeof t=="string"||Tce(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Ece.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){gP(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"),gP(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=_ce(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 gP(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Tce(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Pce=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),Rce={}.hasOwnProperty;class Rk extends Pce{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=bce()}copy(){const t=new Rk;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):Rce.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);Ice(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),vP("processSync","process",n),r;function i(a,l){n=!0,pP(a),r=l}}run(t,n,r){yP(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),vP("runSync","run",r),i;function a(l,u){pP(l),i=u,r=!0}}stringify(t,n){this.freeze();const r=tg(n),i=this.compiler||this.Compiler;return Gw("stringify",i),yP(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 Dce=new Rk().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 yP(e){if(!p1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function vP(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function tg(e){return Mce(e)?e:new H3(e)}function Mce(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ice(e){return typeof e=="string"||Lce(e)}function Lce(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $ce="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",xP=[],bP={allowDangerousHtml:!0},Bce=/^(https?|ircs?|mailto|xmpp)$/i,Uce=[{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 qce(e){const t=Fce(e),n=Hce(e);return Kce(t.runSync(t.parse(n),n),e)}function Fce(e){const t=e.rehypePlugins||xP,n=e.remarkPlugins||xP,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...bP}:bP;return Dce().use(jle).use(n).use(yce,r).use(t)}function Hce(e){const t=e.children||"",n=new H3;return typeof t=="string"&&(n.value=t),n}function Kce(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||Gce;for(const p of Uce)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+$ce+p.id,void 0);return F3(e,f),tse(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 Gce(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||Bce.test(e.slice(0,t))?e:""}function Vce(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Kv=Vce();async function wP(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 Qce(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 Wce(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 Yce({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 O=k.slice(5).trim();if(O)try{l(JSON.parse(O))}catch{}}b=m.indexOf(`
114
-
115
- `)}}}finally{a?.removeEventListener("abort",g);try{f.releaseLock()}catch{}}}function K3(e){return!e||e.role!=="assistant"?"":e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}const Zce=[{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?"}],Xce=[{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}`,jP=e=>`canonry:aero:scope:${e}`;function Jce({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,O]=x.useState(()=>typeof window>"u"?null:window.localStorage.getItem(ng(e))??null),[C,A]=x.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(jP(e))==="all"?"all":"read-only"),T=x.useRef(null),E=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 Xce.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:()=>Qce(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)||(O(null),window.localStorage.removeItem(ng(e)))},[U.data,k,e]);const V=x.useCallback(q=>{O(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(jP(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||wP(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=E.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 Yce({project:e,prompt:D,provider:k??void 0,scope:C,signal:se.signal,onEvent:H});const ne=await wP(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(K3(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 Wce(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(P2,{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(eue,{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(V5,{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(mW,{className:"h-3.5 w-3.5","aria-hidden":"true"}):s.jsx(dW,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),s.jsx("button",{type:"button",onClick:()=>{i(!1),n(!1)},className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Close Aero",children:s.jsx(Kh,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),s.jsxs("div",{ref:E,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:Zce.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))})]}),aue(a,e,k,C),m.length>0&&s.jsx("div",{className:"mt-3 space-y-1.5",children:m.map(q=>s.jsx(G3,{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(V3,{content:v})]}),f&&!v&&m.every(q=>q.endedAt!==void 0)&&s.jsx(cue,{})]}),s.jsx(tue,{projectName:e,activeProvider:B,scope:C,onToggleScope:X,disabled:f}),s.jsxs("div",{className:"relative",children:[F.length>0&&s.jsx(nue,{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(LQ,{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(P2,{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 eue({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(FQ,{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(q5,{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:rue(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 tue({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 nue({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 rue(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 iue(e,t){const n=e.timestamp??0;return`${e.role}:${n}:${t}`}function aue(e,t,n,r){const i=[];for(let a=0;a<e.length;a++){const l=e[a],u=iue(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(sue,{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=lue(l,d,l.timestamp??0),m=K3(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(G3,{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(V3,{content:m})]})]},u)),a=f-1;continue}}return i}function sue({text:e,projectName:t,providerOverride:n,scope:r}){const[i,a]=x.useState(!1),l=x.useMemo(()=>oue(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(q5,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):s.jsxs(s.Fragment,{children:[s.jsx(YQ,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),s.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function oue(e,t,n,r){const i=["canonry","agent","ask",SP(e),SP(t)];return n&&i.push("--provider",n),r==="read-only"&&i.push("--scope","read-only"),i.join(" ")}function SP(e){return`'${e.replace(/'/g,"'\\''")}'`}function lue(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 G3({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(G5,{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(RW,{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:NP(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:NP(e.result)})]})]})]})}function NP(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 V3({content:e}){return s.jsx("div",{className:"aero-markdown text-zinc-100",children:s.jsx(qce,{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 cue(){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 uue(){const e=k5(),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(Jce,{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 Nt["answer-visibility"]:case Nt["site-audit"]:case Nt["backlink-extract"]:return;case Nt["gsc-sync"]:case Nt["inspect-sitemap"]:e.invalidateQueries({queryKey:qe.gsc.project(n)});return;case Nt["ga-sync"]:case Nt["traffic-sync"]:e.invalidateQueries({queryKey:qe.traffic.project(n)});return;case Nt["bing-inspect"]:case Nt["bing-inspect-sitemap"]:e.invalidateQueries({queryKey:qe.bing.project(n)});return;default:return t}}const kP=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:rW},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:BQ},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:tW}],CP=e=>({label:e,state:"checking",detail:"Checking service health"}),due={apiStatus:CP("API"),workerStatus:CP("Worker")};function fue(e){switch(e){case Nt["answer-visibility"]:return"Visibility sweep";case Nt["gsc-sync"]:return"GSC sync";case Nt["inspect-sitemap"]:return"Sitemap inspection";case Nt["ga-sync"]:return"GA sync";case Nt["traffic-sync"]:return"Traffic sync";case Nt["bing-inspect"]:return"Bing URL inspection";case Nt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Nt["site-audit"]:return"Site audit";case Nt["backlink-extract"]:return"Backlink extract"}}function hue(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function pue(e){const t=fue(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function mue(e,t){return e.error?`${t}: ${ak(e.error)}`:e.location?`${t} · ${e.location}`:t}function gue(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function yue(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 vue(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function xue(){const e=xi(),t=x.useSyncExternalStore(ene,rc,rc),n=Object.keys(t.runs).length>0||Object.keys(t.batches).length>0,r=ua({queryKey:qe.runs.all,queryFn:E5,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||!uk(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"){cT(g.id);continue}const b=gue(g.projectId,m.projectLabel,d);vt({title:pue(g),detail:mue(g,b),tone:hue(g.status),dedupeKey:`run:${g.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:g.id}}),cT(g.id)}for(const m of Object.values(t.batches)){const g=rne(m.runIds,f);g.finished&&(vt({title:"Run-all batch finished",detail:yue(g,m.skippedCount),tone:vue(g),dedupeKey:`batch:${m.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),nne(m.batchId))}a.current=p},[i.data,r.data,t,e]),null}function bue(){const e=Gh(),{dashboard:t,isLoading:n,refetch:r}=jc(),l=Uv(!e,e?.health).data??e?.health??due,u=k5(),{runId:d,evidenceId:f,closeDrawer:p}=vd(),[m,g]=x.useState(!1),v=Sae(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?Jie(S,d):void 0,O=f&&S?eae(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 E=A.split("/").filter(Boolean)[1];if(E&&S){const _=S.projects.find(P=>P.project.id===E);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(xT,{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(oW,{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(aW,{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(K5,{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(kW,{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(jW,{className:"sidebar-icon"}),s.jsx("span",{children:"Setup"})]})]})]}),s.jsx("div",{className:"sidebar-footer",children:kP.map(({label:A,href:T,Icon:E})=>s.jsx("a",{className:"sidebar-footer-icon",href:T,target:"_blank",rel:"noopener noreferrer",title:A,"aria-label":A,children:s.jsx(E,{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(xT,{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(hW,{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:kP.map(({label:A,href:T,Icon:E})=>s.jsx("a",{href:T,target:"_blank",rel:"noopener noreferrer",title:A,"aria-label":A,className:"footer-icon",children:s.jsx(E,{className:"size-3.5"})},T))})]})]}),k?s.jsxs(qie,{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(ic,{provider:A.provider}),s.jsx(b$,{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,E)=>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})},E))})]}),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:Ute(j.error)})]}):s.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,O?s.jsx(Gie,{evidence:O.evidence,project:O.project,onClose:p}):null,s.jsx(xue,{}),s.jsx(Cae,{}),s.jsx(uue,{})]})}class wue 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(V5,{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 jue({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 Sue({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(jue,{points:e.trend,tone:J4(e.lastRun.status)})}),s.jsx("span",{className:"project-row-link",children:s.jsx(Hh,{className:"h-4 w-4 text-zinc-500"})})]})}function Nue(){const e=Gh(),{dashboard:t,isLoading:n}=jc(),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=Vte(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(Sue,{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(Je,{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 Dk=Symbol.for("yaml.alias"),x1=Symbol.for("yaml.document"),Bo=Symbol.for("yaml.map"),Q3=Symbol.for("yaml.pair"),qa=Symbol.for("yaml.scalar"),wd=Symbol.for("yaml.seq"),Gi=Symbol.for("yaml.node.type"),Nc=e=>!!e&&typeof e=="object"&&e[Gi]===Dk,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]===Q3,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 Dk:case Bo:case qa:case wd:return!0}return!1}const W3=e=>(Jt(e)||Pn(e))&&!!e.anchor,zl=Symbol("break visit"),kue=Symbol("skip children"),uh=Symbol("remove node");function jd(e,t){const n=Cue(t);Vv(e)?_u(null,e.contents,n,Object.freeze([e]))===uh&&(e.contents=null):_u(null,e,n,Object.freeze([]))}jd.BREAK=zl;jd.SKIP=kue;jd.REMOVE=uh;function _u(e,t,n,r){const i=Aue(e,t,n,r);if(Rn(i)||Dn(i))return Eue(e,r,i),_u(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=_u(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=_u("key",t.key,n,r);if(a===zl)return zl;a===uh&&(t.key=null);const l=_u("value",t.value,n,r);if(l===zl)return zl;l===uh&&(t.value=null)}}return i}function Cue(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 Aue(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(Nc(t))return n.Alias?.(e,t,r)}function Eue(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=Nc(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Oue={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_ue=e=>e.replace(/[!,[\]{}]/g,t=>Oue[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+_ue(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 Y3(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 Z3(e){const t=new Set;return jd(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function X3(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function zue(e,t){const n=[],r=new Map;let i=null;return{onAnchor:a=>{n.push(a),i??(i=Z3(e));const l=X3(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 zu(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=zu(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=zu(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=zu(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=zu(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||!W3(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 Mk{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"?zu(a,{"":u},"",u):u}}class Ik extends Mk{constructor(t){super(Dk),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)=>{(Nc(l)||W3(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(Y3(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(Nc(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 J3=e=>!e||typeof e!="function"&&typeof e!="object";class it extends Mk{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 Tue="tag:yaml.org,2002:";function Pue(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 Ik(d.anchor);d={anchor:null,node:null},u.set(e,d)}t?.startsWith("!!")&&(t=Tue+t.slice(2));let f=Pue(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 eB extends Mk{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 Rue=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ns(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const $l=(e,t,n)=>e.endsWith(`
118
- `)?Ns(n,t):n.includes(`
119
- `)?`
120
- `+Ns(n,t):(e.endsWith(" ")?"":" ")+n,tB="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=AP(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=AP(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 O=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?O=`
124
- ${t}${e.slice(0,T)}`:(n===Bg&&p[A]&&(O+=`${e[A]}\\`),O+=`
125
- ${t}${e.slice(A+1,T)}`)}return O}function AP(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 Due(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,tB,Wv(t,!1))}function Tu(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 Tu(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:!Due(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 O=n.substring(0,k<S?k+1:S);O&&(n=n.substring(O.length),O=O.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 E=!1;const _=Wv(r,!0);l!=="folded"&&t!==it.BLOCK_FOLDED&&(_.onOverflow=()=>{E=!0});const P=Qv(`${O}${T}${v}`,f,b1,_);if(!E)return`>${A}
143
- ${f}${P}`}return n=n.replace(/\n+/g,`$&${f}`),`|${A}
144
- ${f}${O}${n}${v}`}function Mue(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 Tu(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return u||p||!a.includes(`
146
- `)?Tu(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 Tu(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 Tu(a,t)}return u?m:Qv(m,d,tB,Wv(t,!1))}function Lk(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?Tu(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 Mue(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 nB(e,t){const n=Object.assign({blockQuote:!0,commentString:Rue,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 Iue(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 Lue(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],a=(Jt(e)||Pn(e))&&e.anchor;a&&Y3(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(Nc(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=Iue(t.doc.schema.tags,a));const l=Lue(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)?Lk(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 $ue({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,O,C;Rn(t)?(k=!!t.spaceBefore,O=t.commentBefore,C=t.comment):(k=!1,O=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 E=" ";if(g||k||O){if(E=k?`
151
- `:"",O){const _=f(O);E+=`
152
- ${Ns(_,n.indent)}`}T===""&&!n.inFlow?E===`
153
- `&&C&&(E=`
154
-
155
- `):E+=`
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||(E=`
158
- ${n.indent}`)}}else(T===""||T[0]===`
159
- `)&&(E="");return S+=E+T,n.inFlow?A&&r&&r():C&&!A?S+=$l(S,n.indent,f(C)):b&&i&&i(),S}function Bue(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const rg="<<",As={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:rB}),stringify:()=>rg},Uue=(e,t)=>(As.identify(t)||Jt(t)&&(!t.type||t.type===it.PLAIN)&&As.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===As.tag&&n.default);function rB(e,t,n){if(n=e&&Nc(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&&Nc(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 iB(e,t,{key:n,value:r}){if(Rn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Uue(e,n))rB(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=que(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 que(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Rn(e)&&n?.doc){const r=nB(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)+'..."'),Bue(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 $k(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:Q3}),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 iB(n,r,this)}toString(t,n,r){return t?.doc?$ue(this,t,n,r):JSON.stringify(this)}}function aB(e,t,n){return(t.inFlow??e.flow?Hue:Fue)(e,t,n)}function Fue({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 O=Rn(b.key)?b.key:null;O&&(!m&&O.spaceBefore&&g.push(""),vy(n,g,O.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
- `+Ns(f(e),d),u&&u()):m&&l&&l(),v}function Hue({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 O=Rn(b.key)?b.key:null;O&&(O.spaceBefore&&m.push(""),vy(t,m,O.commentBefore,!1),O.comment&&(f=!0));const C=Rn(b.value)?b.value:null;C?(C.comment&&(S=C.comment),C.commentBefore&&(f=!0)):b.value==null&&O?.comment&&(S=O.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=Ns(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 eB{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($k(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)&&J3(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)iB(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})),aB(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 sc extends eB{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)&&J3(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?aB(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:sc,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Yh(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>sc.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),Lk(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},Bk={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&&Bk.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 sB={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ya},oB={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)}},lB={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),Uk=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function cB(e,t,n){const{value:r}=e;return Jv(r)&&r>=0?n+r.toString(t):ya(e)}const uB={identify:e=>Jv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Uk(e,2,8,n),stringify:e=>cB(e,8,"0o")},dB={identify:Jv,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Uk(e,0,10,n),stringify:ya},fB={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)=>Uk(e,2,16,n),stringify:e=>cB(e,16,"0x")},Kue=[Sd,Nd,Zv,Xv,Bk,uB,dB,fB,sB,oB,lB];function EP(e){return typeof e=="bigint"||Number.isInteger(e)}const ag=({value:e})=>JSON.stringify(e),Gue=[{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:EP,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})=>EP(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}],Vue={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Que=[Sd,Nd].concat(Gue,Vue),qk={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 Lk({comment:e,type:t,value:u},r,i,a)}};function hB(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 pB(e,t,n){const{replacer:r}=n,i=new sc(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($k(u,d,n))}return i}const Fk={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:hB,createNode:pB};class qu extends sc{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=qu.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=pB(t,n,r),a=new this;return a.items=i.items,a}}qu.tag="tag:yaml.org,2002:omap";const Hk={collection:"seq",identify:e=>e instanceof Map,nodeClass:qu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=hB(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 qu,n)},createNode:(e,t,n)=>qu.from(e,t,n)};function mB({value:e,source:t},n){return t&&(e?gB:yB).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const gB={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:mB},yB={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:mB},Wue={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},Yue={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)}},Zue={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 Kk(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 Xue={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=>Kk(e,2,"0b")},Jue={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=>Kk(e,8,"0")},ede={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},tde={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=>Kk(e,16,"0x")};class Fu extends Bi{constructor(t){super(t),this.tag=Fu.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($k(l,null,r));return a}}Fu.tag="tag:yaml.org,2002:set";const Gk={collection:"map",identify:e=>e instanceof Set,nodeClass:Fu,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Fu.from(e,t,n),resolve(e,t){if(Wh(e)){if(e.hasAllNullValues(!0))return Object.assign(new Fu,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Vk(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 vB(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 xB={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})=>Vk(e,n),stringify:vB},bB={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=>Vk(e,!1),stringify:vB},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=Vk(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,gB,yB,Xue,Jue,ede,tde,Wue,Yue,Zue,qk,As,Hk,Fk,Gk,xB,bB,tx],_P=new Map([["core",Kue],["failsafe",[Sd,Nd,Zv]],["json",Que],["yaml11",OP],["yaml-1.1",OP]]),zP={binary:qk,bool:Bk,float:lB,floatExp:oB,floatNaN:sB,floatTime:bB,int:dB,intHex:fB,intOct:uB,intTime:xB,map:Sd,merge:As,null:Xv,omap:Hk,pairs:Fk,seq:Nd,set:Gk,timestamp:tx},nde={"tag:yaml.org,2002:binary":qk,"tag:yaml.org,2002:merge":As,"tag:yaml.org,2002:omap":Hk,"tag:yaml.org,2002:pairs":Fk,"tag:yaml.org,2002:set":Gk,"tag:yaml.org,2002:timestamp":tx};function Ww(e,t,n){const r=_P.get(t);if(r&&!e)return n&&!r.includes(As)?r.concat(As):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const a=Array.from(_P.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(As)),i.reduce((a,l)=>{const u=typeof l=="string"?zP[l]:l;if(!u){const d=JSON.stringify(l),f=Object.keys(zP).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 rde=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Qk{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?nde:{},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?rde:null}clone(){const t=Object.create(Qk.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function ide(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=nB(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=a(e.commentBefore);n.unshift(Ns(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(Ns(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(Ns(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(Ns(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){mu(this.contents)&&this.contents.add(t)}addIn(t,n){mu(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=Z3(this);t.anchor=!n||r.has(n)?X3(n||"a",r):n}return new Ik(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=O=>typeof O=="number"||O instanceof String||O 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}=zue(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 mu(this.contents)?this.contents.delete(t):!1}deleteIn(t){return eh(t)?this.contents==null?!1:(this.contents=null,!0):mu(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):mu(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):mu(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new 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 Qk(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"?zu(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 ide(this,t)}}function mu(e){if(Pn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class wB extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class sg extends wB{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class ade extends wB{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const TP=(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,O=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)&&(O=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 E=e[e.length-1],_=E?E.offset+E.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:O,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 jB(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 PP="All mapping items must start at the same column";function sde({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",PP)),!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",PP);n.atKey=!0;const k=b.end,O=g?e(n,g,b,i):t(n,k,m,null,b,i);n.schema.compat&&S1(r.indent,g,i),n.atKey=!1,jB(n,u.items,O)&&i(k,"DUPLICATE_KEY","Map keys must be unique");const C=td(v??[],{indicator:"map-value-ind",next:j,offset:O.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(O.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(O,A);n.options.keepSourceTokens&&(T.srcToken=p),u.items.push(T)}else{S&&i(O.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),C.comment&&(O.comment?O.comment+=`
180
- `+C.comment:O.comment=C.comment);const A=new Mr(O);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 ode({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=a?.nodeClass??sc,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 lde({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=r.start.source==="{",u=l?"flow map":"flow sequence",d=a?.nodeClass??(l?Bi:sc),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:O,key:C,sep:A,value:T}=k,E=td(O,{flow:u,indicator:"explicit-key-ind",next:C??A?.[0],offset:m,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!A&&!T){S===0&&E.comma?i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`):S<r.items.length-1&&i(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${u}`),E.comment&&(f.comment?f.comment+=`
181
- `+E.comment:f.comment=E.comment),m=E.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)E.comma&&i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`);else if(E.comma||i(E.start,"MISSING_CHAR",`Missing , between ${u} items`),E.comment){let _="";e:for(const P of O)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=_,E.comment=E.comment.substring(_.length+1)}}if(!l&&!A&&!E.found){const _=T?e(n,T,E,i):t(n,E.end,A,null,E,i);f.items.push(_),m=_.range[2],Zw(T)&&i(_.range,"BLOCK_IN_FLOW",Yw)}else{n.atKey=!0;const _=E.end,P=C?e(n,C,E,i):t(n,_,O,null,E,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&&!E.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}}E.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;jB(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"?sde(e,t,n,r,a):n.type==="block-seq"?ode(e,t,n,r,a):lde(e,t,n,r,a),u=l.constructor;return i==="!"||i===u.tagName?(l.tag=u.tagName,l):(i&&(l.tag=i),l)}function cde(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===sc.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 ude(e,t,n){const r=t.offset,i=dde(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?fde(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 O=k[k.length-1]==="\r";if(O&&(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-(O?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 dde({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 fde(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 hde(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=pde(a,f);break;case"single-quoted-scalar":u=it.QUOTE_SINGLE,d=mde(a,f);break;case"double-quoted-scalar":u=it.QUOTE_DOUBLE,d=gde(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 pde(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}`),SB(e)}function mde(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),SB(e.slice(1,-1)).replace(/''/g,"'")}function SB(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 gde(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}=yde(e,r);n+=a,r=l}else if(i==="\\"){let a=e[++r];const l=vde[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+=xde(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 yde(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 vde={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
214
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function xde(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 NB(e,t,n,r){const{value:i,type:a,comment:l,range:u}=t.type==="block-scalar"?ude(e,t,r):hde(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=bde(e.schema,i,d,n,r):t.type==="scalar"?f=wde(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 bde(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 wde({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 jde(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 Sde={composeNode:kB,composeEmptyNode:Wk};function kB(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=Nde(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=NB(e,t,d,r),u&&(f.anchor=u.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=cde(Sde,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=Wk(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 Wk(e,t,n,r,{spaceBefore:i,comment:a,anchor:l,tag:u,end:d},f){const p={type:"scalar",offset:jde(t,n,r),indent:-1,source:""},m=NB(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 Nde({options:e},{offset:t,source:n,end:r},i){const a=new Ik(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 kde(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?kB(f,i,p,l):Wk(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 RP(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 Cde{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 ade(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}=RP(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:RP(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=kde(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 CB="\uFEFF",AB="",EB="",N1="";function Ade(e){switch(e){case CB:return"byte-order-mark";case AB:return"doc-mode";case EB: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 DP=new Set("0123456789ABCDEFabcdef"),Ede=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),og=new Set(",[]{}"),Ode=new Set(` ,[]{}
225
- \r `),Jw=e=>!e||Ode.has(e);class _de{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]===CB&&(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 AB,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 EB,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(Ede.has(n))n=this.buffer[++t];else if(n==="%"&&DP.has(this.buffer[t+1])&&DP.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 zde{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 MP(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 OB(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 gu(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function IP(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,OB(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 Tde{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 _de,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=Ade(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"&&IP(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&&MP(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":{MP(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=gu(n);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
243
- `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
244
- `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(i&&n.sep&&!n.value){const l=[];for(let 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(OB(n.key)&&!Ao(n.sep,"newline")){const l=gu(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=gu(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):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=gu(i);IP(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=gu(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=lg(t),r=gu(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Pde(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new zde||null,prettyErrors:t}}function Rde(e,t={}){const{lineCounter:n,prettyErrors:r}=Pde(t),i=new Tde(n?.addNewLine),a=new Cde(t),l=Array.from(a.compose(i.parse(e)));if(r&&n)for(const u of l)u.errors.forEach(TP(e,n)),u.warnings.forEach(TP(e,n));return l.length>0?l:Object.assign([],{empty:!0},a.streamInfo())}function Dde({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=Rde(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 TV(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 Mde(){const{dashboard:e,isLoading:t,refetch:n}=jc();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,O]=x.useState(!1),[C,A]=x.useState(null),T=u.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),E=async()=>{if(!(!T||!m)){O(!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{O(!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(z2,{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:E,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(Je,{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(z2,{className:"size-4 mr-1.5"}),"Add project"]})]}),s.jsx(Dde,{onApplied:()=>{n()}})]})}function k1({state:e,label:t}){return s.jsx(Je,{tone:Hte(e),children:t??Pv(e)})}function _B({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 Ide({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 LP({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 Lde(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 $P(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 BP(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 UP(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 $de(e,t){return t==="citations"?e:e.map(n=>({...n,citationState:$P(n,t),runHistory:n.runHistory.map(r=>({...r,citationState:$P(r,t)}))}))}function Bde({evidence:e}){const{openEvidence:t}=vd(),[n,r]=x.useState(new Set),[i,a]=x.useState("citations"),l=x.useMemo(()=>{const m=$de(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=Lde(g),k=g.filter(C=>C.citationState===Ju.cited||C.citationState==="emerging").length,O=UP(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(ic,{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:BP(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(LP,{history:S})}),s.jsx("td",{className:"evidence-change-cell",children:O}),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(ic,{provider:C.provider})}),s.jsx("td",{children:s.jsx(k1,{state:C.citationState,label:BP(C.citationState,i)})}),s.jsx("td",{children:s.jsx(LP,{history:C.runHistory})}),s.jsx("td",{className:"evidence-change-cell",children:UP(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 Ude({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(Je,{tone:Kte(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 qP({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(Je,{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 qde=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function Yk(e){if(typeof e!="string")return!1;var t=qde;return t.includes(e)}var Fde=["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"],Hde=new Set(Fde);function zB(e){return typeof e!="string"?!1:Hde.has(e)}function TB(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)&&(zB(n)||TB(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)&&(zB(n)||TB(n)||Yk(n))&&(t[n]=e[n]);return t}function Kde(e){return e==null?null:x.isValidElement(e)?kr(e.props):typeof e=="object"&&!Array.isArray(e)?kr(e):null}var Gde=["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 Vde(e,t){if(e==null)return{};var n,r,i=Qde(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 Qde(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Zk=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:l,style:u,title:d,desc:f}=e,p=Vde(e,Gde),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)}),Wde=["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 Yde(e,t){if(e==null)return{};var n,r,i=Zde(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 Zde(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=Yde(e,Wde),a=Ot("recharts-layer",r);return x.createElement("g",A1({className:a},kr(i),{ref:t}),n)}),PB=x.createContext(null),Xde=()=>x.useContext(PB);function Zt(e){return function(){return e}}const RB=Math.cos,xy=Math.sin,va=Math.sqrt,by=Math.PI,rx=2*by,E1=Math.PI,O1=2*E1,Tl=1e-6,Jde=O1-Tl;function DB(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function efe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return DB;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 tfe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?DB:efe(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),O=Math.sqrt(g),C=a*Math.tan((E1-Math.acos((b+g-S)/(2*k*O)))/2),A=C/O,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%O1+O1),g>Jde?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>=E1)},${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 Xk(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 tfe(t)}function Jk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function MB(e){this._context=e}MB.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 MB(e)}function IB(e){return e[0]}function LB(e){return e[1]}function $B(e,t){var n=Zt(!0),r=null,i=ix,a=null,l=Xk(u);e=typeof e=="function"?e:e===void 0?IB:Zt(e),t=typeof t=="function"?t:t===void 0?LB:Zt(t);function u(d){var f,p=(d=Jk(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=Xk(f);e=typeof e=="function"?e:e===void 0?IB:Zt(+e),t=typeof t=="function"?t:Zt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?LB:Zt(+n);function f(m){var g,v,j,b=(m=Jk(m)).length,S,k=!1,O,C=new Array(b),A=new Array(b);for(a==null&&(u=l(O=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(O)return u=null,O+""||null}function p(){return $B().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 BB{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 nfe(e){return new BB(e,!0)}function rfe(e){return new BB(e,!1)}const eC={draw(e,t){const n=va(t/by);e.moveTo(n,0),e.arc(0,0,n,0,rx)}},ife={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()}},UB=va(1/3),afe=UB*2,sfe={draw(e,t){const n=va(t/afe),r=n*UB;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},ofe={draw(e,t){const n=va(t),r=-n/2;e.rect(r,r,n,n)}},lfe=.8908130915292852,qB=xy(by/10)/xy(7*by/10),cfe=xy(rx/10)*qB,ufe=-RB(rx/10)*qB,dfe={draw(e,t){const n=va(t*lfe),r=cfe*n,i=ufe*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const l=rx*a/5,u=RB(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),ffe={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),hfe=(_1/2+1)*3,pfe={draw(e,t){const n=va(t/hfe),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 mfe(e,t){let n=null,r=Xk(i);e=typeof e=="function"?e:Zt(e||eC),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 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(){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 gfe(e){return new FB(e)}function HB(e){this._context=e}HB.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 yfe(e){return new HB(e)}function KB(e){this._context=e}KB.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 vfe(e){return new KB(e)}function GB(e){this._context=e}GB.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 xfe(e){return new GB(e)}function FP(e){return e<0?-1:1}function HP(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(FP(a)+FP(l))*Math.min(Math.abs(a),Math.abs(l),.5*Math.abs(u))||0}function KP(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,KP(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,KP(this,n=HP(this,e,t)),n);break;default:tj(this,this._t0,n=HP(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function VB(e){this._context=new QB(e)}(VB.prototype=Object.create(Sy.prototype)).point=function(e,t){Sy.prototype.point.call(this,t,e)};function QB(e){this._context=e}QB.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 bfe(e){return new Sy(e)}function wfe(e){return new VB(e)}function WB(e){this._context=e}WB.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=GP(e),i=GP(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 GP(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 jfe(e){return new WB(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 Sfe(e){return new ax(e,.5)}function Nfe(e){return new ax(e,0)}function kfe(e){return new ax(e,1)}function oc(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 Cfe(e,t){return e[t]}function Afe(e){const t=[];return t.key=e,t}function Efe(){var e=Zt([]),t=z1,n=oc,r=Cfe;function i(a){var l=Array.from(e.apply(this,arguments),Afe),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=Jk(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??oc,i):n},i}function Ofe(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}oc(e,t)}}function _fe(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}oc(e,t)}}function zfe(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,oc(e,t)}}var nj={},rj={},VP;function Tfe(){return VP||(VP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(rj)),rj}var ij={},QP;function YB(){return QP||(QP=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={},WP;function tC(){return WP||(WP=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={},YP;function Pfe(){return YP||(YP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(n==null)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(t).join(",");const r=String(n);return r==="0"&&Object.is(Number(n),-0)?"-0":r}e.toString=t})(oj)),oj}var ZP;function nC(){return ZP||(ZP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Pfe(),n=tC();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 XP;function rC(){return XP||(XP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Tfe(),n=YB(),r=tC(),i=nC();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,JP;function Rfe(){return JP||(JP=1,lj=rC().get),lj}var Dfe=Rfe();const nd=ma(Dfe);var Mfe=4;function Do(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Mfe,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,lc=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",Ife=0,Ah=e=>{var t=++Ife;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(lc(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},ZB=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 XB(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 Lfe=["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 eR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eR(Object(n),!0).forEach(function(r){$fe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $fe(e,t,n){return(t=Bfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bfe(e){var t=Ufe(e,"string");return typeof t=="symbol"?t:t+""}function Ufe(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 qfe(e,t){if(e==null)return{};var n,r,i=Ffe(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 Ffe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var JB={symbolCircle:eC,symbolCross:ife,symbolDiamond:sfe,symbolSquare:ofe,symbolStar:dfe,symbolTriangle:ffe,symbolWye:pfe},Hfe=Math.PI/180,Kfe=e=>{var t="symbol".concat(ep(e));return JB[t]||eC},Gfe=(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*Hfe;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}},Vfe=(e,t)=>{JB["symbol".concat(ep(e))]=t},iC=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=qfe(e,Lfe),a=tR(tR({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var u=()=>{var g=Kfe(l),v=mfe().type(g).size(Gfe(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};iC.registerSymbol=Vfe;var e6=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,aC=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(x.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{Yk(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},Qfe=(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];Yk(i)&&typeof a=="function"&&(r||(r={}),r[i]=Qfe(a,t,n))}),r};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 Wfe(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){Yfe(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 Yfe(e,t,n){return(t=Zfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zfe(e){var t=Xfe(e,"string");return typeof t=="symbol"?t:t+""}function Xfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tr(e,t){var n=Wfe({},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 rR(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 t6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rR(Object(n),!0).forEach(function(r){Jfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jfe(e,t,n){return(t=ehe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ehe(e){var t=the(e,"string");return typeof t=="symbol"?t:t+""}function the(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,nhe={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function rhe(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function ihe(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:rhe(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=t6({},t);return delete f.legendIcon,x.cloneElement(t.legendIcon,f)}return x.createElement(iC,{fill:u,cx:i,cy:i,size:Mi,sizeType:"diameter",type:d})}function ahe(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"?t6({},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(Zk,{width:n,height:n,viewBox:d,style:p,"aria-label":"".concat(m.value," legend icon")},x.createElement(ihe,{data:m,iconType:l,inactiveColor:a})),x.createElement("span",{className:"recharts-legend-item-text",style:b},S))})}var she=e=>{var t=tr(e,nhe),{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(ahe,Ny({},t,{payload:n})))},cj={},uj={},iR;function ohe(){return iR||(iR=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={},aR;function lhe(){return aR||(aR=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={},sR;function n6(){return sR||(sR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(fj)),fj}var hj={},pj={},mj={},oR;function che(){return oR||(oR=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 lR;function r6(){return lR||(lR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=che();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(pj)),pj}var gj={},cR;function uhe(){return cR||(cR=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 uR;function dhe(){return uR||(uR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=r6(),n=uhe();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(hj)),hj}var yj={},vj={},dR;function fhe(){return dR||(dR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rC();function n(r){return function(i){return t.get(i,r)}}e.property=n})(vj)),vj}var xj={},bj={},wj={},jj={},fR;function i6(){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.isObject=t})(jj)),jj}var Sj={},hR;function a6(){return hR||(hR=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={},pR;function s6(){return pR||(pR=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 mR;function hhe(){return mR||(mR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=i6(),n=a6(),r=s6();function i(p,m,g){return typeof g!="function"?i(p,m,()=>{}):a(p,m,function v(j,b,S,k,O,C){const A=g(j,b,S,k,O,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 O=0;O<p.length;O++){if(j.has(O))continue;const C=p[O];let A=!1;if(g(C,S,b,p,m,v)&&(A=!0),A){j.add(O),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 gR;function o6(){return gR||(gR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hhe();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(bj)),bj}var kj={},Cj={},Aj={},yR;function phe(){return yR||(yR=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 Ej={},vR;function sC(){return vR||(vR=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})(Ej)),Ej}var Oj={},xR;function l6(){return xR||(xR=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]",O="[object Uint16Array]",C="[object Uint32Array]",A="[object BigUint64Array]",T="[object Int8Array]",E="[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=E,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=O,e.uint32ArrayTag=C,e.uint8ArrayTag=S,e.uint8ClampedArrayTag=k})(Oj)),Oj}var _j={},bR;function mhe(){return bR||(bR=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 wR;function c6(){return wR||(wR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=phe(),n=sC(),r=l6(),i=a6(),a=mhe();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,O]of p)S.set(k,u(O,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],O=Object.getOwnPropertyDescriptor(p,k);(O==null||O.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 jR;function ghe(){return jR||(jR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=c6();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(kj)),kj}var SR;function yhe(){return SR||(SR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=o6(),n=ghe();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(xj)),xj}var zj={},Tj={},Pj={},NR;function vhe(){return NR||(NR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=c6(),n=sC(),r=l6();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 kR;function xhe(){return kR||(kR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vhe();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(Tj)),Tj}var Rj={},Dj={},CR;function u6(){return CR||(CR=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={},AR;function bhe(){return AR||(AR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=sC();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(Mj)),Mj}var ER;function whe(){return ER||(ER=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=YB(),n=u6(),r=bhe(),i=nC();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 jhe(){return OR||(OR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=o6(),n=tC(),r=xhe(),i=rC(),a=whe();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 _R;function She(){return _R||(_R=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=n6(),n=fhe(),r=yhe(),i=jhe();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 zR;function Nhe(){return zR||(zR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ohe(),n=lhe(),r=n6(),i=dhe(),a=She();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,TR;function khe(){return TR||(TR=1,Ij=Nhe().uniqBy),Ij}var Che=khe();const PR=ma(Che);function d6(e,t,n){return t===!0?PR(e,n):typeof t=="function"?PR(e,t):e}var oC=x.createContext(null),Ahe=e=>e,ln=()=>{var e=x.useContext(oC);return e?e.store.dispatch:Ahe},qg=()=>{},Ehe=()=>qg,Ohe=(e,t)=>e===t;function Ue(e){var t=x.useContext(oC),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:qg,[t,e]);return j5.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Ehe,t?t.store.getState:qg,t?t.store.getState:qg,n,Ohe)}function _he(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function zhe(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function The(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 RR=e=>Array.isArray(e)?e:[e];function Phe(e){const t=Array.isArray(e[0])?e[0]:e;return The(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Rhe(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Dhe=class{constructor(e){this.value=e}deref(){return this.value}},Mhe=typeof WeakRef<"u"?WeakRef:Dhe,Ihe=0,DR=1;function dg(){return{s:Ihe,v:void 0,o:null,p:null}}function f6(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===DR)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 Mhe(p):p}return f.s=DR,f.v=p,p}return l.clearCache=()=>{n=dg(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function Lhe(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()),_he(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p={...n,...d},{memoize:m,memoizeOptions:g=[],argsMemoize:v=f6,argsMemoizeOptions:j=[]}=p,b=RR(g),S=RR(j),k=Phe(i),O=m(function(){return a++,f.apply(null,arguments)},...b),C=v(function(){l++;const T=Rhe(k,arguments);return u=O.apply(null,T),u},...S);return Object.assign(C,{resultFunc:f,memoizedResultFunc:O,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=Lhe(f6),$he=Object.assign((e,t=re)=>{zhe(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:()=>$he}),Lj={},$j={},Bj={},MR;function Bhe(){return MR||(MR=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={},IR;function h6(){return IR||(IR=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 LR;function Uhe(){return LR||(LR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=h6(),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 $R;function qhe(){return $R||($R=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bhe(),n=Uhe(),r=nC();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={},BR;function Fhe(){return BR||(BR=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={},UR;function p6(){return UR||(UR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=u6(),n=r6(),r=i6(),i=s6();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 qR;function Hhe(){return qR||(qR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qhe(),n=Fhe(),r=p6();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,FR;function Khe(){return FR||(FR=1,Kj=Hhe().sortBy),Kj}var Ghe=Khe();const ox=ma(Ghe);var m6=e=>e.legend.settings,Vhe=e=>e.legend.size,Qhe=e=>e.legend.payload,Whe=re([Qhe,m6],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?ox(r,n):r});function Yhe(){return Ue(Whe)}var fg=1;function g6(){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 Zhe=typeof Symbol=="function"&&Symbol.observable||"@@observable",HR=Zhe,Gj=()=>Math.random().toString(36).substring(7).split("").join("."),Xhe={INIT:`@@redux/INIT${Gj()}`,REPLACE:`@@redux/REPLACE${Gj()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Gj()}`},ky=Xhe;function lC(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 y6(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(y6)(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 O=u++;return l.set(O,S),function(){if(k){if(d)throw new Error(dr(6));k=!1,f(),l.delete(O),a=null}}}function g(S){if(!lC(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(O=>{O()}),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 O(){const A=k;A.next&&A.next(p())}return O(),{unsubscribe:S(O)}},[HR](){return this}}}return g({type:ky.INIT}),{dispatch:g,subscribe:m,getState:p,replaceReducer:v,[HR]:j}}function Jhe(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 v6(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{Jhe(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 epe(...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 x6(e){return lC(e)&&"type"in e&&typeof e.type=="string"}var b6=Symbol.for("immer-nothing"),KR=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",Ey="enumerable",Fg="writable",Eh="value",Ts=e=>!!e&&!!e[Ir];function pa(e){return e?w6(e)||ux(e)||!!e[KR]||!!e[Ay]?.[KR]||dx(e)||fx(e):!1}var tpe=pi[lx][Ay].toString(),GR=new WeakMap;function w6(e){if(!e||!cC(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(!Au(n))return!1;let r=GR.get(n);return r===void 0&&(r=Function.toString.call(n),GR.set(n,r)),r===tpe}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 VR=(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],Oy=(e,t,n,r=tp(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function npe(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,cC=e=>typeof e=="object",Au=e=>typeof e=="function",Vj=e=>typeof e=="boolean";function rpe(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ws=e=>e.copy_||e.base_,uC=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=w6(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,[Ey]:u[Ey],[Eh]: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 dC(e,t=!1){return hx(e)||Ts(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)=>{dC(r,!0)},!1)),e}function ipe(){oa(2)}var hg={[Eh]:ipe};function hx(e){return e===null||!cC(e)?!0:pi.isFrozen(e)}var _y="MapSet",M1="Patches",QR="ArrayMethods",j6={};function cc(e){const t=j6[e];return t||oa(0,e),t}var WR=e=>!!j6[e],Oh,S6=()=>Oh,ape=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:WR(_y)?cc(_y):void 0,arrayMethodsPlugin_:WR(QR)?cc(QR):void 0});function YR(e,t){t&&(e.patchPlugin_=cc(M1),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function I1(e){L1(e),e.drafts_.forEach(spe),e.drafts_=null}function L1(e){e===Oh&&(Oh=e.parent_)}var ZR=e=>Oh=ape(Oh,e);function spe(e){const t=e[Ir];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function XR(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=JR(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Ir].base_,e,t)}else e=JR(t,n);return ope(t,e,!0),I1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==b6?e:void 0}function JR(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);C6(n,e)}return n.copy_}function ope(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&dC(t,n)}function N6(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var px=(e,t)=>e.scope_===t,lpe=[];function k6(e,t,n,r){const i=ws(e),a=e.type_;if(r!==void 0&&R1(i,r,a)===t){Oy(i,r,n,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;cx(i,(d,f)=>{if(Ts(f)){const p=u.get(f)||[];p.push(d),u.set(f,p)}})}const l=e.draftLocations_.get(t)??lpe;for(const u of l)Oy(i,u,n,a)}function cpe(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!px(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const l=uC(a);k6(e,a.draft_??a,l,n),C6(a,i)})}function C6(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)}N6(e)}}function upe(e,t,n){const{scope_:r}=e;if(Ts(n)){const i=n[Ir];px(i,r)&&i.callbacks_.push(function(){Hg(e);const l=uC(i);k6(e,n,l,t)})}else pa(n)&&e.callbacks_.push(function(){const a=ws(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||Ts(e)||t.has(e)||!pa(e)||hx(e)||(t.add(e),cx(e,(r,i)=>{if(Ts(i)){const a=i[Ir];if(px(a,n)){const l=uC(a);Oy(e,r,l,e.type_),N6(a)}}else pa(i)&&zy(i,t,n)})),e}function dpe(e,t){const n=ux(e),r={type_:n?1:0,scope_:t?t.scope_:S6(),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=ws(e);if(!VR(i,t,e.type_))return fpe(e,i,t);const a=i[t];if(e.finalized_||!pa(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&rpe(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 ws(e)},ownKeys(e){return Reflect.ownKeys(ws(e))},set(e,t,n){const r=A6(ws(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Qj(ws(e),t),a=i?.[Ir];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(npe(n,i)&&(n!==void 0||VR(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),upe(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=ws(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Fg]:!0,[P1]:e.type_!==1||t!=="length",[Ey]:r[Ey],[Eh]: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?ws(n):e)[t]}function fpe(e,t,n){const r=A6(t,n);return r?Eh in r?r[Eh]:r.get?.call(e.draft_):void 0}function A6(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 hpe=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Au(n)&&!Au(r)){const l=r;r=n;const u=this;return function(f=l,...p){return u.produce(f,m=>r.call(this,m,...p))}}Au(r)||oa(6),i!==void 0&&!Au(i)&&oa(7);let a;if(pa(n)){const l=ZR(this),u=B1(l,n,void 0);let d=!0;try{a=r(u),d=!1}finally{d?I1(l):L1(l)}return YR(l,i),XR(a,l)}else if(!n||!cC(n)){if(a=r(n),a===void 0&&(a=n),a===b6&&(a=void 0),this.autoFreeze_&&dC(a,!0),i){const l=[],u=[];cc(M1).generateReplacementPatches_(n,a,{patches_:l,inversePatches_:u}),i(l,u)}return a}else oa(1,n)},this.produceWithPatches=(n,r)=>{if(Au(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),Ts(t)&&(t=Ui(t));const n=ZR(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 YR(i,n),XR(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=cc(M1).applyPatches_;return Ts(t)?i(t,n):this.produce(t,a=>i(a,n))}};function B1(e,t,n,r){const[i,a]=dx(t)?cc(_y).proxyMap_(t,n):fx(t)?cc(_y).proxySet_(t,n):dpe(t,n);return(n?.scope_??S6()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?cpe(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 Ts(e)||oa(10,e),E6(e)}function E6(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)=>{Oy(n,i,E6(a))},r),t&&(t.finalized_=!1),n}var ppe=new hpe,O6=ppe.produce;function _6(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var mpe=_6(),gpe=_6,ype=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=>x6(r)&&r.type===e,n}var z6=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 eD(e){return pa(e)?O6(e,()=>{}):e}function pg(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function vpe(e){return typeof e=="boolean"}var xpe=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let l=new z6;return n&&(vpe(n)?l.push(mpe):l.push(gpe(n.extraArgument))),l},T6="RTK_autoBatch",an=()=>e=>({payload:e,meta:{[T6]:!0}}),tD=e=>t=>{setTimeout(t,e)},P6=(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:tD(10):e.type==="callback"?e.queueNotification:tD(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?.[T6],a=!i,a&&(l||(l=!0,d(f))),r.dispatch(p)}finally{i=!0}}})},bpe=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new z6(e);return r&&i.push(P6(typeof r=="object"?r:void 0)),i};function wpe(e){const t=xpe(),{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(lC(n))u=v6(n);else throw new Error(mi(1));let d;typeof r=="function"?d=r(t):d=t();let f=Cy;i&&(f=ype({trace:!1,...typeof i=="object"&&i}));const p=epe(...d),m=bpe(p);let g=typeof l=="function"?l(m):m();const v=f(...g);return y6(u,a,v)}function R6(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 jpe(e){return typeof e=="function"}function Spe(e,t){let[n,r,i]=R6(t),a;if(jpe(e))a=()=>eD(e());else{const u=eD(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(Ts(p)){const v=m(p,d);return v===void 0?p:v}else{if(pa(p))return O6(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 Npe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",kpe=(e=21)=>{let t="",n=e;for(;n--;)t+=Npe[Math.random()*64|0];return t},Cpe=Symbol.for("rtk-slice-createasyncthunk");function Ape(e,t){return`${e}/${t}`}function Epe({creators:e}={}){const t=e?.asyncThunk?.[Cpe];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(_pe()):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:Ape(i,C),createNotation:typeof r.reducers=="function"};Tpe(A)?Rpe(T,A,f,t):zpe(T,A,f)});function p(){const[C={},A=[],T=void 0]=typeof r.extraReducers=="function"?R6(r.extraReducers):[r.extraReducers],E={...C,...d.sliceCaseReducersByType};return Spe(r.initialState,_=>{for(let P in E)_.addCase(P,E[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 E(_=m){const P=pg(g,A,()=>new WeakMap);return pg(P,_,()=>{const $={};for(const[F,U]of Object.entries(r.selectors??{}))$[F]=Ope(U,_,()=>pg(v,_,S),A);return $})}return{reducerPath:C,getSelectors:E,get selectors(){return E(T)},selectSlice:T}}const O={name:i,reducer:b,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:S,...k(a),injectInto(C,{reducerPath:A,...T}={}){const E=A??a;return C.inject({reducerPath:E,reducer:b},T),{...O,...k(E,!0)}}};return O}}function Ope(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 Er=Epe();function _pe(){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 zpe({type:e,reducerName:t,createNotation:n},r,i){let a,l;if("reducer"in r){if(n&&!Ppe(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 Tpe(e){return e._reducerDefinitionType==="asyncThunk"}function Ppe(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Rpe({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 Dpe="task",D6="listener",M6="completed",fC="cancelled",Mpe=`task-${fC}`,Ipe=`task-${M6}`,U1=`${D6}-${fC}`,Lpe=`${D6}-${M6}`,mx=class{constructor(e){this.code=e,this.message=`${Dpe} ${fC} (reason: ${e})`}name="TaskAbortError";message},hC=(e,t)=>{if(typeof e!="function")throw new TypeError(mi(32))},Py=()=>{},I6=(e,t=Py)=>(e.catch(t),e),L6=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Wl=e=>{if(e.aborted)throw new mx(e.reason)};function $6(e,t){let n=Py;return new Promise((r,i)=>{const a=()=>i(new mx(e.reason));if(e.aborted){a();return}n=L6(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Py})}var $pe=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=>I6($6(e,t).then(n=>(Wl(e),n))),B6=e=>{const t=Ry(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Hu}=Object,nD={},gx="listenerMiddleware",Bpe=(e,t)=>{const n=r=>L6(e,()=>r.abort(e.reason));return(r,i)=>{hC(r);const a=new AbortController;n(a);const l=$pe(async()=>{Wl(e),Wl(a.signal);const u=await r({pause:Ry(a.signal),delay:B6(a.signal),signal:a.signal});return Wl(a.signal),u},()=>a.abort(Ipe));return i?.autoJoin&&t.push(l.catch(Py)),{result:Ry(e)(l),cancel(){a.abort(Mpe)}}}},Upe=(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 $6(t,Promise.race(u));return Wl(t),d}finally{a()}};return(r,i)=>I6(n(r,i))},U6=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 hC(a),{predicate:i,type:t,effect:a}},q6=Hu(e=>{const{type:t,predicate:n,effect:r}=U6(e);return{id:kpe(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(mi(22))}}},{withTypes:()=>q6}),rD=(e,t)=>{const{type:n,effect:r,predicate:i}=U6(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)})},qpe=(e,t)=>()=>{for(const n of t.keys())q1(n);e.clear()},iD=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},F6=Hu(yi(`${gx}/add`),{withTypes:()=>F6}),Fpe=yi(`${gx}/removeAll`),H6=Hu(yi(`${gx}/remove`),{withTypes:()=>H6}),Hpe=(...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=Hpe}=e;hC(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=rD(t,v)??q6(v);return u(j)};Hu(d,{withTypes:()=>d});const f=v=>{const j=rD(t,v);return j&&(j.unsubscribe(),v.cancelActive&&q1(j)),!!j};Hu(f,{withTypes:()=>f});const p=async(v,j,b,S)=>{const k=new AbortController,O=Upe(d,k.signal),C=[];try{v.pending.add(k),r(v),await Promise.resolve(v.effect(j,Hu({},b,{getOriginalState:S,condition:(A,T)=>O(A,T).then(Boolean),take:O,delay:B6(k.signal),pause:Ry(k.signal),extra:a,signal:k.signal,fork:Bpe(k.signal,C),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((A,T,E)=>{A!==k&&(A.abort(U1),E.delete(A))})},cancel:()=>{k.abort(U1),v.pending.delete(k)},throwIfCancelled:()=>{Wl(k.signal)}})))}catch(A){A instanceof mx||iD(l,A,{raisedBy:"effect"})}finally{await Promise.all(C),k.abort(Lpe),i(v),v.pending.delete(k)}},m=qpe(t,n);return{middleware:v=>j=>b=>{if(!x6(b))return j(b);if(F6.match(b))return d(b.payload);if(Fpe.match(b)){m();return}if(H6.match(b))return f(b.payload);let S=v.getState();const k=()=>{if(S===nD)throw new Error(mi(23));return S};let O;try{if(O=j(b),t.size>0){const C=v.getState(),A=Array.from(t.values());for(const T of A){let E=!1;try{E=T.predicate(b,C,S)}catch(_){E=!1,iD(l,_,{raisedBy:"predicate"})}E&&p(T,b,v,k)}}}finally{S=nD}return O},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 Kpe={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},K6=Er({name:"chartLayout",initialState:Kpe,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:Gpe,setLayout:Vpe,setChartSize:Qpe,setScale:Wpe}=K6.actions,Ype=K6.reducer;function G6(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 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 Pu(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){Zpe(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 Zpe(e,t,n){return(t=Xpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xpe(e){var t=Jpe(e,"string");return typeof t=="symbol"?t:t+""}function Jpe(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 eme=(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 Pu(Pu({},e),{},{[a]:e[a]+(r||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&l!=="middle"&&Te(e[l]))return Pu(Pu({},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",V6=(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},Q6=(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,O)=>{var C=r?r.indexOf(k):k,A=l.map(C);return ht(A)?{coordinate:A+b,value:k,offset:b,index:O}:null}).filter(Yr);return S}return d&&f?f.map((k,O)=>{var C=l.map(k);return ht(C)?{coordinate:C+b,value:k,index:O,offset:b}:null}).filter(Yr):l.ticks&&p!=null?l.ticks(p).map((k,O)=>{var C=l.map(k);return ht(C)?{coordinate:C+b,value:k,index:O,offset:b}:null}).filter(Yr):l.domain().map((k,O)=>{var C=l.map(k);return ht(C)?{coordinate:C+b,value:r?r[k]:k,index:O,offset:b}:null}).filter(Yr)},tme=(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},nme=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)}}}},rme=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)}}}},ime={sign:nme,expand:Ofe,none:oc,silhouette:_fe,wiggle:zfe,positive:rme},ame=(e,t,n)=>{var r,i=(r=ime[n])!==null&&r!==void 0?r:oc,a=Efe().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 W6(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=XB(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 sD=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},sme=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]},ome=e=>{var t=e.flat(2).filter(Te);return[Math.min(...t),Math.max(...t)]},lme=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],cme=(e,t,n)=>{if(e!=null)return lme(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=G6(f,t,n),m=ome(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]))},oD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,lD=/^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 cD(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Pu(Pu({},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 ume=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},dme=(e,t)=>t==="centric"?e.angle:e.radius,Bs=e=>e.layout.width,Us=e=>e.layout.height,fme=e=>e.layout.scale,Y6=e=>e.layout.margin,yx=re(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),vx=re(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),hme="data-recharts-item-index",pme="data-recharts-item-id",rp=60;function uD(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?uD(Object(n),!0).forEach(function(r){mme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mme(e,t,n){return(t=gme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gme(e){var t=yme(e,"string");return typeof t=="symbol"?t:t+""}function yme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vme=e=>e.brush.height;function xme(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 bme(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 wme(e){var t=yx(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function jme(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,Y6,vme,xme,bme,wme,jme,m6,Vhe],(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=eme(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)})}),Sme=re(nr,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),pC=re(Bs,Us,(e,t)=>({x:0,y:0,width:e,height:t})),Nme=x.createContext(null),rr=()=>x.useContext(Nme)!=null,xx=e=>e.brush,bx=re([xx,nr,Y6],(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={},dD;function kme(){return dD||(dD=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(...O){if(i?.aborted)return;l=this,u=O;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 fD;function Cme(){return fD||(fD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kme();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 hD;function Ame(){return hD||(hD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Cme();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,pD;function Eme(){return pD||(pD=1,Xj=Ame().throttle),Xj}var Ome=Eme();const _me=ma(Ome);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}},Z6=(e,t,n)=>{var{width:r=Ia.width,height:i=Ia.height,aspect:a,maxHeight:l}=n,u=lc(r)?e:Number(r),d=lc(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}},zme={width:0,height:0,overflow:"visible"},Tme={width:0,overflowX:"visible"},Pme={height:0,overflowY:"visible"},Rme={},Dme=e=>{var{width:t,height:n}=e,r=lc(t),i=lc(n);return r&&i?zme:r?Tme:i?Pme:Rme};function Mme(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 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 gD(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){Ime(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 Ime(e,t,n){return(t=Lme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lme(e){var t=$me(e,"string");return typeof t=="symbol"?t:t+""}function $me(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 X6=x.createContext(Ia.initialDimension);function Bme(e){return Ha(e.width)&&Ha(e.height)}function J6(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return Bme(i)?x.createElement(X6.Provider,{value:i},t):null}var mC=()=>x.useContext(X6),Ume=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,O]=x.useState({containerWidth:r.width,containerHeight:r.height}),C=x.useCallback((P,$)=>{O(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=_me(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:E,calculatedHeight:_}=Z6(A,T,{width:i,height:a,aspect:n,maxHeight:d});return My(E!=null&&E>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.`,E,_,i,a,l,u,n),x.createElement("div",{id:m?"".concat(m):void 0,className:Ot("recharts-responsive-container",g),style:gD(gD({},j),{},{width:i,height:a,minWidth:l,minHeight:u,maxHeight:d}),ref:b},x.createElement("div",{style:Dme({width:i,height:a})},x.createElement(J6,{width:E,height:_},f)))}),Ps=x.forwardRef((e,t)=>{var n=mC();if(Ha(n.width)&&Ha(n.height))return e.children;var{width:r,height:i}=Mme({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=Z6(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Te(a)&&Te(l)?x.createElement(J6,{width:a,height:l},e.children):x.createElement(Ume,F1({},e,{width:r,height:i,ref:t}))});function gC(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(Sme),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}},qme={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},eU=()=>{var e;return(e=Ue(nr))!==null&&e!==void 0?e:qme},yC=()=>Ue(Bs),vC=()=>Ue(Us),Fme=()=>Ue(e=>e.layout.margin),zt=e=>e.layout.layoutType,tl=()=>Ue(zt),xC=()=>{var e=tl();if(e==="horizontal"||e==="vertical")return e},tU=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Hme=()=>{var e=tl();return e!==void 0},ip=e=>{var t=ln(),n=rr(),{width:r,height:i}=e,a=mC(),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(Qpe({width:l,height:u}))},[t,n,l,u]),null},nU=Symbol.for("immer-nothing"),yD=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 uc(e){return e?rU(e)||Array.isArray(e)||!!e[yD]||!!e.constructor?.[yD]||ap(e)||Sx(e):!1}var Kme=Object.prototype.constructor.toString(),vD=new WeakMap;function rU(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=vD.get(n);return r===void 0&&(r=Function.toString.call(n),vD.set(n,r)),r===Kme}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 iU(e,t,n){const r=jx(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Gme(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=rU(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 bC(e,t=!1){return Nx(e)||id(e)||!uc(e)||(jx(e)>1&&Object.defineProperties(e,{set:yg,add:yg,clear:yg,delete:yg}),Object.freeze(e),t&&Object.values(e).forEach(n=>bC(n,!0))),e}function Vme(){la(2)}var yg={value:Vme};function Nx(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Qme={};function dc(e){const t=Qme[e];return t||la(0,e),t}var Th;function aU(){return Th}function Wme(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function xD(e,t){t&&(dc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function G1(e){V1(e),e.drafts_.forEach(Yme),e.drafts_=null}function V1(e){e===Th&&(Th=e.parent_)}function bD(e){return Th=Wme(Th,e)}function Yme(e){const t=e[vi];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function wD(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)),uc(e)&&(e=Ly(t,e),t.parent_||$y(t,e)),t.patches_&&dc("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!==nU?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)=>jD(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)=>jD(e,i,a,d,f,n,u),r),$y(e,a,!1),n&&e.patches_&&dc("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function jD(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(iU(n,r,f),id(f))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(uc(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_&&bC(t,n)}function Zme(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:aU(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=wC;n&&(i=[r],a=Ph);const{revoke:l,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=l,u}var wC={get(e,t){if(t===vi)return e;const n=Pl(e);if(!H1(n,t))return Xme(e,n,t);const r=n[t];return e.finalized_||!uc(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=sU(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(Gme(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(wC,(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 wC.set.call(this,e[0],t,n,e[0])};function Jj(e,t){const n=e[vi];return(n?Pl(n):e)[t]}function Xme(e,t,n){const r=sU(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function sU(e,t){if(!(t in e))return;let n=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 Jme=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(uc(t)){const a=bD(this),l=W1(t,void 0);let u=!0;try{i=n(l),u=!1}finally{u?G1(a):V1(a)}return xD(a,r),wD(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===nU&&(i=void 0),this.autoFreeze_&&bC(i,!0),r){const a=[],l=[];dc("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){uc(e)||la(8),id(e)&&(e=ege(e));const t=bD(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 xD(r,t),wD(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=dc("Patches").applyPatches_;return id(e)?r(e,t):this.produce(e,i=>r(i,t))}};function W1(e,t){const n=ap(e)?dc("MapSet").proxyMap_(e,t):Sx(e)?dc("MapSet").proxySet_(e,t):Zme(e,t);return(t?t.scope_:aU()).drafts_.push(n),n}function ege(e){return id(e)||la(10,e),oU(e)}function oU(e){if(!uc(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)=>{iU(n,i,oU(a))},r),t&&(t.finalized_=!1),n}var tge=new Jme;tge.produce;var nge={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},lU=Er({name:"legend",initialState:nge,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:SD,setLegendSettings:rge,addLegendPayload:ige,replaceLegendPayload:age,removeLegendPayload:sge}=lU.actions,oge=lU.reducer,tS={exports:{}},nS={};var ND;function lge(){if(ND)return nS;ND=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,O=T,T=m(T),g!==void 0&&j.hasValue){var E=j.value;if(g(E,T))return C=E}return C=T}if(E=C,n(O,T))return E;var _=m(T);return g!==void 0&&g(E,_)?(O=T,E):(O=T,C=_)}var k=!1,O,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 kD;function cge(){return kD||(kD=1,tS.exports=lge()),tS.exports}cge();function uge(e){e()}function dge(){let e=null,t=null;return{clear(){e=null,t=null},notify(){uge(()=>{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 CD={notify(){},get:()=>[]};function fge(e,t){let n,r=CD,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=dge())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=CD)}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 hge=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",pge=hge(),mge=()=>typeof navigator<"u"&&navigator.product==="ReactNative",gge=mge(),yge=()=>pge||gge?x.useLayoutEffect:x.useEffect,vge=yge();function AD(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function xge(e,t){if(AD(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])||!AD(e[n[i]],t[n[i]]))return!1;return!0}var bge=Symbol.for("react-redux-context"),wge=typeof globalThis<"u"?globalThis:{};function jge(){if(!x.createContext)return{};const e=wge[bge]??=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var Sge=jge();function Nge(e){const{children:t,context:n,serverState:r,store:i}=e,a=x.useMemo(()=>{const d=fge(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),l=x.useMemo(()=>i.getState(),[i]);vge(()=>{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||Sge;return x.createElement(u.Provider,{value:a},t)}var kge=Nge,Cge=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Age(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function kc(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Cge.has(r)){if(e[r]==null&&t[r]==null)continue;if(!xge(e[r],t[r]))return!1}else if(!Age(e[r],t[r]))return!1;return!0}var Ege=["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 ED(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ad(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ED(Object(n),!0).forEach(function(r){Oge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ED(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Oge(e,t,n){return(t=_ge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _ge(e){var t=zge(e,"string");return typeof t=="symbol"?t:t+""}function zge(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 Tge(e,t){if(e==null)return{};var n,r,i=Pge(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 Pge(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Rge(e){return e.value}function Dge(e){var{contextPayload:t}=e,n=Tge(e,Ege),r=d6(t,e.payloadUniqBy,Rge),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(she,i)}function Mge(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 Ige(e){var t=ln();return x.useEffect(()=>{t(rge(e))},[t,e]),null}function Lge(e){var t=ln();return x.useEffect(()=>(t(SD(e)),()=>{t(SD({width:0,height:0}))}),[t,e]),null}function $ge(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Bge={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Uge(e){var t=tr(e,Bge),n=Yhe(),r=Xde(),i=Fme(),{width:a,height:l,wrapperStyle:u,portal:d}=t,[f,p]=g6([n]),m=yC(),g=vC();if(m==null||g==null)return null;var v=m-(i?.left||0)-(i?.right||0),j=$ge(t.layout,l,a,v),b=d?u:ad(ad({position:"absolute",width:j?.width||a||"auto",height:j?.height||l||"auto"},Mge(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(Ige,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&x.createElement(Lge,{width:f.width,height:f.height}),x.createElement(Dge,Y1({},t,j,{margin:i,chartWidth:m,chartHeight:g,contextPayload:n})));return vc.createPortal(k,S)}var cU=x.memo(Uge,kc);cU.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){qge(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 qge(e,t,n){return(t=Fge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fge(e){var t=Hge(e,"string");return typeof t=="symbol"?t:t+""}function Hge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kge(e){return Array.isArray(e)&&Fa(e[0])&&Fa(e[1])?e.join(" ~ "):e}var yu={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function Gge(e,t){return t==null?e:ox(e,t)}var Vge=e=>{var{separator:t=yu.separator,contentStyle:n,itemStyle:r,labelStyle:i=yu.labelStyle,payload:a,formatter:l,itemSorter:u,wrapperClassName:d,labelClassName:f,label:p,labelFormatter:m,accessibilityLayer:g=yu.accessibilityLayer}=e,v=()=>{if(a&&a.length){var T={padding:0,margin:0},E=Gge(a,u),_=E.map((P,$)=>{if(!P||P.type==="none")return null;var F=P.formatter||l||Kge,{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({},yu.itemStyle),{},{color:P.color||yu.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat($),style:H},Fa(X)?x.createElement("span",{className:"recharts-tooltip-item-name"},X):null,Fa(X)?x.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,x.createElement("span",{className:"recharts-tooltip-item-value"},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({},yu.contentStyle),n),b=Uf({margin:0},i),S=!on(p),k=S?p:"",O=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:O,style:j},A),x.createElement("p",{className:C,style:b},x.isValidElement(k)?k:"".concat(k)),v())},qf="recharts-tooltip-wrapper",Qge={visibility:"hidden"};function Wge(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 _D(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 Yge(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 Zge(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=_D({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:l,tooltipDimension:u.width,viewBox:f,viewBoxDimension:f.width}),g=_D({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:l,tooltipDimension:u.height,viewBox:f,viewBoxDimension:f.height}),p=Yge({translateX:m,translateY:g,useTranslate3d:d})):p=Qge,{cssProperties:p,cssClasses:Wge({translateX:m,translateY:g,coordinate:n})}}var Xge=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),sp={isSsr:Xge()};function uU(){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 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 vu(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){Jge(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 Jge(e,t,n){return(t=eye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eye(e){var t=tye(e,"string");return typeof t=="symbol"?t:t+""}function tye(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 nye(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function rye(e){var t,n,r,i,a,l,u=uU(),[d,f]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var j=b=>{if(b.key==="Escape"){var S,k,O,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:(O=(C=e.coordinate)===null||C===void 0?void 0:C.y)!==null&&O!==void 0?O: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(vu(vu({},d),{},{dismissed:!1}));var{cssClasses:p,cssProperties:m}=Zge({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?{}:vu(vu({transition:nye({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},m),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=vu(vu({},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 iye=x.memo(rye),dU=()=>{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 TD(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 PD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TD(Object(n),!0).forEach(function(r){aye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aye(e,t,n){return(t=sye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sye(e){var t=oye(e,"string");return typeof t=="symbol"?t:t+""}function oye(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 RD={curveBasisClosed:yfe,curveBasisOpen:vfe,curveBasis:gfe,curveBumpX:nfe,curveBumpY:rfe,curveLinearClosed:xfe,curveLinear:ix,curveMonotoneX:bfe,curveMonotoneY:wfe,curveNatural:jfe,curveStep:Sfe,curveStepAfter:kfe,curveStepBefore:Nfe},By=e=>ht(e.x)&&ht(e.y),DD=e=>e.base!=null&&By(e.base)&&By(e),Ff=e=>e.x,Hf=e=>e.y,lye=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(ep(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=RD["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return RD[n]||ix},MD={connectNulls:!1,type:"linear"},cye=e=>{var{type:t=MD.type,points:n=[],baseLine:r,layout:i,connectNulls:a=MD.connectNulls}=e,l=lye(t,i),u=a?n.filter(By):n;if(Array.isArray(r)){var d,f=n.map((j,b)=>PD(PD({},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(DD).curve(l),m=a?f.filter(DD):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=$B().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?cye(l):r;return x.createElement("path",X1({},gi(e),aC(e),{className:Ot("recharts-curve",t),d:u===null?void 0:u,ref:i}))},uye=["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 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 dye(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){fye(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 fye(e,t,n){return(t=hye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hye(e){var t=pye(e,"string");return typeof t=="symbol"?t:t+""}function pye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mye(e,t){if(e==null)return{};var n,r,i=gye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function gye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var yye=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),vye=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:l=0,className:u}=e,d=mye(e,uye),f=dye({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:yye(t,n,a,l,r,i)}))};function xye(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 LD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $D(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LD(Object(n),!0).forEach(function(r){bye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bye(e,t,n){return(t=wye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wye(e){var t=jye(e,"string");return typeof t=="symbol"?t:t+""}function jye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Sye=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),fU=(e,t,n)=>e.map(r=>"".concat(Sye(r)," ").concat(t,"ms ").concat(n)).join(","),Nye=(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)=>$D($D({},n),{},{[r]:e(r,t[r])}),{});function BD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Qn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BD(Object(n),!0).forEach(function(r){kye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kye(e,t,n){return(t=Cye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cye(e){var t=Aye(e,"string");return typeof t=="symbol"?t:t+""}function Aye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Uy=(e,t,n)=>e+(t-e)*n,eN=e=>{var{from:t,to:n}=e;return t!==n},hU=(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):hU(e,r,n-1)};function Eye(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=hU(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 Oye(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 _ye=(e,t,n,r,i,a)=>{var l=Nye(e,t);return n==null?()=>(i(Qn(Qn({},e),t)),()=>{}):n.isStepper===!0?Eye(e,t,n,l,i,a):Oye(e,t,n,r,l,i,a)};var qy=1e-4,pU=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],mU=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),UD=(e,t)=>n=>{var r=pU(e,t);return mU(r,n)},zye=(e,t)=>n=>{var r=pU(e,t),i=[...r.map((a,l)=>a*l).slice(1),0];return mU(i,n)},Tye=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]]},Pye=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=Tye(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},Rye=(e,t,n,r)=>{var i=UD(e,n),a=UD(t,r),l=zye(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},qD=function(){return Rye(...Pye(...arguments))},Dye=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},Mye=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return qD(e);case"spring":return Dye();default:if(e.split("(")[0]==="cubic-bezier")return qD(e)}return typeof e=="function"?e:null};function Iye(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 Lye{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 $ye(){return Iye(new Lye)}var Bye=x.createContext($ye);function Uye(e,t){var n=x.useContext(Bye);return x.useMemo(()=>t??n(e),[e,t,n])}var qye={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},FD={t:0},rS={t:1};function op(e){var t=tr(e,qye),{isActive:n,canBegin:r,duration:i,easing:a,begin:l,onAnimationEnd:u,onAnimationStart:d,children:f}=t,p=uU(),m=n==="auto"?!sp.isSsr&&!p:n,g=Uye(t.animationId,t.animationManager),[v,j]=x.useState(m?FD:rS),b=x.useRef(null);return x.useEffect(()=>{m||j(rS)},[m]),x.useEffect(()=>{if(!m||!r)return el;var S=_ye(FD,rS,Mye(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 Fye=["radius"],Hye=["radius"],HD,KD,GD,VD,QD,WD,YD,ZD,XD,JD;function eM(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 tM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eM(Object(n),!0).forEach(function(r){Kye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kye(e,t,n){return(t=Gye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gye(e){var t=Vye(e,"string");return typeof t=="symbol"?t:t+""}function Vye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}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 nM(e,t){if(e==null)return{};var n,r,i=Qye(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 Qye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ea(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var rM=(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(HD||(HD=Ea(["M",",",""])),e,t+d*g[0]),g[0]>0&&(m+=kn(KD||(KD=Ea(["A ",",",",0,0,",",",",",""])),g[0],g[0],p,e+f*g[0],t)),m+=kn(GD||(GD=Ea(["L ",",",""])),e+n-f*g[1],t),g[1]>0&&(m+=kn(VD||(VD=Ea(["A ",",",",0,0,",`,
261
- `,",",""])),g[1],g[1],p,e+n,t+d*g[1])),m+=kn(QD||(QD=Ea(["L ",",",""])),e+n,t+r-d*g[2]),g[2]>0&&(m+=kn(WD||(WD=Ea(["A ",",",",0,0,",`,
262
- `,",",""])),g[2],g[2],p,e+n-f*g[2],t+r)),m+=kn(YD||(YD=Ea(["L ",",",""])),e+f*g[3],t+r),g[3]>0&&(m+=kn(ZD||(ZD=Ea(["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(XD||(XD=Ea(["M ",",",`
264
- A `,",",",0,0,",",",",",`
265
- L `,",",`
266
- A `,",",",0,0,",",",",",`
267
- L `,",",`
268
- A `,",",",0,0,",",",",",`
269
- L `,",",`
270
- A `,",",",0,0,",",",","," Z"])),e,t+d*k,k,k,p,e+f*k,t,e+n-f*k,t,k,k,p,e+n,t+d*k,e+n,t+r-d*k,k,k,p,e+n-f*k,t+r,e+f*k,t+r,k,k,p,e,t+r-d*k)}else m=kn(JD||(JD=Ea(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},iM={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},gU=e=>{var t=tr(e,iM),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),O=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 E=Ot("recharts-rectangle",p);if(!b){var _=kr(t),{radius:P}=_,$=nM(_,Fye);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:E,d:rM(a,l,u,d,f)}))}var F=S.current,U=k.current,B=O.current,V=C.current,X="0px ".concat(r===-1?1:r,"px"),Z="".concat(r,"px ").concat(r,"px"),H=fU(["strokeDasharray"],g,typeof m=="string"?m:iM.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,O.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=nM(D,Hye);return x.createElement("path",Fy({},se,{radius:typeof f=="number"?f:void 0,className:E,d:rM(I,M,oe,ye,f),ref:n,style:tM(tM({},q),t.style)}))})};function aM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function sM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aM(Object(n),!0).forEach(function(r){Wye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wye(e,t,n){return(t=Yye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yye(e){var t=Zye(e,"string");return typeof t=="symbol"?t:t+""}function Zye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hy=Math.PI/180,Xye=e=>e*180/Math.PI,mr=(e,t,n,r)=>({x:e+Math.cos(-Hy*r)*n,y:t+Math.sin(-Hy*r)*n}),Jye=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},eve=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},tve=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,l=eve({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:Xye(d),angleInRadian:d}},nve=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}},rve=(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},ive=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=tve({x:n,y:r},t),{innerRadius:l,outerRadius:u}=t;if(i<l||i>u||i===0)return null;var{startAngle:d,endAngle:f}=nve(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?sM(sM({},t),{},{radius:i,angle:rve(p,t)}):null};function yU(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 oM,lM,cM,uM,dM,fM,hM;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 ave=(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}},vU=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:l}=e,u=ave(a,l),d=a+u,f=mr(t,n,i,a),p=mr(t,n,i,d),m=kn(oM||(oM=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(lM||(lM=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(cM||(cM=Ul(["L ",","," Z"])),t,n);return m},sve=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(uM||(uM=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):vU({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:f});var O=kn(dM||(dM=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:E,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(O,"L").concat(t,",").concat(n,"Z");O+=kn(fM||(fM=Ul(["L",",",`
285
- A`,",",",0,0,",",",",",`
286
- A`,",",",0,",",",",",",",`
287
- A`,",",",0,0,",",",",","Z"])),_.x,_.y,a,a,+(p<0),E.x,E.y,r,r,+($>180),+(p>0),C.x,C.y,a,a,+(p<0),A.x,A.y)}else O+=kn(hM||(hM=Ul(["L",",","Z"])),t,n);return O},ove={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},xU=e=>{var t=tr(e,ove),{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=sve({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(j,v/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p}):b=vU({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:p}),x.createElement("path",tN({},kr(t),{className:g,d:b}))};function lve(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(e6(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 yU(t)}}var iS={},aS={},sS={},pM;function cve(){return pM||(pM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=h6();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(sS)),sS}var mM;function uve(){return mM||(mM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cve();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 gM;function dve(){return gM||(gM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=p6(),n=uve();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,yM;function fve(){return yM||(yM=1,oS=dve().range),oS}var hve=fve();const bU=ma(hve);var ba=e=>e.chartData,jC=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?jC(e):ba(e),wU=(e,t,n)=>n?jC(e):ba(e),pve=re([cp],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});re([jC],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var mve=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 vM(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function jU(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 gve(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if($a(r))return vM(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"&&oD.test(i)){var d=oD.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"&&lD.test(a)){var p=lD.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:vM(g,t,n)}}}var Cd=1e9,yve={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},NC,hn=!0,Vi="[DecimalError] ",Yl=Vi+"Invalid argument: ",SC=Vi+"Exponent out of range: ",Ad=Math.floor,Rl=Math.pow,vve=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fi,Jn=1e7,sn=7,SU=9007199254740991,Ky=Ad(SU/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 Es(this,new this.constructor(e))};Re.dividedToIntegerBy=Re.idiv=function(e){var t=this,n=t.constructor;return Qt(Es(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=Es(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?CU(t,e):NU(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=Es(n,e,0,1).times(e),hn=!0,n.minus(t)):Qt(new r(n),i)};Re.naturalExponential=Re.exp=function(){return kU(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?NU(t,e):CU(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(Es(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=fc(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=fc(r,!0,e+1)),n};Re.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?fc(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=fc(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)<=SU){for(i=new d(fi),t=Math.ceil(r/sn+4),hn=!1;n%2&&(i=i.times(u),bM(i.d,t)),n=Ad(n/2),n!==0;)u=u.times(u),bM(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=kU(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=fc(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=fc(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 fc(e,t<=n.toExpNeg||t>=n.toExpPos)};function NU(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+=Eo(n)),a+=r;l=e[t],r=l+"",n=sn-r.length,n&&(a+=Eo(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return a+l}var Es=(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,O,C,A,T,E,_,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?O=a=$.precision:l?O=a+(qn(r)-qn(i))+1:O=a,O<0)return new $(0);if(O=O/sn+2|0,f=0,_==1)for(p=0,B=B[0],O++;(f<T||p)&&O--;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),E=B[0],B[1]>=Jn/2&&++E;do p=0,u=t(B,b,_,S),u<0?(k=b[0],_!=S&&(k=k*Jn+(b[1]||0)),p=k/E|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)&&O--)}return j[0]||j.shift(),v.e=d,Qt(v,l?a+qn(v)+1:a)}})();function kU(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(SC+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(Es(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 Eo(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=Es(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(Es(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=Es(u,new b(m),f),b.precision=S,t==null?(hn=!0,Qt(u,S)):u;u=d,i+=2}}function xM(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(SC+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(SC+qn(e));return e}function CU(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 fc(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)+Eo(r):l>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Eo(-i-1)+a,n&&(r=n-l)>0&&(a+=Eo(r))):i>=l?(a+=Eo(i+1-l),n&&(r=n-i-1)>0&&(a=a+"."+Eo(r))):((r=i+1)<l&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(a+="."),a+=Eo(r))),e.s<0?"-"+a:a}function bM(e,t){if(e.length>t)return e.length=t,!0}function AU(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 xM(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,vve.test(a))xM(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=AU,i.config=i.set=xve,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 xve(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 NC=AU(yve);fi=new NC(1);const jt=NC;function EU(e){var t;return e===0?t=1:t=Math.floor(new jt(e).abs().log(10).toNumber())+1,t}function OU(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 _U=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},kC=(e,t,n)=>{if(e.lte(0))return new jt(0);var r=EU(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()))},zU=(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()))},bve=(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(EU(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},TU=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]:kC;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?TU(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))})},wM=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]=_U([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 bve(d,i,a);var m=l==="snap125"?zU:kC,{step:g,tickMin:v,tickMax:j}=TU(d,f,u,a,0,m),b=OU(v,j.add(new jt(.1).mul(g)),g);return n>r?b.reverse():b},jM=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]=_U([r,i]);if(u===-1/0||d===1/0)return[r,i];if(u===d)return[u];var f=l==="snap125"?zU:kC,p=Math.max(n,2),m=f(new jt(d).sub(u).div(p-1),a,0),g=[...OU(new jt(u),new jt(d),m),d];return a===!1&&(g=g.map(v=>Math.round(v))),r>i?g.reverse():g},PU=e=>e.rootProps.maxBarSize,wve=e=>e.rootProps.barGap,RU=e=>e.rootProps.barCategoryGap,jve=e=>e.rootProps.barSize,kx=e=>e.rootProps.stackOffset,DU=e=>e.rootProps.reverseStackOrder,CC=e=>e.options.chartName,AC=e=>e.rootProps.syncId,MU=e=>e.rootProps.syncMethod,EC=e=>e.options.eventEmitter,Sve=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"},Oa={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 SM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SM(Object(n),!0).forEach(function(r){Nve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nve(e,t,n){return(t=kve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kve(e){var t=Cve(e,"string");return typeof t=="symbol"?t:t+""}function Cve(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 NM={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"},kM={allowDataOverflow:Oa.allowDataOverflow,allowDecimals:Oa.allowDecimals,allowDuplicatedCategory:Oa.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Oa.radiusAxisId,includeHidden:Oa.includeHidden,name:void 0,reversed:Oa.reversed,scale:Oa.scale,tick:Oa.tick,tickCount:Oa.tickCount,ticks:void 0,type:Oa.type,unit:void 0,niceTicks:"auto"},Ave=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},OC=re([Ave,tU],(e,t)=>{var n;if(e!=null)return e;var r=(n=Ax(t,"angleAxis",NM.type))!==null&&n!==void 0?n:"category";return Gy(Gy({},NM),{},{type:r})}),Eve=(e,t)=>e.polarAxis.radiusAxis[t],_C=re([Eve,tU],(e,t)=>{var n;if(e!=null)return e;var r=(n=Ax(t,"radiusAxis",kM.type))!==null&&n!==void 0?n:"category";return Gy(Gy({},kM),{},{type:r})}),Ex=e=>e.polarOptions,zC=re([Bs,Us,nr],Jye),IU=re([Ex,zC],(e,t)=>{if(e!=null)return ha(e.innerRadius,t,0)}),LU=re([Ex,zC],(e,t)=>{if(e!=null)return ha(e.outerRadius,t,t*.8)}),Ove=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},$U=re([Ex],Ove);re([OC,$U],Cx);var BU=re([zC,IU,LU],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});re([_C,BU],Cx);var UU=re([zt,Ex,IU,LU,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,Ox=(e,t,n)=>n;function _x(e){return e?.id}function qU(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 _ve(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=zt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Ed=e=>e.tooltip.settings.axisId;function TC(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(a){function 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 zve=(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 Tve(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function PC(e){let t,n,r;e.length!==2?(t=Uo,n=(u,d)=>Uo(e(u),d),r=(u,d)=>e(u)-d):(t=e===Uo||e===Tve?e:Pve,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 Pve(){return 0}function FU(e){return e===null?NaN:+e}function*Rve(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Dve=PC(Uo),up=Dve.right;PC(FU).center;class CM extends Map{constructor(t,n=Lve){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(AM(this,t))}has(t){return super.has(AM(this,t))}set(t,n){return super.set(Mve(this,t),n)}delete(t){return super.delete(Ive(this,t))}}function AM({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Mve({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Ive({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Lve(e){return e!==null&&typeof e=="object"?e.valueOf():e}function $ve(e=Uo){if(e===Uo)return HU;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 HU(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Bve=Math.sqrt(50),Uve=Math.sqrt(10),qve=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>=Bve?10:a>=Uve?5:a>=qve?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 EM(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 KU(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?HU:$ve(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));KU(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 Fve(e,t,n){if(e=Float64Array.from(Rve(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return OM(e);if(t>=1)return EM(e);var r,i=(r-1)*t,a=Math.floor(i),l=EM(KU(e,a).subarray(0,a+1)),u=OM(e.subarray(a+1));return l+(u-l)*(i-a)}}function Hve(e,t,n=FU){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 Kve(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 RC(){var e=new CM,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 CM;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 RC(t,n).unknown(r)},Zi.apply(i,arguments),i}function DC(){var e=RC().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=Kve(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 DC(t(),[r,i]).round(u).paddingInner(d).paddingOuter(f).align(p)},Zi.apply(m(),arguments)}function GU(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return GU(t())},e}function Gve(){return GU(DC.apply(null,arguments).paddingInner(1))}function MC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function VU(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,Ku="\\s*([+-]?\\d+)\\s*",Ih="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ba="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Vve=/^#([0-9a-f]{3,8})$/,Qve=new RegExp(`^rgb\\(${Ku},${Ku},${Ku}\\)$`),Wve=new RegExp(`^rgb\\(${Ba},${Ba},${Ba}\\)$`),Yve=new RegExp(`^rgba\\(${Ku},${Ku},${Ku},${Ih}\\)$`),Zve=new RegExp(`^rgba\\(${Ba},${Ba},${Ba},${Ih}\\)$`),Xve=new RegExp(`^hsl\\(${Ih},${Ba},${Ba}\\)$`),Jve=new RegExp(`^hsla\\(${Ih},${Ba},${Ba},${Ih}\\)$`),_M={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};MC(dp,Lh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:zM,formatHex:zM,formatHex8:exe,formatHsl:txe,formatRgb:TM,toString:TM});function zM(){return this.rgb().formatHex()}function exe(){return this.rgb().formatHex8()}function txe(){return QU(this).formatHsl()}function TM(){return this.rgb().formatRgb()}function Lh(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Vve.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?PM(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=Qve.exec(e))?new Zr(t[1],t[2],t[3],1):(t=Wve.exec(e))?new Zr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Yve.exec(e))?xg(t[1],t[2],t[3],t[4]):(t=Zve.exec(e))?xg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Xve.exec(e))?MM(t[1],t[2]/100,t[3]/100,1):(t=Jve.exec(e))?MM(t[1],t[2]/100,t[3]/100,t[4]):_M.hasOwnProperty(e)?PM(_M[e]):e==="transparent"?new Zr(NaN,NaN,NaN,0):null}function PM(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 nxe(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?nxe(e):new Zr(e,t,n,r??1)}function Zr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}MC(Zr,sN,VU(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:RM,formatHex:RM,formatHex8:rxe,formatRgb:DM,toString:DM}));function RM(){return`#${ql(this.r)}${ql(this.g)}${ql(this.b)}`}function rxe(){return`#${ql(this.r)}${ql(this.g)}${ql(this.b)}${ql((isNaN(this.opacity)?1:this.opacity)*255)}`}function DM(){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 MM(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 QU(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 ixe(e,t,n,r){return arguments.length===1?QU(e):new ca(e,t,n,r??1)}function ca(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}MC(ca,ixe,VU(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(IM(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("}${IM(this.h)}, ${bg(this.s)*100}%, ${bg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function IM(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 IC=e=>()=>e;function axe(e,t){return function(n){return e+n*t}}function sxe(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 oxe(e){return(e=+e)==1?WU:function(t,n){return n-t?sxe(t,n,e):IC(isNaN(t)?n:t)}}function WU(e,t){var n=t-e;return n?axe(e,n):IC(isNaN(e)?t:e)}const LM=(function e(t){var n=oxe(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=WU(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 lxe(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 cxe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function uxe(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]=Od(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 dxe(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 fxe(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]=Od(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 hxe(e){return function(){return e}}function pxe(e){return function(t){return e(t)+""}}function mxe(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]?pxe(d[0].x):hxe(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 Od(e,t){var n=typeof t,r;return t==null||n==="boolean"?IC(t):(n==="number"?Yy:n==="string"?(r=Lh(t))?(t=r,LM):mxe:t instanceof Lh?LM:t instanceof Date?dxe:cxe(t)?lxe:Array.isArray(t)?uxe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?fxe:Yy)(e,t)}function LC(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function gxe(e,t){t===void 0&&(t=e,e=Od);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 yxe(e){return function(){return e}}function Zy(e){return+e}var $M=[0,1];function Rr(e){return e}function lN(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:yxe(isNaN(t)?NaN:.5)}function vxe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function xxe(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 bxe(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=$M,t=$M,n=Od,r,i,a,l=Rr,u,d,f;function p(){var g=Math.min(e.length,t.length);return l!==Rr&&(l=vxe(e[0],e[g-1])),u=g>2?bxe:xxe,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=LC,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 $C(){return Rx()(Rr,Rr)}function wxe(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 jxe(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 Sxe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Nxe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $h(e){if(!(t=Nxe.exec(e)))throw new Error("invalid format: "+e);var t;return new BC({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}$h.prototype=BC.prototype;function BC(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}BC.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function kxe(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Jy;function Cxe(e,t){var n=Xy(e,t);if(!n)return Jy=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Jy=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return a===l?r:a>l?r+new Array(a-l+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Xy(e,Math.max(0,t+a-1))[0]}function BM(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 UM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:wxe,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)=>BM(e*100,t),r:BM,s:Cxe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function qM(e){return e}var FM=Array.prototype.map,HM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Axe(e){var t=e.grouping===void 0||e.thousands===void 0?qM:jxe(FM.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?qM:Sxe(FM.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,O=m.width,C=m.comma,A=m.precision,T=m.trim,E=m.type;E==="n"?(C=!0,E="g"):UM[E]||(A===void 0&&(A=12),T=!0,E="g"),(k||v==="0"&&j==="=")&&(k=!0,v="0",j="=");var _=(g&&g.prefix!==void 0?g.prefix:"")+(S==="$"?n:S==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():""),P=(S==="$"?r:/[%p]/.test(E)?l:"")+(g&&g.suffix!==void 0?g.suffix:""),$=UM[E],F=/[defgprs%]/.test(E);A=A===void 0?6:/[gprs]/.test(E)?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(E==="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=kxe(B)),oe&&+B==0&&b!=="+"&&(oe=!1),V=(oe?b==="("?b:u:b==="-"||b==="("?"":b)+V,X=(E==="s"&&!isNaN(B)&&Jy!==void 0?HM[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<O?new Array(O-ye+1).join(v):"";switch(C&&k&&(B=t(I+B,I.length?O-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:HM[8+v/3]});return function(S){return b(j*S)}}return{format:f,formatPrefix:p}}var wg,UC,YU;Exe({thousands:",",grouping:[3],currency:["$",""]});function Exe(e){return wg=Axe(e),UC=wg.format,YU=wg.formatPrefix,wg}function Oxe(e){return Math.max(0,-sd(Math.abs(e)))}function _xe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(sd(t)/3)))*3-sd(Math.abs(e)))}function zxe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,sd(t)-sd(e))+1}function ZU(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=_xe(i,l))&&(r.precision=a),YU(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=zxe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Oxe(i))&&(r.precision=a-(r.type==="%")*2);break}}return UC(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 ZU(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 XU(){var e=$C();return e.copy=function(){return fp(e,XU())},Zi.apply(e,arguments),nl(e)}function JU(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 JU(e).unknown(t)},e=arguments.length?Array.from(e,Zy):[0,1],nl(n)}function eq(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 KM(e){return Math.log(e)}function GM(e){return Math.exp(e)}function Txe(e){return-Math.log(-e)}function Pxe(e){return-Math.exp(-e)}function Rxe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Dxe(e){return e===10?Rxe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Mxe(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 VM(e){return(t,n)=>-e(-t,n)}function qC(e){const t=e(KM,GM),n=t.domain;let r=10,i,a;function l(){return i=Mxe(r),a=Dxe(r),n()[0]<0?(i=VM(i),a=VM(a),e(Txe,Pxe)):e(KM,GM),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=UC(d)),u===1/0)return d;const f=Math.max(1,r*u/t.ticks().length);return p=>{let m=p/a(Math.round(i(p)));return m*r<r-.5&&(m*=r),m<=f?d(p):""}},t.nice=()=>n(eq(n(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function tq(){const e=qC(Rx()).domain([1,10]);return e.copy=()=>fp(e,tq()).base(e.base()),Zi.apply(e,arguments),e}function QM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function WM(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function FC(e){var t=1,n=e(QM(t),WM(t));return n.constant=function(r){return arguments.length?e(QM(t=+r),WM(t)):t},nl(n)}function nq(){var e=FC(Rx());return e.copy=function(){return fp(e,nq()).constant(e.constant())},Zi.apply(e,arguments)}function YM(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Ixe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Lxe(e){return e<0?-e*e:e*e}function HC(e){var t=e(Rr,Rr),n=1;function r(){return n===1?e(Rr,Rr):n===.5?e(Ixe,Lxe):e(YM(n),YM(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},nl(t)}function KC(){var e=HC(Rx());return e.copy=function(){return fp(e,KC()).exponent(e.exponent())},Zi.apply(e,arguments),e}function $xe(){return KC.apply(null,arguments).exponent(.5)}function ZM(e){return Math.sign(e)*e*e}function Bxe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function rq(){var e=$C(),t=[0,1],n=!1,r;function i(a){var l=Bxe(e(a));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(a){return e.invert(ZM(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(ZM)),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 rq(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Zi.apply(i,arguments),nl(i)}function iq(){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]=Hve(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 iq().domain(e).range(t).unknown(r)},Zi.apply(a,arguments)}function aq(){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 aq().domain([e,t]).range(i).unknown(a)},Zi.apply(nl(l),arguments)}function sq(){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 sq().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 ks=1e3,qi=ks*60,Cs=qi*60,Rs=Cs*24,GC=Rs*7,XM=Rs*30,hS=Rs*365,Fl=Yn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ks)},(e,t)=>(t-e)/ks,e=>e.getUTCSeconds());Fl.range;const VC=Yn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ks)},(e,t)=>{e.setTime(+e+t*qi)},(e,t)=>(t-e)/qi,e=>e.getMinutes());VC.range;const QC=Yn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*qi)},(e,t)=>(t-e)/qi,e=>e.getUTCMinutes());QC.range;const WC=Yn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ks-e.getMinutes()*qi)},(e,t)=>{e.setTime(+e+t*Cs)},(e,t)=>(t-e)/Cs,e=>e.getHours());WC.range;const YC=Yn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Cs)},(e,t)=>(t-e)/Cs,e=>e.getUTCHours());YC.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)/Rs,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)/Rs,e=>e.getUTCDate()-1);Dx.range;const oq=Yn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Rs,e=>Math.floor(e/Rs));oq.range;function Cc(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)/GC)}const Mx=Cc(0),tv=Cc(1),Uxe=Cc(2),qxe=Cc(3),od=Cc(4),Fxe=Cc(5),Hxe=Cc(6);Mx.range;tv.range;Uxe.range;qxe.range;od.range;Fxe.range;Hxe.range;function Ac(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)/GC)}const Ix=Ac(0),nv=Ac(1),Kxe=Ac(2),Gxe=Ac(3),ld=Ac(4),Vxe=Ac(5),Qxe=Ac(6);Ix.range;nv.range;Kxe.range;Gxe.range;ld.range;Vxe.range;Qxe.range;const ZC=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());ZC.range;const XC=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());XC.range;const Ds=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());Ds.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)});Ds.range;const Ms=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());Ms.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)});Ms.range;function lq(e,t,n,r,i,a){const l=[[Fl,1,ks],[Fl,5,5*ks],[Fl,15,15*ks],[Fl,30,30*ks],[a,1,qi],[a,5,5*qi],[a,15,15*qi],[a,30,30*qi],[i,1,Cs],[i,3,3*Cs],[i,6,6*Cs],[i,12,12*Cs],[r,1,Rs],[r,2,2*Rs],[n,1,GC],[t,1,XM],[t,3,3*XM],[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=PC(([,,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[Wxe,Yxe]=lq(Ms,XC,Ix,oq,YC,QC),[Zxe,Xxe]=lq(Ds,ZC,Mx,hp,WC,VC);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 Jxe(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),O=Qf(d),C={a:J,A:oe,b:ye,B:I,c:null,d:iI,e:iI,f:j0e,g:T0e,G:R0e,H:x0e,I:b0e,j:w0e,L:cq,m:S0e,M:N0e,p:M,q,Q:oI,s:lI,S:k0e,u:C0e,U:A0e,V:E0e,w:O0e,W:_0e,x:null,X:null,y:z0e,Y:P0e,Z:D0e,"%":sI},A={a:D,A:G,b:se,B:ne,c:null,d:aI,e:aI,f:$0e,g:W0e,G:Z0e,H:M0e,I:I0e,j:L0e,L:dq,m:B0e,M:U0e,p:Ce,q:Se,Q:oI,s:lI,S:q0e,u:F0e,U:H0e,V:K0e,w:G0e,W:V0e,x:null,X:null,y:Q0e,Y:Y0e,Z:X0e,"%":sI},T={a:F,A:U,b:B,B:V,c:X,d:nI,e:nI,f:m0e,g:tI,G:eI,H:rI,I:rI,j:d0e,L:p0e,m:u0e,M:f0e,p:$,q:c0e,Q:y0e,s:v0e,S:h0e,u:i0e,U:a0e,V:s0e,w:r0e,W:o0e,x:Z,X:H,y:tI,Y:eI,Z:l0e,"%":g0e};C.x=E(n,C),C.X=E(r,C),C.c=E(t,C),A.x=E(n,A),A.X=E(r,A),A.c=E(t,A);function E(ee,me){return function(Oe){var Y=[],He=-1,Pe=0,at=ee.length,Ve,Ht,Lt;for(Oe instanceof Date||(Oe=new Date(+Oe));++He<at;)ee.charCodeAt(He)===37&&(Y.push(ee.slice(Pe,He)),(Ht=JM[Ve=ee.charAt(++He)])!=null?Ve=ee.charAt(++He):Ht=Ve==="e"?" ":"0",(Lt=me[Ve])&&(Ve=Lt(Oe,Ht)),Y.push(Ve),Pe=He+1);return Y.push(ee.slice(Pe,He)),Y.join("")}}function _(ee,me){return function(Oe){var Y=Gf(1900,void 0,1),He=P(Y,ee,Oe+="",0),Pe,at;if(He!=Oe.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(me&&!("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,me,Oe,Y){for(var He=0,Pe=me.length,at=Oe.length,Ve,Ht;He<Pe;){if(Y>=at)return-1;if(Ve=me.charCodeAt(He++),Ve===37){if(Ve=me.charAt(He++),Ht=T[Ve in JM?me.charAt(He++):Ve],!Ht||(Y=Ht(ee,Oe,Y))<0)return-1}else if(Ve!=Oe.charCodeAt(Y++))return-1}return Y}function $(ee,me,Oe){var Y=f.exec(me.slice(Oe));return Y?(ee.p=p.get(Y[0].toLowerCase()),Oe+Y[0].length):-1}function F(ee,me,Oe){var Y=v.exec(me.slice(Oe));return Y?(ee.w=j.get(Y[0].toLowerCase()),Oe+Y[0].length):-1}function U(ee,me,Oe){var Y=m.exec(me.slice(Oe));return Y?(ee.w=g.get(Y[0].toLowerCase()),Oe+Y[0].length):-1}function B(ee,me,Oe){var Y=k.exec(me.slice(Oe));return Y?(ee.m=O.get(Y[0].toLowerCase()),Oe+Y[0].length):-1}function V(ee,me,Oe){var Y=b.exec(me.slice(Oe));return Y?(ee.m=S.get(Y[0].toLowerCase()),Oe+Y[0].length):-1}function X(ee,me,Oe){return P(ee,t,me,Oe)}function Z(ee,me,Oe){return P(ee,n,me,Oe)}function H(ee,me,Oe){return P(ee,r,me,Oe)}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 me=E(ee+="",C);return me.toString=function(){return ee},me},parse:function(ee){var me=_(ee+="",!1);return me.toString=function(){return ee},me},utcFormat:function(ee){var me=E(ee+="",A);return me.toString=function(){return ee},me},utcParse:function(ee){var me=_(ee+="",!0);return me.toString=function(){return ee},me}}}var JM={"-":"",_:" ",0:"0"},sr=/^\s*\d+/,e0e=/^%/,t0e=/[\\^$*+?|[\]().{}]/g;function _t(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 n0e(e){return e.replace(t0e,"\\$&")}function Vf(e){return new RegExp("^(?:"+e.map(n0e).join("|")+")","i")}function Qf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function r0e(e,t,n){var r=sr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function i0e(e,t,n){var r=sr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function a0e(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function s0e(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function o0e(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function eI(e,t,n){var r=sr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function tI(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 l0e(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 c0e(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 u0e(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 nI(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function d0e(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 rI(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function f0e(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function h0e(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function p0e(e,t,n){var r=sr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function m0e(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 g0e(e,t,n){var r=e0e.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function y0e(e,t,n){var r=sr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function v0e(e,t,n){var r=sr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function iI(e,t){return _t(e.getDate(),t,2)}function x0e(e,t){return _t(e.getHours(),t,2)}function b0e(e,t){return _t(e.getHours()%12||12,t,2)}function w0e(e,t){return _t(1+hp.count(Ds(e),e),t,3)}function cq(e,t){return _t(e.getMilliseconds(),t,3)}function j0e(e,t){return cq(e,t)+"000"}function S0e(e,t){return _t(e.getMonth()+1,t,2)}function N0e(e,t){return _t(e.getMinutes(),t,2)}function k0e(e,t){return _t(e.getSeconds(),t,2)}function C0e(e){var t=e.getDay();return t===0?7:t}function A0e(e,t){return _t(Mx.count(Ds(e)-1,e),t,2)}function uq(e){var t=e.getDay();return t>=4||t===0?od(e):od.ceil(e)}function E0e(e,t){return e=uq(e),_t(od.count(Ds(e),e)+(Ds(e).getDay()===4),t,2)}function O0e(e){return e.getDay()}function _0e(e,t){return _t(tv.count(Ds(e)-1,e),t,2)}function z0e(e,t){return _t(e.getFullYear()%100,t,2)}function T0e(e,t){return e=uq(e),_t(e.getFullYear()%100,t,2)}function P0e(e,t){return _t(e.getFullYear()%1e4,t,4)}function R0e(e,t){var n=e.getDay();return e=n>=4||n===0?od(e):od.ceil(e),_t(e.getFullYear()%1e4,t,4)}function D0e(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+_t(t/60|0,"0",2)+_t(t%60,"0",2)}function aI(e,t){return _t(e.getUTCDate(),t,2)}function M0e(e,t){return _t(e.getUTCHours(),t,2)}function I0e(e,t){return _t(e.getUTCHours()%12||12,t,2)}function L0e(e,t){return _t(1+Dx.count(Ms(e),e),t,3)}function dq(e,t){return _t(e.getUTCMilliseconds(),t,3)}function $0e(e,t){return dq(e,t)+"000"}function B0e(e,t){return _t(e.getUTCMonth()+1,t,2)}function U0e(e,t){return _t(e.getUTCMinutes(),t,2)}function q0e(e,t){return _t(e.getUTCSeconds(),t,2)}function F0e(e){var t=e.getUTCDay();return t===0?7:t}function H0e(e,t){return _t(Ix.count(Ms(e)-1,e),t,2)}function fq(e){var t=e.getUTCDay();return t>=4||t===0?ld(e):ld.ceil(e)}function K0e(e,t){return e=fq(e),_t(ld.count(Ms(e),e)+(Ms(e).getUTCDay()===4),t,2)}function G0e(e){return e.getUTCDay()}function V0e(e,t){return _t(nv.count(Ms(e)-1,e),t,2)}function Q0e(e,t){return _t(e.getUTCFullYear()%100,t,2)}function W0e(e,t){return e=fq(e),_t(e.getUTCFullYear()%100,t,2)}function Y0e(e,t){return _t(e.getUTCFullYear()%1e4,t,4)}function Z0e(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ld(e):ld.ceil(e),_t(e.getUTCFullYear()%1e4,t,4)}function X0e(){return"+0000"}function sI(){return"%"}function oI(e){return+e}function lI(e){return Math.floor(+e/1e3)}var xu,hq,pq;J0e({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 J0e(e){return xu=Jxe(e),hq=xu.format,xu.parse,pq=xu.utcFormat,xu.utcParse,xu}function ebe(e){return new Date(e)}function tbe(e){return e instanceof Date?+e:+new Date(+e)}function JC(e,t,n,r,i,a,l,u,d,f){var p=$C(),m=p.invert,g=p.domain,v=f(".%L"),j=f(":%S"),b=f("%I:%M"),S=f("%I %p"),k=f("%a %d"),O=f("%b %d"),C=f("%B"),A=f("%Y");function T(E){return(d(E)<E?v:u(E)<E?j:l(E)<E?b:a(E)<E?S:r(E)<E?i(E)<E?k:O:n(E)<E?C:A)(E)}return p.invert=function(E){return new Date(m(E))},p.domain=function(E){return arguments.length?g(Array.from(E,tbe)):g().map(ebe)},p.ticks=function(E){var _=g();return e(_[0],_[_.length-1],E??10)},p.tickFormat=function(E,_){return _==null?T:f(_)},p.nice=function(E){var _=g();return(!E||typeof E.range!="function")&&(E=t(_[0],_[_.length-1],E??10)),E?g(eq(_,E)):p},p.copy=function(){return fp(p,JC(e,t,n,r,i,a,l,u,d,f))},p}function nbe(){return Zi.apply(JC(Zxe,Xxe,Ds,ZC,Mx,hp,WC,VC,Fl,hq).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function rbe(){return Zi.apply(JC(Wxe,Yxe,Ms,XC,Ix,Dx,YC,QC,Fl,pq).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(Od),f.rangeRound=p(LC),f.unknown=function(m){return arguments.length?(d=m,f):d},function(m){return a=m,n=m(e),r=m(t),i=n===r?0:1/(r-n),f}}function rl(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function mq(){var e=nl(Lx()(Rr));return e.copy=function(){return rl(e,mq())},qs.apply(e,arguments)}function gq(){var e=qC(Lx()).domain([1,10]);return e.copy=function(){return rl(e,gq()).base(e.base())},qs.apply(e,arguments)}function yq(){var e=FC(Lx());return e.copy=function(){return rl(e,yq()).constant(e.constant())},qs.apply(e,arguments)}function eA(){var e=HC(Lx());return e.copy=function(){return rl(e,eA()).exponent(e.exponent())},qs.apply(e,arguments)}function ibe(){return eA.apply(null,arguments).exponent(.5)}function vq(){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)=>Fve(e,a/r))},n.copy=function(){return vq(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,O,C;return arguments.length?([k,O,C]=S,f=gxe(b,[k,O,C]),v):[f(0),f(.5),f(1)]}}return v.range=j(Od),v.rangeRound=j(LC),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 xq(){var e=nl($x()(Rr));return e.copy=function(){return rl(e,xq())},qs.apply(e,arguments)}function bq(){var e=qC($x()).domain([.1,1,10]);return e.copy=function(){return rl(e,bq()).base(e.base())},qs.apply(e,arguments)}function wq(){var e=FC($x());return e.copy=function(){return rl(e,wq()).constant(e.constant())},qs.apply(e,arguments)}function tA(){var e=HC($x());return e.copy=function(){return rl(e,tA()).exponent(e.exponent())},qs.apply(e,arguments)}function abe(){return tA.apply(null,arguments).exponent(.5)}const jq=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:DC,scaleDiverging:xq,scaleDivergingLog:bq,scaleDivergingPow:tA,scaleDivergingSqrt:abe,scaleDivergingSymlog:wq,scaleIdentity:JU,scaleImplicit:aN,scaleLinear:XU,scaleLog:tq,scaleOrdinal:RC,scalePoint:Gve,scalePow:KC,scaleQuantile:iq,scaleQuantize:aq,scaleRadial:rq,scaleSequential:mq,scaleSequentialLog:gq,scaleSequentialPow:eA,scaleSequentialQuantile:vq,scaleSequentialSqrt:ibe,scaleSequentialSymlog:yq,scaleSqrt:$xe,scaleSymlog:nq,scaleThreshold:sq,scaleTime:nbe,scaleUtc:rbe,tickFormat:ZU},Symbol.toStringTag,{value:"Module"}));function sbe(e){var t=jq;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 cI(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=sbe(e);if(r!=null)return r.domain(t).range(n),r}}function nA(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?cI(e.scale,n,r):cI(t,n,r)}function obe(e){return"scale".concat(ep(e))}function lbe(e){return obe(e)in jq}var Sq=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string")return lbe(r)?r:"point"}};function cbe(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 Nq(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=cbe(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 ube(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):Nq(e,void 0)}function uI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uI(Object(n),!0).forEach(function(r){dbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dbe(e,t,n){return(t=fbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fbe(e){var t=hbe(e,"string");return typeof t=="symbol"?t:t+""}function hbe(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"},kq=(e,t)=>e.cartesianAxis.xAxis[t],Fs=(e,t)=>{var n=kq(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},Cq=(e,t)=>e.cartesianAxis.yAxis[t],Hs=(e,t)=>{var n=Cq(e,t);return n??Vn},pbe={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},rA=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??pbe},Lr=(e,t,n)=>{switch(t){case"xAxis":return Fs(e,n);case"yAxis":return Hs(e,n);case"zAxis":return rA(e,n);case"angleAxis":return OC(e,n);case"radiusAxis":return _C(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},mbe=(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 _C(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Aq=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function Eq(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,gbe=re([ir,Ox],Eq),Oq=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),_d=re([mp,Lr,gbe],Oq,{memoizeOptions:{resultEqualityCheck:Px}}),_q=re([_d],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(zx)),zq=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),ybe=re([_d],zq),Tq=e=>e.map(t=>t.data).filter(Boolean).flat(1),vbe=re([_d],e=>e.some(t=>!t.data)),Pq=re([_d],Tq,{memoizeOptions:{resultEqualityCheck:Px}}),Rq=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},iA=re([Pq,cp],Rq),xbe=(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})),Dq=(e,t,n,r,i,a)=>{var{chartData:l=[],dataStartIndex:u,dataEndIndex:d}=r,f=xbe(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([iA,Lr,_d,cp,vbe,Pq],Dq);function Gu(e){if(Fa(e)||e instanceof Date){var t=Number(e);if(ht(t))return t}}function dI(e){if(Array.isArray(e)){var t=[Gu(e[0]),Gu(e[1])];return $a(t)?t:void 0}var n=Gu(e);if(n!=null)return[n,n]}function Ga(e){return e.map(Gu).filter(Yr)}function bbe(e,t){var n=Gu(e),r=Gu(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var wbe=re([gp],e=>e?.map(t=>t.value).sort(bbe));function Mq(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function jbe(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=Ed(e);return pp(e,t,n)},cd=re([Zn],e=>e?.dataKey),Sbe=re([_q,cp,Zn],qU),Iq=(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:ame(e,p,n),graphicalItems:f}]}))},iv=re([Sbe,_q,kx,DU],Iq),Lq=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var l=cme(e,i,a);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},Nbe=re([Lr],e=>e.allowDataOverflow),aA=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},$q=re([Lr],aA),Bq=re([$q,Nbe],jU),kbe=re([iv,ba,ir,Bq],Lq,{memoizeOptions:{resultEqualityCheck:Tx}}),sA=e=>e.errorBars,Cbe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>Mq(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]}},Uq=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=>Mq(a,v));m.forEach(v=>{var j,b=vn(v,(j=n.dataKey)!==null&&j!==void 0?j:f.dataKey),S=jbe(v,b,g);if(S.length>=2){var k=Math.min(...S),O=Math.max(...S);(u==null||k<u)&&(u=k),(d==null||O>d)&&(d=O)}var C=dI(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=dI(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]},Abe=re([iA,Lr,ybe,sA,ir,pve],Uq,{memoizeOptions:{resultEqualityCheck:Tx}});function Ebe(e){var{value:t}=e;if(Fa(t)||t instanceof Date)return t}var Obe=(e,t,n)=>{var r=e.map(Ebe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&ZB(r))?bU(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},qq=e=>e.referenceElements.dots,zd=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),_be=re([qq,ir,Ox],zd),Fq=e=>e.referenceElements.areas,zbe=re([Fq,ir,Ox],zd),Hq=e=>e.referenceElements.lines,Tbe=re([Hq,ir,Ox],zd),Kq=(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)]}},Pbe=re(_be,ir,Kq),Gq=(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)]}},Rbe=re([zbe,ir],Gq);function Dbe(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 Mbe(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 Vq=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?Dbe(r):Mbe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Ibe=re([Tbe,ir],Vq),Lbe=re(Pbe,Ibe,Rbe,(e,t,n)=>av(e,n,t)),Qq=(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 gve(t,f,e.allowDataOverflow)},$be=re([Lr,$q,Bq,kbe,Abe,Lbe,zt,ir],Qq,{memoizeOptions:{resultEqualityCheck:Tx}}),Bbe=[0,1],Wq=(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 bU(0,(p=n?.length)!==null&&p!==void 0?p:0)}return d==="category"?Obe(r,e,f):i==="expand"&&!f?Bbe:l}},oA=re([Lr,zt,iA,gp,kx,ir,$be],Wq),Td=re([Lr,Aq,CC],Sq),Yq=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=aA(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&$a(e)){if(a)return wM(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return jM(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&$a(e))return wM(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&$a(e))return jM(e,t.tickCount,t.allowDecimals,"adaptive")}}},lA=re([oA,pp,Td],Yq),Zq=(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},Ube=re([Lr,oA,lA,ir],Zq),qbe=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}}),Xq=re(qbe,zt,RU,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}),Fbe=(e,t,n)=>{var r=Fs(e,t);return r==null||typeof r.padding!="string"?0:Xq(e,"xAxis",t,n,r.padding)},Hbe=(e,t,n)=>{var r=Hs(e,t);return r==null||typeof r.padding!="string"?0:Xq(e,"yAxis",t,n,r.padding)},Kbe=re(Fs,Fbe,(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}}),Gbe=re(Hs,Hbe,(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}}),Vbe=re([nr,Kbe,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]}),Qbe=re([nr,zt,Gbe,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 Vbe(e,n,r);case"yAxis":return Qbe(e,n,r);case"zAxis":return(i=rA(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return $U(e);case"radiusAxis":return BU(e,n);default:return}},Jq=re([Lr,yp],Cx),Wbe=re([Td,Ube],zve),cA=re([Lr,Td,Wbe,Jq],nA),e8=(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)}},uA=re([zt,gp,pp,ir],e8),Bx=re([cA],TC);re([cA],ube);re([cA,wbe],Nq);re([_d,sA,ir],Cbe);function t8(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Ux=(e,t)=>t,qx=(e,t,n)=>n,Ybe=re(yx,Ux,qx,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(t8)),Zbe=re(vx,Ux,qx,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(t8)),n8=(e,t)=>({width:e.width,height:t.height}),Xbe=(e,t)=>{var n=typeof t.width=="number"?t.width:rp;return{width:n,height:e.height}},r8=re(nr,Fs,n8),Jbe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},ewe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},twe=re(Us,nr,Ybe,Ux,qx,(e,t,n,r,i)=>{var a={},l;return n.forEach(u=>{var d=n8(t,u);l==null&&(l=Jbe(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}),nwe=re(Bs,nr,Zbe,Ux,qx,(e,t,n,r,i)=>{var a={},l;return n.forEach(u=>{var d=Xbe(t,u);l==null&&(l=ewe(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}),rwe=(e,t)=>{var n=Fs(e,t);if(n!=null)return twe(e,n.orientation,n.mirror)},iwe=re([nr,Fs,rwe,(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}}}),awe=(e,t)=>{var n=Hs(e,t);if(n!=null)return nwe(e,n.orientation,n.mirror)},swe=re([nr,Hs,awe,(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}}}),i8=re(nr,Hs,(e,t)=>{var n=typeof t.width=="number"?t.width:rp;return{width:n,height:e.height}}),fI=(e,t,n)=>{switch(t){case"xAxis":return r8(e,n).width;case"yAxis":return i8(e,n).height;default:return}},a8=(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&&ZB(f))return d}},dA=re([zt,gp,Lr,ir],a8),hI=re([zt,mbe,Td,Bx,dA,uA,yp,lA,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}}}),owe=(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 O=l?l.indexOf(S):S,C=r.map(O);return ht(C)?{index:k,coordinate:C+j,value:S,offset:j}:null}).filter(Yr):f&&u?u.map((S,k)=>{var O=r.map(S);return ht(O)?{coordinate:O+j,value:S,index:k,offset:j}:null}).filter(Yr):r.ticks?r.ticks(g).map((S,k)=>{var O=r.map(S);return ht(O)?{coordinate:O+j,value:S,index:k,offset:j}:null}).filter(Yr):r.domain().map((S,k)=>{var O=r.map(S);return ht(O)?{coordinate:O+j,value:l?l[S]:S,index:k,offset:j}:null}).filter(Yr)}},s8=re([zt,pp,Td,Bx,lA,yp,dA,uA,ir],owe),lwe=(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([zt,pp,Bx,yp,dA,uA,ir],lwe),Qa=re(Lr,Bx,(e,t)=>{if(!(e==null||t==null))return rv(rv({},e),{},{scale:t})}),cwe=re([Lr,Td,oA,Jq],nA),uwe=re([cwe],TC);re((e,t,n)=>rA(e,n),uwe,(e,t)=>{if(!(e==null||t==null))return rv(rv({},e),{},{scale:t})});var dwe=re([zt,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}}),fwe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};re([fwe],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 o8=e=>e.options.defaultTooltipEventType,l8=e=>e.options.validateTooltipEventTypes;function c8(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=o8(e),r=l8(e);return c8(t,n,r)}function hwe(e){return Ue(t=>vp(t,e))}var u8=(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},pwe=e=>e.tooltip.settings,zo={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},mwe={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}},d8=Er({name:"tooltip",initialState:mwe,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:gwe,replaceTooltipEntrySettings:ywe,removeTooltipEntrySettings:vwe,setTooltipSettingsState:xwe,setActiveMouseOverItemIndex:f8,mouseLeaveItem:bwe,mouseLeaveChart:h8,setActiveClickItemIndex:wwe,setMouseOverAxisIndex:p8,setMouseClickAxisIndex:jwe,setSyncInteraction:nh,setKeyboardInteraction:sv}=d8.actions,Swe=d8.reducer;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 jg(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){Nwe(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 Nwe(e,t,n){return(t=kwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kwe(e){var t=Cwe(e,"string");return typeof t=="symbol"?t:t+""}function Cwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Awe(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Ewe(e){return e.index!=null}var m8=(e,t,n,r)=>{if(t==null)return zo;var i=Awe(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(Ewe(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 Owe(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 _we(e,t){var n=Owe(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 zwe(e,t,n){if(n==null||t==null)return!0;var r=vn(e,t);return r==null||!$a(n)?!0:_we(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||zwe(f,n,r)?String(d):null},g8=(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}}},y8=(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})},v8=e=>e.options.tooltipPayloadSearcher,Pd=e=>e.tooltip;function mI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mI(Object(n),!0).forEach(function(r){Twe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Twe(e,t,n){return(t=Pwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pwe(e){var t=Rwe(e,"string");return typeof t=="symbol"?t:t+""}function Rwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dwe(e){if(typeof e=="string"||typeof e=="number")return e}function Mwe(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Iwe(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function yI(e){if(typeof e=="string")return e}function Lwe(e){if(!(e==null||typeof e!="object")){var t="name"in e?Dwe(e.name):void 0,n="unit"in e?Mwe(e.unit):void 0,r="dataKey"in e?Iwe(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?yI(e.color):void 0,l="fill"in e?yI(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:l}}}function $we(e,t){return e??t}var x8=(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=$we(b,u),O=Array.isArray(k)?G6(k,f,p):k,C=(j=S?.dataKey)!==null&&j!==void 0?j:r,A=S?.nameKey,T;if(r&&Array.isArray(O)&&!Array.isArray(O[0])&&l==="axis"?T=XB(O,r,i):T=a(O,t,d,A),Array.isArray(T))T.forEach(_=>{var P,$,F=Lwe(_),U=F?.name,B=F?.dataKey,V=F?.payload,X=gI(gI({},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(cD({tooltipEntrySettings:X,dataKey:B,payload:V,value:vn(V,B),name:U==null?void 0:String(U)}))});else{var E;g.push(cD({tooltipEntrySettings:S,dataKey:C,payload:T,value:vn(T,C),name:(E=vn(T,A))!==null&&E!==void 0?E:S?.name}))}return g},m)}},fA=re([Zn,Aq,CC],Sq),Bwe=re([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Uwe=re([ar,Ed],Eq),Ec=re([Bwe,Zn,Uwe],Oq,{memoizeOptions:{resultEqualityCheck:Px}}),qwe=re([Ec],e=>e.filter(zx)),b8=re([Ec],Tq,{memoizeOptions:{resultEqualityCheck:Px}}),Fwe=re([Ec],e=>e.some(t=>!t.data)),hc=re([b8,ba],Rq),Hwe=re([qwe,ba,Zn],qU),hA=re([hc,Zn,Ec,ba,Fwe,b8],Dq),w8=re([Zn],aA),Kwe=re([Zn],e=>e.allowDataOverflow),j8=re([w8,Kwe],jU),Gwe=re([Ec],e=>e.filter(zx)),Vwe=re([Hwe,Gwe,kx,DU],Iq),Qwe=re([Vwe,ba,ar,j8],Lq),Wwe=re([Ec],zq),Ywe=re([hc,Zn,Wwe,sA,ar,mve],Uq,{memoizeOptions:{resultEqualityCheck:Tx}}),Zwe=re([qq,ar,Ed],zd),Xwe=re([Zwe,ar],Kq),Jwe=re([Fq,ar,Ed],zd),eje=re([Jwe,ar],Gq),tje=re([Hq,ar,Ed],zd),nje=re([tje,ar],Vq),rje=re([Xwe,nje,eje],av),ije=re([Zn,w8,j8,Qwe,Ywe,rje,zt,ar],Qq),ud=re([Zn,zt,hc,hA,kx,ar,ije],Wq),aje=re([ud,Zn,fA],Yq),sje=re([Zn,ud,aje,ar],Zq),S8=e=>{var t=ar(e),n=Ed(e),r=!1;return yp(e,t,n,r)},N8=re([Zn,S8],Cx),oje=re([Zn,fA,sje,N8],nA),k8=re([oje],TC),lje=re([zt,hA,Zn,ar],a8),cje=re([zt,hA,Zn,ar],e8),uje=(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([zt,Zn,fA,k8,S8,lje,cje,ar],uje),pA=re([o8,l8,pwe],(e,t,n)=>c8(n.shared,e,t)),C8=e=>e.tooltip.settings.trigger,mA=e=>e.tooltip.settings.defaultIndex,xp=re([Pd,pA,C8,mA],m8),pc=re([xp,hc,cd,ud],hh),A8=re([Ks,pc],u8),E8=re([xp],e=>{if(e)return e.dataKey}),dje=re([xp],e=>{if(e)return e.graphicalItemId}),O8=re([Pd,pA,C8,mA],y8),fje=re([Bs,Us,zt,nr,Ks,mA,O8],g8),hje=re([xp,fje],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),pje=re([xp],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),mje=re([O8,pc,ba,cd,A8,v8,pA],x8),gje=re([mje],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function vI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vI(Object(n),!0).forEach(function(r){yje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yje(e,t,n){return(t=vje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vje(e){var t=xje(e,"string");return typeof t=="symbol"?t:t+""}function xje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bje=()=>Ue(Zn),wje=()=>{var e=bje(),t=Ue(Ks),n=Ue(k8);return Go(!e||!n?void 0:xI(xI({},e),{},{scale:n}),t)};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 bu(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){jje(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 jje(e,t,n){return(t=Sje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sje(e){var t=Nje(e,"string");return typeof t=="symbol"?t:t+""}function Nje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kje=(e,t,n,r)=>{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},Cje=(e,t,n,r)=>{var i=t.find(f=>f&&f.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:l}=r;return bu(bu(bu({},r),mr(r.cx,r.cy,l,a)),{},{angle:a,radius:l})}var u=i.coordinate,{angle:d}=r;return bu(bu(bu({},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 Aje(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 _8=(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 O=j+i[1]-i[0];k[0]=Math.min(O,(O+v)/2),k[1]=Math.max(O,(O+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 E=Math.min(v,b),_=Math.max(v,b);if(e>(E+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},z8=()=>Ue(CC),gA=(e,t)=>t,T8=(e,t,n)=>n,yA=(e,t,n,r)=>r,Eje=re(Ks,e=>ox(e,t=>t.coordinate)),vA=re([Pd,gA,T8,yA],m8),xA=re([vA,hc,cd,ud],hh),Oje=(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}},P8=re([Pd,gA,T8,yA],y8),ov=re([Bs,Us,zt,nr,Ks,yA,P8],g8),_je=re([vA,ov],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),R8=re([Ks,xA],u8),zje=re([P8,xA,ba,cd,R8,v8,gA],x8),Tje=re([vA,xA],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Pje=(e,t,n,r,i,a,l)=>{if(!(!e||!n||!r||!i)&&Aje(e,l)){var u=ume(e,t),d=_8(u,a,i,n,r),f=kje(t,i,d,e);return{activeIndex:String(d),activeCoordinate:f}}},Rje=(e,t,n,r,i,a,l)=>{if(!(!e||!r||!i||!a||!n)){var u=ive(e,n);if(u){var d=dme(u,t),f=_8(d,l,a,r,i),p=Cje(t,a,f,u);return{activeIndex:String(f),activeCoordinate:p}}}},Dje=(e,t,n,r,i,a,l,u)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?Pje(e,t,r,i,a,l,u):Rje(e,t,n,r,i,a,l)},Mje=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}}),Ije=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:_ve}});function wI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wI(Object(n),!0).forEach(function(r){Lje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lje(e,t,n){return(t=$je(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $je(e){var t=Bje(e,"string");return typeof t=="symbol"?t:t+""}function Bje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Uje={},qje={zIndexMap:Object.values(Wn).reduce((e,t)=>jI(jI({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Uje)},Fje=new Set(Object.values(Wn));function Hje(e){return Fje.has(e)}var D8=Er({name:"zIndex",initialState:qje,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&&!Hje(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:Kje,unregisterZIndexPortal:gS,registerZIndexPortalElement:Gje,unregisterZIndexPortalElement:Vje}=D8.actions,Qje=D8.reducer;function bi(e){var{zIndex:t,children:n}=e,r=Hme(),i=r&&t!==void 0&&t!==0,a=rr(),l=x.useRef(void 0),u=x.useRef(new Set),d=ln(),f=Ue(m=>Mje(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(Kje({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?vc.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 SI(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?SI(Object(n),!0).forEach(function(r){Wje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wje(e,t,n){return(t=Yje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yje(e){var t=Zje(e,"string");return typeof t=="symbol"?t:t+""}function Zje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xje(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function Jje(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=vye,S=Wn.cursorLine;else if(p==="BarChart")j=xye(u,m,a,l),b=gU,S=Wn.cursorRectangle;else if(u==="radial"&&e6(m)){var{cx:k,cy:O,radius:C,startAngle:A,endAngle:T}=yU(m);j={cx:k,cy:O,startAngle:A,endAngle:T,innerRadius:C,outerRadius:C},b=xU,S=Wn.cursorLine}else j={points:lve(u,m,a)},b=fh,S=Wn.cursorLine;var E=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",E)});return x.createElement(bi,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:S},x.createElement(Xje,{cursor:d,cursorComp:b,cursorProps:_}))}function eSe(e){var t=wje(),n=eU(),r=tl(),i=z8();return t==null||n==null||r==null||i==null?null:x.createElement(Jje,uN({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var M8=x.createContext(null),tSe=()=>x.useContext(M8),yS={exports:{}},NI;function nSe(){return NI||(NI=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,O,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,O=new Array(k-1);C<k;C++)O[C-1]=arguments[C];S.fn.apply(S.context,O)}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(!O)for(T=1,O=new Array(k-1);T<k;T++)O[T-1]=arguments[T];S[C].fn.apply(S[C].context,O)}}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 rSe=nSe();const iSe=ma(rSe);var Bh=new iSe,dN="recharts.syncEvent.tooltip",kI="recharts.syncEvent.brush",bA=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!fa(n))return e[n]}},aSe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},I8=Er({name:"options",initialState:aSe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),sSe=I8.reducer,{createEventEmitter:oSe}=I8.actions;function lSe(e){return e.tooltip.syncInteraction}var cSe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},L8=Er({name:"chartData",initialState:cSe,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:CI,setDataStartEndIndexes:uSe,setComputedData:gze}=L8.actions,dSe=L8.reducer,fSe=["x","y"];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 wu(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){hSe(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 hSe(e,t,n){return(t=pSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pSe(e){var t=mSe(e,"string");return typeof t=="symbol"?t:t+""}function mSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gSe(e,t){if(e==null)return{};var n,r,i=ySe(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 ySe(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 vSe(){var e=Ue(AC),t=Ue(EC),n=ln(),r=Ue(MU),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=gSe(v,fSe),{x:k,y:O,width:C,height:A}=p.payload.sourceViewBox,T=wu(wu({},S),{},{x:l.x+(C?(j-k)/C:0)*l.width,y:l.y+(A?(b-O)/A:0)*l.height});n(wu(wu({},p),{},{payload:wu(wu({},p.payload),{},{coordinate:T})}))}else n(p);return}if(i!=null){var E;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,_);E=i[P]}else r==="value"&&(E=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(E==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"?E.coordinate:B,y:a==="horizontal"?V:E.coordinate},Z=nh({active:p.payload.active,coordinate:X,dataKey:p.payload.dataKey,index:String(E.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 xSe(){var e=Ue(AC),t=Ue(EC),n=ln();x.useEffect(()=>{if(e==null)return el;var r=(i,a,l)=>{t!==l&&e===i&&n(uSe(a))};return Bh.on(kI,r),()=>{Bh.off(kI,r)}},[n,t,e])}function bSe(){var e=ln();x.useEffect(()=>{e(oSe())},[e]),vSe(),xSe()}function wSe(e,t,n,r,i,a){var l=Ue(j=>Oje(j,e,t)),u=Ue(dje),d=Ue(EC),f=Ue(AC),p=Ue(MU),m=Ue(lSe),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 EI(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?EI(Object(n),!0).forEach(function(r){jSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jSe(e,t,n){return(t=SSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SSe(e){var t=NSe(e,"string");return typeof t=="symbol"?t:t+""}function NSe(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 kSe(e){return e.dataKey}function CSe(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(Vge,t)}var _I=[],ASe={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 Is(e){var t,n,r=tr(e,ASe),{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:O,trigger:C,defaultIndex:A,portal:T,axisId:E}=r,_=ln(),P=typeof A=="number"?String(A):A;x.useEffect(()=>{_(xwe({shared:O,trigger:C,axisId:E,active:i,defaultIndex:P}))},[_,O,C,E,i,P]);var $=wx(),F=dU(),U=hwe(O),{activeIndex:B,isActive:V}=(t=Ue(Se=>Tje(Se,U,C,P)))!==null&&t!==void 0?t:{},X=Ue(Se=>zje(Se,U,C,P)),Z=Ue(Se=>R8(Se,U,C,P)),H=Ue(Se=>_je(Se,U,C,P)),J=X,oe=tSe(),ye=(n=i??V)!==null&&n!==void 0?n:!1,[I,M]=g6([J,ye]),q=U==="axis"?Z:void 0;wSe(U,C,H,q,B,ye);var D=T??oe;if(D==null||$==null||U==null)return null;var G=J??_I;ye||(G=_I),f&&G.length&&(G=d6(G.filter(Se=>Se.value!=null&&(Se.hide!==!0||r.includeHidden)),g,kSe));var se=G.length>0,ne=OI(OI({},r),{},{payload:G,label:q,active:ye,activeIndex:B,coordinate:H,accessibilityLayer:F}),Ce=x.createElement(iye,{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},CSe(d,ne));return x.createElement(x.Fragment,null,vc.createPortal(Ce,D),ye&&x.createElement(eSe,{cursor:k,tooltipEventType:U,coordinate:H,payload:G,index:B}))}var lv=e=>null;lv.displayName="Cell";function ESe(e,t,n){return(t=OSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OSe(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)}class zSe{constructor(t){ESe(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 zI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function TSe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zI(Object(n),!0).forEach(function(r){PSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PSe(e,t,n){return(t=RSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RSe(e){var t=DSe(e,"string");return typeof t=="symbol"?t:t+""}function DSe(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 MSe={cacheSize:2e3,enableCache:!0},$8=TSe({},MSe),TI=new zSe($8.cacheSize),ISe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},PI="recharts_measurement_span";function LSe(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 RI=(e,t)=>{try{var n=document.getElementById(PI);n||(n=document.createElement("span"),n.setAttribute("id",PI),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,ISe,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(!$8.enableCache)return RI(t,n);var r=LSe(t,n),i=TI.get(r);if(i)return i;var a=RI(t,n);return TI.set(r,a),a},B8;function $Se(e,t,n){return(t=BSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BSe(e){var t=USe(e,"string");return typeof t=="symbol"?t:t+""}function USe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var DI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,MI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,qSe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,FSe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,HSe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},KSe=["cm","mm","pt","pc","in","Q","px"];function GSe(e){return KSe.includes(e)}var Ru="NaN";function VSe(e,t){return e*HSe[t]}class fr{static parse(t){var n,[,r,i]=(n=FSe.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!==""&&!qSe.test(n)&&(this.num=NaN,this.unit=""),GSe(n)&&(this.num=VSe(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)}}B8=fr;$Se(fr,"NaN",new B8(NaN,""));function U8(e){if(e==null||e.includes(Ru))return Ru;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=DI.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 Ru;t=t.replace(DI,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,p,m,g]=(f=MI.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 Ru;t=t.replace(MI,b.toString())}return t}var II=/\(([^()]*)\)/;function QSe(e){for(var t=e,n;(n=II.exec(t))!=null;){var[,r]=n;t=t.replace(II,U8(r))}return t}function WSe(e){var t=e.replace(/\s+/g,"");return t=QSe(t),t=U8(t),t}function YSe(e){try{return WSe(e)}catch{return Ru}}function vS(e){var t=YSe(e.slice(5,-1));return t===Ru?"":t}var ZSe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],XSe=["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 LI(e,t){if(e==null)return{};var n,r,i=JSe(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 JSe(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 q8=/[ \f\n\r\t\v\u2028\u2029]+/,F8=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];on(t)||(n?i=t.toString().split(""):i=t.toString().split(q8));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 H8(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function e1e(e){return on(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var K8=(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},[]),G8=e=>e.reduce((t,n)=>t.width>n.width?t:n),t1e="…",$I=(e,t,n,r,i,a,l,u)=>{var d=e.slice(0,t),f=F8({breakAll:n,style:r,children:d+t1e});if(!f)return[!1,[]];var p=K8(f.wordsWithComputedWidth,a,l,u),m=p.length>i||G8(p).width>Number(a);return[m,p]},n1e=(e,t,n,r,i)=>{var{maxLines:a,children:l,style:u,breakAll:d}=e,f=Te(a),p=String(l),m=K8(t,r,n,i);if(!f||i)return m;var g=m.length>a||G8(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),O=k-1,[C,A]=$I(p,O,d,u,a,r,n,i),[T]=$I(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},BI=e=>{var t=on(e)?[]:e.toString().split(q8);return[{words:t,width:void 0}]},r1e=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:l}=e;if((t||n)&&!sp.isSsr){var u,d,f=F8({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:p,spaceWidth:m}=f;u=p,d=m}else return BI(r);return n1e({breakAll:a,children:r,maxLines:l,style:i},u,d,t,!!n)}return BI(r)},V8="#808080",i1e={angle:0,breakAll:!1,capHeight:"0.71em",fill:V8,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},wA=x.forwardRef((e,t)=>{var n=tr(e,i1e),{x:r,y:i,lineHeight:a,capHeight:l,fill:u,scaleToFit:d,textAnchor:f,verticalAnchor:p}=n,m=LI(n,ZSe),g=x.useMemo(()=>r1e({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,O=LI(m,XSe);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 E=[],_=g[0];if(d&&_!=null){var P=_.width,{width:$}=m;E.push("scale(".concat(Te($)&&Te(P)?$/P:1,")"))}return b&&E.push("rotate(".concat(b,", ").concat(C,", ").concat(A,")")),E.length&&(O.transform=E.join(" ")),x.createElement("text",fN({},kr(O),{ref:t,x:C,y:A,className:Ot("recharts-text",S),textAnchor:f,fill:u.includes("url")?V8: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)}))});wA.displayName="Text";function UI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _a(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UI(Object(n),!0).forEach(function(r){a1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function a1e(e,t,n){return(t=s1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s1e(e){var t=o1e(e,"string");return typeof t=="symbol"?t:t+""}function o1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var l1e=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:l,height:u,upperWidth:d,lowerWidth:f}=gC(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",O=b>0?"start":"end",C=d>=0?1:-1,A=C*r,T=C>0?"end":"start",E=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:O};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:E,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:E,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:O},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:E,verticalAnchor:O},B):n==="insideTopRight"?_a({x:p+d-A,y:l+S,horizontalAnchor:T,verticalAnchor:O},B):n==="insideBottomLeft"?_a({x:m+A,y:l+u-S,horizontalAnchor:E,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)||lc(n.x))&&(Te(n.y)||lc(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)},c1e=["labelRef"],u1e=["content"];function qI(e,t){if(e==null)return{};var n,r,i=d1e(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 d1e(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 FI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FI(Object(n),!0).forEach(function(r){f1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function f1e(e,t,n){return(t=h1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h1e(e){var t=p1e(e,"string");return typeof t=="symbol"?t:t+""}function p1e(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 Ss(){return Ss=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},Ss.apply(null,arguments)}var Q8=x.createContext(null),m1e=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(Q8.Provider,{value:d},u)},W8=()=>{var e=x.useContext(Q8),t=wx();return e||(t?gC(t):void 0)},g1e=x.createContext(null),y1e=()=>{var e=x.useContext(g1e),t=Ue(UU);return e||t},v1e=e=>{var{value:t,formatter:n}=e,r=on(e.children)?t:e.children;return typeof n=="function"?n(r):r},jA=e=>e!=null&&typeof e=="function",x1e=(e,t)=>{var n=Wr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},b1e=(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=x1e(m,g),S=b>=0?1:-1,k,O;switch(t){case"insideStart":k=m+S*a,O=v;break;case"insideEnd":k=g-S*a,O=!v;break;case"end":k=g+S*a,O=v;break;default:throw new Error("Unsupported position ".concat(t))}O=b<=0?O:!O;var C=mr(u,d,j,k),A=mr(u,d,j,k+(O?1:-1)*359),T="M".concat(C.x,",").concat(C.y,`
288
- A`).concat(j,",").concat(j,",0,1,").concat(O?0:1,`,
289
- `).concat(A.x,",").concat(A.y),E=on(e.id)?Ah("recharts-radial-line-"):e.id;return x.createElement("text",Ss({},r,{dominantBaseline:"central",className:Ot("recharts-radial-bar-label",l)}),x.createElement("defs",null,x.createElement("path",{id:E,d:T})),x.createElement("textPath",{xlinkHref:"#".concat(E)},n))},w1e=(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),j1e={angle:0,offset:5,zIndex:Wn.label,position:"middle",textBreakAll:!1};function S1e(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 Oo(e){var t=tr(e,j1e),{viewBox:n,parentViewBox:r,position:i,value:a,children:l,content:u,className:d="",textBreakAll:f,labelRef:p}=t,m=y1e(),g=W8(),v=i==="center"?g:m??g,j,b,S;n==null?j=v:Kg(n)?j=n:j=gC(n);var k=S1e(j);if(!j||on(a)&&on(l)&&!x.isValidElement(u)&&typeof u!="function")return null;var O=rh(rh({},t),{},{viewBox:j});if(x.isValidElement(u)){var{labelRef:C}=O,A=qI(O,c1e);return x.cloneElement(u,A)}if(typeof u=="function"){var{content:T}=O,E=qI(O,u1e);if(b=x.createElement(u,E),x.isValidElement(b))return b}else b=v1e(t);var _=kr(t);if(Kg(j)){if(i==="insideStart"||i==="insideEnd"||i==="end")return b1e(t,i,b,_,j);S=w1e(j,t.offset,t.position)}else{if(!k)return null;var P=l1e({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(wA,Ss({ref:p,className:Ot("recharts-label",d)},_,S,{textAnchor:H8(_.textAnchor)?_.textAnchor:S.textAnchor,breakAll:f}),b))}Oo.displayName="Label";var N1e=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(Oo,Ss({key:"label-implicit"},r)):Fa(e)?x.createElement(Oo,Ss({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===Oo?x.cloneElement(e,rh({key:"label-implicit"},r)):x.createElement(Oo,Ss({key:"label-implicit",content:e},r)):jA(e)?x.createElement(Oo,Ss({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(Oo,Ss({},e,{key:"label-implicit"},r)):null};function k1e(e){var{label:t,labelRef:n}=e,r=W8();return N1e(t,r,n)||null}var C1e=["valueAccessor"],A1e=["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 HI(e,t){if(e==null)return{};var n,r,i=E1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function E1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var O1e=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(e1e(t))return t},Y8=x.createContext(void 0),SA=Y8.Provider,Z8=x.createContext(void 0);Z8.Provider;function _1e(){return x.useContext(Y8)}function z1e(){return x.useContext(Z8)}function Gg(e){var{valueAccessor:t=O1e}=e,n=HI(e,C1e),{dataKey:r,clockWise:i,id:a,textBreakAll:l,zIndex:u}=n,d=HI(n,A1e),f=_1e(),p=z1e(),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(Oo,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 NA(e){var{label:t}=e;return t?t===!0?x.createElement(Gg,{key:"labelList-implicit"}):x.isValidElement(t)||jA(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 X8=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),aC(e),{className:a,cx:t,cy:n,r})):null},T1e={radiusAxis:{},angleAxis:{}},J8=Er({name:"polarAxis",initialState:T1e,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:yze,removeRadiusAxis:vze,addAngleAxis:xze,removeAngleAxis:bze}=J8.actions,P1e=J8.reducer;function R1e(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var xS={exports:{}},qt={};var KI;function D1e(){if(KI)return qt;KI=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 GI;function M1e(){return GI||(GI=1,xS.exports=D1e()),xS.exports}var I1e=M1e(),VI=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",QI=null,bS=null,eF=e=>{if(e===QI&&Array.isArray(bS))return bS;var t=[];return x.Children.forEach(e,n=>{on(n)||(I1e.isFragment(n)?t=t.concat(eF(n.props.children)):t.push(n))}),bS=t,QI=e,t};function L1e(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>VI(i)):r=[VI(t)],eF(e).forEach(i=>{var a=nd(i,"type.displayName")||nd(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var kA=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,wS={},WI;function $1e(){return WI||(WI=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,YI;function B1e(){return YI||(YI=1,jS=$1e().isPlainObject),jS}var U1e=B1e();const q1e=ma(U1e);var ZI,XI,JI,eL,tL;function nL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nL(Object(n),!0).forEach(function(r){F1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function F1e(e,t,n){return(t=H1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H1e(e){var t=K1e(e,"string");return typeof t=="symbol"?t:t+""}function K1e(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 iL=(e,t,n,r,i)=>{var a=n-r,l;return l=kn(ZI||(ZI=Wf(["M ",",",""])),e,t),l+=kn(XI||(XI=Wf(["L ",",",""])),e+n,t),l+=kn(JI||(JI=Wf(["L ",",",""])),e+n-a/2,t+i),l+=kn(eL||(eL=Wf(["L ",",",""])),e+n-a/2-r,t+i),l+=kn(tL||(tL=Wf(["L ",","," Z"])),e,t),l},G1e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},V1e=e=>{var t=tr(e,G1e),{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),O=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:iL(n,r,i,a,l)})));var E=b.current,_=S.current,P=k.current,$=O.current,F=C.current,U="0px ".concat(v===-1?1:v,"px"),B="".concat(v,"px ").concat(v,"px"),V=fU(["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(E,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,O.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:iL(oe,ye,Z,H,J),ref:g,style:rL(rL({},I),t.style)}))})},Q1e=["option","shapeType","activeClassName","inActiveClassName"];function W1e(e,t){if(e==null)return{};var n,r,i=Y1e(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 Y1e(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 aL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aL(Object(n),!0).forEach(function(r){Z1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Z1e(e,t,n){return(t=X1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X1e(e){var t=J1e(e,"string");return typeof t=="symbol"?t:t+""}function J1e(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 eNe(e,t){return dv(dv({},t),e)}function tNe(e,t){return e==="symbols"}function sL(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return x.createElement(gU,n);case"trapezoid":return x.createElement(V1e,n);case"sector":return x.createElement(xU,n);case"symbols":if(tNe(t))return x.createElement(iC,n);break;case"curve":return x.createElement(fh,n);default:return null}}function nNe(e){return x.isValidElement(e)?e.props:e}function tF(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=W1e(e,Q1e),l;if(x.isValidElement(t))l=x.cloneElement(t,dv(dv({},a),nNe(t)));else if(typeof t=="function")l=t(a,a.index);else if(q1e(t)&&typeof t!="boolean"){var u=eNe(t,a);l=x.createElement(sL,{shapeType:n,elementProps:u})}else{var d=a;l=x.createElement(sL,{shapeType:n,elementProps:d})}return a.isActive?x.createElement(gr,{className:r},l):x.createElement(gr,{className:i},l)}var nF=(e,t,n)=>{var r=ln();return(i,a)=>l=>{e?.(i,a,l),r(f8({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},rF=e=>{var t=ln();return(n,r)=>i=>{e?.(n,r,i),t(bwe())}},iF=(e,t,n)=>{var r=ln();return(i,a)=>l=>{e?.(i,a,l),r(wwe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function CA(e){var{tooltipEntrySettings:t}=e,n=ln(),r=rr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(gwe(t)):i.current!==t&&n(ywe({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(vwe(i.current)),i.current=null)},[n]),null}function AA(e){var{legendPayload:t}=e,n=ln(),r=rr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(ige(t)):i.current!==t&&n(age({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(sge(i.current)),i.current=null)},[n]),null}var SS,rNe=()=>{var[e]=x.useState(()=>Ah("uid-"));return e},iNe=(SS=bv.useId)!==null&&SS!==void 0?SS:rNe;function aNe(e,t){var n=iNe();return t||(e?"".concat(e,"-").concat(n):n)}var sNe=x.createContext(void 0),EA=e=>{var{id:t,type:n,children:r}=e,i=aNe("recharts-".concat(n),t);return x.createElement(sNe.Provider,{value:i},r(i))},oNe={cartesianItems:[],polarItems:[]},aF=Er({name:"graphicalItems",initialState:oNe,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:lNe,replaceCartesianGraphicalItem:cNe,removeCartesianGraphicalItem:uNe,addPolarGraphicalItem:wze,removePolarGraphicalItem:jze,replacePolarGraphicalItem:Sze}=aF.actions,dNe=aF.reducer,fNe=e=>{var t=ln(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(lNe(e)):n.current!==e&&t(cNe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(uNe(n.current)),n.current=null)},[t]),null},OA=x.memo(fNe),hNe=["points"];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 NS(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){pNe(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 pNe(e,t,n){return(t=mNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mNe(e){var t=gNe(e,"string");return typeof t=="symbol"?t:t+""}function gNe(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 yNe(e,t){if(e==null)return{};var n,r,i=vNe(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 vNe(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 xNe(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=yNe(a,hNe);return x.createElement(X8,fv({},u,{className:i}))}function bNe(e,t){return e==null?!1:t?!0:e.length===1}function sF(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:l,needClip:u,clipPathId:d,zIndex:f=Wn.scatter}=e;if(!bNe(t,n))return null;var p=kA(n),m=Kde(n),g=t.map((j,b)=>{var S,k,O=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(xNe,{key:"dot-".concat(b),option:n,dotProps:O,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 lL(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?lL(Object(n),!0).forEach(function(r){wNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wNe(e,t,n){return(t=jNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jNe(e){var t=SNe(e,"string");return typeof t=="symbol"?t:t+""}function SNe(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 oF=0,NNe={xAxis:{},yAxis:{},zAxis:{}},lF=Er({name:"cartesianAxis",initialState:NNe,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]=cL(cL({},i),{},{width:r,widthHistory:u})}}}}),{addXAxis:kNe,replaceXAxis:CNe,removeXAxis:ANe,addYAxis:ENe,replaceYAxis:ONe,removeYAxis:_Ne,addZAxis:Nze,replaceZAxis:kze,removeZAxis:Cze,updateYAxisWidth:zNe}=lF.actions,TNe=lF.reducer,PNe=re([nr],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),RNe=re([PNe,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(RNe),DNe=()=>Ue(gje);function uL(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?uL(Object(n),!0).forEach(function(r){MNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MNe(e,t,n){return(t=INe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function INe(e){var t=LNe(e,"string");return typeof t=="symbol"?t:t+""}function LNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $Ne=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)),aC(i)),f;return x.isValidElement(i)?f=x.cloneElement(i,d):typeof i=="function"?f=i(d):f=x.createElement(X8,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(pc),d=DNe();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($Ne,{point:f,childIndex:Number(u),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var dL=(e,t,n)=>{var r=n??e;if(!on(r))return ha(r,t,0)},BNe=(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=dL(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=dL(t,n,f.barSize);return{stackId:void 0,dataKeys:p,barSize:m}});return[...u,...d]};function fL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ng(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fL(Object(n),!0).forEach(function(r){UNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function UNe(e,t,n){return(t=qNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qNe(e){var t=FNe(e,"string");return typeof t=="symbol"?t:t+""}function FNe(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 HNe(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((O,C)=>O+(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((O,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}},E=[...O,T];return j=T.position,E},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((O,C,A)=>[...O,{stackId:C.stackId,dataKeys:C.dataKeys,position:{offset:b+(S+u)*A+(S-k)/2,size:k}}],f)}return d}}var KNe=(e,t,n,r,i,a,l)=>{var u=on(l)?t:l,d=HNe(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},GNe=(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)}}}},VNe=(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 QNe(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&ht(e.zIndex)?e.zIndex:t}var WNe=e=>{var{chartData:t}=e,n=ln(),r=rr();return x.useEffect(()=>r?()=>{}:(n(CI(t)),()=>{n(CI(void 0))}),[t,n,r]),null},hL={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},cF=Er({name:"brush",initialState:hL,reducers:{setBrushSettings(e,t){return t.payload==null?hL:t.payload}}}),{setBrushSettings:Aze}=cF.actions,YNe=cF.reducer;function ZNe(e){return(e%180+180)%180}var XNe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=ZNe(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)},JNe={dots:[],areas:[],lines:[]},uF=Er({name:"referenceElements",initialState:JNe,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:Eze,removeDot:Oze,addArea:_ze,removeArea:zze,addLine:Tze,removeLine:Pze}=uF.actions,eke=uF.reducer,tke=x.createContext(void 0),nke=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(tke.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 dF(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 rke(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return XNe(r,n)}function ike(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 ake(e,t){return dF(e,t+1)}function ske(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:dF(r,f)};var b=d,S,k=()=>(S===void 0&&(S=n(j,b)),S),O=j.coordinate,C=d===0||Uh(e,O,k,p,u);C||(d=0,p=l,f+=1),C&&(p=O+e*(k()/2+i),d+=f)},g;f<=a.length;)if(g=m(),g)return g.v;return[]}function oke(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,E,_=()=>(E===void 0&&(E=n(A,T)),E),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 O=r[k];O!=null&&S.push(O)}return S}}return[]}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 xr(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){lke(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 lke(e,t,n){return(t=cke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cke(e){var t=uke(e,"string");return typeof t=="symbol"?t:t+""}function uke(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 dke(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 O=Uh(e,j.tickCoord,S,u,d);O&&(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 fke(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(O){var C=l[O];if(C==null)return 1;var A=C,T,E=()=>(T===void 0&&(T=n(C,O)),T);if(O===0){var _=e*(A.coordinate-e*E()/2-d);l[O]=A=xr(xr({},A),{},{tickCoord:_<0?A.coordinate-_*e:A.coordinate})}else l[O]=A=xr(xr({},A),{},{tickCoord:A.coordinate});if(A.tickCoord!=null){var P=Uh(e,A.tickCoord,E,d,f);P&&(d=A.tickCoord+e*(E()/2+i),l[O]=xr(xr({},A),{},{isShow:!0}))}},S=0;S<j;S++)b(S);return l}function _A(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=ake(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,E)=>{var _=typeof f=="function"?f(T.value,E):T.value;return j==="width"?rke(ph(_,{fontSize:t,letterSpacing:n}),b,m):ph(_,{fontSize:t,letterSpacing:n})[j]},k=i[0],O=i[1],C=i.length>=2&&k!=null&&O!=null?Wr(O.coordinate-k.coordinate):1,A=ike(a,C,j);return d==="equidistantPreserveStart"?ske(C,A,S,i,l):d==="equidistantPreserveEnd"?oke(C,A,S,i,l):(d==="preserveStart"||d==="preserveStartEnd"?v=fke(C,A,S,i,l,d==="preserveStartEnd"):v=dke(C,A,S,i,l),v.filter(T=>T.isShow))}var hke=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},pke={xAxis:{},yAxis:{}},fF=Er({name:"renderedTicks",initialState:pke,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:mke,removeRenderedTicks:gke}=fF.actions,yke=fF.reducer,vke=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function xke(e,t){if(e==null)return{};var n,r,i=bke(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 bke(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 mc(){return mc=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},mc.apply(null,arguments)}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 Nn(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){wke(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 wke(e,t,n){return(t=jke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jke(e){var t=Ske(e,"string");return typeof t=="symbol"?t:t+""}function Ske(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 Nke(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",mc({},f,{className:Ot("recharts-cartesian-axis-line",nd(u,"className"))}))}function kke(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 Cke(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function Ake(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function Eke(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,R1e(t))),i=x.createElement(wA,mc({},n,{className:l}),r)}return i}function Oke(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(mke({ticks:a,axisId:r,axisType:n})),()=>{i(gke({axisId:r,axisType:n}))}},[i,t,r,n]),null}var _ke=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:O,letterSpacing:C,getTicksConfig:A,events:T,axisType:E,axisId:_}=e,P=_A(Nn(Nn({},A),{},{ticks:n}),O,C),$=gi(A),F=Jh(r),U=H8($.textAnchor)?$.textAnchor:Cke(p,m),B=Ake(p,m),V={};typeof i=="object"&&(V=i);var X=Nn(Nn({},$),{},{fill:"none"},V),Z=P.map(oe=>Nn({entry:oe},kke(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",mc({},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,mc({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(Eke,{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(E,"-ticks")},x.createElement(Oke,{ticks:P,axisId:_,axisType:E}),J.length>0&&x.createElement(bi,{zIndex:Wn.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(E,"-tick-labels"),ref:t},J)),H.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(E,"-tick-lines")},H))}),zke=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:l,ticks:u,axisType:d,axisId:f}=e,p=xke(e,vke),[m,g]=x.useState(""),[v,j]=x.useState(""),b=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return hke({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 O=k.getElementsByClassName("recharts-cartesian-axis-tick-value");b.current=O;var C=O[0];if(C){var A=window.getComputedStyle(C),T=A.fontSize,E=A.letterSpacing;(T!==m||E!==v)&&(g(T),j(E))}}},[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(Nke,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:gi(e)}),x.createElement(_ke,{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(m1e,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(k1e,{label:e.label,labelRef:e.labelRef}),e.children)))}),zA=x.forwardRef((e,t)=>{var n=tr(e,Os);return x.createElement(zke,mc({},n,{ref:t}))});zA.displayName="CartesianAxis";var Tke=["x1","y1","x2","y2","key"],Pke=["offset"],Rke=["xAxisId","yAxisId"],Dke=["xAxisId","yAxisId"];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 Sr(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){Mke(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 Mke(e,t,n){return(t=Ike(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ike(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 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=$ke(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 $ke(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 Bke=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 hF(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,Tke),m=(i=gi(p))!==null&&i!==void 0?i:{},{offset:g}=m,v=hv(m,Pke);r=x.createElement("line",Hl({},v,{x1:a,y1:l,x2:u,y2:d,fill:"none",key:f}))}return r}function Uke(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,Rke),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(hF,{key:"line-".concat(p),option:r,lineItemProps:m})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function qke(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,Dke),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(hF,{option:r,lineItemProps:m,key:"line-".concat(p)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function Fke(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 Hke(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 Kke=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return V6(_A(Sr(Sr(Sr({},Os),n),{},{ticks:Q6(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},Gke=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return V6(_A(Sr(Sr(Sr({},Os),n),{},{ticks:Q6(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},Vke={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Wn.grid};function gc(e){var t=yC(),n=vC(),r=eU(),i=Sr(Sr({},tr(e,Vke)),{},{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($=>hI($,"xAxis",a,j)),S=Ue($=>hI($,"yAxis",l,j));if(!Ha(f)||!Ha(p)||!Te(u)||!Te(d))return null;var k=i.verticalCoordinatesGenerator||Kke,O=i.horizontalCoordinatesGenerator||Gke,{horizontalPoints:C,verticalPoints:A}=i;if((!C||!C.length)&&typeof O=="function"){var T=g&&g.length,E=O({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(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof E,"]")),Array.isArray(E)&&(C=E)}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(Bke,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(Fke,Hl({},i,{horizontalPoints:C})),x.createElement(Hke,Hl({},i,{verticalPoints:A})),x.createElement(Uke,Hl({},i,{offset:r,horizontalPoints:C,xAxis:b,yAxis:S})),x.createElement(qke,Hl({},i,{offset:r,verticalPoints:A,xAxis:b,yAxis:S}))))}gc.displayName="CartesianGrid";var Qke={},pF=Er({name:"errorBars",initialState:Qke,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:Rze,replaceErrorBar:Dze,removeErrorBar:Mze}=pF.actions,Wke=pF.reducer,Yke=["children"];function Zke(e,t){if(e==null)return{};var n,r,i=Xke(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 Xke(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 Jke={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},eCe=x.createContext(Jke);function mF(e){var{children:t}=e,n=Zke(e,Yke);return x.createElement(eCe.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 TA(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 gF=(e,t,n,r)=>Qa(e,"xAxis",t,r),yF=(e,t,n,r)=>Va(e,"xAxis",t,r),vF=(e,t,n,r)=>Qa(e,"yAxis",n,r),xF=(e,t,n,r)=>Va(e,"yAxis",n,r),tCe=re([zt,gF,vF,yF,xF],(e,t,n,r,i)=>xa(e,"xAxis")?Go(t,r,!1):Go(n,i,!1)),nCe=(e,t,n,r,i)=>i;function rCe(e){return e.type==="line"}var iCe=re([mp,nCe],(e,t)=>e.filter(rCe).find(n=>n.id===t)),aCe=re([zt,gF,vF,yF,xF,iCe,tCe,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 kCe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:m,bandSize:l,displayedData:v})}});function bF(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 sCe=["id"],oCe=["type","layout","connectNulls","needClip","shape"],lCe=["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 yL(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?yL(Object(n),!0).forEach(function(r){cCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cCe(e,t,n){return(t=uCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uCe(e){var t=dCe(e,"string");return typeof t=="symbol"?t:t+""}function dCe(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 PA(e,t){if(e==null)return{};var n,r,i=fCe(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 fCe(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 hCe=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}]},pCe=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(CA,{tooltipEntrySettings:m})}),wF=(e,t)=>"".concat(t,"px ").concat(e,"px");function mCe(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var gCe=(e,t,n)=>{var r=n.reduce((g,v)=>g+v,0);if(!r)return wF(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[...mCe(n,i),...l,...m].map(g=>"".concat(g,"px")).join(", ")};function yCe(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:l}=r,{id:u}=r,d=PA(r,sCe),f=gi(d);return x.createElement(sF,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:f,needClip:l,clipPathId:t})}function vCe(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(SA,{value:t?i:void 0},n)}function vL(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=PA(a,oCe),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(tF,qh({shapeType:"curve",option:p},g,{pathRef:n})),x.createElement(yCe,{points:r,clipPathId:t,props:a}))}function xCe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function bCe(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,O=lp(l,"recharts-line-"),C=x.useRef(O),[A,T]=x.useState(!1),E=!A,_=x.useCallback(()=>{typeof b=="function"&&b(),T(!1)},[b]),P=x.useCallback(()=>{typeof S=="function"&&S(),T(!0)},[S]),$=xCe(r.current),F=x.useRef(0);C.current!==O&&(F.current=a.current,C.current=O);var U=F.current;return x.createElement(vCe,{points:l,showLabels:E},n.children,x.createElement(op,{animationId:O,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:_,onAnimationStart:P,key:O},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=gCe(X,$,H)}else Z=wF($,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(vL,{props:n,points:oe,clipPathId:t,pathRef:r,strokeDasharray:Z})}return x.createElement(vL,{props:n,points:l,clipPathId:t,pathRef:r,strokeDasharray:Z})}),x.createElement(NA,{label:n.label}))}function wCe(e){var{clipPathId:t,props:n}=e,r=x.useRef(null),i=x.useRef(0),a=x.useRef(null);return x.createElement(bCe,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var jCe=(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 SCe 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}=bF(n),O=kA(n),C=S*2+k,A=g?"url(#clipPath-".concat(O?"":"dots-").concat(b,")"):void 0;return x.createElement(bi,{zIndex:v},x.createElement(gr,{className:j},g&&x.createElement("defs",null,x.createElement(TA,{clipPathId:b,xAxisId:a,yAxisId:l}),!O&&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(mF,{xAxisId:a,yAxisId:l,data:r,dataPointFormatter:jCe,errorBarOffset:0},x.createElement(wCe,{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 jF={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 NCe(e){var t=tr(e,jF),{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=PA(t,lCe),{needClip:k}=Hx(v,j),O=Fx(),C=tl(),A=rr(),T=Ue(F=>aCe(F,v,j,A,b));if(C!=="horizontal"&&C!=="vertical"||T==null||O==null)return null;var{height:E,width:_,x:P,y:$}=O;return x.createElement(SCe,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:E,width:_,left:P,top:$,needClip:k}))}function kCe(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 CCe(e){var t=tr(e,jF),n=rr();return x.createElement(EA,{id:t.id,type:"line"},r=>x.createElement(x.Fragment,null,x.createElement(AA,{legendPayload:hCe(t)}),x.createElement(pCe,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),x.createElement(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(NCe,qh({},t,{id:r}))))}var Kx=x.memo(CCe,kc);Kx.displayName="Line";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.xAxisId)!==null&&n!==void 0?n:oF}function Ja(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:oF}var SF=(e,t,n)=>Qa(e,"xAxis",Xa(e,t),n),NF=(e,t,n)=>Va(e,"xAxis",Xa(e,t),n),kF=(e,t,n)=>Qa(e,"yAxis",Ja(e,t),n),CF=(e,t,n)=>Va(e,"yAxis",Ja(e,t),n),ACe=re([zt,SF,kF,NF,CF],(e,t,n,r,i)=>xa(e,"xAxis")?Go(t,r,!1):Go(n,i,!1)),ECe=(e,t)=>t,AF=re([mp,ECe],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),EF=e=>{var t=zt(e),n=xa(t,"xAxis");return n?"yAxis":"xAxis"},OCe=(e,t)=>{var n=EF(e);return n==="yAxis"?Ja(e,t):Xa(e,t)},_Ce=(e,t,n)=>iv(e,EF(e),OCe(e,t),n),zCe=re([AF,_Ce],(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]])}}}),TCe=re([zt,SF,kF,NF,CF,zCe,wU,ACe,AF,Sve],(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 XCe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:m,areaSettings:d,stackedData:a,displayedData:j,chartBaseValue:f,bandSize:u})}}),PCe=["id"],RCe=["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 OF(e,t){if(e==null)return{};var n,r,i=DCe(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 DCe(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 xL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Du(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xL(Object(n),!0).forEach(function(r){MCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MCe(e,t,n){return(t=ICe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ICe(e){var t=LCe(e,"string");return typeof t=="symbol"?t:t+""}function LCe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pv(e,t){return e&&e!=="none"?e:t}var $Ce=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}]},BCe=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(CA,{tooltipEntrySettings:m})});function UCe(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:l}=r,u=gi(r);return x.createElement(sF,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:u,needClip:i,clipPathId:t})}function qCe(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 Du(Du({},d),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return x.createElement(SA,{value:t?i:void 0},n)}function bL(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=OF(a,PCe),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(UCe,{points:t,props:g,clipPathId:i}))}function FCe(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 HCe(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 KCe(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?x.createElement(FCe,{alpha:t,points:r,baseLine:i,strokeWidth:a}):x.createElement(HCe,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function GCe(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=xC(),[k,O]=x.useState(!1),C=!k,A=x.useCallback(()=>{typeof v=="function"&&v(),O(!1)},[v]),T=x.useCallback(()=>{typeof g=="function"&&g(),O(!0)},[g]);if(S==null)return null;var E=i.current,_=a.current;return x.createElement(qCe,{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(E){var $=E.length/l.length,F=P===1?l:l.map((B,V)=>{var X=Math.floor(V*$);if(E[X]){var Z=E[X];return Du(Du({},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 Du(Du({},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(bL,{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(KCe,{alpha:P,points:l,baseLine:u,layout:S,strokeWidth:r.strokeWidth}))),x.createElement(gr,{clipPath:"url(#animationClipPath-".concat(n,")")},x.createElement(bL,{points:l,baseLine:u,needClip:t,clipPathId:n,props:r})))}),x.createElement(NA,{label:r.label}))}function VCe(e){var{needClip:t,clipPathId:n,props:r}=e,i=x.useRef(null),a=x.useRef();return x.createElement(GCe,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class QCe 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:O}=bF(n),C=kA(n),A=k*2+O,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(TA,{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(VCe,{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 WCe={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 YCe(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=OF(e,RCe),k=tl(),O=z8(),{needClip:C}=Hx(j,b),A=rr(),{points:T,isRange:E,baseLine:_}=(t=Ue(V=>TCe(V,e.id,A)))!==null&&t!==void 0?t:{},P=Fx();if(k!=="horizontal"&&k!=="vertical"||P==null||O!=="AreaChart"&&O!=="ComposedChart")return null;var{height:$,width:F,x:U,y:B}=P;return!T||!T.length?null:x.createElement(QCe,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:E,legendType:g,needClip:C,points:T,stroke:v,width:F,left:U,top:B,xAxisId:j,yAxisId:b}))}var ZCe=(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 XCe(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=ZCe(a,l,n,u,d),S=a==="horizontal",k=!1,O=f.map((A,T)=>{var E,_,P,$;if(j)$=i[p+T];else{var F=vn(A,r);Array.isArray(F)?($=F,k=!0):$=[b,F]}var U=(E=(_=$)===null||_===void 0?void 0:_[1])!==null&&E!==void 0?E: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=O.map(A=>{var T,E=Array.isArray(A.value)?A.value[0]:null;if(S){var _;return{x:A.x,y:E!=null&&A.y!=null&&(_=d.scale.map(E))!==null&&_!==void 0?_:null,payload:A.payload}}return{x:E!=null&&(T=u.scale.map(E))!==null&&T!==void 0?T:null,y:A.y,payload:A.payload}}):C=S?d.scale.map(b):u.scale.map(b),{points:O,baseLine:C??0,isRange:k}}function JCe(e){var t=tr(e,WCe),n=rr();return x.createElement(EA,{id:t.id,type:"area"},r=>x.createElement(x.Fragment,null,x.createElement(AA,{legendPayload:$Ce(t)}),x.createElement(BCe,{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:W6(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),x.createElement(YCe,Xl({},t,{id:r}))))}var Mu=x.memo(JCe,kc);Mu.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 RA(e){return x.createElement(tF,mN({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var eAe=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||zs(!1),n)}},tAe=(e,t,n)=>n,nAe=(e,t)=>t,bp=re([mp,nAe],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),rAe=re([bp],e=>e?.maxBarSize),iAe=(e,t,n,r)=>r,aAe=re([zt,mp,Xa,Ja,tAe],(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")),sAe=(e,t,n)=>{var r=zt(e),i=Xa(e,t),a=Ja(e,t);if(!(i==null||a==null))return r==="horizontal"?iv(e,"yAxis",a,n):iv(e,"xAxis",i,n)},oAe=(e,t)=>{var n=zt(e),r=Xa(e,t),i=Ja(e,t);if(!(r==null||i==null))return n==="horizontal"?fI(e,"xAxis",r):fI(e,"yAxis",i)},lAe=re([aAe,jve,oAe],BNe),cAe=(e,t,n)=>{var r,i,a=bp(e,t);if(a==null)return 0;var l=Xa(e,t),u=Ja(e,t);if(l==null||u==null)return 0;var d=zt(e),f=PU(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},_F=(e,t,n)=>{var r=zt(e),i=Xa(e,t),a=Ja(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)}},uAe=re([lAe,PU,wve,RU,cAe,_F,rAe],KNe),dAe=(e,t,n)=>{var r=Xa(e,t);if(r!=null)return Qa(e,"xAxis",r,n)},fAe=(e,t,n)=>{var r=Ja(e,t);if(r!=null)return Qa(e,"yAxis",r,n)},hAe=(e,t,n)=>{var r=Xa(e,t);if(r!=null)return Va(e,"xAxis",r,n)},pAe=(e,t,n)=>{var r=Ja(e,t);if(r!=null)return Va(e,"yAxis",r,n)},mAe=re([uAe,bp],VNe),gAe=re([sAe,bp],GNe),yAe=re([nr,pC,dAe,fAe,hAe,pAe,mAe,zt,wU,_F,gAe,bp,iAe],(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 KAe({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})}}),vAe=["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 xAe(e,t){if(e==null)return{};var n,r,i=bAe(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 bAe(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 zF=x.createContext(void 0),wAe=e=>{var t=x.useContext(zF);if(t!=null)return t.stackId;if(e!=null)return W6(e)},jAe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),SAe=e=>{var t=x.useContext(zF);if(t!=null){var{stackId:n}=t;return"url(#".concat(jAe(n,e),")")}},TF=e=>{var{index:t}=e,n=xAe(e,vAe),r=SAe(t);return x.createElement(gr,gN({className:"recharts-bar-stack-layer",clipPath:r},n))},NAe=["onMouseEnter","onMouseLeave","onClick"],kAe=["value","background","tooltipPosition"],CAe=["id"],AAe=["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 wL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wL(Object(n),!0).forEach(function(r){EAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EAe(e,t,n){return(t=OAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OAe(e){var t=_Ae(e,"string");return typeof t=="symbol"?t:t+""}function _Ae(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=zAe(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 zAe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var TAe=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}]},PAe=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(CA,{tooltipEntrySettings:p})});function RAe(e){var t=Ue(pc),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:l,onMouseLeave:u,onClick:d}=a,f=mv(a,NAe),p=nF(l,r,a.id),m=rF(u),g=iF(d,r,a.id);if(!i||n==null)return null;var v=Jh(i);return x.createElement(bi,{zIndex:QNe(i,Wn.barBackground)},n.map((j,b)=>{var{value:S,background:k,tooltipPosition:O}=j,C=mv(j,kAe);if(!k)return null;var A=p(j,b),T=m(j,b),E=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:E,dataKey:r,index:b,className:"recharts-bar-background-rectangle"});return x.createElement(RA,Vo({key:"background-bar-".concat(b)},_))}))}function DAe(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(SA,{value:t?i:void 0},n)}function MAe(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:l}=e,u=Ue(pc),d=Ue(E8),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 O=x.createElement(RA,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(TF,{index:i.originalDataIndex},O)):O}function IAe(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return x.createElement(RA,Vo({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function LAe(e){var t,{data:n,props:r}=e,i=(t=gi(r))!==null&&t!==void 0?t:{},{id:a}=i,l=mv(i,CAe),{shape:u,dataKey:d,activeBar:f}=r,{onMouseEnter:p,onClick:m,onMouseLeave:g}=r,v=mv(r,AAe),j=nF(p,d,a),b=rF(g),S=iF(m,d,a);return n?x.createElement(x.Fragment,null,n.map((k,O)=>x.createElement(TF,Vo({index:k.originalDataIndex,key:"rectangle-".concat(k?.x,"-").concat(k?.y,"-").concat(k?.value,"-").concat(O),className:"recharts-bar-rectangle"},sx(v,k,O),{onMouseEnter:j(k,O),onMouseLeave:b(k,O),onClick:S(k,O)}),f?x.createElement(MAe,{shape:u,activeBar:f,baseProps:l,entry:k,index:O,dataKey:d}):x.createElement(IAe,{shape:u,baseProps:l,entry:k,index:O,dataKey:d})))):null}function $Ae(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(DAe,{showLabels:b,rects:r},x.createElement(op,{animationId:g,begin:l,duration:u,isActive:a,easing:d,onAnimationEnd:S,onAnimationStart:k,key:g},O=>{var C=O===1?r:r?.map((A,T)=>{var E=m&&m[T];if(E)return Pr(Pr({},A),{},{x:Ft(E.x,A.x,O),y:Ft(E.y,A.y,O),width:Ft(E.width,A.width,O),height:Ft(E.height,A.height,O)});if(i==="horizontal"){var _=Ft(0,A.height,O),P=Ft(A.stackedBarStart,A.y,O);return Pr(Pr({},A),{},{y:P,height:_})}var $=Ft(0,A.width,O),F=Ft(A.stackedBarStart,A.x,O);return Pr(Pr({},A),{},{width:$,x:F})});return O>0&&(n.current=C??null),C==null?null:x.createElement(gr,null,x.createElement(LAe,{props:t,data:C}))}),x.createElement(NA,{label:t.label}),t.children)}function BAe(e){var t=x.useRef(null);return x.createElement($Ae,{previousRectanglesRef:t,props:e})}var PF=0,UAe=(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 qAe 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(TA,{clipPathId:m,xAxisId:a,yAxisId:l})),x.createElement(gr,{className:"recharts-bar-rectangles",clipPath:u?"url(#clipPath-".concat(m,")"):void 0},x.createElement(RAe,{data:n,dataKey:r,background:d,allOtherBarProps:this.props}),x.createElement(BAe,this.props)))}}var FAe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:PF,xAxisId:0,yAxisId:0,zIndex:Wn.bar};function HAe(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=L1e(e.children,lv),b=Ue(O=>yAe(O,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(mF,{xAxisId:t,yAxisId:n,data:b,dataPointFormatter:UAe,errorBarOffset:S},x.createElement(qAe,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 KAe(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,O=m?k.scale.domain():null,C=sme({numericAxis:k}),A=k.scale.map(C);return g.map((T,E)=>{var _,P,$,F,U,B;if(m){var V=m[E+S];if(V==null)return null;_=tme(V,O)}else _=vn(T,n),Array.isArray(_)||(_=[C,_]);var X=eAe(r,PF)(_[1],E);if(t==="horizontal"){var Z,H=d.scale.map(_[0]),J=d.scale.map(_[1]);if(H==null||J==null)return null;P=sD({axis:u,ticks:f,bandSize:l,offset:a.offset,entry:T,index:E}),$=(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,$=sD({axis:d,ticks:p,bandSize:l,offset:a.offset,entry:T,index:E}),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:E},j&&j[E]&&j[E].props);return D}).filter(Boolean)}function GAe(e){var t=tr(e,FAe),n=wAe(t.stackId),r=rr();return x.createElement(EA,{id:t.id,type:"bar"},i=>x.createElement(x.Fragment,null,x.createElement(AA,{legendPayload:TAe(t)}),x.createElement(PAe,{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(HAe,Vo({},t,{id:i})))))}var gv=x.memo(GAe,kc);gv.displayName="Bar";var VAe=["domain","range"],QAe=["domain","range"];function jL(e,t){if(e==null)return{};var n,r,i=WAe(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 WAe(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 SL(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 RF(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=jL(e,VAe),{domain:a,range:l}=t,u=jL(t,QAe);return!SL(n,a)||!SL(r,l)?!1:kc(i,u)}var YAe=["type"],ZAe=["dangerouslySetInnerHTML","ticks","scale"],XAe=["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 NL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NL(Object(n),!0).forEach(function(r){JAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JAe(e,t,n){return(t=eEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eEe(e){var t=tEe(e,"string");return typeof t=="symbol"?t:t+""}function tEe(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=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}function rEe(e){var t=ln(),n=x.useRef(null),r=xC(),{type:i}=e,a=vN(e,YAe),l=Ax(r,"xAxis",i),u=x.useMemo(()=>{if(l!=null)return kL(kL({},a),{},{type:l})},[a,l]);return x.useLayoutEffect(()=>{u!=null&&(n.current===null?t(kNe(u)):n.current!==u&&t(CNe({prev:n.current,next:u})),n.current=u)},[u,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(ANe(n.current)),n.current=null)},[t]),null}var iEe=e=>{var{xAxisId:t,className:n}=e,r=Ue(pC),i=rr(),a="xAxis",l=Ue(k=>s8(k,a,t,i)),u=Ue(k=>r8(k,t)),d=Ue(k=>iwe(k,t)),f=Ue(k=>kq(k,t));if(u==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:p,ticks:m,scale:g}=e,v=vN(e,ZAe),{id:j,scale:b}=f,S=vN(f,XAe);return x.createElement(zA,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}))},aEe={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},sEe=e=>{var t=tr(e,aEe);return x.createElement(x.Fragment,null,x.createElement(rEe,{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(iEe,t))},Wa=x.memo(sEe,RF);Wa.displayName="XAxis";var oEe=["type"],lEe=["dangerouslySetInnerHTML","ticks","scale"],cEe=["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 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 AL(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){uEe(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 uEe(e,t,n){return(t=dEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dEe(e){var t=fEe(e,"string");return typeof t=="symbol"?t:t+""}function fEe(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=hEe(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 hEe(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 pEe(e){var t=ln(),n=x.useRef(null),r=xC(),{type:i}=e,a=bN(e,oEe),l=Ax(r,"yAxis",i),u=x.useMemo(()=>{if(l!=null)return AL(AL({},a),{},{type:l})},[l,a]);return x.useLayoutEffect(()=>{u!=null&&(n.current===null?t(ENe(u)):n.current!==u&&t(ONe({prev:n.current,next:u})),n.current=u)},[u,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(_Ne(n.current)),n.current=null)},[t]),null}function mEe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=x.useRef(null),l=x.useRef(null),u=Ue(pC),d=rr(),f=ln(),p="yAxis",m=Ue(E=>i8(E,t)),g=Ue(E=>swe(E,t)),v=Ue(E=>s8(E,p,t,d)),j=Ue(E=>Cq(E,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!m||jA(i)||x.isValidElement(i)||j==null)){var E=a.current;if(E){var _=E.getCalculatedWidth();Math.round(m.width)!==Math.round(_)&&f(zNe({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,O=bN(e,lEe),{id:C,scale:A}=j,T=bN(j,cEe);return x.createElement(zA,xN({},O,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 gEe={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},yEe=e=>{var t=tr(e,gEe);return x.createElement(x.Fragment,null,x.createElement(pEe,{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(mEe,t))},Ya=x.memo(yEe,RF);Ya.displayName="YAxis";var vEe=(e,t)=>t,DA=re([vEe,zt,UU,ar,N8,Ks,Eje,nr],Dje);function xEe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function MA(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(xEe(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 DF=yi("mouseClick"),MF=np();MF.startListening({actionCreator:DF,effect:(e,t)=>{var n=e.payload,r=DA(t.getState(),MA(n));r?.activeIndex!=null&&t.dispatch(jwe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var wN=yi("mouseMove"),IF=np(),ju=null,Al=null,CS=null;IF.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");ju!==null&&(cancelAnimationFrame(ju),ju=null),Al!==null&&(typeof i!="number"||!l)&&(clearTimeout(Al),Al=null),CS=MA(n);var u=()=>{var d=t.getState(),f=vp(d,d.tooltip.settings.shared);if(!CS){ju=null,Al=null;return}if(f==="axis"){var p=DA(d,CS);p?.activeIndex!=null?t.dispatch(p8({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(h8())}ju=null,Al=null};if(!l){u();return}i==="raf"?ju=requestAnimationFrame(u):typeof i=="number"&&Al===null&&(Al=setTimeout(u,i))}});function bEe(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 EL={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},LF=Er({name:"rootProps",initialState:EL,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:EL.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}}}),wEe=LF.reducer,{updateOptions:jEe}=LF.actions,SEe=null,NEe={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)},$F=Er({name:"polarOptions",initialState:SEe,reducers:NEe}),{updatePolarOptions:Ize}=$F.actions,kEe=$F.reducer,BF=yi("keyDown"),UF=yi("focus"),qF=yi("blur"),Gx=np(),Su=null,El=null,kg=null;Gx.startListening({actionCreator:BF,effect:(e,t)=>{kg=e.payload,Su!==null&&(cancelAnimationFrame(Su),Su=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");El!==null&&(typeof r!="number"||!a)&&(clearTimeout(El),El=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,hc(u),cd(u),ud(u)),g=m==null?-1:Number(m),v=!Number.isFinite(g)||g<0,j=Ks(u),b=hc(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 O=dwe(u),C=O==="left-to-right"?1:-1,A=p==="ArrowRight"?1:-1,T;if(v){var E=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,E,_)!=null){T=F;break}}else for(var U=b.length-1;U>=0;U--)if(hh($(U),b,E,_)!=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{Su=null,El=null}};if(!a){l();return}r==="raf"?Su=requestAnimationFrame(l):typeof r=="number"&&El===null&&(l(),kg=null,El=setTimeout(()=>{kg?l():(El=null,Su=null)},r))}});Gx.startListening({actionCreator:UF,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:qF,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 FF(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"),HF=np(),Cg=new Map,Yf=new Map,AS=new Map;HF.startListening({actionCreator:Di,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=FF(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:O}=S,C=t.getState(),A={activeCoordinate:hje(C),activeDataKey:E8(C),activeIndex:pc(C),activeLabel:A8(C),activeTooltipIndex:pc(C),isTooltipActive:pje(C)};k&&k(A,O)}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 CEe=re([Pd],e=>e.tooltipItemPayloads),AEe=re([CEe,(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)}}}),KF=yi("touchMove"),GF=np(),Ol=null,No=null,OL=null,Zf=null;GF.startListening({actionCreator:KF,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Zf=FF(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,l=a==="all"||a.includes("touchmove");Ol!==null&&(cancelAnimationFrame(Ol),Ol=null),No!==null&&(typeof i!="number"||!l)&&(clearTimeout(No),No=null),OL=Array.from(n.touches).map(d=>MA({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){Ol=null,No=null;return}var g=DA(d,m);g?.activeIndex!=null&&t.dispatch(p8({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(hme),k=(v=b.getAttribute(pme))!==null&&v!==void 0?v:void 0,O=Ec(d).find(T=>T.id===k);if(S==null||O==null||k==null)return;var{dataKey:C}=O,A=AEe(d,S,k);t.dispatch(f8({activeDataKey:C,activeIndex:S,activeCoordinate:A,activeGraphicalItemId:k}))}Ol=null,No=null}};if(!l){u();return}i==="raf"?Ol=requestAnimationFrame(u):typeof i=="number"&&No===null&&(u(),Zf=null,No=setTimeout(()=>{Zf?u():(No=null,Ol=null)},i))}}});var VF={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},QF=Er({name:"eventSettings",initialState:VF,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:EEe}=QF.actions,OEe=QF.reducer,_Ee=v6({brush:YNe,cartesianAxis:TNe,chartData:dSe,errorBars:Wke,eventSettings:OEe,graphicalItems:dNe,layout:Ype,legend:oge,options:sSe,polarAxis:P1e,polarOptions:kEe,referenceElements:eke,renderedTicks:yke,rootProps:wEe,tooltip:Swe,zIndex:Qje}),zEe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return wpe({reducer:_Ee,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([MF.middleware,IF.middleware,Gx.middleware,HF.middleware,GF.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(P6({type:"raf"}))},devTools:{serialize:{replacer:bEe},name:"recharts-".concat(n)}})};function TEe(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=rr(),a=x.useRef(null);if(i)return n;a.current==null&&(a.current=zEe(t,r));var l=oC;return x.createElement(kge,{context:l,store:a.current},n)}function PEe(e){var{layout:t,margin:n}=e,r=ln(),i=rr();return x.useEffect(()=>{i||(r(Vpe(t)),r(Gpe(n)))},[r,i,t,n]),null}var REe=x.memo(PEe,kc);function DEe(e){var t=ln();return x.useEffect(()=>{t(jEe(e))},[t,e]),null}var MEe=e=>{var t=ln();return x.useEffect(()=>{t(EEe(e))},[t,e]),null},IEe=x.memo(MEe,kc);function _L(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=ln();return x.useLayoutEffect(()=>(r.current&&i(Gje({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Vje({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function zL(e){var{children:t,isPanorama:n}=e,r=Ue(Ije);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(_L,{key:l,zIndex:l,isPanorama:n})),t,a.map(l=>x.createElement(_L,{key:l,zIndex:l,isPanorama:n})))}var LEe=["children"];function $Ee(e,t){if(e==null)return{};var n,r,i=BEe(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 BEe(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 UEe={width:"100%",height:"100%",display:"block"},qEe=x.forwardRef((e,t)=>{var n=yC(),r=vC(),i=dU();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(Zk,yv({},l,{title:u,desc:d,role:p,tabIndex:f,width:n,height:r,style:UEe,ref:t}),a)}),FEe=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(Zk,{width:r,height:i,x:l,y:a},t)},TL=x.forwardRef((e,t)=>{var{children:n}=e,r=$Ee(e,LEe),i=rr();return i?x.createElement(FEe,null,x.createElement(zL,{isPanorama:!0},n)):x.createElement(qEe,yv({ref:t},r),x.createElement(zL,{isPanorama:!1},n))});function HEe(){var e=ln(),[t,n]=x.useState(null),r=Ue(fme);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;ht(a)&&a!==r&&e(Wpe(a))}},[t,e,r]),n}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 KEe(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){GEe(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 GEe(e,t,n){return(t=VEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VEe(e){var t=QEe(e,"string");return typeof t=="symbol"?t:t+""}function QEe(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 WEe=()=>(bSe(),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 YEe=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)))}),ZEe=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)))}),XEe=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)))}),JEe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(ZEe,qo({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(XEe,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 eOe(e){return e?YEe:JEe}var tOe=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:O,dispatchTouchEvents:C=!0}=e,A=x.useRef(null),T=ln(),[E,_]=x.useState(null),[P,$]=x.useState(null),F=HEe(),U=mC(),B=U?.width>0?U.width:k,V=U?.height>0?U.height:i,X=x.useCallback(me=>{F(me),typeof t=="function"&&t(me),_(me),$(me),me!=null&&(A.current=me)},[F,t,_,$]),Z=x.useCallback(me=>{T(DF(me)),T(Di({handler:a,reactEvent:me}))},[T,a]),H=x.useCallback(me=>{T(wN(me)),T(Di({handler:f,reactEvent:me}))},[T,f]),J=x.useCallback(me=>{T(h8()),T(Di({handler:p,reactEvent:me}))},[T,p]),oe=x.useCallback(me=>{T(wN(me)),T(Di({handler:m,reactEvent:me}))},[T,m]),ye=x.useCallback(()=>{T(UF())},[T]),I=x.useCallback(()=>{T(qF())},[T]),M=x.useCallback(me=>{T(BF(me.key))},[T]),q=x.useCallback(me=>{T(Di({handler:l,reactEvent:me}))},[T,l]),D=x.useCallback(me=>{T(Di({handler:u,reactEvent:me}))},[T,u]),G=x.useCallback(me=>{T(Di({handler:d,reactEvent:me}))},[T,d]),se=x.useCallback(me=>{T(Di({handler:g,reactEvent:me}))},[T,g]),ne=x.useCallback(me=>{T(Di({handler:b,reactEvent:me}))},[T,b]),Ce=x.useCallback(me=>{C&&T(KF(me)),T(Di({handler:j,reactEvent:me}))},[T,C,j]),Se=x.useCallback(me=>{T(Di({handler:v,reactEvent:me}))},[T,v]),ee=eOe(O);return x.createElement(M8.Provider,{value:E},x.createElement(PB.Provider,{value:P},x.createElement(ee,{width:B??S?.width,height:V??S?.height,className:Ot("recharts-wrapper",r),style:KEe({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(WEe,null),n)))}),nOe=["width","height","responsive","children","className","style","compact","title","desc"];function rOe(e,t){if(e==null)return{};var n,r,i=iOe(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 iOe(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 aOe=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=rOe(e,nOe),g=gi(m);return d?x.createElement(x.Fragment,null,x.createElement(ip,{width:n,height:r}),x.createElement(TL,{otherAttributes:g,title:f,desc:p},a)):x.createElement(tOe,{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(TL,{otherAttributes:g,title:f,desc:p,ref:t},x.createElement(nke,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 RL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function sOe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RL(Object(n),!0).forEach(function(r){oOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oOe(e,t,n){return(t=lOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lOe(e){var t=cOe(e,"string");return typeof t=="symbol"?t:t+""}function cOe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uOe={top:5,right:5,bottom:5,left:5},dOe=sOe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:uOe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},VF),IA=x.forwardRef(function(t,n){var r,i=tr(t.categoricalChartProps,dOe),{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(TEe,{preloadedState:{options:p},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},x.createElement(WNe,{chartData:f.data}),x.createElement(REe,{layout:i.layout,margin:i.margin}),x.createElement(IEe,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(DEe,{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(aOe,jN({},i,{ref:n})))}),fOe=["axis"],LA=x.forwardRef((e,t)=>x.createElement(IA,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:fOe,tooltipPayloadSearcher:bA,categoricalChartProps:e,ref:t})),hOe=["axis","item"],SN=x.forwardRef((e,t)=>x.createElement(IA,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:hOe,tooltipPayloadSearcher:bA,categoricalChartProps:e,ref:t})),pOe=["axis"],NN=x.forwardRef((e,t)=>x.createElement(IA,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:pOe,tooltipPayloadSearcher:bA,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 WF(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function fd(e){return WF(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function hd(e){const t=WF(e);return`${t.getMonth()+1}/${t.getDate()}`}const mOe=6,pd="__other__",Vu="_socialTotal";function gOe(e,t=mOe){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,[Vu]:0},u.set(p.date,m));const g=a.has(p.source)?p.source:pd;m[g]=(m[g]??0)+p.sessions,m[Vu]=(m[Vu]??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 Qu(e){return e.replace(/\+/g," ")}function YF(e,t=30){return e.length<=t?e:e.slice(0,Math.max(1,t-1))+"…"}const yOe=["7d","30d","90d","all"],_o=An,kN="#71717a",ZF="#52525b",Xf=25;function Ag(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function vOe(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 xOe({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"),[O,C]=x.useState("desc"),[A,T]=x.useState("sessions"),[E,_]=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(fe){u(!0),v(null);try{const ze=await t.fetchQuery({queryKey:qe.traffic.status(e),queryFn:()=>rQ(e),staleTime:Pf});if(fe.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:()=>iQ(e,void 0,G),staleTime:Pf}),t.fetchQuery({queryKey:qe.traffic.aiHistory(e,G),queryFn:()=>sQ(e,G).catch(()=>[]),staleTime:Pf}),t.fetchQuery({queryKey:qe.traffic.sessionHistory(e,G),queryFn:()=>lQ(e,G).catch(()=>[]),staleTime:Pf}),t.fetchQuery({queryKey:qe.traffic.socialHistory(e,G),queryFn:()=>oQ(e,G).catch(()=>[]),staleTime:Pf})]);if(fe.current)return;a(he),J(Qe),ye(Fn),M(wi),u(!1)}catch(ze){if(fe.current)return;v(ze instanceof Error?ze.message:"Failed to load GA4 data"),u(!1)}}x.useEffect(()=>{const fe={current:!1};return ne(fe),()=>{fe.current=!0}},[e,G,t]);async function Ce(){f(!0),v(null),b(null);try{const fe=await I5(e);b(`Synced ${fe.rowCount.toLocaleString()} page rows, ${fe.aiReferralCount.toLocaleString()} AI and ${fe.socialReferralCount.toLocaleString()} social referral rows (${fe.days} days)`),await t.invalidateQueries({queryKey:qe.traffic.project(e)}),await ne({current:!1})}catch(fe){v(fe instanceof Error?fe.message:"Sync failed")}finally{f(!1)}}async function Se(){m(!0),v(null),b(null);try{await cQ(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(fe){v(fe instanceof Error?fe.message:"Disconnect failed")}finally{m(!1)}}function ee(fe){S===fe?C(ze=>ze==="desc"?"asc":"desc"):(k(fe),C("desc"))}function me(fe){A===fe?_(ze=>ze==="desc"?"asc":"desc"):(T(fe),_("desc"))}function Oe(fe){P===fe?U(ze=>ze==="desc"?"asc":"desc"):($(fe),U("desc"))}function Y(fe){B===fe?Z(ze=>ze==="desc"?"asc":"desc"):(V(fe),Z("desc"))}const He=x.useMemo(()=>i?.topPages?[...i.topPages].sort((fe,ze)=>{const he=fe[S],Qe=ze[S];return typeof he=="string"&&typeof Qe=="string"?O==="asc"?he.localeCompare(Qe):Qe.localeCompare(he):O==="asc"?he-Qe:Qe-he}):[],[i?.topPages,S,O]),Pe=x.useMemo(()=>i?.aiReferrals?[...i.aiReferrals].sort((fe,ze)=>{const he=fe[A],Qe=ze[A];return typeof he=="string"&&typeof Qe=="string"?E==="asc"?he.localeCompare(Qe):Qe.localeCompare(he):E==="asc"?he-Qe:Qe-he}):[],[i?.aiReferrals,A,E]),at=x.useMemo(()=>i?.aiReferralLandingPages?[...i.aiReferralLandingPages].sort((fe,ze)=>{const he=fe[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((fe,ze)=>{const he=fe[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 fe=gOe(I);return{socialChartData:fe.data,socialChartSources:fe.sources,socialOtherCount:fe.otherCount}},[I]),{chartData:en,chartSources:je,dateRange:Xe}=x.useMemo(()=>{const fe=[...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 On=`${tn.date}::${tn.source}`,$r=he.get(On)??0;he.set(On,Math.max($r,tn.sessions))}for(const[tn,On]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)+On}const Qe=[...ze.entries()].sort(([tn],[On])=>tn.localeCompare(On)).map(([tn,On])=>({date:tn,...On})),Fn=Qe.map(tn=>tn.date),wi=Fn.length>0?{start:Fn[0],end:Fn[Fn.length-1]}:null;return{chartData:Qe,chartSources:fe,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(bOe,{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,ue=i?.aiSessionsBySession??0,Ne=i?.aiSharePctBySessionDisplay??"0%",Me=i?new Set(i.aiReferrals.map(fe=>fe.source.toLowerCase())).size:0,Ge=Pe[0]??null,pt=i?.totalDirectSessions??0,mn=i?.directSharePctDisplay??"0%",En=i?.socialSessions??0,gn=i?.socialSharePctDisplay??"0%",We=i?new Set(i.socialReferrals.map(fe=>fe.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(T2,{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(_W,{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:yOe.map(fe=>s.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${G===fe?"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(fe),children:fe==="all"?"All":fe},fe))})]}),i?s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsx(ES,{value:Ag(i.totalSessions),label:"Total Sessions",subtitle:i.totalSessions.toLocaleString(),tone:"neutral"}),s.jsx(ES,{value:Ag(i.totalOrganicSessions),label:"Organic Sessions",subtitle:`${Rt} of total`,tone:"positive"}),s.jsx(ES,{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(T2,{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)."})]})]}),Xe&&s.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(Xe.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(Xe.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(Ps,{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(Is,{...da,labelFormatter:fd,formatter:(fe,ze)=>{const he=typeof fe=="number"?fe.toLocaleString():String(fe??0),Qe=String(ze??"");return Qe==="_totalSessions"?[he,"Total Sessions"]:Qe==="_organicSessions"?[he,"Organic Sessions"]:[he,Qe]}}),s.jsx(cU,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:fe=>fe==="_totalSessions"?"Total Sessions":fe==="_organicSessions"?"Organic Sessions":fe}),s.jsx(Mu,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),je.map((fe,ze)=>s.jsx(Mu,{type:"monotone",dataKey:fe,stackId:"ai",stroke:_o[ze%_o.length],fill:_o[ze%_o.length],fillOpacity:.4,strokeWidth:1.5},fe))]})})})]}),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:`${En.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:`${ue.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:E,onSort:me,align:"left"}),s.jsx(vr,{label:"Medium",sortKey:"medium",current:A,dir:E,onSort:me,align:"left"}),s.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),s.jsx(vr,{label:"Sessions",sortKey:"sessions",current:A,dir:E,onSort:me,align:"right"}),s.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),s.jsx(vr,{label:"Users",sortKey:"users",current:A,dir:E,onSort:me,align:"right"})]})}),s.jsx("tbody",{children:Pe.map(fe=>s.jsx(jOe,{referral:fe,totalSessions:et},`${fe.source}:${fe.medium}:${fe.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(fe=>s.jsx(SOe,{row:fe},`${fe.landingPage}:${fe.source}:${fe.medium}:${fe.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(Ps,{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(Is,{...da,labelFormatter:fd,formatter:(fe,ze)=>{const he=typeof fe=="number"?fe.toLocaleString():String(fe??0),Qe=String(ze??"");if(Qe===Vu)return[he,"Total Social"];if(Qe===pd){const Fn=`Other (${cn} source${cn===1?"":"s"})`;return[he,Fn]}return[he,Qu(Qe)]}}),s.jsx(Mu,{type:"monotone",dataKey:Vu,stroke:ZF,fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Lt.map((fe,ze)=>{const Qe=fe===pd?kN:_o[ze%_o.length];return s.jsx(Mu,{type:"monotone",dataKey:fe,stackId:"social",stroke:Qe,fill:Qe,fillOpacity:.4,strokeWidth:1.5},fe)})]})})}),s.jsx(kOe,{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(En),hint:`${En.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:YF(Qu(Kt.source),64)}),s.jsxs("p",{className:"text-xs text-sky-200/70 mt-0.5 truncate",title:Kt.medium,children:["via ",Qu(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:Oe,align:"left"}),s.jsx(vr,{label:"Medium",sortKey:"medium",current:P,dir:F,onSort:Oe,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:Oe,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:Oe,align:"right"})]})}),s.jsx("tbody",{children:(q?Ve:Ve.slice(0,Xf)).map(fe=>s.jsx(NOe,{referral:fe,totalSessions:En},`${fe.source}:${fe.medium}:${fe.channelGroup}`))})]})}),Ve.length>Xf&&s.jsx("div",{className:"mt-3 flex justify-center",children:s.jsx("button",{type:"button",onClick:()=>D(fe=>!fe),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:O,onSort:ee,align:"left"}),s.jsx(vr,{label:"Sessions",sortKey:"sessions",current:S,dir:O,onSort:ee,align:"right"}),s.jsx(vr,{label:"Organic",sortKey:"organicSessions",current:S,dir:O,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:O,onSort:ee,align:"right"})]})}),s.jsx("tbody",{children:He.map(fe=>s.jsx(wOe,{page:fe},fe.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 ${vOe(i.lastSyncedAt)}`:"Never synced"}),s.jsx("span",{children:i?`${i.topPages.length} pages · ${i.aiReferrals.length} AI rows · ${i.socialReferrals.length} social rows`:""})]})]})}function bOe({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 O=k.result;try{const C=JSON.parse(O);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(O)}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 aQ(e,{propertyId:n.trim(),keyJson:l});try{await I5(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(TW,{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 XF={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function ES({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 ${XF[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 ${XF[r]}`,children:e}),s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function wOe({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 JF={session:"Session",first_user:"First Visit",manual_utm:"UTM"},e9={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 jOe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=JF[e.sourceDimension]??e.sourceDimension,i=e9[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 SOe({row:e}){const t=JF[e.sourceDimension]??e.sourceDimension,n=e9[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 NOe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=e.channelGroup==="Paid Social"?"Paid":"Organic",i=Qu(e.source),a=Qu(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 kOe({sources:e,otherCount:t}){const n=[{key:Vu,color:ZF,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=Qu(i);n.push({key:i,color:_o[r%_o.length]??kN,label:YF(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 t9(e){e.invalidateQueries({queryKey:qe.runs.all}),e.invalidateQueries({queryKey:qe.projects.all})}function COe(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function AOe(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){n$({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),vt({title:COe(e.kind),detail:AOe(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function EOe(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)n$({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=tne({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 n9(){const e=xi();return Fh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>pV(t,n),onSuccess:(t,n)=>{t9(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 OOe(){const e=xi();return Fh({meta:{skipGlobalErrorToast:!0},mutationFn:t=>PV(t),onSuccess:t=>{t9(e),EOe(t)},onError:t=>{vt({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function _Oe(){const e=xi();return Fh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>P5(t,n),onSuccess:(t,n)=>{Gv(e,Nt["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 zOe(){const e=xi();return Fh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>GV(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 TOe(){const e=xi();return Fh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>HV(t,n),onSuccess:(t,n)=>{Gv(e,Nt["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 POe=["7d","30d","90d","all"];function ROe({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(""),[O,C]=x.useState(""),[A,T]=x.useState("30"),[E,_]=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),[me,Oe]=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),[Xe,Rt]=x.useState("indexed"),[mt,et]=x.useState(null),ue=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,En]=x.useState(!1),[gn,We]=x.useState(null),[Kt,fe]=x.useState(null),ze=i.find(Q=>Q.connectionType==="gsc"),he=d.length>0||p.length>0||g.length>0,Qe=_Oe(),Fn=zOe(),wi=TOe();async function tn(Q){if(!Q){u([]),k("");return}ye(!0);try{const{sites:ke}=await t.fetchQuery({queryKey:qe.gsc.properties(e),queryFn:()=>MV(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 On(){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:()=>$V(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:()=>UV(e,{url:Q,limit:20}),staleTime:jr}),t.fetchQuery({queryKey:qe.gsc.deindexed(e),queryFn:()=>qV(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(){Oe(!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:()=>FV(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{Oe(!1)}}async function wa(Q){En(!0),We(null);try{const ke=await C2(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{En(!1)}}async function Sp(){En(!0),We(null);try{const Q=await C2(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{En(!1)}}async function Gs(){if(Ve.trim()){cn(!0),We(null);try{await LV(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 KV(e);t.setQueryData(qe.gsc.sitemaps(e),Q),at(Q.sitemaps),Q.sitemaps.length===0&&fe("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:()=>T5(e).catch(()=>[]),staleTime:jr})]);r(!!Q?.google?.configured),a(ke);const nt=ke.find(St=>St.connectionType==="gsc");await Promise.all([tn(nt),On(),$r(),Xi()])}finally{Z(!1)}}x.useEffect(()=>{Dd()},[e]),x.useEffect(()=>{On()},[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),fe(null);try{const{authUrl:Q}=await RV(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}fe("Finish the Google consent flow in the popup, then close it to refresh this project.");const nt=window.setInterval(()=>{ke.closed&&(window.clearInterval(nt),fe(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),fe(null);try{await DV(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 IV(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),fe(null);try{await Qe.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(A,10)||void 0,full:E||void 0}}),await t.invalidateQueries({queryKey:qe.gsc.project(e)})}catch{}}async function Ld(){if(O.trim()){Ce(!0),We(null),fe(null);try{const Q=await BV(e,O.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:POe.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:()=>{On()},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:()=>fe(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(Je,{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:me,onClick:()=>{Xi()},children:me?"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),es=_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:`${es} ${_n-es}`,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 ${Xe===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:[Xe==="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))})]}),Xe==="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))})]}),Xe==="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))})]}),Xe==="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})(),Xe==="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}`))})]}),(Xe==="indexed"&&Se.indexed.length===0||Xe==="notIndexed"&&!Ge&&Se.notIndexed.length===0||Xe==="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:me?"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:()=>{On()},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",es=700,Qs=220,Or={top:12,bottom:36,left:48,right:12},il=es-Or.left-Or.right,Sa=Qs-Or.top-Or.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),ts=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:`${es} / ${Qs}`},children:s.jsxs("svg",{viewBox:`0 0 ${es} ${Qs}`,className:"h-full w-full",children:[Cp.map((ut,Gt)=>{const Br=Or.top+Sa-ut/al*Sa;return s.jsxs("g",{children:[s.jsx("line",{x1:Or.left,y1:Br,x2:es-Or.right,y2:Br,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),s.jsx("text",{x:Or.left-6,y:Br+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:ts(ut)})]},`t-${Gt}`)}),ke.map(([ut,Gt],Br)=>{const ea=Or.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:Or.top+Sa-Oc,width:Ji,height:Math.max(Oc,1),rx:2,fill:"#3b82f6",opacity:.85}),s.jsx("rect",{x:ea+Ws/2,y:Or.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=Or.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:[$te[Q],mt?.key===Q?mt.dir==="desc"?" ↓":" ↑":""]})},Q))]})}),s.jsx("tbody",{children:ue.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:O,onChange:Q=>C(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&void Ld()}),s.jsx(be,{type:"button",size:"sm",disabled:ne||!ze?.propertyId||!O.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:oT(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:oT(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:E,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),fe(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 OS({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(H5,{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 Nu(e){return typeof window>"u"?e:`${window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??""}${e}`}function Eg(e){return e.toLocaleString()}function DOe(e){const t=Number(e);return Number.isFinite(t)?`${(t*100).toFixed(1)}%`:"—"}function MOe(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 IOe(e){const t=e.filter(n=>n.kind===Nt["backlink-extract"]&&!uk(n.status));return t.length===0?null:t.reduce((n,r)=>n.createdAt>r.createdAt?n:r)}function LOe(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 $Oe({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,O]=x.useState(!0),[C,A]=x.useState(!1),[T,E]=x.useState(null),_=x.useRef(null),P=x.useCallback(async()=>{O(!0),E(null);try{const[oe,ye,I,M,q]=await Promise.all([L5().catch(()=>null),bQ(e,{excludeCrawlers:!0}).catch(()=>null),wQ(e,{limit:_l,offset:b,excludeCrawlers:!0}).catch(G=>{if(G instanceof ei&&G.code==="NOT_FOUND")return null;throw G}),jQ(e).catch(()=>[]),lV(e).catch(()=>[])]);d(oe),n(ye),i(I),l(M);const D=IOe(q);p(D),_.current=D?.id??null}catch(oe){E(oe instanceof Error?oe.message:"Failed to load backlinks")}finally{O(!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;uk(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),E(null);try{const oe=await SQ(e);p(oe),_.current=oe.id}catch(oe){oe instanceof ei&&oe.code==="MISSING_DEPENDENCY"?E("DuckDB is not installed. Visit the Backlinks admin page to install it."):E(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(G5,{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(Je,{tone:"neutral",children:f.status}),s.jsxs("span",{className:"text-xs text-zinc-500 tabular-nums",children:[LOe(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(F5,{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:Bte(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:Eg(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:Eg(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:DOe(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 ",MOe(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(Ps,{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(Is,{contentStyle:da.contentStyle,labelStyle:da.labelStyle,itemStyle:da.itemStyle,labelFormatter:fd}),s.jsx(Mu,{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," · ",Eg(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:Eg(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(Ev,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Re-run extract"]}),s.jsxs(OS,{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:Nu("/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(K5,{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:Nu("/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:Nu("/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:Nu("/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(OS,{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:Nu("/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:Nu("/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(OS,{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 BOe({projectName:e}){const t=ua({queryKey:qe.citationVisibility(e),queryFn:()=>dQ(e),staleTime:B5}),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(UOe,{data:n}),s.jsx(qOe,{data:n}),n.competitorGaps.length>0&&s.jsx(GOe,{data:n})]})}function UOe({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(Og,{label:"Cited + mentioned",value:`${n} / ${t}`,helper:"In sources AND named in answer",tone:n>0?"positive":"neutral"}),s.jsx(Og,{label:"Cited only",value:`${r} / ${t}`,helper:"In sources, not named in answer",tone:r>0?"positive-dim":"neutral"}),s.jsx(Og,{label:"Mentioned only",value:`${i} / ${t}`,helper:"Named in answer, no source link",tone:i>0?"caution":"neutral"}),s.jsx(Og,{label:"Invisible",value:`${a} / ${t}`,helper:"No engine cites or mentions",tone:a>0?"negative":"neutral"})]})}function Og({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 qOe({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(FOe,{}),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(ic,{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(yW,{className:"inline h-3.5 w-3.5 text-zinc-700","aria-label":"no data"}):s.jsx(HOe,{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 FOe(){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(Iu,{active:!0,tone:"cited"}),s.jsx("span",{children:"cited (in sources)"})]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Iu,{active:!0,tone:"mentioned"}),s.jsx("span",{children:"mentioned (in answer)"})]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Iu,{active:!1,tone:"cited"}),s.jsx(Iu,{active:!1,tone:"mentioned"}),s.jsx("span",{children:"neither"})]})]})}function HOe({provider:e}){const t=KOe(e);return s.jsxs("span",{className:"inline-flex items-center justify-center gap-1",title:t,children:[s.jsx(Iu,{active:e.cited,tone:"cited"}),s.jsx(Iu,{active:e.mentioned,tone:"mentioned"})]})}function KOe(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 Iu({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 GOe({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(ic,{provider:t.provider})}),s.jsx("td",{className:"text-zinc-300",children:t.citingCompetitors.join(", ")})]},`${t.queryId}::${t.provider}`))})]})})]})}const r9=4;function VOe(e){return e.length<r9}const i9={critical:"negative",high:"negative",medium:"caution",low:"neutral"},QOe={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 $A(e){return Number.isFinite(e)?`${(e*100).toFixed(1)}%`:"—"}function _s(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 a9(e){switch(e){case"up":return"positive";case"down":return"negative";case"flat":return"neutral";case"unknown":return"neutral"}}function s9(e){const t=[e.city,e.region,e.country].filter(Boolean).join(", ");return t?`${e.label} (${t})`:e.label}function WOe(e){switch(e){case"request-param":case"prompt":return"positive";case"browser-geo":return"caution";case"ignored":return"negative"}}const YOe={"request-param":"Request parameter",prompt:"Prompt-injected","browser-geo":"Browser geo",ignored:"Ignored"};function ZOe({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 XOe(e){switch(e){case"High":return"negative";case"Moderate":return"caution";case"Low":return"neutral";case"None":return"neutral"}}function JOe({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:()=>eQ(e)});async function d(){n(!0),i(null);try{await nQ(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: ${s9(f.meta.location)}`:" · No location set"," · ","Generated ",_s(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(Ev,{className:"size-4"}),t?"Preparing…":"Download report HTML"]})]})]}),a==="client"?s.jsxs(s.Fragment,{children:[s.jsx(t_e,{report:f}),s.jsx(LL,{report:f}),s.jsx(DL,{report:f,audience:"client"}),s.jsx(r_e,{report:f})]}):s.jsxs(s.Fragment,{children:[s.jsx(i_e,{report:f}),s.jsx(LL,{report:f}),s.jsx(DL,{report:f,audience:"agency"}),s.jsx(n_e,{report:f}),s.jsx(l_e,{report:f}),s.jsx(c_e,{report:f}),s.jsx(u_e,{report:f}),s.jsx(d_e,{report:f}),s.jsx(h_e,{report:f}),s.jsx(p_e,{report:f}),s.jsx(m_e,{report:f}),s.jsx(g_e,{report:f}),s.jsx(v_e,{report:f}),s.jsx(b_e,{report:f}),s.jsx(w_e,{report:f}),s.jsx(j_e,{report:f}),s.jsx(S_e,{report:f})]})]}):null}function e_e(e,t){return e.audience==="both"||e.audience===t}function t_e({report:e}){const t=e.executiveSummary;return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Et,{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:a9(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 DL({report:e,audience:t}){const n=t==="client"?e.clientSummary.actionItems:e.agencyDiagnostics.priorities.length>0?e.agencyDiagnostics.priorities:e.actionPlan.filter(i=>e_e(i,t)),r=W4(e,n);return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Et,{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(Je,{tone:kte(i),children:H4(i.horizon)}),s.jsx(Je,{tone:"neutral",children:Cte(i.category)}),s.jsxs(Je,{tone:"neutral",children:[Ate(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(qA,{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 n_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(Et,{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(Je,{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(qA,{items:n.evidence,limit:3,className:"mt-3"})]},n.title))})]})}function r_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=Y4(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(Et,{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(Je,{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 i_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=W4(e,p).length,g=o9(e);return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Et,{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:a9(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 · ${$A(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 · ${_s(t.ga.periodStart)} → ${_s(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(Je,{tone:v.tone,children:QOe[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(o_e,{report:e})]})}const a_e=14;function BA(e){return e==="up"?"positive":e==="down"?"negative":"neutral"}function UA(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=BA(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:UA(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 ML({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=BA(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:UA(t.direction)})]}),s.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:[r,ft(t.deltaAbs)," ",n," vs prior ",a_e," days"]})]})}function s_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=BA(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),"% ",UA(n.direction)]})]},n.provider)})})]})})]})}function IL({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(Je,{tone:i9[r.severity],children:F4(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 LL({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(Et,{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(Et,{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(ML,{label:"GSC clicks",delta:t.gscClicksDelta,countLabel:"clicks"}),s.jsx(ML,{label:"AI referral sessions",delta:t.aiReferralsDelta,countLabel:"sessions"})]}),s.jsx(s_e,{movements:t.providerMovements}),s.jsx(IL,{insights:t.wins,heading:"Wins",emptyMessage:"No new gains in the latest check."}),s.jsx(IL,{insights:t.regressions,heading:"Regressions",emptyMessage:"No new regressions in the latest check."})]})}function o_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?s9(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(Je,{tone:WOe(r.treatment),children:YOe[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 l_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(Et,{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(Et,{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(Ps,{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(gc,{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(Is,{...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(ZOe,{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 c_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(Et,{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(Et,{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(Ps,{width:"100%",height:"100%",children:s.jsxs(SN,{data:l,layout:"vertical",margin:{left:20,right:32,top:8,bottom:8},children:[s.jsx(gc,{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(Is,{...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(Ps,{width:"100%",height:"100%",children:s.jsxs(SN,{data:u,layout:"vertical",margin:{left:20,right:32,top:8,bottom:8},children:[s.jsx(gc,{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(Is,{...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(Je,{tone:XOe(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 u_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(Et,{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(Et,{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(Je,{tone:"negative",children:"Tracked competitor"}):s.jsx(Je,{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 o9(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?`${_s(r)} → ${_s(i)}`:_s(r||i)}function d_e({report:e}){const t=e.gsc;if(!t)return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Et,{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=o9(e);return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Et,{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:$A(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(Ps,{width:"100%",height:"100%",children:s.jsxs(LA,{data:t.trend,margin:{left:8,right:12,top:8,bottom:8},children:[s.jsx(gc,{stroke:dd}),s.jsx(Wa,{dataKey:"date",tick:er,stroke:Nr,tickFormatter:hd}),s.jsx(Ya,{tick:er,stroke:Nr}),s.jsx(Is,{...da,labelFormatter:fd}),s.jsx(Kx,{type:"monotone",dataKey:"clicks",stroke:An[0],strokeWidth:2,dot:!0})]})})})]}),t.topQueries.length>0&&s.jsx(f_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($L,{title:"Tracked but no GSC impressions",tone:"caution",items:t.trackedButNoGsc}),t.gscButNotTracked.length>0&&s.jsx($L,{title:"GSC queries not yet tracked",tone:"neutral",items:t.gscButNotTracked})]})]})}function f_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:$A(t.ctr)}),s.jsx("td",{children:t.avgPosition.toFixed(1)}),s.jsx("td",{children:s.jsx(Je,{tone:"neutral",children:t.category})})]},t.query))})]})})]})}function $L({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(Je,{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 h_e({report:e}){const t=e.ga;return t?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Et,{eyebrow:"Section 7",title:"GA4 Traffic",subtitle:`Site traffic from ${_s(t.periodStart)} to ${_s(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(Et,{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 p_e({report:e}){const t=e.socialReferrals;return t?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Et,{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(Et,{eyebrow:"Section 8",title:"Social Referrals",subtitle:"Social traffic split by channel and campaign."}),s.jsx(Cr,{message:"No social referral data."})]})}function m_e({report:e}){const t=e.aiReferrals;return t?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Et,{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(Ps,{width:"100%",height:"100%",children:s.jsxs(LA,{data:t.trend,margin:{left:8,right:12,top:8,bottom:8},children:[s.jsx(gc,{stroke:dd}),s.jsx(Wa,{dataKey:"date",tick:er,stroke:Nr,tickFormatter:hd}),s.jsx(Ya,{tick:er,stroke:Nr}),s.jsx(Is,{...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(Et,{eyebrow:"Section 9",title:"AI Referral Traffic",subtitle:"Traffic arriving from AI answer engines."}),s.jsx(Cr,{message:"No AI referral data."})]})}function g_e({report:e}){const t=e.indexingHealth;if(!t||!t.provider)return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Et,{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(Et,{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(y_e,{ih:t})]})}function y_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 v_e({report:e}){const t=e.citationsTrend;return t.length===0?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Et,{eyebrow:"Section 11",title:"Citations Over Time",subtitle:"Citation coverage across recent checks."}),s.jsx(Cr,{message:"Run multiple checks to see a trend."})]}):VOe(t)?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Et,{eyebrow:"Section 11",title:"Citations Over Time",subtitle:"Citation coverage across recent checks."}),s.jsx(Cr,{message:`Building baseline (${t.length} of ${r9} checks completed). Trend will appear once more checks are recorded.`})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Et,{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(Ps,{width:"100%",height:"100%",children:s.jsxs(LA,{data:t,margin:{left:8,right:12,top:8,bottom:8},children:[s.jsx(gc,{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(Is,{...da,labelFormatter:fd,formatter:n=>`${n}%`}),s.jsx(Kx,{type:"monotone",dataKey:"citationRate",stroke:An[0],strokeWidth:2,dot:!0})]})})}),s.jsx(x_e,{trend:t})]})}function x_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:_s(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 b_e({report:e}){return e.insights.length===0?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Et,{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(Et,{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(Je,{tone:i9[t.severity],children:F4(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 w_e({report:e}){const t=Y4(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(Et,{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:[aT(i.action)," · ",sT(i.actionConfidence)," confidence"]}),s.jsx(qA,{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(Je,{tone:"neutral",children:aT(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:bte(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(Je,{tone:"neutral",children:sT(i.actionConfidence)})})]},i.targetRef))})]})})]})}function j_e({report:e}){return e.contentGaps.length===0?null:s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Et,{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 S_e({report:e}){return e.recommendedNextSteps.length===0?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Et,{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(Et,{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:H4(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 Et({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 qA({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 N_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,O]=x.useState(e.ownedDomains??[]),[C,A]=x.useState(""),[T,E]=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),O(e.ownedDomains??[]))},[e,r]);function M(){i(!1),d(null),p(e.displayName),g(e.canonicalDomain),j(e.country),S(e.language),O(e.ownedDomains??[]),A("")}function q(){const Y=C.trim();Y&&(k.includes(Y)||O([...k,Y]),A(""))}function D(Y){O(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),E(null);try{const Ve={label:Y,city:He,region:Pe,country:at};ye.trim()&&(Ve.timezone=ye.trim()),await mV(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){E(Ve instanceof Error?Ve.message:"Failed to add location")}finally{P(!1)}}}async function ne(Y){P(!0),E(null);try{await gV(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){E(He instanceof Error?He.message:"Failed to remove location")}finally{P(!1)}}async function Ce(Y){P(!0),E(null);try{await yV(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){E(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",me="block text-xs font-medium text-zinc-400 mb-1",Oe=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:me,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:me,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:me,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:me,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:me,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:()=>E(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:_||!Oe,onClick:se,children:_?"Adding...":"Add location"}),s.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:_,onClick:()=>{F(!1),E(null)},children:"Cancel"})]})]}):s.jsx(be,{type:"button",size:"sm",variant:"outline",onClick:()=>F(!0),children:"+ Add location"})]})]})]})})})]})}const k_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"}],BL=["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 C_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,O]=x.useState(!1),[C,A]=x.useState(!1),[T,E]=x.useState(null);x.useEffect(()=>{kV(e).then(n).catch(()=>n(null))},[e]);const _=()=>{if(t&&t!=="loading"){const U=Fte(t.preset??null,t.cronExpr);l(U.freq),d(U.hour),p(U.customCron);const B=BL.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("");E(null),i(!0)},P=async()=>{O(!0),E(null);try{const B={timezone:v?b.trim()||"UTC":m};a==="custom"?B.cron=f.trim():B.preset=qte(a,u);const V=await N2(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){E(U instanceof Error?U.message:"Failed to save schedule")}finally{O(!1)}},$=async()=>{if(!(!t||t==="loading")){O(!0),E(null);try{const U={timezone:t.timezone,enabled:!t.enabled};t.preset?U.preset=t.preset:U.cron=t.cronExpr;const B=await N2(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){E(U instanceof Error?U.message:"Failed to update schedule")}finally{O(!1)}}},F=async()=>{A(!0),E(null);try{await CV(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){E(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(Je,{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:k_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:[BL.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),E(null)},children:"Cancel"}),s.jsx(be,{type:"button",size:"sm",disabled:k||a==="custom"&&!f.trim(),onClick:P,children:k?"Saving...":"Save schedule"})]})]})]})}const A_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 E_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(()=>{AV(e).then(n).catch(()=>n([]))},[e]);const k=T=>{d(E=>E.includes(T)?E.filter(_=>_!==T):[...E,T])},O=async()=>{if(!(!a.trim()||u.length===0)){p(!0),g(null);try{const T=await EV(e,{channel:"webhook",url:a.trim(),events:u});n(E=>E==="loading"?[T]:[...E,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(E=>new Set(E).add(T));try{await OV(e,T),n(E=>E==="loading"?E:E.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(E){g(E instanceof Error?E.message:"Failed to remove webhook")}finally{S(E=>{const _=new Set(E);return _.delete(T),_})}}},A=async T=>{j(E=>({...E,[T]:{state:"testing"}}));try{const E=await _V(e,T);j(_=>({..._,[T]:{state:E.ok?"ok":"fail",status:E.status}})),E.ok&&vt({title:"Test notification sent",detail:`Webhook returned status ${E.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${T}`,dedupeMode:"replace"})}catch{j(E=>({...E,[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:A_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:O,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(E=>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:E.replace("."," ")},E))})}),s.jsx("td",{children:s.jsx(Je,{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 E=v[T.id],_=E.state==="testing"?"Sending…":E.state==="ok"?`Delivered${E.status?` (${E.status})`:""}`:`Failed${E.status?` (${E.status})`:""}`;return s.jsx(Je,{tone:E.state==="ok"?"positive":E.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 O_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,O]=x.useState(""),[C,A]=x.useState(""),[T,E]=x.useState(!0),[_,P]=x.useState(!1),[$,F]=x.useState(null),[U,B]=x.useState("coverage");x.useEffect(()=>{V()},[e,t]);async function V(){E(!0),F(null);try{const M=await n.fetchQuery({queryKey:qe.bing.status(e),queryFn:()=>R5(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:()=>D5(e).catch(()=>[]),staleTime:jr}),n.fetchQuery({queryKey:qe.bing.performance(e),queryFn:()=>XV(e).catch(()=>[]),staleTime:jr}),M.siteUrl?Promise.resolve([]):n.fetchQuery({queryKey:qe.bing.sites(e),queryFn:()=>YV(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{E(!1)}}async function X(){if(k.trim()){F(null);try{const M=await QV(e,k.trim());await n.invalidateQueries({queryKey:qe.bing.project(e)}),O(""),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 WV(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 ZV(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 M5(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 A2(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 A2(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(Je,{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=>O(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(Je,{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(Je,{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(Je,{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 __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,O]=x.useState(!1),[C,A]=x.useState(null),[T,E]=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:()=>T5(e).catch(()=>[]),staleTime:jr}),t.fetchQuery({queryKey:qe.bing.status(e),queryFn:()=>R5(e).catch(()=>null),staleTime:jr})]),ne=G.find(ee=>ee.connectionType==="gsc")??null;g(!!D?.google?.configured),O(!!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),E(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 P5(e);if(!ee?.id)return;const me=2e3,Y=Date.now()+12e4;for(;Date.now()<Y;){if(D.aborted||(await new Promise(Pe=>setTimeout(Pe,me)),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 D5(e).catch(()=>[]),me=[...new Set(ee.map(Oe=>Oe.url))];if(me.length!==0)for(let Oe=0;Oe<me.length;Oe+=ne){if(D.aborted)return;const Y=me.slice(Oe,Oe+ne),Pe=(await Promise.allSettled(Y.map(at=>M5(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(qP,{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(qP,{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(ROe,{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(O_e,{projectName:e,refreshNonce:_})]})]})}function z_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(Je,{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(ic,{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}=jc();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=Xie(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,O]=x.useState(!1),[C,A]=x.useState(""),[T,E]=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=n9(),se=(l?.recentRuns??[]).some(je=>je.kind===Nt["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),_5(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 Xe of J){for(const[Rt,mt]of Object.entries(Xe.providerRuns??{}))je.set(`${Xe.query}::${Rt}`,mt.map(et=>({runId:et.runId,citationState:et.citationState,createdAt:et.createdAt,answerMentioned:et.answerMentioned,visibilityState:et.visibilityState,visibilityTransition:et.visibilityTransition})));(!Xe.providerRuns||Object.keys(Xe.providerRuns).length===0)&&je.set(`${Xe.query}::`,Xe.runs.map(Rt=>({runId:Rt.runId,citationState:Rt.citationState,createdAt:Rt.createdAt,answerMentioned:Rt.answerMentioned,visibilityState:Rt.visibilityState,visibilityTransition:Rt.visibilityTransition})))}return je},[J]),me=x.useMemo(()=>{const je=V!==void 0?M.filter(Xe=>V===""?!Xe.location:Xe.location===V):M;return ee?je.map(Xe=>{const Rt=ee.get(`${Xe.query}::${Xe.provider}`)??ee.get(`${Xe.query}::`);return Rt?{...Xe,runHistory:Rt}:Xe}):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 Oe(){try{await G.mutateAsync({projectName:q,projectLabel:D,sourceAction:"project-run"}),a()}catch{}}async function Y(){p(!0);try{await vV(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 xV(q),Xe=typeof je=="string"?je:JSON.stringify(je,null,2),Rt=new Blob([Xe],{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(Xe=>Xe.trim()).filter(Boolean);if(je.length!==0){S(!0);try{await fV(q,je),a(),j(""),g(!1)}finally{S(!1)}}}async function at(){const je=C.trim();if(je){E(!0);try{const Rt=(await O5(q)).map(et=>et.domain),mt=[...new Set([...Rt,je])];await z5(q,mt),a(),A(""),O(!1)}finally{E(!1)}}}async function Ve(){const je=$.trim();if(je){B(!0);try{const Xe=l?.project.ownedDomains??[];await S2(q,[...Xe,je]),a(),F(""),P(!1)}finally{B(!1)}}}async function Ht(je){B(!0);try{const Xe=l?.project.ownedDomains??[];await S2(q,Xe.filter(Rt=>Rt!==je)),a()}finally{B(!1)}}async function Lt(je,Xe){await hV(je,Xe),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(Ev,{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(Q5,{className:"h-4 w-4 text-zinc-400"})}),s.jsx(be,{type:"button",disabled:G.isPending||se,onClick:Oe,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(Ide,{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(BOe,{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(ic,{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(z_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(Bde,{evidence:me})]}),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:()=>O(!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(Ude,{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(_B,{run:je},je.id))})]}),s.jsx(N_e,{project:{...l.project,displayName:l.project.displayName??l.project.name,defaultLocation:l.project.defaultLocation??null},onUpdateProject:Lt,onRefresh:()=>{a()}}),s.jsx(C_e,{projectName:l.project.name}),s.jsx(E_e,{projectName:l.project.name})]}):e==="report"?s.jsx(JOe,{projectName:l.project.name}):e==="traffic"?s.jsx(xOe,{projectName:l.project.name}):e==="inbound"?s.jsx($Oe,{projectName:l.project.name}):s.jsx(__e,{projectName:l.project.name})]})}function T_e(){const{dashboard:e,isLoading:t}=jc(),n=OOe();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(_B,{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 P_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,O]=x.useState(!1),[C,A]=x.useState(null),[T,E]=x.useState(!1),_=i?u.trim().length>0:a.trim().length>0;async function P(){if(_){O(!0),A(null),E(!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 SV(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(""),E(!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{O(!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 R_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 NV({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 D_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(()=>{k2().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(Je,{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 VV(l,parseInt(d,10)||9222);const v=await k2().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 M_e={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function I_e(){const e=Gh(),{dashboard:t}=jc(),n=t?.settings??e?.dashboard?.settings,a=Uv(!e,e?.health).data??e?.health??M_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),[O,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(Je,{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(P_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(Je,{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(R_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(Je,{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}),O&&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 JV(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(D_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(Je,{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(Je,{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 L_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 $_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 B_e(){const e=Gh(),{dashboard:t,isLoading:n,refetch:r}=jc(),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=Wte(i.setup,d,a),p=Wo(),[m,g]=x.useState(0),[v,j]=x.useState(""),[b,S]=x.useState(""),[k,O]=x.useState(""),[C,A]=x.useState("US"),[T,E]=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),[me,Oe]=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),[Xe,Rt]=x.useState(!1),[mt,et]=x.useState(!1),ue=n9(),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)}}},En=async()=>{if(!$)return;const he=Me;if(he.length!==0){G(!0),q(null);try{await dV($,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)){Oe(!0),He(null);try{const he=await zV($,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{Oe(!1)}}},We=async()=>{if(!$)return;const he=Ge;if(he.length!==0){je(!0),cn(null);try{await z5($,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 ue.mutateAsync({projectName:$,projectLabel:b||v||$,sourceAction:"setup-launch"}),Rt(!0),r()}catch{}finally{et(!1)}}},fe=()=>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(Je,{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(Je,{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:fe,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=>O(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=>E(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:fe,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(Je,{tone:"positive",children:[Me.length," saved"]}):s.jsxs(Je,{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:fe,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:me||!ne,onClick:gn,children:me?"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:fe,children:"Back"}),s.jsx(be,{type:"button",disabled:Me.length===0||D,onClick:En,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(Je,{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:fe,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:fe,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"})]}),Xe?s.jsx(Je,{tone:"positive",children:"Queued"}):null]}),Xe?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:fe,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($_e,{current:m,labels:L_e}),s.jsx("section",{className:"setup-wizard",children:ze})]})}function ku({children:e,label:t="More info",placement:n="top",className:r}){const i=x.useId(),[a,l]=x.useState(!1);return s.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[s.jsx("button",{type:"button","aria-label":t,"aria-describedby":a?i:void 0,className:"inline-flex h-4 w-4 items-center justify-center rounded-full text-zinc-500 hover:text-zinc-200 focus:text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onFocus:()=>l(!0),onBlur:()=>l(!1),children:s.jsx(H5,{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 U_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 q_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(""),[O,C]=x.useState(!1),[A,T]=x.useState(null),[E,_]=x.useState(null),P=x.useCallback(async()=>{m(!0),T(null);try{const[V,X,Z,H,J]=await Promise.all([hQ(),L5().catch(()=>null),mQ().catch(()=>[]),yQ().catch(()=>[]),vQ().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 pQ();_(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 gQ(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 xQ(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})}),E&&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:E})}),s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dependency"}),s.jsxs("h2",{className:"flex items-center gap-2",children:["DuckDB install status",s.jsxs(ku,{label:"Why DuckDB?",children:[s.jsx("span",{className:"block",children:"DuckDB is a query engine canonry uses to scan the ~16 GB Common Crawl dumps and pull out your referring domains."}),s.jsxs("span",{className:"mt-2 block text-zinc-400",children:["It does ",s.jsx("span",{className:"text-zinc-200",children:"not"})," store any canonry data — your backlink results live in SQLite alongside the rest of your projects. DuckDB is purely a tool for processing the raw CSV files."]}),s.jsxs("span",{className:"mt-2 block text-zinc-500",children:["Installed on demand (not bundled) into ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/plugins/"})," so users who never run backlinks don’t pay the ~40 MB install cost."]})]})]})]}),e?.duckdbInstalled?s.jsx(Je,{tone:"positive",children:"Installed"}):s.jsx(Je,{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(F5,{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(GQ,{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(Ev,{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(ku,{label:"What is a release sync?",children:"A release sync downloads one Common Crawl dump (~16 GB) and extracts backlinks for every project in this workspace in one pass. This is the heavy job — subsequent per-project re-runs skip the download and just re-query the cached files."})]})]}),n&&s.jsx(Je,{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(ku,{label:"What are rows?",children:"Total number of (project, referring domain) pairs persisted in SQLite from this sync, across every project in the workspace."})]}),s.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.domainsDiscovered??"—"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Started"}),s.jsx("p",{className:"text-zinc-300 mt-0.5",children:_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:U_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(JQ,{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(ku,{label:"What does Run sync do?",children:[s.jsxs("span",{className:"block",children:["Downloads the auto-detected (or chosen) Common Crawl release (~16 GB) to"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),", then runs a single DuckDB query that extracts referring domains for every project in this workspace."]}),s.jsxs("span",{className:"mt-2 block text-zinc-400",children:["First time for a release: ",s.jsx("span",{className:"text-zinc-200",children:"~10–20 min download + ~5 min query"}),". Re-running the same release later: ",s.jsx("span",{className:"text-zinc-200",children:"skips download, just re-queries"})," (~5 min)."]})]})]})]}),O?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(ku,{label:"What is this?",children:[s.jsxs("span",{className:"block",children:["Raw Common Crawl dumps stored at"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/<release>/"}),". Each release takes ~16 GB."]}),s.jsxs("span",{className:"mt-2 block text-zinc-400",children:["These files are needed to re-run per-project extracts against a release without re-downloading. Pruning here ",s.jsx("span",{className:"text-zinc-200",children:"does not delete your backlink data"})," — that lives in SQLite."]})]})]})]})}),s.jsx("p",{className:"text-xs text-zinc-500 mb-3 max-w-3xl",children:"Each cached release is a ~16 GB pair of gzipped files. They’re needed to re-query the graph (e.g. for a newly-added project) without re-downloading. Safe to prune — backlink results persist in SQLite."}),s.jsx($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(Je,{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(Q5,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),"Prune"]}),s.jsx(ku,{label:"What does Prune do?",placement:"top",children:"Deletes the ~16 GB cache for this release from disk. Backlink results already in SQLite remain untouched. To re-run extracts against this release, you’d have to sync it again (another ~16 GB download)."})]})})]},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(Je,{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 F_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 H_e(){return s.jsx(wue,{children:s.jsx(bue,{})})}const Hi=FG()({component:H_e,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),K_e=ti({getParentRoute:()=>Hi,path:"/",component:Nue,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(qe.projects.all);if(t&&t.length===0)throw MN({to:"/setup"})}}),G_e=ti({getParentRoute:()=>Hi,path:"/projects",component:Mde}),Rd=ti({getParentRoute:()=>Hi,path:"/projects/$projectId",component:()=>s.jsx(KN,{})}),V_e=ti({getParentRoute:()=>Rd,path:"/",component:()=>s.jsx(jp,{tab:"overview"})}),Q_e=ti({getParentRoute:()=>Rd,path:"/search-console",component:()=>s.jsx(jp,{tab:"search-console"})}),W_e=ti({getParentRoute:()=>Rd,path:"/report",component:()=>s.jsx(jp,{tab:"report"})}),Y_e=ti({getParentRoute:()=>Rd,path:"/traffic",component:()=>s.jsx(jp,{tab:"traffic"})}),Z_e=ti({getParentRoute:()=>Rd,path:"/inbound",component:()=>s.jsx(jp,{tab:"inbound"})}),X_e=ti({getParentRoute:()=>Hi,path:"/runs",component:T_e}),J_e=ti({getParentRoute:()=>Hi,path:"/settings",component:I_e,beforeLoad:({context:e})=>{}}),eze=ti({getParentRoute:()=>Hi,path:"/setup",component:B_e,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(qe.projects.all);if(t&&t.length>0)throw MN({to:"/"})}}),tze=ti({getParentRoute:()=>Hi,path:"/backlinks",component:q_e}),nze=ti({getParentRoute:()=>Hi,path:"*",component:F_e}),rze=Hi.addChildren([K_e,G_e,Rd.addChildren([V_e,Q_e,W_e,Y_e,Z_e]),X_e,J_e,eze,tze,nze]);function ize(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const UL=ize(),aze=UL==="/"?"":UL.replace(/\/$/,"");function sze(e,t){return JG({routeTree:rze,basepath:aze||"/",context:{queryClient:e},...t?.initialEntries})}const l9=zQ(),oze=sze(l9),c9=document.getElementById("root");if(!c9)throw new Error("Expected #root element for web app bootstrap.");function lze(){const[e,t]=x.useState(j2()?"ready":"checking"),[n,r]=x.useState(""),[i,a]=x.useState(""),[l,u]=x.useState(null),[d,f]=x.useState(!1);x.useEffect(()=>{if(j2())return;let g=!1;return bV().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 wV(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 jV(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(ZK,{client:l9,children:s.jsx(nV,{router:oze})}):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"})]})})]})})})})}CK.createRoot(c9).render(s.jsx(x.StrictMode,{children:s.jsx(lze,{})}));