@ainyc/canonry 2.2.3 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,301 @@
1
+ function qq(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function ja(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ox={exports:{}},$d={};var lE;function Hq(){if(lE)return $d;lE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var u in i)u!=="key"&&(a[u]=i[u])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:a}}return $d.Fragment=t,$d.jsx=n,$d.jsxs=n,$d}var cE;function Kq(){return cE||(cE=1,ox.exports=Hq()),ox.exports}var c=Kq(),lx={exports:{}},Je={};var uE;function Gq(){if(uE)return Je;uE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),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"),y=Symbol.iterator;function v(U){return U===null||typeof U!="object"?null:(U=y&&U[y]||U["@@iterator"],typeof U=="function"?U:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,j={};function k(U,F,D){this.props=U,this.context=F,this.refs=j,this.updater=D||w}k.prototype.isReactComponent={},k.prototype.setState=function(U,F){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,F,"setState")},k.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function A(){}A.prototype=k.prototype;function _(U,F,D){this.props=U,this.context=F,this.refs=j,this.updater=D||w}var C=_.prototype=new A;C.constructor=_,S(C,k.prototype),C.isPureReactComponent=!0;var P=Array.isArray;function E(){}var O={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function M(U,F,D){var Y=D.ref;return{$$typeof:e,type:U,key:F,ref:Y!==void 0?Y:null,props:D}}function q(U,F){return M(U.type,F,U.props)}function $(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function L(U){var F={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(D){return F[D]})}var J=/\/+/g;function ae(U,F){return typeof U=="object"&&U!==null&&U.key!=null?L(""+U.key):F.toString(36)}function Z(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(E,E):(U.status="pending",U.then(function(F){U.status==="pending"&&(U.status="fulfilled",U.value=F)},function(F){U.status==="pending"&&(U.status="rejected",U.reason=F)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function H(U,F,D,Y,se){var ie=typeof U;(ie==="undefined"||ie==="boolean")&&(U=null);var fe=!1;if(U===null)fe=!0;else switch(ie){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(U.$$typeof){case e:case t:fe=!0;break;case p:return fe=U._init,H(fe(U._payload),F,D,Y,se)}}if(fe)return se=se(U),fe=Y===""?"."+ae(U,0):Y,P(se)?(D="",fe!=null&&(D=fe.replace(J,"$&/")+"/"),H(se,F,D,"",function(ue){return ue})):se!=null&&($(se)&&(se=q(se,D+(se.key==null||U&&U.key===se.key?"":(""+se.key).replace(J,"$&/")+"/")+fe)),F.push(se)),1;fe=0;var je=Y===""?".":Y+":";if(P(U))for(var ee=0;ee<U.length;ee++)Y=U[ee],ie=je+ae(Y,ee),fe+=H(Y,F,D,ie,se);else if(ee=v(U),typeof ee=="function")for(U=ee.call(U),ee=0;!(Y=U.next()).done;)Y=Y.value,ie=je+ae(Y,ee++),fe+=H(Y,F,D,ie,se);else if(ie==="object"){if(typeof U.then=="function")return H(Z(U),F,D,Y,se);throw F=String(U),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return fe}function Q(U,F,D){if(U==null)return U;var Y=[],se=0;return H(U,Y,"","",function(ie){return F.call(D,ie,se++)}),Y}function he(U){if(U._status===-1){var F=U._result;F=F(),F.then(function(D){(U._status===0||U._status===-1)&&(U._status=1,U._result=D)},function(D){(U._status===0||U._status===-1)&&(U._status=2,U._result=D)}),U._status===-1&&(U._status=0,U._result=F)}if(U._status===1)return U._result.default;throw U._result}var we=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},R={map:Q,forEach:function(U,F,D){Q(U,function(){F.apply(this,arguments)},D)},count:function(U){var F=0;return Q(U,function(){F++}),F},toArray:function(U){return Q(U,function(F){return F})||[]},only:function(U){if(!$(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return Je.Activity=m,Je.Children=R,Je.Component=k,Je.Fragment=n,Je.Profiler=i,Je.PureComponent=_,Je.StrictMode=r,Je.Suspense=d,Je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Je.__COMPILER_RUNTIME={__proto__:null,c:function(U){return O.H.useMemoCache(U)}},Je.cache=function(U){return function(){return U.apply(null,arguments)}},Je.cacheSignal=function(){return null},Je.cloneElement=function(U,F,D){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var Y=S({},U.props),se=U.key;if(F!=null)for(ie in F.key!==void 0&&(se=""+F.key),F)!T.call(F,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&F.ref===void 0||(Y[ie]=F[ie]);var ie=arguments.length-2;if(ie===1)Y.children=D;else if(1<ie){for(var fe=Array(ie),je=0;je<ie;je++)fe[je]=arguments[je+2];Y.children=fe}return M(U.type,se,Y)},Je.createContext=function(U){return U={$$typeof:o,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:a,_context:U},U},Je.createElement=function(U,F,D){var Y,se={},ie=null;if(F!=null)for(Y in F.key!==void 0&&(ie=""+F.key),F)T.call(F,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(se[Y]=F[Y]);var fe=arguments.length-2;if(fe===1)se.children=D;else if(1<fe){for(var je=Array(fe),ee=0;ee<fe;ee++)je[ee]=arguments[ee+2];se.children=je}if(U&&U.defaultProps)for(Y in fe=U.defaultProps,fe)se[Y]===void 0&&(se[Y]=fe[Y]);return M(U,ie,se)},Je.createRef=function(){return{current:null}},Je.forwardRef=function(U){return{$$typeof:u,render:U}},Je.isValidElement=$,Je.lazy=function(U){return{$$typeof:p,_payload:{_status:-1,_result:U},_init:he}},Je.memo=function(U,F){return{$$typeof:f,type:U,compare:F===void 0?null:F}},Je.startTransition=function(U){var F=O.T,D={};O.T=D;try{var Y=U(),se=O.S;se!==null&&se(D,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(E,we)}catch(ie){we(ie)}finally{F!==null&&D.types!==null&&(F.types=D.types),O.T=F}},Je.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},Je.use=function(U){return O.H.use(U)},Je.useActionState=function(U,F,D){return O.H.useActionState(U,F,D)},Je.useCallback=function(U,F){return O.H.useCallback(U,F)},Je.useContext=function(U){return O.H.useContext(U)},Je.useDebugValue=function(){},Je.useDeferredValue=function(U,F){return O.H.useDeferredValue(U,F)},Je.useEffect=function(U,F){return O.H.useEffect(U,F)},Je.useEffectEvent=function(U){return O.H.useEffectEvent(U)},Je.useId=function(){return O.H.useId()},Je.useImperativeHandle=function(U,F,D){return O.H.useImperativeHandle(U,F,D)},Je.useInsertionEffect=function(U,F){return O.H.useInsertionEffect(U,F)},Je.useLayoutEffect=function(U,F){return O.H.useLayoutEffect(U,F)},Je.useMemo=function(U,F){return O.H.useMemo(U,F)},Je.useOptimistic=function(U,F){return O.H.useOptimistic(U,F)},Je.useReducer=function(U,F,D){return O.H.useReducer(U,F,D)},Je.useRef=function(U){return O.H.useRef(U)},Je.useState=function(U){return O.H.useState(U)},Je.useSyncExternalStore=function(U,F,D){return O.H.useSyncExternalStore(U,F,D)},Je.useTransition=function(){return O.H.useTransition()},Je.version="19.2.4",Je}var dE;function Ou(){return dE||(dE=1,lx.exports=Gq()),lx.exports}var b=Ou();const Hi=ja(b),Ty=qq({__proto__:null,default:Hi},[b]);var cx={exports:{}},Bd={},ux={exports:{}},dx={};var fE;function Vq(){return fE||(fE=1,(function(e){function t(H,Q){var he=H.length;H.push(Q);e:for(;0<he;){var we=he-1>>>1,R=H[we];if(0<i(R,Q))H[we]=Q,H[he]=R,he=we;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var Q=H[0],he=H.pop();if(he!==Q){H[0]=he;e:for(var we=0,R=H.length,U=R>>>1;we<U;){var F=2*(we+1)-1,D=H[F],Y=F+1,se=H[Y];if(0>i(D,he))Y<R&&0>i(se,D)?(H[we]=se,H[Y]=he,we=Y):(H[we]=D,H[F]=he,we=F);else if(Y<R&&0>i(se,he))H[we]=se,H[Y]=he,we=Y;else break e}}return Q}function i(H,Q){var he=H.sortIndex-Q.sortIndex;return he!==0?he:H.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var d=[],f=[],p=1,m=null,y=3,v=!1,w=!1,S=!1,j=!1,k=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function C(H){for(var Q=n(f);Q!==null;){if(Q.callback===null)r(f);else if(Q.startTime<=H)r(f),Q.sortIndex=Q.expirationTime,t(d,Q);else break;Q=n(f)}}function P(H){if(S=!1,C(H),!w)if(n(d)!==null)w=!0,E||(E=!0,L());else{var Q=n(f);Q!==null&&Z(P,Q.startTime-H)}}var E=!1,O=-1,T=5,M=-1;function q(){return j?!0:!(e.unstable_now()-M<T)}function $(){if(j=!1,E){var H=e.unstable_now();M=H;var Q=!0;try{e:{w=!1,S&&(S=!1,A(O),O=-1),v=!0;var he=y;try{t:{for(C(H),m=n(d);m!==null&&!(m.expirationTime>H&&q());){var we=m.callback;if(typeof we=="function"){m.callback=null,y=m.priorityLevel;var R=we(m.expirationTime<=H);if(H=e.unstable_now(),typeof R=="function"){m.callback=R,C(H),Q=!0;break t}m===n(d)&&r(d),C(H)}else r(d);m=n(d)}if(m!==null)Q=!0;else{var U=n(f);U!==null&&Z(P,U.startTime-H),Q=!1}}break e}finally{m=null,y=he,v=!1}Q=void 0}}finally{Q?L():E=!1}}}var L;if(typeof _=="function")L=function(){_($)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,ae=J.port2;J.port1.onmessage=$,L=function(){ae.postMessage(null)}}else L=function(){k($,0)};function Z(H,Q){O=k(function(){H(e.unstable_now())},Q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(H){switch(y){case 1:case 2:case 3:var Q=3;break;default:Q=y}var he=y;y=Q;try{return H()}finally{y=he}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(H,Q){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var he=y;y=H;try{return Q()}finally{y=he}},e.unstable_scheduleCallback=function(H,Q,he){var we=e.unstable_now();switch(typeof he=="object"&&he!==null?(he=he.delay,he=typeof he=="number"&&0<he?we+he:we):he=we,H){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=he+R,H={id:p++,callback:Q,priorityLevel:H,startTime:he,expirationTime:R,sortIndex:-1},he>we?(H.sortIndex=he,t(f,H),n(d)===null&&H===n(f)&&(S?(A(O),O=-1):S=!0,Z(P,he-we))):(H.sortIndex=R,t(d,H),w||v||(w=!0,E||(E=!0,L()))),H},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(H){var Q=y;return function(){var he=y;y=Q;try{return H.apply(this,arguments)}finally{y=he}}}})(dx)),dx}var hE;function Zq(){return hE||(hE=1,ux.exports=Vq()),ux.exports}var fx={exports:{}},er={};var pE;function Yq(){if(pE)return er;pE=1;var e=Ou();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(d,f,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:d,containerInfo:f,implementation:p}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return er.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,er.createPortal=function(d,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return a(d,f,null,p)},er.flushSync=function(d){var f=o.T,p=r.p;try{if(o.T=null,r.p=2,d)return d()}finally{o.T=f,r.p=p,r.d.f()}},er.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},er.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},er.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,m=u(p,f.crossOrigin),y=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:v}):p==="script"&&r.d.X(d,{crossOrigin:m,integrity:y,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},er.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=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)},er.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})}},er.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)},er.requestFormReset=function(d){r.d.r(d)},er.unstable_batchedUpdates=function(d,f){return d(f)},er.useFormState=function(d,f,p){return o.H.useFormState(d,f,p)},er.useFormStatus=function(){return o.H.useHostTransitionStatus()},er.version="19.2.4",er}var mE;function WD(){if(mE)return fx.exports;mE=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(),fx.exports=Yq(),fx.exports}var gE;function Wq(){if(gE)return Bd;gE=1;var e=Zq(),t=Ou(),n=WD();function r(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var l=s,h=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(h=l.return),s=l.return;while(s)}return l.tag===3?h:null}function o(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function u(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function d(s){if(a(s)!==s)throw Error(r(188))}function f(s){var l=s.alternate;if(!l){if(l=a(s),l===null)throw Error(r(188));return l!==s?null:s}for(var h=s,g=l;;){var x=h.return;if(x===null)break;var N=x.alternate;if(N===null){if(g=x.return,g!==null){h=g;continue}break}if(x.child===N.child){for(N=x.child;N;){if(N===h)return d(x),s;if(N===g)return d(x),l;N=N.sibling}throw Error(r(188))}if(h.return!==g.return)h=x,g=N;else{for(var z=!1,I=x.child;I;){if(I===h){z=!0,h=x,g=N;break}if(I===g){z=!0,g=x,h=N;break}I=I.sibling}if(!z){for(I=N.child;I;){if(I===h){z=!0,h=N,g=x;break}if(I===g){z=!0,g=N,h=x;break}I=I.sibling}if(!z)throw Error(r(189))}}if(h.alternate!==g)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?s:l}function p(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=p(s),l!==null)return l;s=s.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),_=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function L(s){return s===null||typeof s!="object"?null:(s=$&&s[$]||s["@@iterator"],typeof s=="function"?s:null)}var J=Symbol.for("react.client.reference");function ae(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===J?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case k:return"Profiler";case j:return"StrictMode";case P:return"Suspense";case E:return"SuspenseList";case M:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case w:return"Portal";case _:return s.displayName||"Context";case A:return(s._context.displayName||"Context")+".Consumer";case C:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case O:return l=s.displayName||null,l!==null?l:ae(s.type)||"Memo";case T:l=s._payload,s=s._init;try{return ae(s(l))}catch{}}return null}var Z=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he={pending:!1,data:null,method:null,action:null},we=[],R=-1;function U(s){return{current:s}}function F(s){0>R||(s.current=we[R],we[R]=null,R--)}function D(s,l){R++,we[R]=s.current,s.current=l}var Y=U(null),se=U(null),ie=U(null),fe=U(null);function je(s,l){switch(D(ie,l),D(se,s),D(Y,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?zO(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=zO(l),s=TO(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}F(Y),D(Y,s)}function ee(){F(Y),F(se),F(ie)}function ue(s){s.memoizedState!==null&&D(fe,s);var l=Y.current,h=TO(l,s.type);l!==h&&(D(se,s),D(Y,h))}function Ae(s){se.current===s&&(F(Y),F(se)),fe.current===s&&(F(fe),Md._currentValue=he)}var W,Ke;function Re(s){if(W===void 0)try{throw Error()}catch(h){var l=h.stack.trim().match(/\n( *(at )?)/);W=l&&l[1]||"",Ke=-1<h.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+W+s+Ke}var it=!1;function at(s,l){if(!s||it)return"";it=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(l){var ye=function(){throw Error()};if(Object.defineProperty(ye.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ye,[])}catch(ce){var oe=ce}Reflect.construct(s,[],ye)}else{try{ye.call()}catch(ce){oe=ce}s.call(ye.prototype)}}else{try{throw Error()}catch(ce){oe=ce}(ye=s())&&typeof ye.catch=="function"&&ye.catch(function(){})}}catch(ce){if(ce&&oe&&typeof ce.stack=="string")return[ce.stack,oe.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=g.DetermineComponentFrameRoot(),z=N[0],I=N[1];if(z&&I){var K=z.split(`
4
+ `),re=I.split(`
5
+ `);for(x=g=0;g<K.length&&!K[g].includes("DetermineComponentFrameRoot");)g++;for(;x<re.length&&!re[x].includes("DetermineComponentFrameRoot");)x++;if(g===K.length||x===re.length)for(g=K.length-1,x=re.length-1;1<=g&&0<=x&&K[g]!==re[x];)x--;for(;1<=g&&0<=x;g--,x--)if(K[g]!==re[x]){if(g!==1||x!==1)do if(g--,x--,0>x||K[g]!==re[x]){var de=`
6
+ `+K[g].replace(" at new "," at ");return s.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",s.displayName)),de}while(1<=g&&0<=x);break}}}finally{it=!1,Error.prepareStackTrace=h}return(h=s?s.displayName||s.name:"")?Re(h):""}function At(s,l){switch(s.tag){case 26:case 27:case 5:return Re(s.type);case 16:return Re("Lazy");case 13:return s.child!==l&&l!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return at(s.type,!1);case 11:return at(s.type.render,!1);case 1:return at(s.type,!0);case 31:return Re("Activity");default:return""}}function Bt(s){try{var l="",h=null;do l+=At(s,h),h=s,s=s.return;while(s);return l}catch(g){return`
7
+ Error generating stack: `+g.message+`
8
+ `+g.stack}}var wn=Object.prototype.hasOwnProperty,ve=e.unstable_scheduleCallback,Ye=e.unstable_cancelCallback,be=e.unstable_shouldYield,Me=e.unstable_requestPaint,Pe=e.unstable_now,ze=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,xe=e.unstable_UserBlockingPriority,Ee=e.unstable_NormalPriority,Ge=e.unstable_LowPriority,et=e.unstable_IdlePriority,rn=e.log,Sn=e.unstable_setDisableYieldValue,Xe=null,Qt=null;function Ut(s){if(typeof rn=="function"&&Sn(s),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Xe,s)}catch{}}var Ue=Math.clz32?Math.clz32:lr,Jr=Math.log,Se=Math.LN2;function lr(s){return s>>>=0,s===0?32:31-(Jr(s)/Se|0)|0}var ms=256,_o=262144,Aa=4194304;function ei(s){var l=s&42;if(l!==0)return l;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Ao(s,l,h){var g=s.pendingLanes;if(g===0)return 0;var x=0,N=s.suspendedLanes,z=s.pingedLanes;s=s.warmLanes;var I=g&134217727;return I!==0?(g=I&~N,g!==0?x=ei(g):(z&=I,z!==0?x=ei(z):h||(h=I&~s,h!==0&&(x=ei(h))))):(I=g&~N,I!==0?x=ei(I):z!==0?x=ei(z):h||(h=g&~s,h!==0&&(x=ei(h)))),x===0?0:l!==0&&l!==x&&(l&N)===0&&(N=x&-x,h=l&-l,N>=h||N===32&&(h&4194048)!==0)?l:x}function gs(s,l){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&l)===0}function Jv(s,l){switch(s){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Oo(){var s=Aa;return Aa<<=1,(Aa&62914560)===0&&(Aa=4194304),s}function Ql(s){for(var l=[],h=0;31>h;h++)l.push(s);return l}function Eo(s,l){s.pendingLanes|=l,l!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Ph(s,l,h,g,x,N){var z=s.pendingLanes;s.pendingLanes=h,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=h,s.entangledLanes&=h,s.errorRecoveryDisabledLanes&=h,s.shellSuspendCounter=0;var I=s.entanglements,K=s.expirationTimes,re=s.hiddenUpdates;for(h=z&~h;0<h;){var de=31-Ue(h),ye=1<<de;I[de]=0,K[de]=-1;var oe=re[de];if(oe!==null)for(re[de]=null,de=0;de<oe.length;de++){var ce=oe[de];ce!==null&&(ce.lane&=-536870913)}h&=~ye}g!==0&&Rh(s,g,0),N!==0&&x===0&&s.tag!==0&&(s.suspendedLanes|=N&~(z&~l))}function Rh(s,l,h){s.pendingLanes|=l,s.suspendedLanes&=~l;var g=31-Ue(l);s.entangledLanes|=l,s.entanglements[g]=s.entanglements[g]|1073741824|h&261930}function Mh(s,l){var h=s.entangledLanes|=l;for(s=s.entanglements;h;){var g=31-Ue(h),x=1<<g;x&l|s[g]&l&&(s[g]|=l),h&=~x}}function Dh(s,l){var h=l&-l;return h=(h&42)!==0?1:Qu(h),(h&(s.suspendedLanes|l))!==0?0:h}function Qu(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Xl(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function G(){var s=Q.p;return s!==0?s:(s=window.event,s===void 0?32:tE(s.type))}function Ne(s,l){var h=Q.p;try{return Q.p=s,l()}finally{Q.p=h}}var bt=Math.random().toString(36).slice(2),ut="__reactFiber$"+bt,Ot="__reactProps$"+bt,Ir="__reactContainer$"+bt,Ri="__reactEvents$"+bt,ys="__reactListeners$"+bt,br="__reactHandles$"+bt,Ih="__reactResources$"+bt,ti="__reactMarker$"+bt;function Oa(s){delete s[ut],delete s[Ot],delete s[Ri],delete s[ys],delete s[br]}function Mi(s){var l=s[ut];if(l)return l;for(var h=s.parentNode;h;){if(l=h[Ir]||h[ut]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(s=$O(s);s!==null;){if(h=s[ut])return h;s=$O(s)}return l}s=h,h=s.parentNode}return null}function Ea(s){if(s=s[ut]||s[Ir]){var l=s.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return s}return null}function zo(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s.stateNode;throw Error(r(33))}function Di(s){var l=s[Ih];return l||(l=s[Ih]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function an(s){s[ti]=!0}var Lh=new Set,$h={};function st(s,l){xt(s,l),xt(s+"Capture",l)}function xt(s,l){for($h[s]=l,s=0;s<l.length;s++)Lh.add(l[s])}var Lr=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]*$"),Ii={},To={};function Bh(s){return wn.call(To,s)?!0:wn.call(Ii,s)?!1:Lr.test(s)?To[s]=!0:(Ii[s]=!0,!1)}function Uh(s,l,h){if(Bh(l))if(h===null)s.removeAttribute(l);else{switch(typeof h){case"undefined":case"function":case"symbol":s.removeAttribute(l);return;case"boolean":var g=l.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(l);return}}s.setAttribute(l,""+h)}}function Fh(s,l,h){if(h===null)s.removeAttribute(l);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(l);return}s.setAttribute(l,""+h)}}function za(s,l,h,g){if(g===null)s.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(h);return}s.setAttributeNS(l,h,""+g)}}function ni(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function jC(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function D8(s,l,h){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,l);if(!s.hasOwnProperty(l)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var x=g.get,N=g.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return x.call(this)},set:function(z){h=""+z,N.call(this,z)}}),Object.defineProperty(s,l,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(z){h=""+z},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function e0(s){if(!s._valueTracker){var l=jC(s)?"checked":"value";s._valueTracker=D8(s,l,""+s[l])}}function NC(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var h=l.getValue(),g="";return s&&(g=jC(s)?s.checked?"true":"false":s.value),s=g,s!==h?(l.setValue(s),!0):!1}function qh(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var I8=/[\n"\\]/g;function ri(s){return s.replace(I8,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function t0(s,l,h,g,x,N,z,I){s.name="",z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?s.type=z:s.removeAttribute("type"),l!=null?z==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+ni(l)):s.value!==""+ni(l)&&(s.value=""+ni(l)):z!=="submit"&&z!=="reset"||s.removeAttribute("value"),l!=null?n0(s,z,ni(l)):h!=null?n0(s,z,ni(h)):g!=null&&s.removeAttribute("value"),x==null&&N!=null&&(s.defaultChecked=!!N),x!=null&&(s.checked=x&&typeof x!="function"&&typeof x!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?s.name=""+ni(I):s.removeAttribute("name")}function kC(s,l,h,g,x,N,z,I){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(s.type=N),l!=null||h!=null){if(!(N!=="submit"&&N!=="reset"||l!=null)){e0(s);return}h=h!=null?""+ni(h):"",l=l!=null?""+ni(l):h,I||l===s.value||(s.value=l),s.defaultValue=l}g=g??x,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=I?s.checked:!!g,s.defaultChecked=!!g,z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"&&(s.name=z),e0(s)}function n0(s,l,h){l==="number"&&qh(s.ownerDocument)===s||s.defaultValue===""+h||(s.defaultValue=""+h)}function Jl(s,l,h,g){if(s=s.options,l){l={};for(var x=0;x<h.length;x++)l["$"+h[x]]=!0;for(h=0;h<s.length;h++)x=l.hasOwnProperty("$"+s[h].value),s[h].selected!==x&&(s[h].selected=x),x&&g&&(s[h].defaultSelected=!0)}else{for(h=""+ni(h),l=null,x=0;x<s.length;x++){if(s[x].value===h){s[x].selected=!0,g&&(s[x].defaultSelected=!0);return}l!==null||s[x].disabled||(l=s[x])}l!==null&&(l.selected=!0)}}function CC(s,l,h){if(l!=null&&(l=""+ni(l),l!==s.value&&(s.value=l),h==null)){s.defaultValue!==l&&(s.defaultValue=l);return}s.defaultValue=h!=null?""+ni(h):""}function _C(s,l,h,g){if(l==null){if(g!=null){if(h!=null)throw Error(r(92));if(Z(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),l=h}h=ni(l),s.defaultValue=h,g=s.textContent,g===h&&g!==""&&g!==null&&(s.value=g),e0(s)}function ec(s,l){if(l){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=l;return}}s.textContent=l}var L8=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 AC(s,l,h){var g=l.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?s.setProperty(l,""):l==="float"?s.cssFloat="":s[l]="":g?s.setProperty(l,h):typeof h!="number"||h===0||L8.has(l)?l==="float"?s.cssFloat=h:s[l]=(""+h).trim():s[l]=h+"px"}function OC(s,l,h){if(l!=null&&typeof l!="object")throw Error(r(62));if(s=s.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||l!=null&&l.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var x in l)g=l[x],l.hasOwnProperty(x)&&h[x]!==g&&AC(s,x,g)}else for(var N in l)l.hasOwnProperty(N)&&AC(s,N,l[N])}function r0(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $8=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"]]),B8=/^[\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 Hh(s){return B8.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Ta(){}var i0=null;function a0(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var tc=null,nc=null;function EC(s){var l=Ea(s);if(l&&(s=l.stateNode)){var h=s[Ot]||null;e:switch(s=l.stateNode,l.type){case"input":if(t0(s,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),l=h.name,h.type==="radio"&&l!=null){for(h=s;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+ri(""+l)+'"][type="radio"]'),l=0;l<h.length;l++){var g=h[l];if(g!==s&&g.form===s.form){var x=g[Ot]||null;if(!x)throw Error(r(90));t0(g,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(l=0;l<h.length;l++)g=h[l],g.form===s.form&&NC(g)}break e;case"textarea":CC(s,h.value,h.defaultValue);break e;case"select":l=h.value,l!=null&&Jl(s,!!h.multiple,l,!1)}}}var s0=!1;function zC(s,l,h){if(s0)return s(l,h);s0=!0;try{var g=s(l);return g}finally{if(s0=!1,(tc!==null||nc!==null)&&(zp(),tc&&(l=tc,s=nc,nc=tc=null,EC(l),s)))for(l=0;l<s.length;l++)EC(s[l])}}function Xu(s,l){var h=s.stateNode;if(h===null)return null;var g=h[Ot]||null;if(g===null)return null;h=g[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(h&&typeof h!="function")throw Error(r(231,l,typeof h));return h}var Pa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),o0=!1;if(Pa)try{var Ju={};Object.defineProperty(Ju,"passive",{get:function(){o0=!0}}),window.addEventListener("test",Ju,Ju),window.removeEventListener("test",Ju,Ju)}catch{o0=!1}var vs=null,l0=null,Kh=null;function TC(){if(Kh)return Kh;var s,l=l0,h=l.length,g,x="value"in vs?vs.value:vs.textContent,N=x.length;for(s=0;s<h&&l[s]===x[s];s++);var z=h-s;for(g=1;g<=z&&l[h-g]===x[N-g];g++);return Kh=x.slice(s,1<g?1-g:void 0)}function Gh(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function Vh(){return!0}function PC(){return!1}function xr(s){function l(h,g,x,N,z){this._reactName=h,this._targetInst=x,this.type=g,this.nativeEvent=N,this.target=z,this.currentTarget=null;for(var I in s)s.hasOwnProperty(I)&&(h=s[I],this[I]=h?h(N):N[I]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?Vh:PC,this.isPropagationStopped=PC,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Vh)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Vh)},persist:function(){},isPersistent:Vh}),l}var Po={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zh=xr(Po),ed=m({},Po,{view:0,detail:0}),U8=xr(ed),c0,u0,td,Yh=m({},ed,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:f0,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==td&&(td&&s.type==="mousemove"?(c0=s.screenX-td.screenX,u0=s.screenY-td.screenY):u0=c0=0,td=s),c0)},movementY:function(s){return"movementY"in s?s.movementY:u0}}),RC=xr(Yh),F8=m({},Yh,{dataTransfer:0}),q8=xr(F8),H8=m({},ed,{relatedTarget:0}),d0=xr(H8),K8=m({},Po,{animationName:0,elapsedTime:0,pseudoElement:0}),G8=xr(K8),V8=m({},Po,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),Z8=xr(V8),Y8=m({},Po,{data:0}),MC=xr(Y8),W8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Q8={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"},X8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function J8(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=X8[s])?!!l[s]:!1}function f0(){return J8}var eF=m({},ed,{key:function(s){if(s.key){var l=W8[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=Gh(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?Q8[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:f0,charCode:function(s){return s.type==="keypress"?Gh(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Gh(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),tF=xr(eF),nF=m({},Yh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),DC=xr(nF),rF=m({},ed,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:f0}),iF=xr(rF),aF=m({},Po,{propertyName:0,elapsedTime:0,pseudoElement:0}),sF=xr(aF),oF=m({},Yh,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),lF=xr(oF),cF=m({},Po,{newState:0,oldState:0}),uF=xr(cF),dF=[9,13,27,32],h0=Pa&&"CompositionEvent"in window,nd=null;Pa&&"documentMode"in document&&(nd=document.documentMode);var fF=Pa&&"TextEvent"in window&&!nd,IC=Pa&&(!h0||nd&&8<nd&&11>=nd),LC=" ",$C=!1;function BC(s,l){switch(s){case"keyup":return dF.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function UC(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var rc=!1;function hF(s,l){switch(s){case"compositionend":return UC(l);case"keypress":return l.which!==32?null:($C=!0,LC);case"textInput":return s=l.data,s===LC&&$C?null:s;default:return null}}function pF(s,l){if(rc)return s==="compositionend"||!h0&&BC(s,l)?(s=TC(),Kh=l0=vs=null,rc=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return IC&&l.locale!=="ko"?null:l.data;default:return null}}var mF={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 FC(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!mF[s.type]:l==="textarea"}function qC(s,l,h,g){tc?nc?nc.push(g):nc=[g]:tc=g,l=Lp(l,"onChange"),0<l.length&&(h=new Zh("onChange","change",null,h,g),s.push({event:h,listeners:l}))}var rd=null,id=null;function gF(s){kO(s,0)}function Wh(s){var l=zo(s);if(NC(l))return s}function HC(s,l){if(s==="change")return l}var KC=!1;if(Pa){var p0;if(Pa){var m0="oninput"in document;if(!m0){var GC=document.createElement("div");GC.setAttribute("oninput","return;"),m0=typeof GC.oninput=="function"}p0=m0}else p0=!1;KC=p0&&(!document.documentMode||9<document.documentMode)}function VC(){rd&&(rd.detachEvent("onpropertychange",ZC),id=rd=null)}function ZC(s){if(s.propertyName==="value"&&Wh(id)){var l=[];qC(l,id,s,a0(s)),zC(gF,l)}}function yF(s,l,h){s==="focusin"?(VC(),rd=l,id=h,rd.attachEvent("onpropertychange",ZC)):s==="focusout"&&VC()}function vF(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Wh(id)}function bF(s,l){if(s==="click")return Wh(l)}function xF(s,l){if(s==="input"||s==="change")return Wh(l)}function wF(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var $r=typeof Object.is=="function"?Object.is:wF;function ad(s,l){if($r(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var h=Object.keys(s),g=Object.keys(l);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var x=h[g];if(!wn.call(l,x)||!$r(s[x],l[x]))return!1}return!0}function YC(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function WC(s,l){var h=YC(s);s=0;for(var g;h;){if(h.nodeType===3){if(g=s+h.textContent.length,s<=l&&g>=l)return{node:h,offset:l-s};s=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=YC(h)}}function QC(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?QC(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function XC(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var l=qh(s.document);l instanceof s.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)s=l.contentWindow;else break;l=qh(s.document)}return l}function g0(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}var SF=Pa&&"documentMode"in document&&11>=document.documentMode,ic=null,y0=null,sd=null,v0=!1;function JC(s,l,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;v0||ic==null||ic!==qh(g)||(g=ic,"selectionStart"in g&&g0(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),sd&&ad(sd,g)||(sd=g,g=Lp(y0,"onSelect"),0<g.length&&(l=new Zh("onSelect","select",null,l,h),s.push({event:l,listeners:g}),l.target=ic)))}function Ro(s,l){var h={};return h[s.toLowerCase()]=l.toLowerCase(),h["Webkit"+s]="webkit"+l,h["Moz"+s]="moz"+l,h}var ac={animationend:Ro("Animation","AnimationEnd"),animationiteration:Ro("Animation","AnimationIteration"),animationstart:Ro("Animation","AnimationStart"),transitionrun:Ro("Transition","TransitionRun"),transitionstart:Ro("Transition","TransitionStart"),transitioncancel:Ro("Transition","TransitionCancel"),transitionend:Ro("Transition","TransitionEnd")},b0={},e_={};Pa&&(e_=document.createElement("div").style,"AnimationEvent"in window||(delete ac.animationend.animation,delete ac.animationiteration.animation,delete ac.animationstart.animation),"TransitionEvent"in window||delete ac.transitionend.transition);function Mo(s){if(b0[s])return b0[s];if(!ac[s])return s;var l=ac[s],h;for(h in l)if(l.hasOwnProperty(h)&&h in e_)return b0[s]=l[h];return s}var t_=Mo("animationend"),n_=Mo("animationiteration"),r_=Mo("animationstart"),jF=Mo("transitionrun"),NF=Mo("transitionstart"),kF=Mo("transitioncancel"),i_=Mo("transitionend"),a_=new Map,x0="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(" ");x0.push("scrollEnd");function Li(s,l){a_.set(s,l),st(l,[s])}var Qh=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},ii=[],sc=0,w0=0;function Xh(){for(var s=sc,l=w0=sc=0;l<s;){var h=ii[l];ii[l++]=null;var g=ii[l];ii[l++]=null;var x=ii[l];ii[l++]=null;var N=ii[l];if(ii[l++]=null,g!==null&&x!==null){var z=g.pending;z===null?x.next=x:(x.next=z.next,z.next=x),g.pending=x}N!==0&&s_(h,x,N)}}function Jh(s,l,h,g){ii[sc++]=s,ii[sc++]=l,ii[sc++]=h,ii[sc++]=g,w0|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function S0(s,l,h,g){return Jh(s,l,h,g),ep(s)}function Do(s,l){return Jh(s,null,null,l),ep(s)}function s_(s,l,h){s.lanes|=h;var g=s.alternate;g!==null&&(g.lanes|=h);for(var x=!1,N=s.return;N!==null;)N.childLanes|=h,g=N.alternate,g!==null&&(g.childLanes|=h),N.tag===22&&(s=N.stateNode,s===null||s._visibility&1||(x=!0)),s=N,N=N.return;return s.tag===3?(N=s.stateNode,x&&l!==null&&(x=31-Ue(h),s=N.hiddenUpdates,g=s[x],g===null?s[x]=[l]:g.push(l),l.lane=h|536870912),N):null}function ep(s){if(50<Ad)throw Ad=0,zb=null,Error(r(185));for(var l=s.return;l!==null;)s=l,l=s.return;return s.tag===3?s.stateNode:null}var oc={};function CF(s,l,h,g){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Br(s,l,h,g){return new CF(s,l,h,g)}function j0(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Ra(s,l){var h=s.alternate;return h===null?(h=Br(s.tag,l,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=l,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&65011712,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,l=s.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h.refCleanup=s.refCleanup,h}function o_(s,l){s.flags&=65011714;var h=s.alternate;return h===null?(s.childLanes=0,s.lanes=l,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=h.childLanes,s.lanes=h.lanes,s.child=h.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=h.memoizedProps,s.memoizedState=h.memoizedState,s.updateQueue=h.updateQueue,s.type=h.type,l=h.dependencies,s.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),s}function tp(s,l,h,g,x,N){var z=0;if(g=s,typeof s=="function")j0(s)&&(z=1);else if(typeof s=="string")z=zq(s,h,Y.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case M:return s=Br(31,h,l,x),s.elementType=M,s.lanes=N,s;case S:return Io(h.children,x,N,l);case j:z=8,x|=24;break;case k:return s=Br(12,h,l,x|2),s.elementType=k,s.lanes=N,s;case P:return s=Br(13,h,l,x),s.elementType=P,s.lanes=N,s;case E:return s=Br(19,h,l,x),s.elementType=E,s.lanes=N,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case _:z=10;break e;case A:z=9;break e;case C:z=11;break e;case O:z=14;break e;case T:z=16,g=null;break e}z=29,h=Error(r(130,s===null?"null":typeof s,"")),g=null}return l=Br(z,h,l,x),l.elementType=s,l.type=g,l.lanes=N,l}function Io(s,l,h,g){return s=Br(7,s,g,l),s.lanes=h,s}function N0(s,l,h){return s=Br(6,s,null,l),s.lanes=h,s}function l_(s){var l=Br(18,null,null,0);return l.stateNode=s,l}function k0(s,l,h){return l=Br(4,s.children!==null?s.children:[],s.key,l),l.lanes=h,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}var c_=new WeakMap;function ai(s,l){if(typeof s=="object"&&s!==null){var h=c_.get(s);return h!==void 0?h:(l={value:s,source:l,stack:Bt(l)},c_.set(s,l),l)}return{value:s,source:l,stack:Bt(l)}}var lc=[],cc=0,np=null,od=0,si=[],oi=0,bs=null,ta=1,na="";function Ma(s,l){lc[cc++]=od,lc[cc++]=np,np=s,od=l}function u_(s,l,h){si[oi++]=ta,si[oi++]=na,si[oi++]=bs,bs=s;var g=ta;s=na;var x=32-Ue(g)-1;g&=~(1<<x),h+=1;var N=32-Ue(l)+x;if(30<N){var z=x-x%5;N=(g&(1<<z)-1).toString(32),g>>=z,x-=z,ta=1<<32-Ue(l)+x|h<<x|g,na=N+s}else ta=1<<N|h<<x|g,na=s}function C0(s){s.return!==null&&(Ma(s,1),u_(s,1,0))}function _0(s){for(;s===np;)np=lc[--cc],lc[cc]=null,od=lc[--cc],lc[cc]=null;for(;s===bs;)bs=si[--oi],si[oi]=null,na=si[--oi],si[oi]=null,ta=si[--oi],si[oi]=null}function d_(s,l){si[oi++]=ta,si[oi++]=na,si[oi++]=bs,ta=l.id,na=l.overflow,bs=s}var qn=null,Vt=null,gt=!1,xs=null,li=!1,A0=Error(r(519));function ws(s){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ld(ai(l,s)),A0}function f_(s){var l=s.stateNode,h=s.type,g=s.memoizedProps;switch(l[ut]=s,l[Ot]=g,h){case"dialog":ft("cancel",l),ft("close",l);break;case"iframe":case"object":case"embed":ft("load",l);break;case"video":case"audio":for(h=0;h<Ed.length;h++)ft(Ed[h],l);break;case"source":ft("error",l);break;case"img":case"image":case"link":ft("error",l),ft("load",l);break;case"details":ft("toggle",l);break;case"input":ft("invalid",l),kC(l,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":ft("invalid",l);break;case"textarea":ft("invalid",l),_C(l,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||l.textContent===""+h||g.suppressHydrationWarning===!0||OO(l.textContent,h)?(g.popover!=null&&(ft("beforetoggle",l),ft("toggle",l)),g.onScroll!=null&&ft("scroll",l),g.onScrollEnd!=null&&ft("scrollend",l),g.onClick!=null&&(l.onclick=Ta),l=!0):l=!1,l||ws(s,!0)}function h_(s){for(qn=s.return;qn;)switch(qn.tag){case 5:case 31:case 13:li=!1;return;case 27:case 3:li=!0;return;default:qn=qn.return}}function uc(s){if(s!==qn)return!1;if(!gt)return h_(s),gt=!0,!1;var l=s.tag,h;if((h=l!==3&&l!==27)&&((h=l===5)&&(h=s.type,h=!(h!=="form"&&h!=="button")||Gb(s.type,s.memoizedProps)),h=!h),h&&Vt&&ws(s),h_(s),l===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Vt=LO(s)}else if(l===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Vt=LO(s)}else l===27?(l=Vt,Ms(s.type)?(s=Qb,Qb=null,Vt=s):Vt=l):Vt=qn?ui(s.stateNode.nextSibling):null;return!0}function Lo(){Vt=qn=null,gt=!1}function O0(){var s=xs;return s!==null&&(Nr===null?Nr=s:Nr.push.apply(Nr,s),xs=null),s}function ld(s){xs===null?xs=[s]:xs.push(s)}var E0=U(null),$o=null,Da=null;function Ss(s,l,h){D(E0,l._currentValue),l._currentValue=h}function Ia(s){s._currentValue=E0.current,F(E0)}function z0(s,l,h){for(;s!==null;){var g=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,g!==null&&(g.childLanes|=l)):g!==null&&(g.childLanes&l)!==l&&(g.childLanes|=l),s===h)break;s=s.return}}function T0(s,l,h,g){var x=s.child;for(x!==null&&(x.return=s);x!==null;){var N=x.dependencies;if(N!==null){var z=x.child;N=N.firstContext;e:for(;N!==null;){var I=N;N=x;for(var K=0;K<l.length;K++)if(I.context===l[K]){N.lanes|=h,I=N.alternate,I!==null&&(I.lanes|=h),z0(N.return,h,s),g||(z=null);break e}N=I.next}}else if(x.tag===18){if(z=x.return,z===null)throw Error(r(341));z.lanes|=h,N=z.alternate,N!==null&&(N.lanes|=h),z0(z,h,s),z=null}else z=x.child;if(z!==null)z.return=x;else for(z=x;z!==null;){if(z===s){z=null;break}if(x=z.sibling,x!==null){x.return=z.return,z=x;break}z=z.return}x=z}}function dc(s,l,h,g){s=null;for(var x=l,N=!1;x!==null;){if(!N){if((x.flags&524288)!==0)N=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var z=x.alternate;if(z===null)throw Error(r(387));if(z=z.memoizedProps,z!==null){var I=x.type;$r(x.pendingProps.value,z.value)||(s!==null?s.push(I):s=[I])}}else if(x===fe.current){if(z=x.alternate,z===null)throw Error(r(387));z.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(s!==null?s.push(Md):s=[Md])}x=x.return}s!==null&&T0(l,s,h,g),l.flags|=262144}function rp(s){for(s=s.firstContext;s!==null;){if(!$r(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Bo(s){$o=s,Da=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Hn(s){return p_($o,s)}function ip(s,l){return $o===null&&Bo(s),p_(s,l)}function p_(s,l){var h=l._currentValue;if(l={context:l,memoizedValue:h,next:null},Da===null){if(s===null)throw Error(r(308));Da=l,s.dependencies={lanes:0,firstContext:l},s.flags|=524288}else Da=Da.next=l;return h}var _F=typeof AbortController<"u"?AbortController:function(){var s=[],l=this.signal={aborted:!1,addEventListener:function(h,g){s.push(g)}};this.abort=function(){l.aborted=!0,s.forEach(function(h){return h()})}},AF=e.unstable_scheduleCallback,OF=e.unstable_NormalPriority,jn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function P0(){return{controller:new _F,data:new Map,refCount:0}}function cd(s){s.refCount--,s.refCount===0&&AF(OF,function(){s.controller.abort()})}var ud=null,R0=0,fc=0,hc=null;function EF(s,l){if(ud===null){var h=ud=[];R0=0,fc=Ib(),hc={status:"pending",value:void 0,then:function(g){h.push(g)}}}return R0++,l.then(m_,m_),l}function m_(){if(--R0===0&&ud!==null){hc!==null&&(hc.status="fulfilled");var s=ud;ud=null,fc=0,hc=null;for(var l=0;l<s.length;l++)(0,s[l])()}}function zF(s,l){var h=[],g={status:"pending",value:null,reason:null,then:function(x){h.push(x)}};return s.then(function(){g.status="fulfilled",g.value=l;for(var x=0;x<h.length;x++)(0,h[x])(l)},function(x){for(g.status="rejected",g.reason=x,x=0;x<h.length;x++)(0,h[x])(void 0)}),g}var g_=H.S;H.S=function(s,l){JA=Pe(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&EF(s,l),g_!==null&&g_(s,l)};var Uo=U(null);function M0(){var s=Uo.current;return s!==null?s:Lt.pooledCache}function ap(s,l){l===null?D(Uo,Uo.current):D(Uo,l.pool)}function y_(){var s=M0();return s===null?null:{parent:jn._currentValue,pool:s}}var pc=Error(r(460)),D0=Error(r(474)),sp=Error(r(542)),op={then:function(){}};function v_(s){return s=s.status,s==="fulfilled"||s==="rejected"}function b_(s,l,h){switch(h=s[h],h===void 0?s.push(l):h!==l&&(l.then(Ta,Ta),l=h),l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,w_(s),s;default:if(typeof l.status=="string")l.then(Ta,Ta);else{if(s=Lt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=l,s.status="pending",s.then(function(g){if(l.status==="pending"){var x=l;x.status="fulfilled",x.value=g}},function(g){if(l.status==="pending"){var x=l;x.status="rejected",x.reason=g}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,w_(s),s}throw qo=l,pc}}function Fo(s){try{var l=s._init;return l(s._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(qo=h,pc):h}}var qo=null;function x_(){if(qo===null)throw Error(r(459));var s=qo;return qo=null,s}function w_(s){if(s===pc||s===sp)throw Error(r(483))}var mc=null,dd=0;function lp(s){var l=dd;return dd+=1,mc===null&&(mc=[]),b_(mc,s,l)}function fd(s,l){l=l.props.ref,s.ref=l!==void 0?l:null}function cp(s,l){throw l.$$typeof===y?Error(r(525)):(s=Object.prototype.toString.call(l),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s)))}function S_(s){function l(X,V){if(s){var te=X.deletions;te===null?(X.deletions=[V],X.flags|=16):te.push(V)}}function h(X,V){if(!s)return null;for(;V!==null;)l(X,V),V=V.sibling;return null}function g(X){for(var V=new Map;X!==null;)X.key!==null?V.set(X.key,X):V.set(X.index,X),X=X.sibling;return V}function x(X,V){return X=Ra(X,V),X.index=0,X.sibling=null,X}function N(X,V,te){return X.index=te,s?(te=X.alternate,te!==null?(te=te.index,te<V?(X.flags|=67108866,V):te):(X.flags|=67108866,V)):(X.flags|=1048576,V)}function z(X){return s&&X.alternate===null&&(X.flags|=67108866),X}function I(X,V,te,pe){return V===null||V.tag!==6?(V=N0(te,X.mode,pe),V.return=X,V):(V=x(V,te),V.return=X,V)}function K(X,V,te,pe){var Ze=te.type;return Ze===S?de(X,V,te.props.children,pe,te.key):V!==null&&(V.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===T&&Fo(Ze)===V.type)?(V=x(V,te.props),fd(V,te),V.return=X,V):(V=tp(te.type,te.key,te.props,null,X.mode,pe),fd(V,te),V.return=X,V)}function re(X,V,te,pe){return V===null||V.tag!==4||V.stateNode.containerInfo!==te.containerInfo||V.stateNode.implementation!==te.implementation?(V=k0(te,X.mode,pe),V.return=X,V):(V=x(V,te.children||[]),V.return=X,V)}function de(X,V,te,pe,Ze){return V===null||V.tag!==7?(V=Io(te,X.mode,pe,Ze),V.return=X,V):(V=x(V,te),V.return=X,V)}function ye(X,V,te){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=N0(""+V,X.mode,te),V.return=X,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case v:return te=tp(V.type,V.key,V.props,null,X.mode,te),fd(te,V),te.return=X,te;case w:return V=k0(V,X.mode,te),V.return=X,V;case T:return V=Fo(V),ye(X,V,te)}if(Z(V)||L(V))return V=Io(V,X.mode,te,null),V.return=X,V;if(typeof V.then=="function")return ye(X,lp(V),te);if(V.$$typeof===_)return ye(X,ip(X,V),te);cp(X,V)}return null}function oe(X,V,te,pe){var Ze=V!==null?V.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Ze!==null?null:I(X,V,""+te,pe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return te.key===Ze?K(X,V,te,pe):null;case w:return te.key===Ze?re(X,V,te,pe):null;case T:return te=Fo(te),oe(X,V,te,pe)}if(Z(te)||L(te))return Ze!==null?null:de(X,V,te,pe,null);if(typeof te.then=="function")return oe(X,V,lp(te),pe);if(te.$$typeof===_)return oe(X,V,ip(X,te),pe);cp(X,te)}return null}function ce(X,V,te,pe,Ze){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return X=X.get(te)||null,I(V,X,""+pe,Ze);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case v:return X=X.get(pe.key===null?te:pe.key)||null,K(V,X,pe,Ze);case w:return X=X.get(pe.key===null?te:pe.key)||null,re(V,X,pe,Ze);case T:return pe=Fo(pe),ce(X,V,te,pe,Ze)}if(Z(pe)||L(pe))return X=X.get(te)||null,de(V,X,pe,Ze,null);if(typeof pe.then=="function")return ce(X,V,te,lp(pe),Ze);if(pe.$$typeof===_)return ce(X,V,te,ip(V,pe),Ze);cp(V,pe)}return null}function Ie(X,V,te,pe){for(var Ze=null,wt=null,Fe=V,ot=V=0,mt=null;Fe!==null&&ot<te.length;ot++){Fe.index>ot?(mt=Fe,Fe=null):mt=Fe.sibling;var St=oe(X,Fe,te[ot],pe);if(St===null){Fe===null&&(Fe=mt);break}s&&Fe&&St.alternate===null&&l(X,Fe),V=N(St,V,ot),wt===null?Ze=St:wt.sibling=St,wt=St,Fe=mt}if(ot===te.length)return h(X,Fe),gt&&Ma(X,ot),Ze;if(Fe===null){for(;ot<te.length;ot++)Fe=ye(X,te[ot],pe),Fe!==null&&(V=N(Fe,V,ot),wt===null?Ze=Fe:wt.sibling=Fe,wt=Fe);return gt&&Ma(X,ot),Ze}for(Fe=g(Fe);ot<te.length;ot++)mt=ce(Fe,X,ot,te[ot],pe),mt!==null&&(s&&mt.alternate!==null&&Fe.delete(mt.key===null?ot:mt.key),V=N(mt,V,ot),wt===null?Ze=mt:wt.sibling=mt,wt=mt);return s&&Fe.forEach(function(Bs){return l(X,Bs)}),gt&&Ma(X,ot),Ze}function We(X,V,te,pe){if(te==null)throw Error(r(151));for(var Ze=null,wt=null,Fe=V,ot=V=0,mt=null,St=te.next();Fe!==null&&!St.done;ot++,St=te.next()){Fe.index>ot?(mt=Fe,Fe=null):mt=Fe.sibling;var Bs=oe(X,Fe,St.value,pe);if(Bs===null){Fe===null&&(Fe=mt);break}s&&Fe&&Bs.alternate===null&&l(X,Fe),V=N(Bs,V,ot),wt===null?Ze=Bs:wt.sibling=Bs,wt=Bs,Fe=mt}if(St.done)return h(X,Fe),gt&&Ma(X,ot),Ze;if(Fe===null){for(;!St.done;ot++,St=te.next())St=ye(X,St.value,pe),St!==null&&(V=N(St,V,ot),wt===null?Ze=St:wt.sibling=St,wt=St);return gt&&Ma(X,ot),Ze}for(Fe=g(Fe);!St.done;ot++,St=te.next())St=ce(Fe,X,ot,St.value,pe),St!==null&&(s&&St.alternate!==null&&Fe.delete(St.key===null?ot:St.key),V=N(St,V,ot),wt===null?Ze=St:wt.sibling=St,wt=St);return s&&Fe.forEach(function(Fq){return l(X,Fq)}),gt&&Ma(X,ot),Ze}function Dt(X,V,te,pe){if(typeof te=="object"&&te!==null&&te.type===S&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case v:e:{for(var Ze=te.key;V!==null;){if(V.key===Ze){if(Ze=te.type,Ze===S){if(V.tag===7){h(X,V.sibling),pe=x(V,te.props.children),pe.return=X,X=pe;break e}}else if(V.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===T&&Fo(Ze)===V.type){h(X,V.sibling),pe=x(V,te.props),fd(pe,te),pe.return=X,X=pe;break e}h(X,V);break}else l(X,V);V=V.sibling}te.type===S?(pe=Io(te.props.children,X.mode,pe,te.key),pe.return=X,X=pe):(pe=tp(te.type,te.key,te.props,null,X.mode,pe),fd(pe,te),pe.return=X,X=pe)}return z(X);case w:e:{for(Ze=te.key;V!==null;){if(V.key===Ze)if(V.tag===4&&V.stateNode.containerInfo===te.containerInfo&&V.stateNode.implementation===te.implementation){h(X,V.sibling),pe=x(V,te.children||[]),pe.return=X,X=pe;break e}else{h(X,V);break}else l(X,V);V=V.sibling}pe=k0(te,X.mode,pe),pe.return=X,X=pe}return z(X);case T:return te=Fo(te),Dt(X,V,te,pe)}if(Z(te))return Ie(X,V,te,pe);if(L(te)){if(Ze=L(te),typeof Ze!="function")throw Error(r(150));return te=Ze.call(te),We(X,V,te,pe)}if(typeof te.then=="function")return Dt(X,V,lp(te),pe);if(te.$$typeof===_)return Dt(X,V,ip(X,te),pe);cp(X,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,V!==null&&V.tag===6?(h(X,V.sibling),pe=x(V,te),pe.return=X,X=pe):(h(X,V),pe=N0(te,X.mode,pe),pe.return=X,X=pe),z(X)):h(X,V)}return function(X,V,te,pe){try{dd=0;var Ze=Dt(X,V,te,pe);return mc=null,Ze}catch(Fe){if(Fe===pc||Fe===sp)throw Fe;var wt=Br(29,Fe,null,X.mode);return wt.lanes=pe,wt.return=X,wt}}}var Ho=S_(!0),j_=S_(!1),js=!1;function I0(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function L0(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Ns(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function ks(s,l,h){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(Nt&2)!==0){var x=g.pending;return x===null?l.next=l:(l.next=x.next,x.next=l),g.pending=l,l=ep(s),s_(s,null,h),l}return Jh(s,g,l,h),ep(s)}function hd(s,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194048)!==0)){var g=l.lanes;g&=s.pendingLanes,h|=g,l.lanes=h,Mh(s,h)}}function $0(s,l){var h=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var x=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?x=N=z:N=N.next=z,h=h.next}while(h!==null);N===null?x=N=l:N=N.next=l}else x=N=l;h={baseState:g.baseState,firstBaseUpdate:x,lastBaseUpdate:N,shared:g.shared,callbacks:g.callbacks},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=l:s.next=l,h.lastBaseUpdate=l}var B0=!1;function pd(){if(B0){var s=hc;if(s!==null)throw s}}function md(s,l,h,g){B0=!1;var x=s.updateQueue;js=!1;var N=x.firstBaseUpdate,z=x.lastBaseUpdate,I=x.shared.pending;if(I!==null){x.shared.pending=null;var K=I,re=K.next;K.next=null,z===null?N=re:z.next=re,z=K;var de=s.alternate;de!==null&&(de=de.updateQueue,I=de.lastBaseUpdate,I!==z&&(I===null?de.firstBaseUpdate=re:I.next=re,de.lastBaseUpdate=K))}if(N!==null){var ye=x.baseState;z=0,de=re=K=null,I=N;do{var oe=I.lane&-536870913,ce=oe!==I.lane;if(ce?(pt&oe)===oe:(g&oe)===oe){oe!==0&&oe===fc&&(B0=!0),de!==null&&(de=de.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var Ie=s,We=I;oe=l;var Dt=h;switch(We.tag){case 1:if(Ie=We.payload,typeof Ie=="function"){ye=Ie.call(Dt,ye,oe);break e}ye=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=We.payload,oe=typeof Ie=="function"?Ie.call(Dt,ye,oe):Ie,oe==null)break e;ye=m({},ye,oe);break e;case 2:js=!0}}oe=I.callback,oe!==null&&(s.flags|=64,ce&&(s.flags|=8192),ce=x.callbacks,ce===null?x.callbacks=[oe]:ce.push(oe))}else ce={lane:oe,tag:I.tag,payload:I.payload,callback:I.callback,next:null},de===null?(re=de=ce,K=ye):de=de.next=ce,z|=oe;if(I=I.next,I===null){if(I=x.shared.pending,I===null)break;ce=I,I=ce.next,ce.next=null,x.lastBaseUpdate=ce,x.shared.pending=null}}while(!0);de===null&&(K=ye),x.baseState=K,x.firstBaseUpdate=re,x.lastBaseUpdate=de,N===null&&(x.shared.lanes=0),Es|=z,s.lanes=z,s.memoizedState=ye}}function N_(s,l){if(typeof s!="function")throw Error(r(191,s));s.call(l)}function k_(s,l){var h=s.callbacks;if(h!==null)for(s.callbacks=null,s=0;s<h.length;s++)N_(h[s],l)}var gc=U(null),up=U(0);function C_(s,l){s=Ga,D(up,s),D(gc,l),Ga=s|l.baseLanes}function U0(){D(up,Ga),D(gc,gc.current)}function F0(){Ga=up.current,F(gc),F(up)}var Ur=U(null),ci=null;function Cs(s){var l=s.alternate;D(gn,gn.current&1),D(Ur,s),ci===null&&(l===null||gc.current!==null||l.memoizedState!==null)&&(ci=s)}function q0(s){D(gn,gn.current),D(Ur,s),ci===null&&(ci=s)}function __(s){s.tag===22?(D(gn,gn.current),D(Ur,s),ci===null&&(ci=s)):_s()}function _s(){D(gn,gn.current),D(Ur,Ur.current)}function Fr(s){F(Ur),ci===s&&(ci=null),F(gn)}var gn=U(0);function dp(s){for(var l=s;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Yb(h)||Wb(h)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var La=0,nt=null,Rt=null,Nn=null,fp=!1,yc=!1,Ko=!1,hp=0,gd=0,vc=null,TF=0;function dn(){throw Error(r(321))}function H0(s,l){if(l===null)return!1;for(var h=0;h<l.length&&h<s.length;h++)if(!$r(s[h],l[h]))return!1;return!0}function K0(s,l,h,g,x,N){return La=N,nt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,H.H=s===null||s.memoizedState===null?uA:sb,Ko=!1,N=h(g,x),Ko=!1,yc&&(N=O_(l,h,g,x)),A_(s),N}function A_(s){H.H=bd;var l=Rt!==null&&Rt.next!==null;if(La=0,Nn=Rt=nt=null,fp=!1,gd=0,vc=null,l)throw Error(r(300));s===null||kn||(s=s.dependencies,s!==null&&rp(s)&&(kn=!0))}function O_(s,l,h,g){nt=s;var x=0;do{if(yc&&(vc=null),gd=0,yc=!1,25<=x)throw Error(r(301));if(x+=1,Nn=Rt=null,s.updateQueue!=null){var N=s.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}H.H=dA,N=l(h,g)}while(yc);return N}function PF(){var s=H.H,l=s.useState()[0];return l=typeof l.then=="function"?yd(l):l,s=s.useState()[0],(Rt!==null?Rt.memoizedState:null)!==s&&(nt.flags|=1024),l}function G0(){var s=hp!==0;return hp=0,s}function V0(s,l,h){l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~h}function Z0(s){if(fp){for(s=s.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}fp=!1}La=0,Nn=Rt=nt=null,yc=!1,gd=hp=0,vc=null}function cr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nn===null?nt.memoizedState=Nn=s:Nn=Nn.next=s,Nn}function yn(){if(Rt===null){var s=nt.alternate;s=s!==null?s.memoizedState:null}else s=Rt.next;var l=Nn===null?nt.memoizedState:Nn.next;if(l!==null)Nn=l,Rt=s;else{if(s===null)throw nt.alternate===null?Error(r(467)):Error(r(310));Rt=s,s={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},Nn===null?nt.memoizedState=Nn=s:Nn=Nn.next=s}return Nn}function pp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yd(s){var l=gd;return gd+=1,vc===null&&(vc=[]),s=b_(vc,s,l),l=nt,(Nn===null?l.memoizedState:Nn.next)===null&&(l=l.alternate,H.H=l===null||l.memoizedState===null?uA:sb),s}function mp(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return yd(s);if(s.$$typeof===_)return Hn(s)}throw Error(r(438,String(s)))}function Y0(s){var l=null,h=nt.updateQueue;if(h!==null&&(l=h.memoCache),l==null){var g=nt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(l={data:g.data.map(function(x){return x.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),h===null&&(h=pp(),nt.updateQueue=h),h.memoCache=l,h=l.data[l.index],h===void 0)for(h=l.data[l.index]=Array(s),g=0;g<s;g++)h[g]=q;return l.index++,h}function $a(s,l){return typeof l=="function"?l(s):l}function gp(s){var l=yn();return W0(l,Rt,s)}function W0(s,l,h){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var x=s.baseQueue,N=g.pending;if(N!==null){if(x!==null){var z=x.next;x.next=N.next,N.next=z}l.baseQueue=x=N,g.pending=null}if(N=s.baseState,x===null)s.memoizedState=N;else{l=x.next;var I=z=null,K=null,re=l,de=!1;do{var ye=re.lane&-536870913;if(ye!==re.lane?(pt&ye)===ye:(La&ye)===ye){var oe=re.revertLane;if(oe===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),ye===fc&&(de=!0);else if((La&oe)===oe){re=re.next,oe===fc&&(de=!0);continue}else ye={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},K===null?(I=K=ye,z=N):K=K.next=ye,nt.lanes|=oe,Es|=oe;ye=re.action,Ko&&h(N,ye),N=re.hasEagerState?re.eagerState:h(N,ye)}else oe={lane:ye,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},K===null?(I=K=oe,z=N):K=K.next=oe,nt.lanes|=ye,Es|=ye;re=re.next}while(re!==null&&re!==l);if(K===null?z=N:K.next=I,!$r(N,s.memoizedState)&&(kn=!0,de&&(h=hc,h!==null)))throw h;s.memoizedState=N,s.baseState=z,s.baseQueue=K,g.lastRenderedState=N}return x===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function Q0(s){var l=yn(),h=l.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var g=h.dispatch,x=h.pending,N=l.memoizedState;if(x!==null){h.pending=null;var z=x=x.next;do N=s(N,z.action),z=z.next;while(z!==x);$r(N,l.memoizedState)||(kn=!0),l.memoizedState=N,l.baseQueue===null&&(l.baseState=N),h.lastRenderedState=N}return[N,g]}function E_(s,l,h){var g=nt,x=yn(),N=gt;if(N){if(h===void 0)throw Error(r(407));h=h()}else h=l();var z=!$r((Rt||x).memoizedState,h);if(z&&(x.memoizedState=h,kn=!0),x=x.queue,eb(P_.bind(null,g,x,s),[s]),x.getSnapshot!==l||z||Nn!==null&&Nn.memoizedState.tag&1){if(g.flags|=2048,bc(9,{destroy:void 0},T_.bind(null,g,x,h,l),null),Lt===null)throw Error(r(349));N||(La&127)!==0||z_(g,l,h)}return h}function z_(s,l,h){s.flags|=16384,s={getSnapshot:l,value:h},l=nt.updateQueue,l===null?(l=pp(),nt.updateQueue=l,l.stores=[s]):(h=l.stores,h===null?l.stores=[s]:h.push(s))}function T_(s,l,h,g){l.value=h,l.getSnapshot=g,R_(l)&&M_(s)}function P_(s,l,h){return h(function(){R_(l)&&M_(s)})}function R_(s){var l=s.getSnapshot;s=s.value;try{var h=l();return!$r(s,h)}catch{return!0}}function M_(s){var l=Do(s,2);l!==null&&kr(l,s,2)}function X0(s){var l=cr();if(typeof s=="function"){var h=s;if(s=h(),Ko){Ut(!0);try{h()}finally{Ut(!1)}}}return l.memoizedState=l.baseState=s,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:s},l}function D_(s,l,h,g){return s.baseState=h,W0(s,Rt,typeof g=="function"?g:$a)}function RF(s,l,h,g,x){if(bp(s))throw Error(r(485));if(s=l.action,s!==null){var N={payload:x,action:s,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,g(N),h=l.pending,h===null?(N.next=l.pending=N,I_(l,N)):(N.next=h.next,l.pending=h.next=N)}}function I_(s,l){var h=l.action,g=l.payload,x=s.state;if(l.isTransition){var N=H.T,z={};H.T=z;try{var I=h(x,g),K=H.S;K!==null&&K(z,I),L_(s,l,I)}catch(re){J0(s,l,re)}finally{N!==null&&z.types!==null&&(N.types=z.types),H.T=N}}else try{N=h(x,g),L_(s,l,N)}catch(re){J0(s,l,re)}}function L_(s,l,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){$_(s,l,g)},function(g){return J0(s,l,g)}):$_(s,l,h)}function $_(s,l,h){l.status="fulfilled",l.value=h,B_(l),s.state=h,l=s.pending,l!==null&&(h=l.next,h===l?s.pending=null:(h=h.next,l.next=h,I_(s,h)))}function J0(s,l,h){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do l.status="rejected",l.reason=h,B_(l),l=l.next;while(l!==g)}s.action=null}function B_(s){s=s.listeners;for(var l=0;l<s.length;l++)(0,s[l])()}function U_(s,l){return l}function F_(s,l){if(gt){var h=Lt.formState;if(h!==null){e:{var g=nt;if(gt){if(Vt){t:{for(var x=Vt,N=li;x.nodeType!==8;){if(!N){x=null;break t}if(x=ui(x.nextSibling),x===null){x=null;break t}}N=x.data,x=N==="F!"||N==="F"?x:null}if(x){Vt=ui(x.nextSibling),g=x.data==="F!";break e}}ws(g)}g=!1}g&&(l=h[0])}}return h=cr(),h.memoizedState=h.baseState=l,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:U_,lastRenderedState:l},h.queue=g,h=oA.bind(null,nt,g),g.dispatch=h,g=X0(!1),N=ab.bind(null,nt,!1,g.queue),g=cr(),x={state:l,dispatch:null,action:s,pending:null},g.queue=x,h=RF.bind(null,nt,x,N,h),x.dispatch=h,g.memoizedState=s,[l,h,!1]}function q_(s){var l=yn();return H_(l,Rt,s)}function H_(s,l,h){if(l=W0(s,l,U_)[0],s=gp($a)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var g=yd(l)}catch(z){throw z===pc?sp:z}else g=l;l=yn();var x=l.queue,N=x.dispatch;return h!==l.memoizedState&&(nt.flags|=2048,bc(9,{destroy:void 0},MF.bind(null,x,h),null)),[g,N,s]}function MF(s,l){s.action=l}function K_(s){var l=yn(),h=Rt;if(h!==null)return H_(l,h,s);yn(),l=l.memoizedState,h=yn();var g=h.queue.dispatch;return h.memoizedState=s,[l,g,!1]}function bc(s,l,h,g){return s={tag:s,create:h,deps:g,inst:l,next:null},l=nt.updateQueue,l===null&&(l=pp(),nt.updateQueue=l),h=l.lastEffect,h===null?l.lastEffect=s.next=s:(g=h.next,h.next=s,s.next=g,l.lastEffect=s),s}function G_(){return yn().memoizedState}function yp(s,l,h,g){var x=cr();nt.flags|=s,x.memoizedState=bc(1|l,{destroy:void 0},h,g===void 0?null:g)}function vp(s,l,h,g){var x=yn();g=g===void 0?null:g;var N=x.memoizedState.inst;Rt!==null&&g!==null&&H0(g,Rt.memoizedState.deps)?x.memoizedState=bc(l,N,h,g):(nt.flags|=s,x.memoizedState=bc(1|l,N,h,g))}function V_(s,l){yp(8390656,8,s,l)}function eb(s,l){vp(2048,8,s,l)}function DF(s){nt.flags|=4;var l=nt.updateQueue;if(l===null)l=pp(),nt.updateQueue=l,l.events=[s];else{var h=l.events;h===null?l.events=[s]:h.push(s)}}function Z_(s){var l=yn().memoizedState;return DF({ref:l,nextImpl:s}),function(){if((Nt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function Y_(s,l){return vp(4,2,s,l)}function W_(s,l){return vp(4,4,s,l)}function Q_(s,l){if(typeof l=="function"){s=s();var h=l(s);return function(){typeof h=="function"?h():l(null)}}if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function X_(s,l,h){h=h!=null?h.concat([s]):null,vp(4,4,Q_.bind(null,l,s),h)}function tb(){}function J_(s,l){var h=yn();l=l===void 0?null:l;var g=h.memoizedState;return l!==null&&H0(l,g[1])?g[0]:(h.memoizedState=[s,l],s)}function eA(s,l){var h=yn();l=l===void 0?null:l;var g=h.memoizedState;if(l!==null&&H0(l,g[1]))return g[0];if(g=s(),Ko){Ut(!0);try{s()}finally{Ut(!1)}}return h.memoizedState=[g,l],g}function nb(s,l,h){return h===void 0||(La&1073741824)!==0&&(pt&261930)===0?s.memoizedState=l:(s.memoizedState=h,s=tO(),nt.lanes|=s,Es|=s,h)}function tA(s,l,h,g){return $r(h,l)?h:gc.current!==null?(s=nb(s,h,g),$r(s,l)||(kn=!0),s):(La&42)===0||(La&1073741824)!==0&&(pt&261930)===0?(kn=!0,s.memoizedState=h):(s=tO(),nt.lanes|=s,Es|=s,l)}function nA(s,l,h,g,x){var N=Q.p;Q.p=N!==0&&8>N?N:8;var z=H.T,I={};H.T=I,ab(s,!1,l,h);try{var K=x(),re=H.S;if(re!==null&&re(I,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var de=zF(K,g);vd(s,l,de,Kr(s))}else vd(s,l,g,Kr(s))}catch(ye){vd(s,l,{then:function(){},status:"rejected",reason:ye},Kr())}finally{Q.p=N,z!==null&&I.types!==null&&(z.types=I.types),H.T=z}}function IF(){}function rb(s,l,h,g){if(s.tag!==5)throw Error(r(476));var x=rA(s).queue;nA(s,x,l,he,h===null?IF:function(){return iA(s),h(g)})}function rA(s){var l=s.memoizedState;if(l!==null)return l;l={memoizedState:he,baseState:he,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:he},next:null};var h={};return l.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:h},next:null},s.memoizedState=l,s=s.alternate,s!==null&&(s.memoizedState=l),l}function iA(s){var l=rA(s);l.next===null&&(l=s.alternate.memoizedState),vd(s,l.next.queue,{},Kr())}function ib(){return Hn(Md)}function aA(){return yn().memoizedState}function sA(){return yn().memoizedState}function LF(s){for(var l=s.return;l!==null;){switch(l.tag){case 24:case 3:var h=Kr();s=Ns(h);var g=ks(l,s,h);g!==null&&(kr(g,l,h),hd(g,l,h)),l={cache:P0()},s.payload=l;return}l=l.return}}function $F(s,l,h){var g=Kr();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},bp(s)?lA(l,h):(h=S0(s,l,h,g),h!==null&&(kr(h,s,g),cA(h,l,g)))}function oA(s,l,h){var g=Kr();vd(s,l,h,g)}function vd(s,l,h,g){var x={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(bp(s))lA(l,x);else{var N=s.alternate;if(s.lanes===0&&(N===null||N.lanes===0)&&(N=l.lastRenderedReducer,N!==null))try{var z=l.lastRenderedState,I=N(z,h);if(x.hasEagerState=!0,x.eagerState=I,$r(I,z))return Jh(s,l,x,0),Lt===null&&Xh(),!1}catch{}if(h=S0(s,l,x,g),h!==null)return kr(h,s,g),cA(h,l,g),!0}return!1}function ab(s,l,h,g){if(g={lane:2,revertLane:Ib(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},bp(s)){if(l)throw Error(r(479))}else l=S0(s,h,g,2),l!==null&&kr(l,s,2)}function bp(s){var l=s.alternate;return s===nt||l!==null&&l===nt}function lA(s,l){yc=fp=!0;var h=s.pending;h===null?l.next=l:(l.next=h.next,h.next=l),s.pending=l}function cA(s,l,h){if((h&4194048)!==0){var g=l.lanes;g&=s.pendingLanes,h|=g,l.lanes=h,Mh(s,h)}}var bd={readContext:Hn,use:mp,useCallback:dn,useContext:dn,useEffect:dn,useImperativeHandle:dn,useLayoutEffect:dn,useInsertionEffect:dn,useMemo:dn,useReducer:dn,useRef:dn,useState:dn,useDebugValue:dn,useDeferredValue:dn,useTransition:dn,useSyncExternalStore:dn,useId:dn,useHostTransitionStatus:dn,useFormState:dn,useActionState:dn,useOptimistic:dn,useMemoCache:dn,useCacheRefresh:dn};bd.useEffectEvent=dn;var uA={readContext:Hn,use:mp,useCallback:function(s,l){return cr().memoizedState=[s,l===void 0?null:l],s},useContext:Hn,useEffect:V_,useImperativeHandle:function(s,l,h){h=h!=null?h.concat([s]):null,yp(4194308,4,Q_.bind(null,l,s),h)},useLayoutEffect:function(s,l){return yp(4194308,4,s,l)},useInsertionEffect:function(s,l){yp(4,2,s,l)},useMemo:function(s,l){var h=cr();l=l===void 0?null:l;var g=s();if(Ko){Ut(!0);try{s()}finally{Ut(!1)}}return h.memoizedState=[g,l],g},useReducer:function(s,l,h){var g=cr();if(h!==void 0){var x=h(l);if(Ko){Ut(!0);try{h(l)}finally{Ut(!1)}}}else x=l;return g.memoizedState=g.baseState=x,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:x},g.queue=s,s=s.dispatch=$F.bind(null,nt,s),[g.memoizedState,s]},useRef:function(s){var l=cr();return s={current:s},l.memoizedState=s},useState:function(s){s=X0(s);var l=s.queue,h=oA.bind(null,nt,l);return l.dispatch=h,[s.memoizedState,h]},useDebugValue:tb,useDeferredValue:function(s,l){var h=cr();return nb(h,s,l)},useTransition:function(){var s=X0(!1);return s=nA.bind(null,nt,s.queue,!0,!1),cr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,l,h){var g=nt,x=cr();if(gt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=l(),Lt===null)throw Error(r(349));(pt&127)!==0||z_(g,l,h)}x.memoizedState=h;var N={value:h,getSnapshot:l};return x.queue=N,V_(P_.bind(null,g,N,s),[s]),g.flags|=2048,bc(9,{destroy:void 0},T_.bind(null,g,N,h,l),null),h},useId:function(){var s=cr(),l=Lt.identifierPrefix;if(gt){var h=na,g=ta;h=(g&~(1<<32-Ue(g)-1)).toString(32)+h,l="_"+l+"R_"+h,h=hp++,0<h&&(l+="H"+h.toString(32)),l+="_"}else h=TF++,l="_"+l+"r_"+h.toString(32)+"_";return s.memoizedState=l},useHostTransitionStatus:ib,useFormState:F_,useActionState:F_,useOptimistic:function(s){var l=cr();l.memoizedState=l.baseState=s;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=h,l=ab.bind(null,nt,!0,h),h.dispatch=l,[s,l]},useMemoCache:Y0,useCacheRefresh:function(){return cr().memoizedState=LF.bind(null,nt)},useEffectEvent:function(s){var l=cr(),h={impl:s};return l.memoizedState=h,function(){if((Nt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},sb={readContext:Hn,use:mp,useCallback:J_,useContext:Hn,useEffect:eb,useImperativeHandle:X_,useInsertionEffect:Y_,useLayoutEffect:W_,useMemo:eA,useReducer:gp,useRef:G_,useState:function(){return gp($a)},useDebugValue:tb,useDeferredValue:function(s,l){var h=yn();return tA(h,Rt.memoizedState,s,l)},useTransition:function(){var s=gp($a)[0],l=yn().memoizedState;return[typeof s=="boolean"?s:yd(s),l]},useSyncExternalStore:E_,useId:aA,useHostTransitionStatus:ib,useFormState:q_,useActionState:q_,useOptimistic:function(s,l){var h=yn();return D_(h,Rt,s,l)},useMemoCache:Y0,useCacheRefresh:sA};sb.useEffectEvent=Z_;var dA={readContext:Hn,use:mp,useCallback:J_,useContext:Hn,useEffect:eb,useImperativeHandle:X_,useInsertionEffect:Y_,useLayoutEffect:W_,useMemo:eA,useReducer:Q0,useRef:G_,useState:function(){return Q0($a)},useDebugValue:tb,useDeferredValue:function(s,l){var h=yn();return Rt===null?nb(h,s,l):tA(h,Rt.memoizedState,s,l)},useTransition:function(){var s=Q0($a)[0],l=yn().memoizedState;return[typeof s=="boolean"?s:yd(s),l]},useSyncExternalStore:E_,useId:aA,useHostTransitionStatus:ib,useFormState:K_,useActionState:K_,useOptimistic:function(s,l){var h=yn();return Rt!==null?D_(h,Rt,s,l):(h.baseState=s,[s,h.queue.dispatch])},useMemoCache:Y0,useCacheRefresh:sA};dA.useEffectEvent=Z_;function ob(s,l,h,g){l=s.memoizedState,h=h(g,l),h=h==null?l:m({},l,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}var lb={enqueueSetState:function(s,l,h){s=s._reactInternals;var g=Kr(),x=Ns(g);x.payload=l,h!=null&&(x.callback=h),l=ks(s,x,g),l!==null&&(kr(l,s,g),hd(l,s,g))},enqueueReplaceState:function(s,l,h){s=s._reactInternals;var g=Kr(),x=Ns(g);x.tag=1,x.payload=l,h!=null&&(x.callback=h),l=ks(s,x,g),l!==null&&(kr(l,s,g),hd(l,s,g))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var h=Kr(),g=Ns(h);g.tag=2,l!=null&&(g.callback=l),l=ks(s,g,h),l!==null&&(kr(l,s,h),hd(l,s,h))}};function fA(s,l,h,g,x,N,z){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,N,z):l.prototype&&l.prototype.isPureReactComponent?!ad(h,g)||!ad(x,N):!0}function hA(s,l,h,g){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,g),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,g),l.state!==s&&lb.enqueueReplaceState(l,l.state,null)}function Go(s,l){var h=l;if("ref"in l){h={};for(var g in l)g!=="ref"&&(h[g]=l[g])}if(s=s.defaultProps){h===l&&(h=m({},h));for(var x in s)h[x]===void 0&&(h[x]=s[x])}return h}function pA(s){Qh(s)}function mA(s){console.error(s)}function gA(s){Qh(s)}function xp(s,l){try{var h=s.onUncaughtError;h(l.value,{componentStack:l.stack})}catch(g){setTimeout(function(){throw g})}}function yA(s,l,h){try{var g=s.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function cb(s,l,h){return h=Ns(h),h.tag=3,h.payload={element:null},h.callback=function(){xp(s,l)},h}function vA(s){return s=Ns(s),s.tag=3,s}function bA(s,l,h,g){var x=h.type.getDerivedStateFromError;if(typeof x=="function"){var N=g.value;s.payload=function(){return x(N)},s.callback=function(){yA(l,h,g)}}var z=h.stateNode;z!==null&&typeof z.componentDidCatch=="function"&&(s.callback=function(){yA(l,h,g),typeof x!="function"&&(zs===null?zs=new Set([this]):zs.add(this));var I=g.stack;this.componentDidCatch(g.value,{componentStack:I!==null?I:""})})}function BF(s,l,h,g,x){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(l=h.alternate,l!==null&&dc(l,h,x,!0),h=Ur.current,h!==null){switch(h.tag){case 31:case 13:return ci===null?Tp():h.alternate===null&&fn===0&&(fn=3),h.flags&=-257,h.flags|=65536,h.lanes=x,g===op?h.flags|=16384:(l=h.updateQueue,l===null?h.updateQueue=new Set([g]):l.add(g),Rb(s,g,x)),!1;case 22:return h.flags|=65536,g===op?h.flags|=16384:(l=h.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=l):(h=l.retryQueue,h===null?l.retryQueue=new Set([g]):h.add(g)),Rb(s,g,x)),!1}throw Error(r(435,h.tag))}return Rb(s,g,x),Tp(),!1}if(gt)return l=Ur.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=x,g!==A0&&(s=Error(r(422),{cause:g}),ld(ai(s,h)))):(g!==A0&&(l=Error(r(423),{cause:g}),ld(ai(l,h))),s=s.current.alternate,s.flags|=65536,x&=-x,s.lanes|=x,g=ai(g,h),x=cb(s.stateNode,g,x),$0(s,x),fn!==4&&(fn=2)),!1;var N=Error(r(520),{cause:g});if(N=ai(N,h),_d===null?_d=[N]:_d.push(N),fn!==4&&(fn=2),l===null)return!0;g=ai(g,h),h=l;do{switch(h.tag){case 3:return h.flags|=65536,s=x&-x,h.lanes|=s,s=cb(h.stateNode,g,s),$0(h,s),!1;case 1:if(l=h.type,N=h.stateNode,(h.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(zs===null||!zs.has(N))))return h.flags|=65536,x&=-x,h.lanes|=x,x=vA(x),bA(x,s,h,g),$0(h,x),!1}h=h.return}while(h!==null);return!1}var ub=Error(r(461)),kn=!1;function Kn(s,l,h,g){l.child=s===null?j_(l,null,h,g):Ho(l,s.child,h,g)}function xA(s,l,h,g,x){h=h.render;var N=l.ref;if("ref"in g){var z={};for(var I in g)I!=="ref"&&(z[I]=g[I])}else z=g;return Bo(l),g=K0(s,l,h,z,N,x),I=G0(),s!==null&&!kn?(V0(s,l,x),Ba(s,l,x)):(gt&&I&&C0(l),l.flags|=1,Kn(s,l,g,x),l.child)}function wA(s,l,h,g,x){if(s===null){var N=h.type;return typeof N=="function"&&!j0(N)&&N.defaultProps===void 0&&h.compare===null?(l.tag=15,l.type=N,SA(s,l,N,g,x)):(s=tp(h.type,null,g,l,l.mode,x),s.ref=l.ref,s.return=l,l.child=s)}if(N=s.child,!vb(s,x)){var z=N.memoizedProps;if(h=h.compare,h=h!==null?h:ad,h(z,g)&&s.ref===l.ref)return Ba(s,l,x)}return l.flags|=1,s=Ra(N,g),s.ref=l.ref,s.return=l,l.child=s}function SA(s,l,h,g,x){if(s!==null){var N=s.memoizedProps;if(ad(N,g)&&s.ref===l.ref)if(kn=!1,l.pendingProps=g=N,vb(s,x))(s.flags&131072)!==0&&(kn=!0);else return l.lanes=s.lanes,Ba(s,l,x)}return db(s,l,h,g,x)}function jA(s,l,h,g){var x=g.children,N=s!==null?s.memoizedState:null;if(s===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((l.flags&128)!==0){if(N=N!==null?N.baseLanes|h:h,s!==null){for(g=l.child=s.child,x=0;g!==null;)x=x|g.lanes|g.childLanes,g=g.sibling;g=x&~N}else g=0,l.child=null;return NA(s,l,N,h,g)}if((h&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},s!==null&&ap(l,N!==null?N.cachePool:null),N!==null?C_(l,N):U0(),__(l);else return g=l.lanes=536870912,NA(s,l,N!==null?N.baseLanes|h:h,h,g)}else N!==null?(ap(l,N.cachePool),C_(l,N),_s(),l.memoizedState=null):(s!==null&&ap(l,null),U0(),_s());return Kn(s,l,x,h),l.child}function xd(s,l){return s!==null&&s.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function NA(s,l,h,g,x){var N=M0();return N=N===null?null:{parent:jn._currentValue,pool:N},l.memoizedState={baseLanes:h,cachePool:N},s!==null&&ap(l,null),U0(),__(l),s!==null&&dc(s,l,g,!0),l.childLanes=x,null}function wp(s,l){return l=jp({mode:l.mode,children:l.children},s.mode),l.ref=s.ref,s.child=l,l.return=s,l}function kA(s,l,h){return Ho(l,s.child,null,h),s=wp(l,l.pendingProps),s.flags|=2,Fr(l),l.memoizedState=null,s}function UF(s,l,h){var g=l.pendingProps,x=(l.flags&128)!==0;if(l.flags&=-129,s===null){if(gt){if(g.mode==="hidden")return s=wp(l,g),l.lanes=536870912,xd(null,s);if(q0(l),(s=Vt)?(s=IO(s,li),s=s!==null&&s.data==="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:bs!==null?{id:ta,overflow:na}:null,retryLane:536870912,hydrationErrors:null},h=l_(s),h.return=l,l.child=h,qn=l,Vt=null)):s=null,s===null)throw ws(l);return l.lanes=536870912,null}return wp(l,g)}var N=s.memoizedState;if(N!==null){var z=N.dehydrated;if(q0(l),x)if(l.flags&256)l.flags&=-257,l=kA(s,l,h);else if(l.memoizedState!==null)l.child=s.child,l.flags|=128,l=null;else throw Error(r(558));else if(kn||dc(s,l,h,!1),x=(h&s.childLanes)!==0,kn||x){if(g=Lt,g!==null&&(z=Dh(g,h),z!==0&&z!==N.retryLane))throw N.retryLane=z,Do(s,z),kr(g,s,z),ub;Tp(),l=kA(s,l,h)}else s=N.treeContext,Vt=ui(z.nextSibling),qn=l,gt=!0,xs=null,li=!1,s!==null&&d_(l,s),l=wp(l,g),l.flags|=4096;return l}return s=Ra(s.child,{mode:g.mode,children:g.children}),s.ref=l.ref,l.child=s,s.return=l,s}function Sp(s,l){var h=l.ref;if(h===null)s!==null&&s.ref!==null&&(l.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(s===null||s.ref!==h)&&(l.flags|=4194816)}}function db(s,l,h,g,x){return Bo(l),h=K0(s,l,h,g,void 0,x),g=G0(),s!==null&&!kn?(V0(s,l,x),Ba(s,l,x)):(gt&&g&&C0(l),l.flags|=1,Kn(s,l,h,x),l.child)}function CA(s,l,h,g,x,N){return Bo(l),l.updateQueue=null,h=O_(l,g,h,x),A_(s),g=G0(),s!==null&&!kn?(V0(s,l,N),Ba(s,l,N)):(gt&&g&&C0(l),l.flags|=1,Kn(s,l,h,N),l.child)}function _A(s,l,h,g,x){if(Bo(l),l.stateNode===null){var N=oc,z=h.contextType;typeof z=="object"&&z!==null&&(N=Hn(z)),N=new h(g,N),l.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=lb,l.stateNode=N,N._reactInternals=l,N=l.stateNode,N.props=g,N.state=l.memoizedState,N.refs={},I0(l),z=h.contextType,N.context=typeof z=="object"&&z!==null?Hn(z):oc,N.state=l.memoizedState,z=h.getDerivedStateFromProps,typeof z=="function"&&(ob(l,h,z,g),N.state=l.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&&lb.enqueueReplaceState(N,N.state,null),md(l,g,N,x),pd(),N.state=l.memoizedState),typeof N.componentDidMount=="function"&&(l.flags|=4194308),g=!0}else if(s===null){N=l.stateNode;var I=l.memoizedProps,K=Go(h,I);N.props=K;var re=N.context,de=h.contextType;z=oc,typeof de=="object"&&de!==null&&(z=Hn(de));var ye=h.getDerivedStateFromProps;de=typeof ye=="function"||typeof N.getSnapshotBeforeUpdate=="function",I=l.pendingProps!==I,de||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(I||re!==z)&&hA(l,N,g,z),js=!1;var oe=l.memoizedState;N.state=oe,md(l,g,N,x),pd(),re=l.memoizedState,I||oe!==re||js?(typeof ye=="function"&&(ob(l,h,ye,g),re=l.memoizedState),(K=js||fA(l,h,K,g,oe,re,z))?(de||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(l.flags|=4194308)):(typeof N.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=g,l.memoizedState=re),N.props=g,N.state=re,N.context=z,g=K):(typeof N.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{N=l.stateNode,L0(s,l),z=l.memoizedProps,de=Go(h,z),N.props=de,ye=l.pendingProps,oe=N.context,re=h.contextType,K=oc,typeof re=="object"&&re!==null&&(K=Hn(re)),I=h.getDerivedStateFromProps,(re=typeof I=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(z!==ye||oe!==K)&&hA(l,N,g,K),js=!1,oe=l.memoizedState,N.state=oe,md(l,g,N,x),pd();var ce=l.memoizedState;z!==ye||oe!==ce||js||s!==null&&s.dependencies!==null&&rp(s.dependencies)?(typeof I=="function"&&(ob(l,h,I,g),ce=l.memoizedState),(de=js||fA(l,h,de,g,oe,ce,K)||s!==null&&s.dependencies!==null&&rp(s.dependencies))?(re||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(g,ce,K),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(g,ce,K)),typeof N.componentDidUpdate=="function"&&(l.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof N.componentDidUpdate!="function"||z===s.memoizedProps&&oe===s.memoizedState||(l.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||z===s.memoizedProps&&oe===s.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=ce),N.props=g,N.state=ce,N.context=K,g=de):(typeof N.componentDidUpdate!="function"||z===s.memoizedProps&&oe===s.memoizedState||(l.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||z===s.memoizedProps&&oe===s.memoizedState||(l.flags|=1024),g=!1)}return N=g,Sp(s,l),g=(l.flags&128)!==0,N||g?(N=l.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:N.render(),l.flags|=1,s!==null&&g?(l.child=Ho(l,s.child,null,x),l.child=Ho(l,null,h,x)):Kn(s,l,h,x),l.memoizedState=N.state,s=l.child):s=Ba(s,l,x),s}function AA(s,l,h,g){return Lo(),l.flags|=256,Kn(s,l,h,g),l.child}var fb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hb(s){return{baseLanes:s,cachePool:y_()}}function pb(s,l,h){return s=s!==null?s.childLanes&~h:0,l&&(s|=Hr),s}function OA(s,l,h){var g=l.pendingProps,x=!1,N=(l.flags&128)!==0,z;if((z=N)||(z=s!==null&&s.memoizedState===null?!1:(gn.current&2)!==0),z&&(x=!0,l.flags&=-129),z=(l.flags&32)!==0,l.flags&=-33,s===null){if(gt){if(x?Cs(l):_s(),(s=Vt)?(s=IO(s,li),s=s!==null&&s.data!=="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:bs!==null?{id:ta,overflow:na}:null,retryLane:536870912,hydrationErrors:null},h=l_(s),h.return=l,l.child=h,qn=l,Vt=null)):s=null,s===null)throw ws(l);return Wb(s)?l.lanes=32:l.lanes=536870912,null}var I=g.children;return g=g.fallback,x?(_s(),x=l.mode,I=jp({mode:"hidden",children:I},x),g=Io(g,x,h,null),I.return=l,g.return=l,I.sibling=g,l.child=I,g=l.child,g.memoizedState=hb(h),g.childLanes=pb(s,z,h),l.memoizedState=fb,xd(null,g)):(Cs(l),mb(l,I))}var K=s.memoizedState;if(K!==null&&(I=K.dehydrated,I!==null)){if(N)l.flags&256?(Cs(l),l.flags&=-257,l=gb(s,l,h)):l.memoizedState!==null?(_s(),l.child=s.child,l.flags|=128,l=null):(_s(),I=g.fallback,x=l.mode,g=jp({mode:"visible",children:g.children},x),I=Io(I,x,h,null),I.flags|=2,g.return=l,I.return=l,g.sibling=I,l.child=g,Ho(l,s.child,null,h),g=l.child,g.memoizedState=hb(h),g.childLanes=pb(s,z,h),l.memoizedState=fb,l=xd(null,g));else if(Cs(l),Wb(I)){if(z=I.nextSibling&&I.nextSibling.dataset,z)var re=z.dgst;z=re,g=Error(r(419)),g.stack="",g.digest=z,ld({value:g,source:null,stack:null}),l=gb(s,l,h)}else if(kn||dc(s,l,h,!1),z=(h&s.childLanes)!==0,kn||z){if(z=Lt,z!==null&&(g=Dh(z,h),g!==0&&g!==K.retryLane))throw K.retryLane=g,Do(s,g),kr(z,s,g),ub;Yb(I)||Tp(),l=gb(s,l,h)}else Yb(I)?(l.flags|=192,l.child=s.child,l=null):(s=K.treeContext,Vt=ui(I.nextSibling),qn=l,gt=!0,xs=null,li=!1,s!==null&&d_(l,s),l=mb(l,g.children),l.flags|=4096);return l}return x?(_s(),I=g.fallback,x=l.mode,K=s.child,re=K.sibling,g=Ra(K,{mode:"hidden",children:g.children}),g.subtreeFlags=K.subtreeFlags&65011712,re!==null?I=Ra(re,I):(I=Io(I,x,h,null),I.flags|=2),I.return=l,g.return=l,g.sibling=I,l.child=g,xd(null,g),g=l.child,I=s.child.memoizedState,I===null?I=hb(h):(x=I.cachePool,x!==null?(K=jn._currentValue,x=x.parent!==K?{parent:K,pool:K}:x):x=y_(),I={baseLanes:I.baseLanes|h,cachePool:x}),g.memoizedState=I,g.childLanes=pb(s,z,h),l.memoizedState=fb,xd(s.child,g)):(Cs(l),h=s.child,s=h.sibling,h=Ra(h,{mode:"visible",children:g.children}),h.return=l,h.sibling=null,s!==null&&(z=l.deletions,z===null?(l.deletions=[s],l.flags|=16):z.push(s)),l.child=h,l.memoizedState=null,h)}function mb(s,l){return l=jp({mode:"visible",children:l},s.mode),l.return=s,s.child=l}function jp(s,l){return s=Br(22,s,null,l),s.lanes=0,s}function gb(s,l,h){return Ho(l,s.child,null,h),s=mb(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function EA(s,l,h){s.lanes|=l;var g=s.alternate;g!==null&&(g.lanes|=l),z0(s.return,l,h)}function yb(s,l,h,g,x,N){var z=s.memoizedState;z===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:x,treeForkCount:N}:(z.isBackwards=l,z.rendering=null,z.renderingStartTime=0,z.last=g,z.tail=h,z.tailMode=x,z.treeForkCount=N)}function zA(s,l,h){var g=l.pendingProps,x=g.revealOrder,N=g.tail;g=g.children;var z=gn.current,I=(z&2)!==0;if(I?(z=z&1|2,l.flags|=128):z&=1,D(gn,z),Kn(s,l,g,h),g=gt?od:0,!I&&s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&EA(s,h,l);else if(s.tag===19)EA(s,h,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(x){case"forwards":for(h=l.child,x=null;h!==null;)s=h.alternate,s!==null&&dp(s)===null&&(x=h),h=h.sibling;h=x,h===null?(x=l.child,l.child=null):(x=h.sibling,h.sibling=null),yb(l,!1,x,h,N,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,x=l.child,l.child=null;x!==null;){if(s=x.alternate,s!==null&&dp(s)===null){l.child=x;break}s=x.sibling,x.sibling=h,h=x,x=s}yb(l,!0,h,null,N,g);break;case"together":yb(l,!1,null,null,void 0,g);break;default:l.memoizedState=null}return l.child}function Ba(s,l,h){if(s!==null&&(l.dependencies=s.dependencies),Es|=l.lanes,(h&l.childLanes)===0)if(s!==null){if(dc(s,l,h,!1),(h&l.childLanes)===0)return null}else return null;if(s!==null&&l.child!==s.child)throw Error(r(153));if(l.child!==null){for(s=l.child,h=Ra(s,s.pendingProps),l.child=h,h.return=l;s.sibling!==null;)s=s.sibling,h=h.sibling=Ra(s,s.pendingProps),h.return=l;h.sibling=null}return l.child}function vb(s,l){return(s.lanes&l)!==0?!0:(s=s.dependencies,!!(s!==null&&rp(s)))}function FF(s,l,h){switch(l.tag){case 3:je(l,l.stateNode.containerInfo),Ss(l,jn,s.memoizedState.cache),Lo();break;case 27:case 5:ue(l);break;case 4:je(l,l.stateNode.containerInfo);break;case 10:Ss(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,q0(l),null;break;case 13:var g=l.memoizedState;if(g!==null)return g.dehydrated!==null?(Cs(l),l.flags|=128,null):(h&l.child.childLanes)!==0?OA(s,l,h):(Cs(l),s=Ba(s,l,h),s!==null?s.sibling:null);Cs(l);break;case 19:var x=(s.flags&128)!==0;if(g=(h&l.childLanes)!==0,g||(dc(s,l,h,!1),g=(h&l.childLanes)!==0),x){if(g)return zA(s,l,h);l.flags|=128}if(x=l.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),D(gn,gn.current),g)break;return null;case 22:return l.lanes=0,jA(s,l,h,l.pendingProps);case 24:Ss(l,jn,s.memoizedState.cache)}return Ba(s,l,h)}function TA(s,l,h){if(s!==null)if(s.memoizedProps!==l.pendingProps)kn=!0;else{if(!vb(s,h)&&(l.flags&128)===0)return kn=!1,FF(s,l,h);kn=(s.flags&131072)!==0}else kn=!1,gt&&(l.flags&1048576)!==0&&u_(l,od,l.index);switch(l.lanes=0,l.tag){case 16:e:{var g=l.pendingProps;if(s=Fo(l.elementType),l.type=s,typeof s=="function")j0(s)?(g=Go(s,g),l.tag=1,l=_A(null,l,s,g,h)):(l.tag=0,l=db(null,l,s,g,h));else{if(s!=null){var x=s.$$typeof;if(x===C){l.tag=11,l=xA(null,l,s,g,h);break e}else if(x===O){l.tag=14,l=wA(null,l,s,g,h);break e}}throw l=ae(s)||s,Error(r(306,l,""))}}return l;case 0:return db(s,l,l.type,l.pendingProps,h);case 1:return g=l.type,x=Go(g,l.pendingProps),_A(s,l,g,x,h);case 3:e:{if(je(l,l.stateNode.containerInfo),s===null)throw Error(r(387));g=l.pendingProps;var N=l.memoizedState;x=N.element,L0(s,l),md(l,g,null,h);var z=l.memoizedState;if(g=z.cache,Ss(l,jn,g),g!==N.cache&&T0(l,[jn],h,!0),pd(),g=z.element,N.isDehydrated)if(N={element:g,isDehydrated:!1,cache:z.cache},l.updateQueue.baseState=N,l.memoizedState=N,l.flags&256){l=AA(s,l,g,h);break e}else if(g!==x){x=ai(Error(r(424)),l),ld(x),l=AA(s,l,g,h);break e}else for(s=l.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,Vt=ui(s.firstChild),qn=l,gt=!0,xs=null,li=!0,h=j_(l,null,g,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Lo(),g===x){l=Ba(s,l,h);break e}Kn(s,l,g,h)}l=l.child}return l;case 26:return Sp(s,l),s===null?(h=qO(l.type,null,l.pendingProps,null))?l.memoizedState=h:gt||(h=l.type,s=l.pendingProps,g=$p(ie.current).createElement(h),g[ut]=l,g[Ot]=s,Gn(g,h,s),an(g),l.stateNode=g):l.memoizedState=qO(l.type,s.memoizedProps,l.pendingProps,s.memoizedState),null;case 27:return ue(l),s===null&&gt&&(g=l.stateNode=BO(l.type,l.pendingProps,ie.current),qn=l,li=!0,x=Vt,Ms(l.type)?(Qb=x,Vt=ui(g.firstChild)):Vt=x),Kn(s,l,l.pendingProps.children,h),Sp(s,l),s===null&&(l.flags|=4194304),l.child;case 5:return s===null&&gt&&((x=g=Vt)&&(g=vq(g,l.type,l.pendingProps,li),g!==null?(l.stateNode=g,qn=l,Vt=ui(g.firstChild),li=!1,x=!0):x=!1),x||ws(l)),ue(l),x=l.type,N=l.pendingProps,z=s!==null?s.memoizedProps:null,g=N.children,Gb(x,N)?g=null:z!==null&&Gb(x,z)&&(l.flags|=32),l.memoizedState!==null&&(x=K0(s,l,PF,null,null,h),Md._currentValue=x),Sp(s,l),Kn(s,l,g,h),l.child;case 6:return s===null&&gt&&((s=h=Vt)&&(h=bq(h,l.pendingProps,li),h!==null?(l.stateNode=h,qn=l,Vt=null,s=!0):s=!1),s||ws(l)),null;case 13:return OA(s,l,h);case 4:return je(l,l.stateNode.containerInfo),g=l.pendingProps,s===null?l.child=Ho(l,null,g,h):Kn(s,l,g,h),l.child;case 11:return xA(s,l,l.type,l.pendingProps,h);case 7:return Kn(s,l,l.pendingProps,h),l.child;case 8:return Kn(s,l,l.pendingProps.children,h),l.child;case 12:return Kn(s,l,l.pendingProps.children,h),l.child;case 10:return g=l.pendingProps,Ss(l,l.type,g.value),Kn(s,l,g.children,h),l.child;case 9:return x=l.type._context,g=l.pendingProps.children,Bo(l),x=Hn(x),g=g(x),l.flags|=1,Kn(s,l,g,h),l.child;case 14:return wA(s,l,l.type,l.pendingProps,h);case 15:return SA(s,l,l.type,l.pendingProps,h);case 19:return zA(s,l,h);case 31:return UF(s,l,h);case 22:return jA(s,l,h,l.pendingProps);case 24:return Bo(l),g=Hn(jn),s===null?(x=M0(),x===null&&(x=Lt,N=P0(),x.pooledCache=N,N.refCount++,N!==null&&(x.pooledCacheLanes|=h),x=N),l.memoizedState={parent:g,cache:x},I0(l),Ss(l,jn,x)):((s.lanes&h)!==0&&(L0(s,l),md(l,null,null,h),pd()),x=s.memoizedState,N=l.memoizedState,x.parent!==g?(x={parent:g,cache:g},l.memoizedState=x,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=x),Ss(l,jn,g)):(g=N.cache,Ss(l,jn,g),g!==x.cache&&T0(l,[jn],h,!0))),Kn(s,l,l.pendingProps.children,h),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Ua(s){s.flags|=4}function bb(s,l,h,g,x){if((l=(s.mode&32)!==0)&&(l=!1),l){if(s.flags|=16777216,(x&335544128)===x)if(s.stateNode.complete)s.flags|=8192;else if(aO())s.flags|=8192;else throw qo=op,D0}else s.flags&=-16777217}function PA(s,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!ZO(l))if(aO())s.flags|=8192;else throw qo=op,D0}function Np(s,l){l!==null&&(s.flags|=4),s.flags&16384&&(l=s.tag!==22?Oo():536870912,s.lanes|=l,jc|=l)}function wd(s,l){if(!gt)switch(s.tailMode){case"hidden":l=s.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?s.tail=null:h.sibling=null;break;case"collapsed":h=s.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function Zt(s){var l=s.alternate!==null&&s.alternate.child===s.child,h=0,g=0;if(l)for(var x=s.child;x!==null;)h|=x.lanes|x.childLanes,g|=x.subtreeFlags&65011712,g|=x.flags&65011712,x.return=s,x=x.sibling;else for(x=s.child;x!==null;)h|=x.lanes|x.childLanes,g|=x.subtreeFlags,g|=x.flags,x.return=s,x=x.sibling;return s.subtreeFlags|=g,s.childLanes=h,l}function qF(s,l,h){var g=l.pendingProps;switch(_0(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zt(l),null;case 1:return Zt(l),null;case 3:return h=l.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),l.memoizedState.cache!==g&&(l.flags|=2048),Ia(jn),ee(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(s===null||s.child===null)&&(uc(l)?Ua(l):s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,O0())),Zt(l),null;case 26:var x=l.type,N=l.memoizedState;return s===null?(Ua(l),N!==null?(Zt(l),PA(l,N)):(Zt(l),bb(l,x,null,g,h))):N?N!==s.memoizedState?(Ua(l),Zt(l),PA(l,N)):(Zt(l),l.flags&=-16777217):(s=s.memoizedProps,s!==g&&Ua(l),Zt(l),bb(l,x,s,g,h)),null;case 27:if(Ae(l),h=ie.current,x=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==g&&Ua(l);else{if(!g){if(l.stateNode===null)throw Error(r(166));return Zt(l),null}s=Y.current,uc(l)?f_(l):(s=BO(x,g,h),l.stateNode=s,Ua(l))}return Zt(l),null;case 5:if(Ae(l),x=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==g&&Ua(l);else{if(!g){if(l.stateNode===null)throw Error(r(166));return Zt(l),null}if(N=Y.current,uc(l))f_(l);else{var z=$p(ie.current);switch(N){case 1:N=z.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:N=z.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":N=z.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":N=z.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":N=z.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof g.is=="string"?z.createElement("select",{is:g.is}):z.createElement("select"),g.multiple?N.multiple=!0:g.size&&(N.size=g.size);break;default:N=typeof g.is=="string"?z.createElement(x,{is:g.is}):z.createElement(x)}}N[ut]=l,N[Ot]=g;e:for(z=l.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===l)break e;for(;z.sibling===null;){if(z.return===null||z.return===l)break e;z=z.return}z.sibling.return=z.return,z=z.sibling}l.stateNode=N;e:switch(Gn(N,x,g),x){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Ua(l)}}return Zt(l),bb(l,l.type,s===null?null:s.memoizedProps,l.pendingProps,h),null;case 6:if(s&&l.stateNode!=null)s.memoizedProps!==g&&Ua(l);else{if(typeof g!="string"&&l.stateNode===null)throw Error(r(166));if(s=ie.current,uc(l)){if(s=l.stateNode,h=l.memoizedProps,g=null,x=qn,x!==null)switch(x.tag){case 27:case 5:g=x.memoizedProps}s[ut]=l,s=!!(s.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||OO(s.nodeValue,h)),s||ws(l,!0)}else s=$p(s).createTextNode(g),s[ut]=l,l.stateNode=s}return Zt(l),null;case 31:if(h=l.memoizedState,s===null||s.memoizedState!==null){if(g=uc(l),h!==null){if(s===null){if(!g)throw Error(r(318));if(s=l.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[ut]=l}else Lo(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Zt(l),s=!1}else h=O0(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),s=!0;if(!s)return l.flags&256?(Fr(l),l):(Fr(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Zt(l),null;case 13:if(g=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(x=uc(l),g!==null&&g.dehydrated!==null){if(s===null){if(!x)throw Error(r(318));if(x=l.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[ut]=l}else Lo(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Zt(l),x=!1}else x=O0(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=x),x=!0;if(!x)return l.flags&256?(Fr(l),l):(Fr(l),null)}return Fr(l),(l.flags&128)!==0?(l.lanes=h,l):(h=g!==null,s=s!==null&&s.memoizedState!==null,h&&(g=l.child,x=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(x=g.alternate.memoizedState.cachePool.pool),N=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(N=g.memoizedState.cachePool.pool),N!==x&&(g.flags|=2048)),h!==s&&h&&(l.child.flags|=8192),Np(l,l.updateQueue),Zt(l),null);case 4:return ee(),s===null&&Ub(l.stateNode.containerInfo),Zt(l),null;case 10:return Ia(l.type),Zt(l),null;case 19:if(F(gn),g=l.memoizedState,g===null)return Zt(l),null;if(x=(l.flags&128)!==0,N=g.rendering,N===null)if(x)wd(g,!1);else{if(fn!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(N=dp(s),N!==null){for(l.flags|=128,wd(g,!1),s=N.updateQueue,l.updateQueue=s,Np(l,s),l.subtreeFlags=0,s=h,h=l.child;h!==null;)o_(h,s),h=h.sibling;return D(gn,gn.current&1|2),gt&&Ma(l,g.treeForkCount),l.child}s=s.sibling}g.tail!==null&&Pe()>Op&&(l.flags|=128,x=!0,wd(g,!1),l.lanes=4194304)}else{if(!x)if(s=dp(N),s!==null){if(l.flags|=128,x=!0,s=s.updateQueue,l.updateQueue=s,Np(l,s),wd(g,!0),g.tail===null&&g.tailMode==="hidden"&&!N.alternate&&!gt)return Zt(l),null}else 2*Pe()-g.renderingStartTime>Op&&h!==536870912&&(l.flags|=128,x=!0,wd(g,!1),l.lanes=4194304);g.isBackwards?(N.sibling=l.child,l.child=N):(s=g.last,s!==null?s.sibling=N:l.child=N,g.last=N)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=Pe(),s.sibling=null,h=gn.current,D(gn,x?h&1|2:h&1),gt&&Ma(l,g.treeForkCount),s):(Zt(l),null);case 22:case 23:return Fr(l),F0(),g=l.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(l.flags|=8192):g&&(l.flags|=8192),g?(h&536870912)!==0&&(l.flags&128)===0&&(Zt(l),l.subtreeFlags&6&&(l.flags|=8192)):Zt(l),h=l.updateQueue,h!==null&&Np(l,h.retryQueue),h=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),g=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==h&&(l.flags|=2048),s!==null&&F(Uo),null;case 24:return h=null,s!==null&&(h=s.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),Ia(jn),Zt(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function HF(s,l){switch(_0(l),l.tag){case 1:return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return Ia(jn),ee(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 26:case 27:case 5:return Ae(l),null;case 31:if(l.memoizedState!==null){if(Fr(l),l.alternate===null)throw Error(r(340));Lo()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 13:if(Fr(l),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Lo()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return F(gn),null;case 4:return ee(),null;case 10:return Ia(l.type),null;case 22:case 23:return Fr(l),F0(),s!==null&&F(Uo),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 24:return Ia(jn),null;case 25:return null;default:return null}}function RA(s,l){switch(_0(l),l.tag){case 3:Ia(jn),ee();break;case 26:case 27:case 5:Ae(l);break;case 4:ee();break;case 31:l.memoizedState!==null&&Fr(l);break;case 13:Fr(l);break;case 19:F(gn);break;case 10:Ia(l.type);break;case 22:case 23:Fr(l),F0(),s!==null&&F(Uo);break;case 24:Ia(jn)}}function Sd(s,l){try{var h=l.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var x=g.next;h=x;do{if((h.tag&s)===s){g=void 0;var N=h.create,z=h.inst;g=N(),z.destroy=g}h=h.next}while(h!==x)}}catch(I){zt(l,l.return,I)}}function As(s,l,h){try{var g=l.updateQueue,x=g!==null?g.lastEffect:null;if(x!==null){var N=x.next;g=N;do{if((g.tag&s)===s){var z=g.inst,I=z.destroy;if(I!==void 0){z.destroy=void 0,x=l;var K=h,re=I;try{re()}catch(de){zt(x,K,de)}}}g=g.next}while(g!==N)}}catch(de){zt(l,l.return,de)}}function MA(s){var l=s.updateQueue;if(l!==null){var h=s.stateNode;try{k_(l,h)}catch(g){zt(s,s.return,g)}}}function DA(s,l,h){h.props=Go(s.type,s.memoizedProps),h.state=s.memoizedState;try{h.componentWillUnmount()}catch(g){zt(s,l,g)}}function jd(s,l){try{var h=s.ref;if(h!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof h=="function"?s.refCleanup=h(g):h.current=g}}catch(x){zt(s,l,x)}}function ra(s,l){var h=s.ref,g=s.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(x){zt(s,l,x)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(x){zt(s,l,x)}else h.current=null}function IA(s){var l=s.type,h=s.memoizedProps,g=s.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(x){zt(s,s.return,x)}}function xb(s,l,h){try{var g=s.stateNode;fq(g,s.type,h,l),g[Ot]=l}catch(x){zt(s,s.return,x)}}function LA(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Ms(s.type)||s.tag===4}function wb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||LA(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Ms(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Sb(s,l,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,l?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(s,l):(l=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,l.appendChild(s),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=Ta));else if(g!==4&&(g===27&&Ms(s.type)&&(h=s.stateNode,l=null),s=s.child,s!==null))for(Sb(s,l,h),s=s.sibling;s!==null;)Sb(s,l,h),s=s.sibling}function kp(s,l,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,l?h.insertBefore(s,l):h.appendChild(s);else if(g!==4&&(g===27&&Ms(s.type)&&(h=s.stateNode),s=s.child,s!==null))for(kp(s,l,h),s=s.sibling;s!==null;)kp(s,l,h),s=s.sibling}function $A(s){var l=s.stateNode,h=s.memoizedProps;try{for(var g=s.type,x=l.attributes;x.length;)l.removeAttributeNode(x[0]);Gn(l,g,h),l[ut]=s,l[Ot]=h}catch(N){zt(s,s.return,N)}}var Fa=!1,Cn=!1,jb=!1,BA=typeof WeakSet=="function"?WeakSet:Set,In=null;function KF(s,l){if(s=s.containerInfo,Hb=Gp,s=XC(s),g0(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var x=g.anchorOffset,N=g.focusNode;g=g.focusOffset;try{h.nodeType,N.nodeType}catch{h=null;break e}var z=0,I=-1,K=-1,re=0,de=0,ye=s,oe=null;t:for(;;){for(var ce;ye!==h||x!==0&&ye.nodeType!==3||(I=z+x),ye!==N||g!==0&&ye.nodeType!==3||(K=z+g),ye.nodeType===3&&(z+=ye.nodeValue.length),(ce=ye.firstChild)!==null;)oe=ye,ye=ce;for(;;){if(ye===s)break t;if(oe===h&&++re===x&&(I=z),oe===N&&++de===g&&(K=z),(ce=ye.nextSibling)!==null)break;ye=oe,oe=ye.parentNode}ye=ce}h=I===-1||K===-1?null:{start:I,end:K}}else h=null}h=h||{start:0,end:0}}else h=null;for(Kb={focusedElem:s,selectionRange:h},Gp=!1,In=l;In!==null;)if(l=In,s=l.child,(l.subtreeFlags&1028)!==0&&s!==null)s.return=l,In=s;else for(;In!==null;){switch(l=In,N=l.alternate,s=l.flags,l.tag){case 0:if((s&4)!==0&&(s=l.updateQueue,s=s!==null?s.events:null,s!==null))for(h=0;h<s.length;h++)x=s[h],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&N!==null){s=void 0,h=l,x=N.memoizedProps,N=N.memoizedState,g=h.stateNode;try{var Ie=Go(h.type,x);s=g.getSnapshotBeforeUpdate(Ie,N),g.__reactInternalSnapshotBeforeUpdate=s}catch(We){zt(h,h.return,We)}}break;case 3:if((s&1024)!==0){if(s=l.stateNode.containerInfo,h=s.nodeType,h===9)Zb(s);else if(h===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Zb(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=l.sibling,s!==null){s.return=l.return,In=s;break}In=l.return}}function UA(s,l,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:Ha(s,h),g&4&&Sd(5,h);break;case 1:if(Ha(s,h),g&4)if(s=h.stateNode,l===null)try{s.componentDidMount()}catch(z){zt(h,h.return,z)}else{var x=Go(h.type,l.memoizedProps);l=l.memoizedState;try{s.componentDidUpdate(x,l,s.__reactInternalSnapshotBeforeUpdate)}catch(z){zt(h,h.return,z)}}g&64&&MA(h),g&512&&jd(h,h.return);break;case 3:if(Ha(s,h),g&64&&(s=h.updateQueue,s!==null)){if(l=null,h.child!==null)switch(h.child.tag){case 27:case 5:l=h.child.stateNode;break;case 1:l=h.child.stateNode}try{k_(s,l)}catch(z){zt(h,h.return,z)}}break;case 27:l===null&&g&4&&$A(h);case 26:case 5:Ha(s,h),l===null&&g&4&&IA(h),g&512&&jd(h,h.return);break;case 12:Ha(s,h);break;case 31:Ha(s,h),g&4&&HA(s,h);break;case 13:Ha(s,h),g&4&&KA(s,h),g&64&&(s=h.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(h=eq.bind(null,h),xq(s,h))));break;case 22:if(g=h.memoizedState!==null||Fa,!g){l=l!==null&&l.memoizedState!==null||Cn,x=Fa;var N=Cn;Fa=g,(Cn=l)&&!N?Ka(s,h,(h.subtreeFlags&8772)!==0):Ha(s,h),Fa=x,Cn=N}break;case 30:break;default:Ha(s,h)}}function FA(s){var l=s.alternate;l!==null&&(s.alternate=null,FA(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&Oa(l)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Xt=null,wr=!1;function qa(s,l,h){for(h=h.child;h!==null;)qA(s,l,h),h=h.sibling}function qA(s,l,h){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(Xe,h)}catch{}switch(h.tag){case 26:Cn||ra(h,l),qa(s,l,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Cn||ra(h,l);var g=Xt,x=wr;Ms(h.type)&&(Xt=h.stateNode,wr=!1),qa(s,l,h),Td(h.stateNode),Xt=g,wr=x;break;case 5:Cn||ra(h,l);case 6:if(g=Xt,x=wr,Xt=null,qa(s,l,h),Xt=g,wr=x,Xt!==null)if(wr)try{(Xt.nodeType===9?Xt.body:Xt.nodeName==="HTML"?Xt.ownerDocument.body:Xt).removeChild(h.stateNode)}catch(N){zt(h,l,N)}else try{Xt.removeChild(h.stateNode)}catch(N){zt(h,l,N)}break;case 18:Xt!==null&&(wr?(s=Xt,MO(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,h.stateNode),zc(s)):MO(Xt,h.stateNode));break;case 4:g=Xt,x=wr,Xt=h.stateNode.containerInfo,wr=!0,qa(s,l,h),Xt=g,wr=x;break;case 0:case 11:case 14:case 15:As(2,h,l),Cn||As(4,h,l),qa(s,l,h);break;case 1:Cn||(ra(h,l),g=h.stateNode,typeof g.componentWillUnmount=="function"&&DA(h,l,g)),qa(s,l,h);break;case 21:qa(s,l,h);break;case 22:Cn=(g=Cn)||h.memoizedState!==null,qa(s,l,h),Cn=g;break;default:qa(s,l,h)}}function HA(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{zc(s)}catch(h){zt(l,l.return,h)}}}function KA(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{zc(s)}catch(h){zt(l,l.return,h)}}function GF(s){switch(s.tag){case 31:case 13:case 19:var l=s.stateNode;return l===null&&(l=s.stateNode=new BA),l;case 22:return s=s.stateNode,l=s._retryCache,l===null&&(l=s._retryCache=new BA),l;default:throw Error(r(435,s.tag))}}function Cp(s,l){var h=GF(s);l.forEach(function(g){if(!h.has(g)){h.add(g);var x=tq.bind(null,s,g);g.then(x,x)}})}function Sr(s,l){var h=l.deletions;if(h!==null)for(var g=0;g<h.length;g++){var x=h[g],N=s,z=l,I=z;e:for(;I!==null;){switch(I.tag){case 27:if(Ms(I.type)){Xt=I.stateNode,wr=!1;break e}break;case 5:Xt=I.stateNode,wr=!1;break e;case 3:case 4:Xt=I.stateNode.containerInfo,wr=!0;break e}I=I.return}if(Xt===null)throw Error(r(160));qA(N,z,x),Xt=null,wr=!1,N=x.alternate,N!==null&&(N.return=null),x.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)GA(l,s),l=l.sibling}var $i=null;function GA(s,l){var h=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Sr(l,s),jr(s),g&4&&(As(3,s,s.return),Sd(3,s),As(5,s,s.return));break;case 1:Sr(l,s),jr(s),g&512&&(Cn||h===null||ra(h,h.return)),g&64&&Fa&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(h=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var x=$i;if(Sr(l,s),jr(s),g&512&&(Cn||h===null||ra(h,h.return)),g&4){var N=h!==null?h.memoizedState:null;if(g=s.memoizedState,h===null)if(g===null)if(s.stateNode===null){e:{g=s.type,h=s.memoizedProps,x=x.ownerDocument||x;t:switch(g){case"title":N=x.getElementsByTagName("title")[0],(!N||N[ti]||N[ut]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=x.createElement(g),x.head.insertBefore(N,x.querySelector("head > title"))),Gn(N,g,h),N[ut]=s,an(N),g=N;break e;case"link":var z=GO("link","href",x).get(g+(h.href||""));if(z){for(var I=0;I<z.length;I++)if(N=z[I],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(I,1);break t}}N=x.createElement(g),Gn(N,g,h),x.head.appendChild(N);break;case"meta":if(z=GO("meta","content",x).get(g+(h.content||""))){for(I=0;I<z.length;I++)if(N=z[I],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(I,1);break t}}N=x.createElement(g),Gn(N,g,h),x.head.appendChild(N);break;default:throw Error(r(468,g))}N[ut]=s,an(N),g=N}s.stateNode=g}else VO(x,s.type,s.stateNode);else s.stateNode=KO(x,g,s.memoizedProps);else N!==g?(N===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):N.count--,g===null?VO(x,s.type,s.stateNode):KO(x,g,s.memoizedProps)):g===null&&s.stateNode!==null&&xb(s,s.memoizedProps,h.memoizedProps)}break;case 27:Sr(l,s),jr(s),g&512&&(Cn||h===null||ra(h,h.return)),h!==null&&g&4&&xb(s,s.memoizedProps,h.memoizedProps);break;case 5:if(Sr(l,s),jr(s),g&512&&(Cn||h===null||ra(h,h.return)),s.flags&32){x=s.stateNode;try{ec(x,"")}catch(Ie){zt(s,s.return,Ie)}}g&4&&s.stateNode!=null&&(x=s.memoizedProps,xb(s,x,h!==null?h.memoizedProps:x)),g&1024&&(jb=!0);break;case 6:if(Sr(l,s),jr(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,h=s.stateNode;try{h.nodeValue=g}catch(Ie){zt(s,s.return,Ie)}}break;case 3:if(Fp=null,x=$i,$i=Bp(l.containerInfo),Sr(l,s),$i=x,jr(s),g&4&&h!==null&&h.memoizedState.isDehydrated)try{zc(l.containerInfo)}catch(Ie){zt(s,s.return,Ie)}jb&&(jb=!1,VA(s));break;case 4:g=$i,$i=Bp(s.stateNode.containerInfo),Sr(l,s),jr(s),$i=g;break;case 12:Sr(l,s),jr(s);break;case 31:Sr(l,s),jr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Cp(s,g)));break;case 13:Sr(l,s),jr(s),s.child.flags&8192&&s.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(Ap=Pe()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Cp(s,g)));break;case 22:x=s.memoizedState!==null;var K=h!==null&&h.memoizedState!==null,re=Fa,de=Cn;if(Fa=re||x,Cn=de||K,Sr(l,s),Cn=de,Fa=re,jr(s),g&8192)e:for(l=s.stateNode,l._visibility=x?l._visibility&-2:l._visibility|1,x&&(h===null||K||Fa||Cn||Vo(s)),h=null,l=s;;){if(l.tag===5||l.tag===26){if(h===null){K=h=l;try{if(N=K.stateNode,x)z=N.style,typeof z.setProperty=="function"?z.setProperty("display","none","important"):z.display="none";else{I=K.stateNode;var ye=K.memoizedProps.style,oe=ye!=null&&ye.hasOwnProperty("display")?ye.display:null;I.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Ie){zt(K,K.return,Ie)}}}else if(l.tag===6){if(h===null){K=l;try{K.stateNode.nodeValue=x?"":K.memoizedProps}catch(Ie){zt(K,K.return,Ie)}}}else if(l.tag===18){if(h===null){K=l;try{var ce=K.stateNode;x?DO(ce,!0):DO(K.stateNode,!1)}catch(Ie){zt(K,K.return,Ie)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===s)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;h===l&&(h=null),l=l.return}h===l&&(h=null),l.sibling.return=l.return,l=l.sibling}g&4&&(g=s.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,Cp(s,h))));break;case 19:Sr(l,s),jr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Cp(s,g)));break;case 30:break;case 21:break;default:Sr(l,s),jr(s)}}function jr(s){var l=s.flags;if(l&2){try{for(var h,g=s.return;g!==null;){if(LA(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var x=h.stateNode,N=wb(s);kp(s,N,x);break;case 5:var z=h.stateNode;h.flags&32&&(ec(z,""),h.flags&=-33);var I=wb(s);kp(s,I,z);break;case 3:case 4:var K=h.stateNode.containerInfo,re=wb(s);Sb(s,re,K);break;default:throw Error(r(161))}}catch(de){zt(s,s.return,de)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function VA(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var l=s;VA(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),s=s.sibling}}function Ha(s,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)UA(s,l.alternate,l),l=l.sibling}function Vo(s){for(s=s.child;s!==null;){var l=s;switch(l.tag){case 0:case 11:case 14:case 15:As(4,l,l.return),Vo(l);break;case 1:ra(l,l.return);var h=l.stateNode;typeof h.componentWillUnmount=="function"&&DA(l,l.return,h),Vo(l);break;case 27:Td(l.stateNode);case 26:case 5:ra(l,l.return),Vo(l);break;case 22:l.memoizedState===null&&Vo(l);break;case 30:Vo(l);break;default:Vo(l)}s=s.sibling}}function Ka(s,l,h){for(h=h&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var g=l.alternate,x=s,N=l,z=N.flags;switch(N.tag){case 0:case 11:case 15:Ka(x,N,h),Sd(4,N);break;case 1:if(Ka(x,N,h),g=N,x=g.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(re){zt(g,g.return,re)}if(g=N,x=g.updateQueue,x!==null){var I=g.stateNode;try{var K=x.shared.hiddenCallbacks;if(K!==null)for(x.shared.hiddenCallbacks=null,x=0;x<K.length;x++)N_(K[x],I)}catch(re){zt(g,g.return,re)}}h&&z&64&&MA(N),jd(N,N.return);break;case 27:$A(N);case 26:case 5:Ka(x,N,h),h&&g===null&&z&4&&IA(N),jd(N,N.return);break;case 12:Ka(x,N,h);break;case 31:Ka(x,N,h),h&&z&4&&HA(x,N);break;case 13:Ka(x,N,h),h&&z&4&&KA(x,N);break;case 22:N.memoizedState===null&&Ka(x,N,h),jd(N,N.return);break;case 30:break;default:Ka(x,N,h)}l=l.sibling}}function Nb(s,l){var h=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==h&&(s!=null&&s.refCount++,h!=null&&cd(h))}function kb(s,l){s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&cd(s))}function Bi(s,l,h,g){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)ZA(s,l,h,g),l=l.sibling}function ZA(s,l,h,g){var x=l.flags;switch(l.tag){case 0:case 11:case 15:Bi(s,l,h,g),x&2048&&Sd(9,l);break;case 1:Bi(s,l,h,g);break;case 3:Bi(s,l,h,g),x&2048&&(s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&cd(s)));break;case 12:if(x&2048){Bi(s,l,h,g),s=l.stateNode;try{var N=l.memoizedProps,z=N.id,I=N.onPostCommit;typeof I=="function"&&I(z,l.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(K){zt(l,l.return,K)}}else Bi(s,l,h,g);break;case 31:Bi(s,l,h,g);break;case 13:Bi(s,l,h,g);break;case 23:break;case 22:N=l.stateNode,z=l.alternate,l.memoizedState!==null?N._visibility&2?Bi(s,l,h,g):Nd(s,l):N._visibility&2?Bi(s,l,h,g):(N._visibility|=2,xc(s,l,h,g,(l.subtreeFlags&10256)!==0||!1)),x&2048&&Nb(z,l);break;case 24:Bi(s,l,h,g),x&2048&&kb(l.alternate,l);break;default:Bi(s,l,h,g)}}function xc(s,l,h,g,x){for(x=x&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var N=s,z=l,I=h,K=g,re=z.flags;switch(z.tag){case 0:case 11:case 15:xc(N,z,I,K,x),Sd(8,z);break;case 23:break;case 22:var de=z.stateNode;z.memoizedState!==null?de._visibility&2?xc(N,z,I,K,x):Nd(N,z):(de._visibility|=2,xc(N,z,I,K,x)),x&&re&2048&&Nb(z.alternate,z);break;case 24:xc(N,z,I,K,x),x&&re&2048&&kb(z.alternate,z);break;default:xc(N,z,I,K,x)}l=l.sibling}}function Nd(s,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var h=s,g=l,x=g.flags;switch(g.tag){case 22:Nd(h,g),x&2048&&Nb(g.alternate,g);break;case 24:Nd(h,g),x&2048&&kb(g.alternate,g);break;default:Nd(h,g)}l=l.sibling}}var kd=8192;function wc(s,l,h){if(s.subtreeFlags&kd)for(s=s.child;s!==null;)YA(s,l,h),s=s.sibling}function YA(s,l,h){switch(s.tag){case 26:wc(s,l,h),s.flags&kd&&s.memoizedState!==null&&Tq(h,$i,s.memoizedState,s.memoizedProps);break;case 5:wc(s,l,h);break;case 3:case 4:var g=$i;$i=Bp(s.stateNode.containerInfo),wc(s,l,h),$i=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=kd,kd=16777216,wc(s,l,h),kd=g):wc(s,l,h));break;default:wc(s,l,h)}}function WA(s){var l=s.alternate;if(l!==null&&(s=l.child,s!==null)){l.child=null;do l=s.sibling,s.sibling=null,s=l;while(s!==null)}}function Cd(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var h=0;h<l.length;h++){var g=l[h];In=g,XA(g,s)}WA(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)QA(s),s=s.sibling}function QA(s){switch(s.tag){case 0:case 11:case 15:Cd(s),s.flags&2048&&As(9,s,s.return);break;case 3:Cd(s);break;case 12:Cd(s);break;case 22:var l=s.stateNode;s.memoizedState!==null&&l._visibility&2&&(s.return===null||s.return.tag!==13)?(l._visibility&=-3,_p(s)):Cd(s);break;default:Cd(s)}}function _p(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var h=0;h<l.length;h++){var g=l[h];In=g,XA(g,s)}WA(s)}for(s=s.child;s!==null;){switch(l=s,l.tag){case 0:case 11:case 15:As(8,l,l.return),_p(l);break;case 22:h=l.stateNode,h._visibility&2&&(h._visibility&=-3,_p(l));break;default:_p(l)}s=s.sibling}}function XA(s,l){for(;In!==null;){var h=In;switch(h.tag){case 0:case 11:case 15:As(8,h,l);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:cd(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,In=g;else e:for(h=s;In!==null;){g=In;var x=g.sibling,N=g.return;if(FA(g),g===h){In=null;break e}if(x!==null){x.return=N,In=x;break e}In=N}}}var VF={getCacheForType:function(s){var l=Hn(jn),h=l.data.get(s);return h===void 0&&(h=s(),l.data.set(s,h)),h},cacheSignal:function(){return Hn(jn).controller.signal}},ZF=typeof WeakMap=="function"?WeakMap:Map,Nt=0,Lt=null,dt=null,pt=0,Et=0,qr=null,Os=!1,Sc=!1,Cb=!1,Ga=0,fn=0,Es=0,Zo=0,_b=0,Hr=0,jc=0,_d=null,Nr=null,Ab=!1,Ap=0,JA=0,Op=1/0,Ep=null,zs=null,En=0,Ts=null,Nc=null,Va=0,Ob=0,Eb=null,eO=null,Ad=0,zb=null;function Kr(){return(Nt&2)!==0&&pt!==0?pt&-pt:H.T!==null?Ib():G()}function tO(){if(Hr===0)if((pt&536870912)===0||gt){var s=_o;_o<<=1,(_o&3932160)===0&&(_o=262144),Hr=s}else Hr=536870912;return s=Ur.current,s!==null&&(s.flags|=32),Hr}function kr(s,l,h){(s===Lt&&(Et===2||Et===9)||s.cancelPendingCommit!==null)&&(kc(s,0),Ps(s,pt,Hr,!1)),Eo(s,h),((Nt&2)===0||s!==Lt)&&(s===Lt&&((Nt&2)===0&&(Zo|=h),fn===4&&Ps(s,pt,Hr,!1)),ia(s))}function nO(s,l,h){if((Nt&6)!==0)throw Error(r(327));var g=!h&&(l&127)===0&&(l&s.expiredLanes)===0||gs(s,l),x=g?QF(s,l):Pb(s,l,!0),N=g;do{if(x===0){Sc&&!g&&Ps(s,l,0,!1);break}else{if(h=s.current.alternate,N&&!YF(h)){x=Pb(s,l,!1),N=!1;continue}if(x===2){if(N=l,s.errorRecoveryDisabledLanes&N)var z=0;else z=s.pendingLanes&-536870913,z=z!==0?z:z&536870912?536870912:0;if(z!==0){l=z;e:{var I=s;x=_d;var K=I.current.memoizedState.isDehydrated;if(K&&(kc(I,z).flags|=256),z=Pb(I,z,!1),z!==2){if(Cb&&!K){I.errorRecoveryDisabledLanes|=N,Zo|=N,x=4;break e}N=Nr,Nr=x,N!==null&&(Nr===null?Nr=N:Nr.push.apply(Nr,N))}x=z}if(N=!1,x!==2)continue}}if(x===1){kc(s,0),Ps(s,l,0,!0);break}e:{switch(g=s,N=x,N){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Ps(g,l,Hr,!Os);break e;case 2:Nr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(x=Ap+300-Pe(),10<x)){if(Ps(g,l,Hr,!Os),Ao(g,0,!0)!==0)break e;Va=l,g.timeoutHandle=PO(rO.bind(null,g,h,Nr,Ep,Ab,l,Hr,Zo,jc,Os,N,"Throttled",-0,0),x);break e}rO(g,h,Nr,Ep,Ab,l,Hr,Zo,jc,Os,N,null,-0,0)}}break}while(!0);ia(s)}function rO(s,l,h,g,x,N,z,I,K,re,de,ye,oe,ce){if(s.timeoutHandle=-1,ye=l.subtreeFlags,ye&8192||(ye&16785408)===16785408){ye={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ta},YA(l,N,ye);var Ie=(N&62914560)===N?Ap-Pe():(N&4194048)===N?JA-Pe():0;if(Ie=Pq(ye,Ie),Ie!==null){Va=N,s.cancelPendingCommit=Ie(dO.bind(null,s,l,N,h,g,x,z,I,K,de,ye,null,oe,ce)),Ps(s,N,z,!re);return}}dO(s,l,N,h,g,x,z,I,K)}function YF(s){for(var l=s;;){var h=l.tag;if((h===0||h===11||h===15)&&l.flags&16384&&(h=l.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var x=h[g],N=x.getSnapshot;x=x.value;try{if(!$r(N(),x))return!1}catch{return!1}}if(h=l.child,l.subtreeFlags&16384&&h!==null)h.return=l,l=h;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Ps(s,l,h,g){l&=~_b,l&=~Zo,s.suspendedLanes|=l,s.pingedLanes&=~l,g&&(s.warmLanes|=l),g=s.expirationTimes;for(var x=l;0<x;){var N=31-Ue(x),z=1<<N;g[N]=-1,x&=~z}h!==0&&Rh(s,h,l)}function zp(){return(Nt&6)===0?(Od(0),!1):!0}function Tb(){if(dt!==null){if(Et===0)var s=dt.return;else s=dt,Da=$o=null,Z0(s),mc=null,dd=0,s=dt;for(;s!==null;)RA(s.alternate,s),s=s.return;dt=null}}function kc(s,l){var h=s.timeoutHandle;h!==-1&&(s.timeoutHandle=-1,mq(h)),h=s.cancelPendingCommit,h!==null&&(s.cancelPendingCommit=null,h()),Va=0,Tb(),Lt=s,dt=h=Ra(s.current,null),pt=l,Et=0,qr=null,Os=!1,Sc=gs(s,l),Cb=!1,jc=Hr=_b=Zo=Es=fn=0,Nr=_d=null,Ab=!1,(l&8)!==0&&(l|=l&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=l;0<g;){var x=31-Ue(g),N=1<<x;l|=s[x],g&=~N}return Ga=l,Xh(),h}function iO(s,l){nt=null,H.H=bd,l===pc||l===sp?(l=x_(),Et=3):l===D0?(l=x_(),Et=4):Et=l===ub?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,qr=l,dt===null&&(fn=1,xp(s,ai(l,s.current)))}function aO(){var s=Ur.current;return s===null?!0:(pt&4194048)===pt?ci===null:(pt&62914560)===pt||(pt&536870912)!==0?s===ci:!1}function sO(){var s=H.H;return H.H=bd,s===null?bd:s}function oO(){var s=H.A;return H.A=VF,s}function Tp(){fn=4,Os||(pt&4194048)!==pt&&Ur.current!==null||(Sc=!0),(Es&134217727)===0&&(Zo&134217727)===0||Lt===null||Ps(Lt,pt,Hr,!1)}function Pb(s,l,h){var g=Nt;Nt|=2;var x=sO(),N=oO();(Lt!==s||pt!==l)&&(Ep=null,kc(s,l)),l=!1;var z=fn;e:do try{if(Et!==0&&dt!==null){var I=dt,K=qr;switch(Et){case 8:Tb(),z=6;break e;case 3:case 2:case 9:case 6:Ur.current===null&&(l=!0);var re=Et;if(Et=0,qr=null,Cc(s,I,K,re),h&&Sc){z=0;break e}break;default:re=Et,Et=0,qr=null,Cc(s,I,K,re)}}WF(),z=fn;break}catch(de){iO(s,de)}while(!0);return l&&s.shellSuspendCounter++,Da=$o=null,Nt=g,H.H=x,H.A=N,dt===null&&(Lt=null,pt=0,Xh()),z}function WF(){for(;dt!==null;)lO(dt)}function QF(s,l){var h=Nt;Nt|=2;var g=sO(),x=oO();Lt!==s||pt!==l?(Ep=null,Op=Pe()+500,kc(s,l)):Sc=gs(s,l);e:do try{if(Et!==0&&dt!==null){l=dt;var N=qr;t:switch(Et){case 1:Et=0,qr=null,Cc(s,l,N,1);break;case 2:case 9:if(v_(N)){Et=0,qr=null,cO(l);break}l=function(){Et!==2&&Et!==9||Lt!==s||(Et=7),ia(s)},N.then(l,l);break e;case 3:Et=7;break e;case 4:Et=5;break e;case 7:v_(N)?(Et=0,qr=null,cO(l)):(Et=0,qr=null,Cc(s,l,N,7));break;case 5:var z=null;switch(dt.tag){case 26:z=dt.memoizedState;case 5:case 27:var I=dt;if(z?ZO(z):I.stateNode.complete){Et=0,qr=null;var K=I.sibling;if(K!==null)dt=K;else{var re=I.return;re!==null?(dt=re,Pp(re)):dt=null}break t}}Et=0,qr=null,Cc(s,l,N,5);break;case 6:Et=0,qr=null,Cc(s,l,N,6);break;case 8:Tb(),fn=6;break e;default:throw Error(r(462))}}XF();break}catch(de){iO(s,de)}while(!0);return Da=$o=null,H.H=g,H.A=x,Nt=h,dt!==null?0:(Lt=null,pt=0,Xh(),fn)}function XF(){for(;dt!==null&&!be();)lO(dt)}function lO(s){var l=TA(s.alternate,s,Ga);s.memoizedProps=s.pendingProps,l===null?Pp(s):dt=l}function cO(s){var l=s,h=l.alternate;switch(l.tag){case 15:case 0:l=CA(h,l,l.pendingProps,l.type,void 0,pt);break;case 11:l=CA(h,l,l.pendingProps,l.type.render,l.ref,pt);break;case 5:Z0(l);default:RA(h,l),l=dt=o_(l,Ga),l=TA(h,l,Ga)}s.memoizedProps=s.pendingProps,l===null?Pp(s):dt=l}function Cc(s,l,h,g){Da=$o=null,Z0(l),mc=null,dd=0;var x=l.return;try{if(BF(s,x,l,h,pt)){fn=1,xp(s,ai(h,s.current)),dt=null;return}}catch(N){if(x!==null)throw dt=x,N;fn=1,xp(s,ai(h,s.current)),dt=null;return}l.flags&32768?(gt||g===1?s=!0:Sc||(pt&536870912)!==0?s=!1:(Os=s=!0,(g===2||g===9||g===3||g===6)&&(g=Ur.current,g!==null&&g.tag===13&&(g.flags|=16384))),uO(l,s)):Pp(l)}function Pp(s){var l=s;do{if((l.flags&32768)!==0){uO(l,Os);return}s=l.return;var h=qF(l.alternate,l,Ga);if(h!==null){dt=h;return}if(l=l.sibling,l!==null){dt=l;return}dt=l=s}while(l!==null);fn===0&&(fn=5)}function uO(s,l){do{var h=HF(s.alternate,s);if(h!==null){h.flags&=32767,dt=h;return}if(h=s.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!l&&(s=s.sibling,s!==null)){dt=s;return}dt=s=h}while(s!==null);fn=6,dt=null}function dO(s,l,h,g,x,N,z,I,K){s.cancelPendingCommit=null;do Rp();while(En!==0);if((Nt&6)!==0)throw Error(r(327));if(l!==null){if(l===s.current)throw Error(r(177));if(N=l.lanes|l.childLanes,N|=w0,Ph(s,h,N,z,I,K),s===Lt&&(dt=Lt=null,pt=0),Nc=l,Ts=s,Va=h,Ob=N,Eb=x,eO=g,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,nq(Ee,function(){return gO(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||g){g=H.T,H.T=null,x=Q.p,Q.p=2,z=Nt,Nt|=4;try{KF(s,l,h)}finally{Nt=z,Q.p=x,H.T=g}}En=1,fO(),hO(),pO()}}function fO(){if(En===1){En=0;var s=Ts,l=Nc,h=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||h){h=H.T,H.T=null;var g=Q.p;Q.p=2;var x=Nt;Nt|=4;try{GA(l,s);var N=Kb,z=XC(s.containerInfo),I=N.focusedElem,K=N.selectionRange;if(z!==I&&I&&I.ownerDocument&&QC(I.ownerDocument.documentElement,I)){if(K!==null&&g0(I)){var re=K.start,de=K.end;if(de===void 0&&(de=re),"selectionStart"in I)I.selectionStart=re,I.selectionEnd=Math.min(de,I.value.length);else{var ye=I.ownerDocument||document,oe=ye&&ye.defaultView||window;if(oe.getSelection){var ce=oe.getSelection(),Ie=I.textContent.length,We=Math.min(K.start,Ie),Dt=K.end===void 0?We:Math.min(K.end,Ie);!ce.extend&&We>Dt&&(z=Dt,Dt=We,We=z);var X=WC(I,We),V=WC(I,Dt);if(X&&V&&(ce.rangeCount!==1||ce.anchorNode!==X.node||ce.anchorOffset!==X.offset||ce.focusNode!==V.node||ce.focusOffset!==V.offset)){var te=ye.createRange();te.setStart(X.node,X.offset),ce.removeAllRanges(),We>Dt?(ce.addRange(te),ce.extend(V.node,V.offset)):(te.setEnd(V.node,V.offset),ce.addRange(te))}}}}for(ye=[],ce=I;ce=ce.parentNode;)ce.nodeType===1&&ye.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<ye.length;I++){var pe=ye[I];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}Gp=!!Hb,Kb=Hb=null}finally{Nt=x,Q.p=g,H.T=h}}s.current=l,En=2}}function hO(){if(En===2){En=0;var s=Ts,l=Nc,h=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||h){h=H.T,H.T=null;var g=Q.p;Q.p=2;var x=Nt;Nt|=4;try{UA(s,l.alternate,l)}finally{Nt=x,Q.p=g,H.T=h}}En=3}}function pO(){if(En===4||En===3){En=0,Me();var s=Ts,l=Nc,h=Va,g=eO;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?En=5:(En=0,Nc=Ts=null,mO(s,s.pendingLanes));var x=s.pendingLanes;if(x===0&&(zs=null),Xl(h),l=l.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(Xe,l,void 0,(l.current.flags&128)===128)}catch{}if(g!==null){l=H.T,x=Q.p,Q.p=2,H.T=null;try{for(var N=s.onRecoverableError,z=0;z<g.length;z++){var I=g[z];N(I.value,{componentStack:I.stack})}}finally{H.T=l,Q.p=x}}(Va&3)!==0&&Rp(),ia(s),x=s.pendingLanes,(h&261930)!==0&&(x&42)!==0?s===zb?Ad++:(Ad=0,zb=s):Ad=0,Od(0)}}function mO(s,l){(s.pooledCacheLanes&=l)===0&&(l=s.pooledCache,l!=null&&(s.pooledCache=null,cd(l)))}function Rp(){return fO(),hO(),pO(),gO()}function gO(){if(En!==5)return!1;var s=Ts,l=Ob;Ob=0;var h=Xl(Va),g=H.T,x=Q.p;try{Q.p=32>h?32:h,H.T=null,h=Eb,Eb=null;var N=Ts,z=Va;if(En=0,Nc=Ts=null,Va=0,(Nt&6)!==0)throw Error(r(331));var I=Nt;if(Nt|=4,QA(N.current),ZA(N,N.current,z,h),Nt=I,Od(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Xe,N)}catch{}return!0}finally{Q.p=x,H.T=g,mO(s,l)}}function yO(s,l,h){l=ai(h,l),l=cb(s.stateNode,l,2),s=ks(s,l,2),s!==null&&(Eo(s,2),ia(s))}function zt(s,l,h){if(s.tag===3)yO(s,s,h);else for(;l!==null;){if(l.tag===3){yO(l,s,h);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(zs===null||!zs.has(g))){s=ai(h,s),h=vA(2),g=ks(l,h,2),g!==null&&(bA(h,g,l,s),Eo(g,2),ia(g));break}}l=l.return}}function Rb(s,l,h){var g=s.pingCache;if(g===null){g=s.pingCache=new ZF;var x=new Set;g.set(l,x)}else x=g.get(l),x===void 0&&(x=new Set,g.set(l,x));x.has(h)||(Cb=!0,x.add(h),s=JF.bind(null,s,l,h),l.then(s,s))}function JF(s,l,h){var g=s.pingCache;g!==null&&g.delete(l),s.pingedLanes|=s.suspendedLanes&h,s.warmLanes&=~h,Lt===s&&(pt&h)===h&&(fn===4||fn===3&&(pt&62914560)===pt&&300>Pe()-Ap?(Nt&2)===0&&kc(s,0):_b|=h,jc===pt&&(jc=0)),ia(s)}function vO(s,l){l===0&&(l=Oo()),s=Do(s,l),s!==null&&(Eo(s,l),ia(s))}function eq(s){var l=s.memoizedState,h=0;l!==null&&(h=l.retryLane),vO(s,h)}function tq(s,l){var h=0;switch(s.tag){case 31:case 13:var g=s.stateNode,x=s.memoizedState;x!==null&&(h=x.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(l),vO(s,h)}function nq(s,l){return ve(s,l)}var Mp=null,_c=null,Mb=!1,Dp=!1,Db=!1,Rs=0;function ia(s){s!==_c&&s.next===null&&(_c===null?Mp=_c=s:_c=_c.next=s),Dp=!0,Mb||(Mb=!0,iq())}function Od(s,l){if(!Db&&Dp){Db=!0;do for(var h=!1,g=Mp;g!==null;){if(s!==0){var x=g.pendingLanes;if(x===0)var N=0;else{var z=g.suspendedLanes,I=g.pingedLanes;N=(1<<31-Ue(42|s)+1)-1,N&=x&~(z&~I),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(h=!0,SO(g,N))}else N=pt,N=Ao(g,g===Lt?N:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(N&3)===0||gs(g,N)||(h=!0,SO(g,N));g=g.next}while(h);Db=!1}}function rq(){bO()}function bO(){Dp=Mb=!1;var s=0;Rs!==0&&pq()&&(s=Rs);for(var l=Pe(),h=null,g=Mp;g!==null;){var x=g.next,N=xO(g,l);N===0?(g.next=null,h===null?Mp=x:h.next=x,x===null&&(_c=h)):(h=g,(s!==0||(N&3)!==0)&&(Dp=!0)),g=x}En!==0&&En!==5||Od(s),Rs!==0&&(Rs=0)}function xO(s,l){for(var h=s.suspendedLanes,g=s.pingedLanes,x=s.expirationTimes,N=s.pendingLanes&-62914561;0<N;){var z=31-Ue(N),I=1<<z,K=x[z];K===-1?((I&h)===0||(I&g)!==0)&&(x[z]=Jv(I,l)):K<=l&&(s.expiredLanes|=I),N&=~I}if(l=Lt,h=pt,h=Ao(s,s===l?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,h===0||s===l&&(Et===2||Et===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&Ye(g),s.callbackNode=null,s.callbackPriority=0;if((h&3)===0||gs(s,h)){if(l=h&-h,l===s.callbackPriority)return l;switch(g!==null&&Ye(g),Xl(h)){case 2:case 8:h=xe;break;case 32:h=Ee;break;case 268435456:h=et;break;default:h=Ee}return g=wO.bind(null,s),h=ve(h,g),s.callbackPriority=l,s.callbackNode=h,l}return g!==null&&g!==null&&Ye(g),s.callbackPriority=2,s.callbackNode=null,2}function wO(s,l){if(En!==0&&En!==5)return s.callbackNode=null,s.callbackPriority=0,null;var h=s.callbackNode;if(Rp()&&s.callbackNode!==h)return null;var g=pt;return g=Ao(s,s===Lt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(nO(s,g,l),xO(s,Pe()),s.callbackNode!=null&&s.callbackNode===h?wO.bind(null,s):null)}function SO(s,l){if(Rp())return null;nO(s,l,!0)}function iq(){gq(function(){(Nt&6)!==0?ve(ne,rq):bO()})}function Ib(){if(Rs===0){var s=fc;s===0&&(s=ms,ms<<=1,(ms&261888)===0&&(ms=256)),Rs=s}return Rs}function jO(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Hh(""+s)}function NO(s,l){var h=l.ownerDocument.createElement("input");return h.name=l.name,h.value=l.value,s.id&&h.setAttribute("form",s.id),l.parentNode.insertBefore(h,l),s=new FormData(s),h.parentNode.removeChild(h),s}function aq(s,l,h,g,x){if(l==="submit"&&h&&h.stateNode===x){var N=jO((x[Ot]||null).action),z=g.submitter;z&&(l=(l=z[Ot]||null)?jO(l.formAction):z.getAttribute("formAction"),l!==null&&(N=l,z=null));var I=new Zh("action","action",null,g,x);s.push({event:I,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Rs!==0){var K=z?NO(x,z):new FormData(x);rb(h,{pending:!0,data:K,method:x.method,action:N},null,K)}}else typeof N=="function"&&(I.preventDefault(),K=z?NO(x,z):new FormData(x),rb(h,{pending:!0,data:K,method:x.method,action:N},N,K))},currentTarget:x}]})}}for(var Lb=0;Lb<x0.length;Lb++){var $b=x0[Lb],sq=$b.toLowerCase(),oq=$b[0].toUpperCase()+$b.slice(1);Li(sq,"on"+oq)}Li(t_,"onAnimationEnd"),Li(n_,"onAnimationIteration"),Li(r_,"onAnimationStart"),Li("dblclick","onDoubleClick"),Li("focusin","onFocus"),Li("focusout","onBlur"),Li(jF,"onTransitionRun"),Li(NF,"onTransitionStart"),Li(kF,"onTransitionCancel"),Li(i_,"onTransitionEnd"),xt("onMouseEnter",["mouseout","mouseover"]),xt("onMouseLeave",["mouseout","mouseover"]),xt("onPointerEnter",["pointerout","pointerover"]),xt("onPointerLeave",["pointerout","pointerover"]),st("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),st("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),st("onBeforeInput",["compositionend","keypress","textInput","paste"]),st("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),st("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),st("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ed="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(" "),lq=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ed));function kO(s,l){l=(l&4)!==0;for(var h=0;h<s.length;h++){var g=s[h],x=g.event;g=g.listeners;e:{var N=void 0;if(l)for(var z=g.length-1;0<=z;z--){var I=g[z],K=I.instance,re=I.currentTarget;if(I=I.listener,K!==N&&x.isPropagationStopped())break e;N=I,x.currentTarget=re;try{N(x)}catch(de){Qh(de)}x.currentTarget=null,N=K}else for(z=0;z<g.length;z++){if(I=g[z],K=I.instance,re=I.currentTarget,I=I.listener,K!==N&&x.isPropagationStopped())break e;N=I,x.currentTarget=re;try{N(x)}catch(de){Qh(de)}x.currentTarget=null,N=K}}}}function ft(s,l){var h=l[Ri];h===void 0&&(h=l[Ri]=new Set);var g=s+"__bubble";h.has(g)||(CO(l,s,2,!1),h.add(g))}function Bb(s,l,h){var g=0;l&&(g|=4),CO(h,s,g,l)}var Ip="_reactListening"+Math.random().toString(36).slice(2);function Ub(s){if(!s[Ip]){s[Ip]=!0,Lh.forEach(function(h){h!=="selectionchange"&&(lq.has(h)||Bb(h,!1,s),Bb(h,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[Ip]||(l[Ip]=!0,Bb("selectionchange",!1,l))}}function CO(s,l,h,g){switch(tE(l)){case 2:var x=Dq;break;case 8:x=Iq;break;default:x=nx}h=x.bind(null,l,h,s),x=void 0,!o0||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(x=!0),g?x!==void 0?s.addEventListener(l,h,{capture:!0,passive:x}):s.addEventListener(l,h,!0):x!==void 0?s.addEventListener(l,h,{passive:x}):s.addEventListener(l,h,!1)}function Fb(s,l,h,g,x){var N=g;if((l&1)===0&&(l&2)===0&&g!==null)e:for(;;){if(g===null)return;var z=g.tag;if(z===3||z===4){var I=g.stateNode.containerInfo;if(I===x)break;if(z===4)for(z=g.return;z!==null;){var K=z.tag;if((K===3||K===4)&&z.stateNode.containerInfo===x)return;z=z.return}for(;I!==null;){if(z=Mi(I),z===null)return;if(K=z.tag,K===5||K===6||K===26||K===27){g=N=z;continue e}I=I.parentNode}}g=g.return}zC(function(){var re=N,de=a0(h),ye=[];e:{var oe=a_.get(s);if(oe!==void 0){var ce=Zh,Ie=s;switch(s){case"keypress":if(Gh(h)===0)break e;case"keydown":case"keyup":ce=tF;break;case"focusin":Ie="focus",ce=d0;break;case"focusout":Ie="blur",ce=d0;break;case"beforeblur":case"afterblur":ce=d0;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=RC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=q8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=iF;break;case t_:case n_:case r_:ce=G8;break;case i_:ce=sF;break;case"scroll":case"scrollend":ce=U8;break;case"wheel":ce=lF;break;case"copy":case"cut":case"paste":ce=Z8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=DC;break;case"toggle":case"beforetoggle":ce=uF}var We=(l&4)!==0,Dt=!We&&(s==="scroll"||s==="scrollend"),X=We?oe!==null?oe+"Capture":null:oe;We=[];for(var V=re,te;V!==null;){var pe=V;if(te=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||te===null||X===null||(pe=Xu(V,X),pe!=null&&We.push(zd(V,pe,te))),Dt)break;V=V.return}0<We.length&&(oe=new ce(oe,Ie,null,h,de),ye.push({event:oe,listeners:We}))}}if((l&7)===0){e:{if(oe=s==="mouseover"||s==="pointerover",ce=s==="mouseout"||s==="pointerout",oe&&h!==i0&&(Ie=h.relatedTarget||h.fromElement)&&(Mi(Ie)||Ie[Ir]))break e;if((ce||oe)&&(oe=de.window===de?de:(oe=de.ownerDocument)?oe.defaultView||oe.parentWindow:window,ce?(Ie=h.relatedTarget||h.toElement,ce=re,Ie=Ie?Mi(Ie):null,Ie!==null&&(Dt=a(Ie),We=Ie.tag,Ie!==Dt||We!==5&&We!==27&&We!==6)&&(Ie=null)):(ce=null,Ie=re),ce!==Ie)){if(We=RC,pe="onMouseLeave",X="onMouseEnter",V="mouse",(s==="pointerout"||s==="pointerover")&&(We=DC,pe="onPointerLeave",X="onPointerEnter",V="pointer"),Dt=ce==null?oe:zo(ce),te=Ie==null?oe:zo(Ie),oe=new We(pe,V+"leave",ce,h,de),oe.target=Dt,oe.relatedTarget=te,pe=null,Mi(de)===re&&(We=new We(X,V+"enter",Ie,h,de),We.target=te,We.relatedTarget=Dt,pe=We),Dt=pe,ce&&Ie)t:{for(We=cq,X=ce,V=Ie,te=0,pe=X;pe;pe=We(pe))te++;pe=0;for(var Ze=V;Ze;Ze=We(Ze))pe++;for(;0<te-pe;)X=We(X),te--;for(;0<pe-te;)V=We(V),pe--;for(;te--;){if(X===V||V!==null&&X===V.alternate){We=X;break t}X=We(X),V=We(V)}We=null}else We=null;ce!==null&&_O(ye,oe,ce,We,!1),Ie!==null&&Dt!==null&&_O(ye,Dt,Ie,We,!0)}}e:{if(oe=re?zo(re):window,ce=oe.nodeName&&oe.nodeName.toLowerCase(),ce==="select"||ce==="input"&&oe.type==="file")var wt=HC;else if(FC(oe))if(KC)wt=xF;else{wt=vF;var Fe=yF}else ce=oe.nodeName,!ce||ce.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?re&&r0(re.elementType)&&(wt=HC):wt=bF;if(wt&&(wt=wt(s,re))){qC(ye,wt,h,de);break e}Fe&&Fe(s,oe,re),s==="focusout"&&re&&oe.type==="number"&&re.memoizedProps.value!=null&&n0(oe,"number",oe.value)}switch(Fe=re?zo(re):window,s){case"focusin":(FC(Fe)||Fe.contentEditable==="true")&&(ic=Fe,y0=re,sd=null);break;case"focusout":sd=y0=ic=null;break;case"mousedown":v0=!0;break;case"contextmenu":case"mouseup":case"dragend":v0=!1,JC(ye,h,de);break;case"selectionchange":if(SF)break;case"keydown":case"keyup":JC(ye,h,de)}var ot;if(h0)e:{switch(s){case"compositionstart":var mt="onCompositionStart";break e;case"compositionend":mt="onCompositionEnd";break e;case"compositionupdate":mt="onCompositionUpdate";break e}mt=void 0}else rc?BC(s,h)&&(mt="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(mt="onCompositionStart");mt&&(IC&&h.locale!=="ko"&&(rc||mt!=="onCompositionStart"?mt==="onCompositionEnd"&&rc&&(ot=TC()):(vs=de,l0="value"in vs?vs.value:vs.textContent,rc=!0)),Fe=Lp(re,mt),0<Fe.length&&(mt=new MC(mt,s,null,h,de),ye.push({event:mt,listeners:Fe}),ot?mt.data=ot:(ot=UC(h),ot!==null&&(mt.data=ot)))),(ot=fF?hF(s,h):pF(s,h))&&(mt=Lp(re,"onBeforeInput"),0<mt.length&&(Fe=new MC("onBeforeInput","beforeinput",null,h,de),ye.push({event:Fe,listeners:mt}),Fe.data=ot)),aq(ye,s,re,h,de)}kO(ye,l)})}function zd(s,l,h){return{instance:s,listener:l,currentTarget:h}}function Lp(s,l){for(var h=l+"Capture",g=[];s!==null;){var x=s,N=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||N===null||(x=Xu(s,h),x!=null&&g.unshift(zd(s,x,N)),x=Xu(s,l),x!=null&&g.push(zd(s,x,N))),s.tag===3)return g;s=s.return}return[]}function cq(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function _O(s,l,h,g,x){for(var N=l._reactName,z=[];h!==null&&h!==g;){var I=h,K=I.alternate,re=I.stateNode;if(I=I.tag,K!==null&&K===g)break;I!==5&&I!==26&&I!==27||re===null||(K=re,x?(re=Xu(h,N),re!=null&&z.unshift(zd(h,re,K))):x||(re=Xu(h,N),re!=null&&z.push(zd(h,re,K)))),h=h.return}z.length!==0&&s.push({event:l,listeners:z})}var uq=/\r\n?/g,dq=/\u0000|\uFFFD/g;function AO(s){return(typeof s=="string"?s:""+s).replace(uq,`
9
+ `).replace(dq,"")}function OO(s,l){return l=AO(l),AO(s)===l}function Mt(s,l,h,g,x,N){switch(h){case"children":typeof g=="string"?l==="body"||l==="textarea"&&g===""||ec(s,g):(typeof g=="number"||typeof g=="bigint")&&l!=="body"&&ec(s,""+g);break;case"className":Fh(s,"class",g);break;case"tabIndex":Fh(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Fh(s,h,g);break;case"style":OC(s,g,N);break;case"data":if(l!=="object"){Fh(s,"data",g);break}case"src":case"href":if(g===""&&(l!=="a"||h!=="href")){s.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=Hh(""+g),s.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof N=="function"&&(h==="formAction"?(l!=="input"&&Mt(s,l,"name",x.name,x,null),Mt(s,l,"formEncType",x.formEncType,x,null),Mt(s,l,"formMethod",x.formMethod,x,null),Mt(s,l,"formTarget",x.formTarget,x,null)):(Mt(s,l,"encType",x.encType,x,null),Mt(s,l,"method",x.method,x,null),Mt(s,l,"target",x.target,x,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=Hh(""+g),s.setAttribute(h,g);break;case"onClick":g!=null&&(s.onclick=Ta);break;case"onScroll":g!=null&&ft("scroll",s);break;case"onScrollEnd":g!=null&&ft("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(x.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}h=Hh(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,""+g):s.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,""):s.removeAttribute(h);break;case"capture":case"download":g===!0?s.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,g):s.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(h,g):s.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(h):s.setAttribute(h,g);break;case"popover":ft("beforetoggle",s),ft("toggle",s),Uh(s,"popover",g);break;case"xlinkActuate":za(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":za(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":za(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":za(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":za(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":za(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":za(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":za(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":za(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Uh(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=$8.get(h)||h,Uh(s,h,g))}}function qb(s,l,h,g,x,N){switch(h){case"style":OC(s,g,N);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(x.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"children":typeof g=="string"?ec(s,g):(typeof g=="number"||typeof g=="bigint")&&ec(s,""+g);break;case"onScroll":g!=null&&ft("scroll",s);break;case"onScrollEnd":g!=null&&ft("scrollend",s);break;case"onClick":g!=null&&(s.onclick=Ta);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$h.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(x=h.endsWith("Capture"),l=h.slice(2,x?h.length-7:void 0),N=s[Ot]||null,N=N!=null?N[h]:null,typeof N=="function"&&s.removeEventListener(l,N,x),typeof g=="function")){typeof N!="function"&&N!==null&&(h in s?s[h]=null:s.hasAttribute(h)&&s.removeAttribute(h)),s.addEventListener(l,g,x);break e}h in s?s[h]=g:g===!0?s.setAttribute(h,""):Uh(s,h,g)}}}function Gn(s,l,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ft("error",s),ft("load",s);var g=!1,x=!1,N;for(N in h)if(h.hasOwnProperty(N)){var z=h[N];if(z!=null)switch(N){case"src":g=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Mt(s,l,N,z,h,null)}}x&&Mt(s,l,"srcSet",h.srcSet,h,null),g&&Mt(s,l,"src",h.src,h,null);return;case"input":ft("invalid",s);var I=N=z=x=null,K=null,re=null;for(g in h)if(h.hasOwnProperty(g)){var de=h[g];if(de!=null)switch(g){case"name":x=de;break;case"type":z=de;break;case"checked":K=de;break;case"defaultChecked":re=de;break;case"value":N=de;break;case"defaultValue":I=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,l));break;default:Mt(s,l,g,de,h,null)}}kC(s,N,I,K,re,z,x,!1);return;case"select":ft("invalid",s),g=z=N=null;for(x in h)if(h.hasOwnProperty(x)&&(I=h[x],I!=null))switch(x){case"value":N=I;break;case"defaultValue":z=I;break;case"multiple":g=I;default:Mt(s,l,x,I,h,null)}l=N,h=z,s.multiple=!!g,l!=null?Jl(s,!!g,l,!1):h!=null&&Jl(s,!!g,h,!0);return;case"textarea":ft("invalid",s),N=x=g=null;for(z in h)if(h.hasOwnProperty(z)&&(I=h[z],I!=null))switch(z){case"value":g=I;break;case"defaultValue":x=I;break;case"children":N=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(91));break;default:Mt(s,l,z,I,h,null)}_C(s,g,x,N);return;case"option":for(K in h)h.hasOwnProperty(K)&&(g=h[K],g!=null)&&(K==="selected"?s.selected=g&&typeof g!="function"&&typeof g!="symbol":Mt(s,l,K,g,h,null));return;case"dialog":ft("beforetoggle",s),ft("toggle",s),ft("cancel",s),ft("close",s);break;case"iframe":case"object":ft("load",s);break;case"video":case"audio":for(g=0;g<Ed.length;g++)ft(Ed[g],s);break;case"image":ft("error",s),ft("load",s);break;case"details":ft("toggle",s);break;case"embed":case"source":case"link":ft("error",s),ft("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in h)if(h.hasOwnProperty(re)&&(g=h[re],g!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Mt(s,l,re,g,h,null)}return;default:if(r0(l)){for(de in h)h.hasOwnProperty(de)&&(g=h[de],g!==void 0&&qb(s,l,de,g,h,void 0));return}}for(I in h)h.hasOwnProperty(I)&&(g=h[I],g!=null&&Mt(s,l,I,g,h,null))}function fq(s,l,h,g){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,N=null,z=null,I=null,K=null,re=null,de=null;for(ce in h){var ye=h[ce];if(h.hasOwnProperty(ce)&&ye!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":K=ye;default:g.hasOwnProperty(ce)||Mt(s,l,ce,null,g,ye)}}for(var oe in g){var ce=g[oe];if(ye=h[oe],g.hasOwnProperty(oe)&&(ce!=null||ye!=null))switch(oe){case"type":N=ce;break;case"name":x=ce;break;case"checked":re=ce;break;case"defaultChecked":de=ce;break;case"value":z=ce;break;case"defaultValue":I=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,l));break;default:ce!==ye&&Mt(s,l,oe,ce,g,ye)}}t0(s,z,I,K,re,de,N,x);return;case"select":ce=z=I=oe=null;for(N in h)if(K=h[N],h.hasOwnProperty(N)&&K!=null)switch(N){case"value":break;case"multiple":ce=K;default:g.hasOwnProperty(N)||Mt(s,l,N,null,g,K)}for(x in g)if(N=g[x],K=h[x],g.hasOwnProperty(x)&&(N!=null||K!=null))switch(x){case"value":oe=N;break;case"defaultValue":I=N;break;case"multiple":z=N;default:N!==K&&Mt(s,l,x,N,g,K)}l=I,h=z,g=ce,oe!=null?Jl(s,!!h,oe,!1):!!g!=!!h&&(l!=null?Jl(s,!!h,l,!0):Jl(s,!!h,h?[]:"",!1));return;case"textarea":ce=oe=null;for(I in h)if(x=h[I],h.hasOwnProperty(I)&&x!=null&&!g.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:Mt(s,l,I,null,g,x)}for(z in g)if(x=g[z],N=h[z],g.hasOwnProperty(z)&&(x!=null||N!=null))switch(z){case"value":oe=x;break;case"defaultValue":ce=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==N&&Mt(s,l,z,x,g,N)}CC(s,oe,ce);return;case"option":for(var Ie in h)oe=h[Ie],h.hasOwnProperty(Ie)&&oe!=null&&!g.hasOwnProperty(Ie)&&(Ie==="selected"?s.selected=!1:Mt(s,l,Ie,null,g,oe));for(K in g)oe=g[K],ce=h[K],g.hasOwnProperty(K)&&oe!==ce&&(oe!=null||ce!=null)&&(K==="selected"?s.selected=oe&&typeof oe!="function"&&typeof oe!="symbol":Mt(s,l,K,oe,g,ce));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var We in h)oe=h[We],h.hasOwnProperty(We)&&oe!=null&&!g.hasOwnProperty(We)&&Mt(s,l,We,null,g,oe);for(re in g)if(oe=g[re],ce=h[re],g.hasOwnProperty(re)&&oe!==ce&&(oe!=null||ce!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,l));break;default:Mt(s,l,re,oe,g,ce)}return;default:if(r0(l)){for(var Dt in h)oe=h[Dt],h.hasOwnProperty(Dt)&&oe!==void 0&&!g.hasOwnProperty(Dt)&&qb(s,l,Dt,void 0,g,oe);for(de in g)oe=g[de],ce=h[de],!g.hasOwnProperty(de)||oe===ce||oe===void 0&&ce===void 0||qb(s,l,de,oe,g,ce);return}}for(var X in h)oe=h[X],h.hasOwnProperty(X)&&oe!=null&&!g.hasOwnProperty(X)&&Mt(s,l,X,null,g,oe);for(ye in g)oe=g[ye],ce=h[ye],!g.hasOwnProperty(ye)||oe===ce||oe==null&&ce==null||Mt(s,l,ye,oe,g,ce)}function EO(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hq(){if(typeof performance.getEntriesByType=="function"){for(var s=0,l=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var x=h[g],N=x.transferSize,z=x.initiatorType,I=x.duration;if(N&&I&&EO(z)){for(z=0,I=x.responseEnd,g+=1;g<h.length;g++){var K=h[g],re=K.startTime;if(re>I)break;var de=K.transferSize,ye=K.initiatorType;de&&EO(ye)&&(K=K.responseEnd,z+=de*(K<I?1:(I-re)/(K-re)))}if(--g,l+=8*(N+z)/(x.duration/1e3),s++,10<s)break}}if(0<s)return l/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Hb=null,Kb=null;function $p(s){return s.nodeType===9?s:s.ownerDocument}function zO(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function TO(s,l){if(s===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&l==="foreignObject"?0:s}function Gb(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Vb=null;function pq(){var s=window.event;return s&&s.type==="popstate"?s===Vb?!1:(Vb=s,!0):(Vb=null,!1)}var PO=typeof setTimeout=="function"?setTimeout:void 0,mq=typeof clearTimeout=="function"?clearTimeout:void 0,RO=typeof Promise=="function"?Promise:void 0,gq=typeof queueMicrotask=="function"?queueMicrotask:typeof RO<"u"?function(s){return RO.resolve(null).then(s).catch(yq)}:PO;function yq(s){setTimeout(function(){throw s})}function Ms(s){return s==="head"}function MO(s,l){var h=l,g=0;do{var x=h.nextSibling;if(s.removeChild(h),x&&x.nodeType===8)if(h=x.data,h==="/$"||h==="/&"){if(g===0){s.removeChild(x),zc(l);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")Td(s.ownerDocument.documentElement);else if(h==="head"){h=s.ownerDocument.head,Td(h);for(var N=h.firstChild;N;){var z=N.nextSibling,I=N.nodeName;N[ti]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&N.rel.toLowerCase()==="stylesheet"||h.removeChild(N),N=z}}else h==="body"&&Td(s.ownerDocument.body);h=x}while(h);zc(l)}function DO(s,l){var h=s;s=0;do{var g=h.nextSibling;if(h.nodeType===1?l?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(l?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(s===0)break;s--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||s++;h=g}while(h)}function Zb(s){var l=s.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var h=l;switch(l=l.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Zb(h),Oa(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}s.removeChild(h)}}function vq(s,l,h,g){for(;s.nodeType===1;){var x=h;if(s.nodeName.toLowerCase()!==l.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[ti])switch(l){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(N=s.getAttribute("rel"),N==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(N!==x.rel||s.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||s.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||s.getAttribute("title")!==(x.title==null?null:x.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(N=s.getAttribute("src"),(N!==(x.src==null?null:x.src)||s.getAttribute("type")!==(x.type==null?null:x.type)||s.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&N&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(l==="input"&&s.type==="hidden"){var N=x.name==null?null:""+x.name;if(x.type==="hidden"&&s.getAttribute("name")===N)return s}else return s;if(s=ui(s.nextSibling),s===null)break}return null}function bq(s,l,h){if(l==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!h||(s=ui(s.nextSibling),s===null))return null;return s}function IO(s,l){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!l||(s=ui(s.nextSibling),s===null))return null;return s}function Yb(s){return s.data==="$?"||s.data==="$~"}function Wb(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function xq(s,l){var h=s.ownerDocument;if(s.data==="$~")s._reactRetry=l;else if(s.data!=="$?"||h.readyState!=="loading")l();else{var g=function(){l(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function ui(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return s}var Qb=null;function LO(s){s=s.nextSibling;for(var l=0;s;){if(s.nodeType===8){var h=s.data;if(h==="/$"||h==="/&"){if(l===0)return ui(s.nextSibling);l--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||l++}s=s.nextSibling}return null}function $O(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var h=s.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(l===0)return s;l--}else h!=="/$"&&h!=="/&"||l++}s=s.previousSibling}return null}function BO(s,l,h){switch(l=$p(h),s){case"html":if(s=l.documentElement,!s)throw Error(r(452));return s;case"head":if(s=l.head,!s)throw Error(r(453));return s;case"body":if(s=l.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Td(s){for(var l=s.attributes;l.length;)s.removeAttributeNode(l[0]);Oa(s)}var di=new Map,UO=new Set;function Bp(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Za=Q.d;Q.d={f:wq,r:Sq,D:jq,C:Nq,L:kq,m:Cq,X:Aq,S:_q,M:Oq};function wq(){var s=Za.f(),l=zp();return s||l}function Sq(s){var l=Ea(s);l!==null&&l.tag===5&&l.type==="form"?iA(l):Za.r(s)}var Ac=typeof document>"u"?null:document;function FO(s,l,h){var g=Ac;if(g&&typeof l=="string"&&l){var x=ri(l);x='link[rel="'+s+'"][href="'+x+'"]',typeof h=="string"&&(x+='[crossorigin="'+h+'"]'),UO.has(x)||(UO.add(x),s={rel:s,crossOrigin:h,href:l},g.querySelector(x)===null&&(l=g.createElement("link"),Gn(l,"link",s),an(l),g.head.appendChild(l)))}}function jq(s){Za.D(s),FO("dns-prefetch",s,null)}function Nq(s,l){Za.C(s,l),FO("preconnect",s,l)}function kq(s,l,h){Za.L(s,l,h);var g=Ac;if(g&&s&&l){var x='link[rel="preload"][as="'+ri(l)+'"]';l==="image"&&h&&h.imageSrcSet?(x+='[imagesrcset="'+ri(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(x+='[imagesizes="'+ri(h.imageSizes)+'"]')):x+='[href="'+ri(s)+'"]';var N=x;switch(l){case"style":N=Oc(s);break;case"script":N=Ec(s)}di.has(N)||(s=m({rel:"preload",href:l==="image"&&h&&h.imageSrcSet?void 0:s,as:l},h),di.set(N,s),g.querySelector(x)!==null||l==="style"&&g.querySelector(Pd(N))||l==="script"&&g.querySelector(Rd(N))||(l=g.createElement("link"),Gn(l,"link",s),an(l),g.head.appendChild(l)))}}function Cq(s,l){Za.m(s,l);var h=Ac;if(h&&s){var g=l&&typeof l.as=="string"?l.as:"script",x='link[rel="modulepreload"][as="'+ri(g)+'"][href="'+ri(s)+'"]',N=x;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=Ec(s)}if(!di.has(N)&&(s=m({rel:"modulepreload",href:s},l),di.set(N,s),h.querySelector(x)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Rd(N)))return}g=h.createElement("link"),Gn(g,"link",s),an(g),h.head.appendChild(g)}}}function _q(s,l,h){Za.S(s,l,h);var g=Ac;if(g&&s){var x=Di(g).hoistableStyles,N=Oc(s);l=l||"default";var z=x.get(N);if(!z){var I={loading:0,preload:null};if(z=g.querySelector(Pd(N)))I.loading=5;else{s=m({rel:"stylesheet",href:s,"data-precedence":l},h),(h=di.get(N))&&Xb(s,h);var K=z=g.createElement("link");an(K),Gn(K,"link",s),K._p=new Promise(function(re,de){K.onload=re,K.onerror=de}),K.addEventListener("load",function(){I.loading|=1}),K.addEventListener("error",function(){I.loading|=2}),I.loading|=4,Up(z,l,g)}z={type:"stylesheet",instance:z,count:1,state:I},x.set(N,z)}}}function Aq(s,l){Za.X(s,l);var h=Ac;if(h&&s){var g=Di(h).hoistableScripts,x=Ec(s),N=g.get(x);N||(N=h.querySelector(Rd(x)),N||(s=m({src:s,async:!0},l),(l=di.get(x))&&Jb(s,l),N=h.createElement("script"),an(N),Gn(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(x,N))}}function Oq(s,l){Za.M(s,l);var h=Ac;if(h&&s){var g=Di(h).hoistableScripts,x=Ec(s),N=g.get(x);N||(N=h.querySelector(Rd(x)),N||(s=m({src:s,async:!0,type:"module"},l),(l=di.get(x))&&Jb(s,l),N=h.createElement("script"),an(N),Gn(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(x,N))}}function qO(s,l,h,g){var x=(x=ie.current)?Bp(x):null;if(!x)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(l=Oc(h.href),h=Di(x).hoistableStyles,g=h.get(l),g||(g={type:"style",instance:null,count:0,state:null},h.set(l,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){s=Oc(h.href);var N=Di(x).hoistableStyles,z=N.get(s);if(z||(x=x.ownerDocument||x,z={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(s,z),(N=x.querySelector(Pd(s)))&&!N._p&&(z.instance=N,z.state.loading=5),di.has(s)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},di.set(s,h),N||Eq(x,s,h,z.state))),l&&g===null)throw Error(r(528,""));return z}if(l&&g!==null)throw Error(r(529,""));return null;case"script":return l=h.async,h=h.src,typeof h=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Ec(h),h=Di(x).hoistableScripts,g=h.get(l),g||(g={type:"script",instance:null,count:0,state:null},h.set(l,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Oc(s){return'href="'+ri(s)+'"'}function Pd(s){return'link[rel="stylesheet"]['+s+"]"}function HO(s){return m({},s,{"data-precedence":s.precedence,precedence:null})}function Eq(s,l,h,g){s.querySelector('link[rel="preload"][as="style"]['+l+"]")?g.loading=1:(l=s.createElement("link"),g.preload=l,l.addEventListener("load",function(){return g.loading|=1}),l.addEventListener("error",function(){return g.loading|=2}),Gn(l,"link",h),an(l),s.head.appendChild(l))}function Ec(s){return'[src="'+ri(s)+'"]'}function Rd(s){return"script[async]"+s}function KO(s,l,h){if(l.count++,l.instance===null)switch(l.type){case"style":var g=s.querySelector('style[data-href~="'+ri(h.href)+'"]');if(g)return l.instance=g,an(g),g;var x=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),an(g),Gn(g,"style",x),Up(g,h.precedence,s),l.instance=g;case"stylesheet":x=Oc(h.href);var N=s.querySelector(Pd(x));if(N)return l.state.loading|=4,l.instance=N,an(N),N;g=HO(h),(x=di.get(x))&&Xb(g,x),N=(s.ownerDocument||s).createElement("link"),an(N);var z=N;return z._p=new Promise(function(I,K){z.onload=I,z.onerror=K}),Gn(N,"link",g),l.state.loading|=4,Up(N,h.precedence,s),l.instance=N;case"script":return N=Ec(h.src),(x=s.querySelector(Rd(N)))?(l.instance=x,an(x),x):(g=h,(x=di.get(N))&&(g=m({},h),Jb(g,x)),s=s.ownerDocument||s,x=s.createElement("script"),an(x),Gn(x,"link",g),s.head.appendChild(x),l.instance=x);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(g=l.instance,l.state.loading|=4,Up(g,h.precedence,s));return l.instance}function Up(s,l,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=g.length?g[g.length-1]:null,N=x,z=0;z<g.length;z++){var I=g[z];if(I.dataset.precedence===l)N=I;else if(N!==x)break}N?N.parentNode.insertBefore(s,N.nextSibling):(l=h.nodeType===9?h.head:h,l.insertBefore(s,l.firstChild))}function Xb(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.title==null&&(s.title=l.title)}function Jb(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.integrity==null&&(s.integrity=l.integrity)}var Fp=null;function GO(s,l,h){if(Fp===null){var g=new Map,x=Fp=new Map;x.set(h,g)}else x=Fp,g=x.get(h),g||(g=new Map,x.set(h,g));if(g.has(s))return g;for(g.set(s,null),h=h.getElementsByTagName(s),x=0;x<h.length;x++){var N=h[x];if(!(N[ti]||N[ut]||s==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var z=N.getAttribute(l)||"";z=s+z;var I=g.get(z);I?I.push(N):g.set(z,[N])}}return g}function VO(s,l,h){s=s.ownerDocument||s,s.head.insertBefore(h,l==="title"?s.querySelector("head > title"):null)}function zq(s,l,h){if(h===1||l.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(s=l.disabled,typeof l.precedence=="string"&&s==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function ZO(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function Tq(s,l,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var x=Oc(g.href),N=l.querySelector(Pd(x));if(N){l=N._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(s.count++,s=qp.bind(s),l.then(s,s)),h.state.loading|=4,h.instance=N,an(N);return}N=l.ownerDocument||l,g=HO(g),(x=di.get(x))&&Xb(g,x),N=N.createElement("link"),an(N);var z=N;z._p=new Promise(function(I,K){z.onload=I,z.onerror=K}),Gn(N,"link",g),h.instance=N}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(h,l),(l=h.state.preload)&&(h.state.loading&3)===0&&(s.count++,h=qp.bind(s),l.addEventListener("load",h),l.addEventListener("error",h))}}var ex=0;function Pq(s,l){return s.stylesheets&&s.count===0&&Kp(s,s.stylesheets),0<s.count||0<s.imgCount?function(h){var g=setTimeout(function(){if(s.stylesheets&&Kp(s,s.stylesheets),s.unsuspend){var N=s.unsuspend;s.unsuspend=null,N()}},6e4+l);0<s.imgBytes&&ex===0&&(ex=62500*hq());var x=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Kp(s,s.stylesheets),s.unsuspend)){var N=s.unsuspend;s.unsuspend=null,N()}},(s.imgBytes>ex?50:800)+l);return s.unsuspend=h,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(x)}}:null}function qp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kp(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Hp=null;function Kp(s,l){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Hp=new Map,l.forEach(Rq,s),Hp=null,qp.call(s))}function Rq(s,l){if(!(l.state.loading&4)){var h=Hp.get(s);if(h)var g=h.get(null);else{h=new Map,Hp.set(s,h);for(var x=s.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<x.length;N++){var z=x[N];(z.nodeName==="LINK"||z.getAttribute("media")!=="not all")&&(h.set(z.dataset.precedence,z),g=z)}g&&h.set(null,g)}x=l.instance,z=x.getAttribute("data-precedence"),N=h.get(z)||g,N===g&&h.set(null,x),h.set(z,x),this.count++,g=qp.bind(this),x.addEventListener("load",g),x.addEventListener("error",g),N?N.parentNode.insertBefore(x,N.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(x,s.firstChild)),l.state.loading|=4}}var Md={$$typeof:_,Provider:null,Consumer:null,_currentValue:he,_currentValue2:he,_threadCount:0};function Mq(s,l,h,g,x,N,z,I,K){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ql(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ql(0),this.hiddenUpdates=Ql(null),this.identifierPrefix=g,this.onUncaughtError=x,this.onCaughtError=N,this.onRecoverableError=z,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function YO(s,l,h,g,x,N,z,I,K,re,de,ye){return s=new Mq(s,l,h,z,K,re,de,ye,I),l=1,N===!0&&(l|=24),N=Br(3,null,null,l),s.current=N,N.stateNode=s,l=P0(),l.refCount++,s.pooledCache=l,l.refCount++,N.memoizedState={element:g,isDehydrated:h,cache:l},I0(N),s}function WO(s){return s?(s=oc,s):oc}function QO(s,l,h,g,x,N){x=WO(x),g.context===null?g.context=x:g.pendingContext=x,g=Ns(l),g.payload={element:h},N=N===void 0?null:N,N!==null&&(g.callback=N),h=ks(s,g,l),h!==null&&(kr(h,s,l),hd(h,s,l))}function XO(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<l?h:l}}function tx(s,l){XO(s,l),(s=s.alternate)&&XO(s,l)}function JO(s){if(s.tag===13||s.tag===31){var l=Do(s,67108864);l!==null&&kr(l,s,67108864),tx(s,67108864)}}function eE(s){if(s.tag===13||s.tag===31){var l=Kr();l=Qu(l);var h=Do(s,l);h!==null&&kr(h,s,l),tx(s,l)}}var Gp=!0;function Dq(s,l,h,g){var x=H.T;H.T=null;var N=Q.p;try{Q.p=2,nx(s,l,h,g)}finally{Q.p=N,H.T=x}}function Iq(s,l,h,g){var x=H.T;H.T=null;var N=Q.p;try{Q.p=8,nx(s,l,h,g)}finally{Q.p=N,H.T=x}}function nx(s,l,h,g){if(Gp){var x=rx(g);if(x===null)Fb(s,l,g,Vp,h),nE(s,g);else if($q(x,s,l,h,g))g.stopPropagation();else if(nE(s,g),l&4&&-1<Lq.indexOf(s)){for(;x!==null;){var N=Ea(x);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var z=ei(N.pendingLanes);if(z!==0){var I=N;for(I.pendingLanes|=2,I.entangledLanes|=2;z;){var K=1<<31-Ue(z);I.entanglements[1]|=K,z&=~K}ia(N),(Nt&6)===0&&(Op=Pe()+500,Od(0))}}break;case 31:case 13:I=Do(N,2),I!==null&&kr(I,N,2),zp(),tx(N,2)}if(N=rx(g),N===null&&Fb(s,l,g,Vp,h),N===x)break;x=N}x!==null&&g.stopPropagation()}else Fb(s,l,g,null,h)}}function rx(s){return s=a0(s),ix(s)}var Vp=null;function ix(s){if(Vp=null,s=Mi(s),s!==null){var l=a(s);if(l===null)s=null;else{var h=l.tag;if(h===13){if(s=o(l),s!==null)return s;s=null}else if(h===31){if(s=u(l),s!==null)return s;s=null}else if(h===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null)}}return Vp=s,null}function tE(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ze()){case ne:return 2;case xe:return 8;case Ee:case Ge:return 32;case et:return 268435456;default:return 32}default:return 32}}var ax=!1,Ds=null,Is=null,Ls=null,Dd=new Map,Id=new Map,$s=[],Lq="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 nE(s,l){switch(s){case"focusin":case"focusout":Ds=null;break;case"dragenter":case"dragleave":Is=null;break;case"mouseover":case"mouseout":Ls=null;break;case"pointerover":case"pointerout":Dd.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Id.delete(l.pointerId)}}function Ld(s,l,h,g,x,N){return s===null||s.nativeEvent!==N?(s={blockedOn:l,domEventName:h,eventSystemFlags:g,nativeEvent:N,targetContainers:[x]},l!==null&&(l=Ea(l),l!==null&&JO(l)),s):(s.eventSystemFlags|=g,l=s.targetContainers,x!==null&&l.indexOf(x)===-1&&l.push(x),s)}function $q(s,l,h,g,x){switch(l){case"focusin":return Ds=Ld(Ds,s,l,h,g,x),!0;case"dragenter":return Is=Ld(Is,s,l,h,g,x),!0;case"mouseover":return Ls=Ld(Ls,s,l,h,g,x),!0;case"pointerover":var N=x.pointerId;return Dd.set(N,Ld(Dd.get(N)||null,s,l,h,g,x)),!0;case"gotpointercapture":return N=x.pointerId,Id.set(N,Ld(Id.get(N)||null,s,l,h,g,x)),!0}return!1}function rE(s){var l=Mi(s.target);if(l!==null){var h=a(l);if(h!==null){if(l=h.tag,l===13){if(l=o(h),l!==null){s.blockedOn=l,Ne(s.priority,function(){eE(h)});return}}else if(l===31){if(l=u(h),l!==null){s.blockedOn=l,Ne(s.priority,function(){eE(h)});return}}else if(l===3&&h.stateNode.current.memoizedState.isDehydrated){s.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Zp(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var h=rx(s.nativeEvent);if(h===null){h=s.nativeEvent;var g=new h.constructor(h.type,h);i0=g,h.target.dispatchEvent(g),i0=null}else return l=Ea(h),l!==null&&JO(l),s.blockedOn=h,!1;l.shift()}return!0}function iE(s,l,h){Zp(s)&&h.delete(l)}function Bq(){ax=!1,Ds!==null&&Zp(Ds)&&(Ds=null),Is!==null&&Zp(Is)&&(Is=null),Ls!==null&&Zp(Ls)&&(Ls=null),Dd.forEach(iE),Id.forEach(iE)}function Yp(s,l){s.blockedOn===l&&(s.blockedOn=null,ax||(ax=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Bq)))}var Wp=null;function aE(s){Wp!==s&&(Wp=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Wp===s&&(Wp=null);for(var l=0;l<s.length;l+=3){var h=s[l],g=s[l+1],x=s[l+2];if(typeof g!="function"){if(ix(g||h)===null)continue;break}var N=Ea(h);N!==null&&(s.splice(l,3),l-=3,rb(N,{pending:!0,data:x,method:h.method,action:g},g,x))}}))}function zc(s){function l(K){return Yp(K,s)}Ds!==null&&Yp(Ds,s),Is!==null&&Yp(Is,s),Ls!==null&&Yp(Ls,s),Dd.forEach(l),Id.forEach(l);for(var h=0;h<$s.length;h++){var g=$s[h];g.blockedOn===s&&(g.blockedOn=null)}for(;0<$s.length&&(h=$s[0],h.blockedOn===null);)rE(h),h.blockedOn===null&&$s.shift();if(h=(s.ownerDocument||s).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var x=h[g],N=h[g+1],z=x[Ot]||null;if(typeof N=="function")z||aE(h);else if(z){var I=null;if(N&&N.hasAttribute("formAction")){if(x=N,z=N[Ot]||null)I=z.formAction;else if(ix(x)!==null)continue}else I=z.action;typeof I=="function"?h[g+1]=I:(h.splice(g,3),g-=3),aE(h)}}}function sE(){function s(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(z){return x=z})},focusReset:"manual",scroll:"manual"})}function l(){x!==null&&(x(),x=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var N=navigation.currentEntry;N&&N.url!=null&&navigation.navigate(N.url,{state:N.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,x=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),x!==null&&(x(),x=null)}}}function sx(s){this._internalRoot=s}Qp.prototype.render=sx.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(r(409));var h=l.current,g=Kr();QO(h,g,s,l,null,null)},Qp.prototype.unmount=sx.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;QO(s.current,2,null,s,null,null),zp(),l[Ir]=null}};function Qp(s){this._internalRoot=s}Qp.prototype.unstable_scheduleHydration=function(s){if(s){var l=G();s={blockedOn:null,target:s,priority:l};for(var h=0;h<$s.length&&l!==0&&l<$s[h].priority;h++);$s.splice(h,0,s),h===0&&rE(s)}};var oE=t.version;if(oE!=="19.2.4")throw Error(r(527,oE,"19.2.4"));Q.findDOMNode=function(s){var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(l),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var Uq={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xp.isDisabled&&Xp.supportsFiber)try{Xe=Xp.inject(Uq),Qt=Xp}catch{}}return Bd.createRoot=function(s,l){if(!i(s))throw Error(r(299));var h=!1,g="",x=pA,N=mA,z=gA;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(x=l.onUncaughtError),l.onCaughtError!==void 0&&(N=l.onCaughtError),l.onRecoverableError!==void 0&&(z=l.onRecoverableError)),l=YO(s,1,!1,null,null,h,g,null,x,N,z,sE),s[Ir]=l.current,Ub(s),new sx(l)},Bd.hydrateRoot=function(s,l,h){if(!i(s))throw Error(r(299));var g=!1,x="",N=pA,z=mA,I=gA,K=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(x=h.identifierPrefix),h.onUncaughtError!==void 0&&(N=h.onUncaughtError),h.onCaughtError!==void 0&&(z=h.onCaughtError),h.onRecoverableError!==void 0&&(I=h.onRecoverableError),h.formState!==void 0&&(K=h.formState)),l=YO(s,1,!0,l,h??null,g,x,K,N,z,I,sE),l.context=WO(null),h=l.current,g=Kr(),g=Qu(g),x=Ns(g),x.callback=null,ks(h,x,g),h=g,l.current.lanes=h,Eo(l,h),ia(l),s[Ir]=l.current,Ub(s),new Qp(l)},Bd.version="19.2.4",Bd}var yE;function Qq(){if(yE)return cx.exports;yE=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(),cx.exports=Wq(),cx.exports}var Xq=Qq(),Bl=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(){}},Jq={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},e9=class{#t=Jq;#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)}},ol=new e9;function t9(e){setTimeout(e,0)}var Cl=typeof window>"u"||"Deno"in globalThis;function nr(){}function n9(e,t){return typeof e=="function"?e(t):e}function TS(e){return typeof e=="number"&&e>=0&&e!==1/0}function QD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ao(e,t){return typeof e=="function"?e(t):e}function vi(e,t){return typeof e=="function"?e(t):e}function vE(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:u}=e;if(o){if(r){if(t.queryHash!==Sj(o,t.options))return!1}else if(!Nf(t.queryKey,o))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 bE(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(_l(t.options.mutationKey)!==_l(a))return!1}else if(!Nf(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Sj(e,t){return(t?.queryKeyHashFn||_l)(e)}function _l(e){return JSON.stringify(e,(t,n)=>PS(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Nf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Nf(e[n],t[n])):!1}var r9=Object.prototype.hasOwnProperty;function jj(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=xE(e)&&xE(t);if(!r&&!(PS(e)&&PS(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),u=o.length,d=r?new Array(u):{};let f=0;for(let p=0;p<u;p++){const m=r?p:o[p],y=e[m],v=t[m];if(y===v){d[m]=y,(r?p<a:r9.call(e,m))&&f++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){d[m]=v;continue}const w=jj(y,v,n+1);d[m]=w,w===y&&f++}return a===u&&f===a?e:d}function kf(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 xE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function PS(e){if(!wE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!wE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function wE(e){return Object.prototype.toString.call(e)==="[object Object]"}function i9(e){return new Promise(t=>{ol.setTimeout(t,e)})}function RS(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?jj(e,t):t}function a9(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function s9(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Nj=Symbol();function XD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Nj?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function kj(e,t){return typeof e=="function"?e(...t):!!e}function o9(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 l9=class extends Bl{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Cl&&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"}},Cj=new l9;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 c9=t9;function u9(){let e=[],t=0,n=u=>{u()},r=u=>{u()},i=c9;const a=u=>{t?e.push(u):i(()=>{n(u)})},o=()=>{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||o()}return d},batchCalls:u=>(...d)=>{a(()=>{u(...d)})},schedule:a,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var mn=u9(),d9=class extends Bl{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Cl&&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}},og=new d9;function f9(e){return Math.min(1e3*2**e,3e4)}function JD(e){return(e??"online")==="online"?og.isOnline():!0}var DS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function eI(e){let t=!1,n=0,r;const i=MS(),a=()=>i.status!=="pending",o=S=>{if(!a()){const j=new DS(S);y(j),e.onCancel?.(j)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Cj.isFocused()&&(e.networkMode==="always"||og.isOnline())&&e.canRun(),p=()=>JD(e.networkMode)&&e.canRun(),m=S=>{a()||(r?.(),i.resolve(S))},y=S=>{a()||(r?.(),i.reject(S))},v=()=>new Promise(S=>{r=j=>{(a()||f())&&S(j)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),w=()=>{if(a())return;let S;const j=n===0?e.initialPromise:void 0;try{S=j??e.fn()}catch(k){S=Promise.reject(k)}Promise.resolve(S).then(m).catch(k=>{if(a())return;const A=e.retry??(Cl?0:3),_=e.retryDelay??f9,C=typeof _=="function"?_(n,k):_,P=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,k);if(t||!P){y(k);return}n++,e.onFail?.(n,k),i9(C).then(()=>f()?void 0:v()).then(()=>{t?y(k):w()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?w():v().then(w),i)}}var tI=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),TS(this.gcTime)&&(this.#t=ol.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Cl?1/0:300*1e3))}clearGcTimeout(){this.#t&&(ol.clearTimeout(this.#t),this.#t=void 0)}},h9=class extends tI{#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=jE(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=jE(this.options);t.data!==void 0&&(this.setState(SE(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=RS(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(nr).catch(nr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>vi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Nj||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ao(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:!QD(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=XD(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)},o=(()=>{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(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=eI({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:u=>{u instanceof DS&&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:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.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 DS){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,...nI(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...SE(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),mn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function nI(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:JD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function SE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jE(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 _j=class extends Bl{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),NE(this.#e,this.options)?this.#m():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return IS(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return IS(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,n=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof vi(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#e.setOptions(this.options),t._defaulted&&!kf(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&kE(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||vi(this.options.enabled,this.#e)!==vi(t.enabled,this.#e)||ao(this.options.staleTime,this.#e)!==ao(t.staleTime,this.#e))&&this.#g();const i=this.#y();r&&(this.#e!==n||vi(this.options.enabled,this.#e)!==vi(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 m9(this,n)&&(this.#i=n,this.#a=this.options,this.#r=this.#e.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),n=this.#t.getQueryCache().build(this.#t,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#m(e){this.#S();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(nr)),t}#g(){this.#x();const e=ao(this.options.staleTime,this.#e);if(Cl||this.#i.isStale||!TS(e))return;const n=QD(this.#i.dataUpdatedAt,e)+1;this.#c=ol.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,!(Cl||vi(this.options.enabled,this.#e)===!1||!TS(this.#l)||this.#l===0)&&(this.#u=ol.setInterval(()=>{(this.options.refetchIntervalInBackground||Cj.isFocused())&&this.#m()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(ol.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(ol.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,i=this.#i,a=this.#r,o=this.#a,d=e!==n?e.state:this.#n,{state:f}=e;let p={...f},m=!1,y;if(t._optimisticResults){const T=this.hasListeners(),M=!T&&NE(e,t),q=T&&kE(e,n,t,r);(M||q)&&(p={...p,...nI(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:S}=p;y=p.data;let j=!1;if(t.placeholderData!==void 0&&y===void 0&&S==="pending"){let T;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(T=i.data,j=!0):T=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,T!==void 0&&(S="success",y=RS(i?.data,T,t),m=!0)}if(t.select&&y!==void 0&&!j)if(i&&y===a?.data&&t.select===this.#p)y=this.#d;else try{this.#p=t.select,y=t.select(y),y=RS(i?.data,y,t),this.#d=y,this.#s=null}catch(T){this.#s=T}this.#s&&(v=this.#s,y=this.#d,w=Date.now(),S="error");const k=p.fetchStatus==="fetching",A=S==="pending",_=S==="error",C=A&&k,P=y!==void 0,O={status:S,fetchStatus:p.fetchStatus,isPending:A,isSuccess:S==="success",isError:_,isInitialLoading:C,isLoading:C,data:y,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:k,isRefetching:k&&!A,isLoadingError:_&&!P,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:_&&P,isStale:Aj(e,t),refetch:this.refetch,promise:this.#o,isEnabled:vi(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const T=O.data!==void 0,M=O.status==="error"&&!T,q=J=>{M?J.reject(O.error):T&&J.resolve(O.data)},$=()=>{const J=this.#o=O.promise=MS();q(J)},L=this.#o;switch(L.status){case"pending":e.queryHash===n.queryHash&&q(L);break;case"fulfilled":(M||O.data!==L.value)&&$();break;case"rejected":(!M||O.error!==L.reason)&&$();break}}return O}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),kf(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#h.size)return!0;const a=new Set(i??this.#h);return this.options.throwOnError&&a.add("error"),Object.keys(this.#i).some(o=>{const u=o;return this.#i[u]!==e[u]&&a.has(u)})};this.#j({listeners:n()})}#S(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#j(e){mn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function p9(e,t){return vi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function NE(e,t){return p9(e,t)||e.state.data!==void 0&&IS(e,t,t.refetchOnMount)}function IS(e,t,n){if(vi(t.enabled,e)!==!1&&ao(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Aj(e,t)}return!1}function kE(e,t,n,r){return(e!==t||vi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Aj(e,n)}function Aj(e,t){return vi(t.enabled,e)!==!1&&e.isStaleByTime(ao(t.staleTime,e))}function m9(e,t){return!kf(e.getCurrentResult(),t)}function CE(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},d=0;const f=async()=>{let p=!1;const m=w=>{o9(w,()=>t.signal,()=>p=!0)},y=XD(t.options,t.fetchOptions),v=async(w,S,j)=>{if(p)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const A=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:S,direction:j?"backward":"forward",meta:t.options.meta};return m(E),E})(),_=await y(A),{maxPages:C}=t.options,P=j?s9:a9;return{pages:P(w.pages,_,C),pageParams:P(w.pageParams,S,C)}};if(i&&a.length){const w=i==="backward",S=w?g9:_E,j={pages:a,pageParams:o},k=S(r,j);u=await v(j,k,w)}else{const w=e??a.length;do{const S=d===0?o[0]??r.initialPageParam:_E(r,u);if(d>0&&S==null)break;u=await v(u,S),d++}while(d<w)}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 _E(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 g9(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var y9=class extends tI{#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||rI(),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=eI({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#r({type:"failed",failureCount:a,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:i})}const a=await this.#i.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),mn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function rI(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var iI=class extends Bl{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 y9({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=Jp(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=Jp(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=Jp(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=Jp(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){mn.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=>bE(t,n))}findAll(e={}){return this.getAll().filter(t=>bE(e,t))}notify(e){mn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return mn.batch(()=>Promise.all(e.map(t=>t.continue().catch(nr))))}};function Jp(e){return e.options.scope?.id}var v9=class extends Bl{#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),kf(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&_l(n.mutationKey)!==_l(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??rI();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){mn.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 AE(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function b9(e,t,n){const r=e.slice(0);return r[t]=n,r}var x9=class extends Bl{#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,mn.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const i=r.map(p=>p.observer),a=i.map(p=>p.getCurrentResult()),o=n.length!==i.length,u=i.some((p,m)=>p!==n[m]),d=o||u,f=d?!0:a.some((p,m)=>{const y=this.#e[m];return!y||!kf(p,y)});!d&&!f||(d&&(this.#d=r,this.#r=i),this.#e=a,this.hasListeners()&&(d&&(AE(n,i).forEach(p=>{p.destroy()}),AE(i,n).forEach(p=>{p.subscribe(m=>{this.#l(p,m)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,t){const n=this.#u(e),r=n.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=n.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#c(a??r,t,i),()=>this.#f(r,n)]}#f(e,t){return t.map((n,r)=>{const i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,a=>{t.forEach(o=>{o.observer.trackProp(a)})})})}#c(e,t,n){if(t){const r=this.#p,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((a,o)=>a!==r[o]));return(!this.#a||this.#e!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#e,n!==void 0&&(this.#p=n),this.#a=jj(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#r.forEach(r=>{const i=r.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(r):t.set(i,[r])});const n=[];return e.forEach(r=>{const i=this.#t.defaultQueryOptions(r),o=t.get(i.queryHash)?.shift()??new _j(this.#t,i);n.push({defaultedQueryOptions:i,observer:o})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=b9(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&&mn.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},w9=class extends Bl{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??Sj(r,t);let a=this.get(i);return a||(a=new h9({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(){mn.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=>vE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>vE(e,n)):t}notify(e){mn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){mn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){mn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},S9=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new w9,this.#e=e.mutationCache||new iI,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Cj.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=og.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(ao(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=this.#t.get(r.queryHash)?.state.data,o=n9(t,a);if(o!==void 0)return this.#t.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return mn.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;mn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return mn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=mn.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(nr).catch(nr)}invalidateQueries(e,t={}){return mn.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=mn.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(nr)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(nr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(ao(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(nr).catch(nr)}fetchInfiniteQuery(e){return e.behavior=CE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(nr).catch(nr)}ensureInfiniteQueryData(e){return e.behavior=CE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return og.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(_l(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{Nf(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(_l(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Nf(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=Sj(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===Nj&&(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()}},aI=b.createContext(void 0),vo=e=>{const t=b.useContext(aI);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},j9=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(aI.Provider,{value:e,children:t})),sI=b.createContext(!1),oI=()=>b.useContext(sI);sI.Provider;function N9(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var k9=b.createContext(N9()),lI=()=>b.useContext(k9),cI=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?kj(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},uI=e=>{b.useEffect(()=>{e.clearReset()},[e])},dI=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||kj(n,[e.error,r])),fI=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))}},C9=(e,t)=>e.isLoading&&e.isFetching&&!t,LS=(e,t)=>e?.suspense&&t.isPending,$S=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function _9({queries:e,...t},n){const r=vo(),i=oI(),a=lI(),o=b.useMemo(()=>e.map(S=>{const j=r.defaultQueryOptions(S);return j._optimisticResults=i?"isRestoring":"optimistic",j}),[e,r,i]);o.forEach(S=>{fI(S);const j=r.getQueryCache().get(S.queryHash);cI(S,a,j)}),uI(a);const[u]=b.useState(()=>new x9(r,o,t)),[d,f,p]=u.getOptimisticResult(o,t.combine),m=!i&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(S=>m?u.subscribe(mn.batchCalls(S)):nr,[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setQueries(o,t)},[o,t,u]);const v=d.some((S,j)=>LS(o[j],S))?d.flatMap((S,j)=>{const k=o[j];if(k&&LS(k,S)){const A=new _j(r,k);return $S(k,A,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const w=d.find((S,j)=>{const k=o[j];return k&&dI({result:S,errorResetBoundary:a,throwOnError:k.throwOnError,query:r.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(w?.error)throw w.error;return f(p())}function A9(e,t,n){const r=oI(),i=lI(),a=vo(),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const u=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",fI(o),cI(o,i,u),uI(i);const d=!a.getQueryCache().get(o.queryHash),[f]=b.useState(()=>new t(a,o)),p=f.getOptimisticResult(o),m=!r&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(y=>{const v=m?f.subscribe(mn.batchCalls(y)):nr;return f.updateResult(),v},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),b.useEffect(()=>{f.setOptions(o)},[o,f]),LS(o,p))throw $S(o,f,i);if(dI({result:p,errorResetBoundary:i,throwOnError:o.throwOnError,query:u,suspense:o.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!Cl&&C9(p,r)&&(d?$S(o,f,i):u?.promise)?.catch(nr).finally(()=>{f.updateResult()}),o.notifyOnChangeProps?p:f.trackResult(p)}function ns(e,t){return A9(e,_j)}function nh(e,t){const n=vo(),[r]=b.useState(()=>new v9(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const i=b.useSyncExternalStore(b.useCallback(o=>r.subscribe(mn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=b.useCallback((o,u)=>{r.mutate(o,u).catch(nr)},[r]);if(i.error&&kj(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var em=typeof window<"u"?b.useLayoutEffect:b.useEffect;function hx(e){const t=b.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function O9(e,t,n={},r={}){b.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 E9(e){const t=b.useRef(null);return b.useImperativeHandle(e,()=>t.current,[]),t}var z9=!1;function Cf(e){return e[e.length-1]}function T9(e){return typeof e=="function"}function Xs(e,t){return T9(e)?e(t):e}var P9=Object.prototype.hasOwnProperty,OE=Object.prototype.propertyIsEnumerable,R9=()=>Object.create(null),Yo=(e,t)=>ll(e,t,R9);function ll(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=TE(e)&&TE(i);if(!a&&!(lg(e)&&lg(i)))return i;const o=a?e:EE(e);if(!o)return i;const u=a?i:EE(i);if(!u)return i;const d=o.length,f=u.length,p=a?new Array(f):n();let m=0;for(let y=0;y<f;y++){const v=a?y:u[y],w=e[v],S=i[v];if(w===S){p[v]=w,(a?y<d:P9.call(e,v))&&m++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){p[v]=S;continue}const j=ll(w,S,n,r+1);p[v]=j,j===w&&m++}return d===f&&m===d?e:p}function EE(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!OE.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(!OE.call(e,i))return!1;r.push(i)}return r}function lg(e){if(!zE(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!zE(n)||!n.hasOwnProperty("isPrototypeOf"))}function zE(e){return Object.prototype.toString.call(e)==="[object Object]"}function TE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function vl(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(!vl(e[r],t[r],n))return!1;return!0}if(lg(e)&&lg(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const o in t)if((!r||t[o]!==void 0)&&!vl(e[o],t[o],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const o in e)e[o]!==void 0&&i++;let a=0;for(const o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!vl(e[o],t[o],n)))return!1;return i===a}return!1}function mu(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 _f(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function M9(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function PE(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 M9(t)}var D9=["http:","https:","mailto:","tel:"];function cg(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Ud(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+=PE(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+PE(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function I9(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ug(e){const t=new Map;let n,r;const i=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,n=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const o=t.get(a);if(o)return i(o),o.value},set(a,o){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const u=t.get(a);if(u)u.value=o,i(u);else{const d={key:a,value:o,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,r=void 0}}}var L9="Invariant failed";function ho(e,t){if(!e)throw new Error(L9)}var cl=4,hI=5;function $9(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 Oj(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 o=$9(a);if(o){const[u,d]=o,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 Py(e,t,n,r,i,a,o){o?.(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=Oj(d,u,t);let w;const S=u,j=v[5];switch(u=j+1,a++,v[0]){case 0:{const k=d.substring(v[2],v[3]);if(p){const A=i.static?.get(k);if(A)w=A;else{i.static??=new Map;const _=ul(n.fullPath??n.from);_.parent=i,_.depth=a,w=_,i.static.set(k,_)}}else{const A=k.toLowerCase(),_=i.staticInsensitive?.get(A);if(_)w=_;else{i.staticInsensitive??=new Map;const C=ul(n.fullPath??n.from);C.parent=i,C.depth=a,w=C,i.staticInsensitive.set(A,C)}}break}case 1:{const k=d.substring(S,v[1]),A=d.substring(v[4],j),_=p&&!!(k||A),C=k?_?k:k.toLowerCase():void 0,P=A?_?A:A.toLowerCase():void 0,E=!m&&i.dynamic?.find(O=>!O.skipOnParamError&&O.caseSensitive===_&&O.prefix===C&&O.suffix===P);if(E)w=E;else{const O=mx(1,n.fullPath??n.from,_,C,P);w=O,O.depth=a,O.parent=i,i.dynamic??=[],i.dynamic.push(O)}break}case 3:{const k=d.substring(S,v[1]),A=d.substring(v[4],j),_=p&&!!(k||A),C=k?_?k:k.toLowerCase():void 0,P=A?_?A:A.toLowerCase():void 0,E=!m&&i.optional?.find(O=>!O.skipOnParamError&&O.caseSensitive===_&&O.prefix===C&&O.suffix===P);if(E)w=E;else{const O=mx(3,n.fullPath??n.from,_,C,P);w=O,O.parent=i,O.depth=a,i.optional??=[],i.optional.push(O)}break}case 2:{const k=d.substring(S,v[1]),A=d.substring(v[4],j),_=p&&!!(k||A),C=k?_?k:k.toLowerCase():void 0,P=A?_?A:A.toLowerCase():void 0,E=mx(2,n.fullPath??n.from,_,C,P);w=E,E.parent=i,E.depth=a,i.wildcard??=[],i.wildcard.push(E)}}i=w}if(m&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const v=ul(n.fullPath??n.from);v.kind=hI,v.parent=i,a++,v.depth=a,i.pathless??=[],i.pathless.push(v),i=v}const y=(n.path||!n.children)&&!n.isRoot;if(y&&d.endsWith("/")){const v=ul(n.fullPath??n.from);v.kind=cl,v.parent=i,a++,v.depth=a,i.index=v,i=v}i.parse=n.options?.params?.parse??null,i.skipOnParamError=m,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,y&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)Py(e,t,d,u,i,a,o)}function px(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 Vs(e){if(e.pathless)for(const t of e.pathless)Vs(t);if(e.static)for(const t of e.static.values())Vs(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Vs(t);if(e.dynamic?.length){e.dynamic.sort(px);for(const t of e.dynamic)Vs(t)}if(e.optional?.length){e.optional.sort(px);for(const t of e.optional)Vs(t)}if(e.wildcard?.length){e.wildcard.sort(px);for(const t of e.wildcard)Vs(t)}}function ul(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 mx(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 B9(e,t){const n=ul("/"),r=new Uint16Array(6);for(const i of e)Py(!1,r,i,1,n,0);Vs(n),t.masksTree=n,t.flatCache=ug(1e3)}function U9(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Ej(e,t.masksTree);return t.flatCache.set(e,r),r}function F9(e,t,n,r,i){e||="/",r||="/";const a=t?`case\0${e}`:e;let o=i.singleCache.get(a);return o||(o=ul("/"),Py(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Ej(r,o,n)}function q9(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=Ej(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)a=null;else throw o}return a&&(a.branch=G9(a.route)),t.matchCache.set(r,a),a}function H9(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function K9(e,t=!1,n){const r=ul(e.fullPath),i=new Uint16Array(6),a={},o={};let u=0;return Py(t,i,e,1,r,0,d=>{if(n?.(d,u),ho(!(d.id in a),`Duplicate routes found with id: ${String(d.id)}`),a[d.id]=d,u!==0&&d.path){const f=H9(d.fullPath);(!o[f]||d.fullPath.endsWith("/"))&&(o[f]=d)}u++}),Vs(r),{processedTree:{segmentTree:r,singleCache:ug(1e3),matchCache:ug(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Ej(e,t,n=!1){const r=e.split("/"),i=Z9(e,r,t,n);if(!i)return null;const[a]=pI(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function pI(e,t,n){const r=V9(n.node);let i=null;const a=Object.create(null);let o=n.extract?.part??0,u=n.extract?.node??0,d=n.extract?.path??0,f=n.extract?.segment??0;for(;u<r.length;o++,u++,d++,f++){const p=r[u];if(p.kind===cl)break;if(p.kind===hI){f--,o--,d--;continue}const m=t[o],y=d;if(m&&(d+=m.length),p.kind===1){i??=n.node.fullPath.split("/");const v=i[f],w=p.prefix?.length??0;if(v.charCodeAt(w)===123){const S=p.suffix?.length??0,j=v.substring(w+2,v.length-S-1),k=m.substring(w,m.length-S);a[j]=decodeURIComponent(k)}else{const S=v.substring(1);a[S]=decodeURIComponent(m)}}else if(p.kind===3){if(n.skipped&1<<u){o--,d=y-1;continue}i??=n.node.fullPath.split("/");const v=i[f],w=p.prefix?.length??0,S=p.suffix?.length??0,j=v.substring(w+3,v.length-S-1),k=p.suffix||p.prefix?m.substring(w,m.length-S):m;k&&(a[j]=decodeURIComponent(k))}else if(p.kind===2){const v=p,w=e.substring(y+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),S=decodeURIComponent(w);a["*"]=S,a._splat=S;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:u,path:d,segment:f}]}function G9(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function V9(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Z9(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Cf(t),a=i&&e!=="/",o=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:y,index:v,skipped:w,depth:S,statics:j,dynamics:k,optionals:A}=m;let{extract:_,rawParams:C,parsedParams:P}=m;if(y.skipOnParamError){if(!gx(e,t,m))continue;C=m.rawParams,_=m.extract,P=m.parsedParams}r&&y.route&&y.kind!==cl&&Fd(f,m)&&(f=m);const E=v===o;if(E&&(y.route&&!a&&Fd(p,m)&&(p=m),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const O=E?void 0:t[v];let T;if(E&&y.index){const M={node:y.index,index:v,skipped:w,depth:S+1,statics:j,dynamics:k,optionals:A,extract:_,rawParams:C,parsedParams:P};let q=!0;if(y.index.skipOnParamError&&(gx(e,t,M)||(q=!1)),q){if(j===o&&!k&&!A&&!w)return M;Fd(p,M)&&(p=M)}}if(y.wildcard&&Fd(d,m))for(const M of y.wildcard){const{prefix:q,suffix:$}=M;if(q&&(E||!(M.caseSensitive?O:T??=O.toLowerCase()).startsWith(q)))continue;if($){if(E)continue;const J=t.slice(v).join("/").slice(-$.length);if((M.caseSensitive?J:J.toLowerCase())!==$)continue}const L={node:M,index:o,skipped:w,depth:S,statics:j,dynamics:k,optionals:A,extract:_,rawParams:C,parsedParams:P};if(!(M.skipOnParamError&&!gx(e,t,L))){d=L;break}}if(y.optional){const M=w|1<<S,q=S+1;for(let $=y.optional.length-1;$>=0;$--){const L=y.optional[$];u.push({node:L,index:v,skipped:M,depth:q,statics:j,dynamics:k,optionals:A,extract:_,rawParams:C,parsedParams:P})}if(!E)for(let $=y.optional.length-1;$>=0;$--){const L=y.optional[$],{prefix:J,suffix:ae}=L;if(J||ae){const Z=L.caseSensitive?O:T??=O.toLowerCase();if(J&&!Z.startsWith(J)||ae&&!Z.endsWith(ae))continue}u.push({node:L,index:v+1,skipped:w,depth:q,statics:j,dynamics:k,optionals:A+1,extract:_,rawParams:C,parsedParams:P})}}if(!E&&y.dynamic&&O)for(let M=y.dynamic.length-1;M>=0;M--){const q=y.dynamic[M],{prefix:$,suffix:L}=q;if($||L){const J=q.caseSensitive?O:T??=O.toLowerCase();if($&&!J.startsWith($)||L&&!J.endsWith(L))continue}u.push({node:q,index:v+1,skipped:w,depth:S+1,statics:j,dynamics:k+1,optionals:A,extract:_,rawParams:C,parsedParams:P})}if(!E&&y.staticInsensitive){const M=y.staticInsensitive.get(T??=O.toLowerCase());M&&u.push({node:M,index:v+1,skipped:w,depth:S+1,statics:j+1,dynamics:k,optionals:A,extract:_,rawParams:C,parsedParams:P})}if(!E&&y.static){const M=y.static.get(O);M&&u.push({node:M,index:v+1,skipped:w,depth:S+1,statics:j+1,dynamics:k,optionals:A,extract:_,rawParams:C,parsedParams:P})}if(y.pathless){const M=S+1;for(let q=y.pathless.length-1;q>=0;q--){const $=y.pathless[q];u.push({node:$,index:v,skipped:w,depth:M,statics:j,dynamics:k,optionals:A,extract:_,rawParams:C,parsedParams:P})}}}if(p&&d)return Fd(d,p)?p:d;if(p)return p;if(d)return d;if(r&&f){let m=f.index;for(let v=0;v<f.index;v++)m+=t[v].length;const y=m===e.length?"/":e.slice(m);return f.rawParams??=Object.create(null),f.rawParams["**"]=decodeURIComponent(y),f}return null}function gx(e,t,n){try{const[r,i]=pI(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 Fd(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===cl)>(e.node.kind===cl)||t.node.kind===cl==(e.node.kind===cl)&&t.depth>e.depth))):!0}function qm(e){return zj(e.filter(t=>t!==void 0).join("/"))}function zj(e){return e.replace(/\/{2,}/g,"/")}function mI(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function so(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function gI(e){return so(mI(e))}function dg(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Y9(e,t,n){return dg(e,n)===dg(t,n)}function W9({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),a=!i&&t===".";let o;if(r){o=i?t:a?e:e+"\0"+t;const m=r.get(o);if(m)return m}let u;if(a)u=e.split("/");else if(i)u=t.split("/");else{for(u=e.split("/");u.length>1&&Cf(u)==="";)u.pop();const m=t.split("/");for(let y=0,v=m.length;y<v;y++){const w=m[y];w===""?y?y===v-1&&u.push(w):u=[w]:w===".."?u.pop():w==="."||u.push(w)}}u.length>1&&(Cf(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));let d,f="";for(let m=0;m<u.length;m++){m>0&&(f+="/");const y=u[m];if(!y)continue;d=Oj(y,0,d);const v=d[0];if(v===0){f+=y;continue}const w=d[5],S=y.substring(0,d[1]),j=y.substring(d[4],w),k=y.substring(d[2],d[3]);v===1?f+=S||j?`${S}{$${k}}${j}`:`$${k}`:v===2?f+=S||j?`${S}{$}${j}`:"$":f+=`${S}{-$${k}}${j}`}f=zj(f);const p=f||"/";return o&&r&&r.set(o,p),p}function Q9(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 yx(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=>ME(i,n)).join("/"):ME(r,n)}function RE({path:e,params:t,decoder:n,...r}){let i=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:i};const o=e.length;let u=0,d,f="";for(;u<o;){const p=u;d=Oj(e,p,d);const m=d[5];if(u=m+1,p===m)continue;const y=d[0];if(y===0){f+="/"+e.substring(p,m);continue}if(y===2){const v=t._splat;a._splat=v,a["*"]=v;const w=e.substring(p,d[1]),S=e.substring(d[4],m);if(!v){i=!0,(w||S)&&(f+="/"+w+S);continue}const j=yx("_splat",t,n);f+="/"+w+j+S;continue}if(y===1){const v=e.substring(d[2],d[3]);!i&&!(v in t)&&(i=!0),a[v]=t[v];const w=e.substring(p,d[1]),S=e.substring(d[4],m),j=yx(v,t,n)??"undefined";f+="/"+w+j+S;continue}if(y===3){const v=e.substring(d[2],d[3]),w=t[v];if(w==null)continue;a[v]=w;const S=e.substring(p,d[1]),j=e.substring(d[4],m),k=yx(v,t,n)??"";f+="/"+S+k+j;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:i}}function ME(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function hr(e){return!!e?.isNotFound}function X9(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var BS="tsr-scroll-restoration-v1_3",J9=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function eH(){const e=X9();if(!e)return null;const t=e.getItem(BS);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=Xs(r,n)||n;try{e.setItem(BS,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var tm=eH(),tH=e=>e.state.__TSR_key||e.href;function nH(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 fg=!1;function rH({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const u=t||window.history.state?.__TSR_key,d=o[u];fg=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const m in d){const y=d[m];if(m==="window")window.scrollTo({top:y.scrollY,left:y.scrollX,behavior:n});else if(m){const v=document.querySelector(m);v&&(v.scrollLeft=y.scrollX,v.scrollTop=y.scrollY)}}break e}const f=(a??window.location).hash.split("#",2)[1];if(f){const m=window.history.state?.__hashScrollIntoViewOptions??!0;if(m){const y=document.getElementById(f);y&&y.scrollIntoView(m)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),i)for(const m of i){if(m==="window")continue;const y=typeof m=="function"?m():document.querySelector(m);y&&y.scrollTo(p)}}fg=!1}function iH(e,t){if(!tm||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!tm))return;e.isScrollRestorationSetup=!0,fg=!1;const n=e.options.getScrollRestorationKey||tH;window.history.scrollRestoration="manual";const r=i=>{if(fg||!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=nH(i.target)}const o=n(e.state.location);tm.set(u=>{const d=u[o]||={},f=d[a]||={};if(a==="window")f.scrollX=window.scrollX||0,f.scrollY=window.scrollY||0;else if(a){const p=document.querySelector(a);p&&(f.scrollX=p.scrollLeft||0,f.scrollY=p.scrollTop||0)}return u})};typeof document<"u"&&document.addEventListener("scroll",J9(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})||(rH({storageKey:BS,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&tm.set(o=>(o[a]||={},o)))})}function aH(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 sH(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 vx(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function oH(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]=vx(i):Array.isArray(a)?a.push(vx(i)):n[r]=[a,vx(i)]}return n}var lH=uH(JSON.parse),cH=dH(JSON.stringify,JSON.parse);function uH(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=oH(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function dH(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=sH(i,r);return a?`?${a}`:""}}var bl="__root__";function Tj(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function _r(e){return e instanceof Response&&!!e.options}function fH(e){return{input:({url:t})=>{for(const n of e)t=US(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=yI(e[n],t);return t}}}function hH(e){const t=gI(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:o})=>{const u=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return u===i?o.pathname="/":u.startsWith(a)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=qm(["/",t,o.pathname]),o)}}function US(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 yI(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 Jt=(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))(Jt||{});function vI({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:u};function r(f,p,m){const y=p.depsTail;if(y!==void 0&&y.dep===f)return;const v=y!==void 0?y.nextDep:p.deps;if(v!==void 0&&v.dep===f){v.version=m,p.depsTail=v;return}const w=f.subsTail;if(w!==void 0&&w.version===m&&w.sub===p)return;const S=p.depsTail=f.subsTail={version:m,dep:f,sub:p,prevDep:y,nextDep:v,prevSub:w,nextSub:void 0};v!==void 0&&(v.prevDep=S),y!==void 0?y.nextDep=S:p.deps=S,w!==void 0?w.nextSub=S:f.subs=S}function i(f,p=f.sub){const m=f.dep,y=f.prevDep,v=f.nextDep,w=f.nextSub,S=f.prevSub;return v!==void 0?v.prevDep=y:p.depsTail=y,y!==void 0?y.nextDep=v:p.deps=v,w!==void 0?w.prevSub=S:m.subsTail=S,S!==void 0?S.nextSub=w:(m.subs=w)===void 0&&n(m),v}function a(f){let p=f.nextSub,m;e:do{const y=f.sub;let v=y.flags;if(v&60?v&12?v&4?!(v&48)&&d(f,y)?(y.flags=v|40,v&=1):v=0:y.flags=v&-9|32:v=0:y.flags=v|32,v&2&&t(y),v&1){const w=y.subs;if(w!==void 0){const S=(f=w).nextSub;S!==void 0&&(m={value:p,prev:m},p=S);continue}}if((f=p)!==void 0){p=f.nextSub;continue}for(;m!==void 0;)if(f=m.value,m=m.prev,f!==void 0){p=f.nextSub;continue e}break}while(!0)}function o(f,p){let m,y=0,v=!1;e:do{const w=f.dep,S=w.flags;if(p.flags&16)v=!0;else if((S&17)===17){if(e(w)){const j=w.subs;j.nextSub!==void 0&&u(j),v=!0}}else if((S&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(m={value:f,prev:m}),f=w.deps,p=w,++y;continue}if(!v){const j=f.nextDep;if(j!==void 0){f=j;continue}}for(;y--;){const j=p.subs,k=j.nextSub!==void 0;if(k?(f=m.value,m=m.prev):f=j,v){if(e(p)){k&&u(j),p=f.sub;continue}v=!1}else p.flags&=-33;p=f.sub;const A=f.nextDep;if(A!==void 0){f=A;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 Pj=0,Wo=0,mf=0;const Qa=[],{link:zke,unlink:bI,propagate:Tke,checkDirty:pH,shallowPropagate:Pke}=vI({update(e){return e.depsTail!==void 0?vH(e):bH(e)},notify(e){let t=mf,n=t;do if(Qa[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(mf=t;n<--t;){const r=Qa[n];Qa[n++]=Qa[t],Qa[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Ry(e)):SH.call(e)}});function mH(){return Pj}function gH(){++Pj}function yH(){--Pj||wH()}function vH(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Ry(e)}}function bH(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function xH(e){const t=e.flags;if(t&16||t&32&&pH(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Ry(e)}}else e.flags=2}function wH(){try{for(;Wo<mf;){const e=Qa[Wo];Qa[Wo++]=void 0,xH(e)}}finally{for(;Wo<mf;){const e=Qa[Wo];Qa[Wo++]=void 0,e.flags|=10}Wo=0,mf=0}}function SH(){this.depsTail=void 0,this.flags=0,Ry(this);const e=this.subs;e!==void 0&&bI(e)}function Ry(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=bI(n,e)}function Rj(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 Hm=0;const{link:DE,unlink:jH,propagate:NH,checkDirty:xI,shallowPropagate:IE}=vI({update(e){return e._update()},notify(e){FS[qS++]=e,e.flags&=~Jt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Jt.Mutable|Jt.Dirty,hg(e))}});let nm=0,qS=0,ca;function hg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=jH(n,e)}function wI(){if(!(mH()>0)){for(;nm<qS;){const e=FS[nm];FS[nm++]=void 0,e.notify()}nm=0,qS=0}}function SI(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?Jt.None:Jt.Mutable,get(){return ca!==void 0&&DE(i,ca,Hm),i._snapshot},subscribe(a){const o=Rj(a),u={current:!1},d=kH(()=>{i.get(),u.current?o.next?.(i._snapshot):u.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const o=ca,u=Object.is;if(n)ca=i,++Hm,i.depsTail=void 0;else if(a===void 0)return!1;n&&(i.flags=Jt.Mutable|Jt.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{ca=o,n&&(i.flags&=~Jt.RecursedCheck),hg(i)}}};return n?(i.flags=Jt.Mutable|Jt.Dirty,i.get=function(){const a=i.flags;if(a&Jt.Dirty||a&Jt.Pending&&xI(i.deps,i)){if(i._update()){const o=i.subs;o!==void 0&&IE(o)}}else a&Jt.Pending&&(i.flags=a&~Jt.Pending);return ca!==void 0&&DE(i,ca,Hm),i._snapshot}):i.set=function(a){if(i._update(a)){const o=i.subs;o!==void 0&&(NH(o),IE(o),wI())}},i}function kH(e){const t=()=>{const r=ca;ca=n,++Hm,n.depsTail=void 0,n.flags=Jt.Watching|Jt.RecursedCheck;try{return e()}finally{ca=r,n.flags&=~Jt.RecursedCheck,hg(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Jt.Watching|Jt.RecursedCheck,notify(){const r=this.flags;r&Jt.Dirty||r&Jt.Pending&&xI(this.deps,this)?t():this.flags=Jt.Watching},stop(){this.flags=Jt.None,this.depsTail=void 0,hg(this)}};return t(),n}class CH{constructor(t){this.atom=SI(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Rj(t))}}class _H{constructor(t){this.atom=SI(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Rj(t))}}function AH(e){return typeof e=="function"?new _H(e):new CH(e)}function OH(e){try{gH(),e()}finally{yH(),wI()}}function gf(e){let t;return OH(()=>{t=e()}),t}var HS=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},My=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),xl=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const o=e.matches[a];if(!o)continue;const u=e.router.getMatch(o.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},LE=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(o=>o.routeId===e.router.routeTree.id),i=r>=0?r:0;let a=n?e.matches.findIndex(o=>o.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let o=a;o>=0;o--){const u=e.matches[o];if(e.router.looseRoutesById[u.routeId].options.notFoundComponent)return o}return n?a:i},Js=(e,t,n)=>{if(!(!_r(n)&&!hr(n)))throw _r(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:_r(n)?"redirected":r.status==="pending"?"success":r.status,context:xl(e,t.index),isFetching:!1,error:n})),hr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),_r(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},jI=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},$E=(e,t,n)=>{const r=xl(e,n);e.updateMatch(t,i=>({...i,context:r}))},qd=(e,t,n,r)=>{const{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Js(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(u){n=u,Js(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&&!_r(n)&&!hr(n)&&(e.serialError??=n)},NI=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!My(e,t)&&(n.options.loader||n.options.beforeLoad||CI(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{HS(e)},i);r._nonReactive.pendingTimeout=a}},EH=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;NI(e,t,n,r);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&Js(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},zH=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=mu(()=>{a?.resolve(),a=void 0});const{paramsError:o,searchError:u}=i;o&&qd(e,n,o,"PARSE_PARAMS"),u&&qd(e,n,u,"VALIDATE_SEARCH"),NI(e,t,r,i);const d=new AbortController;let f=!1;const p=()=>{f||(f=!0,e.updateMatch(t,C=>({...C,isFetching:"beforeLoad",fetchCount:C.fetchCount+1,abortController:d})))},m=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,C=>({...C,isFetching:!1}))};if(!r.options.beforeLoad){gf(()=>{p(),m()});return}i._nonReactive.beforeLoadPromise=mu();const y={...xl(e,n,!1),...i.__routeContext},{search:v,params:w,cause:S}=i,j=My(e,t),k={search:v,abortController:d,params:w,preload:j,context:y,location:e.location,navigate:C=>e.router.navigate({...C,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":S,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},A=C=>{if(C===void 0){gf(()=>{p(),m()});return}(_r(C)||hr(C))&&(p(),qd(e,n,C,"BEFORE_LOAD")),gf(()=>{p(),e.updateMatch(t,P=>({...P,__beforeLoadContext:C})),m()})};let _;try{if(_=r.options.beforeLoad(k),_f(_))return p(),_.catch(C=>{qd(e,n,C,"BEFORE_LOAD")}).then(A)}catch(C){p(),qd(e,n,C,"BEFORE_LOAD")}A(_)},TH=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>u(),o=()=>zH(e,n,t,i),u=()=>{if(jI(e,n))return;const d=EH(e,n,i);return _f(d)?d.then(o):o()};return a()},PH=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([a,o,u])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:u,scripts:o,styles:a?.styles}))},kI=(e,t,n,r,i)=>{const a=t[r-1],{params:o,loaderDeps:u,abortController:d,cause:f}=e.router.getMatch(n),p=xl(e,r),m=My(e,n);return{params:o,deps:u,preload:!!m,parentMatchPromise:a,abortController:d,context:p,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:m?"preload":f,route:i,...e.router.options.additionalContext}},BE=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(z9??e.router.isServer)||a.ssr===!0)&&Af(i);const o=i.options.loader,u=typeof o=="function"?o:o?.handler,d=u?.(kI(e,t,n,r,i)),f=!!u&&_f(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;Js(e,e.router.getMatch(n),m),m!==void 0&&e.updateMatch(n,y=>({...y,loaderData:m}))}i._lazyPromise&&await i._lazyPromise;const p=a._nonReactive.minPendingPromise;p&&await p,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,m=>({...m,error:void 0,context:xl(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(o){let u=o;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:xl(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,hr(o)&&await i.options.notFoundComponent?.preload?.(),Js(e,e.router.getMatch(n),o);try{i.options.onError?.(o)}catch(f){u=f,Js(e,e.router.getMatch(n),f)}!_r(u)&&!hr(u)&&await Af(i,["errorComponent"]),e.updateMatch(n,f=>({...f,error:u,context:xl(e,r),status:"error",isFetching:!1}))}}catch(a){const o=e.router.getMatch(n);o&&(o._nonReactive.loaderPromise=void 0),Js(e,o,a)}},RH=async(e,t,n)=>{async function r(v,w,S,j,k){const A=Date.now()-w.updatedAt,_=v?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,C=k.options.shouldReload,P=typeof C=="function"?C(kI(e,t,i,n,k)):C,{status:E,invalid:O}=j,T=A>_&&(!!e.forceStaleReload||j.cause==="enter"||S!==void 0&&S!==j.id);o=E==="success"&&(O||(P??T)),v&&k.options.preload===!1||(o&&!e.sync&&p?(u=!0,(async()=>{try{await BE(e,t,i,n,k);const M=e.router.getMatch(i);M._nonReactive.loaderPromise?.resolve(),M._nonReactive.loadPromise?.resolve(),M._nonReactive.loaderPromise=void 0,M._nonReactive.loadPromise=void 0}catch(M){_r(M)&&await e.router.navigate(M.options)}})()):E!=="success"||o?await BE(e,t,i,n,k):$E(e,i,n))}const{id:i,routeId:a}=e.matches[n];let o=!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(jI(e,i)){if(!e.router.getMatch(i))return e.matches[n];$E(e,i,n)}else{const v=e.router.getMatch(i),w=e.router.state.matches[n]?.routeId===a?e.router.state.matches[n].id:e.router.state.matches.find(j=>j.routeId===a)?.id,S=My(e,i);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload&&p)return v;await v._nonReactive.loaderPromise;const j=e.router.getMatch(i),k=j._nonReactive.error||j.error;k&&Js(e,j,k),j.status==="pending"&&await r(S,v,w,j,d)}else{const j=S&&!e.router.state.matches.some(A=>A.id===i),k=e.router.getMatch(i);k._nonReactive.loaderPromise=mu(),j!==k.preload&&e.updateMatch(i,A=>({...A,preload:j})),await r(S,v,w,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 y=u?m.isFetching:!1;return y!==m.isFetching||m.invalid!==!1?(e.updateMatch(i,v=>({...v,isFetching:y,invalid:!1})),e.router.getMatch(i)):m};async function UE(e){const t=e,n=[];t.router.state.matches.some(y=>y._forcePending)&&HS(t);let r;for(let y=0;y<t.matches.length;y++){try{const v=TH(t,y);_f(v)&&await v}catch(v){if(_r(v))throw v;if(hr(v))r=v;else if(!t.preload)throw v;break}if(t.serialError)break}const i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?LE(t,r):void 0,o=r&&t.preload?0:a!==void 0?Math.min(a+1,i):i;let u,d;for(let y=0;y<o;y++)n.push(RH(t,n,y));try{await Promise.all(n)}catch{const y=await Promise.allSettled(n);for(const v of y){if(v.status!=="rejected")continue;const w=v.reason;if(_r(w))throw w;hr(w)?u??=w:d??=w}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 y=LE(t,f);ho(y!==void 0);const v=t.matches[y],w=t.router.looseRoutesById[v.routeId],S=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&S&&(w.options.notFoundComponent=S),f.routeId=v.routeId;const j=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,k=>({...k,...j?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),p=y,await Af(w,["notFoundComponent"])}else if(!t.preload){const y=t.matches[0];y.globalNotFound||t.router.getMatch(y.id)?.globalNotFound&&t.updateMatch(y.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const y=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Af(y,["errorComponent"])}for(let y=0;y<=p;y++){const{id:v,routeId:w}=t.matches[y],S=t.router.looseRoutesById[w];try{const j=PH(t,v,S);if(j){const k=await j;t.updateMatch(v,A=>({...A,...k}))}}catch(j){console.error(`Error executing head for route ${w}:`,j)}}const m=HS(t);if(_f(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function FE(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Af(e,t=Km){!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===Km?(()=>{if(e._componentsPromise===void 0){const r=FE(e,Km);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():FE(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function CI(e){for(const t of Km)if(e.options[t]?.preload)return!0;return!1}var Km=["component","errorComponent","pendingComponent","notFoundComponent"],oo="__TSR_index",qE="popstate",HE="beforeunload";function MH(e){let t=e.getLocation();const n=new Set,r=o=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:o}))},i=o=>{e.notifyOnIndexChange??!0?r(o):t=e.getLocation()},a=async({task:o,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){o();return}const f=e.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&f.length&&p)for(const m of f){const y=pg(d.path,d.state);if(await m.blockerFn({currentLocation:t,nextLocation:y,action:d.type})){e.onBlocked?.();return}}o()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,u,d)=>{const f=t.state[oo];u=KE(f+1,u),a({task:()=>{e.pushState(o,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:o,state:u})},replace:(o,u,d)=>{const f=t.state[oo];u=KE(f,u),a({task:()=>{e.replaceState(o,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:o,state:u})},go:(o,u)=>{a({task:()=>{e.go(o),i({type:"GO",index:o})},navigateOpts:u,type:"GO"})},back:o=>{a({task:()=>{e.back(o?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{a({task:()=>{e.forward(o?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[oo]!==0,createHref:o=>e.createHref(o),block:o=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,o]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==o))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function KE(e,t){t||(t={});const n=Mj();return{...t,key:n,__TSR_key:n,[oo]:e}}function DH(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const a=()=>i,o=T=>i=T,u=(T=>T),d=(()=>pg(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const T=Mj();t.history.replaceState({[oo]:0,key:T,__TSR_key:T},"")}let f=d(),p,m=!1,y=!1,v=!1,w=!1;const S=()=>f;let j,k;const A=()=>{j&&(O._ignoreSubscribers=!0,(j.isPush?t.history.pushState:t.history.replaceState)(j.state,"",j.href),O._ignoreSubscribers=!1,j=void 0,k=void 0,p=void 0)},_=(T,M,q)=>{const $=u(M);k||(p=f),f=pg(M,q),j={href:$,state:q,isPush:j?.isPush||T==="push"},k||(k=Promise.resolve().then(()=>A()))},C=T=>{f=d(),O.notify({type:T})},P=async()=>{if(y){y=!1;return}const T=d(),M=T.state[oo]-f.state[oo],q=M===1,$=M===-1,L=!q&&!$||m;m=!1;const J=L?"GO":$?"BACK":"FORWARD",ae=L?{type:"GO",index:M}:{type:$?"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:T,action:J})){y=!0,t.history.go(1),O.notify(ae);return}}}f=d(),O.notify(ae)},E=T=>{if(w){w=!1;return}let M=!1;const q=a();if(typeof document<"u"&&q.length)for(const $ of q){const L=$.enableBeforeUnload??!0;if(L===!0){M=!0;break}if(typeof L=="function"&&L()===!0){M=!0;break}}if(M)return T.preventDefault(),T.returnValue=""},O=MH({getLocation:S,getLength:()=>t.history.length,pushState:(T,M)=>_("push",T,M),replaceState:(T,M)=>_("replace",T,M),back:T=>(T&&(v=!0),w=!0,t.history.back()),forward:T=>{T&&(v=!0),w=!0,t.history.forward()},go:T=>{m=!0,t.history.go(T)},createHref:T=>u(T),flush:A,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(HE,E,{capture:!0}),t.removeEventListener(qE,P)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(HE,E,{capture:!0}),t.addEventListener(qE,P),t.history.pushState=function(...T){const M=n.apply(t.history,T);return O._ignoreSubscribers||C("PUSH"),M},t.history.replaceState=function(...T){const M=r.apply(t.history,T);return O._ignoreSubscribers||C("REPLACE"),M},O}function IH(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function pg(e,t){const n=IH(e),r=n.indexOf("#"),i=n.indexOf("?"),a=Mj();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||{[oo]:0,key:a,__TSR_key:a}}}function Mj(){return(Math.random()+1).toString(36).substring(7)}function wl(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 LH(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var $H=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=Q9(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=DH()),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=ug(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=AH(UH(this.latestLocation)),iH(this));let o=!1;const u=this.options.basepath??"/",d=this.options.rewrite;if(i||r!==u||a!==d){this.basepath=u;const f=[],p=gI(u);p&&p!=="/"&&f.push(hH({basepath:u})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:fH(f),this.history&&this.updateLatestLocation(),o=!0}o&&this.__store&&this.__store.setState(f=>({...f,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=K9(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&B9(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 j=this.options.parseSearch(d),k=this.options.stringifySearch(j);return{href:u+k+f,publicHref:p,pathname:Ud(u).path,external:!1,searchStr:k,search:Yo(n?.search,j),hash:Ud(f.slice(1)).path,state:ll(n?.state,m)}}const y=new URL(p,this.origin),v=US(this.rewrite,y),w=this.options.parseSearch(v.search),S=this.options.stringifySearch(w);return v.search=S,{href:v.href.replace(v.origin,""),publicHref:p,pathname:Ud(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:S,search:Yo(n?.search,w),hash:Ud(v.hash.slice(1)).path,state:ll(n?.state,m)}},i=r(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===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)=>W9({base:t,to:zj(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=>FH({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const n=this.getMatch(t);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(r=>r.status==="pending"),n=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...n]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=t=>{const n=(i={})=>{const a=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const u=i.unsafeRelative==="path"?a.pathname:i.from??o.fullPath,d=this.resolvePathWithBase(u,"."),f=o.search,p=Object.assign(Object.create(null),o.params),m=i.to?this.resolvePathWithBase(d,`${i.to}`):this.resolvePathWithBase(d,"."),y=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?p:Object.assign(p,Xs(i.params,p)),v=this.getMatchedRoutes(m);let w=v.matchedRoutes;if((!v.foundRoute||v.foundRoute.path!=="/"&&v.routeParams["**"])&&this.options.notFoundRoute&&(w=[...w,this.options.notFoundRoute]),Object.keys(y).length>0)for(const M of w){const q=M.options.params?.stringify??M.options.stringifyParams;if(q)try{Object.assign(y,q(y))}catch{}}const S=t.leaveParams?m:Ud(RE({path:m,params:y,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let j=f;if(t._includeValidateSearch&&this.options.search?.strict){const M={};w.forEach(q=>{if(q.options.validateSearch)try{Object.assign(M,Gm(q.options.validateSearch,{...M,...j}))}catch{}}),j=M}j=qH({search:j,dest:i,destRoutes:w,_includeValidateSearch:t._includeValidateSearch}),j=Yo(f,j);const k=this.options.stringifySearch(j),A=i.hash===!0?a.hash:i.hash?Xs(i.hash,a.hash):void 0,_=A?`#${A}`:"";let C=i.state===!0?a.state:i.state?Xs(i.state,a.state):{};C=ll(a.state,C);const P=`${S}${k}${_}`;let E,O,T=!1;if(this.rewrite){const M=new URL(P,this.origin),q=yI(this.rewrite,M);E=M.href.replace(M.origin,""),q.origin!==this.origin?(O=q.href,T=!0):O=q.pathname+q.search+q.hash}else E=I9(P),O=E;return{publicHref:O,href:E,pathname:S,search:j,searchStr:k,state:C,hash:A??"",external:T,unmaskOnReload:i.unmaskOnReload}},r=(i={},a)=>{const o=n(i);let u=a?n(a):void 0;if(!u){const d=Object.create(null);if(this.options.routeMasks){const f=U9(o.pathname,this.processedTree);if(f){Object.assign(d,f.rawParams);const{from:p,params:m,...y}=f.route,v=m===!1||m===null?Object.create(null):(m??!0)===!0?d:Object.assign(d,Xs(m,d));a={from:t.from,...y,params:v},u=n(a)}}}return u&&(o.maskedLocation=u),o};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=vl(r.state,this.latestLocation.state);return u.forEach(f=>{delete r.state[f]}),d},a=so(this.latestLocation.href)===so(r.href);let o=this.commitLocationPromise;if(this.commitLocationPromise=mu(()=>{o?.resolve(),o=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:o,...u}={})=>{if(o){const p=this.history.location.state.__TSR_index,m=pg(o,{__TSR_index:t?p:p+1}),y=new URL(m.pathname,this.origin);u.to=US(this.rewrite,y).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 o=!1;if(r)try{new URL(`${r}`),o=!0}catch{}if(o&&!n&&(n=!0),n){if(t!==void 0||!r){const d=this.buildLocation({to:t,...a});r=r??d.publicHref,i=i??d.publicHref}const u=!o&&i?i:r;if(cg(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",...wl({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...wl({resolvedLocation:f,location:d})}),await UE({router:this,sync:t?.sync,forceStaleReload:a.href===d.href,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],m=[],y=[],v=[];gf(()=>{this.__store.setState(w=>{const S=w.matches,j=w.pendingMatches||w.matches;return p=S.filter(k=>!j.some(A=>A.id===k.id)),m=S.filter(k=>!j.some(A=>A.routeId===k.routeId)),y=j.filter(k=>!S.some(A=>A.routeId===k.routeId)),v=j.filter(k=>S.some(A=>A.routeId===k.routeId)),{...w,isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...p.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[y,"onEnter"],[v,"onStay"]].forEach(([w,S])=>{w.forEach(j=>{this.looseRoutesById[j.routeId].options[S]?.(j)})})})})}})}catch(d){_r(d)?(n=d,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):hr(d)&&(r=d),this.__store.setState(f=>({...f,statusCode:n?n.status:r?404:f.matches.some(p=>p.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),u()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.__store.state.matches.some(u=>u.status==="error")&&(o=500),o!==void 0&&this.__store.setState(u=>({...u,statusCode:o}))},this.startViewTransition=t=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,a=this.state.resolvedLocation,o=typeof n.types=="function"?n.types(wl({resolvedLocation:a,location:i})):n.types;if(o===!1){t();return}r={update:t,types:o}}else r=t;document.startViewTransition(r)}else t()},this.updateMatch=(t,n)=>{this.startTransition(()=>{const r=this.state.pendingMatches?.some(i=>i.id===t)?"pendingMatches":this.state.matches.some(i=>i.id===t)?"matches":this.state.cachedMatches.some(i=>i.id===t)?"cachedMatches":"";r&&(r==="cachedMatches"?this.__store.setState(i=>({...i,cachedMatches:LH(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&&cg(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=Af,this.preloadRoute=async t=>{const n=t._builtLocation??this.buildLocation(t);let r=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:t});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(o=>o.id)),a=new Set([...i,...this.state.cachedMatches.map(o=>o.id)]);gf(()=>{r.forEach(o=>{a.has(o.id)||this.__store.setState(u=>({...u,cachedMatches:[...u.cachedMatches,o]}))})});try{return r=await UE({router:this,matches:r,location:n,preload:!0,updateMatch:(o,u)=>{i.has(o)?r=r.map(d=>d.id===o?u(d):d):this.updateMatch(o,u)}}),r}catch(o){if(_r(o))return o.options.reloadDocument?void 0:await this.preloadRoute({...o.options,_fromLocation:n});hr(o)||console.error(o);return}},this.matchRoute=(t,n)=>{const r={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(r);if(n?.pending&&this.state.status!=="pending")return!1;const a=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,o=F9(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,a.pathname,this.processedTree);return!o||t.params&&!vl(o.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?vl(a.search,i.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??cH,parseSearch:e.parseSearch??lH,protocolAllowlist:e.protocolAllowlist??D9}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n;let{matchedRoutes:o}=n,u=!1;(r?r.path!=="/"&&i["**"]:so(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:u=!0);const d=u?KH(this.options.notFoundMode,o):void 0,f=new Array(o.length),p=new Map(this.state.matches.map(m=>[m.routeId,m]));for(let m=0;m<o.length;m++){const y=o[m],v=f[m-1];let w,S,j;{const J=v?.search??e.search,ae=v?._strictSearch??void 0;try{const Z=Gm(y.options.validateSearch,{...J})??void 0;w={...J,...Z},S={...ae,...Z},j=void 0}catch(Z){let H=Z;if(Z instanceof mg||(H=new mg(Z.message,{cause:Z})),t?.throwOnError)throw H;w=J,S={},j=H}}const k=y.options.loaderDeps?.({search:w})??"",A=k?JSON.stringify(k):"",{interpolatedPath:_,usedParams:C}=RE({path:y.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),P=y.id+_+A,E=this.getMatch(P),O=p.get(y.id),T=E?._strictParams??C;let M;if(!E)try{GE(y,C,a,T)}catch(J){if(hr(J)||_r(J)?M=J:M=new BH(J.message,{cause:J}),t?.throwOnError)throw M}Object.assign(i,T);const q=O?"stay":"enter";let $;if(E)$={...E,cause:q,params:O?.params??i,_strictParams:T,search:Yo(O?O.search:E.search,w),_strictSearch:S};else{const J=y.options.loader||y.options.beforeLoad||y.lazyFn||CI(y)?"pending":"success";$={id:P,ssr:y.options.ssr,index:m,routeId:y.id,params:O?.params??i,_strictParams:T,pathname:_,updatedAt:Date.now(),search:O?Yo(O.search,w):w,_strictSearch:S,searchError:void 0,status:J,isFetching:!1,error:void 0,paramsError:M,__routeContext:void 0,_nonReactive:{loadPromise:mu()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:q,loaderDeps:O?ll(O.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:y.options.staticData||{},fullPath:y.fullPath}}t?.preload||($.globalNotFound=d===y.id),$.searchError=j;const L=this.getParentContext(v);$.context={...L,...$.__routeContext,...$.__beforeLoadContext},f[m]=$}for(let m=0;m<f.length;m++){const y=f[m],v=this.looseRoutesById[y.routeId],w=this.getMatch(y.id),S=p.get(y.routeId);if(y.params=S?Yo(S.params,i):i,!w){const j=f[m-1],k=this.getParentContext(j);if(v.options.context){const A={deps:y.loaderDeps,params:y.params,context:k??{},location:e,navigate:_=>this.navigate({..._,_fromLocation:e}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:f,routeId:v.id};y.__routeContext=v.options.context(A)??void 0}y.context={...k,...y.__routeContext,...y.__beforeLoadContext}}}return f}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=Cf(t),a={...e.search};for(const f of t)try{Object.assign(a,Gm(f.options.validateSearch,a))}catch{}const o=Cf(this.state.matches),u=o&&o.routeId===i.id&&e.pathname===this.state.location.pathname;let d;if(u)d=o.params;else{const f=Object.assign(Object.create(null),n);for(const p of t)try{GE(p,n,r??{},f)}catch{}d=f}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:d}}},mg=class extends Error{},BH=class extends Error{};function UH(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Gm(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new mg("Async validation not supported");if(n.issues)throw new mg(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 FH({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=so(e);let a,o;const u=q9(i,n,!0);return u&&(a=u.route,Object.assign(r,u.rawParams),o=Object.assign(Object.create(null),u.parsedParams)),{matchedRoutes:u?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function qH({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return HH(n)(e,t,r??!1)}function HH(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const a=({search:o,next:u})=>{let d=o;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((p,m)=>m(p),o));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:o,next:u})=>{const d=u(o);if(!t._includeValidateSearch)return d;try{return{...d,...Gm(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:Xs(a.search,i):{}};t.middlewares.push(n);const r=(i,a,o)=>{if(i>=o.length)return a;const u=o[i];return u({search:a,next:f=>r(i+1,f,o)})};return function(a,o,u){return t.dest=o,t._includeValidateSearch=u,r(0,a,t.middlewares)}}function KH(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 bl}function GE(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 GH="Error preloading route! ☝️",_I=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=bl:this.parentRoute||ho(!1);let i=r?bl:n?.path;i&&i!=="/"&&(i=mI(i));const a=n?.id||i;let o=r?bl:qm([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),o!=="__root__"&&(o=qm(["/",o]));const u=o==="__root__"?"/":qm([this.parentRoute.fullPath,i]);this._path=i,this._id=o,this._fullPath=u,this._to=so(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=>Tj({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.")}},VH=class extends _I{constructor(e){super(e)}};function Dj(e){const t=e.errorComponent??Ij;return c.jsx(ZH,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?b.createElement(t,{error:n,reset:r}):e.children})}var ZH=class extends b.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 Ij({error:e}){const[t,n]=b.useState(!1);return c.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[c.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),c.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"})]}),c.jsx("div",{style:{height:".25rem"}}),t?c.jsx("div",{children:c.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?c.jsx("code",{children:e.message}):null})}):null]})}function YH({children:e,fallback:t=null}){return AI()?c.jsx(Hi.Fragment,{children:e}):c.jsx(Hi.Fragment,{children:t})}function AI(){return Hi.useSyncExternalStore(WH,()=>!0,()=>!1)}function WH(){return()=>{}}var OI=b.createContext(null);function Ei(e){const t=b.useContext(OI);return e?.warn,t}var bx={exports:{}},xx={},wx={exports:{}},Sx={};var VE;function QH(){if(VE)return Sx;VE=1;var e=Ou();function t(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function u(m,y){var v=y(),w=r({inst:{value:v,getSnapshot:y}}),S=w[0].inst,j=w[1];return a(function(){S.value=v,S.getSnapshot=y,d(S)&&j({inst:S})},[m,v,y]),i(function(){return d(S)&&j({inst:S}),m(function(){d(S)&&j({inst:S})})},[m]),o(v),v}function d(m){var y=m.getSnapshot;m=m.value;try{var v=y();return!n(m,v)}catch{return!0}}function f(m,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return Sx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Sx}var ZE;function XH(){return ZE||(ZE=1,wx.exports=QH()),wx.exports}var YE;function JH(){if(YE)return xx;YE=1;var e=Ou(),t=XH();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,u=e.useMemo,d=e.useDebugValue;return xx.useSyncExternalStoreWithSelector=function(f,p,m,y,v){var w=a(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=u(function(){function k(E){if(!A){if(A=!0,_=E,E=y(E),v!==void 0&&S.hasValue){var O=S.value;if(v(O,E))return C=O}return C=E}if(O=C,r(_,E))return O;var T=y(E);return v!==void 0&&v(O,T)?(_=E,O):(_=E,C=T)}var A=!1,_,C,P=m===void 0?null:m;return[function(){return k(p())},P===null?void 0:function(){return k(P())}]},[p,m,y,v]);var j=i(f,w[0],w[1]);return o(function(){S.hasValue=!0,S.value=j},[j]),d(j),j},xx}var WE;function eK(){return WE||(WE=1,bx.exports=JH()),bx.exports}var EI=eK();function tK(e,t){return e===t}function nK(e,t,n=tK){const r=b.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(o);return u},[e]),i=b.useCallback(()=>e?.get(),[e]);return EI.useSyncExternalStoreWithSelector(r,i,i,t,n)}function zr(e){const t=Ei({warn:e?.router===void 0}),n=e?.router||t,r=b.useRef(void 0);return nK(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=ll(r.current,e.select(i));return r.current=a,a}return e.select(i)}return i})}var Dy=b.createContext(void 0),rK=b.createContext(void 0);function bo(e){const t=b.useContext(e.from?rK:Dy);return zr({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(ho(!((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 Lj(e){return bo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function $j(e){const{select:t,...n}=e;return bo({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Iy(e){return bo({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 Ly(e){return bo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function xo(e){const t=Ei();return b.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Bj(e){return bo({...e,select:t=>e.select?e.select(t.context):t.context})}var Ul=WD();const iK=ja(Ul);function aK(e,t){const n=Ei(),r=E9(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:u,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:y,resetScroll:v,viewTransition:w,children:S,target:j,disabled:k,style:A,className:_,onClick:C,onBlur:P,onFocus:E,onMouseEnter:O,onMouseLeave:T,onTouchStart:M,ignoreBlocker:q,params:$,search:L,hash:J,state:ae,mask:Z,reloadDocument:H,unsafeRelative:Q,from:he,_fromLocation:we,...R}=e,U=AI(),F=zr({select:ze=>{const ne=ze.matches[ze.matches.length-1];return{search:ne?.search,hash:ze.location.hash,path:ne?.pathname}},structuralSharing:!0}),D=e.from,Y=b.useMemo(()=>({...e,from:D}),[n,F,D,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),se=b.useMemo(()=>n.buildLocation({...Y}),[n,Y]),ie=se.maskedLocation?se.maskedLocation.publicHref:se.publicHref,fe=se.maskedLocation?se.maskedLocation.external:se.external,je=b.useMemo(()=>dK(ie,fe,n.history,k),[k,fe,ie,n.history]),ee=b.useMemo(()=>{if(je?.external)return cg(je.href,n.protocolAllowlist)?void 0:je.href;if(!fK(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),cg(u,n.protocolAllowlist)?void 0:u}catch{}},[u,je,n.protocolAllowlist]),ue=zr({select:ze=>{if(ee)return!1;if(o?.exact){if(!Y9(ze.location.pathname,se.pathname,n.basepath))return!1}else{const ne=dg(ze.location.pathname,n.basepath),xe=dg(se.pathname,n.basepath);if(!(ne.startsWith(xe)&&(ne.length===xe.length||ne[xe.length]==="/")))return!1}return(o?.includeSearch??!0)&&!vl(ze.location.search,se.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?U&&ze.location.hash===se.hash:!0}}),Ae=ue?Xs(i,{})??sK:jx,W=ue?jx:Xs(a,{})??jx,Ke=[_,Ae.className,W.className].filter(Boolean).join(" "),Re=(A||Ae.style||W.style)&&{...A,...Ae.style,...W.style},[it,at]=b.useState(!1),At=b.useRef(!1),Bt=e.reloadDocument||ee?!1:d??n.options.defaultPreload,wn=f??n.options.defaultPreloadDelay??0,ve=b.useCallback(()=>{n.preloadRoute({...Y,_builtLocation:se}).catch(ze=>{console.warn(ze),console.warn(GH)})},[n,Y,se]);O9(r,b.useCallback(ze=>{ze?.isIntersecting&&ve()},[ve]),uK,{disabled:!!k||Bt!=="viewport"}),b.useEffect(()=>{At.current||!k&&Bt==="render"&&(ve(),At.current=!0)},[k,ve,Bt]);const Ye=ze=>{const ne=ze.currentTarget.getAttribute("target"),xe=j!==void 0?j:ne;if(!k&&!hK(ze)&&!ze.defaultPrevented&&(!xe||xe==="_self")&&ze.button===0){ze.preventDefault(),Ul.flushSync(()=>{at(!0)});const Ee=n.subscribe("onResolved",()=>{Ee(),at(!1)});n.navigate({...Y,replace:m,resetScroll:v,hashScrollIntoView:p,startTransition:y,viewTransition:w,ignoreBlocker:q})}};if(ee)return{...R,ref:r,href:ee,...S&&{children:S},...j&&{target:j},...k&&{disabled:k},...A&&{style:A},..._&&{className:_},...C&&{onClick:C},...P&&{onBlur:P},...E&&{onFocus:E},...O&&{onMouseEnter:O},...T&&{onMouseLeave:T},...M&&{onTouchStart:M}};const be=ze=>{if(k||Bt!=="intent")return;if(!wn){ve();return}const ne=ze.currentTarget;if(Hd.has(ne))return;const xe=setTimeout(()=>{Hd.delete(ne),ve()},wn);Hd.set(ne,xe)},Me=ze=>{k||Bt!=="intent"||ve()},Pe=ze=>{if(k||!Bt||!wn)return;const ne=ze.currentTarget,xe=Hd.get(ne);xe&&(clearTimeout(xe),Hd.delete(ne))};return{...R,...Ae,...W,href:je?.href,ref:r,onClick:Tc([C,Ye]),onBlur:Tc([P,Pe]),onFocus:Tc([E,be]),onMouseEnter:Tc([O,be]),onMouseLeave:Tc([T,Pe]),onTouchStart:Tc([M,Me]),disabled:!!k,target:j,...Re&&{style:Re},...Ke&&{className:Ke},...k&&oK,...ue&&lK,...U&&it&&cK}}var jx={},sK={className:"active"},oK={role:"link","aria-disabled":!0},lK={"data-status":"active","aria-current":"page"},cK={"data-transitioning":"transitioning"},Hd=new WeakMap,uK={rootMargin:"100px"},Tc=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function dK(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function fK(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var qt=b.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...a}=aK(r,t),o=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:u,...d}=a;return b.createElement("a",d,o)}return b.createElement(n,a,o)});function hK(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var pK=class extends _I{constructor(e){super(e),this.useMatch=t=>bo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Bj({...t,from:this.id}),this.useSearch=t=>Ly({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Iy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>$j({...t,from:this.id}),this.useLoaderData=t=>Lj({...t,from:this.id}),this.useNavigate=()=>xo({from:this.fullPath}),this.Link=Hi.forwardRef((t,n)=>c.jsx(qt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Rr(e){return new pK(e)}function mK(){return e=>yK(e)}var gK=class extends VH{constructor(e){super(e),this.useMatch=t=>bo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Bj({...t,from:this.id}),this.useSearch=t=>Ly({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Iy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>$j({...t,from:this.id}),this.useLoaderData=t=>Lj({...t,from:this.id}),this.useNavigate=()=>xo({from:this.fullPath}),this.Link=Hi.forwardRef((t,n)=>c.jsx(qt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function yK(e){return new gK(e)}function QE(e){return typeof e=="object"?new XE(e,{silent:!0}).createRoute(e):new XE(e,{silent:!0}).createRoute}var XE=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=Rr(n);return r.isRoot=!1,r},this.silent=t?.silent}},JE=class{constructor(e){this.useMatch=t=>bo({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Bj({...t,from:this.options.id}),this.useSearch=t=>Ly({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Iy({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>$j({...t,from:this.options.id}),this.useLoaderData=t=>Lj({...t,from:this.options.id}),this.useNavigate=()=>xo({from:Ei().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function e2(e){return typeof e=="object"?new JE(e):t=>new JE({id:e,...t})}function vK(e){const t=zr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return c.jsx(Dj,{getResetKey:()=>t,onCatch:(n,r)=>{if(hr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(hr(n))return e.fallback?.(n);throw n},children:e.children})}function bK(){return c.jsx("p",{children:"Not Found"})}function Yc(e){return c.jsx(c.Fragment,{children:e.children})}function zI(e,t,n){return t.options.notFoundComponent?c.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?c.jsx(e.options.defaultNotFoundComponent,{...n}):c.jsx(bK,{})}function xK(){return Ei().isScrollRestoring,null}var TI=b.memo(function({matchId:t}){const n=Ei(),r=zr({select:w=>{const S=w.matches.findIndex(k=>k.id===t),j=w.matches[S];return ho(j),{routeId:j.routeId,ssr:j.ssr,_displayPending:j._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[S-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],a=i.options.pendingComponent??n.options.defaultPendingComponent,o=a?c.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))?b.Suspense:Yc,y=u?Dj:Yc,v=f?vK:Yc;return c.jsxs(i.isRoot?i.options.shellComponent??Yc:Yc,{children:[c.jsx(Dy.Provider,{value:t,children:c.jsx(m,{fallback:o,children:c.jsx(y,{getResetKey:()=>r.resetKey,errorComponent:u||Ij,onCatch:(w,S)=>{if(hr(w))throw w;d?.(w,S)},children:c.jsx(v,{fallback:w=>{if(!f||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!i.isRoot)throw w;return b.createElement(f,w)},children:p||r._displayPending?c.jsx(YH,{fallback:o,children:c.jsx(t2,{matchId:t})}):c.jsx(t2,{matchId:t})})})})}),r.parentRouteId===bl&&n.options.scrollRestoration?c.jsxs(c.Fragment,{children:[c.jsx(wK,{}),c.jsx(xK,{})]}):null]})});function wK(){const e=Ei(),t=b.useRef(void 0);return c.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...wl(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var t2=b.memo(function({matchId:t}){const n=Ei(),{match:r,key:i,routeId:a}=zr({select:d=>{const f=d.matches.find(y=>y.id===t),p=f.routeId,m=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:m?JSON.stringify(m):void 0,routeId:p,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),o=n.routesById[a],u=b.useMemo(()=>{const d=o.options.component??n.options.defaultComponent;return d?c.jsx(d,{},i):c.jsx(Uj,{})},[i,o.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const d=o.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const f=n.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise){const p=mu();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 ho(hr(r.error)),zI(n,o,r.error);if(r.status==="redirected")throw ho(_r(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return u}),Uj=b.memo(function(){const t=Ei(),n=b.useContext(Dy),r=zr({select:f=>f.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],a=zr({select:f=>{const p=f.matches.find(m=>m.id===n);return ho(p),p.globalNotFound}}),o=zr({select:f=>{const p=f.matches;return p[p.findIndex(m=>m.id===n)+1]?.id}}),u=t.options.defaultPendingComponent?c.jsx(t.options.defaultPendingComponent,{}):null;if(a)return zI(t,i,void 0);if(!o)return null;const d=c.jsx(TI,{matchId:o});return r===bl?c.jsx(b.Suspense,{fallback:u,children:d}):d});function SK(){const e=Ei(),t=b.useRef({router:e,mounted:!1}),[n,r]=b.useState(!1),{hasPendingMatches:i,isLoading:a}=zr({select:m=>({isLoading:m.isLoading,hasPendingMatches:m.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),o=hx(a),u=a||n||i,d=hx(u),f=a||i,p=hx(f);return e.startTransition=m=>{r(!0),b.startTransition(()=>{m(),r(!1)})},b.useEffect(()=>{const m=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return so(e.latestLocation.publicHref)!==so(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{m()}},[e,e.history]),em(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),em(()=>{o&&!a&&e.emit({type:"onLoad",...wl(e.state)})},[o,e,a]),em(()=>{p&&!f&&e.emit({type:"onBeforeRouteMount",...wl(e.state)})},[f,p,e]),em(()=>{if(d&&!u){const m=wl(e.state);e.emit({type:"onResolved",...m}),e.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),m.hrefChanged&&aH(e)}},[u,d,e]),null}function jK(){const e=Ei(),t=e.routesById[bl].options.pendingComponent??e.options.defaultPendingComponent,n=t?c.jsx(t,{}):null,r=c.jsxs(typeof document<"u"&&e.ssr?Yc:b.Suspense,{fallback:n,children:[c.jsx(SK,{}),c.jsx(NK,{})]});return e.options.InnerWrap?c.jsx(e.options.InnerWrap,{children:r}):r}function NK(){const e=Ei(),t=zr({select:i=>i.matches[0]?.id}),n=zr({select:i=>i.loadedAt}),r=t?c.jsx(TI,{matchId:t}):null;return c.jsx(Dy.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:c.jsx(Dj,{getResetKey:()=>n,errorComponent:Ij,onCatch:void 0,children:r})})}var kK=e=>new CK(e),CK=class extends $H{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=QE,globalThis.createLazyFileRoute=e2):typeof window<"u"&&(window.createFileRoute=QE,window.createLazyFileRoute=e2);function _K({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=c.jsx(OI.Provider,{value:e,children:t});return e.options.Wrap?c.jsx(e.options.Wrap,{children:r}):r}function AK({router:e,...t}){return c.jsx(_K,{router:e,...t,children:c.jsx(jK,{})})}function PI(e){return zr({select:t=>t.location})}class Ci extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function OK(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const EK=OK();function zK(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function TK(e){return`${zK()}${e}`}function PK(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 RK(){return""}function n2(){return!!RK()}async function _e(e,t){const n=await fetch(`${EK}${e}`,{...t,credentials:t?.credentials??"same-origin",headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const r=await n.text();let i=`API ${n.status}: ${n.statusText}`,a;if(r)try{const o=JSON.parse(r);typeof o.error=="string"?i=o.error:o.error?.message?(i=o.error.message,a=o.error.code):o.message&&(i=o.message)}catch{i=r}throw new Ci(i,n.status,a)}if(n.status!==204)return n.json()}function Fj(){return _e("/projects")}function RI(e){return _e(`/projects/${encodeURIComponent(e)}`)}function MI(){return _e("/runs")}function MK(e){return _e(`/projects/${encodeURIComponent(e)}/runs`)}function Al(e){return _e(`/runs/${encodeURIComponent(e)}`)}function DK(e){return _e(`/projects/${encodeURIComponent(e)}/keywords`)}function DI(e){return _e(`/projects/${encodeURIComponent(e)}/competitors`)}function II(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 $y(e,t){return _e(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function IK(e,t){return _e(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function LK(e,t){return _e(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function LI(e,t){return _e(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function r2(e,t){const n=await RI(e);return $y(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 $K(e,t){const n=await RI(e);return $y(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 BK(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 UK(e,t){return _e(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function FK(e,t){await _e(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function qK(e,t){return _e(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function HK(e){await _e(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function KK(e){return _e(`/projects/${encodeURIComponent(e)}/export`)}function qj(){return _e("/settings")}function GK(){return _e("/session")}function VK(e){return _e("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function ZK(e){return _e("/session",{method:"POST",body:JSON.stringify({password:e})})}function YK(e,t){return _e(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function WK(e){return _e("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function QK(e){try{return await _e(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Ci&&t.statusCode===404)return null;throw t}}function i2(e,t){return _e(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function XK(e){await _e(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function JK(e){return _e(`/projects/${encodeURIComponent(e)}/notifications`)}function e7(e,t){return _e(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function t7(e,t){await _e(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function n7(e,t){return _e(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function r7(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function i7(e){return _e("/apply",{method:"POST",body:JSON.stringify(e)})}function a7(e){return _e("/runs",{method:"POST",body:JSON.stringify(e??{})})}function $I(e){return _e(`/projects/${encodeURIComponent(e)}/google/connections`)}function s7(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function o7(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function l7(e){return _e(`/projects/${encodeURIComponent(e)}/google/properties`)}function c7(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function u7(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function BI(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function d7(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 f7(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function h7(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 p7(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function Hj(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function m7(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return _e(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function g7(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function y7(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function v7(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function a2(){return _e("/cdp/status")}function b7(e,t){return _e("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function s2(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function UI(e){return _e(`/projects/${encodeURIComponent(e)}/bing/status`)}function x7(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function w7(e){return _e(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function S7(e){return _e(`/projects/${encodeURIComponent(e)}/bing/sites`)}function j7(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function Kj(e){return _e(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function FI(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return _e(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function qI(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function o2(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function N7(e){return _e(`/projects/${encodeURIComponent(e)}/bing/performance`)}function k7(e){return _e("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function C7(e,t){const n=t?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/analytics/metrics${n}`)}function _7(e,t){const n=t?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/analytics/gaps${n}`)}function A7(e,t){const n=t?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/analytics/sources${n}`)}function l2(e){return _e(`/projects/${encodeURIComponent(e)}/ga/status`)}function c2(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 HI(e,t){return _e(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function O7(e,t){return _e(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function u2(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history${n}`)}function d2(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/social-referral-history${n}`)}function f2(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/session-history${n}`)}function E7(e){return _e(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function z7(e,t){const n=t?`?runId=${encodeURIComponent(t)}`:"";return _e(`/projects/${encodeURIComponent(e)}/insights${n}`)}async function T7(e,t){const n=TK(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:PK(e,r.status)};const i=await r.json(),a=typeof i.version=="string"?i.version:"unknown",o=typeof i.databaseUrlConfigured=="boolean"?i.databaseUrlConfigured:void 0,u=typeof i.lastHeartbeatAt=="string"?i.lastHeartbeatAt:void 0,d=[a,o===!1?"database not configured":"database configured",u?`heartbeat ${u}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:d,version:a,databaseConfigured:o,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 P7(){return _e("/backlinks/status")}function R7(){return _e("/backlinks/install",{method:"POST"})}function KI(){return _e("/backlinks/syncs/latest")}function M7(){return _e("/backlinks/syncs")}function D7(e){return _e("/backlinks/syncs",{method:"POST",body:JSON.stringify({release:e})})}function I7(){return _e("/backlinks/releases")}function L7(e){return _e(`/backlinks/cache/${encodeURIComponent(e)}`,{method:"DELETE"})}function $7(e,t){return _e(`/projects/${encodeURIComponent(e)}/backlinks/summary`)}function B7(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);const r=n.toString();return _e(`/projects/${encodeURIComponent(e)}/backlinks/domains${r?`?${r}`:""}`)}function U7(e){return _e(`/projects/${encodeURIComponent(e)}/backlinks/history`)}function F7(e,t){return _e(`/projects/${encodeURIComponent(e)}/backlinks/extract`,{method:"POST",body:JSON.stringify({release:void 0})})}const q7=6e3,H7=5,K7=180;let rr=[],G7=0;const KS=new Set,GS=new Map,VS=new Map;function gg(){const e=[...rr];for(const t of KS)t(e)}function Gj(e){const t=GS.get(e);t&&(clearTimeout(t),GS.delete(e));const n=VS.get(e);n&&(clearTimeout(n),VS.delete(e))}function GI(e){Gj(e);const t=rr.length;rr=rr.filter(n=>n.id!==e),rr.length!==t&&gg()}function h2(e){Gj(e.id),GS.set(e.id,setTimeout(()=>{ZS(e.id)},e.durationMs))}function V7(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function ht(e,t="negative",n=q7){const r=V7(e,t,n),i={id:String(++G7),title:r.title,detail:r.detail,tone:r.tone??t,durationMs:r.durationMs??n,dedupeKey:r.dedupeKey,cta:r.cta,state:"open"};if(r.dedupeKey){const a=rr.find(o=>o.dedupeKey===r.dedupeKey);if(a){if((r.dedupeMode??"drop")==="drop")return a.id;const o={...a,title:i.title,detail:i.detail,tone:i.tone,durationMs:i.durationMs,cta:i.cta,state:"open"};return rr=rr.map(u=>u.id===a.id?o:u),gg(),h2(o),a.id}}return rr.length>=H7&&GI(rr[0].id),rr=[...rr,i],gg(),h2(i),i.id}function ZS(e){const t=rr.find(n=>n.id===e);!t||t.state==="closing"||(Gj(e),rr=rr.map(n=>n.id===e?{...n,state:"closing"}:n),gg(),VS.set(e,setTimeout(()=>{GI(e)},K7)))}function Z7(e){return KS.add(e),()=>{KS.delete(e)}}function p2(){return rr}function Y7(){return new S9({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new iI({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||ht({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const W7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Q7=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),m2=e=>{const t=Q7(e);return t.charAt(0).toUpperCase()+t.slice(1)},VI=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),X7=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var J7={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 eG=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...u},d)=>b.createElement("svg",{ref:d,...J7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:VI("lucide",i),...!a&&!X7(u)&&{"aria-hidden":"true"},...u},[...o.map(([f,p])=>b.createElement(f,p)),...Array.isArray(a)?a:[a]]));const _t=(e,t)=>{const n=b.forwardRef(({className:r,...i},a)=>b.createElement(eG,{ref:a,iconNode:t,className:VI(`lucide-${W7(m2(e))}`,`lucide-${e}`,r),...i}));return n.displayName=m2(e),n};const tG=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],nG=_t("arrow-up",tG);const rG=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ZI=_t("check",rG);const iG=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],aG=_t("chevron-down",iG);const sG=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],rh=_t("chevron-right",sG);const oG=[["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"}]],lG=_t("circle-alert",oG);const cG=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],YI=_t("circle-check",cG);const uG=[["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"}]],WI=_t("circle-question-mark",uG);const dG=[["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"}]],fG=_t("copy",dG);const hG=[["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"}]],Vj=_t("download",hG);const pG=[["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"}]],mG=_t("github",pG);const gG=[["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"}]],yG=_t("globe",gG);const vG=[["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"}]],bG=_t("layout-dashboard",vG);const xG=[["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"}]],QI=_t("link-2",xG);const wG=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],XI=_t("loader-circle",wG);const SG=[["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"}]],jG=_t("maximize-2",SG);const NG=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],kG=_t("menu",NG);const CG=[["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"}]],_G=_t("minimize-2",CG);const AG=[["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"}]],yg=_t("play",AG);const OG=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],g2=_t("plus",OG);const EG=[["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"}]],y2=_t("refresh-cw",EG);const zG=[["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"}]],TG=_t("rocket",zG);const PG=[["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"}]],JI=_t("rotate-ccw",PG);const RG=[["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"}]],MG=_t("settings",RG);const DG=[["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"}]],v2=_t("sparkles",DG);const IG=[["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"}]],eL=_t("trash-2",IG);const LG=[["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"}]],vg=_t("triangle-alert",LG);const $G=[["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"}]],BG=_t("unplug",$G);const UG=[["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"}]],FG=_t("upload",UG);const qG=[["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"}]],HG=_t("wrench",qG);const KG=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ih=_t("x",KG);function me(e,t,n){function r(u,d){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:d,constr:o,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,d);const f=o.prototype,p=Object.keys(f);for(let m=0;m<p.length;m++){const y=p[m];y in u||(u[y]=f[y].bind(u))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(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(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:u=>n?.Parent&&u instanceof n.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class au extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class tL extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const nL={};function po(e){return nL}function rL(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 YS(e,t){return typeof t=="bigint"?t.toString():t}function Zj(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Yj(e){return e==null}function Wj(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function GG(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const d=r.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const a=n>i?n:i,o=Number.parseInt(e.toFixed(a).replace(".","")),u=Number.parseInt(t.toFixed(a).replace(".",""));return o%u/10**a}const b2=Symbol("evaluating");function Pt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==b2)return r===void 0&&(r=b2,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Fl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function wo(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function x2(e){return JSON.stringify(e)}function VG(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const iL="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function bg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const ZG=Zj(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function gu(e){if(bg(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(bg(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function aL(e){return gu(e)?{...e}:Array.isArray(e)?[...e]:e}const YG=new Set(["string","number","symbol"]);function yu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function So(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Ve(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 WG(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const QG={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 XG(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=wo(e._zod.def,{get shape(){const o={};for(const u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(o[u]=n.shape[u])}return Fl(this,"shape",o),o},checks:[]});return So(e,a)}function JG(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=wo(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete o[u]}return Fl(this,"shape",o),o},checks:[]});return So(e,a)}function eV(e,t){if(!gu(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const a=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(a,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=wo(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Fl(this,"shape",a),a}});return So(e,i)}function tV(e,t){if(!gu(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=wo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Fl(this,"shape",r),r}});return So(e,n)}function nV(e,t){const n=wo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Fl(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return So(e,n)}function rV(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=wo(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 Fl(this,"shape",d),d},checks:[]});return So(t,o)}function iV(e,t,n){const r=wo(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const o in n){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(a[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)a[o]=new e({type:"nonoptional",innerType:i[o]});return Fl(this,"shape",a),a}});return So(t,r)}function Qc(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 Xc(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function rm(e){return typeof e=="string"?e:e?.message}function mo(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=rm(e.inst?._zod.def?.error?.(e))??rm(t?.error?.(e))??rm(n.customError?.(e))??rm(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Qj(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Of(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const sL=(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,YS,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},oL=me("$ZodError",sL),lL=me("$ZodError",sL,{Parent:Error});function aV(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 sV(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>r({issues:o}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let o=n,u=0;for(;u<a.path.length;){const d=a.path[u];u===a.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(a))):o[d]=o[d]||{_errors:[]},o=o[d],u++}}};return r(e),n}const Xj=e=>(t,n,r,i)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new au;if(o.issues.length){const u=new(i?.Err??e)(o.issues.map(d=>mo(d,a,po())));throw iL(u,i?.callee),u}return o.value},Jj=e=>async(t,n,r,i)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const u=new(i?.Err??e)(o.issues.map(d=>mo(d,a,po())));throw iL(u,i?.callee),u}return o.value},By=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 au;return a.issues.length?{success:!1,error:new(e??oL)(a.issues.map(o=>mo(o,i,po())))}:{success:!0,data:a.value}},oV=By(lL),Uy=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(o=>mo(o,i,po())))}:{success:!0,data:a.value}},lV=Uy(lL),cV=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Xj(e)(t,n,i)},uV=e=>(t,n,r)=>Xj(e)(t,n,r),dV=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Jj(e)(t,n,i)},fV=e=>async(t,n,r)=>Jj(e)(t,n,r),hV=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return By(e)(t,n,i)},pV=e=>(t,n,r)=>By(e)(t,n,r),mV=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Uy(e)(t,n,i)},gV=e=>async(t,n,r)=>Uy(e)(t,n,r),yV=/^[cC][^\s-]{8,}$/,vV=/^[0-9a-z]+$/,bV=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xV=/^[0-9a-vA-V]{20}$/,wV=/^[A-Za-z0-9]{27}$/,SV=/^[a-zA-Z0-9_-]{21}$/,jV=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,NV=/^([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})$/,w2=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)$/,kV=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,CV="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function _V(){return new RegExp(CV,"u")}const AV=/^(?:(?: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])$/,OV=/^(([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}|:))$/,EV=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,zV=/^(([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])$/,TV=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,cL=/^[A-Za-z0-9_-]*$/,PV=/^\+[1-9]\d{6,14}$/,uL="(?:(?:\\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])))",RV=new RegExp(`^${uL}$`);function dL(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 MV(e){return new RegExp(`^${dL(e)}$`)}function DV(e){const t=dL({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(`^${uL}T(?:${r})$`)}const IV=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},LV=/^-?\d+$/,fL=/^-?\d+(?:\.\d+)?$/,$V=/^(?:true|false)$/i,BV=/^[^A-Z]*$/,UV=/^[^a-z]*$/,Mr=me("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),hL={number:"number",bigint:"bigint",object:"date"},pL=me("$ZodCheckLessThan",(e,t)=>{Mr.init(e,t);const n=hL[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})}}),mL=me("$ZodCheckGreaterThan",(e,t)=>{Mr.init(e,t);const n=hL[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})}}),FV=me("$ZodCheckMultipleOf",(e,t)=>{Mr.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):GG(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})}}),qV=me("$ZodCheckNumberFormat",(e,t)=>{Mr.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,a]=QG[t.format];e._zod.onattach.push(o=>{const u=o._zod.bag;u.format=t.format,u.minimum=i,u.maximum=a,n&&(u.pattern=LV)}),e._zod.check=o=>{const u=o.value;if(n){if(!Number.isInteger(u)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?o.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}):o.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&&o.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),u>a&&o.issues.push({origin:"number",input:u,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),HV=me("$ZodCheckMaxLength",(e,t)=>{var n;Mr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Yj(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const o=Qj(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),KV=me("$ZodCheckMinLength",(e,t)=>{var n;Mr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Yj(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const o=Qj(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),GV=me("$ZodCheckLengthEquals",(e,t)=>{var n;Mr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!Yj(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,a=i.length;if(a===t.length)return;const o=Qj(i),u=a>t.length;r.issues.push({origin:o,...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})}}),Fy=me("$ZodCheckStringFormat",(e,t)=>{var n,r;Mr.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=()=>{})}),VV=me("$ZodCheckRegex",(e,t)=>{Fy.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})}}),ZV=me("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=BV),Fy.init(e,t)}),YV=me("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=UV),Fy.init(e,t)}),WV=me("$ZodCheckIncludes",(e,t)=>{Mr.init(e,t);const n=yu(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),QV=me("$ZodCheckStartsWith",(e,t)=>{Mr.init(e,t);const n=new RegExp(`^${yu(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),XV=me("$ZodCheckEndsWith",(e,t)=>{Mr.init(e,t);const n=new RegExp(`.*${yu(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),JV=me("$ZodCheckOverwrite",(e,t)=>{Mr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class eZ{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
10
+ `).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),a=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of a)this.content.push(o)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
11
+ `))}}const tZ={major:4,minor:3,patch:6},on=me("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tZ;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const a of i._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(o,u,d)=>{let f=Qc(o),p;for(const m of u){if(m._zod.def.when){if(!m._zod.def.when(o))continue}else if(f)continue;const y=o.issues.length,v=m._zod.check(o);if(v instanceof Promise&&d?.async===!1)throw new au;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,o.issues.length!==y&&(f||(f=Qc(o,y)))});else{if(o.issues.length===y)continue;f||(f=Qc(o,y))}}return p?p.then(()=>o):o},a=(o,u,d)=>{if(Qc(o))return o.aborted=!0,o;const f=i(u,r,d);if(f instanceof Promise){if(d.async===!1)throw new au;return f.then(p=>e._zod.parse(p,d))}return e._zod.parse(f,d)};e._zod.run=(o,u)=>{if(u.skipChecks)return e._zod.parse(o,u);if(u.direction==="backward"){const f=e._zod.parse({value:o.value,issues:[]},{...u,skipChecks:!0});return f instanceof Promise?f.then(p=>a(p,o,u)):a(f,o,u)}const d=e._zod.parse(o,u);if(d instanceof Promise){if(u.async===!1)throw new au;return d.then(f=>i(f,r,u))}return i(d,r,u)}}Pt(e,"~standard",()=>({validate:i=>{try{const a=oV(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return lV(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),eN=me("$ZodString",(e,t)=>{on.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??IV(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}}),tn=me("$ZodStringFormat",(e,t)=>{Fy.init(e,t),eN.init(e,t)}),nZ=me("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=NV),tn.init(e,t)}),rZ=me("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=w2(r))}else t.pattern??(t.pattern=w2());tn.init(e,t)}),iZ=me("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=kV),tn.init(e,t)}),aZ=me("$ZodURL",(e,t)=>{tn.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),sZ=me("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=_V()),tn.init(e,t)}),oZ=me("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=SV),tn.init(e,t)}),lZ=me("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=yV),tn.init(e,t)}),cZ=me("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=vV),tn.init(e,t)}),uZ=me("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bV),tn.init(e,t)}),dZ=me("$ZodXID",(e,t)=>{t.pattern??(t.pattern=xV),tn.init(e,t)}),fZ=me("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=wV),tn.init(e,t)}),hZ=me("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=DV(t)),tn.init(e,t)}),pZ=me("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=RV),tn.init(e,t)}),mZ=me("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=MV(t)),tn.init(e,t)}),gZ=me("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=jV),tn.init(e,t)}),yZ=me("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=AV),tn.init(e,t),e._zod.bag.format="ipv4"}),vZ=me("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=OV),tn.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})}}}),bZ=me("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=EV),tn.init(e,t)}),xZ=me("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=zV),tn.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,a]=r;if(!a)throw new Error;const o=Number(a);if(`${o}`!==a)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function gL(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const wZ=me("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=TV),tn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{gL(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function SZ(e){if(!cL.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return gL(n)}const jZ=me("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=cL),tn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{SZ(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),NZ=me("$ZodE164",(e,t)=>{t.pattern??(t.pattern=PV),tn.init(e,t)});function kZ(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 CZ=me("$ZodJWT",(e,t)=>{tn.init(e,t),e._zod.check=n=>{kZ(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),yL=me("$ZodNumber",(e,t)=>{on.init(e,t),e._zod.pattern=e._zod.bag.pattern??fL,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}}),_Z=me("$ZodNumberFormat",(e,t)=>{qV.init(e,t),yL.init(e,t)}),AZ=me("$ZodBoolean",(e,t)=>{on.init(e,t),e._zod.pattern=$V,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}}),OZ=me("$ZodUnknown",(e,t)=>{on.init(e,t),e._zod.parse=n=>n}),EZ=me("$ZodNever",(e,t)=>{on.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function S2(e,t,n){e.issues.length&&t.issues.push(...Xc(n,e.issues)),t.value[n]=e.value}const zZ=me("$ZodArray",(e,t)=>{on.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const a=[];for(let o=0;o<i.length;o++){const u=i[o],d=t.element._zod.run({value:u,issues:[]},r);d instanceof Promise?a.push(d.then(f=>S2(f,n,o))):S2(d,n,o)}return a.length?Promise.all(a).then(()=>n):n}});function xg(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Xc(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function vL(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=WG(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function bL(e,t,n,r,i,a){const o=[],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"){o.push(m);continue}const y=d.run({value:t[m],issues:[]},r);y instanceof Promise?e.push(y.then(v=>xg(v,n,m,t,p))):xg(y,n,m,t,p)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const TZ=me("$ZodObject",(e,t)=>{if(on.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=Zj(()=>vL(t));Pt(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=bg,a=t.catchall;let o;e._zod.parse=(u,d)=>{o??(o=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=o.shape;for(const y of o.keys){const v=m[y],w=v._zod.optout==="optional",S=v._zod.run({value:f[y],issues:[]},d);S instanceof Promise?p.push(S.then(j=>xg(j,u,y,f,w))):xg(S,u,y,f,w)}return a?bL(p,f,u,d,r.value,e):p.length?Promise.all(p).then(()=>u):u}}),PZ=me("$ZodObjectJIT",(e,t)=>{TZ.init(e,t);const n=e._zod.parse,r=Zj(()=>vL(t)),i=y=>{const v=new eZ(["shape","payload","ctx"]),w=r.value,S=_=>{const C=x2(_);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};v.write("const input = payload.value;");const j=Object.create(null);let k=0;for(const _ of w.keys)j[_]=`key_${k++}`;v.write("const newResult = {};");for(const _ of w.keys){const C=j[_],P=x2(_),O=y[_]?._zod?.optout==="optional";v.write(`const ${C} = ${S(_)};`),O?v.write(`
12
+ if (${C}.issues.length) {
13
+ if (${P} in input) {
14
+ payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
15
+ ...iss,
16
+ path: iss.path ? [${P}, ...iss.path] : [${P}]
17
+ })));
18
+ }
19
+ }
20
+
21
+ if (${C}.value === undefined) {
22
+ if (${P} in input) {
23
+ newResult[${P}] = undefined;
24
+ }
25
+ } else {
26
+ newResult[${P}] = ${C}.value;
27
+ }
28
+
29
+ `):v.write(`
30
+ if (${C}.issues.length) {
31
+ payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
32
+ ...iss,
33
+ path: iss.path ? [${P}, ...iss.path] : [${P}]
34
+ })));
35
+ }
36
+
37
+ if (${C}.value === undefined) {
38
+ if (${P} in input) {
39
+ newResult[${P}] = undefined;
40
+ }
41
+ } else {
42
+ newResult[${P}] = ${C}.value;
43
+ }
44
+
45
+ `)}v.write("payload.value = newResult;"),v.write("return payload;");const A=v.compile();return(_,C)=>A(y,_,C)};let a;const o=bg,u=!nL.jitless,f=u&&ZG.value,p=t.catchall;let m;e._zod.parse=(y,v)=>{m??(m=r.value);const w=y.value;return o(w)?u&&f&&v?.async===!1&&v.jitless!==!0?(a||(a=i(t.shape)),y=a(y,v),p?bL([],w,y,v,m,e):y):n(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),y)}});function j2(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=>!Qc(a));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(o=>mo(o,r,po())))}),t)}const RZ=me("$ZodUnion",(e,t)=>{on.init(e,t),Pt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Pt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Pt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Pt(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=>Wj(a.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1;const u=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},a);if(f instanceof Promise)u.push(f),o=!0;else{if(f.issues.length===0)return f;u.push(f)}}return o?Promise.all(u).then(d=>j2(d,i,e,a)):j2(u,i,e,a)}}),MZ=me("$ZodIntersection",(e,t)=>{on.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},r),o=t.right._zod.run({value:i,issues:[]},r);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([d,f])=>N2(n,d,f)):N2(n,a,o)}});function WS(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(gu(e)&&gu(t)){const n=Object.keys(t),r=Object.keys(e).filter(a=>n.indexOf(a)!==-1),i={...e,...t};for(const a of r){const o=WS(e[a],t[a]);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};i[a]=o.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],a=t[r],o=WS(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function N2(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}),Qc(e))return e;const o=WS(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const DZ=me("$ZodRecord",(e,t)=>{on.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!gu(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],o=t.keyType._zod.values;if(o){n.value={};const u=new Set;for(const f of o)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(...Xc(f,m.issues)),n.value[f]=m.value})):(p.issues.length&&n.issues.push(...Xc(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"&&fL.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=>mo(m,r,po())),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(...Xc(u,m.issues)),n.value[d.value]=m.value})):(p.issues.length&&n.issues.push(...Xc(u,p.issues)),n.value[d.value]=p.value)}}return a.length?Promise.all(a).then(()=>n):n}}),IZ=me("$ZodEnum",(e,t)=>{on.init(e,t);const n=rL(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>YG.has(typeof i)).map(i=>typeof i=="string"?yu(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:n,input:o,inst:e}),i}}),LZ=me("$ZodLiteral",(e,t)=>{if(on.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?yu(r):r?yu(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const a=r.value;return n.has(a)||r.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),r}}),$Z=me("$ZodTransform",(e,t)=>{on.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new tL(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(n.value=o,n));if(i instanceof Promise)throw new au;return n.value=i,n}});function k2(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const xL=me("$ZodOptional",(e,t)=>{on.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Pt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Pt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Wj(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=>k2(a,n.value)):k2(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),BZ=me("$ZodExactOptional",(e,t)=>{xL.init(e,t),Pt(e._zod,"values",()=>t.innerType._zod.values),Pt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),UZ=me("$ZodNullable",(e,t)=>{on.init(e,t),Pt(e._zod,"optin",()=>t.innerType._zod.optin),Pt(e._zod,"optout",()=>t.innerType._zod.optout),Pt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Wj(n.source)}|null)$`):void 0}),Pt(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)}),FZ=me("$ZodDefault",(e,t)=>{on.init(e,t),e._zod.optin="optional",Pt(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=>C2(a,t)):C2(i,t)}});function C2(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const qZ=me("$ZodPrefault",(e,t)=>{on.init(e,t),e._zod.optin="optional",Pt(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))}),HZ=me("$ZodNonOptional",(e,t)=>{on.init(e,t),Pt(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=>_2(a,e)):_2(i,e)}});function _2(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 KZ=me("$ZodCatch",(e,t)=>{on.init(e,t),Pt(e._zod,"optin",()=>t.innerType._zod.optin),Pt(e._zod,"optout",()=>t.innerType._zod.optout),Pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(o=>mo(o,r,po()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>mo(a,r,po()))},input:n.value}),n.issues=[]),n)}}),GZ=me("$ZodPipe",(e,t)=>{on.init(e,t),Pt(e._zod,"values",()=>t.in._zod.values),Pt(e._zod,"optin",()=>t.in._zod.optin),Pt(e._zod,"optout",()=>t.out._zod.optout),Pt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const a=t.out._zod.run(n,r);return a instanceof Promise?a.then(o=>im(o,t.in,r)):im(a,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>im(a,t.out,r)):im(i,t.out,r)}});function im(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const VZ=me("$ZodReadonly",(e,t)=>{on.init(e,t),Pt(e._zod,"propValues",()=>t.innerType._zod.propValues),Pt(e._zod,"values",()=>t.innerType._zod.values),Pt(e._zod,"optin",()=>t.innerType?._zod?.optin),Pt(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(A2):A2(i)}});function A2(e){return e.value=Object.freeze(e.value),e}const ZZ=me("$ZodCustom",(e,t)=>{Mr.init(e,t),on.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=>O2(a,n,r,e));O2(i,n,r,e)}});function O2(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(Of(i))}}var E2;class YZ{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 WZ(){return new YZ}(E2=globalThis).__zod_globalRegistry??(E2.__zod_globalRegistry=WZ());const uf=globalThis.__zod_globalRegistry;function QZ(e,t){return new e({type:"string",...Ve(t)})}function XZ(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ve(t)})}function z2(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ve(t)})}function JZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ve(t)})}function eY(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ve(t)})}function tY(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ve(t)})}function nY(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ve(t)})}function rY(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ve(t)})}function iY(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ve(t)})}function aY(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ve(t)})}function sY(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ve(t)})}function oY(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ve(t)})}function lY(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ve(t)})}function cY(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ve(t)})}function uY(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ve(t)})}function dY(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ve(t)})}function fY(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ve(t)})}function hY(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ve(t)})}function pY(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ve(t)})}function mY(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ve(t)})}function gY(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ve(t)})}function yY(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ve(t)})}function vY(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ve(t)})}function bY(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ve(t)})}function xY(e,t){return new e({type:"string",format:"date",check:"string_format",...Ve(t)})}function wY(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ve(t)})}function SY(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ve(t)})}function jY(e,t){return new e({type:"number",checks:[],...Ve(t)})}function NY(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ve(t)})}function kY(e,t){return new e({type:"boolean",...Ve(t)})}function CY(e){return new e({type:"unknown"})}function _Y(e,t){return new e({type:"never",...Ve(t)})}function T2(e,t){return new pL({check:"less_than",...Ve(t),value:e,inclusive:!1})}function Nx(e,t){return new pL({check:"less_than",...Ve(t),value:e,inclusive:!0})}function P2(e,t){return new mL({check:"greater_than",...Ve(t),value:e,inclusive:!1})}function kx(e,t){return new mL({check:"greater_than",...Ve(t),value:e,inclusive:!0})}function R2(e,t){return new FV({check:"multiple_of",...Ve(t),value:e})}function wL(e,t){return new HV({check:"max_length",...Ve(t),maximum:e})}function wg(e,t){return new KV({check:"min_length",...Ve(t),minimum:e})}function SL(e,t){return new GV({check:"length_equals",...Ve(t),length:e})}function AY(e,t){return new VV({check:"string_format",format:"regex",...Ve(t),pattern:e})}function OY(e){return new ZV({check:"string_format",format:"lowercase",...Ve(e)})}function EY(e){return new YV({check:"string_format",format:"uppercase",...Ve(e)})}function zY(e,t){return new WV({check:"string_format",format:"includes",...Ve(t),includes:e})}function TY(e,t){return new QV({check:"string_format",format:"starts_with",...Ve(t),prefix:e})}function PY(e,t){return new XV({check:"string_format",format:"ends_with",...Ve(t),suffix:e})}function Eu(e){return new JV({check:"overwrite",tx:e})}function RY(e){return Eu(t=>t.normalize(e))}function MY(){return Eu(e=>e.trim())}function DY(){return Eu(e=>e.toLowerCase())}function IY(){return Eu(e=>e.toUpperCase())}function LY(){return Eu(e=>VG(e))}function $Y(e,t,n){return new e({type:"array",element:t,...Ve(n)})}function BY(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ve(n)})}function UY(e){const t=FY(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Of(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(Of(i))}},e(n.value,n)));return t}function FY(e,t){const n=new Mr({check:"custom",...Ve(t)});return n._zod.check=e,n}function jL(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??uf,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 An(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const u=e._zod.toJSONSchema?.();if(u)o.schema=u;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,p);else{const y=o.schema,v=t.processors[i.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);v(e,t,y,p)}const m=e._zod.parent;m&&(o.ref||(o.ref=m),An(m,t,p),t.seen.get(m).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(o.schema,d),t.io==="input"&&ur(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function NL(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const o of e.seen.entries()){const u=e.metadataRegistry.get(o[0])?.id;if(u){const d=r.get(u);if(d&&d!==o[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,o[0])}}const i=o=>{const u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(o[0])?.id,y=e.external.uri??(w=>w);if(m)return{ref:y(m)};const v=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=v,{defId:v,ref:`${y("__shared")}#/${u}/${v}`}}if(o[1]===n)return{ref:"#"};const f=`#/${u}/`,p=o[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},a=o=>{if(o[1].schema.$ref)return;const u=o[1],{ref:d,defId:f}=i(o);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 o of e.seen.entries()){const u=o[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 o of e.seen.entries()){const u=o[1];if(t===o[0]){a(o);continue}if(e.external){const f=e.external.registry.get(o[0])?.id;if(t!==o[0]&&f){a(o);continue}}if(e.metadataRegistry.get(o[0])?.id){a(o);continue}if(u.cycle){a(o);continue}if(u.count>1&&e.reused==="ref"){a(o);continue}}}function kL(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const u=e.seen.get(o);if(u.ref===null)return;const d=u.def??u.schema,f={...d},p=u.ref;if(u.ref=null,p){r(p);const y=e.seen.get(p),v=y.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):Object.assign(d,v),Object.assign(d,f),o._zod.parent===p)for(const S in d)S==="$ref"||S==="allOf"||S in f||delete d[S];if(v.$ref&&y.def)for(const S in d)S==="$ref"||S==="allOf"||S in y.def&&JSON.stringify(d[S])===JSON.stringify(y.def[S])&&delete d[S]}const m=o._zod.parent;if(m&&m!==p){r(m);const y=e.seen.get(m);if(y?.schema.$ref&&(d.$ref=y.schema.$ref,y.def))for(const v in d)v==="$ref"||v==="allOf"||v in y.def&&JSON.stringify(d[v])===JSON.stringify(y.def[v])&&delete d[v]}e.override({zodSchema:o,jsonSchema:d,path:u.path??[]})};for(const o of[...e.seen.entries()].reverse())r(o[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(o)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const o of e.seen.entries()){const u=o[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 o=JSON.parse(JSON.stringify(i));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Sg(t,"input",e.processors),output:Sg(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function ur(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return ur(r.element,n);if(r.type==="set")return ur(r.valueType,n);if(r.type==="lazy")return ur(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return ur(r.innerType,n);if(r.type==="intersection")return ur(r.left,n)||ur(r.right,n);if(r.type==="record"||r.type==="map")return ur(r.keyType,n)||ur(r.valueType,n);if(r.type==="pipe")return ur(r.in,n)||ur(r.out,n);if(r.type==="object"){for(const i in r.shape)if(ur(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(ur(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(ur(i,n))return!0;return!!(r.rest&&ur(r.rest,n))}return!1}const qY=(e,t={})=>n=>{const r=jL({...n,processors:t});return An(e,r),NL(r,e),kL(r,e)},Sg=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},o=jL({...i??{},target:a,io:t,processors:n});return An(e,o),NL(o,e),kL(o,e)},HY={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},KY=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:a,maximum:o,format:u,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof o=="number"&&(i.maxLength=o),u&&(i.format=HY[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}))])}},GY=(e,t,n,r)=>{const i=n,{minimum:a,maximum:o,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 o=="number"&&(i.maximum=o,typeof f=="number"&&t.target!=="draft-04"&&(f<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},VY=(e,t,n,r)=>{n.type="boolean"},ZY=(e,t,n,r)=>{n.not={}},YY=(e,t,n,r)=>{},WY=(e,t,n,r)=>{const i=e._zod.def,a=rL(i.entries);a.every(o=>typeof o=="number")&&(n.type="number"),a.every(o=>typeof o=="string")&&(n.type="string"),n.enum=a},QY=(e,t,n,r)=>{const i=e._zod.def,a=[];for(const o of i.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){const o=a[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else a.every(o=>typeof o=="number")&&(n.type="number"),a.every(o=>typeof o=="string")&&(n.type="string"),a.every(o=>typeof o=="boolean")&&(n.type="boolean"),a.every(o=>o===null)&&(n.type="null"),n.enum=a},XY=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},JY=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},eW=(e,t,n,r)=>{const i=n,a=e._zod.def,{minimum:o,maximum:u}=e._zod.bag;typeof o=="number"&&(i.minItems=o),typeof u=="number"&&(i.maxItems=u),i.type="array",i.items=An(a.element,t,{...r,path:[...r.path,"items"]})},tW=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const o=a.shape;for(const f in o)i.properties[f]=An(o[f],t,{...r,path:[...r.path,"properties",f]});const u=new Set(Object.keys(o)),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=An(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},nW=(e,t,n,r)=>{const i=e._zod.def,a=i.inclusive===!1,o=i.options.map((u,d)=>An(u,t,{...r,path:[...r.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=o:n.anyOf=o},rW=(e,t,n,r)=>{const i=e._zod.def,a=An(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=An(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(o)?o.allOf:[o]];n.allOf=d},iW=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object";const o=a.keyType,d=o._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){const p=An(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=An(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=An(a.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=o._zod.values;if(f){const p=[...f].filter(m=>typeof m=="string"||typeof m=="number");p.length>0&&(i.required=p)}},aW=(e,t,n,r)=>{const i=e._zod.def,a=An(i.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},sW=(e,t,n,r)=>{const i=e._zod.def;An(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},oW=(e,t,n,r)=>{const i=e._zod.def;An(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},lW=(e,t,n,r)=>{const i=e._zod.def;An(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)))},cW=(e,t,n,r)=>{const i=e._zod.def;An(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},uW=(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;An(a,t,r);const o=t.seen.get(e);o.ref=a},dW=(e,t,n,r)=>{const i=e._zod.def;An(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},CL=(e,t,n,r)=>{const i=e._zod.def;An(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},fW=me("ZodISODateTime",(e,t)=>{hZ.init(e,t),cn.init(e,t)});function hW(e){return bY(fW,e)}const pW=me("ZodISODate",(e,t)=>{pZ.init(e,t),cn.init(e,t)});function mW(e){return xY(pW,e)}const gW=me("ZodISOTime",(e,t)=>{mZ.init(e,t),cn.init(e,t)});function yW(e){return wY(gW,e)}const vW=me("ZodISODuration",(e,t)=>{gZ.init(e,t),cn.init(e,t)});function bW(e){return SY(vW,e)}const xW=(e,t)=>{oL.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>sV(e,n)},flatten:{value:n=>aV(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,YS,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,YS,2)}},isEmpty:{get(){return e.issues.length===0}}})},zi=me("ZodError",xW,{Parent:Error}),wW=Xj(zi),SW=Jj(zi),jW=By(zi),NW=Uy(zi),kW=cV(zi),CW=uV(zi),_W=dV(zi),AW=fV(zi),OW=hV(zi),EW=pV(zi),zW=mV(zi),TW=gV(zi),ln=me("ZodType",(e,t)=>(on.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Sg(e,"input"),output:Sg(e,"output")}}),e.toJSONSchema=qY(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(wo(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)=>So(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>wW(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>jW(e,n,r),e.parseAsync=async(n,r)=>SW(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>NW(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>kW(e,n,r),e.decode=(n,r)=>CW(e,n,r),e.encodeAsync=async(n,r)=>_W(e,n,r),e.decodeAsync=async(n,r)=>AW(e,n,r),e.safeEncode=(n,r)=>OW(e,n,r),e.safeDecode=(n,r)=>EW(e,n,r),e.safeEncodeAsync=async(n,r)=>zW(e,n,r),e.safeDecodeAsync=async(n,r)=>TW(e,n,r),e.refine=(n,r)=>e.check(CQ(n,r)),e.superRefine=n=>e.check(_Q(n)),e.overwrite=n=>e.check(Eu(n)),e.optional=()=>I2(e),e.exactOptional=()=>hQ(e),e.nullable=()=>L2(e),e.nullish=()=>I2(L2(e)),e.nonoptional=n=>bQ(e,n),e.array=()=>Te(e),e.or=n=>aQ([e,n]),e.and=n=>oQ(e,n),e.transform=n=>$2(e,dQ(n)),e.default=n=>gQ(e,n),e.prefault=n=>vQ(e,n),e.catch=n=>wQ(e,n),e.pipe=n=>$2(e,n),e.readonly=()=>NQ(e),e.describe=n=>{const r=e.clone();return uf.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return uf.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return uf.get(e);const r=e.clone();return uf.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),_L=me("_ZodString",(e,t)=>{eN.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(r,i,a)=>KY(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(AY(...r)),e.includes=(...r)=>e.check(zY(...r)),e.startsWith=(...r)=>e.check(TY(...r)),e.endsWith=(...r)=>e.check(PY(...r)),e.min=(...r)=>e.check(wg(...r)),e.max=(...r)=>e.check(wL(...r)),e.length=(...r)=>e.check(SL(...r)),e.nonempty=(...r)=>e.check(wg(1,...r)),e.lowercase=r=>e.check(OY(r)),e.uppercase=r=>e.check(EY(r)),e.trim=()=>e.check(MY()),e.normalize=(...r)=>e.check(RY(...r)),e.toLowerCase=()=>e.check(DY()),e.toUpperCase=()=>e.check(IY()),e.slugify=()=>e.check(LY())}),PW=me("ZodString",(e,t)=>{eN.init(e,t),_L.init(e,t),e.email=n=>e.check(XZ(RW,n)),e.url=n=>e.check(rY(MW,n)),e.jwt=n=>e.check(vY(WW,n)),e.emoji=n=>e.check(iY(DW,n)),e.guid=n=>e.check(z2(M2,n)),e.uuid=n=>e.check(JZ(am,n)),e.uuidv4=n=>e.check(eY(am,n)),e.uuidv6=n=>e.check(tY(am,n)),e.uuidv7=n=>e.check(nY(am,n)),e.nanoid=n=>e.check(aY(IW,n)),e.guid=n=>e.check(z2(M2,n)),e.cuid=n=>e.check(sY(LW,n)),e.cuid2=n=>e.check(oY($W,n)),e.ulid=n=>e.check(lY(BW,n)),e.base64=n=>e.check(mY(VW,n)),e.base64url=n=>e.check(gY(ZW,n)),e.xid=n=>e.check(cY(UW,n)),e.ksuid=n=>e.check(uY(FW,n)),e.ipv4=n=>e.check(dY(qW,n)),e.ipv6=n=>e.check(fY(HW,n)),e.cidrv4=n=>e.check(hY(KW,n)),e.cidrv6=n=>e.check(pY(GW,n)),e.e164=n=>e.check(yY(YW,n)),e.datetime=n=>e.check(hW(n)),e.date=n=>e.check(mW(n)),e.time=n=>e.check(yW(n)),e.duration=n=>e.check(bW(n))});function B(e){return QZ(PW,e)}const cn=me("ZodStringFormat",(e,t)=>{tn.init(e,t),_L.init(e,t)}),RW=me("ZodEmail",(e,t)=>{iZ.init(e,t),cn.init(e,t)}),M2=me("ZodGUID",(e,t)=>{nZ.init(e,t),cn.init(e,t)}),am=me("ZodUUID",(e,t)=>{rZ.init(e,t),cn.init(e,t)}),MW=me("ZodURL",(e,t)=>{aZ.init(e,t),cn.init(e,t)}),DW=me("ZodEmoji",(e,t)=>{sZ.init(e,t),cn.init(e,t)}),IW=me("ZodNanoID",(e,t)=>{oZ.init(e,t),cn.init(e,t)}),LW=me("ZodCUID",(e,t)=>{lZ.init(e,t),cn.init(e,t)}),$W=me("ZodCUID2",(e,t)=>{cZ.init(e,t),cn.init(e,t)}),BW=me("ZodULID",(e,t)=>{uZ.init(e,t),cn.init(e,t)}),UW=me("ZodXID",(e,t)=>{dZ.init(e,t),cn.init(e,t)}),FW=me("ZodKSUID",(e,t)=>{fZ.init(e,t),cn.init(e,t)}),qW=me("ZodIPv4",(e,t)=>{yZ.init(e,t),cn.init(e,t)}),HW=me("ZodIPv6",(e,t)=>{vZ.init(e,t),cn.init(e,t)}),KW=me("ZodCIDRv4",(e,t)=>{bZ.init(e,t),cn.init(e,t)}),GW=me("ZodCIDRv6",(e,t)=>{xZ.init(e,t),cn.init(e,t)}),VW=me("ZodBase64",(e,t)=>{wZ.init(e,t),cn.init(e,t)}),ZW=me("ZodBase64URL",(e,t)=>{jZ.init(e,t),cn.init(e,t)}),YW=me("ZodE164",(e,t)=>{NZ.init(e,t),cn.init(e,t)}),WW=me("ZodJWT",(e,t)=>{CZ.init(e,t),cn.init(e,t)}),AL=me("ZodNumber",(e,t)=>{yL.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(r,i,a)=>GY(e,r,i),e.gt=(r,i)=>e.check(P2(r,i)),e.gte=(r,i)=>e.check(kx(r,i)),e.min=(r,i)=>e.check(kx(r,i)),e.lt=(r,i)=>e.check(T2(r,i)),e.lte=(r,i)=>e.check(Nx(r,i)),e.max=(r,i)=>e.check(Nx(r,i)),e.int=r=>e.check(D2(r)),e.safe=r=>e.check(D2(r)),e.positive=r=>e.check(P2(0,r)),e.nonnegative=r=>e.check(kx(0,r)),e.negative=r=>e.check(T2(0,r)),e.nonpositive=r=>e.check(Nx(0,r)),e.multipleOf=(r,i)=>e.check(R2(r,i)),e.step=(r,i)=>e.check(R2(r,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Oe(e){return jY(AL,e)}const QW=me("ZodNumberFormat",(e,t)=>{_Z.init(e,t),AL.init(e,t)});function D2(e){return NY(QW,e)}const XW=me("ZodBoolean",(e,t)=>{AZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>VY(e,n,r)});function Tt(e){return kY(XW,e)}const JW=me("ZodUnknown",(e,t)=>{OZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>YY()});function jg(){return CY(JW)}const eQ=me("ZodNever",(e,t)=>{EZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ZY(e,n,r)});function tQ(e){return _Y(eQ,e)}const nQ=me("ZodArray",(e,t)=>{zZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>eW(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(wg(n,r)),e.nonempty=n=>e.check(wg(1,n)),e.max=(n,r)=>e.check(wL(n,r)),e.length=(n,r)=>e.check(SL(n,r)),e.unwrap=()=>e.element});function Te(e,t){return $Y(nQ,e,t)}const rQ=me("ZodObject",(e,t)=>{PZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>tW(e,n,r,i),Pt(e,"shape",()=>t.shape),e.keyof=()=>It(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:jg()}),e.loose=()=>e.clone({...e._zod.def,catchall:jg()}),e.strict=()=>e.clone({...e._zod.def,catchall:tQ()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>eV(e,n),e.safeExtend=n=>tV(e,n),e.merge=n=>nV(e,n),e.pick=n=>XG(e,n),e.omit=n=>JG(e,n),e.partial=(...n)=>rV(OL,e,n[0]),e.required=(...n)=>iV(EL,e,n[0])});function Ce(e,t){const n={type:"object",shape:e??{},...Ve(t)};return new rQ(n)}const iQ=me("ZodUnion",(e,t)=>{RZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>nW(e,n,r,i),e.options=t.options});function aQ(e,t){return new iQ({type:"union",options:e,...Ve(t)})}const sQ=me("ZodIntersection",(e,t)=>{MZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>rW(e,n,r,i)});function oQ(e,t){return new sQ({type:"intersection",left:e,right:t})}const lQ=me("ZodRecord",(e,t)=>{DZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>iW(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function ah(e,t,n){return new lQ({type:"record",keyType:e,valueType:t,...Ve(n)})}const QS=me("ZodEnum",(e,t)=>{IZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(r,i,a)=>WY(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const a={};for(const o of r)if(n.has(o))a[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new QS({...t,checks:[],...Ve(i),entries:a})},e.exclude=(r,i)=>{const a={...t.entries};for(const o of r)if(n.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new QS({...t,checks:[],...Ve(i),entries:a})}});function It(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new QS({type:"enum",entries:n,...Ve(t)})}const cQ=me("ZodLiteral",(e,t)=>{LZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>QY(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 Ef(e,t){return new cQ({type:"literal",values:Array.isArray(e)?e:[e],...Ve(t)})}const uQ=me("ZodTransform",(e,t)=>{$Z.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>JY(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new tL(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(Of(a,n.value,t));else{const o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(Of(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function dQ(e){return new uQ({type:"transform",transform:e})}const OL=me("ZodOptional",(e,t)=>{xL.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>CL(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function I2(e){return new OL({type:"optional",innerType:e})}const fQ=me("ZodExactOptional",(e,t)=>{BZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>CL(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function hQ(e){return new fQ({type:"optional",innerType:e})}const pQ=me("ZodNullable",(e,t)=>{UZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>aW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function L2(e){return new pQ({type:"nullable",innerType:e})}const mQ=me("ZodDefault",(e,t)=>{FZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>oW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gQ(e,t){return new mQ({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():aL(t)}})}const yQ=me("ZodPrefault",(e,t)=>{qZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function vQ(e,t){return new yQ({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():aL(t)}})}const EL=me("ZodNonOptional",(e,t)=>{HZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>sW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function bQ(e,t){return new EL({type:"nonoptional",innerType:e,...Ve(t)})}const xQ=me("ZodCatch",(e,t)=>{KZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>cW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function wQ(e,t){return new xQ({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const SQ=me("ZodPipe",(e,t)=>{GZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uW(e,n,r,i),e.in=t.in,e.out=t.out});function $2(e,t){return new SQ({type:"pipe",in:e,out:t})}const jQ=me("ZodReadonly",(e,t)=>{VZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dW(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function NQ(e){return new jQ({type:"readonly",innerType:e})}const kQ=me("ZodCustom",(e,t)=>{ZZ.init(e,t),ln.init(e,t),e._zod.processJSONSchema=(n,r,i)=>XY(e,n)});function CQ(e,t={}){return BY(kQ,e,t)}function _Q(e){return UY(e)}Ce({maxConcurrency:Oe().int().positive(),maxRequestsPerMinute:Oe().int().positive(),maxRequestsPerDay:Oe().int().positive()});const zu=B().min(1);B().min(1);const tN=Ce({label:B().min(1),city:B().min(1),region:B().min(1),country:B().length(2),timezone:B().optional()}),zL=It(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);Ce({id:B(),projectId:B(),channel:Ef("webhook"),url:B().url(),urlDisplay:B(),urlHost:B(),events:Te(zL),enabled:Tt().default(!0),source:B().optional(),webhookSecret:B().optional(),createdAt:B(),updatedAt:B()});const TL=It(["cli","api","config-file"]);function AQ(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 OQ(e,t){return t?e.some(n=>n.label===t):!0}Ce({displayName:B().min(1),canonicalDomain:B().min(1),ownedDomains:Te(B().min(1)).optional(),country:B().length(2),language:B().min(2),tags:Te(B()).optional(),labels:ah(B(),B()).optional(),providers:Te(zu).optional(),locations:Te(tN).optional(),defaultLocation:B().nullable().optional(),autoExtractBacklinks:Tt().optional(),configSource:TL.optional()});Ce({id:B(),name:B(),displayName:B().optional(),canonicalDomain:B(),ownedDomains:Te(B()).default([]),country:B().length(2),language:B().min(2),tags:Te(B()).default([]),labels:ah(B(),B()).default({}),locations:Te(tN).default([]),defaultLocation:B().nullable().optional(),autoExtractBacklinks:Tt().default(!1),configSource:TL.default("cli"),configRevision:Oe().int().positive().default(1),createdAt:B().optional(),updatedAt:B().optional()});function XS(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function EQ(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],n=new Set,r=[];for(const i of t){const a=i.trim();if(!a)continue;const o=XS(a);n.has(o)||(n.add(o),r.push(a))}return r}const zQ=Ce({name:B().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:ah(B(),B()).optional().default({})}),TQ=Ce({preset:B().optional(),cron:B().optional(),timezone:B().optional().default("UTC"),providers:Te(zu).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),PQ=Ce({channel:Ef("webhook"),url:B().url(),events:Te(zL).min(1)}),RQ=Ce({gsc:Ce({propertyUrl:B()}).optional(),syncSchedule:Ce({preset:B().optional(),cron:B().optional()}).optional()}).optional(),MQ=Ce({displayName:B().min(1),canonicalDomain:B().min(1),ownedDomains:Te(B().min(1)).optional().default([]),country:B().length(2),language:B().min(2),keywords:Te(B().min(1)).optional().default([]),competitors:Te(B().min(1)).optional().default([]),providers:Te(zu).optional().default([]),locations:Te(tN).optional().default([]),defaultLocation:B().optional(),schedule:TQ,notifications:Te(PQ).optional().default([]),google:RQ,autoExtractBacklinks:Tt().optional().default(!1)}).superRefine((e,t)=>{const n=AQ(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),OQ(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});Ce({apiVersion:Ef("canonry/v1"),kind:Ef("Project"),metadata:zQ,spec:MQ});const DQ=It(["gsc","ga4"]);Ce({id:B(),domain:B(),connectionType:DQ,propertyId:B().nullable().optional(),sitemapUrl:B().nullable().optional(),scopes:Te(B()).default([]),createdAt:B(),updatedAt:B()});Ce({date:B(),query:B(),page:B(),country:B().nullable().optional(),device:B().nullable().optional(),clicks:Oe(),impressions:Oe(),ctr:Oe(),position:Oe()});const JS=Ce({id:B(),url:B(),indexingState:B().nullable().optional(),verdict:B().nullable().optional(),coverageState:B().nullable().optional(),pageFetchState:B().nullable().optional(),robotsTxtState:B().nullable().optional(),crawlTime:B().nullable().optional(),lastCrawlResult:B().nullable().optional(),isMobileFriendly:Tt().nullable().optional(),richResults:Te(B()).default([]),inspectedAt:B()});It(["stable","reindexed","deindexed","still-missing","new"]);const IQ=Ce({url:B(),previousState:B().nullable(),currentState:B().nullable(),transitionDate:B()}),LQ=Ce({reason:B(),count:Oe(),urls:Te(JS).default([])});Ce({summary:Ce({total:Oe(),indexed:Oe(),notIndexed:Oe(),deindexed:Oe(),percentage:Oe()}),lastInspectedAt:B().nullable(),indexed:Te(JS).default([]),notIndexed:Te(JS).default([]),deindexed:Te(IQ).default([]),reasonGroups:Te(LQ).default([])});Ce({url:B(),type:It(["URL_UPDATED","URL_DELETED"]),notifiedAt:B()});Ce({url:B(),type:It(["URL_UPDATED","URL_DELETED"]),notifiedAt:B(),status:It(["success","error"]),error:B().optional()});Ce({date:B(),indexed:Oe(),notIndexed:Oe(),reasonBreakdown:ah(B(),Oe()).default({})});Ce({id:B(),domain:B(),siteUrl:B().nullable().optional(),createdAt:B(),updatedAt:B()});const Cx=Ce({id:B(),url:B(),httpCode:Oe().nullable().optional(),inIndex:Tt().nullable().optional(),lastCrawledDate:B().nullable().optional(),inIndexDate:B().nullable().optional(),inspectedAt:B(),documentSize:Oe().nullable().optional(),anchorCount:Oe().nullable().optional(),discoveryDate:B().nullable().optional()});Ce({summary:Ce({total:Oe(),indexed:Oe(),notIndexed:Oe(),unknown:Oe().optional(),percentage:Oe()}),lastInspectedAt:B().nullable(),indexed:Te(Cx).default([]),notIndexed:Te(Cx).default([]),unknown:Te(Cx).default([]).optional()});Ce({query:B(),impressions:Oe(),clicks:Oe(),ctr:Oe(),averagePosition:Oe()});Ce({date:B(),indexed:Oe(),notIndexed:Oe(),unknown:Oe()});Ce({url:B(),status:It(["success","error"]),submittedAt:B(),error:B().optional()});const Tu=It(["live","staging"]);Ce({projectName:B(),url:B(),stagingUrl:B().optional(),username:B(),defaultEnv:Tu,createdAt:B(),updatedAt:B()});const B2=Ce({url:B(),reachable:Tt(),pageCount:Oe().nullable().optional(),version:B().nullable().optional(),error:B().nullable().optional(),plugins:Te(B()).optional(),authenticatedUser:Ce({id:Oe(),slug:B()}).nullable().optional()});Ce({connected:Tt(),projectName:B(),defaultEnv:Tu,live:B2.nullable(),staging:B2.nullable(),adminUrl:B().nullable().optional()});const $Q=Ce({id:Oe(),slug:B(),title:B(),status:B(),modifiedAt:B().nullable().optional(),link:B().nullable().optional()}),PL=Ce({title:B().nullable(),description:B().nullable(),noindex:Tt().nullable(),writable:Tt().default(!1),writeTargets:Te(B()).default([])}),BQ=Ce({type:B(),json:ah(B(),jg())}),UQ=$Q.extend({env:Tu,content:B(),seo:PL,schemaBlocks:Te(BQ).default([])}),U2=UQ.extend({contentHash:B(),contentSnippet:B()}),RL=Ce({manualRequired:Ef(!0),targetUrl:B(),adminUrl:B().nullable().optional(),content:B(),nextSteps:Te(B()).default([])}),FQ=Ce({slug:B(),severity:It(["high","medium","low"]),code:It(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:B()});Ce({slug:B(),title:B(),status:B(),wordCount:Oe(),seo:PL,schemaPresent:Tt(),issues:Te(FQ).default([])});const qQ=Ce({slug:B(),status:It(["applied","skipped","manual"]),error:B().optional(),manualAssist:RL.optional()});Ce({env:Tu,strategy:It(["plugin","manual"]),results:Te(qQ)});const HQ=Ce({slug:B(),status:It(["deployed","stripped","skipped","failed"]),schemasInjected:Te(B()).optional(),manualAssist:RL.optional(),error:B().optional()});Ce({env:Tu,results:Te(HQ)});const KQ=Ce({slug:B(),title:B(),canonrySchemas:Te(B()),thirdPartySchemas:Te(B()),hasCanonrySchema:Tt()});Ce({env:Tu,pages:Te(KQ)});const GQ=Ce({name:B(),status:It(["completed","skipped","failed"]),summary:B().optional(),error:B().optional()});Ce({projectName:B(),steps:Te(GQ)});Ce({slug:B(),live:U2,staging:U2,hasDifferences:Tt(),differences:Ce({title:Tt(),slug:Tt(),content:Tt(),seoTitle:Tt(),seoDescription:Tt(),noindex:Tt(),schema:Tt()})});const ML=It(["queued","running","completed","partial","failed","cancelled"]),pn=ML.enum,DL=It(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","backlink-extract"]),sn=DL.enum,IL=It(["manual","scheduled","config-apply"]),Vm=IL.enum,LL=It(["cited","not-cited"]);LL.enum;const $L=It(["visible","not-visible"]);$L.enum;const BL=It(["new","cited","lost","emerging","not-cited"]);BL.enum;const VQ=Ce({id:B(),projectId:B(),kind:DL,status:ML,trigger:IL.default("manual"),location:B().nullable().optional(),startedAt:B().nullable().optional(),finishedAt:B().nullable().optional(),error:B().nullable().optional(),createdAt:B()}),UL=Ce({uri:B(),title:B()}),ZQ=Ce({id:B(),runId:B(),keywordId:B(),keyword:B().optional(),provider:zu,citationState:LL,answerMentioned:Tt().optional(),visibilityState:$L.optional(),transition:BL.optional(),answerText:B().nullable().optional(),citedDomains:Te(B()).default([]),competitorOverlap:Te(B()).default([]),recommendedCompetitors:Te(B()).default([]),matchedTerms:Te(B()).default([]),groundingSources:Te(UL).default([]),searchQueries:Te(B()).default([]),model:B().nullable().optional(),location:B().nullable().optional(),createdAt:B()}),YQ=VQ.extend({snapshots:Te(ZQ).optional()});Ce({totalRuns:Oe().int().nonnegative(),run:YQ.nullable()});Ce({id:B(),projectId:B().nullable().optional(),actor:B(),action:B(),entityType:B(),entityId:B().nullable().optional(),diff:jg().optional(),createdAt:B()});const WQ=It(["yes","no","unknown","not-mentioned"]);Ce({companyName:B().min(1),domain:B().min(1),phrases:Te(B().min(1)).optional().default([]),competitors:Te(B().min(1)).optional().default([])});const QQ=Ce({name:B(),count:Oe().int().nonnegative()}),XQ=Ce({id:B(),name:B(),weight:Oe(),score:Oe(),grade:B(),status:It(["pass","partial","fail"]),findings:Te(Ce({type:B(),message:B()})).default([]),recommendations:Te(B()).default([])}),JQ=Ce({url:B(),finalUrl:B(),auditedAt:B(),overallScore:Oe(),overallGrade:B(),summary:B(),factors:Te(XQ).default([])}),eX=Ce({industry:B(),summary:B(),services:Te(B()).default([]),categoryTerms:Te(B()).default([])}),tX=Ce({provider:B(),displayName:B(),model:B().nullable().optional(),mentioned:Tt(),cited:Tt(),describedAccurately:WQ,accuracyNotes:B().nullable().optional(),incorrectClaims:Te(B()).default([]),recommendedCompetitors:Te(B()).default([]),citedDomains:Te(B()).default([]),groundingSources:Te(UL).default([]),searchQueries:Te(B()).default([]),answerText:B(),error:B().nullable().optional()}),nX=Ce({phrase:B(),providerResults:Te(tX).default([])}),rX=Ce({totalQueries:Oe().int().nonnegative(),totalProviders:Oe().int().nonnegative(),totalComparisons:Oe().int().nonnegative(),mentionCount:Oe().int().nonnegative(),citationCount:Oe().int().nonnegative(),topCompetitors:Te(QQ).default([]),visibilityGap:B(),whatThisMeans:Te(B()).default([]),recommendedActions:Te(B()).default([])});Ce({companyName:B(),domain:B(),homepageUrl:B(),generatedAt:B(),phrases:Te(B()).default([]),competitors:Te(B()).default([]),profile:eX,audit:JQ,queryResults:Te(nX).default([]),summary:rX});Ce({id:B(),projectId:B(),cronExpr:B(),preset:B().nullable().optional(),timezone:B().default("UTC"),enabled:Tt().default(!0),providers:Te(zu).default([]),lastRunAt:B().nullable().optional(),nextRunAt:B().nullable().optional(),createdAt:B(),updatedAt:B()});Ce({preset:B().optional(),cron:B().optional(),timezone:B().optional().default("UTC"),enabled:Tt().optional().default(!0),providers:Te(zu).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const iX=It(["answer","citation"]),eo=iX.enum;Ce({id:B(),projectId:B(),propertyId:B(),clientEmail:B(),connected:Tt(),createdAt:B(),updatedAt:B()});Ce({date:B(),landingPage:B(),sessions:Oe(),organicSessions:Oe(),users:Oe()});const FL=It(["session","first_user","manual_utm"]),aX=Ce({source:B(),medium:B(),sessions:Oe(),users:Oe(),sourceDimension:FL}),sX=Ce({source:B(),medium:B(),sessions:Oe(),users:Oe(),channelGroup:B()});Ce({totalSessions:Oe(),totalOrganicSessions:Oe(),totalUsers:Oe(),topPages:Te(Ce({landingPage:B(),sessions:Oe(),organicSessions:Oe(),users:Oe()})),aiReferrals:Te(aX),aiSessionsDeduped:Oe(),aiUsersDeduped:Oe(),socialReferrals:Te(sX),socialSessions:Oe(),socialUsers:Oe(),organicSharePct:Oe(),aiSharePct:Oe(),socialSharePct:Oe(),lastSyncedAt:B().nullable()});Ce({date:B(),source:B(),medium:B(),sessions:Oe(),users:Oe(),sourceDimension:FL});Ce({date:B(),source:B(),medium:B(),sessions:Oe(),users:Oe(),channelGroup:B()});Ce({date:B(),sessions:Oe(),organicSessions:Oe(),users:Oe()});function F2(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const oX=It(["aero","user","compaction"]);oX.enum;const qL=128;Ce({key:B().min(1).max(qL),value:B().min(1)});Ce({key:B().min(1).max(qL)});const nN=It(["queued","downloading","querying","ready","failed"]);nN.enum;Ce({id:B(),release:B(),status:nN,phaseDetail:B().nullable().optional(),vertexPath:B().nullable().optional(),edgesPath:B().nullable().optional(),vertexSha256:B().nullable().optional(),edgesSha256:B().nullable().optional(),vertexBytes:Oe().int().nullable().optional(),edgesBytes:Oe().int().nullable().optional(),projectsProcessed:Oe().int().nullable().optional(),domainsDiscovered:Oe().int().nullable().optional(),downloadStartedAt:B().nullable().optional(),downloadFinishedAt:B().nullable().optional(),queryStartedAt:B().nullable().optional(),queryFinishedAt:B().nullable().optional(),error:B().nullable().optional(),createdAt:B(),updatedAt:B()});const lX=Ce({linkingDomain:B(),numHosts:Oe().int()}),cX=Ce({projectId:B(),release:B(),targetDomain:B(),totalLinkingDomains:Oe().int(),totalHosts:Oe().int(),top10HostsShare:B(),queriedAt:B()});Ce({summary:cX.nullable(),total:Oe().int(),rows:Te(lX)});Ce({release:B(),totalLinkingDomains:Oe().int(),totalHosts:Oe().int(),top10HostsShare:B(),queriedAt:B()});Ce({duckdbInstalled:Tt(),duckdbVersion:B().nullable().optional(),duckdbSpec:B(),pluginDir:B()});Ce({installed:Tt(),version:B(),path:B(),alreadyPresent:Tt()});Ce({release:B(),vertexUrl:B(),edgesUrl:B(),vertexBytes:Oe().int().nullable(),edgesBytes:Oe().int().nullable(),lastModified:B().nullable()});Ce({release:B(),syncStatus:nN.nullable(),bytes:Oe().int(),lastUsedAt:B().nullable()});var to=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(to||{});const uX={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},sm={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"};function dX(e){const t=e.match(/^(\[.*?\])\s*(.+)/);if(t){const n=t[1],r=t[2],i=r.indexOf("{");if(i>=0){const a=r.slice(0,i).trim(),o=r.slice(i);try{const u=JSON.parse(o);return`${n} ${a}
48
+
49
+ ${JSON.stringify(u,null,2)}`}catch{}}return`${n}
50
+ ${r}`}try{const n=JSON.parse(e);return JSON.stringify(n,null,2)}catch{return e}}function qy(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function qi(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function q2(e){return e===null?"Unknown":e?"Pass":"Fail"}function e1(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function fX(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function hX(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 _x(e,t,n){const r=n==="UTC"?"UTC":n.split("/").pop()?.replace(/_/g," ")??n;if(!e)return`Custom: ${t} · ${r}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${r}`;const i=e.match(/^daily(?:@(\d+))?$/);if(i){const o=i[1]?parseInt(i[1]):6;return`Every day at ${e1(o)} · ${r}`}const a=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(a){const o={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},u=a[2]?parseInt(a[2]):6;return`Every ${o[a[1]]} at ${e1(u)} · ${r}`}return`${e} · ${r}`}function Ng(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function HL(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 pX(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 mX(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function gX(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function go(e){const t=[e.detail,e.hint].filter(Boolean);return t.length>0?t.join(`
51
+ `):void 0}function yX(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:Ng(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:Ng(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const i=n.providerStatuses.filter(d=>d.state==="ready").length,a=n.providerStatuses.length,o=i>0,u=n.providerStatuses.filter(d=>d.state==="ready").map(d=>gX(d)).join(" · ");return{...r,label:"Providers",tone:o?"positive":"caution",detail:`${i} of ${a} configured`,meta:u||"None configured"}})}function vX(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 bX(e,t,n){const r=vX(t,n),i=structuredClone(e);return i.healthChecks=i.healthChecks.map(a=>{if(a.id==="api")return{...a,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(a.id==="worker")return{...a,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const o=n.providerStatuses.some(u=>u.state==="ready");return{...a,detail:o?"At least one provider configured.":"No providers configured.",state:o?"ready":"attention"}}),i.launchState.enabled=r===void 0,i.launchState.blockedReason=r,i.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",i}const KL="canonry.run-tracker",t1=new Set;let H2=!1,xX=0,Hy={runs:{},batches:{}};function wX(){const e=Ol();for(const t of t1)t(e)}function SX(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function jX(){typeof window>"u"||window.sessionStorage.setItem(KL,JSON.stringify(Hy))}function GL(){H2||(H2=!0,!(typeof window>"u")&&(Hy=SX(window.sessionStorage.getItem(KL))))}function Ky(e){Hy=e,jX(),wX()}function Ol(){return GL(),Hy}function NX(e){return GL(),t1.add(e),()=>{t1.delete(e)}}function VL(e){const t=Ol();Ky({...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 K2(e){const t=Ol();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;Ky({...t,runs:r})}function kX(e){const t=Ol(),n=`batch_${Date.now()}_${++xX}`;return Ky({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function CX(e){const t=Ol();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;Ky({...t,batches:r})}function rN(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function _X(e,t){let n=0,r=0,i=0,a=0,o=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:o+=1}return{completed:n,partial:r,failed:i,cancelled:a,pending:o,finished:o===0}}function G2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function iN(...e){return t=>{let n=!1;const r=e.map(i=>{const a=G2(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():G2(e[i],null)}}}}function ql(...e){return b.useCallback(iN(...e),e)}var AX=Symbol.for("react.lazy"),kg=Ty[" use ".trim().toString()];function OX(e){return typeof e=="object"&&e!==null&&"then"in e}function ZL(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===AX&&"_payload"in e&&OX(e._payload)}function EX(e){const t=TX(e),n=b.forwardRef((r,i)=>{let{children:a,...o}=r;ZL(a)&&typeof kg=="function"&&(a=kg(a._payload));const u=b.Children.toArray(a),d=u.find(RX);if(d){const f=d.props.children,p=u.map(m=>m===d?b.Children.count(f)>1?b.Children.only(null):b.isValidElement(f)?f.props.children:null:m);return c.jsx(t,{...o,ref:i,children:b.isValidElement(f)?b.cloneElement(f,void 0,p):null})}return c.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var zX=EX("Slot");function TX(e){const t=b.forwardRef((n,r)=>{let{children:i,...a}=n;if(ZL(i)&&typeof kg=="function"&&(i=kg(i._payload)),b.isValidElement(i)){const o=DX(i),u=MX(a,i.props);return i.type!==b.Fragment&&(u.ref=r?iN(r,o):o),b.cloneElement(i,u)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var PX=Symbol("radix.slottable");function RX(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===PX}function MX(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 DX(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 YL(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=YL(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ct(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=YL(e))&&(r&&(r+=" "),r+=t);return r}const V2=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Z2=Ct,WL=(e,t)=>n=>{var r;if(t?.variants==null)return Z2(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(f=>{const p=n?.[f],m=a?.[f];if(p===null)return null;const y=V2(p)||V2(m);return i[f][y]}),u=n&&Object.entries(n).reduce((f,p)=>{let[m,y]=p;return y===void 0||(f[m]=y),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:m,className:y,...v}=p;return Object.entries(v).every(w=>{let[S,j]=w;return Array.isArray(j)?j.includes({...a,...u}[S]):{...a,...u}[S]===j})?[...f,m,y]:f},[]);return Z2(e,o,d,n?.class,n?.className)},IX=(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},LX=(e,t)=>({classGroupId:e,validator:t}),QL=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Cg="-",Y2=[],$X="arbitrary..",BX=e=>{const t=FX(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return UX(o);const u=o.split(Cg),d=u[0]===""&&u.length>1?1:0;return XL(u,d,t)},getConflictingClassGroupIds:(o,u)=>{if(u){const d=r[o],f=n[o];return d?f?IX(f,d):d:f||Y2}return n[o]||Y2}}},XL=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=XL(e,t+1,a);if(f)return f}const o=n.validators;if(o===null)return;const u=t===0?e.join(Cg):e.slice(t).join(Cg),d=o.length;for(let f=0;f<d;f++){const p=o[f];if(p.validator(u))return p.classGroupId}},UX=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?$X+r:void 0})(),FX=e=>{const{theme:t,classGroups:n}=e;return qX(n,t)},qX=(e,t)=>{const n=QL();for(const r in e){const i=e[r];aN(i,n,r,t)}return n},aN=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];HX(o,t,n,r)}},HX=(e,t,n,r)=>{if(typeof e=="string"){KX(e,t,n);return}if(typeof e=="function"){GX(e,t,n,r);return}VX(e,t,n,r)},KX=(e,t,n)=>{const r=e===""?t:JL(t,e);r.classGroupId=n},GX=(e,t,n,r)=>{if(ZX(e)){aN(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(LX(n,e))},VX=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[u,d]=i[o];aN(d,JL(t,u),n,r)}},JL=(e,t)=>{let n=e;const r=t.split(Cg),i=r.length;for(let a=0;a<i;a++){const o=r[a];let u=n.nextPart.get(o);u||(u=QL(),n.nextPart.set(o,u)),n=u}return n},ZX=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,YX=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let o=n[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return i(a,o),o},set(a,o){a in n?n[a]=o:i(a,o)}}},n1="!",W2=":",WX=[],Q2=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),QX=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let o=0,u=0,d=0,f;const p=i.length;for(let S=0;S<p;S++){const j=i[S];if(o===0&&u===0){if(j===W2){a.push(i.slice(d,S)),d=S+1;continue}if(j==="/"){f=S;continue}}j==="["?o++:j==="]"?o--:j==="("?u++:j===")"&&u--}const m=a.length===0?i:i.slice(d);let y=m,v=!1;m.endsWith(n1)?(y=m.slice(0,-1),v=!0):m.startsWith(n1)&&(y=m.slice(1),v=!0);const w=f&&f>d?f-d:void 0;return Q2(a,v,y,w)};if(t){const i=t+W2,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):Q2(WX,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},XX=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const o=n[a],u=o[0]==="[",d=t.has(o);u||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},JX=e=>({cache:YX(e.cacheSize),parseClassName:QX(e),sortModifiers:XX(e),...BX(e)}),eJ=/\s+/,tJ=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],u=e.trim().split(eJ);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:m,modifiers:y,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:S}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let j=!!S,k=r(j?w.substring(0,S):w);if(!k){if(!j){d=p+(d.length>0?" "+d:d);continue}if(k=r(w),!k){d=p+(d.length>0?" "+d:d);continue}j=!1}const A=y.length===0?"":y.length===1?y[0]:a(y).join(":"),_=v?A+n1:A,C=_+k;if(o.indexOf(C)>-1)continue;o.push(C);const P=i(k,j);for(let E=0;E<P.length;++E){const O=P[E];o.push(_+O)}d=p+(d.length>0?" "+d:d)}return d},nJ=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=e5(n))&&(i&&(i+=" "),i+=r);return i},e5=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=e5(e[r]))&&(n&&(n+=" "),n+=t);return n},rJ=(e,...t)=>{let n,r,i,a;const o=d=>{const f=t.reduce((p,m)=>m(p),e());return n=JX(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=tJ(d,n);return i(d,p),p};return a=o,(...d)=>a(nJ(...d))},iJ=[],zn=e=>{const t=n=>n[e]||iJ;return t.isThemeGetter=!0,t},t5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,n5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,aJ=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,sJ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oJ=/\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$/,lJ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cJ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uJ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Us=e=>aJ.test(e),ct=e=>!!e&&!Number.isNaN(Number(e)),Fs=e=>!!e&&Number.isInteger(Number(e)),Ax=e=>e.endsWith("%")&&ct(e.slice(0,-1)),Ya=e=>sJ.test(e),r5=()=>!0,dJ=e=>oJ.test(e)&&!lJ.test(e),sN=()=>!1,fJ=e=>cJ.test(e),hJ=e=>uJ.test(e),pJ=e=>!Le(e)&&!$e(e),mJ=e=>jo(e,s5,sN),Le=e=>t5.test(e),Qo=e=>jo(e,o5,dJ),X2=e=>jo(e,jJ,ct),gJ=e=>jo(e,c5,r5),yJ=e=>jo(e,l5,sN),J2=e=>jo(e,i5,sN),vJ=e=>jo(e,a5,hJ),om=e=>jo(e,u5,fJ),$e=e=>n5.test(e),Kd=e=>Hl(e,o5),bJ=e=>Hl(e,l5),ez=e=>Hl(e,i5),xJ=e=>Hl(e,s5),wJ=e=>Hl(e,a5),lm=e=>Hl(e,u5,!0),SJ=e=>Hl(e,c5,!0),jo=(e,t,n)=>{const r=t5.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Hl=(e,t,n=!1)=>{const r=n5.exec(e);return r?r[1]?t(r[1]):n:!1},i5=e=>e==="position"||e==="percentage",a5=e=>e==="image"||e==="url",s5=e=>e==="length"||e==="size"||e==="bg-size",o5=e=>e==="length",jJ=e=>e==="number",l5=e=>e==="family-name",c5=e=>e==="number"||e==="weight",u5=e=>e==="shadow",NJ=()=>{const e=zn("color"),t=zn("font"),n=zn("text"),r=zn("font-weight"),i=zn("tracking"),a=zn("leading"),o=zn("breakpoint"),u=zn("container"),d=zn("spacing"),f=zn("radius"),p=zn("shadow"),m=zn("inset-shadow"),y=zn("text-shadow"),v=zn("drop-shadow"),w=zn("blur"),S=zn("perspective"),j=zn("aspect"),k=zn("ease"),A=zn("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...C(),$e,Le],E=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],T=()=>[$e,Le,d],M=()=>[Us,"full","auto",...T()],q=()=>[Fs,"none","subgrid",$e,Le],$=()=>["auto",{span:["full",Fs,$e,Le]},Fs,$e,Le],L=()=>[Fs,"auto",$e,Le],J=()=>["auto","min","max","fr",$e,Le],ae=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...T()],Q=()=>[Us,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],he=()=>[Us,"screen","full","dvw","lvw","svw","min","max","fit",...T()],we=()=>[Us,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],R=()=>[e,$e,Le],U=()=>[...C(),ez,J2,{position:[$e,Le]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",xJ,mJ,{size:[$e,Le]}],Y=()=>[Ax,Kd,Qo],se=()=>["","none","full",f,$e,Le],ie=()=>["",ct,Kd,Qo],fe=()=>["solid","dashed","dotted","double"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[ct,Ax,ez,J2],ue=()=>["","none",w,$e,Le],Ae=()=>["none",ct,$e,Le],W=()=>["none",ct,$e,Le],Ke=()=>[ct,$e,Le],Re=()=>[Us,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ya],breakpoint:[Ya],color:[r5],container:[Ya],"drop-shadow":[Ya],ease:["in","out","in-out"],font:[pJ],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ya],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ya],shadow:[Ya],spacing:["px",ct],text:[Ya],"text-shadow":[Ya],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Us,Le,$e,j]}],container:["container"],columns:[{columns:[ct,Le,$e,u]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:P()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[Fs,"auto",$e,Le]}],basis:[{basis:[Us,"full","auto",u,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ct,Us,"auto","initial","none",Le]}],grow:[{grow:["",ct,$e,Le]}],shrink:[{shrink:["",ct,$e,Le]}],order:[{order:[Fs,"first","last","none",$e,Le]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...ae(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...ae()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":ae()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...he()]}],"min-inline-size":[{"min-inline":["auto",...he()]}],"max-inline-size":[{"max-inline":["none",...he()]}],"block-size":[{block:["auto",...we()]}],"min-block-size":[{"min-block":["auto",...we()]}],"max-block-size":[{"max-block":["none",...we()]}],w:[{w:[u,"screen",...Q()]}],"min-w":[{"min-w":[u,"screen","none",...Q()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[o]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",n,Kd,Qo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,SJ,gJ]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ax,Le]}],"font-family":[{font:[bJ,yJ,t]}],"font-features":[{"font-features":[Le]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,$e,Le]}],"line-clamp":[{"line-clamp":[ct,"none",$e,X2]}],leading:[{leading:[a,...T()]}],"list-image":[{"list-image":["none",$e,Le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$e,Le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[ct,"from-font","auto",$e,Qo]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[ct,"auto",$e,Le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e,Le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$e,Le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fs,$e,Le],radial:["",$e,Le],conic:[Fs,$e,Le]},wJ,vJ]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ct,$e,Le]}],"outline-w":[{outline:["",ct,Kd,Qo]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",p,lm,om]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",m,lm,om]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[ct,Qo]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",y,lm,om]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[ct,$e,Le]}],"mix-blend":[{"mix-blend":[...je(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":je()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ct]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[$e,Le]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[ct]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$e,Le]}],filter:[{filter:["","none",$e,Le]}],blur:[{blur:ue()}],brightness:[{brightness:[ct,$e,Le]}],contrast:[{contrast:[ct,$e,Le]}],"drop-shadow":[{"drop-shadow":["","none",v,lm,om]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",ct,$e,Le]}],"hue-rotate":[{"hue-rotate":[ct,$e,Le]}],invert:[{invert:["",ct,$e,Le]}],saturate:[{saturate:[ct,$e,Le]}],sepia:[{sepia:["",ct,$e,Le]}],"backdrop-filter":[{"backdrop-filter":["","none",$e,Le]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[ct,$e,Le]}],"backdrop-contrast":[{"backdrop-contrast":[ct,$e,Le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ct,$e,Le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ct,$e,Le]}],"backdrop-invert":[{"backdrop-invert":["",ct,$e,Le]}],"backdrop-opacity":[{"backdrop-opacity":[ct,$e,Le]}],"backdrop-saturate":[{"backdrop-saturate":[ct,$e,Le]}],"backdrop-sepia":[{"backdrop-sepia":["",ct,$e,Le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",$e,Le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ct,"initial",$e,Le]}],ease:[{ease:["linear","initial",k,$e,Le]}],delay:[{delay:[ct,$e,Le]}],animate:[{animate:["none",A,$e,Le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,$e,Le]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:Ae()}],"rotate-x":[{"rotate-x":Ae()}],"rotate-y":[{"rotate-y":Ae()}],"rotate-z":[{"rotate-z":Ae()}],scale:[{scale:W()}],"scale-x":[{"scale-x":W()}],"scale-y":[{"scale-y":W()}],"scale-z":[{"scale-z":W()}],"scale-3d":["scale-3d"],skew:[{skew:Ke()}],"skew-x":[{"skew-x":Ke()}],"skew-y":[{"skew-y":Ke()}],transform:[{transform:[$e,Le,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Re()}],"translate-x":[{"translate-x":Re()}],"translate-y":[{"translate-y":Re()}],"translate-z":[{"translate-z":Re()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$e,Le]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$e,Le]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[ct,Kd,Qo,X2]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},kJ=rJ(NJ);function Ti(...e){return kJ(Ct(e))}const CJ=WL("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"}}),ge=b.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const o=r?zX:"button";return c.jsx(o,{ref:a,className:Ti(CJ({variant:t,size:n,className:e})),...i})});ge.displayName="Button";const _J=WL("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 d5({className:e,variant:t,...n}){return c.jsx("div",{className:Ti(_J({variant:t}),e),...n})}function tz({compact:e=!1}){return c.jsxs(qt,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[c.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),c.jsxs("span",{className:"brand-copy",children:[c.jsx("span",{className:"brand-mark",children:"Canonry"}),e?null:c.jsx("span",{className:"brand-subtitle",children:"AEO Monitor"})]})]})}function zf({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 c.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 vt({tone:e,children:t,...n}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return c.jsx(d5,{variant:r,...n,children:t})}function Gy({status:e}){return c.jsx(vt,{tone:HL(e),children:qy(e)})}function lo(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function AJ(e,t){const n=b.createContext(t),r=a=>{const{children:o,...u}=a,d=b.useMemo(()=>u,Object.values(u));return c.jsx(n.Provider,{value:d,children:o})};r.displayName=e+"Provider";function i(a){const o=b.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function OJ(e,t=[]){let n=[];function r(a,o){const u=b.createContext(o),d=n.length;n=[...n,o];const f=m=>{const{scope:y,children:v,...w}=m,S=y?.[e]?.[d]||u,j=b.useMemo(()=>w,Object.values(w));return c.jsx(S.Provider,{value:j,children:v})};f.displayName=a+"Provider";function p(m,y){const v=y?.[e]?.[d]||u,w=b.useContext(v);if(w)return w;if(o!==void 0)return o;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[f,p]}const i=()=>{const a=n.map(o=>b.createContext(o));return function(u){const d=u?.[e]||a;return b.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return i.scopeName=e,[r,EJ(i,...t)]}function EJ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((u,{useScope:d,scopeName:f})=>{const m=d(a)[`__scope${f}`];return{...u,...m}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Tf=globalThis?.document?b.useLayoutEffect:()=>{},zJ=Ty[" useId ".trim().toString()]||(()=>{}),TJ=0;function Ox(e){const[t,n]=b.useState(zJ());return Tf(()=>{n(r=>r??String(TJ++))},[e]),e||(t?`radix-${t}`:"")}var PJ=Ty[" useInsertionEffect ".trim().toString()]||Tf;function RJ({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=MJ({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:i;{const p=b.useRef(e!==void 0);b.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=b.useCallback(p=>{if(u){const m=DJ(p)?p(e):p;m!==e&&o.current?.(m)}else a(p)},[u,e,a,o]);return[d,f]}function MJ({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),i=b.useRef(n),a=b.useRef(t);return PJ(()=>{a.current=t},[t]),b.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function DJ(e){return typeof e=="function"}function f5(e){const t=IJ(e),n=b.forwardRef((r,i)=>{const{children:a,...o}=r,u=b.Children.toArray(a),d=u.find($J);if(d){const f=d.props.children,p=u.map(m=>m===d?b.Children.count(f)>1?b.Children.only(null):b.isValidElement(f)?f.props.children:null:m);return c.jsx(t,{...o,ref:i,children:b.isValidElement(f)?b.cloneElement(f,void 0,p):null})}return c.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function IJ(e){const t=b.forwardRef((n,r)=>{const{children:i,...a}=n;if(b.isValidElement(i)){const o=UJ(i),u=BJ(a,i.props);return i.type!==b.Fragment&&(u.ref=r?iN(r,o):o),b.cloneElement(i,u)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var LJ=Symbol("radix.slottable");function $J(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===LJ}function BJ(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 UJ(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 FJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],us=FJ.reduce((e,t)=>{const n=f5(`Primitive.${t}`),r=b.forwardRef((i,a)=>{const{asChild:o,...u}=i,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(d,{...u,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function qJ(e,t){e&&Ul.flushSync(()=>e.dispatchEvent(t))}function Pf(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>t.current?.(...n),[])}function HJ(e,t=globalThis?.document){const n=Pf(e);b.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 KJ="DismissableLayer",r1="dismissableLayer.update",GJ="dismissableLayer.pointerDownOutside",VJ="dismissableLayer.focusOutside",nz,h5=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),p5=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:u,...d}=e,f=b.useContext(h5),[p,m]=b.useState(null),y=p?.ownerDocument??globalThis?.document,[,v]=b.useState({}),w=ql(t,O=>m(O)),S=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(j),A=p?S.indexOf(p):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,C=A>=k,P=WJ(O=>{const T=O.target,M=[...f.branches].some(q=>q.contains(T));!C||M||(i?.(O),o?.(O),O.defaultPrevented||u?.())},y),E=QJ(O=>{const T=O.target;[...f.branches].some(q=>q.contains(T))||(a?.(O),o?.(O),O.defaultPrevented||u?.())},y);return HJ(O=>{A===f.layers.size-1&&(r?.(O),!O.defaultPrevented&&u&&(O.preventDefault(),u()))},y),b.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(nz=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),rz(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=nz)}},[p,y,n,f]),b.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),rz())},[p,f]),b.useEffect(()=>{const O=()=>v({});return document.addEventListener(r1,O),()=>document.removeEventListener(r1,O)},[]),c.jsx(us.div,{...d,ref:w,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:lo(e.onFocusCapture,E.onFocusCapture),onBlurCapture:lo(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:lo(e.onPointerDownCapture,P.onPointerDownCapture)})});p5.displayName=KJ;var ZJ="DismissableLayerBranch",YJ=b.forwardRef((e,t)=>{const n=b.useContext(h5),r=b.useRef(null),i=ql(t,r);return b.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),c.jsx(us.div,{...e,ref:i})});YJ.displayName=ZJ;function WJ(e,t=globalThis?.document){const n=Pf(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const a=u=>{if(u.target&&!r.current){let d=function(){m5(GJ,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},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function QJ(e,t=globalThis?.document){const n=Pf(e),r=b.useRef(!1);return b.useEffect(()=>{const i=a=>{a.target&&!r.current&&m5(VJ,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 rz(){const e=new CustomEvent(r1);document.dispatchEvent(e)}function m5(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?qJ(i,a):i.dispatchEvent(a)}var Ex="focusScope.autoFocusOnMount",zx="focusScope.autoFocusOnUnmount",iz={bubbles:!1,cancelable:!0},XJ="FocusScope",g5=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[u,d]=b.useState(null),f=Pf(i),p=Pf(a),m=b.useRef(null),y=ql(t,S=>d(S)),v=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let S=function(_){if(v.paused||!u)return;const C=_.target;u.contains(C)?m.current=C:Gs(m.current,{select:!0})},j=function(_){if(v.paused||!u)return;const C=_.relatedTarget;C!==null&&(u.contains(C)||Gs(m.current,{select:!0}))},k=function(_){if(document.activeElement===document.body)for(const P of _)P.removedNodes.length>0&&Gs(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",j);const A=new MutationObserver(k);return u&&A.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",j),A.disconnect()}}},[r,u,v.paused]),b.useEffect(()=>{if(u){sz.add(v);const S=document.activeElement;if(!u.contains(S)){const k=new CustomEvent(Ex,iz);u.addEventListener(Ex,f),u.dispatchEvent(k),k.defaultPrevented||(JJ(iee(y5(u)),{select:!0}),document.activeElement===S&&Gs(u))}return()=>{u.removeEventListener(Ex,f),setTimeout(()=>{const k=new CustomEvent(zx,iz);u.addEventListener(zx,p),u.dispatchEvent(k),k.defaultPrevented||Gs(S??document.body,{select:!0}),u.removeEventListener(zx,p),sz.remove(v)},0)}}},[u,f,p,v]);const w=b.useCallback(S=>{if(!n&&!r||v.paused)return;const j=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,k=document.activeElement;if(j&&k){const A=S.currentTarget,[_,C]=eee(A);_&&C?!S.shiftKey&&k===C?(S.preventDefault(),n&&Gs(_,{select:!0})):S.shiftKey&&k===_&&(S.preventDefault(),n&&Gs(C,{select:!0})):k===A&&S.preventDefault()}},[n,r,v.paused]);return c.jsx(us.div,{tabIndex:-1,...o,ref:y,onKeyDown:w})});g5.displayName=XJ;function JJ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Gs(r,{select:t}),document.activeElement!==n)return}function eee(e){const t=y5(e),n=az(t,e),r=az(t.reverse(),e);return[n,r]}function y5(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 az(e,t){for(const n of e)if(!tee(n,{upTo:t}))return n}function tee(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 nee(e){return e instanceof HTMLInputElement&&"select"in e}function Gs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&nee(e)&&t&&e.select()}}var sz=ree();function ree(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=oz(e,t),e.unshift(t)},remove(t){e=oz(e,t),e[0]?.resume()}}}function oz(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function iee(e){return e.filter(t=>t.tagName!=="A")}var aee="Portal",v5=b.forwardRef((e,t)=>{const{container:n,...r}=e,[i,a]=b.useState(!1);Tf(()=>a(!0),[]);const o=n||i&&globalThis?.document?.body;return o?iK.createPortal(c.jsx(us.div,{...r,ref:t}),o):null});v5.displayName=aee;function see(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var Vy=e=>{const{present:t,children:n}=e,r=oee(t),i=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),a=ql(r.ref,lee(i));return typeof n=="function"||r.isPresent?b.cloneElement(i,{ref:a}):null};Vy.displayName="Presence";function oee(e){const[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),a=b.useRef("none"),o=e?"mounted":"unmounted",[u,d]=see(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const f=cm(r.current);a.current=u==="mounted"?f:"none"},[u]),Tf(()=>{const f=r.current,p=i.current;if(p!==e){const y=a.current,v=cm(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&y!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),Tf(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,m=v=>{const S=cm(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&S&&(d("ANIMATION_END"),!i.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},y=v=>{v.target===t&&(a.current=cm(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:b.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function cm(e){return e?.animationName||"none"}function lee(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 Tx=0;function cee(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??lz()),document.body.insertAdjacentElement("beforeend",e[1]??lz()),Tx++,()=>{Tx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Tx--}},[])}function lz(){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 b5(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 uee(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 Zm="right-scroll-bar-position",Ym="width-before-scroll-bar",dee="with-scroll-bars-hidden",fee="--removed-body-scroll-bar-size";function Px(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function hee(e,t){var n=b.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 pee=typeof window<"u"?b.useLayoutEffect:b.useEffect,cz=new WeakMap;function mee(e,t){var n=hee(null,function(r){return e.forEach(function(i){return Px(i,r)})});return pee(function(){var r=cz.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(u){a.has(u)||Px(u,null)}),a.forEach(function(u){i.has(u)||Px(u,o)})}cz.set(n,e)},[e]),n}function gee(e){return e}function yee(e,t){t===void 0&&(t=gee);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(u){return u!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(u){return a(u)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var u=n;n=[],u.forEach(a),o=n}var d=function(){var p=o;o=[],p.forEach(a)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){o.push(p),f()},filter:function(p){return o=o.filter(p),n}}}};return i}function vee(e){e===void 0&&(e={});var t=yee(null);return t.options=da({async:!0,ssr:!1},e),t}var x5=function(e){var t=e.sideCar,n=b5(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 b.createElement(r,da({},n))};x5.isSideCarExport=!0;function bee(e,t){return e.useMedium(t),x5}var w5=vee(),Rx=function(){},Zy=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:Rx,onWheelCapture:Rx,onTouchMoveCapture:Rx}),i=r[0],a=r[1],o=e.forwardProps,u=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,y=e.sideCar,v=e.noRelative,w=e.noIsolation,S=e.inert,j=e.allowPinchZoom,k=e.as,A=k===void 0?"div":k,_=e.gapMode,C=b5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=y,E=mee([n,t]),O=da(da({},C),i);return b.createElement(b.Fragment,null,p&&b.createElement(P,{sideCar:w5,removeScrollBar:f,shards:m,noRelative:v,noIsolation:w,inert:S,setCallbacks:a,allowPinchZoom:!!j,lockRef:n,gapMode:_}),o?b.cloneElement(b.Children.only(u),da(da({},O),{ref:E})):b.createElement(A,da({},O,{className:d,ref:E}),u))});Zy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zy.classNames={fullWidth:Ym,zeroRight:Zm};var xee=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function wee(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=xee();return t&&e.setAttribute("nonce",t),e}function See(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function jee(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Nee=function(){var e=0,t=null;return{add:function(n){e==0&&(t=wee())&&(See(t,n),jee(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},kee=function(){var e=Nee();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},S5=function(){var e=kee(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Cee={left:0,top:0,right:0,gap:0},Mx=function(e){return parseInt(e||"",10)||0},_ee=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[Mx(n),Mx(r),Mx(i)]},Aee=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Cee;var t=_ee(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])}},Oee=S5(),su="data-scroll-locked",Eee=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,u=e.gap;return n===void 0&&(n="margin"),`
52
+ .`.concat(dee,` {
53
+ overflow: hidden `).concat(r,`;
54
+ padding-right: `).concat(u,"px ").concat(r,`;
55
+ }
56
+ body[`).concat(su,`] {
57
+ overflow: hidden `).concat(r,`;
58
+ overscroll-behavior: contain;
59
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
60
+ padding-left: `.concat(i,`px;
61
+ padding-top: `).concat(a,`px;
62
+ padding-right: `).concat(o,`px;
63
+ margin-left:0;
64
+ margin-top:0;
65
+ margin-right: `).concat(u,"px ").concat(r,`;
66
+ `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
67
+ }
68
+
69
+ .`).concat(Zm,` {
70
+ right: `).concat(u,"px ").concat(r,`;
71
+ }
72
+
73
+ .`).concat(Ym,` {
74
+ margin-right: `).concat(u,"px ").concat(r,`;
75
+ }
76
+
77
+ .`).concat(Zm," .").concat(Zm,` {
78
+ right: 0 `).concat(r,`;
79
+ }
80
+
81
+ .`).concat(Ym," .").concat(Ym,` {
82
+ margin-right: 0 `).concat(r,`;
83
+ }
84
+
85
+ body[`).concat(su,`] {
86
+ `).concat(fee,": ").concat(u,`px;
87
+ }
88
+ `)},uz=function(){var e=parseInt(document.body.getAttribute(su)||"0",10);return isFinite(e)?e:0},zee=function(){b.useEffect(function(){return document.body.setAttribute(su,(uz()+1).toString()),function(){var e=uz()-1;e<=0?document.body.removeAttribute(su):document.body.setAttribute(su,e.toString())}},[])},Tee=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;zee();var a=b.useMemo(function(){return Aee(i)},[i]);return b.createElement(Oee,{styles:Eee(a,!t,i,n?"":"!important")})},i1=!1;if(typeof window<"u")try{var um=Object.defineProperty({},"passive",{get:function(){return i1=!0,!0}});window.addEventListener("test",um,um),window.removeEventListener("test",um,um)}catch{i1=!1}var Pc=i1?{passive:!1}:!1,Pee=function(e){return e.tagName==="TEXTAREA"},j5=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Pee(e)&&n[t]==="visible")},Ree=function(e){return j5(e,"overflowY")},Mee=function(e){return j5(e,"overflowX")},dz=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=N5(e,r);if(i){var a=k5(e,r),o=a[1],u=a[2];if(o>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Dee=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Iee=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},N5=function(e,t){return e==="v"?Ree(t):Mee(t)},k5=function(e,t){return e==="v"?Dee(t):Iee(t)},Lee=function(e,t){return e==="h"&&t==="rtl"?-1:1},$ee=function(e,t,n,r,i){var a=Lee(e,window.getComputedStyle(t).direction),o=a*r,u=n.target,d=t.contains(u),f=!1,p=o>0,m=0,y=0;do{if(!u)break;var v=k5(e,u),w=v[0],S=v[1],j=v[2],k=S-j-a*w;(w||k)&&N5(e,u)&&(m+=k,y+=w);var A=u.parentNode;u=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(p&&Math.abs(m)<1||!p&&Math.abs(y)<1)&&(f=!0),f},dm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fz=function(e){return[e.deltaX,e.deltaY]},hz=function(e){return e&&"current"in e?e.current:e},Bee=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Uee=function(e){return`
89
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
90
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
91
+ `)},Fee=0,Rc=[];function qee(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(Fee++)[0],a=b.useState(S5)[0],o=b.useRef(e);b.useEffect(function(){o.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=uee([e.lockRef.current],(e.shards||[]).map(hz),!0).filter(Boolean);return S.forEach(function(j){return j.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=b.useCallback(function(S,j){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!o.current.allowPinchZoom;var k=dm(S),A=n.current,_="deltaX"in S?S.deltaX:A[0]-k[0],C="deltaY"in S?S.deltaY:A[1]-k[1],P,E=S.target,O=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in S&&O==="h"&&E.type==="range")return!1;var T=window.getSelection(),M=T&&T.anchorNode,q=M?M===E||M.contains(E):!1;if(q)return!1;var $=dz(O,E);if(!$)return!0;if($?P=O:(P=O==="v"?"h":"v",$=dz(O,E)),!$)return!1;if(!r.current&&"changedTouches"in S&&(_||C)&&(r.current=P),!P)return!0;var L=r.current||P;return $ee(L,j,S,L==="h"?_:C)},[]),d=b.useCallback(function(S){var j=S;if(!(!Rc.length||Rc[Rc.length-1]!==a)){var k="deltaY"in j?fz(j):dm(j),A=t.current.filter(function(P){return P.name===j.type&&(P.target===j.target||j.target===P.shadowParent)&&Bee(P.delta,k)})[0];if(A&&A.should){j.cancelable&&j.preventDefault();return}if(!A){var _=(o.current.shards||[]).map(hz).filter(Boolean).filter(function(P){return P.contains(j.target)}),C=_.length>0?u(j,_[0]):!o.current.noIsolation;C&&j.cancelable&&j.preventDefault()}}},[]),f=b.useCallback(function(S,j,k,A){var _={name:S,delta:j,target:k,should:A,shadowParent:Hee(k)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),p=b.useCallback(function(S){n.current=dm(S),r.current=void 0},[]),m=b.useCallback(function(S){f(S.type,fz(S),S.target,u(S,e.lockRef.current))},[]),y=b.useCallback(function(S){f(S.type,dm(S),S.target,u(S,e.lockRef.current))},[]);b.useEffect(function(){return Rc.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:y}),document.addEventListener("wheel",d,Pc),document.addEventListener("touchmove",d,Pc),document.addEventListener("touchstart",p,Pc),function(){Rc=Rc.filter(function(S){return S!==a}),document.removeEventListener("wheel",d,Pc),document.removeEventListener("touchmove",d,Pc),document.removeEventListener("touchstart",p,Pc)}},[]);var v=e.removeScrollBar,w=e.inert;return b.createElement(b.Fragment,null,w?b.createElement(a,{styles:Uee(i)}):null,v?b.createElement(Tee,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Hee(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Kee=bee(w5,qee);var C5=b.forwardRef(function(e,t){return b.createElement(Zy,da({},e,{ref:t,sideCar:Kee}))});C5.classNames=Zy.classNames;var Gee=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Mc=new WeakMap,fm=new WeakMap,hm={},Dx=0,_5=function(e){return e&&(e.host||_5(e.parentNode))},Vee=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=_5(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})},Zee=function(e,t,n,r){var i=Vee(t,Array.isArray(e)?e:[e]);hm[n]||(hm[n]=new WeakMap);var a=hm[n],o=[],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(y){if(u.has(y))p(y);else try{var v=y.getAttribute(r),w=v!==null&&v!=="false",S=(Mc.get(y)||0)+1,j=(a.get(y)||0)+1;Mc.set(y,S),a.set(y,j),o.push(y),S===1&&w&&fm.set(y,!0),j===1&&y.setAttribute(n,"true"),w||y.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",y,k)}})};return p(t),u.clear(),Dx++,function(){o.forEach(function(m){var y=Mc.get(m)-1,v=a.get(m)-1;Mc.set(m,y),a.set(m,v),y||(fm.has(m)||m.removeAttribute(r),fm.delete(m)),v||m.removeAttribute(n)}),Dx--,Dx||(Mc=new WeakMap,Mc=new WeakMap,fm=new WeakMap,hm={})}},Yee=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=Gee(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Zee(r,i,n,"aria-hidden")):function(){return null}},Yy="Dialog",[A5]=OJ(Yy),[Wee,Qi]=A5(Yy),O5=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,u=b.useRef(null),d=b.useRef(null),[f,p]=RJ({prop:r,defaultProp:i??!1,onChange:a,caller:Yy});return c.jsx(Wee,{scope:t,triggerRef:u,contentRef:d,contentId:Ox(),titleId:Ox(),descriptionId:Ox(),open:f,onOpenChange:p,onOpenToggle:b.useCallback(()=>p(m=>!m),[p]),modal:o,children:n})};O5.displayName=Yy;var E5="DialogTrigger",Qee=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qi(E5,n),a=ql(t,i.triggerRef);return c.jsx(us.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":cN(i.open),...r,ref:a,onClick:lo(e.onClick,i.onOpenToggle)})});Qee.displayName=E5;var oN="DialogPortal",[Xee,z5]=A5(oN,{forceMount:void 0}),T5=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Qi(oN,t);return c.jsx(Xee,{scope:t,forceMount:n,children:b.Children.map(r,o=>c.jsx(Vy,{present:n||a.open,children:c.jsx(v5,{asChild:!0,container:i,children:o})}))})};T5.displayName=oN;var _g="DialogOverlay",P5=b.forwardRef((e,t)=>{const n=z5(_g,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Qi(_g,e.__scopeDialog);return a.modal?c.jsx(Vy,{present:r||a.open,children:c.jsx(ete,{...i,ref:t})}):null});P5.displayName=_g;var Jee=f5("DialogOverlay.RemoveScroll"),ete=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qi(_g,n);return c.jsx(C5,{as:Jee,allowPinchZoom:!0,shards:[i.contentRef],children:c.jsx(us.div,{"data-state":cN(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),El="DialogContent",R5=b.forwardRef((e,t)=>{const n=z5(El,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Qi(El,e.__scopeDialog);return c.jsx(Vy,{present:r||a.open,children:a.modal?c.jsx(tte,{...i,ref:t}):c.jsx(nte,{...i,ref:t})})});R5.displayName=El;var tte=b.forwardRef((e,t)=>{const n=Qi(El,e.__scopeDialog),r=b.useRef(null),i=ql(t,n.contentRef,r);return b.useEffect(()=>{const a=r.current;if(a)return Yee(a)},[]),c.jsx(M5,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:lo(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:lo(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,u=o.button===0&&o.ctrlKey===!0;(o.button===2||u)&&a.preventDefault()}),onFocusOutside:lo(e.onFocusOutside,a=>a.preventDefault())})}),nte=b.forwardRef((e,t)=>{const n=Qi(El,e.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return c.jsx(M5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;n.triggerRef.current?.contains(o)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),M5=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,u=Qi(El,n),d=b.useRef(null),f=ql(t,d);return cee(),c.jsxs(c.Fragment,{children:[c.jsx(g5,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:c.jsx(p5,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":cN(u.open),...o,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(rte,{titleId:u.titleId}),c.jsx(ate,{contentRef:d,descriptionId:u.descriptionId})]})]})}),lN="DialogTitle",D5=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qi(lN,n);return c.jsx(us.h2,{id:i.titleId,...r,ref:t})});D5.displayName=lN;var I5="DialogDescription",L5=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qi(I5,n);return c.jsx(us.p,{id:i.descriptionId,...r,ref:t})});L5.displayName=I5;var $5="DialogClose",B5=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Qi($5,n);return c.jsx(us.button,{type:"button",...r,ref:t,onClick:lo(e.onClick,()=>i.onOpenChange(!1))})});B5.displayName=$5;function cN(e){return e?"open":"closed"}var U5="DialogTitleWarning",[Rke,F5]=AJ(U5,{contentName:El,titleName:lN,docsSlug:"dialog"}),rte=({titleId:e})=>{const t=F5(U5),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
92
+
93
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
94
+
95
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ite="DialogDescriptionWarning",ate=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${F5(ite).contentName}}.`;return b.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},q5=O5,H5=T5,uN=P5,dN=R5,fN=D5,K5=L5,G5=B5;const ste=q5,ote=H5,V5=b.forwardRef(({className:e,...t},n)=>c.jsx(uN,{ref:n,className:Ti("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));V5.displayName=uN.displayName;const lte=400,cte=1200,ute=720,Z5=b.forwardRef(({className:e,children:t,...n},r)=>{const[i,a]=b.useState(ute),o=b.useRef(!1),u=b.useRef(0),d=b.useRef(0),f=b.useCallback(y=>{o.current=!0,u.current=y.clientX,d.current=i,y.target.setPointerCapture(y.pointerId),y.preventDefault()},[i]),p=b.useCallback(y=>{if(!o.current)return;const v=u.current-y.clientX,w=Math.min(cte,Math.max(lte,d.current+v));a(w)},[]),m=b.useCallback(()=>{o.current=!1},[]);return c.jsxs(ote,{children:[c.jsx(V5,{}),c.jsxs(dN,{ref:r,className:Ti("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:[c.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,c.jsxs(G5,{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:[c.jsx(ih,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Z5.displayName=dN.displayName;const dte=({className:e,...t})=>c.jsx("div",{className:Ti("flex flex-col gap-1.5 pr-10",e),...t}),Y5=b.forwardRef(({className:e,...t},n)=>c.jsx(fN,{ref:n,className:Ti("text-lg font-medium text-zinc-50",e),...t}));Y5.displayName=fN.displayName;const W5=b.forwardRef(({className:e,...t},n)=>c.jsx(K5,{ref:n,className:Ti("text-sm text-zinc-500",e),...t}));W5.displayName=K5.displayName;function fte({title:e,subtitle:t,children:n,open:r,onClose:i}){return c.jsx(ste,{open:r,onOpenChange:a=>a?void 0:i(),children:c.jsxs(Z5,{children:[c.jsxs(dte,{className:"drawer-head",children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),c.jsx(Y5,{id:"drawer-title",children:e}),c.jsx(W5,{className:"sr-only",children:t})]}),c.jsx("div",{className:"drawer-body",children:n})]})})}function Wn({text:e}){const[t,n]=b.useState(null),r=b.useRef(null),i=b.useCallback(()=>{if(!r.current)return;const o=r.current.getBoundingClientRect();n({top:o.top,left:o.left+o.width/2})},[]),a=b.useCallback(()=>n(null),[]);return c.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,children:[c.jsxs("svg",{ref:r,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[c.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),c.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),t!==null&&Ul.createPortal(c.jsx("span",{role:"tooltip",style:{position:"fixed",top:t.top,left:t.left,transform:"translateX(-50%) translateY(calc(-100% - 8px))",zIndex:9999,pointerEvents:"none",width:"14rem",padding:"0.5rem 0.75rem",fontSize:"11px",fontWeight:400,textTransform:"none",letterSpacing:"normal",lineHeight:"1rem",color:"#d4d4d8",backgroundColor:"#18181b",border:"1px solid rgba(63, 63, 70, 0.6)",borderRadius:"0.5rem",boxShadow:"0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1)"},children:e}),document.body)]})}function pz(e,t){const n=hte(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"?Hi.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const o=[...i].sort((f,p)=>p.length-f.length).map(f=>f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),u=new RegExp(`(${o.join("|")})`,"gi"),d=new Map;for(const f of n)for(const p of f.terms){const m=p.toLowerCase();d.has(m)||d.set(m,f.className)}return r.flatMap((f,p)=>f.value.split(u).map((y,v)=>{if(!y)return null;if(v%2===1){const S=d.get(y.toLowerCase())??"answer-highlight";return f.type==="bold"?Hi.createElement("mark",{key:`hl-${p}-${v}`,className:S},Hi.createElement("strong",{className:"text-zinc-200 font-semibold"},y)):Hi.createElement("mark",{key:`hl-${p}-${v}`,className:S},y)}return f.type==="bold"?Hi.createElement("strong",{key:`b-${p}-${v}`,className:"text-zinc-200 font-semibold"},y):y})).filter(Boolean)}function hte(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Ix(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 pte({evidence:e,project:t,onClose:n}){const[r,i]=b.useState(!1),[a,o]=b.useState("mentions"),[u,d]=b.useState(-1),[f,p]=b.useState(null),[m,y]=b.useState(!1),[v,w]=b.useState({}),S=EQ(t.project),j=new Set(S.map(XS)),k=e.runHistory,A=k.length>1,[_,C]=b.useState(null),P=b.useRef(!1);b.useEffect(()=>{if(P.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const Y=k.at(-1);Y&&(P.current=!0,Al(Y.runId).then(se=>{const ie=se.snapshots.find(fe=>fe.keyword===e.keyword&&fe.provider===e.provider);ie&&C({citationState:ie.citationState,answerMentioned:ie.answerMentioned,visibilityState:ie.visibilityState,visibilityTransition:Y.visibilityTransition,provider:ie.provider,model:ie.model??e.model,answerSnippet:ie.answerText??e.answerSnippet,citedDomains:ie.citedDomains??e.citedDomains,competitorDomains:ie.competitorOverlap??e.competitorDomains,recommendedCompetitors:ie.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:ie.matchedTerms??e.matchedTerms??[],groundingSources:ie.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,k]);const E=u>=0&&f!==null,O=E?f:_||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:k.at(-1)?.visibilityTransition,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,recommendedCompetitors:e.recommendedCompetitors??[],matchedTerms:e.matchedTerms??[],groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},T=O.visibilityState==="pending"||O.citationState==="pending",M=T?!1:O.visibilityState!=null?O.visibilityState==="visible":O.answerMentioned!=null?O.answerMentioned:O.citationState==="cited"||O.citationState==="emerging",q=O.answerMentioned!=null||O.visibilityState!=null||O.recommendedCompetitors.length>0,$=O.citedDomains.length>0||O.groundingSources.length>0||O.evidenceUrls.length>0,L=t.project.displayName||t.project.name,J=[...S.map(XS),L,L.split(" ").slice(0,2).join(" "),...O.matchedTerms].filter(Y=>Y.trim().length>2),ae=[...O.competitorDomains.flatMap(Y=>{const se=Y.split(".")[0];return se&&se.length>=4?[se]:[]}),...O.recommendedCompetitors].filter(Y=>Y.trim().length>2),Z=[{terms:J,className:"answer-highlight-brand"},...ae.length>0?[{terms:ae,className:"answer-highlight-competitor"}]:[]],H=T?"pending":O.visibilityTransition==="lost"?"lost":M?"cited":"not-cited",Q=b.useRef(0),he=b.useCallback(async Y=>{const se=++Q.current;if(Y===-1||Y===k.length-1){d(-1),p(null),i(!1);return}d(Y),i(!1);const ie=k[Y],fe=`${ie.runId}::${e.keyword}::${e.provider}`;if(v[fe]){p(v[fe]);return}y(!0);try{const je=await Al(ie.runId);if(se!==Q.current)return;const ee=je.snapshots.find(Ae=>Ae.keyword===e.keyword&&Ae.provider===e.provider)??je.snapshots.find(Ae=>Ae.keyword===e.keyword),ue=ee?{citationState:ee.citationState,answerMentioned:ee.answerMentioned,visibilityState:ee.visibilityState,visibilityTransition:ie.visibilityTransition,provider:ee.provider,model:ee.model??null,answerSnippet:ee.answerText??"",citedDomains:ee.citedDomains,competitorDomains:ee.competitorOverlap,recommendedCompetitors:ee.recommendedCompetitors??[],matchedTerms:ee.matchedTerms??[],groundingSources:ee.groundingSources,evidenceUrls:[],changeLabel:Ix(ie.visibilityTransition,ie.visibilityState),summary:""}:{citationState:ie.citationState,answerMentioned:ie.answerMentioned,visibilityState:ie.visibilityState,visibilityTransition:ie.visibilityTransition,provider:e.provider,model:ie.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Ix(ie.visibilityTransition,ie.visibilityState),summary:"Snapshot data not available for this run."};w(Ae=>({...Ae,[fe]:ue})),p(ue)}catch{if(se!==Q.current)return;p({citationState:ie.citationState,answerMentioned:ie.answerMentioned,visibilityState:ie.visibilityState,visibilityTransition:ie.visibilityTransition,provider:e.provider,model:ie.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Ix(ie.visibilityTransition,ie.visibilityState),summary:"Failed to load historical run data."})}finally{se===Q.current&&y(!1)}},[k,e.keyword,e.provider,v]),R=(E||e.historyScope!=="provider")&&O.model?`${O.provider} (${O.model}) · ${O.changeLabel.toLowerCase()}`:`${O.provider} · ${O.changeLabel.toLowerCase()}`,U=!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(" · "):"",F=M?{label:"Visible in answer",title:"Your brand or domain is mentioned in this answer",meta:R}:O.visibilityTransition==="lost"?{label:"Visibility lost",title:"Your brand no longer appears in this answer",meta:R}:T?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not visible in answer",title:"Your brand or domain was not mentioned in this answer",meta:R},D=()=>{if(!O.answerSnippet)return null;const Y=O.answerSnippet.split(`
96
+ `),se=[];let ie=[],fe=0;const je=()=>{if(ie.length===0)return;const ee=ie.join(" ").trim();ee&&se.push(c.jsx("p",{className:se.length>0?"mt-2.5":"",children:pz(ee,Z)},fe++)),ie=[]};for(const ee of Y){const ue=ee.trim();if(/^[-\u2013\u2014]{3,}$/.test(ue)){je(),se.push(c.jsx("hr",{className:"border-zinc-800/60 my-3"},fe++));continue}const Ae=ue.match(/^(#{1,3})\s+(.+)$/);if(Ae){je();const W=Ae[1].length,Ke=Ae[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||Ae[2],Re=W===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":W===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";se.push(c.jsx("p",{className:Re,children:pz(Ke,Z)},fe++));continue}if(ue===""){je();continue}ie.push(ue)}return je(),se};return c.jsx(q5,{open:!0,onOpenChange:Y=>{Y||n()},children:c.jsxs(H5,{children:[c.jsx(uN,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),c.jsxs(dN,{className:"evidence-modal","aria-describedby":void 0,children:[c.jsxs("div",{className:"evidence-modal-header",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," ","·"," ",O.provider||"All providers"]}),c.jsx(fN,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),c.jsxs(G5,{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:[c.jsx(ih,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]}),A&&c.jsxs("div",{className:"evidence-modal-timeline",children:[c.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),c.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:k.map((Y,se)=>{const ie=u===-1&&se===k.length-1||u===se,fe=Y.visibilityState??(Y.answerMentioned?"visible":"not-visible"),je=Y.visibilityTransition??fe,ee=fe==="visible"?"bg-emerald-400":je==="emerging"?"bg-amber-400":je==="lost"?"bg-rose-400":"bg-zinc-600",Ae=new Date(Y.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),W=!!(Y.model&&se>0&&k[se-1]?.model&&k[se-1].model!==Y.model);return c.jsxs("button",{type:"button",className:`evidence-run-dot ${ie?"evidence-run-dot--selected":""}`,onClick:()=>he(se===k.length-1?-1:se),"aria-label":[`Run ${Ae}: ${fe}`,Y.model?`model ${Y.model}`:null,W?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ie,children:[c.jsx("span",{className:`size-2 rounded-full ${ee} ${W?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),c.jsx("span",{className:"text-[10px] text-zinc-500",children:Ae})]},se)})}),u>=0&&u<k.length&&c.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(k[u].createdAt).toLocaleString()," ","—"," ",c.jsx("span",{className:"capitalize",children:k[u].visibilityState??(k[u].answerMentioned?"visible":"not-visible")}),c.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>he(-1),children:["←"," Back to latest"]})]}),!E&&(e.modelTransitions?.length??0)>0&&c.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(Y=>c.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-400/30 bg-amber-400/10 px-2 py-1 text-[10px] text-amber-100",children:`${Y.fromModel??"unknown"} -> ${Y.toModel??"unknown"} on ${new Date(Y.createdAt).toLocaleDateString()}`},`${Y.runId}:${Y.toModel??"unknown"}`))})]}),c.jsxs("div",{className:"evidence-modal-body",children:[m&&c.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&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"evidence-modal-main",children:[c.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${H}`,children:[c.jsx("p",{className:`evidence-position-label evidence-position-label--${H}`,children:F.label}),c.jsx("p",{className:`evidence-position-title evidence-position-title--${H}`,children:F.title}),c.jsx("p",{className:"evidence-position-meta",children:F.meta}),U&&c.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:U})]}),O.answerSnippet&&c.jsxs("div",{children:[c.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),c.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:D()}),O.answerSnippet.length>280&&c.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"})]}),!O.answerSnippet&&!m&&c.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&&c.jsxs("div",{children:[c.jsx("p",{className:"drawer-section-label",children:M?"Why you're visible":"What to fix"}),c.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((Y,se)=>c.jsxs("div",{className:"action-item",children:[c.jsx("svg",{className:`action-item-icon ${M?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:M?c.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),c.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),c.jsx("span",{className:"action-item-text",children:Y})]},se))})]}),O.summary&&c.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:O.summary})]}),c.jsxs("div",{className:"evidence-modal-sidebar",children:[(q||$)&&c.jsxs("div",{className:"sidebar-tabs",children:[c.jsx("button",{className:`sidebar-tab ${a==="mentions"?"sidebar-tab--active":""}`,onClick:()=>o("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),c.jsx("button",{className:`sidebar-tab ${a==="sources"?"sidebar-tab--active":""}`,onClick:()=>o("sources"),type:"button",title:"Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.",children:"Sources"})]}),a==="mentions"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsxs("div",{className:"drawer-section-label flex items-center",children:[c.jsx("span",{children:"Answer visibility"}),c.jsx(Wn,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),c.jsxs("div",{className:`mention-status mention-status--${M?"visible":"not-visible"}`,children:[c.jsx("span",{className:"mention-status-icon",children:T?"…":M?"✓":"—"}),c.jsx("span",{className:"mention-status-label",children:T?"Pending":M?"Visible":"Not visible"})]}),O.matchedTerms.length>0&&c.jsxs("div",{className:"mt-2",children:[c.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:O.matchedTerms.map(Y=>c.jsx("span",{className:"mention-chip mention-chip--brand",children:Y},Y))})]}),!T&&!M&&O.matchedTerms.length===0&&c.jsxs("div",{className:"mt-2",children:[c.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:J.map(Y=>c.jsx("span",{className:"mention-chip mention-chip--muted",children:Y},Y))}),c.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(O.recommendedCompetitors.length>0||O.competitorDomains.length>0)&&c.jsxs("div",{children:[c.jsxs("div",{className:"drawer-section-label flex items-center",children:[c.jsx("span",{children:"Competitors in answer"}),c.jsx(Wn,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const Y=O.competitorDomains.map(fe=>fe.replace(/^www\./,"")),se=new Set(Y.map(fe=>F2(fe.replace(/\.[^.]+$/,""))));return[...O.recommendedCompetitors.filter(fe=>!se.has(F2(fe))),...Y].map(fe=>c.jsx("span",{className:"mention-chip mention-chip--competitor",children:fe},fe))})()})]})]}),a==="sources"&&c.jsxs(c.Fragment,{children:[O.citedDomains.length>0&&c.jsxs("div",{children:[c.jsxs("div",{className:"drawer-section-label flex items-center",children:[c.jsx("span",{children:"Domains from source links"}),c.jsx(Wn,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),c.jsx("div",{className:"citation-leaderboard",children:O.citedDomains.map((Y,se)=>{const ie=Y.toLowerCase().replace(/^www\./,""),fe=j.has(ie),je=!fe&&O.competitorDomains.some(ue=>ue.toLowerCase().replace(/^www\./,"")===ie),ee=fe?"you":je?"competitor":"other";return c.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${ee}`,children:[c.jsxs("span",{className:"citation-leaderboard-rank",children:["#",se+1]}),c.jsx("span",{className:"citation-leaderboard-domain",children:Y}),fe&&c.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),je&&c.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},Y)})})]}),O.groundingSources.length>0&&c.jsxs("div",{children:[c.jsxs("div",{className:"drawer-section-label flex items-center",children:[c.jsxs("span",{children:["Grounding source links (",O.groundingSources.length,")"]}),c.jsx(Wn,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),c.jsx("ul",{className:"grid gap-0.5",children:O.groundingSources.map((Y,se)=>c.jsx("li",{className:"truncate text-sm",children:c.jsx("a",{href:Y.uri,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Y.title||Y.uri})},se))})]}),O.evidenceUrls.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),c.jsx("ul",{className:"grid gap-1",children:O.evidenceUrls.map(Y=>c.jsx("li",{className:"truncate text-sm",children:c.jsx("a",{href:Y,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Y})},Y))})]}),O.citedDomains.length===0&&O.groundingSources.length===0&&O.evidenceUrls.length===0&&c.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",E?"for this run":"yet"]})]}),!q&&!$&&c.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 Fi(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 Lx=[{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 Wy(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 mte=Wy({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"}),gte=Wy({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"}),yte=Wy({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"}),vte=Wy({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"}),bte=[{id:"evidence_citypoint_emergency_gemini",keyword:"emergency dentist brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"lost",changeLabel:"Lost since Mar 5",answerSnippet:"For urgent dental care in Brooklyn, Downtown Smiles and Harbor Dental are now cited first for emergency availability and same-day booking.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:["https://downtownsmiles.com/emergency-dentist-brooklyn","https://harbordental.com/same-day-emergency-care"],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing on the emergency service page","llms.txt not found during latest site audit","Location pages link weakly into the emergency care hub"],summary:"AI answers now cite two competitors while your emergency page is no longer grounded.",runHistory:Fi(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",keyword:"emergency dentist brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"Cited for 6 runs",answerSnippet:"Citypoint Dental is listed as a top emergency dentist in Brooklyn for same-day appointments and walk-in availability.",citedDomains:["citypointdental.com","downtownsmiles.com"],evidenceUrls:["https://citypointdental.com/emergency-dentist-brooklyn"],competitorDomains:["downtownsmiles.com"],groundingSources:[],relatedTechnicalSignals:["Emergency page indexed with structured data"],summary:"OpenAI cites your emergency page consistently alongside one competitor.",runHistory:Fi(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",keyword:"emergency dentist brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"Based on the search results, top-rated emergency dental practices in Brooklyn include Downtown Smiles and Harbor Dental.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:[],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing","llms.txt not found"],summary:"Claude does not cite your domain for this emergency query.",runHistory:Fi(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_invisalign_openai",keyword:"best invisalign dentist downtown brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"First citation in 7 days",answerSnippet:"Citypoint Dental appears as an emerging recommendation for Invisalign in Downtown Brooklyn, supported by recent before-and-after case pages.",citedDomains:["citypointdental.com","clearlineortho.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn","https://citypointdental.com/case-studies/invisalign-open-bite"],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["Structured data now present on two case-study pages","Internal links from service pages to case studies improved crawl depth"],summary:"Fresh case-study content is starting to earn citations on Invisalign prompts.",runHistory:Fi(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",keyword:"best invisalign dentist downtown brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"cited",changeLabel:"Cited for 8 runs",answerSnippet:"Citypoint Dental in Downtown Brooklyn is highlighted for its Invisalign expertise and patient outcomes.",citedDomains:["citypointdental.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn"],competitorDomains:[],groundingSources:[],relatedTechnicalSignals:["Case study pages well-indexed"],summary:"Gemini consistently cites your Invisalign page with no competitor overlap.",runHistory:Fi(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",keyword:"best invisalign dentist downtown brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For Invisalign in Downtown Brooklyn, Clear Line Ortho and Brooklyn Smiles are frequently recommended for their experienced orthodontists.",citedDomains:["clearlineortho.com","brooklynsmiles.com"],evidenceUrls:[],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["No before/after schema on case study pages"],summary:"Claude does not surface your Invisalign content despite strong page quality.",runHistory:Fi(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_claude",keyword:"pediatric dentist brooklyn heights",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 4 runs",answerSnippet:"Answers cite neighborhood-specific pediatric practices with stronger family-focused FAQ content and clearer insurance details.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:["https://brightkidsdental.com/pediatric-dentist-brooklyn-heights","https://parkpediatricdental.com/insurance"],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric service page exists for Brooklyn Heights","Insurance content is buried three clicks deep"],summary:"Coverage gap is content-driven, not purely technical.",runHistory:Fi(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",keyword:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For pediatric dentistry in Brooklyn Heights, Bright Kids Dental and Park Pediatric Dental are cited for family-friendly care.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:[],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric page for Brooklyn Heights"],summary:"Gemini does not surface your domain for pediatric queries in this area.",runHistory:Fi(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_openai",keyword:"pediatric dentist brooklyn heights",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"First citation this month",answerSnippet:"Citypoint Dental is mentioned as offering pediatric services in Brooklyn, though specialized pediatric-only practices are also highlighted.",citedDomains:["citypointdental.com","brightkidsdental.com"],evidenceUrls:["https://citypointdental.com/family-dentistry"],competitorDomains:["brightkidsdental.com"],groundingSources:[],relatedTechnicalSignals:["Family dentistry page recently updated"],summary:"OpenAI recently started citing your family dentistry page for this query.",runHistory:Fi(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Lx[0],Lx[1],Fi(["cited","cited","cited","cited","cited"]),Lx[2],2/7,Fi(["not-cited","not-cited","not-cited","cited"]);function xte(e,t){return e.projects.find(n=>n.project.id===t)}function wte(e,t){return e.runs.find(n=>n.id===t)}function Ste(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 jte={regression:"negative",gain:"positive",opportunity:"caution"},Nte={regression:"lost",gain:"emerging",opportunity:"not-cited"},kte={regression:"Regression",gain:"Gain",opportunity:"Opportunity"};function Cte(e){return{id:e.id,tone:jte[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??kte[e.type],affectedPhrases:[{keyword:e.keyword,evidenceId:"",provider:e.provider,citationState:Nte[e.type]}]}}function _te(e){return e.filter(t=>!t.dismissed).map(Cte)}function Q5(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 a1(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function Ate(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 hN(e){switch(e){case sn["answer-visibility"]:return"Answer visibility sweep";case sn["gsc-sync"]:return"GSC sync";case sn["inspect-sitemap"]:return"Sitemap inspection";case sn["ga-sync"]:return"GA sync";case sn["bing-inspect"]:return"Bing URL inspection";case sn["site-audit"]:return"Site audit";case sn["backlink-extract"]:return"Backlink extract"}}function Ote(e){return e===Vm.manual?"Manual":e===Vm.scheduled?"Scheduled":e===Vm["config-apply"]?"Config apply":e}function pN(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:hN(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?a1(e.startedAt):a1(e.createdAt),duration:Ate(e.startedAt,e.finishedAt),statusDetail:e.error?X5(e.error):Ete(e),summary:zte(e),triggerLabel:Ote(e.trigger)}}function X5(e){try{const n=JSON.parse(e);if(typeof n=="object"&&n!==null){const r=n.message??n.error?.message??n[0]?.error?.message;if(typeof r=="string"&&r.length>0)return r.length>200?r.slice(0,200)+"…":r}}catch{}const t=e.match(/\[.*?\]\s*(.+)/);if(t){const n=t[1];return n.length>200?n.slice(0,200)+"…":n}return e.length>200?e.slice(0,200)+"…":e}function Ete(e){switch(e.status){case pn.queued:return"Waiting for execution slot.";case pn.running:return"Provider queries in progress.";case pn.completed:return"All key phrases checked.";case pn.partial:return"Run completed with some key phrases skipped.";case pn.failed:return e.error?X5(e.error):"Run failed.";case pn.cancelled:return"Run was cancelled.";default:return""}}function zte(e){const t=hN(e.kind);switch(e.status){case pn.queued:return`${t} queued`;case pn.running:return`${t} in progress`;case pn.completed:return`${t} completed`;case pn.partial:return`${t} partially completed`;case pn.failed:return`${t} failed`;case pn.cancelled:return`${t} cancelled`;default:return e.status}}function J5(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const a of e){const o=a.keyword??a.id;t.has(o)||t.set(o,!1),a.citationState==="cited"&&t.set(o,!0)}const n=t.size,r=[...t.values()].filter(Boolean).length;return{score:n>0?Math.round(r/n*100):0,citedCount:r,totalCount:n}}function e4(e){return e>=70?"positive":e>=40?"caution":"negative"}function Tte(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function Pte(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function Rte(e){if(e.length===0)return{label:"Gap Key Phrases",value:"No data",delta:"Run a sweep first",tone:"neutral",description:"Run a visibility sweep to identify key phrases where competitors are cited and your domain is not.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[]};const t=new Map;for(const a of e){const o=a.keywordId,u=t.get(o)??{cited:!1,competitorOverlap:new Set};a.citationState==="cited"&&(u.cited=!0);for(const d of a.competitorOverlap)u.competitorOverlap.add(d);t.set(o,u)}const n=t.size,r=[...t.values()].filter(a=>!a.cited&&a.competitorOverlap.size>0).length,i=r===1?"key phrase":"key phrases";return{label:"Gap Key Phrases",value:`${r}`,delta:`${r} of ${n} key phrases at risk`,tone:Pte(r,n),description:r>0?`${r} tracked ${i} currently cite competitors without citing your domain.`:"No competitive key phrase gaps detected in the latest visibility run.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[],progress:n>0?r/n:0}}function Mte(e,t){return e&&e.summary.total>0?{provider:"Google",...e.summary}:t&&t.summary.total>0?{provider:"Bing",...t.summary,deindexed:0}:e?{provider:"Google",...e.summary}:t?{provider:"Bing",...t.summary,deindexed:0}:null}function Dte(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function Ite(e,t){const n=Mte(e,t);if(!n||n.total===0)return{label:"Index Coverage",value:"No data",delta:"Connect GSC or Bing",tone:"neutral",description:"Connect Google Search Console or Bing Webmaster Tools and inspect your sitemap to populate coverage.",tooltip:"Percentage of inspected URLs currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used.",trend:[]};const r=n.notIndexed===1?"URL is":"URLs are",i=n.deindexed===1?"URL":"URLs";return{label:"Index Coverage",value:`${Math.round(n.percentage)}`,delta:`${n.provider} · ${n.indexed} of ${n.total} indexed`,tone:Dte(n),description:n.provider==="Google"&&n.deindexed>0?`${n.deindexed} deindexed ${i} detected in the latest Google Search Console inspection.`:`${n.notIndexed} ${r} not indexed in ${n.provider==="Google"?"Google Search Console":"Bing Webmaster Tools"}.`,tooltip:"Percentage of inspected URLs currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used.",trend:[]}}function t4(e,t){if(e.length===0||t.length===0)return{label:"None",count:0};const n=new Set(t);let r=0;for(const a of e)a.competitorOverlap.some(o=>n.has(o))&&r++;const i=r/e.length;return i>=.5?{label:"High",count:r}:i>=.2?{label:"Moderate",count:r}:{label:"Low",count:r}}function Lte(e,t,n,r){const i=[];let a=0;const o=new Set;if(n){const u=new Map;for(const y of n.snapshots)if(y.keyword){const v=`${y.keyword}::${y.provider}`;u.set(v,y)}const d=new Set(n.snapshots.map(y=>y.provider)),f=new Set(t.flatMap(y=>Object.keys(y.providerRuns??{}))),p=[...new Set([...d,...f])].sort(),m=p.length>0?p:["gemini"];for(const y of t){if(y.runs.length===0)continue;o.add(y.keyword);const v=y.runs.at(-1),w=v?.transition??"not-cited";for(const S of m){const j=u.get(`${y.keyword}::${S}`),k=(y.providerRuns?.[S]?.length??0)>0;if(!j&&!k)continue;const A=j?.model??null,_=A?`${S}:${A}`:null,C=_?y.modelRuns?.[_]:void 0,P=y.providerRuns?.[S],E=(P?.length?P:null)??(C?.length?C:null),O=P?.length?"provider":C?.length?"model":"keyword",T=E?E.at(-1).transition:w,M=E?E.at(-1).visibilityTransition??(E.at(-1).visibilityState==="visible"?"visible":"not-visible"):v?.visibilityTransition??(v?.visibilityState==="visible"?"visible":"not-visible"),q=E?.at(-1)?.citationState,$=E?.at(-1)?.visibilityState,L=j?T==="lost"?"lost":T==="emerging"?"emerging":j.citationState==="cited"?"cited":"not-cited":q==="cited"?"cited":"not-cited",J=j?.visibilityState??($==="visible"?"visible":$==="pending"?"pending":"not-visible"),ae=s1(E||y.runs),Z=mz(E||y.runs),H=$te(y,S),Q=(E??y.runs).map(U=>({runId:U.runId,citationState:U.citationState,createdAt:U.createdAt,model:H.get(U.runId)??null,answerMentioned:U.answerMentioned,visibilityState:U.visibilityState,visibilityTransition:U.visibilityTransition})),he=Bte(Q),we=O==="provider"&&he.length<=1?"model":O,R=Ute(Q);i.push({id:`evidence_${e}_${a++}`,keyword:y.keyword,provider:j?.provider??S,model:j?.model??null,location:j?.location??null,citationState:L,answerMentioned:j?.answerMentioned,visibilityState:J,visibilityChangeLabel:gz(M,Z,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:gz(T,ae),answerSnippet:j?.answerText??"",citedDomains:j?.citedDomains??[],evidenceUrls:[],competitorDomains:j?.competitorOverlap??[],recommendedCompetitors:j?.recommendedCompetitors??[],matchedTerms:j?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:j?.groundingSources??[],summary:Fte(J,M,y.keyword),runHistory:Q,historyScope:we,modelsSeen:he,modelTransitions:R})}}}for(const u of r)o.has(u.keyword)||i.push({id:`evidence_${e}_${a++}`,keyword:u.keyword,provider:"",model:null,location:null,citationState:"pending",visibilityState:"pending",visibilityChangeLabel:"Awaiting first run",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${u.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return i}function $te(e,t){const n=new Map,r=`${t}:`;for(const[i,a]of Object.entries(e.modelRuns??{})){if(!i.startsWith(r))continue;const o=i.slice(r.length),u=o==="unknown"?null:o;for(const d of a)n.set(d.runId,u)}return n}function Bte(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function Ute(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 s1(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 mz(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 gz(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?`${Gd(r.positive)} in latest run`:`${Gd(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return Gd(r.first);case"not-cited":case"not-visible":return t<=1?`${Gd(r.negative)} in latest run`:`${Gd(r.negative)} across ${t} runs`;default:return e}}function Gd(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Fte(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 yz(e,t){const n=new Set(t),r=new Map;for(const i of e)if(i.keyword)for(const a of i.competitorOverlap){if(!n.has(a))continue;const o=r.get(a)??new Set;o.add(i.keyword),r.set(a,o)}return r}const $x=3;function qte(e){const{evidence:t,timeline:n,latestSnapshots:r,previousSnapshots:i,trackedCompetitors:a}=e,o=[],u=[],d=new Set;for(const k of t)k.citationState==="lost"&&(d.has(k.keyword)||(d.add(k.keyword),u.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"lost"})));u.length>0&&o.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${u.length} key phrase${u.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:u});const f=yz(r,a),p=yz(i,a);for(const k of a){const A=f.get(k)??new Set,_=p.get(k)??new Set,C=[...A].filter(P=>!_.has(P));C.length>0&&o.push({id:`insight_comp_gained_${k}`,tone:"negative",title:`${k} appeared on ${C.length} key phrase${C.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:C.map(P=>{const E=t.find(O=>O.keyword===P);return{keyword:P,evidenceId:E?.id??"",citationState:"cited"}})})}const m=new Map;for(const k of n){const A=k.runs.at(-1);A&&m.set(k.keyword,{transition:A.transition,citationState:A.citationState})}const y=[],v=[],w=new Set;for(const[k,{transition:A,citationState:_}]of m){if(!(A==="emerging"||A==="new"&&_==="cited"))continue;w.add(k);const P=t.find(E=>E.keyword===k&&(E.citationState==="emerging"||E.citationState==="cited"));y.push({keyword:k,evidenceId:P?.id??"",provider:P?.provider,citationState:"emerging"})}for(const k of t)k.citationState==="emerging"&&(w.has(k.keyword)||v.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"emerging"}));if(v.length>0){const k=new Set(v.map(A=>A.keyword)).size;o.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${k} key phrase${k>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:v})}y.length>0&&o.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${w.size} key phrase${w.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:y});const S=new Set(t.map(k=>k.keyword)),j=[];for(const k of n){if(!S.has(k.keyword)||k.runs.length<$x||k.runs.at(-1)?.citationState!=="not-cited")continue;if(s1(k.runs)>=$x){const C=t.find(P=>P.keyword===k.keyword);j.push({keyword:k.keyword,evidenceId:C?.id??"",citationState:"not-cited"})}}j.length>0&&o.push({id:"insight_persistent_gap",tone:"caution",title:`${j.length} key phrase${j.length>1?"s":""} uncited for ${$x}+ runs`,detail:"These key phrases have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:j});for(const k of a){const A=f.get(k)??new Set,C=[...p.get(k)??new Set].filter(P=>!A.has(P));C.length>0&&o.push({id:`insight_comp_lost_${k}`,tone:"neutral",title:`${k} dropped from ${C.length} key phrase${C.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:C.map(P=>{const E=t.find(O=>O.keyword===P);return{keyword:P,evidenceId:E?.id??"",citationState:"not-cited"}})})}return o.length===0&&o.push({id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}),o}function Hte(e,t){const n=e.filter(i=>i.id!=="insight_lost"&&i.id!=="insight_stable"),r=[...t,...n];return r.length===0?[{id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}]:r}function Kte(e,t){if(t.length===0){const d=new Set(e.filter(f=>f.citationState==="cited").map(f=>f.keyword)).size;return{gained:d,lost:0,tone:d>0?"positive":"neutral",hasPreviousRun:!1}}const n=d=>{const f=new Set;for(const p of d)p.citationState==="cited"&&p.keyword&&f.add(p.keyword);return f},r=n(e),i=n(t);let a=0,o=0;for(const d of r)i.has(d)||a++;for(const d of i)r.has(d)||o++;const u=o>a?"negative":a>o?"positive":"neutral";return{gained:a,lost:o,tone:u,hasPreviousRun:!0}}function Gte(e){if(e.length===0)return{label:"Run Status",value:"None",delta:"No runs yet",tone:"neutral",description:"Trigger a visibility sweep to start tracking.",tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]};const n=e.find(d=>d.kind===sn["answer-visibility"])??e[0],r=n.status===pn.completed?"Healthy":n.status===pn.running?"Running":n.status===pn.queued?"Queued":n.status===pn.partial?"Partial":"Failed",i=n.status===pn.completed?"positive":n.status===pn.failed?"negative":n.status===pn.partial?"caution":"neutral",a=e.filter(d=>d.kind===sn["answer-visibility"]).length,o=e.length-a,u=o>0?`${a} ${a===1?"sweep":"sweeps"} · ${o} ${o===1?"sync":"syncs"}`:`${e.length} total runs`;return{label:"Run Status",value:r,delta:u,tone:i,description:`Latest: ${hN(n.kind)} — ${n.status}`,tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]}}function Vte(e){const t=Q5(e.project),n=Lte(t.name,e.timeline,e.latestRunDetail,e.keywords),r=e.runs.filter(O=>O.kind===sn["answer-visibility"]).sort((O,T)=>T.createdAt.localeCompare(O.createdAt))[0],i=r&&e.latestRunDetail?.id===r.id?e.latestRunDetail.snapshots:[],a=J5(i),o=Rte(i),u=Ite(e.gscCoverage,e.bingCoverage),d=t4(i,e.competitors.map(O=>O.domain)),f=qte({evidence:n,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(O=>O.domain)}),p=e.dbInsights!=null?_te(e.dbInsights):null,m=p!=null?Hte(f,p):f,y=[...e.runs].sort((O,T)=>T.createdAt.localeCompare(O.createdAt)),v=y.find(O=>O.kind===sn["answer-visibility"]),w=y.find(O=>O.kind!==sn["answer-visibility"]);if(v&&w){const O=new Date(w.createdAt).getTime()-new Date(v.createdAt).getTime(),T=1440*60*1e3;O>T&&m.push({id:"insight_stale_visibility",tone:"caution",title:"Stale visibility data",detail:`Last visibility sweep was ${a1(v.createdAt)}, but integration syncs have run since. Run a new sweep for current metrics.`,actionLabel:"Stale",affectedPhrases:[]})}const S=y.map(O=>pN(O,e.project.displayName||e.project.name)),j=new Map;for(const O of i){const T=O.provider||"gemini",M=O.model??null,q=`${T}::${M??"unknown"}`,$=j.get(q)??{provider:T,model:M,cited:0,total:0};$.total++,O.citationState==="cited"&&$.cited++,j.set(q,$)}const k=[...j.values()].sort((O,T)=>O.provider.localeCompare(T.provider)||(O.model??"").localeCompare(T.model??"")).map(({provider:O,model:T,cited:M,total:q})=>({provider:O,model:T,score:q>0?Math.round(M/q*100):0,cited:M,total:q})),A=e.project.providers.filter(O=>!O.startsWith("cdp:")),_=new Set(i.map(O=>O.provider)),C=A.filter(O=>_.has(O)).length,P=i.length>0&&A.length>1&&C<A.length,E=P?`${C} of ${A.length} providers`:void 0;return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:i.length>0?`${a.score}`:"No data",delta:i.length>0?`${a.citedCount} of ${a.totalCount} key phrases visible`:"Run a sweep first",tone:i.length>0?P?"caution":e4(a.score):"neutral",description:i.length>0?`${a.citedCount} of ${a.totalCount} tracked key phrases found your domain in at least one AI answer engine.`:"No visibility data yet. Trigger a run to start tracking.",tooltip:'Percentage of tracked key phrases where your domain is cited by at least one AI answer engine. A key phrase is "visible" if any configured provider includes your site in its response.',trend:[],providerCoverage:E},keywordCounts:{cited:a.citedCount,total:a.totalCount},gapKeyPhrases:o,indexCoverage:u,providerScores:k,competitorPressure:{label:"Competitor Pressure",value:d.label,delta:d.count>0?`${d.count} overlapping citations`:"No overlap detected",tone:Tte(d.label),description:e.competitors.length>0?`${e.competitors.length} competitor${e.competitors.length>1?"s":""} tracked.`:"No competitors configured.",tooltip:"How often competitor domains appear alongside yours in AI answers. High pressure means competitors are frequently cited for the same key phrases.",trend:[]},runStatus:Gte(y),movementSummary:Kte(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:m,visibilityEvidence:n,competitors:e.competitors.map((O,T)=>{const M=new Set;for(const ae of i)(ae.competitorOverlap.includes(O.domain)||ae.citedDomains.includes(O.domain))&&ae.keyword&&M.add(ae.keyword);const q=[...M],$=new Set(i.map(ae=>ae.keyword).filter(Boolean)),L=$.size>0?q.length/$.size:0,J=L>=.5?"High":L>=.2?"Moderate":q.length>0?"Low":"None";return{id:O.id||`comp_${T}`,domain:O.domain,citationCount:q.length,totalKeywords:$.size,pressureLabel:J,citedKeywords:q,movement:"",notes:""}}),recentRuns:S.slice(0,5)}}function Zte(e){const t=Q5(e.project),n=e.runs.filter(w=>w.kind===sn["answer-visibility"]).sort((w,S)=>S.createdAt.localeCompare(w.createdAt))[0],r=n&&e.latestRunDetail?.id===n.id?e.latestRunDetail.snapshots:[],i=J5(r),a=t4(r,e.competitors.map(w=>w.domain)),o=[...e.runs].sort((w,S)=>S.createdAt.localeCompare(w.createdAt)),u=o.find(w=>w.kind===sn["answer-visibility"])??o[0],d=e.project.displayName||e.project.name,f=u?pN(u,d):{id:"none",projectId:e.project.id,projectName:d,kind:sn["answer-visibility"],kindLabel:"No runs yet",status:pn.queued,trigger:Vm.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""},p=e.project.providers.filter(w=>!w.startsWith("cdp:")),m=new Set(r.map(w=>w.provider)),y=p.filter(w=>m.has(w)).length,v=r.length>0&&p.length>1&&y<p.length;return{project:t,visibilityScore:i.score,visibilityDelta:r.length>0?`${i.citedCount} of ${i.totalCount} key phrases`:"No data",visibilityTone:r.length>0?v?"caution":e4(i.score):"neutral",providerCoverage:v?`${y} of ${p.length} providers`:void 0,lastRun:f,insight:r.length>0?`${i.citedCount} of ${i.totalCount} key phrases visible across ${new Set(r.map(w=>w.provider)).size} provider${new Set(r.map(w=>w.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:a.label}}function Yte(e,t){const n=[],r=[],i=[];for(const o of e){r.push(Vte(o)),i.push(Zte(o));const u=[...o.runs].sort((d,f)=>f.createdAt.localeCompare(d.createdAt));for(const d of u)n.push(pN(d,o.project.displayName||o.project.name))}n.sort((o,u)=>u.createdAt.localeCompare(o.createdAt));const a=e.length>0;return{portfolioOverview:{projects:i,attentionItems:a?Wte(r):[{id:"attention_setup",tone:"neutral",title:"No projects yet",detail:"Create your first project using the setup wizard, CLI, or API.",actionLabel:"Open setup",href:"/setup"}],recentRuns:n.slice(0,5),systemHealth:[{id:"api",label:"API",tone:"positive",detail:"Connected",meta:"Real-time data"},{id:"provider",label:"Gemini",tone:"positive",detail:"Configured",meta:"Provider active"}],lastUpdatedAt:new Date().toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),...a?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small key phrase set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:r,runs:n,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},keywordImportState:{mode:"paste",keywordCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:a,ctaLabel:a?"Trigger run":"Create a project first",summary:a?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(o=>({name:o.name,displayName:o.displayName,keyUrl:o.keyUrl,modelHint:o.modelHint,model:o.model,state:o.configured?"ready":"needs-config",detail:o.configured?"Provider is configured.":"API key is missing.",quota:o.quota})),google:{state:t?.google?.configured?"ready":"needs-config",detail:t?.google?.configured?"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard.":"Google OAuth client ID and client secret are not configured yet."},bing:{state:t?.bing?.configured?"ready":"needs-config",detail:t?.bing?.configured?"Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.":"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}}}function Wte(e){const t=[];for(const n of e){const r=n.visibilityEvidence.filter(a=>a.citationState==="lost");r.length>0&&t.push({id:`attention_${n.project.id}_lost`,tone:"negative",title:`${n.project.displayName||n.project.name} lost citations`,detail:`${r.length} key phrase${r.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${n.project.id}`});const i=n.recentRuns.filter(a=>a.status===pn.running||a.status===pn.queued);i.length>0&&t.push({id:`attention_${n.project.id}_active`,tone:"neutral",title:`${n.project.displayName||n.project.name} has active runs`,detail:`${i.length} run${i.length>1?"s":""} in progress.`,actionLabel:"View runs",href:"/runs"})}return t.length===0&&t.push({id:"attention_stable",tone:"positive",title:"All projects stable",detail:"No citation losses or active runs to flag.",actionLabel:"View portfolio",href:"/"}),t}const Ar={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],keywords:e=>["projects",e,"keywords"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"],agent:{providers:e=>["agent",e,"providers"]}},n4=b.createContext(null);n4.Provider;function sh(){return b.useContext(n4)}function Kl(e){const n=sh()?.dashboard??null,r=ns({queryKey:Ar.projects.all,queryFn:Fj,enabled:!n}),i=ns({queryKey:Ar.runs.all,queryFn:MI,enabled:!n,refetchInterval:w=>w.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:!1}),a=ns({queryKey:Ar.settings,queryFn:()=>qj().catch(()=>null),enabled:!n}),o=r.data??[],u=i.data??[],d=_9({queries:o.map(w=>{const S=u.filter(k=>k.projectId===w.id),j=S.filter(k=>(k.status==="completed"||k.status==="partial")&&k.kind==="answer-visibility").sort((k,A)=>A.createdAt.localeCompare(k.createdAt));return{queryKey:Ar.projects.detail(w.id,j[0]?.id),queryFn:async()=>{const k=j[0]?.id,[A,_,C,P,E,O,T,M]=await Promise.all([DK(w.name).catch(()=>[]),DI(w.name).catch(()=>[]),II(w.name).catch(()=>[]),k?Al(k).catch(()=>null):Promise.resolve(null),j[1]?Al(j[1].id).catch(()=>null):Promise.resolve(null),Hj(w.name).catch(()=>null),Kj(w.name).catch(()=>null),k?z7(w.name,k).catch(()=>null):Promise.resolve(null)]);return{project:w,runs:S,keywords:A,competitors:_,timeline:C,latestRunDetail:P,previousRunDetail:E,gscCoverage:O,bingCoverage:T,dbInsights:M}},enabled:!n&&r.isSuccess&&i.isSuccess}})}),f=d.every(w=>w.isSuccess),p=b.useMemo(()=>{if(n)return n;if(!r.data||!i.data||o.length>0&&!f)return null;const w=d.map(S=>S.data).filter(S=>S!=null);return Yte(w,a.data??null)},[n,r.data,i.data,a.data,f,d,o.length]),m=!n&&(r.isError||i.isError),y=!n&&!p&&!m,v=b.useCallback(async()=>{await Promise.all([r.refetch(),i.refetch(),a.refetch()])},[r.refetch,i.refetch,a.refetch]);return{dashboard:p,isLoading:y,isError:m,refetch:v}}async function Qte(){const e=await T7("/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 Qy(e,t){return ns({queryKey:Ar.health,queryFn:Qte,enabled:e,refetchInterval:15e3,initialData:t})}function Xte(e){return ns({queryKey:Ar.runs.detail(e??""),queryFn:()=>Al(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function Pu(){const e=xo(),t=Ly({strict:!1}),n=zr({select:d=>d.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:d=>e({to:n,from:ki.to,search:f=>({...f,runId:d,evidenceId:void 0})}),openEvidence:d=>e({to:n,from:ki.to,search:f=>({...f,evidenceId:d,runId:void 0})}),closeDrawer:()=>e({to:n,from:ki.to,search:d=>({...d,runId:void 0,evidenceId:void 0})})}}const Jte={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function ene(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function tne(){const e=b.useSyncExternalStore(Z7,p2,p2),t=xo(),{openRun:n}=Pu(),r=b.useCallback(a=>{ZS(a)},[]),i=b.useCallback(a=>{a.cta&&(a.cta.intent==="open-run-drawer"?n(a.cta.runId):t({to:"/runs"}),ZS(a.id))},[t,n]);return e.length===0?null:c.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(a=>c.jsxs("section",{role:a.tone==="negative"?"alert":"status","aria-live":a.tone==="negative"?"assertive":"polite","data-state":a.state,className:`toast-card ${Jte[a.tone]}`,children:[c.jsxs("div",{className:"toast-copy",children:[c.jsx("p",{className:"toast-title",children:a.title}),a.detail?c.jsx("p",{className:"toast-detail",children:a.detail}):null,a.cta?c.jsx("button",{type:"button",className:"toast-action",onClick:()=>i(a),"aria-label":ene(a),children:a.cta.label}):null]}),c.jsx("button",{type:"button",onClick:()=>r(a.id),className:"toast-dismiss","aria-label":"Dismiss",children:c.jsx(ih,{className:"size-3.5"})})]},a.id))})}function nne(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const rne=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ine=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ane={};function vz(e,t){return(ane.jsx?ine:rne).test(e)}const sne=/[ \t\n\f\r]/g;function one(e){return typeof e=="object"?e.type==="text"?bz(e.value):!1:bz(e)}function bz(e){return e.replace(sne,"")===""}let oh=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};oh.prototype.normal={};oh.prototype.property={};oh.prototype.space=void 0;function r4(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new oh(n,r,t)}function o1(e){return e.toLowerCase()}class Dr{constructor(t,n){this.attribute=n,this.property=t}}Dr.prototype.attribute="";Dr.prototype.booleanish=!1;Dr.prototype.boolean=!1;Dr.prototype.commaOrSpaceSeparated=!1;Dr.prototype.commaSeparated=!1;Dr.prototype.defined=!1;Dr.prototype.mustUseProperty=!1;Dr.prototype.number=!1;Dr.prototype.overloadedBoolean=!1;Dr.prototype.property="";Dr.prototype.spaceSeparated=!1;Dr.prototype.space=void 0;let lne=0;const lt=Gl(),_n=Gl(),l1=Gl(),ke=Gl(),Ft=Gl(),ou=Gl(),Gr=Gl();function Gl(){return 2**++lne}const c1=Object.freeze(Object.defineProperty({__proto__:null,boolean:lt,booleanish:_n,commaOrSpaceSeparated:Gr,commaSeparated:ou,number:ke,overloadedBoolean:l1,spaceSeparated:Ft},Symbol.toStringTag,{value:"Module"})),Bx=Object.keys(c1);class mN extends Dr{constructor(t,n,r,i){let a=-1;if(super(t,n),xz(this,"space",i),typeof r=="number")for(;++a<Bx.length;){const o=Bx[a];xz(this,Bx[a],(r&c1[o])===c1[o])}}}mN.prototype.defined=!0;function xz(e,t,n){n&&(e[t]=n)}function Ru(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new mN(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[o1(r)]=r,n[o1(a.attribute)]=r}return new oh(t,n,e.space)}const i4=Ru({properties:{ariaActiveDescendant:null,ariaAtomic:_n,ariaAutoComplete:null,ariaBusy:_n,ariaChecked:_n,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:Ft,ariaCurrent:null,ariaDescribedBy:Ft,ariaDetails:null,ariaDisabled:_n,ariaDropEffect:Ft,ariaErrorMessage:null,ariaExpanded:_n,ariaFlowTo:Ft,ariaGrabbed:_n,ariaHasPopup:null,ariaHidden:_n,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ft,ariaLevel:ke,ariaLive:null,ariaModal:_n,ariaMultiLine:_n,ariaMultiSelectable:_n,ariaOrientation:null,ariaOwns:Ft,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:_n,ariaReadOnly:_n,ariaRelevant:null,ariaRequired:_n,ariaRoleDescription:Ft,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:_n,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function a4(e,t){return t in e?e[t]:t}function s4(e,t){return a4(e,t.toLowerCase())}const cne=Ru({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ou,acceptCharset:Ft,accessKey:Ft,action:null,allow:null,allowFullScreen:lt,allowPaymentRequest:lt,allowUserMedia:lt,alt:null,as:null,async:lt,autoCapitalize:null,autoComplete:Ft,autoFocus:lt,autoPlay:lt,blocking:Ft,capture:null,charSet:null,checked:lt,cite:null,className:Ft,cols:ke,colSpan:null,content:null,contentEditable:_n,controls:lt,controlsList:Ft,coords:ke|ou,crossOrigin:null,data:null,dateTime:null,decoding:null,default:lt,defer:lt,dir:null,dirName:null,disabled:lt,download:l1,draggable:_n,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:lt,formTarget:null,headers:Ft,height:ke,hidden:l1,high:ke,href:null,hrefLang:null,htmlFor:Ft,httpEquiv:Ft,id:null,imageSizes:null,imageSrcSet:null,inert:lt,inputMode:null,integrity:null,is:null,isMap:lt,itemId:null,itemProp:Ft,itemRef:Ft,itemScope:lt,itemType:Ft,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:lt,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,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:ke,pattern:null,ping:Ft,placeholder:null,playsInline:lt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:lt,referrerPolicy:null,rel:Ft,required:lt,reversed:lt,rows:ke,rowSpan:ke,sandbox:Ft,scope:null,scoped:lt,seamless:lt,selected:lt,shadowRootClonable:lt,shadowRootDelegatesFocus:lt,shadowRootMode:null,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:_n,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:lt,useMap:null,value:_n,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ft,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:lt,declare:lt,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:lt,noHref:lt,noShade:lt,noWrap:lt,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:_n,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:lt,disableRemotePlayback:lt,prefix:null,property:null,results:ke,security:null,unselectable:null},space:"html",transform:s4}),une=Ru({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:Gr,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:Ft,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:lt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ou,g2:ou,glyphName:ou,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:Gr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ke,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ft,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gr,rev:Gr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gr,requiredFeatures:Gr,requiredFonts:Gr,requiredFormats:Gr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:Gr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gr,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:a4}),o4=Ru({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()}}),l4=Ru({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:s4}),c4=Ru({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),dne={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"},fne=/[A-Z]/g,wz=/-[a-z]/g,hne=/^data[-\w.:]+$/i;function pne(e,t){const n=o1(t);let r=t,i=Dr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&hne.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(wz,gne);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!wz.test(a)){let o=a.replace(fne,mne);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=mN}return new i(r,t)}function mne(e){return"-"+e.toLowerCase()}function gne(e){return e.charAt(1).toUpperCase()}const yne=r4([i4,cne,o4,l4,c4],"html"),gN=r4([i4,une,o4,l4,c4],"svg");function vne(e){return e.join(" ").trim()}var Dc={},Ux,Sz;function bne(){if(Sz)return Ux;Sz=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
97
+ `,f="/",p="*",m="",y="comment",v="declaration";function w(j,k){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];k=k||{};var A=1,_=1;function C(ae){var Z=ae.match(t);Z&&(A+=Z.length);var H=ae.lastIndexOf(d);_=~H?ae.length-H:_+ae.length}function P(){var ae={line:A,column:_};return function(Z){return Z.position=new E(ae),M(),Z}}function E(ae){this.start=ae,this.end={line:A,column:_},this.source=k.source}E.prototype.content=j;function O(ae){var Z=new Error(k.source+":"+A+":"+_+": "+ae);if(Z.reason=ae,Z.filename=k.source,Z.line=A,Z.column=_,Z.source=j,!k.silent)throw Z}function T(ae){var Z=ae.exec(j);if(Z){var H=Z[0];return C(H),j=j.slice(H.length),Z}}function M(){T(n)}function q(ae){var Z;for(ae=ae||[];Z=$();)Z!==!1&&ae.push(Z);return ae}function $(){var ae=P();if(!(f!=j.charAt(0)||p!=j.charAt(1))){for(var Z=2;m!=j.charAt(Z)&&(p!=j.charAt(Z)||f!=j.charAt(Z+1));)++Z;if(Z+=2,m===j.charAt(Z-1))return O("End of comment missing");var H=j.slice(2,Z-2);return _+=2,C(H),j=j.slice(Z),_+=2,ae({type:y,comment:H})}}function L(){var ae=P(),Z=T(r);if(Z){if($(),!T(i))return O("property missing ':'");var H=T(a),Q=ae({type:v,property:S(Z[0].replace(e,m)),value:H?S(H[0].replace(e,m)):m});return T(o),Q}}function J(){var ae=[];q(ae);for(var Z;Z=L();)Z!==!1&&(ae.push(Z),q(ae));return ae}return M(),J()}function S(j){return j?j.replace(u,m):m}return Ux=w,Ux}var jz;function xne(){if(jz)return Dc;jz=1;var e=Dc&&Dc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.default=n;const t=e(bne());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),u=typeof i=="function";return o.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 Dc}var Vd={},Nz;function wne(){if(Nz)return Vd;Nz=1,Object.defineProperty(Vd,"__esModule",{value:!0}),Vd.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},o=function(f,p){return p.toUpperCase()},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,o))};return Vd.camelCase=d,Vd}var Zd,kz;function Sne(){if(kz)return Zd;kz=1;var e=Zd&&Zd.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(xne()),n=wne();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(u,d){u&&d&&(o[(0,n.camelCase)(u,a)]=d)}),o}return r.default=r,Zd=r,Zd}var jne=Sne();const Nne=ja(jne),u4=d4("end"),yN=d4("start");function d4(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 kne(e){const t=yN(e),n=u4(e);if(t&&n)return{start:t,end:n}}function yf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Cz(e.position):"start"in e||"end"in e?Cz(e):"line"in e||"column"in e?u1(e):""}function u1(e){return _z(e&&e.line)+":"+_z(e&&e.column)}function Cz(e){return u1(e&&e.start)+"-"+u1(e&&e.end)}function _z(e){return e&&typeof e=="number"?e:1}class sr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const 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=yf(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}sr.prototype.file="";sr.prototype.name="";sr.prototype.reason="";sr.prototype.message="";sr.prototype.stack="";sr.prototype.column=void 0;sr.prototype.line=void 0;sr.prototype.ancestors=void 0;sr.prototype.cause=void 0;sr.prototype.fatal=void 0;sr.prototype.place=void 0;sr.prototype.ruleId=void 0;sr.prototype.source=void 0;const vN={}.hasOwnProperty,Cne=new Map,_ne=/[A-Z]/g,Ane=new Set(["table","tbody","thead","tfoot","tr"]),One=new Set(["td","th"]),f4="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ene(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=Lne(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=Ine(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"?gN:yne,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=h4(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function h4(e,t,n){if(t.type==="element")return zne(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Tne(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Rne(e,t,n);if(t.type==="mdxjsEsm")return Pne(e,t);if(t.type==="root")return Mne(e,t,n);if(t.type==="text")return Dne(e,t)}function zne(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=gN,e.schema=i),e.ancestors.push(t);const a=m4(e,t.tagName,!1),o=$ne(e,t);let u=xN(e,t);return Ane.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!one(d):!0})),p4(e,o,a,t),bN(o,u),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Tne(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)}Rf(e,t.position)}function Pne(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rf(e,t.position)}function Rne(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=gN,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:m4(e,t.name,!0),o=Bne(e,t),u=xN(e,t);return p4(e,o,a,t),bN(o,u),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Mne(e,t,n){const r={};return bN(r,xN(e,t)),e.create(t,e.Fragment,r,n)}function Dne(e,t){return t.value}function p4(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function bN(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ine(e,t,n){return r;function r(i,a,o,u){const f=Array.isArray(o.children)?n:t;return u?f(a,o,u):f(a,o)}}function Lne(e,t){return n;function n(r,i,a,o){const u=Array.isArray(a.children),d=yN(r);return t(i,a,o,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function $ne(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&vN.call(t.properties,i)){const a=Une(e,i,t.properties[i]);if(a){const[o,u]=a;e.tableCellAlignToStyle&&o==="align"&&typeof u=="string"&&One.has(t.tagName)?r=u:n[o]=u}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Bne(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const u=o.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else Rf(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 Rf(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function xN(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Cne;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=i.get(d)||0;o=d+"-"+f,i.set(d,f+1)}}const u=h4(e,a,o);u!==void 0&&n.push(u)}return n}function Une(e,t,n){const r=pne(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?nne(n):vne(n)),r.property==="style"){let i=typeof n=="object"?n:Fne(e,String(n));return e.stylePropertyNameCase==="css"&&(i=qne(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?dne[r.property]||r.property:r.attribute,n]}}function Fne(e,t){try{return Nne(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new sr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=f4+"#cannot-parse-style-attribute",i}}function m4(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const u=vz(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=o}else r=vz(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return vN.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rf(e)}function Rf(e,t){const n=new sr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=f4+"#cannot-handle-mdx-estrees-without-createevaluater",n}function qne(e){const t={};let n;for(n in e)vN.call(e,n)&&(t[Hne(n)]=e[n]);return t}function Hne(e){let t=e.replace(_ne,Kne);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Kne(e){return"-"+e.toLowerCase()}const Fx={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"]},Gne={};function Vne(e,t){const n=Gne,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return g4(e,r,i)}function g4(e,t,n){if(Zne(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 Az(e.children,t,n)}return Array.isArray(e)?Az(e,t,n):""}function Az(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=g4(e[i],t,n);return r.join("")}function Zne(e){return!!(e&&typeof e=="object")}const Oz=document.createElement("i");function wN(e){const t="&"+e+";";Oz.innerHTML=t;const n=Oz.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ya(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function bi(e,t){return e.length>0?(ya(e,e.length,0,t),e):t}const Ez={}.hasOwnProperty;function Yne(e){const t={};let n=-1;for(;++n<e.length;)Wne(t,e[n]);return t}function Wne(e,t){let n;for(n in t){const i=(Ez.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){Ez.call(i,o)||(i[o]=[]);const u=a[o];Qne(i[o],Array.isArray(u)?u:u?[u]:[])}}}function Qne(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ya(e,0,0,r)}function y4(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 lu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const fa=No(/[A-Za-z]/),Zr=No(/[\dA-Za-z]/),Xne=No(/[#-'*+\--9=?A-Z^-~]/);function d1(e){return e!==null&&(e<32||e===127)}const f1=No(/\d/),Jne=No(/[\dA-Fa-f]/),ere=No(/[!-/:-@[-`{-~]/);function Qe(e){return e!==null&&e<-2}function Tr(e){return e!==null&&(e<0||e===32)}function kt(e){return e===-2||e===-1||e===32}const tre=No(new RegExp("\\p{P}|\\p{S}","u")),nre=No(/\s/);function No(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Mu(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&Zr(e.charCodeAt(n+1))&&Zr(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(o=String.fromCharCode(a,u),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Kt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(d){return kt(d)?(e.enter(n),u(d)):t(d)}function u(d){return kt(d)&&a++<i?(e.consume(d),u):(e.exit(n),t(d))}}const rre={tokenize:ire};function ire(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"),Kt(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,o(u)}function o(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Qe(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),o)}}const are={tokenize:sre},zz={tokenize:ore};function sre(e){const t=this,n=[];let r=0,i,a,o;return u;function u(_){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,d,f)(_)}return f(_)}function d(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&A();const C=t.events.length;let P=C,E;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){E=t.events[P][1].end;break}k(r);let O=C;for(;O<t.events.length;)t.events[O][1].end={...E},O++;return ya(t.events,P+1,0,t.events.slice(C)),t.events.length=O,f(_)}return u(_)}function f(_){if(r===n.length){if(!i)return y(_);if(i.currentConstruct&&i.currentConstruct.concrete)return w(_);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(zz,p,m)(_)}function p(_){return i&&A(),k(r),y(_)}function m(_){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,w(_)}function y(_){return t.containerState={},e.attempt(zz,v,w)(_)}function v(_){return r++,n.push([t.currentConstruct,t.containerState]),y(_)}function w(_){if(_===null){i&&A(),k(0),e.consume(_);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),S(_)}function S(_){if(_===null){j(e.exit("chunkFlow"),!0),k(0),e.consume(_);return}return Qe(_)?(e.consume(_),j(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(_),S)}function j(_,C){const P=t.sliceStream(_);if(C&&P.push(null),_.previous=a,a&&(a.next=_),a=_,i.defineSkip(_.start),i.write(P),t.parser.lazy[_.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<o&&(!i.events[E][1].end||i.events[E][1].end.offset>o))return;const O=t.events.length;let T=O,M,q;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(M){q=t.events[T][1].end;break}M=!0}for(k(r),E=O;E<t.events.length;)t.events[E][1].end={...q},E++;ya(t.events,T+1,0,t.events.slice(O)),t.events.length=E}}function k(_){let C=n.length;for(;C-- >_;){const P=n[C];t.containerState=P[1],P[0].exit.call(t,e)}n.length=_}function A(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ore(e,t,n){return Kt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Tz(e){if(e===null||Tr(e)||nre(e))return 1;if(tre(e))return 2}function SN(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 h1={name:"attention",resolveAll:lre,tokenize:cre};function lre(e,t){let n=-1,r,i,a,o,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},y={...e[n][1].start};Pz(m,-d),Pz(y,d),o={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...o.start},end:{...u.end}},e[r][1].end={...o.start},e[n][1].start={...u.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=bi(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=bi(f,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),f=bi(f,SN(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=bi(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=bi(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,ya(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 cre(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Tz(r);let a;return o;function o(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=Tz(d),m=!p||p===2&&i||n.includes(d),y=!i||i===2&&p||n.includes(r);return f._open=!!(a===42?m:m&&(i||!y)),f._close=!!(a===42?y:y&&(p||!m)),t(d)}}function Pz(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const ure={name:"autolink",tokenize:dre};function dre(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 fa(v)?(e.consume(v),o):v===64?n(v):f(v)}function o(v){return v===43||v===45||v===46||Zr(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||Zr(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||d1(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):Xne(v)?(e.consume(v),f):n(v)}function p(v){return Zr(v)?m(v):n(v)}function m(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):y(v)}function y(v){if((v===45||Zr(v))&&r++<63){const w=v===45?y:m;return e.consume(v),w}return n(v)}}const Xy={partial:!0,tokenize:fre};function fre(e,t,n){return r;function r(a){return kt(a)?Kt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Qe(a)?t(a):n(a)}}const v4={continuation:{tokenize:pre},exit:mre,name:"blockQuote",tokenize:hre};function hre(e,t,n){const r=this;return i;function i(o){if(o===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return kt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function pre(e,t,n){const r=this;return i;function i(o){return kt(o)?Kt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(v4,t,n)(o)}}function mre(e){e.exit("blockQuote")}const b4={name:"characterEscape",tokenize:gre};function gre(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 ere(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const x4={name:"characterReference",tokenize:yre};function yre(e,t,n){const r=this;let i=0,a,o;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,o=Zr,p(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=Jne,p):(e.enter("characterReferenceValue"),a=7,o=f1,p(m))}function p(m){if(m===59&&i){const y=e.exit("characterReferenceValue");return o===Zr&&!wN(r.sliceSerialize(y))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(m)&&i++<a?(e.consume(m),p):n(m)}}const Rz={partial:!0,tokenize:bre},Mz={concrete:!0,name:"codeFenced",tokenize:vre};function vre(e,t,n){const r=this,i={partial:!0,tokenize:P};let a=0,o=0,u;return d;function d(E){return f(E)}function f(E){const O=r.events[r.events.length-1];return a=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,u=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(E)}function p(E){return E===u?(o++,e.consume(E),p):o<3?n(E):(e.exit("codeFencedFenceSequence"),kt(E)?Kt(e,m,"whitespace")(E):m(E))}function m(E){return E===null||Qe(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(Rz,S,C)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(E))}function y(E){return E===null||Qe(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(E)):kt(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Kt(e,v,"whitespace")(E)):E===96&&E===u?n(E):(e.consume(E),y)}function v(E){return E===null||Qe(E)?m(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(E))}function w(E){return E===null||Qe(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(E)):E===96&&E===u?n(E):(e.consume(E),w)}function S(E){return e.attempt(i,C,j)(E)}function j(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),k}function k(E){return a>0&&kt(E)?Kt(e,A,"linePrefix",a+1)(E):A(E)}function A(E){return E===null||Qe(E)?e.check(Rz,S,C)(E):(e.enter("codeFlowValue"),_(E))}function _(E){return E===null||Qe(E)?(e.exit("codeFlowValue"),A(E)):(e.consume(E),_)}function C(E){return e.exit("codeFenced"),t(E)}function P(E,O,T){let M=0;return q;function q(Z){return E.enter("lineEnding"),E.consume(Z),E.exit("lineEnding"),$}function $(Z){return E.enter("codeFencedFence"),kt(Z)?Kt(E,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):L(Z)}function L(Z){return Z===u?(E.enter("codeFencedFenceSequence"),J(Z)):T(Z)}function J(Z){return Z===u?(M++,E.consume(Z),J):M>=o?(E.exit("codeFencedFenceSequence"),kt(Z)?Kt(E,ae,"whitespace")(Z):ae(Z)):T(Z)}function ae(Z){return Z===null||Qe(Z)?(E.exit("codeFencedFence"),O(Z)):T(Z)}}}function bre(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const qx={name:"codeIndented",tokenize:wre},xre={partial:!0,tokenize:Sre};function wre(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Kt(e,a,"linePrefix",5)(f)}function a(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(f):n(f)}function o(f){return f===null?d(f):Qe(f)?e.attempt(xre,o,d)(f):(e.enter("codeFlowValue"),u(f))}function u(f){return f===null||Qe(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),u)}function d(f){return e.exit("codeIndented"),t(f)}}function Sre(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Qe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Kt(e,a,"linePrefix",5)(o)}function a(o){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(o):Qe(o)?i(o):n(o)}}const jre={name:"codeText",previous:kre,resolve:Nre,tokenize:Cre};function Nre(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 kre(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Cre(e,t,n){let r=0,i,a;return o;function o(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)):Qe(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||Qe(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 _re{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&&Yd(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),Yd(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Yd(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);Yd(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Yd(this.left,n.reverse())}}}function Yd(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 w4(e){const t={};let n=-1,r,i,a,o,u,d,f;const p=new _re(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,Are(p,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=p.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},u=p.slice(i,n),u.unshift(r),p.splice(i,n-i+1,u))}}return ya(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function Are(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const u=o.events,d=[],f={};let p,m,y=-1,v=n,w=0,S=0;const j=[S];for(;v;){for(;e.get(++i)[1]!==v;);a.push(i),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),m&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(p),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++y<u.length;)u[y][0]==="exit"&&u[y-1][0]==="enter"&&u[y][1].type===u[y-1][1].type&&u[y][1].start.line!==u[y][1].end.line&&(S=y+1,j.push(S),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(o.events=[],v?(v._tokenizer=void 0,v.previous=void 0):j.pop(),y=j.length;y--;){const k=u.slice(j[y],j[y+1]),A=a.pop();d.push([A,A+k.length-1]),e.splice(A,2,k)}for(d.reverse(),y=-1;++y<d.length;)f[w+d[y][0]]=w+d[y][1],w+=d[y][1]-d[y][0]-1;return f}const Ore={resolve:zre,tokenize:Tre},Ere={partial:!0,tokenize:Pre};function zre(e){return w4(e),e}function Tre(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):Qe(u)?e.check(Ere,o,a)(u):(e.consume(u),i)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function o(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Pre(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Kt(e,a,"linePrefix")}function a(o){if(o===null||Qe(o))return n(o);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(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function S4(e,t,n,r,i,a,o,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),y):k===null||k===32||k===41||d1(k)?n(k):(e.enter(r),e.enter(o),e.enter(u),e.enter("chunkString",{contentType:"string"}),S(k))}function y(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===62?(e.exit("chunkString"),e.exit(u),y(k)):k===null||k===60||Qe(k)?n(k):(e.consume(k),k===92?w:v)}function w(k){return k===60||k===62||k===92?(e.consume(k),v):v(k)}function S(k){return!p&&(k===null||k===41||Tr(k))?(e.exit("chunkString"),e.exit(u),e.exit(o),e.exit(r),t(k)):p<f&&k===40?(e.consume(k),p++,S):k===41?(e.consume(k),p--,S):k===null||k===32||k===40||d1(k)?n(k):(e.consume(k),k===92?j:S)}function j(k){return k===40||k===41||k===92?(e.consume(k),S):S(k)}}function j4(e,t,n,r,i,a){const o=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 o.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):Qe(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||Qe(v)||u++>999?(e.exit("chunkString"),p(v)):(e.consume(v),d||(d=!kt(v)),v===92?y:m)}function y(v){return v===91||v===92||v===93?(e.consume(v),u++,m):m(v)}}function N4(e,t,n,r,i,a){let o;return u;function u(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),o=y===40?41:y,d):n(y)}function d(y){return y===o?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(a),f(y))}function f(y){return y===o?(e.exit(a),d(o)):y===null?n(y):Qe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Kt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===o||y===null||Qe(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?m:p)}function m(y){return y===o||y===92?(e.consume(y),p):p(y)}}function vf(e,t){let n;return r;function r(i){return Qe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):kt(i)?Kt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Rre={name:"definition",tokenize:Dre},Mre={partial:!0,tokenize:Ire};function Dre(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return j4.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function u(v){return i=lu(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 Tr(v)?vf(e,f)(v):f(v)}function f(v){return S4(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(Mre,m,m)(v)}function m(v){return kt(v)?Kt(e,y,"whitespace")(v):y(v)}function y(v){return v===null||Qe(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function Ire(e,t,n){return r;function r(u){return Tr(u)?vf(e,i)(u):n(u)}function i(u){return N4(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return kt(u)?Kt(e,o,"whitespace")(u):o(u)}function o(u){return u===null||Qe(u)?t(u):n(u)}}const Lre={name:"hardBreakEscape",tokenize:$re};function $re(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Qe(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Bre={name:"headingAtx",resolve:Ure,tokenize:Fre};function Ure(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"},ya(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function Fre(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):p===null||Tr(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||Qe(p)?(e.exit("atxHeading"),t(p)):kt(p)?Kt(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||Tr(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),f)}}const qre=["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"],Dz=["pre","script","style","textarea"],Hre={concrete:!0,name:"htmlFlow",resolveTo:Vre,tokenize:Zre},Kre={partial:!0,tokenize:Wre},Gre={partial:!0,tokenize:Yre};function Vre(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 Zre(e,t,n){const r=this;let i,a,o,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),y):D===47?(e.consume(D),a=!0,S):D===63?(e.consume(D),i=3,r.interrupt?t:R):fa(D)?(e.consume(D),o=String.fromCharCode(D),j):n(D)}function y(D){return D===45?(e.consume(D),i=2,v):D===91?(e.consume(D),i=5,u=0,w):fa(D)?(e.consume(D),i=4,r.interrupt?t:R):n(D)}function v(D){return D===45?(e.consume(D),r.interrupt?t:R):n(D)}function w(D){const Y="CDATA[";return D===Y.charCodeAt(u++)?(e.consume(D),u===Y.length?r.interrupt?t:L:w):n(D)}function S(D){return fa(D)?(e.consume(D),o=String.fromCharCode(D),j):n(D)}function j(D){if(D===null||D===47||D===62||Tr(D)){const Y=D===47,se=o.toLowerCase();return!Y&&!a&&Dz.includes(se)?(i=1,r.interrupt?t(D):L(D)):qre.includes(o.toLowerCase())?(i=6,Y?(e.consume(D),k):r.interrupt?t(D):L(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):a?A(D):_(D))}return D===45||Zr(D)?(e.consume(D),o+=String.fromCharCode(D),j):n(D)}function k(D){return D===62?(e.consume(D),r.interrupt?t:L):n(D)}function A(D){return kt(D)?(e.consume(D),A):q(D)}function _(D){return D===47?(e.consume(D),q):D===58||D===95||fa(D)?(e.consume(D),C):kt(D)?(e.consume(D),_):q(D)}function C(D){return D===45||D===46||D===58||D===95||Zr(D)?(e.consume(D),C):P(D)}function P(D){return D===61?(e.consume(D),E):kt(D)?(e.consume(D),P):_(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,O):kt(D)?(e.consume(D),E):T(D)}function O(D){return D===d?(e.consume(D),d=null,M):D===null||Qe(D)?n(D):(e.consume(D),O)}function T(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Tr(D)?P(D):(e.consume(D),T)}function M(D){return D===47||D===62||kt(D)?_(D):n(D)}function q(D){return D===62?(e.consume(D),$):n(D)}function $(D){return D===null||Qe(D)?L(D):kt(D)?(e.consume(D),$):n(D)}function L(D){return D===45&&i===2?(e.consume(D),H):D===60&&i===1?(e.consume(D),Q):D===62&&i===4?(e.consume(D),U):D===63&&i===3?(e.consume(D),R):D===93&&i===5?(e.consume(D),we):Qe(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Kre,F,J)(D)):D===null||Qe(D)?(e.exit("htmlFlowData"),J(D)):(e.consume(D),L)}function J(D){return e.check(Gre,ae,F)(D)}function ae(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Z}function Z(D){return D===null||Qe(D)?J(D):(e.enter("htmlFlowData"),L(D))}function H(D){return D===45?(e.consume(D),R):L(D)}function Q(D){return D===47?(e.consume(D),o="",he):L(D)}function he(D){if(D===62){const Y=o.toLowerCase();return Dz.includes(Y)?(e.consume(D),U):L(D)}return fa(D)&&o.length<8?(e.consume(D),o+=String.fromCharCode(D),he):L(D)}function we(D){return D===93?(e.consume(D),R):L(D)}function R(D){return D===62?(e.consume(D),U):D===45&&i===2?(e.consume(D),R):L(D)}function U(D){return D===null||Qe(D)?(e.exit("htmlFlowData"),F(D)):(e.consume(D),U)}function F(D){return e.exit("htmlFlow"),t(D)}}function Yre(e,t,n){const r=this;return i;function i(o){return Qe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Wre(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Xy,t,n)}}const Qre={name:"htmlText",tokenize:Xre};function Xre(e,t,n){const r=this;let i,a,o;return u;function u(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),d}function d(R){return R===33?(e.consume(R),f):R===47?(e.consume(R),P):R===63?(e.consume(R),_):fa(R)?(e.consume(R),T):n(R)}function f(R){return R===45?(e.consume(R),p):R===91?(e.consume(R),a=0,w):fa(R)?(e.consume(R),A):n(R)}function p(R){return R===45?(e.consume(R),v):n(R)}function m(R){return R===null?n(R):R===45?(e.consume(R),y):Qe(R)?(o=m,Q(R)):(e.consume(R),m)}function y(R){return R===45?(e.consume(R),v):m(R)}function v(R){return R===62?H(R):R===45?y(R):m(R)}function w(R){const U="CDATA[";return R===U.charCodeAt(a++)?(e.consume(R),a===U.length?S:w):n(R)}function S(R){return R===null?n(R):R===93?(e.consume(R),j):Qe(R)?(o=S,Q(R)):(e.consume(R),S)}function j(R){return R===93?(e.consume(R),k):S(R)}function k(R){return R===62?H(R):R===93?(e.consume(R),k):S(R)}function A(R){return R===null||R===62?H(R):Qe(R)?(o=A,Q(R)):(e.consume(R),A)}function _(R){return R===null?n(R):R===63?(e.consume(R),C):Qe(R)?(o=_,Q(R)):(e.consume(R),_)}function C(R){return R===62?H(R):_(R)}function P(R){return fa(R)?(e.consume(R),E):n(R)}function E(R){return R===45||Zr(R)?(e.consume(R),E):O(R)}function O(R){return Qe(R)?(o=O,Q(R)):kt(R)?(e.consume(R),O):H(R)}function T(R){return R===45||Zr(R)?(e.consume(R),T):R===47||R===62||Tr(R)?M(R):n(R)}function M(R){return R===47?(e.consume(R),H):R===58||R===95||fa(R)?(e.consume(R),q):Qe(R)?(o=M,Q(R)):kt(R)?(e.consume(R),M):H(R)}function q(R){return R===45||R===46||R===58||R===95||Zr(R)?(e.consume(R),q):$(R)}function $(R){return R===61?(e.consume(R),L):Qe(R)?(o=$,Q(R)):kt(R)?(e.consume(R),$):M(R)}function L(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),i=R,J):Qe(R)?(o=L,Q(R)):kt(R)?(e.consume(R),L):(e.consume(R),ae)}function J(R){return R===i?(e.consume(R),i=void 0,Z):R===null?n(R):Qe(R)?(o=J,Q(R)):(e.consume(R),J)}function ae(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||Tr(R)?M(R):(e.consume(R),ae)}function Z(R){return R===47||R===62||Tr(R)?M(R):n(R)}function H(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function Q(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),he}function he(R){return kt(R)?Kt(e,we,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):we(R)}function we(R){return e.enter("htmlTextData"),o(R)}}const jN={name:"labelEnd",resolveAll:nie,resolveTo:rie,tokenize:iie},Jre={tokenize:aie},eie={tokenize:sie},tie={tokenize:oie};function nie(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&&ya(e,0,e.length,n),e}function rie(e,t){let n=e.length,r=0,i,a,o,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(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return u=[["enter",d,t],["enter",f,t]],u=bi(u,e.slice(a+1,a+r+3)),u=bi(u,[["enter",p,t]]),u=bi(u,SN(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),u=bi(u,[["exit",p,t],e[o-2],e[o-1],["exit",f,t]]),u=bi(u,e.slice(o+1)),u=bi(u,[["exit",d,t]]),ya(e,a,e.length,u),e}function iie(e,t,n){const r=this;let i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return u;function u(y){return a?a._inactive?m(y):(o=r.parser.defined.includes(lu(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(Jre,p,o?p:m)(y):y===91?e.attempt(eie,p,o?f:m)(y):o?p(y):m(y)}function f(y){return e.attempt(tie,p,m)(y)}function p(y){return t(y)}function m(y){return a._balanced=!0,n(y)}}function aie(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 Tr(m)?vf(e,a)(m):a(m)}function a(m){return m===41?p(m):S4(e,o,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return Tr(m)?vf(e,d)(m):p(m)}function u(m){return n(m)}function d(m){return m===34||m===39||m===40?N4(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return Tr(m)?vf(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 sie(e,t,n){const r=this;return i;function i(u){return j4.call(r,e,a,o,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(lu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function o(u){return n(u)}}function oie(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 lie={name:"labelStartImage",resolveAll:jN.resolveAll,tokenize:cie};function cie(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"),o):n(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const uie={name:"labelStartLink",resolveAll:jN.resolveAll,tokenize:die};function die(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Hx={name:"lineEnding",tokenize:fie};function fie(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Kt(e,t,"linePrefix")}}const Wm={name:"thematicBreak",tokenize:hie};function hie(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),o(f)}function o(f){return i=f,u(f)}function u(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||Qe(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),kt(f)?Kt(e,u,"whitespace")(f):u(f))}}const Cr={continuation:{tokenize:yie},exit:bie,name:"list",tokenize:gie},pie={partial:!0,tokenize:xie},mie={partial:!0,tokenize:vie};function gie(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return u;function u(v){const w=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:f1(v)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Wm,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 f1(v)&&++o<10?(e.consume(v),d):(!r.interrupt||o<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(Xy,r.interrupt?n:p,e.attempt(pie,y,m))}function p(v){return r.containerState.initialBlankLine=!0,a++,y(v)}function m(v){return kt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):n(v)}function y(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function yie(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Xy,i,a);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Kt(e,t,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!kt(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(mie,t,o)(u))}function o(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Kt(e,e.attempt(Cr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function vie(e,t,n){const r=this;return Kt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function bie(e){e.exit(this.containerState.type)}function xie(e,t,n){const r=this;return Kt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!kt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Iz={name:"setextUnderline",resolveTo:wie,tokenize:Sie};function wie(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Sie(e,t,n){const r=this;let i;return a;function a(f){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=f,o(f)):n(f)}function o(f){return e.enter("setextHeadingLineSequence"),u(f)}function u(f){return f===i?(e.consume(f),u):(e.exit("setextHeadingLineSequence"),kt(f)?Kt(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Qe(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const jie={tokenize:Nie};function Nie(e){const t=this,n=e.attempt(Xy,r,e.attempt(this.parser.constructs.flowInitial,i,Kt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ore,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 kie={resolveAll:C4()},Cie=k4("string"),_ie=k4("text");function k4(e){return{resolveAll:C4(e==="text"?Aie:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,u);return o;function o(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 y=-1;if(m)for(;++y<m.length;){const v=m[y];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function C4(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 Aie(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,o=-1,u=0,d;for(;a--;){const f=i[a];if(typeof f=="string"){for(o=f.length;f.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-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?o:r.start._bufferIndex+o,_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 Oie={42:Cr,43:Cr,45:Cr,48:Cr,49:Cr,50:Cr,51:Cr,52:Cr,53:Cr,54:Cr,55:Cr,56:Cr,57:Cr,62:v4},Eie={91:Rre},zie={[-2]:qx,[-1]:qx,32:qx},Tie={35:Bre,42:Wm,45:[Iz,Wm],60:Hre,61:Iz,95:Wm,96:Mz,126:Mz},Pie={38:x4,92:b4},Rie={[-5]:Hx,[-4]:Hx,[-3]:Hx,33:lie,38:x4,42:h1,60:[ure,Qre],91:uie,92:[Lre,b4],93:jN,95:h1,96:jre},Mie={null:[h1,kie]},Die={null:[42,95]},Iie={null:[]},Lie=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Die,contentInitial:Eie,disable:Iie,document:Oie,flow:Tie,flowInitial:zie,insideSpan:Mie,string:Pie,text:Rie},Symbol.toStringTag,{value:"Module"}));function $ie(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let o=[],u=[];const d={attempt:O(P),check:O(E),consume:A,enter:_,exit:C,interrupt:O(E,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:m};let p=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function m($){return o=bi(o,$),j(),o[o.length-1]!==null?[]:(T(t,0),f.events=SN(a,f.events,f),f.events)}function y($,L){return Uie(v($),L)}function v($){return Bie(o,$)}function w(){const{_bufferIndex:$,_index:L,line:J,column:ae,offset:Z}=r;return{_bufferIndex:$,_index:L,line:J,column:ae,offset:Z}}function S($){i[$.line]=$.column,q()}function j(){let $;for(;r._index<o.length;){const L=o[r._index];if(typeof L=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<L.length;)k(L.charCodeAt(r._bufferIndex));else k(L)}}function k($){p=p($)}function A($){Qe($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,q()):$!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=$}function _($,L){const J=L||{};return J.type=$,J.start=w(),f.events.push(["enter",J,f]),u.push(J),J}function C($){const L=u.pop();return L.end=w(),f.events.push(["exit",L,f]),L}function P($,L){T($,L.from)}function E($,L){L.restore()}function O($,L){return J;function J(ae,Z,H){let Q,he,we,R;return Array.isArray(ae)?F(ae):"tokenize"in ae?F([ae]):U(ae);function U(ie){return fe;function fe(je){const ee=je!==null&&ie[je],ue=je!==null&&ie.null,Ae=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(ue)?ue:ue?[ue]:[]];return F(Ae)(je)}}function F(ie){return Q=ie,he=0,ie.length===0?H:D(ie[he])}function D(ie){return fe;function fe(je){return R=M(),we=ie,ie.partial||(f.currentConstruct=ie),ie.name&&f.parser.constructs.disable.null.includes(ie.name)?se():ie.tokenize.call(L?Object.assign(Object.create(f),L):f,d,Y,se)(je)}}function Y(ie){return $(we,R),Z}function se(ie){return R.restore(),++he<Q.length?D(Q[he]):H}}}function T($,L){$.resolveAll&&!a.includes($)&&a.push($),$.resolve&&ya(f.events,L,f.events.length-L,$.resolve(f.events.slice(L),f)),$.resolveTo&&(f.events=$.resolveTo(f.events,f))}function M(){const $=w(),L=f.previous,J=f.currentConstruct,ae=f.events.length,Z=Array.from(u);return{from:ae,restore:H};function H(){r=$,f.previous=L,f.currentConstruct=J,f.events.length=ae,u=Z,q()}}function q(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Bie(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const u=o[0];typeof u=="string"?o[0]=u.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Uie(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
98
+ `;break}case-3:{o=`\r
99
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}function Fie(e){const r={constructs:Yne([Lie,...(e||{}).extensions||[]]),content:i(rre),defined:[],document:i(are),flow:i(jie),lazy:{},string:i(Cie),text:i(_ie)};return r;function i(a){return o;function o(u){return $ie(r,a,u)}}}function qie(e){for(;!w4(e););return e}const Lz=/[\0\t\n\r]/g;function Hie(){let e=1,t="",n=!0,r;return i;function i(a,o,u){const d=[];let f,p,m,y,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(Lz.lastIndex=m,f=Lz.exec(a),y=f&&f.index!==void 0?f.index:a.length,v=a.charCodeAt(y),!f){t=a.slice(m);break}if(v===10&&m===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<y&&(d.push(a.slice(m,y)),e+=y-m),v){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=y+1}return u&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const Kie=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Gie(e){return e.replace(Kie,Vie)}function Vie(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return y4(n.slice(a?2:1),a?16:10)}return wN(n)||e}const _4={}.hasOwnProperty;function Zie(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Yie(n)(qie(Fie(n).document().write(Hie()(e,t,!0))))}function Yie(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(wn),autolinkProtocol:M,autolinkEmail:M,atxHeading:a(it),blockQuote:a(ue),characterEscape:M,characterReference:M,codeFenced:a(Ae),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(Ae,o),codeText:a(W,o),codeTextData:M,data:M,codeFlowValue:M,definition:a(Ke),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Re),hardBreakEscape:a(at),hardBreakTrailing:a(at),htmlFlow:a(At,o),htmlFlowData:M,htmlText:a(At,o),htmlTextData:M,image:a(Bt),label:o,link:a(wn),listItem:a(Ye),listItemValue:y,listOrdered:a(ve,m),listUnordered:a(ve),paragraph:a(be),reference:D,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(it),strong:a(Me),thematicBreak:a(ze)},exit:{atxHeading:d(),atxHeadingSequence:P,autolink:d(),autolinkEmail:ee,autolinkProtocol:je,blockQuote:d(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ie,characterReference:fe,codeFenced:d(j),codeFencedFence:S,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:q,codeIndented:d(k),codeText:d(Z),codeTextData:q,data:q,definition:d(),definitionDestinationString:C,definitionLabelString:A,definitionTitleString:_,emphasis:d(),hardBreakEscape:d(L),hardBreakTrailing:d(L),htmlFlow:d(J),htmlFlowData:q,htmlText:d(ae),htmlTextData:q,image:d(Q),label:we,labelText:he,lineEnding:$,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:Y,resourceDestinationString:R,resourceTitleString:U,resource:F,setextHeading:d(T),setextHeadingLineSequence:O,setextHeadingText:E,strong:d(),thematicBreak:d()}};A4(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ne){let xe={type:"root",children:[]};const Ee={stack:[xe],tokenStack:[],config:t,enter:u,exit:f,buffer:o,resume:p,data:n},Ge=[];let et=-1;for(;++et<ne.length;)if(ne[et][1].type==="listOrdered"||ne[et][1].type==="listUnordered")if(ne[et][0]==="enter")Ge.push(et);else{const rn=Ge.pop();et=i(ne,rn,et)}for(et=-1;++et<ne.length;){const rn=t[ne[et][0]];_4.call(rn,ne[et][1].type)&&rn[ne[et][1].type].call(Object.assign({sliceSerialize:ne[et][2].sliceSerialize},Ee),ne[et][1])}if(Ee.tokenStack.length>0){const rn=Ee.tokenStack[Ee.tokenStack.length-1];(rn[1]||$z).call(Ee,void 0,rn[0])}for(xe.position={start:qs(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:qs(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},et=-1;++et<t.transforms.length;)xe=t.transforms[et](xe)||xe;return xe}function i(ne,xe,Ee){let Ge=xe-1,et=-1,rn=!1,Sn,Xe,Qt,Ut;for(;++Ge<=Ee;){const Ue=ne[Ge];switch(Ue[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ue[0]==="enter"?et++:et--,Ut=void 0;break}case"lineEndingBlank":{Ue[0]==="enter"&&(Sn&&!Ut&&!et&&!Qt&&(Qt=Ge),Ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ut=void 0}if(!et&&Ue[0]==="enter"&&Ue[1].type==="listItemPrefix"||et===-1&&Ue[0]==="exit"&&(Ue[1].type==="listUnordered"||Ue[1].type==="listOrdered")){if(Sn){let Jr=Ge;for(Xe=void 0;Jr--;){const Se=ne[Jr];if(Se[1].type==="lineEnding"||Se[1].type==="lineEndingBlank"){if(Se[0]==="exit")continue;Xe&&(ne[Xe][1].type="lineEndingBlank",rn=!0),Se[1].type="lineEnding",Xe=Jr}else if(!(Se[1].type==="linePrefix"||Se[1].type==="blockQuotePrefix"||Se[1].type==="blockQuotePrefixWhitespace"||Se[1].type==="blockQuoteMarker"||Se[1].type==="listItemIndent"))break}Qt&&(!Xe||Qt<Xe)&&(Sn._spread=!0),Sn.end=Object.assign({},Xe?ne[Xe][1].start:Ue[1].end),ne.splice(Xe||Ge,0,["exit",Sn,Ue[2]]),Ge++,Ee++}if(Ue[1].type==="listItemPrefix"){const Jr={type:"listItem",_spread:!1,start:Object.assign({},Ue[1].start),end:void 0};Sn=Jr,ne.splice(Ge,0,["enter",Jr,Ue[2]]),Ge++,Ee++,Qt=void 0,Ut=!0}}}return ne[xe][1]._spread=rn,Ee}function a(ne,xe){return Ee;function Ee(Ge){u.call(this,ne(Ge),Ge),xe&&xe.call(this,Ge)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(ne,xe,Ee){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([xe,Ee||void 0]),ne.position={start:qs(xe.start),end:void 0}}function d(ne){return xe;function xe(Ee){ne&&ne.call(this,Ee),f.call(this,Ee)}}function f(ne,xe){const Ee=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==ne.type&&(xe?xe.call(this,ne,Ge[0]):(Ge[1]||$z).call(this,ne,Ge[0]));else throw new Error("Cannot close `"+ne.type+"` ("+yf({start:ne.start,end:ne.end})+"): it’s not open");Ee.position.end=qs(ne.end)}function p(){return Vne(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(ne){if(this.data.expectingFirstListItemValue){const xe=this.stack[this.stack.length-2];xe.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ne=this.resume(),xe=this.stack[this.stack.length-1];xe.lang=ne}function w(){const ne=this.resume(),xe=this.stack[this.stack.length-1];xe.meta=ne}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const ne=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ne=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ne.replace(/(\r?\n|\r)$/g,"")}function A(ne){const xe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=xe,Ee.identifier=lu(this.sliceSerialize(ne)).toLowerCase()}function _(){const ne=this.resume(),xe=this.stack[this.stack.length-1];xe.title=ne}function C(){const ne=this.resume(),xe=this.stack[this.stack.length-1];xe.url=ne}function P(ne){const xe=this.stack[this.stack.length-1];if(!xe.depth){const Ee=this.sliceSerialize(ne).length;xe.depth=Ee}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function O(ne){const xe=this.stack[this.stack.length-1];xe.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function M(ne){const Ee=this.stack[this.stack.length-1].children;let Ge=Ee[Ee.length-1];(!Ge||Ge.type!=="text")&&(Ge=Pe(),Ge.position={start:qs(ne.start),end:void 0},Ee.push(Ge)),this.stack.push(Ge)}function q(ne){const xe=this.stack.pop();xe.value+=this.sliceSerialize(ne),xe.position.end=qs(ne.end)}function $(ne){const xe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=xe.children[xe.children.length-1];Ee.position.end=qs(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(xe.type)&&(M.call(this,ne),q.call(this,ne))}function L(){this.data.atHardBreak=!0}function J(){const ne=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ne}function ae(){const ne=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ne}function Z(){const ne=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ne}function H(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=xe,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function Q(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=xe,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function he(ne){const xe=this.sliceSerialize(ne),Ee=this.stack[this.stack.length-2];Ee.label=Gie(xe),Ee.identifier=lu(xe).toLowerCase()}function we(){const ne=this.stack[this.stack.length-1],xe=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Ge=ne.children;Ee.children=Ge}else Ee.alt=xe}function R(){const ne=this.resume(),xe=this.stack[this.stack.length-1];xe.url=ne}function U(){const ne=this.resume(),xe=this.stack[this.stack.length-1];xe.title=ne}function F(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function Y(ne){const xe=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=xe,Ee.identifier=lu(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function se(ne){this.data.characterReferenceType=ne.type}function ie(ne){const xe=this.sliceSerialize(ne),Ee=this.data.characterReferenceType;let Ge;Ee?(Ge=y4(xe,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=wN(xe);const et=this.stack[this.stack.length-1];et.value+=Ge}function fe(ne){const xe=this.stack.pop();xe.position.end=qs(ne.end)}function je(ne){q.call(this,ne);const xe=this.stack[this.stack.length-1];xe.url=this.sliceSerialize(ne)}function ee(ne){q.call(this,ne);const xe=this.stack[this.stack.length-1];xe.url="mailto:"+this.sliceSerialize(ne)}function ue(){return{type:"blockquote",children:[]}}function Ae(){return{type:"code",lang:null,meta:null,value:""}}function W(){return{type:"inlineCode",value:""}}function Ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Re(){return{type:"emphasis",children:[]}}function it(){return{type:"heading",depth:0,children:[]}}function at(){return{type:"break"}}function At(){return{type:"html",value:""}}function Bt(){return{type:"image",title:null,url:"",alt:null}}function wn(){return{type:"link",title:null,url:"",children:[]}}function ve(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function Ye(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function be(){return{type:"paragraph",children:[]}}function Me(){return{type:"strong",children:[]}}function Pe(){return{type:"text",value:""}}function ze(){return{type:"thematicBreak"}}}function qs(e){return{line:e.line,column:e.column,offset:e.offset}}function A4(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?A4(e,r):Wie(e,r)}}function Wie(e,t){let n;for(n in t)if(_4.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 $z(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+yf({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+yf({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+yf({start:t.start,end:t.end})+") is still open")}function Qie(e){const t=this;t.parser=n;function n(r){return Zie(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Xie(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 Jie(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
100
+ `}]}function eae(e,t){const n=t.value?t.value+`
101
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function tae(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nae(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rae(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Mu(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=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(o)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function iae(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 aae(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function O4(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function sae(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return O4(e,t);const i={src:Mu(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 oae(e,t){const n={src:Mu(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 lae(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 cae(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return O4(e,t);const i={href:Mu(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 uae(e,t){const n={href:Mu(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 dae(e,t,n){const r=e.all(t),i=n?fae(n):E4(t),a={},o=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const p=r[u];(i||u!==0||p.type!=="element"||p.tagName!=="p")&&o.push({type:"text",value:`
102
+ `}),p.type==="element"&&p.tagName==="p"&&!i?o.push(...p.children):o.push(p)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
103
+ `});const f={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,f),e.applyData(t,f)}function fae(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=E4(n[r])}return t}function E4(e){const t=e.spread;return t??e.children.length>1}function hae(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function pae(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mae(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function gae(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yae(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=yN(t.children[1]),d=u4(t.children[t.children.length-1]);u&&d&&(o.position={start:u,end:d}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function vae(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,u=o?o.length:t.children.length;let d=-1;const f=[];for(;++d<u;){const m=t.children[d],y={},v=o?o[d]:void 0;v&&(y.align=v);let w={type:"element",tagName:a,properties:y,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),f.push(w)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function bae(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Bz=9,Uz=32;function xae(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(Fz(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Fz(t.slice(i),i>0,!1)),a.join("")}function Fz(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===Bz||a===Uz;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===Bz||a===Uz;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function wae(e,t){const n={type:"text",value:xae(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Sae(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const jae={blockquote:Xie,break:Jie,code:eae,delete:tae,emphasis:nae,footnoteReference:rae,heading:iae,html:aae,imageReference:sae,image:oae,inlineCode:lae,linkReference:cae,link:uae,listItem:dae,list:hae,paragraph:pae,root:mae,strong:gae,table:yae,tableCell:bae,tableRow:vae,text:wae,thematicBreak:Sae,toml:pm,yaml:pm,definition:pm,footnoteDefinition:pm};function pm(){}const z4=-1,Jy=0,bf=1,Ag=2,NN=3,kN=4,CN=5,_N=6,T4=7,P4=8,qz=typeof self=="object"?self:globalThis,Nae=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case Jy:case z4:return n(o,i);case bf:{const u=n([],i);for(const d of o)u.push(r(d));return u}case Ag:{const u=n({},i);for(const[d,f]of o)u[r(d)]=r(f);return u}case NN:return n(new Date(o),i);case kN:{const{source:u,flags:d}=o;return n(new RegExp(u,d),i)}case CN:{const u=n(new Map,i);for(const[d,f]of o)u.set(r(d),r(f));return u}case _N:{const u=n(new Set,i);for(const d of o)u.add(r(d));return u}case T4:{const{name:u,message:d}=o;return n(new qz[u](d),i)}case P4:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:u}=new Uint8Array(o);return n(new DataView(u),o)}}return n(new qz[a](o),i)};return r},Hz=e=>Nae(new Map,e)(0),Ic="",{toString:kae}={},{keys:Cae}=Object,Wd=e=>{const t=typeof e;if(t!=="object"||!e)return[Jy,t];const n=kae.call(e).slice(8,-1);switch(n){case"Array":return[bf,Ic];case"Object":return[Ag,Ic];case"Date":return[NN,Ic];case"RegExp":return[kN,Ic];case"Map":return[CN,Ic];case"Set":return[_N,Ic];case"DataView":return[bf,n]}return n.includes("Array")?[bf,n]:n.includes("Error")?[T4,n]:[Ag,n]},mm=([e,t])=>e===Jy&&(t==="function"||t==="symbol"),_ae=(e,t,n,r)=>{const i=(o,u)=>{const d=r.push(o)-1;return n.set(u,d),d},a=o=>{if(n.has(o))return n.get(o);let[u,d]=Wd(o);switch(u){case Jy:{let p=o;switch(d){case"bigint":u=P4,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([z4],o)}return i([u,p],o)}case bf:{if(d){let y=o;return d==="DataView"?y=new Uint8Array(o.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(o)),i([d,[...y]],o)}const p=[],m=i([u,p],o);for(const y of o)p.push(a(y));return m}case Ag:{if(d)switch(d){case"BigInt":return i([d,o.toString()],o);case"Boolean":case"Number":case"String":return i([d,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const p=[],m=i([u,p],o);for(const y of Cae(o))(e||!mm(Wd(o[y])))&&p.push([a(y),a(o[y])]);return m}case NN:return i([u,o.toISOString()],o);case kN:{const{source:p,flags:m}=o;return i([u,{source:p,flags:m}],o)}case CN:{const p=[],m=i([u,p],o);for(const[y,v]of o)(e||!(mm(Wd(y))||mm(Wd(v))))&&p.push([a(y),a(v)]);return m}case _N:{const p=[],m=i([u,p],o);for(const y of o)(e||!mm(Wd(y)))&&p.push(a(y));return m}}const{message:f}=o;return i([u,{name:d,message:f}],o)};return a},Kz=(e,{json:t,lossy:n}={})=>{const r=[];return _ae(!(t||n),!!t,new Map,r)(e),r},Og=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Hz(Kz(e,t)):structuredClone(e):(e,t)=>Hz(Kz(e,t));function Aae(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 Oae(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Eae(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Aae,r=e.options.footnoteBackLabel||Oae,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=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(),y=Mu(m.toLowerCase());let v=0;const w=[],S=e.footnoteCounts.get(m);for(;S!==void 0&&++v<=S;){w.length>0&&w.push({type:"text",value:" "});let A=typeof n=="string"?n:n(d,v);typeof A=="string"&&(A={type:"text",value:A}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,v),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const j=p[p.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const A=j.children[j.children.length-1];A&&A.type==="text"?A.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...w)}else p.push(...w);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(f,k),u.push(k)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Og(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
104
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
105
+ `}]}}const R4=(function(e){if(e==null)return Rae;if(typeof e=="function")return ev(e);if(typeof e=="object")return Array.isArray(e)?zae(e):Tae(e);if(typeof e=="string")return Pae(e);throw new Error("Expected function, string, or object as test")});function zae(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=R4(e[n]);return ev(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Tae(e){const t=e;return ev(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Pae(e){return ev(t);function t(n){return n&&n.type===e}}function ev(e){return t;function t(n,r,i){return!!(Mae(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Rae(){return!0}function Mae(e){return e!==null&&typeof e=="object"&&"type"in e}const M4=[],Dae=!0,Gz=!1,Iae="skip";function Lae(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=R4(i),o=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(y,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=M4,w,S,j;if((!t||a(d,f,p[p.length-1]||void 0))&&(v=$ae(n(d,p)),v[0]===Gz))return v;if("children"in d&&d.children){const k=d;if(k.children&&v[0]!==Iae)for(S=(r?k.children.length:-1)+o,j=p.concat(k);S>-1&&S<k.children.length;){const A=k.children[S];if(w=u(A,S,j)(),w[0]===Gz)return w;S=typeof w[1]=="number"?w[1]:S+o}}return v}}}function $ae(e){return Array.isArray(e)?e:typeof e=="number"?[Dae,e]:e==null?M4:[e]}function D4(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Lae(e,a,u,i);function u(d,f){const p=f[f.length-1],m=p?p.children.indexOf(d):void 0;return o(d,m,p)}}const p1={}.hasOwnProperty,Bae={};function Uae(e,t){const n=t||Bae,r=new Map,i=new Map,a=new Map,o={...jae,...n.handlers},u={all:f,applyData:qae,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:d,options:n,patch:Fae,wrap:Kae};return D4(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:i,y=String(p.identifier).toUpperCase();m.has(y)||m.set(y,p)}}),u;function d(p,m){const y=p.type,v=u.handlers[y];if(p1.call(u.handlers,y)&&v)return v(u,p,m);if(u.options.passThrough&&u.options.passThrough.includes(y)){if("children"in p){const{children:S,...j}=p,k=Og(j);return k.children=u.all(p),k}return Og(p)}return(u.options.unknownHandler||Hae)(u,p,m)}function f(p){const m=[];if("children"in p){const y=p.children;let v=-1;for(;++v<y.length;){const w=u.one(y[v],p);if(w){if(v&&y[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=Vz(w.value)),!Array.isArray(w)&&w.type==="element")){const S=w.children[0];S&&S.type==="text"&&(S.value=Vz(S.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function Fae(e,t){e.position&&(t.position=kne(e))}function qae(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,Og(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Hae(e,t){const n=t.data||{},r="value"in t&&!(p1.call(n,"hProperties")||p1.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 Kae(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
106
+ `});++r<e.length;)r&&n.push({type:"text",value:`
107
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
108
+ `}),n}function Vz(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Zz(e,t){const n=Uae(e,t),r=n.one(e,void 0),i=Eae(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
109
+ `},i),a}function Gae(e,t){return e&&"run"in e?async function(n,r){const i=Zz(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Zz(n,{file:r,...e||t})}}function Yz(e){if(e)throw e}var Kx,Wz;function Vae(){if(Wz)return Kx;Wz=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var y;for(y in f);return typeof y>"u"||e.call(f,y)},o=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},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 Kx=function d(){var f,p,m,y,v,w,S=arguments[0],j=1,k=arguments.length,A=!1;for(typeof S=="boolean"&&(A=S,S=arguments[1]||{},j=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});j<k;++j)if(f=arguments[j],f!=null)for(p in f)m=u(S,p),y=u(f,p),S!==y&&(A&&y&&(a(y)||(v=i(y)))?(v?(v=!1,w=m&&i(m)?m:[]):w=m&&a(m)?m:{},o(S,{name:p,newValue:d(A,w,y)})):typeof y<"u"&&o(S,{name:p,newValue:y}));return S},Kx}var Zae=Vae();const Gx=ja(Zae);function m1(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 Yae(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);u(null,...i);function u(d,...f){const p=e[++a];let m=-1;if(d){o(d);return}for(;++m<i.length;)(f[m]===null||f[m]===void 0)&&(f[m]=i[m]);i=f,p?Wae(p,u)(...f):o(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Wae(e,t){let n;return r;function r(...o){const u=e.length>o.length;let d;u&&o.push(i);try{d=e.apply(this,o)}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(o,...u){n||(n=!0,t(o,...u))}function a(o){i(null,o)}}const la={basename:Qae,dirname:Xae,extname:Jae,join:ese,sep:"/"};function Qae(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');lh(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Xae(e){if(lh(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 Jae(e){lh(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const u=e.codePointAt(t);if(u===47){if(o){r=t+1;break}continue}n<0&&(o=!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 ese(...e){let t=-1,n;for(;++t<e.length;)lh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":tse(n)}function tse(e){lh(e);const t=e.codePointAt(0)===47;let n=nse(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function nse(e,t){let n="",r=0,i=-1,a=0,o=-1,u,d;for(;++o<=e.length;){if(o<e.length)u=e.codePointAt(o);else{if(u===47)break;u=47}if(u===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else u===46&&a>-1?a++:a=-1}return n}function lh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const rse={cwd:ise};function ise(){return"/"}function g1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ase(e){if(typeof e=="string")e=new URL(e);else if(!g1(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 sse(e)}function sse(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 Vx=["history","path","basename","stem","extname","dirname"];class I4{constructor(t){let n;t?g1(t)?n={path:t}:typeof t=="string"||ose(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":rse.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Vx.length;){const a=Vx[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)Vx.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?la.basename(this.path):void 0}set basename(t){Yx(t,"basename"),Zx(t,"basename"),this.path=la.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?la.dirname(this.path):void 0}set dirname(t){Qz(this.basename,"dirname"),this.path=la.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?la.extname(this.path):void 0}set extname(t){if(Zx(t,"extname"),Qz(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=la.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){g1(t)&&(t=ase(t)),Yx(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?la.basename(this.path,this.extname):void 0}set stem(t){Yx(t,"stem"),Zx(t,"stem"),this.path=la.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new sr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Zx(e,t){if(e&&e.includes(la.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+la.sep+"`")}function Yx(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Qz(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function ose(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const lse=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),cse={}.hasOwnProperty;class AN extends lse{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=Yae()}copy(){const t=new AN;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Gx(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Xx("data",this.frozen),this.namespace[t]=n,this):cse.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Xx("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=gm(t),r=this.parser||this.Parser;return Wx("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Wx("process",this.parser||this.Parser),Qx("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const u=gm(t),d=r.parse(u);r.run(d,u,function(p,m,y){if(p||!m||!y)return f(p);const v=m,w=r.stringify(v,y);fse(w)?y.value=w:y.result=w,f(p,y)});function f(p,m){p||!m?o(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),Wx("processSync",this.parser||this.Parser),Qx("processSync",this.compiler||this.Compiler),this.process(t,i),Jz("processSync","process",n),r;function i(a,o){n=!0,Yz(a),r=o}}run(t,n,r){Xz(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,u){const d=gm(n);i.run(t,d,f);function f(p,m,y){const v=m||t;p?u(p):o?o(v):r(void 0,v,y)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),Jz("runSync","run",r),i;function a(o,u){Yz(o),i=u,r=!0}}stringify(t,n){this.freeze();const r=gm(n),i=this.compiler||this.Compiler;return Qx("stringify",i),Xz(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Xx("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,m)}else o(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function o(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(f.plugins),f.settings&&(i.settings=Gx(!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,y=-1;for(;++m<r.length;)if(r[m][0]===f){y=m;break}if(y===-1)r.push([f,...p]);else if(p.length>0){let[v,...w]=p;const S=r[y][1];m1(S)&&m1(v)&&(v=Gx(!0,S,v)),r[y]=[f,v,...w]}}}}const use=new AN().freeze();function Wx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Qx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Xx(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 Xz(e){if(!m1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Jz(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function gm(e){return dse(e)?e:new I4(e)}function dse(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function fse(e){return typeof e=="string"||hse(e)}function hse(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pse="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",eT=[],tT={allowDangerousHtml:!0},mse=/^(https?|ircs?|mailto|xmpp)$/i,gse=[{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 yse(e){const t=vse(e),n=bse(e);return xse(t.runSync(t.parse(n),n),e)}function vse(e){const t=e.rehypePlugins||eT,n=e.remarkPlugins||eT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...tT}:tT;return use().use(Qie).use(n).use(Gae,r).use(t)}function bse(e){const t=e.children||"",n=new I4;return typeof t=="string"&&(n.value=t),n}function xse(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||wse;for(const p of gse)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+pse+p.id,void 0);return D4(e,f),Ene(e,{Fragment:c.Fragment,components:i,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function f(p,m,y){if(p.type==="raw"&&y&&typeof m=="number")return o?y.children.splice(m,1):y.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in Fx)if(Object.hasOwn(Fx,v)&&Object.hasOwn(p.properties,v)){const w=p.properties[v],S=Fx[v];(S===null||S.includes(p.tagName))&&(p.properties[v]=d(String(w||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!v&&r&&typeof m=="number"&&(v=!r(p,m,y)),v&&y&&typeof m=="number")return u&&p.children?y.children.splice(m,1,...p.children):y.children.splice(m,1),m}}}function wse(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||mse.test(e.slice(0,t))?e:""}function Sse(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const tv=Sse();async function nT(e){const t=await fetch(`${tv}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Ci(n?.error?.message??`transcript fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function jse(e){const t=await fetch(`${tv}/projects/${encodeURIComponent(e)}/agent/providers`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Ci(n?.error?.message??`providers fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function Nse(e){const t=await fetch(`${tv}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Ci(n?.error?.message??`reset failed: ${t.status}`,t.status,n?.error?.code)}}async function kse({project:e,prompt:t,provider:n,modelId:r,scope:i,signal:a,onEvent:o}){const u={prompt:t};n&&(u.provider=n),r&&(u.modelId=r),i&&(u.scope=i);const d=await fetch(`${tv}/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 Ci(v?.error?.message??`prompt failed: ${d.status}`,d.status,v?.error?.code)}const f=d.body.getReader(),p=new TextDecoder;let m="";const y=()=>{f.cancel().catch(()=>{})};a?.addEventListener("abort",y,{once:!0});try{for(;;){const{value:v,done:w}=await f.read();if(w)break;m+=p.decode(v,{stream:!0});let S=m.indexOf(`
110
+
111
+ `);for(;S!==-1;){const j=m.slice(0,S);m=m.slice(S+2);for(const k of j.split(`
112
+ `)){if(!k.startsWith("data:"))continue;const A=k.slice(5).trim();if(A)try{o(JSON.parse(A))}catch{}}S=m.indexOf(`
113
+
114
+ `)}}}finally{a?.removeEventListener("abort",y);try{f.releaseLock()}catch{}}}function L4(e){return!e||e.role!=="assistant"?"":e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}const Cse=[{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?"}],_se=[{command:"/status",label:"Status",hint:"Latest runs, health, anything unusual",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{command:"/insights",label:"Top insights",hint:"Walk through the most severe active insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{command:"/last-run",label:"Last run",hint:"Summarize the latest sweep",prompt:"Summarize the latest run for this project — provider mix, visibility changes, and anything that moved."},{command:"/last-failed",label:"Last failed run",hint:"Diagnose the most recent failure",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{command:"/run-sweep",label:"Run sweep now",hint:"Trigger a new visibility sweep",prompt:"Run a new answer-visibility sweep for this project now and tell me when it lands."},{command:"/schedule",label:"Schedule",hint:"Review the sweep schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"},{command:"/keywords",label:"Keywords",hint:"List tracked keywords",prompt:"List the tracked keywords for this project and flag any that are obvious duplicates or underperformers."},{command:"/competitors",label:"Competitors",hint:"List tracked competitors",prompt:"List this project's tracked competitors and call out which ones are showing up in answer citations."}],ym=e=>`canonry:aero:provider:${e}`,rT=e=>`canonry:aero:scope:${e}`;function Ase({projectName:e}){const[t,n]=b.useState(!1),[r,i]=b.useState(!1),[a,o]=b.useState([]),[u,d]=b.useState(""),[f,p]=b.useState(!1),[m,y]=b.useState([]),[v,w]=b.useState(""),[S,j]=b.useState(null),[k,A]=b.useState(()=>typeof window>"u"?null:window.localStorage.getItem(ym(e))??null),[_,C]=b.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(rT(e))==="all"?"all":"read-only"),P=b.useRef(null),E=b.useRef(null),O=b.useRef(null),[T,M]=b.useState(0),q=b.useMemo(()=>{const F=u.trimStart();if(!F.startsWith("/"))return[];if(/\s/.test(F))return[];const D=F.toLowerCase();return _se.filter(Y=>Y.command.startsWith(D)||Y.label.toLowerCase().includes(D.slice(1)))},[u]);b.useEffect(()=>{M(F=>q.length===0?0:Math.min(F,q.length-1))},[q.length]);const $=ns({queryKey:Ar.agent.providers(e),queryFn:()=>jse(e),enabled:t,staleTime:6e4}),L=b.useMemo(()=>{const F=$.data?.providers??[];if(k){const Y=F.find(se=>se.id===k&&se.configured);if(Y)return Y}const D=$.data?.defaultProvider;return D?F.find(Y=>Y.id===D)??null:null},[k,$.data]);b.useEffect(()=>{if(!$.data||!k)return;$.data.providers.find(D=>D.id===k&&D.configured)||(A(null),window.localStorage.removeItem(ym(e)))},[$.data,k,e]);const J=b.useCallback(F=>{A(F),!(typeof window>"u")&&(F?window.localStorage.setItem(ym(e),F):window.localStorage.removeItem(ym(e)))},[e]),ae=b.useCallback(()=>{C(F=>{const D=F==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(rT(e),D),D})},[e]);b.useEffect(()=>{if(!t)return;const F=D=>{D.key==="Escape"&&(r?i(!1):n(!1))};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[t,r]),b.useEffect(()=>{if(!t)return;let F=!1;j(null);const D=()=>{F||f||nT(e).then(ie=>{F||o(ie.messages)}).catch(ie=>{F||j(ie instanceof Error?ie.message:"Failed to load transcript")})};D();const se=window.setInterval(D,15e3);return()=>{F=!0,window.clearInterval(se)}},[t,e,f]),b.useEffect(()=>()=>{P.current?.abort()},[e]),b.useEffect(()=>{const F=E.current;F&&(F.scrollTop=F.scrollHeight)},[a,v,m]);async function Z(F){const D=F.trim();if(!D||f)return;j(null),d(""),p(!0),w(""),y([]);const Y={role:"user",content:D,timestamp:Date.now()};o(ie=>[...ie,Y]);const se=new AbortController;P.current=se;try{await kse({project:e,prompt:D,provider:k??void 0,scope:_,signal:se.signal,onEvent:H});const ie=await nT(e);o(ie.messages)}catch(ie){ie.name!=="AbortError"&&j(ie instanceof Error?ie.message:"Prompt failed")}finally{p(!1),w(""),P.current=null}}function H(F){switch(F.type){case"message_update":w(L4(F.message));break;case"message_end":F.message.role==="assistant"&&w("");break;case"tool_execution_start":y(D=>[...D,{id:F.toolCallId,name:F.toolName,args:F.args,startedAt:Date.now()}]);break;case"tool_execution_end":y(D=>D.map(Y=>Y.id===F.toolCallId?{...Y,endedAt:Date.now(),isError:F.isError,result:F.result}:Y));break;case"error":j(F.message);break}}async function Q(){P.current?.abort();try{await Nse(e),o([]),j(null)}catch(F){j(F instanceof Error?F.message:"Reset failed")}}const he=a.length===0,we=t&&r?"pointer-events-auto fixed inset-0 z-40 flex items-stretch justify-center bg-zinc-950/70 p-4 sm:p-8 backdrop-blur-sm":"pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center p-3",R=r?"pointer-events-auto flex h-full w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-2xl":"pointer-events-auto w-full max-w-3xl",U=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 c.jsx("div",{className:we,onClick:F=>{r&&F.target===F.currentTarget&&i(!1)},children:c.jsx("div",{className:R,children:t?c.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:[c.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(v2,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),c.jsx("span",{className:"text-sm font-medium text-zinc-100",children:"Aero"}),c.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:f?"working…":e})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(Ose,{providers:$.data?.providers??[],active:L,override:k,onPick:J,disabled:f}),c.jsx("button",{type:"button",onClick:Q,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:c.jsx(JI,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),c.jsx("button",{type:"button",onClick:()=>i(F=>!F),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?c.jsx(_G,{className:"h-3.5 w-3.5","aria-hidden":"true"}):c.jsx(jG,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),c.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:c.jsx(ih,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),c.jsxs("div",{ref:E,className:U,children:[S&&c.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:S}),he&&!f&&c.jsxs("div",{className:"flex flex-col gap-3 py-2",children:[c.jsxs("p",{className:"text-xs text-zinc-500",children:["Ask anything about ",c.jsx("span",{className:"text-zinc-300",children:e}),", or start with:"]}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:Cse.map(F=>c.jsx("button",{type:"button",onClick:()=>Z(F.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:F.label},F.label))})]}),Rse(a,e,k,_),m.length>0&&c.jsx("div",{className:"mt-3 space-y-1.5",children:m.map(F=>c.jsx($4,{trail:F},F.id))}),f&&v&&c.jsxs("div",{className:"mt-3",children:[c.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),c.jsx(B4,{content:v})]}),f&&!v&&m.every(F=>F.endedAt!==void 0)&&c.jsx(Lse,{})]}),c.jsx(Ese,{projectName:e,activeProvider:L,scope:_,onToggleScope:ae,disabled:f}),c.jsxs("div",{className:"relative",children:[q.length>0&&c.jsx(zse,{matches:q,selectedIndex:T,onHover:M,onPick:F=>{d(""),O.current?.focus(),Z(F.prompt)}}),c.jsxs("form",{className:"flex items-end gap-2 border-t border-zinc-800/70 bg-zinc-950/80 px-3 py-2.5",onSubmit:F=>{if(F.preventDefault(),q.length>0){const D=q[T];d(""),Z(D.prompt);return}Z(u)},children:[c.jsx("textarea",{ref:O,value:u,onChange:F=>d(F.target.value),onKeyDown:F=>{if(q.length>0){if(F.key==="ArrowDown"){F.preventDefault(),M(D=>(D+1)%q.length);return}if(F.key==="ArrowUp"){F.preventDefault(),M(D=>(D-1+q.length)%q.length);return}if(F.key==="Tab"){F.preventDefault();const D=q[T];d(`${D.command} `);return}if(F.key==="Escape"){F.preventDefault(),d("");return}}if(F.key==="Enter"&&!F.shiftKey)if(F.preventDefault(),q.length>0){const D=q[T];d(""),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"}),c.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:c.jsx(nG,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}):c.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:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(v2,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Ask Aero about ",e,"…"]}),c.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-600",children:"Enter"})]})})})}function Ose({providers:e,active:t,override:n,onPick:r,disabled:i}){const[a,o]=b.useState(!1),u=b.useRef(null);if(b.useEffect(()=>{if(!a)return;const p=y=>{u.current?.contains(y.target)||o(!1)},m=y=>{y.key==="Escape"&&o(!1)};return window.addEventListener("mousedown",p),window.addEventListener("keydown",m),()=>{window.removeEventListener("mousedown",p),window.removeEventListener("keydown",m)}},[a]),e.length===0)return null;const d=t?.label.replace(/\s+\(.+\)$/,"")??"No provider",f=t?.defaultModel;return c.jsxs("div",{ref:u,className:"relative",children:[c.jsxs("button",{type:"button",onClick:()=>o(p=>!p),disabled:i,className:"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-zinc-400 transition hover:bg-zinc-800/60 hover:text-zinc-200 disabled:opacity-50","aria-label":"Switch agent model","aria-haspopup":"listbox","aria-expanded":a,title:t?`${t.label} · ${t.defaultModel}`:"Pick a provider",children:[c.jsx("span",{className:"font-medium text-zinc-200",children:d}),f&&c.jsx("span",{className:"hidden font-mono text-[10px] text-zinc-500 sm:inline",children:f}),c.jsx(aG,{className:"h-3 w-3","aria-hidden":"true"})]}),a&&c.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:[c.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-2 text-[10px] uppercase tracking-wider text-zinc-500",children:"Aero provider"}),c.jsx("ul",{className:"max-h-72 overflow-y-auto py-1",children:e.map(p=>{const m=t?.id===p.id,y=n===p.id;return c.jsx("li",{children:c.jsxs("button",{type:"button",role:"option","aria-selected":m,disabled:!p.configured,onClick:()=>{p.configured&&(r(y?null:p.id),o(!1))},className:"flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition enabled:hover:bg-zinc-900 disabled:cursor-not-allowed disabled:opacity-50",children:[c.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:m?c.jsx(ZI,{className:"h-3 w-3 text-emerald-400","aria-hidden":"true"}):null}),c.jsxs("span",{className:"flex-1",children:[c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"font-medium text-zinc-100",children:p.label}),y&&c.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&&c.jsx("span",{className:"rounded-full border border-zinc-800 px-1.5 text-[9px] uppercase tracking-wider text-zinc-500",children:"Key missing"})]}),c.jsx("span",{className:"mt-0.5 block font-mono text-[10px] text-zinc-500",children:p.defaultModel}),p.keySource==="env"&&c.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!p.configured&&c.jsxs("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:["Add key in config.yaml or export"," ",c.jsx("code",{className:"font-mono text-zinc-400",children:Tse(p.id)})]})]})]})},p.id)})}),n&&c.jsx("button",{type:"button",onClick:()=>{r(null),o(!1)},className:"w-full border-t border-zinc-800/60 px-3 py-2 text-left text-[11px] text-zinc-400 transition hover:bg-zinc-900 hover:text-zinc-100",children:"Reset to auto-detected default"})]})]})}function Ese({projectName:e,activeProvider:t,scope:n,onToggleScope:r,disabled:i}){const a=t?.label.replace(/\s+\(.+\)$/,"")??null,o=n==="all";return c.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:[c.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:[c.jsx("span",{className:"text-zinc-600",children:"project"}),c.jsx("span",{className:"font-medium text-zinc-200",children:e})]}),a&&c.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:[c.jsx("span",{className:"text-zinc-600",children:"model"}),c.jsx("span",{className:"font-medium text-zinc-200",children:a})]}),c.jsxs("button",{type:"button",onClick:r,disabled:i,className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] transition disabled:opacity-50 ${o?"border-amber-800/60 bg-amber-950/40 text-amber-300 hover:border-amber-700 hover:text-amber-200":"border-zinc-800 bg-zinc-900/70 text-zinc-400 hover:border-zinc-700 hover:text-zinc-200"}`,title:o?"Aero can invoke write tools (run sweep, dismiss insight, etc). Click to restrict.":"Aero is restricted to read-only tools. Click to allow writes.",children:[c.jsx("span",{className:o?"text-amber-500":"text-zinc-600",children:"scope"}),c.jsx("span",{className:"font-medium",children:o?"all tools":"read-only"})]})]})}function zse({matches:e,selectedIndex:t,onHover:n,onPick:r}){return c.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:[c.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500",children:"Commands"}),c.jsx("ul",{role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:e.map((i,a)=>{const o=a===t;return c.jsx("li",{children:c.jsxs("button",{type:"button",role:"option","aria-selected":o,onMouseEnter:()=>n(a),onClick:()=>r(i),className:`flex w-full items-center gap-3 px-3 py-1.5 text-left text-xs transition ${o?"bg-zinc-900 text-zinc-100":"text-zinc-300 hover:bg-zinc-900/60"}`,children:[c.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:i.command}),c.jsx("span",{className:"font-medium",children:i.label}),c.jsx("span",{className:"ml-auto text-[10px] text-zinc-500",children:i.hint})]})},i.command)})}),c.jsxs("div",{className:"border-t border-zinc-800/60 px-3 py-1.5 text-[10px] text-zinc-600",children:[c.jsx("span",{className:"mr-3",children:"↑↓ to select"}),c.jsx("span",{className:"mr-3",children:"Enter to run"}),c.jsx("span",{children:"Tab to autocomplete"})]})]})}function Tse(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 Pse(e,t){const n=e.timestamp??0;return`${e.role}:${n}:${t}`}function Rse(e,t,n,r){const i=[];for(let a=0;a<e.length;a++){const o=e[a],u=Pse(o,a);if(o.role==="user"){const d=typeof o.content=="string"?o.content:JSON.stringify(o.content);if(d.startsWith("[system]"))continue;i.push(c.jsx(Mse,{text:d,projectName:t,providerOverride:n,scope:r},u));continue}if(o.role==="assistant"){const d=new Map;let f=a+1;for(;f<e.length&&e[f].role==="toolResult";){const y=e[f];d.set(y.toolCallId,y),f++}const p=Ise(o,d,o.timestamp??0),m=L4(o);i.push(c.jsxs(b.Fragment,{children:[p.length>0&&c.jsx("div",{className:"mt-3 space-y-1.5",children:p.map(y=>c.jsx($4,{trail:y},y.id))}),m.trim()&&c.jsxs("div",{className:"mt-3",children:[c.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),c.jsx(B4,{content:m})]})]},u)),a=f-1;continue}}return i}function Mse({text:e,projectName:t,providerOverride:n,scope:r}){const[i,a]=b.useState(!1),o=b.useMemo(()=>Dse(t,e,n,r),[t,e,n,r]);async function u(){try{await navigator.clipboard.writeText(o),a(!0),window.setTimeout(()=>a(!1),1500)}catch{}}return c.jsxs("div",{className:"group relative mt-3 rounded-md bg-zinc-900/60 px-3 py-2 text-zinc-200",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("div",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"You"}),c.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:o,children:i?c.jsxs(c.Fragment,{children:[c.jsx(ZI,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):c.jsxs(c.Fragment,{children:[c.jsx(fG,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),c.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function Dse(e,t,n,r){const i=["canonry","agent","ask",iT(e),iT(t)];return n&&i.push("--provider",n),r==="read-only"&&i.push("--scope","read-only"),i.join(" ")}function iT(e){return`'${e.replace(/'/g,"'\\''")}'`}function Ise(e,t,n){const r=[];for(const i of e.content){if(i.type!=="toolCall")continue;const a=i,o=t.get(a.id);r.push({id:a.id,name:a.name,args:a.arguments,startedAt:n,endedAt:o?.timestamp,isError:o?.isError,result:o?.content})}return r}function $4({trail:e}){const[t,n]=b.useState(!1),r=e.endedAt===void 0,i=!r&&e.isError===!0,a=e.endedAt!=null?e.endedAt-e.startedAt:null,o=a==null||a<0?null:a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`,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 c.jsxs("div",{className:`rounded-md border ${u} ${d} font-mono`,children:[c.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:[c.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:r?c.jsx(XI,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):i?c.jsx(vg,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):c.jsx(HG,{className:"h-3 w-3 text-zinc-500","aria-hidden":"true"})}),c.jsx("span",{className:"text-[11px] font-semibold text-zinc-100",children:e.name}),c.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px] text-zinc-500",children:[r?c.jsx("span",{className:"text-emerald-400",children:"running…"}):c.jsxs(c.Fragment,{children:[c.jsx("span",{children:i?"failed":"ok"}),o&&c.jsx("span",{children:o})]}),c.jsx(rh,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`,"aria-hidden":"true"})]})]}),t&&c.jsxs("div",{className:"border-t border-zinc-800/60 px-2.5 py-2 text-[11px] text-zinc-400",children:[c.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:"Args"}),c.jsx("pre",{className:"mb-2 overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:aT(e.args)}),!r&&e.result!==void 0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:i?"Error":"Result"}),c.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:aT(e.result)})]})]})]})}function aT(e){try{const t=typeof e=="string"?e:JSON.stringify(e,null,2);return t.length>2e3?`${t.slice(0,2e3)}
115
+ … (${t.length-2e3} more chars)`:t}catch{return String(e)}}function B4({content:e}){return c.jsx("div",{className:"aero-markdown text-zinc-100",children:c.jsx(yse,{components:{h1:t=>c.jsx("h1",{...t,className:"mt-3 mb-2 text-base font-semibold text-zinc-50"}),h2:t=>c.jsx("h2",{...t,className:"mt-3 mb-2 text-sm font-semibold text-zinc-50"}),h3:t=>c.jsx("h3",{...t,className:"mt-3 mb-1.5 text-sm font-semibold text-zinc-100"}),h4:t=>c.jsx("h4",{...t,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-300"}),p:t=>c.jsx("p",{...t,className:"mb-2 leading-relaxed"}),ul:t=>c.jsx("ul",{...t,className:"mb-2 ml-4 list-disc space-y-1"}),ol:t=>c.jsx("ol",{...t,className:"mb-2 ml-4 list-decimal space-y-1"}),li:t=>c.jsx("li",{...t,className:"marker:text-zinc-600"}),strong:t=>c.jsx("strong",{...t,className:"font-semibold text-zinc-50"}),em:t=>c.jsx("em",{...t,className:"text-zinc-200"}),code:({children:t,...n})=>c.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=>c.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=>c.jsx("a",{...t,className:"text-emerald-400 underline decoration-emerald-700 hover:decoration-emerald-400",target:"_blank",rel:"noopener noreferrer"}),table:t=>c.jsx("div",{className:"mb-2 overflow-x-auto",children:c.jsx("table",{...t,className:"w-full border-collapse text-xs"})}),thead:t=>c.jsx("thead",{...t,className:"border-b border-zinc-800"}),th:t=>c.jsx("th",{...t,className:"px-2 py-1 text-left font-semibold text-zinc-300"}),tr:t=>c.jsx("tr",{...t,className:"border-b border-zinc-900"}),td:t=>c.jsx("td",{...t,className:"px-2 py-1 text-zinc-200"}),blockquote:t=>c.jsx("blockquote",{...t,className:"mb-2 border-l-2 border-zinc-700 pl-3 italic text-zinc-400"}),hr:()=>c.jsx("hr",{className:"my-3 border-zinc-800"})},children:e})})}function Lse(){return c.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[c.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),c.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[c.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-emerald-400/80"}),c.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-emerald-400/60"}),c.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-emerald-400/40"})]})]})}function $se(){const e=PI(),t=/^\/projects\/([^/]+)/.exec(e.pathname),n=t?decodeURIComponent(t[1]):null,r=ns({queryKey:Ar.projects.all,queryFn:Fj,enabled:n!==null,staleTime:6e4});if(!n)return null;const i=r.data??[],a=i.find(o=>o.id===n)??i.find(o=>o.name===n);return a?c.jsx(Ase,{projectName:a.name},a.name):null}const sT=[{label:"Architecture",href:"https://github.com/AINYC/canonry/blob/main/docs/architecture.md"},{label:"Testing Guide",href:"https://github.com/AINYC/canonry/blob/main/docs/testing.md"}],oT=e=>({label:e,state:"checking",detail:"Checking service health"}),Bse={apiStatus:oT("API"),workerStatus:oT("Worker")};function Use(e){switch(e){case sn["answer-visibility"]:return"Visibility sweep";case sn["gsc-sync"]:return"GSC sync";case sn["inspect-sitemap"]:return"Sitemap inspection";case sn["ga-sync"]:return"GA sync";case sn["bing-inspect"]:return"Bing URL inspection";case sn["site-audit"]:return"Site audit";case sn["backlink-extract"]:return"Backlink extract"}}function Fse(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function qse(e){const t=Use(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function Hse(e,t){return e.error?`${t}: ${e.error}`:e.location?`${t} · ${e.location}`:t}function Kse(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function Gse(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 Vse(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function Zse(){const e=b.useSyncExternalStore(NX,Ol,Ol),t=Object.keys(e.runs).length>0||Object.keys(e.batches).length>0,n=ns({queryKey:Ar.runs.all,queryFn:MI,enabled:t}),r=ns({queryKey:Ar.projects.all,queryFn:Fj,enabled:t}),i=b.useRef({}),a=b.useCallback(()=>{n.refetch()},[n.refetch]);return b.useEffect(()=>{t&&a()},[t,a]),b.useEffect(()=>{if(!t||typeof window>"u")return;const o=()=>{document.visibilityState==="visible"&&a()};return window.addEventListener("focus",a),document.addEventListener("visibilitychange",o),()=>{window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",o)}},[t,a]),b.useEffect(()=>{const o=n.data??[],u=r.data??[],d=Object.fromEntries(o.map(p=>[p.id,p])),f=Object.fromEntries(o.map(p=>[p.id,p.status]));for(const p of Object.values(e.runs)){const m=d[p.runId];if(!m||!rN(m.status)||(i.current[m.id]??p.lastAnnouncedStatus)===m.status)continue;if(p.sourceAction==="run-all"){K2(m.id);continue}const v=Kse(m.projectId,p.projectLabel,u);ht({title:qse(m),detail:Hse(m,v),tone:Fse(m.status),dedupeKey:`run:${m.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:m.id}}),K2(m.id)}for(const p of Object.values(e.batches)){const m=_X(p.runIds,d);m.finished&&(ht({title:"Run-all batch finished",detail:Gse(m,p.skippedCount),tone:Vse(m),dedupeKey:`batch:${p.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),CX(p.batchId))}i.current=f},[r.data,n.data,e]),null}function Yse(){const e=sh(),{dashboard:t,isLoading:n,refetch:r}=Kl(),o=Qy(!e,e?.health).data??e?.health??Bse,u=PI(),{runId:d,evidenceId:f,closeDrawer:p}=Pu(),[m,y]=b.useState(!1),v=Xte(d),w=v.data??null,S=v.isLoading;b.useEffect(()=>{w&&w.status!=="running"&&w.status!=="queued"&&r()},[w?.status,r]),b.useEffect(()=>{y(!1)},[u.pathname]),b.useEffect(()=>{if(typeof window>"u"||!d&&!f)return;const C=P=>{P.key==="Escape"&&p()};return window.addEventListener("keydown",C),()=>{window.removeEventListener("keydown",C)}},[d,f,p]);const j=t??e?.dashboard??null,k=d&&j?wte(j,d):void 0,A=f&&j?Ste(j,f):void 0,_=(()=>{const C=u.pathname;if(C==="/")return"Portfolio";if(C==="/projects")return"Projects";if(C==="/runs")return"Runs";if(C==="/settings")return"Settings";if(C==="/setup")return"Setup";if(C==="/backlinks")return"Backlinks";if(C.startsWith("/projects/")){const E=C.split("/").filter(Boolean)[1];if(E&&j){const O=j.projects.find(T=>T.project.id===E);if(O)return O.project.name}return"Project"}return"Not found"})();return c.jsxs("div",{className:"app-shell",children:[c.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),c.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[c.jsx("div",{className:"sidebar-brand",children:c.jsx(tz,{})}),c.jsxs("nav",{className:"sidebar-nav",children:[c.jsxs(qt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[c.jsx(bG,{className:"sidebar-icon"}),c.jsx("span",{children:"Overview"})]}),c.jsxs(qt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[c.jsx(yG,{className:"sidebar-icon"}),c.jsx("span",{children:"Projects"})]}),c.jsxs(qt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[c.jsx(yg,{className:"sidebar-icon"}),c.jsx("span",{children:"Runs"})]}),c.jsxs(qt,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[c.jsx(QI,{className:"sidebar-icon"}),c.jsx("span",{children:"Backlinks"})]}),c.jsxs(qt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[c.jsx(MG,{className:"sidebar-icon"}),c.jsx("span",{children:"Settings"})]}),n?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(C=>c.jsxs("div",{className:"sidebar-skeleton-item",children:[c.jsx("span",{className:"skeleton-circle size-2"}),c.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+C*15}%`}})]},C))]}):j&&j.projects.length>0?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"sidebar-section-title",children:"Projects"}),j.projects.map(C=>{const P=C.visibilitySummary.tone;return c.jsxs(qt,{to:"/projects/$projectId",params:{projectId:C.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[c.jsx("span",{className:`sidebar-dot sidebar-dot-${P}`}),c.jsx("span",{children:C.project.name})]},C.project.id)})]}):n?null:c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"sidebar-section-title",children:"Resources"}),c.jsxs(qt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[c.jsx(TG,{className:"sidebar-icon"}),c.jsx("span",{children:"Setup"})]})]})]}),c.jsx("div",{className:"sidebar-footer",children:sT.map(C=>c.jsx("a",{className:"sidebar-footer-link",href:C.href,target:"_blank",rel:"noopener noreferrer",children:C.label},C.href))})]}),c.jsxs("div",{className:"main-area",children:[c.jsxs("header",{className:"topbar",children:[c.jsxs("div",{className:"topbar-left",children:[c.jsx("div",{className:"topbar-brand-mobile",children:c.jsx(tz,{compact:!0})}),c.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[c.jsx(qt,{to:"/",children:"Home"}),c.jsx(rh,{className:"breadcrumb-sep size-3"}),c.jsx("span",{className:"breadcrumb-current",children:_})]})]}),c.jsxs("div",{className:"topbar-actions",children:[c.jsxs("div",{className:"health-pill-row",children:[c.jsxs("span",{className:`health-pill health-pill-${o.apiStatus.state}`,title:go(o.apiStatus),children:["API ",o.apiStatus.state==="ok"?"ok":o.apiStatus.state]}),c.jsxs("span",{className:`health-pill health-pill-${o.workerStatus.state}`,title:go(o.workerStatus),children:["Worker ",o.workerStatus.state==="ok"?"ok":o.workerStatus.state]})]}),c.jsxs(ge,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":m,"aria-controls":"mobile-nav",onClick:()=>y(C=>!C),children:[c.jsx(kG,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),c.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${m?"mobile-nav-open":""}`,children:[c.jsxs(ge,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>y(!1),children:[c.jsx(ih,{className:"size-5"}),c.jsx("span",{className:"sr-only",children:"Close navigation"})]}),c.jsx(qt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),c.jsx(qt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),c.jsx(qt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),c.jsx(qt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),j&&j.projects.length>0?c.jsxs("div",{className:"mobile-nav-section",children:[c.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),j.projects.map(C=>c.jsx(qt,{to:"/projects/$projectId",params:{projectId:C.project.id},className:"mobile-nav-link",children:C.project.name},C.project.id))]}):null]}),c.jsx("main",{id:"content",className:"page-shell",children:n&&!e?c.jsxs("div",{className:"page-skeleton",children:[c.jsxs("div",{className:"page-skeleton-header",children:[c.jsx("div",{className:"skeleton-text h-6 w-40"}),c.jsx("div",{className:"skeleton-text-sm w-72"})]}),c.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(C=>c.jsxs("div",{className:"page-skeleton-card",children:[c.jsx("div",{className:"skeleton-text w-24"}),c.jsx("div",{className:"skeleton-text w-full"}),c.jsx("div",{className:"skeleton-text-sm w-3/4"})]},C))}),c.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(C=>c.jsxs("div",{className:"page-skeleton-card",children:[c.jsx("div",{className:"skeleton-text w-20"}),c.jsx("div",{className:"space-y-2",children:[1,2,3].map(P=>c.jsx("div",{className:"skeleton-text-sm w-full"},P))})]},C))})]}):c.jsx(Uj,{})}),c.jsxs("footer",{className:"footer",children:[c.jsxs("a",{href:"https://github.com/AINYC/canonry",target:"_blank",rel:"noopener noreferrer",className:"footer-brand",children:[c.jsx(mG,{className:"size-3.5"}),c.jsx("span",{children:"Canonry"})]}),c.jsx("div",{className:"footer-links",children:sT.map(C=>c.jsx("a",{href:C.href,target:"_blank",rel:"noopener noreferrer",children:C.label},C.href))})]})]}),k?c.jsxs(fte,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:p,children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[c.jsx(Gy,{status:k.status}),c.jsx("span",{className:"text-zinc-400",children:k.startedAt}),c.jsx("span",{className:"text-zinc-500",children:k.duration}),c.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&c.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.statusDetail}),c.jsxs("div",{className:"mt-4",children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),S?c.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):w&&w.snapshots.length>0?c.jsxs("div",{className:"space-y-2",children:[w.snapshots.map(C=>c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[c.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:C.keyword??"Unknown key phrase"}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(zf,{provider:C.provider}),c.jsx(d5,{variant:C.citationState==="cited"?"success":"neutral",children:C.citationState})]})]}),C.model&&c.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:C.model}),C.citedDomains.length>0&&c.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[c.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",C.citedDomains.join(", ")]}),C.competitorOverlap.length>0&&c.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",C.competitorOverlap.join(", ")]}),C.groundingSources&&C.groundingSources.length>0&&c.jsxs("details",{className:"mt-2",children:[c.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[C.groundingSources.length," grounding source",C.groundingSources.length!==1?"s":""]}),c.jsx("ul",{className:"mt-1 space-y-0.5",children:C.groundingSources.map((P,E)=>c.jsx("li",{className:"text-xs text-zinc-500 truncate",children:c.jsx("a",{href:P.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:P.title||P.uri})},E))})]}),C.answerText&&c.jsxs("details",{className:"mt-1",children:[c.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),c.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:C.answerText})]})]},C.id)),w.status==="running"&&c.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[c.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Querying remaining key phrases..."]})]}):w&&w.status==="running"?c.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[c.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first key phrase result..."]}):w&&w.status==="queued"?c.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[c.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):w&&w.error?c.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[c.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),c.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:dX(w.error)})]}):c.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,A?c.jsx(pte,{evidence:A.evidence,project:A.project,onClose:p}):null,c.jsx(Zse,{}),c.jsx(tne,{}),c.jsx($se,{})]})}class Wse extends b.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?c.jsx("div",{className:"page-container",children:c.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[c.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:c.jsx(vg,{className:"size-6 text-rose-400"})}),c.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),c.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),c.jsxs("div",{className:"flex gap-3 mt-2",children:[c.jsxs(ge,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[c.jsx(JI,{className:"size-3.5 mr-1.5"}),"Try again"]}),c.jsx(ge,{variant:"secondary",size:"sm",onClick:()=>{const t=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=t||"/"},children:"Go home"})]})]})}):this.props.children}}const qe=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Ti("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}));qe.displayName="Card";const y1=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Ti("flex flex-col gap-1.5 p-5",e),...t}));y1.displayName="CardHeader";const v1=b.forwardRef(({className:e,...t},n)=>c.jsx("h3",{ref:n,className:Ti("font-medium tracking-tight text-zinc-50",e),...t}));v1.displayName="CardTitle";const b1=b.forwardRef(({className:e,...t},n)=>c.jsx("p",{ref:n,className:Ti("text-sm text-zinc-500",e),...t}));b1.displayName="CardDescription";const Qm=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Ti("p-5 pt-0",e),...t}));Qm.displayName="CardContent";function Qse({points:e,tone:t}){const n=b.useId();if(e.length===0)return null;const r=42,i=132,a=5,o=Math.min(...e),d=Math.max(...e)-o||1,f=i-a*2,p=r-a*2,m=e.map((y,v)=>{const w=a+v/Math.max(e.length-1,1)*f,S=a+(1-(y-o)/d)*p;return`${w},${S}`}).join(" ");return c.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${i} ${r}`,"aria-hidden":"true",children:[c.jsx("defs",{children:c.jsx("clipPath",{id:n,children:c.jsx("rect",{x:a,y:a,width:f,height:p,rx:"8"})})}),c.jsx("line",{className:"sparkline-guide",x1:a,x2:i-a,y1:r-a,y2:r-a}),c.jsx("polyline",{clipPath:`url(#${n})`,points:m,vectorEffect:"non-scaling-stroke"})]})}function Xse({project:e}){return c.jsxs(qt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[c.jsxs("div",{className:"project-row-primary",children:[c.jsxs("div",{children:[c.jsx("p",{className:"project-name",children:e.project.name}),c.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),c.jsx("p",{className:"project-insight",children:e.insight})]}),c.jsx("div",{className:"project-row-stat",children:c.jsxs("div",{className:"metric-inline-block",children:[c.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),c.jsx("p",{className:`metric-inline-value ${e.visibilityTone==="caution"?"text-amber-400":""}`,children:e.visibilityScore}),c.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta}),e.providerCoverage&&c.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),c.jsx("div",{className:"project-row-stat",children:c.jsxs("div",{className:"metric-inline-block",children:[c.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),c.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),c.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",qy(e.lastRun.status)]})]})}),c.jsx("div",{className:"project-row-chart",children:c.jsx(Qse,{points:e.trend,tone:HL(e.lastRun.status)})}),c.jsx("span",{className:"project-row-link",children:c.jsx(rh,{className:"h-4 w-4 text-zinc-500"})})]})}function Jse(){const e=sh(),{dashboard:t,isLoading:n}=Kl(),r=t??e?.dashboard;if(!r||n)return c.jsxs("div",{className:"page-skeleton",children:[c.jsxs("div",{className:"page-skeleton-header",children:[c.jsx("div",{className:"skeleton-text h-6 w-32"}),c.jsx("div",{className:"skeleton-text-sm w-64"})]}),c.jsx("div",{className:"space-y-3",children:[1,2,3].map(p=>c.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[c.jsxs("div",{className:"flex-1 space-y-2",children:[c.jsx("div",{className:"skeleton-text w-36"}),c.jsx("div",{className:"skeleton-text-sm w-48"})]}),c.jsx("div",{className:"skeleton-text w-16"}),c.jsx("div",{className:"skeleton-text w-16"}),c.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},p))})]});const i=r.portfolioOverview,u=Qy(!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=yX(i.systemHealth,u,r.settings),{openRun:f}=Pu();return c.jsxs("div",{className:"page-container",children:[c.jsxs("div",{className:"page-header",children:[c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Portfolio"}),c.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),c.jsx("div",{className:"page-header-right",children:c.jsx("p",{className:"text-[11px] text-zinc-600",children:i.lastUpdatedAt})})]}),i.projects.length>0?c.jsx("div",{className:"project-list project-list-scrollable",children:i.projects.map(p=>c.jsx(Xse,{project:p},p.project.id))}):c.jsxs(qe,{className:"surface-card empty-card",children:[c.jsx("h3",{children:i.emptyState?.title??"No projects yet"}),c.jsx("p",{className:"supporting-copy",children:i.emptyState?.detail}),c.jsx(ge,{size:"sm",asChild:!0,children:c.jsx(qt,{to:i.emptyState?.ctaHref==="/setup"||!i.emptyState?.ctaHref?"/setup":"/",children:i.emptyState?.ctaLabel??"Launch setup"})})]}),c.jsxs("div",{className:"overview-secondary-grid",children:[i.attentionItems.length>0&&c.jsxs("section",{className:"overview-secondary-section",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),c.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),c.jsx("div",{className:"attention-list attention-list-scrollable",children:i.attentionItems.map(p=>c.jsxs(qt,{to:p.href,className:`attention-item attention-item-${p.tone}`,children:[c.jsxs("div",{children:[c.jsx("p",{className:"attention-title",children:p.title}),c.jsx("p",{className:"attention-detail",children:p.detail})]}),c.jsx("span",{className:"attention-action",children:p.actionLabel})]},p.id))})]}),c.jsxs("section",{className:"overview-secondary-section",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),c.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),c.jsx("div",{className:"compact-stack compact-stack-scrollable",children:i.recentRuns.length>0?i.recentRuns.map(p=>c.jsxs("button",{className:"compact-run",type:"button",onClick:()=>f(p.id),children:[c.jsxs("div",{children:[c.jsx("p",{className:"compact-run-title",children:p.projectName}),c.jsx("p",{className:"compact-run-detail",children:p.summary})]}),c.jsx(Gy,{status:p.status})]},p.id)):c.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),c.jsxs("section",{className:"page-section",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),c.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),c.jsx("div",{className:"health-grid",children:d.map(p=>c.jsxs(qe,{className:"surface-card compact-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:p.label}),c.jsx("h3",{children:p.detail})]}),c.jsx(vt,{tone:p.tone,title:p.id==="api"?go(u.apiStatus):p.id==="worker"?go(u.workerStatus):void 0,children:p.label})]}),c.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const ON=Symbol.for("yaml.alias"),x1=Symbol.for("yaml.document"),co=Symbol.for("yaml.map"),U4=Symbol.for("yaml.pair"),va=Symbol.for("yaml.scalar"),Du=Symbol.for("yaml.seq"),_i=Symbol.for("yaml.node.type"),Vl=e=>!!e&&typeof e=="object"&&e[_i]===ON,nv=e=>!!e&&typeof e=="object"&&e[_i]===x1,ch=e=>!!e&&typeof e=="object"&&e[_i]===co,xn=e=>!!e&&typeof e=="object"&&e[_i]===U4,Gt=e=>!!e&&typeof e=="object"&&e[_i]===va,uh=e=>!!e&&typeof e=="object"&&e[_i]===Du;function vn(e){if(e&&typeof e=="object")switch(e[_i]){case co:case Du:return!0}return!1}function bn(e){if(e&&typeof e=="object")switch(e[_i]){case ON:case co:case va:case Du:return!0}return!1}const F4=e=>(Gt(e)||vn(e))&&!!e.anchor,rl=Symbol("break visit"),eoe=Symbol("skip children"),xf=Symbol("remove node");function Iu(e,t){const n=toe(t);nv(e)?Jc(null,e.contents,n,Object.freeze([e]))===xf&&(e.contents=null):Jc(null,e,n,Object.freeze([]))}Iu.BREAK=rl;Iu.SKIP=eoe;Iu.REMOVE=xf;function Jc(e,t,n,r){const i=noe(e,t,n,r);if(bn(i)||xn(i))return roe(e,r,i),Jc(e,i,n,r);if(typeof i!="symbol"){if(vn(t)){r=Object.freeze(r.concat(t));for(let a=0;a<t.items.length;++a){const o=Jc(a,t.items[a],n,r);if(typeof o=="number")a=o-1;else{if(o===rl)return rl;o===xf&&(t.items.splice(a,1),a-=1)}}}else if(xn(t)){r=Object.freeze(r.concat(t));const a=Jc("key",t.key,n,r);if(a===rl)return rl;a===xf&&(t.key=null);const o=Jc("value",t.value,n,r);if(o===rl)return rl;o===xf&&(t.value=null)}}return i}function toe(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 noe(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(ch(t))return n.Map?.(e,t,r);if(uh(t))return n.Seq?.(e,t,r);if(xn(t))return n.Pair?.(e,t,r);if(Gt(t))return n.Scalar?.(e,t,r);if(Vl(t))return n.Alias?.(e,t,r)}function roe(e,t,n){const r=t[t.length-1];if(vn(r))r.items[e]=n;else if(xn(r))e==="key"?r.key=n:r.value=n;else if(nv(r))r.contents=n;else{const i=Vl(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const ioe={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},aoe=e=>e.replace(/[!,[\]{}]/g,t=>ioe[t]);class dr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},dr.defaultYaml,t),this.tags=Object.assign({},dr.defaultTags,n)}clone(){const t=new dr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new dr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:dr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},dr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:dr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},dr.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[a,o]=r;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[a]=r;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const o=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const a=this.tags[r];if(a)try{return a+decodeURIComponent(i)}catch(o){return n(String(o)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+aoe(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&&bn(t.contents)){const a={};Iu(t.contents,(o,u)=>{bn(u)&&u.tag&&(a[u.tag]=!0)}),i=Object.keys(a)}else i=[];for(const[a,o]of r)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(u=>u.startsWith(o)))&&n.push(`%TAG ${a} ${o}`);return n.join(`
116
+ `)}}dr.defaultYaml={explicit:!1,version:"1.2"};dr.defaultTags={"!!":"tag:yaml.org,2002:"};function q4(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 H4(e){const t=new Set;return Iu(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function K4(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function soe(e,t){const n=[],r=new Map;let i=null;return{onAnchor:a=>{n.push(a),i??(i=H4(e));const o=K4(t,i);return i.add(o),o},setAnchors:()=>{for(const a of n){const o=r.get(a);if(typeof o=="object"&&o.anchor&&(Gt(o.node)||vn(o.node)))o.node.anchor=o.anchor;else{const u=new Error("Failed to resolve repeated object (this should not happen)");throw u.source=a,u}}},sourceObjects:r}}function eu(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,a=r.length;i<a;++i){const o=r[i],u=eu(e,r,String(i),o);u===void 0?delete r[i]:u!==o&&(r[i]=u)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const a=r.get(i),o=eu(e,r,i,a);o===void 0?r.delete(i):o!==a&&r.set(i,o)}else if(r instanceof Set)for(const i of Array.from(r)){const a=eu(e,r,i,i);a===void 0?r.delete(i):a!==i&&(r.delete(i),r.add(a))}else for(const[i,a]of Object.entries(r)){const o=eu(e,r,i,a);o===void 0?delete r[i]:o!==a&&(r[i]=o)}return e.call(t,n,r)}function Ni(e,t,n){if(Array.isArray(e))return e.map((r,i)=>Ni(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!F4(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 EN{constructor(t){Object.defineProperty(this,_i,{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(!nv(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},u=Ni(this,"",o);if(typeof i=="function")for(const{count:d,res:f}of o.anchors.values())i(f,d);return typeof a=="function"?eu(a,{"":u},"",u):u}}class zN extends EN{constructor(t){super(ON),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=[],Iu(t,{Node:(a,o)=>{(Vl(o)||F4(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let i;for(const a of r){if(a===this)break;a.anchor===this.source&&(i=a)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:a}=n,o=this.resolve(i,n);if(!o){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let u=r.get(o);if(u||(Ni(o,null,n),u=r.get(o)),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=Xm(i,o,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(q4(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 Xm(e,t,n){if(Vl(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(vn(t)){let r=0;for(const i of t.items){const a=Xm(e,i,n);a>r&&(r=a)}return r}else if(xn(t)){const r=Xm(e,t.key,n),i=Xm(e,t.value,n);return Math.max(r,i)}return 1}const G4=e=>!e||typeof e!="function"&&typeof e!="object";class tt extends EN{constructor(t){super(va),this.value=t}toJSON(t,n){return n?.keep?this.value:Ni(this.value,t,n)}toString(){return String(this.value)}}tt.BLOCK_FOLDED="BLOCK_FOLDED";tt.BLOCK_LITERAL="BLOCK_LITERAL";tt.PLAIN="PLAIN";tt.QUOTE_DOUBLE="QUOTE_DOUBLE";tt.QUOTE_SINGLE="QUOTE_SINGLE";const ooe="tag:yaml.org,2002:";function loe(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 Mf(e,t,n){if(nv(e)&&(e=e.contents),bn(e))return e;if(xn(e)){const m=n.schema[co].createNode?.(n.schema,null,n);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:u}=n;let d;if(r&&e&&typeof e=="object"){if(d=u.get(e),d)return d.anchor??(d.anchor=i(e)),new zN(d.anchor);d={anchor:null,node:null},u.set(e,d)}t?.startsWith("!!")&&(t=ooe+t.slice(2));let f=loe(e,t,o.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new tt(e);return d&&(d.node=m),m}f=e instanceof Map?o[co]:Symbol.iterator in Object(e)?o[Du]:o[co]}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 tt(e);return t?p.tag=t:f.default||(p.tag=f.tag),d&&(d.node=p),p}function Eg(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const a=t[i];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const o=[];o[a]=r,r=o}else r=new Map([[a,r]])}return Mf(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 df=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class V4 extends EN{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=>bn(r)||xn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(df(t))this.add(n);else{const[r,...i]=t,a=this.get(r,!0);if(vn(a))a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,Eg(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(vn(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&&Gt(a)?a.value:a:vn(a)?a.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!xn(n))return!1;const r=n.value;return r==null||t&&Gt(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 vn(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(vn(a))a.setIn(i,n);else if(a===void 0&&this.schema)this.set(r,Eg(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const coe=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ja(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const dl=(e,t,n)=>e.endsWith(`
117
+ `)?Ja(n,t):n.includes(`
118
+ `)?`
119
+ `+Ja(n,t):(e.endsWith(" ")?"":" ")+n,Z4="flow",w1="block",Jm="quoted";function rv(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,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 y,v,w=!1,S=-1,j=-1,k=-1;n===w1&&(S=lT(e,S,t.length),S!==-1&&(m=S+d));for(let _;_=e[S+=1];){if(n===Jm&&_==="\\"){switch(j=S,e[S+1]){case"x":S+=3;break;case"u":S+=5;break;case"U":S+=9;break;default:S+=1}k=S}if(_===`
120
+ `)n===w1&&(S=lT(e,S,t.length)),m=S+t.length+d,y=void 0;else{if(_===" "&&v&&v!==" "&&v!==`
121
+ `&&v!==" "){const C=e[S+1];C&&C!==" "&&C!==`
122
+ `&&C!==" "&&(y=S)}if(S>=m)if(y)f.push(y),m=y+d,y=void 0;else if(n===Jm){for(;v===" "||v===" ";)v=_,_=e[S+=1],w=!0;const C=S>k+1?S-2:j-1;if(p[C])return e;f.push(C),p[C]=!0,m=C+d,y=void 0}else w=!0}v=_}if(w&&u&&u(),f.length===0)return e;o&&o();let A=e.slice(0,f[0]);for(let _=0;_<f.length;++_){const C=f[_],P=f[_+1]||e.length;C===0?A=`
123
+ ${t}${e.slice(0,P)}`:(n===Jm&&p[C]&&(A+=`${e[C]}\\`),A+=`
124
+ ${t}${e.slice(C+1,P)}`)}return A}function lT(e,t,n){let r=t,i=t+1,a=e[i];for(;a===" "||a===" ";)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
125
+ `);r=t,i=t+1,a=e[i]}return r}const iv=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),av=e=>/^(%|---|\.\.\.)/m.test(e);function uoe(e,t,n){if(!t||t<0)return!1;const r=t-n,i=e.length;if(i<=r)return!1;for(let a=0,o=0;a<i;++a)if(e[a]===`
126
+ `){if(a-o>r)return!0;if(o=a+1,i-o<=r)return!1}return!0}function wf(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(av(e)?" ":"");let o="",u=0;for(let d=0,f=n[d];f;f=n[++d])if(f===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(o+=n.slice(u,d)+"\\ ",d+=1,u=d,f="\\"),f==="\\")switch(n[d+1]){case"u":{o+=n.slice(u,d);const p=n.substr(d+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=n.substr(d,6)}d+=5,u=d+1}break;case"n":if(r||n[d+2]==='"'||n.length<i)d+=1;else{for(o+=n.slice(u,d)+`
127
+
128
+ `;n[d+2]==="\\"&&n[d+3]==="n"&&n[d+4]!=='"';)o+=`
129
+ `,d+=2;o+=a,n[d+2]===" "&&(o+="\\"),d+=1,u=d+1}break;default:d+=1}return o=u?o+n.slice(u):n,r?o:rv(o,a,Jm,iv(t,!1))}function S1(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
130
+ `)||/[ \t]\n|\n[ \t]/.test(e))return wf(e,t);const n=t.indent||(av(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
131
+ ${n}`)+"'";return t.implicitKey?r:rv(r,n,Z4,iv(t,!1))}function tu(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=wf;else{const i=e.includes('"'),a=e.includes("'");i&&!a?r=S1:a&&!i?r=wf:r=n?S1:wf}return r(e,t)}let j1;try{j1=new RegExp(`(^|(?<!
132
+ ))
133
+ +(?!
134
+ |$)`,"g")}catch{j1=/\n+(?!\n|$)/g}function eg({comment:e,type:t,value:n},r,i,a){const{blockQuote:o,commentString:u,lineWidth:d}=r.options;if(!o||/\n[\t ]+$/.test(n))return tu(n,r);const f=r.indent||(r.forceBlockIndent||av(n)?" ":""),p=o==="literal"?!0:o==="folded"||t===tt.BLOCK_FOLDED?!1:t===tt.BLOCK_LITERAL?!0:!uoe(n,d,f.length);if(!n)return p?`|
135
+ `:`>
136
+ `;let m,y;for(y=n.length;y>0;--y){const P=n[y-1];if(P!==`
137
+ `&&P!==" "&&P!==" ")break}let v=n.substring(y);const w=v.indexOf(`
138
+ `);w===-1?m="-":n===v||w!==v.length-1?(m="+",a&&a()):m="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
139
+ `&&(v=v.slice(0,-1)),v=v.replace(j1,`$&${f}`));let S=!1,j,k=-1;for(j=0;j<n.length;++j){const P=n[j];if(P===" ")S=!0;else if(P===`
140
+ `)k=j;else break}let A=n.substring(0,k<j?k+1:j);A&&(n=n.substring(A.length),A=A.replace(/\n+/g,`$&${f}`));let C=(S?f?"2":"1":"")+m;if(e&&(C+=" "+u(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const P=n.replace(/\n+/g,`
141
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let E=!1;const O=iv(r,!0);o!=="folded"&&t!==tt.BLOCK_FOLDED&&(O.onOverflow=()=>{E=!0});const T=rv(`${A}${P}${v}`,f,w1,O);if(!E)return`>${C}
142
+ ${f}${T}`}return n=n.replace(/\n+/g,`$&${f}`),`|${C}
143
+ ${f}${A}${n}${v}`}function doe(e,t,n,r){const{type:i,value:a}=e,{actualString:o,implicitKey:u,indent:d,indentStep:f,inFlow:p}=t;if(u&&a.includes(`
144
+ `)||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(`
145
+ `)?tu(a,t):eg(e,t,n,r);if(!u&&!p&&i!==tt.PLAIN&&a.includes(`
146
+ `))return eg(e,t,n,r);if(av(a)){if(d==="")return t.forceBlockIndent=!0,eg(e,t,n,r);if(u&&d===f)return tu(a,t)}const m=a.replace(/\n+/g,`$&
147
+ ${d}`);if(o){const y=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(m),{compat:v,tags:w}=t.doc.schema;if(w.some(y)||v?.some(y))return tu(a,t)}return u?m:rv(m,d,Z4,iv(t,!1))}function TN(e,t,n,r){const{implicitKey:i,inFlow:a}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:u}=e;u!==tt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(u=tt.QUOTE_DOUBLE);const d=p=>{switch(p){case tt.BLOCK_FOLDED:case tt.BLOCK_LITERAL:return i||a?tu(o.value,t):eg(o,t,n,r);case tt.QUOTE_DOUBLE:return wf(o.value,t);case tt.QUOTE_SINGLE:return S1(o.value,t);case tt.PLAIN:return doe(o,t,n,r);default:return null}};let f=d(u);if(f===null){const{defaultKeyType:p,defaultStringType:m}=t.options,y=i&&p||m;if(f=d(y),f===null)throw new Error(`Unsupported default string type ${y}`)}return f}function Y4(e,t){const n=Object.assign({blockQuote:!0,commentString:coe,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 foe(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(Gt(t)){r=t.value;let i=e.filter(a=>a.identify?.(r));if(i.length>1){const a=i.filter(o=>o.test);a.length>0&&(i=a)}n=i.find(a=>a.format===t.format)??i.find(a=>!a.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function hoe(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],a=(Gt(e)||vn(e))&&e.anchor;a&&q4(a)&&(n.add(a),i.push(`&${a}`));const o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(" ")}function vu(e,t,n,r){if(xn(e))return e.toString(t,n,r);if(Vl(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=bn(e)?e:t.doc.createNode(e,{onTagObj:d=>i=d});i??(i=foe(t.doc.schema.tags,a));const o=hoe(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const u=typeof i.stringify=="function"?i.stringify(a,t,n,r):Gt(a)?TN(a,t,n,r):a.toString(t,n,r);return o?Gt(a)||u[0]==="{"||u[0]==="["?`${o} ${u}`:`${o}
148
+ ${t.indent}${u}`:u}function poe({key:e,value:t},n,r,i){const{allNullValues:a,doc:o,indent:u,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:m}}=n;let y=bn(e)&&e.comment||null;if(m){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(vn(e)||!bn(e)&&typeof e=="object"){const O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let v=!m&&(!e||y&&t==null&&!n.inFlow||vn(e)||(Gt(e)?e.type===tt.BLOCK_FOLDED||e.type===tt.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(m||!a),indent:u+d});let w=!1,S=!1,j=vu(e,n,()=>w=!0,()=>S=!0);if(!v&&!n.inFlow&&j.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(a||t==null)return w&&r&&r(),j===""?"?":v?`? ${j}`:j}else if(a&&!m||t==null&&v)return j=`? ${j}`,y&&!w?j+=dl(j,n.indent,f(y)):S&&i&&i(),j;w&&(y=null),v?(y&&(j+=dl(j,n.indent,f(y))),j=`? ${j}
149
+ ${u}:`):(j=`${j}:`,y&&(j+=dl(j,n.indent,f(y))));let k,A,_;bn(t)?(k=!!t.spaceBefore,A=t.commentBefore,_=t.comment):(k=!1,A=null,_=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!v&&!y&&Gt(t)&&(n.indentAtStart=j.length+1),S=!1,!p&&d.length>=2&&!n.inFlow&&!v&&uh(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let C=!1;const P=vu(t,n,()=>C=!0,()=>S=!0);let E=" ";if(y||k||A){if(E=k?`
150
+ `:"",A){const O=f(A);E+=`
151
+ ${Ja(O,n.indent)}`}P===""&&!n.inFlow?E===`
152
+ `&&_&&(E=`
153
+
154
+ `):E+=`
155
+ ${n.indent}`}else if(!v&&vn(t)){const O=P[0],T=P.indexOf(`
156
+ `),M=T!==-1,q=n.inFlow??t.flow??t.items.length===0;if(M||!q){let $=!1;if(M&&(O==="&"||O==="!")){let L=P.indexOf(" ");O==="&"&&L!==-1&&L<T&&P[L+1]==="!"&&(L=P.indexOf(" ",L+1)),(L===-1||T<L)&&($=!0)}$||(E=`
157
+ ${n.indent}`)}}else(P===""||P[0]===`
158
+ `)&&(E="");return j+=E+P,n.inFlow?C&&r&&r():_&&!C?j+=dl(j,n.indent,f(_)):S&&i&&i(),j}function moe(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const vm="<<",rs={identify:e=>e===vm||typeof e=="symbol"&&e.description===vm,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new tt(Symbol(vm)),{addToJSMap:W4}),stringify:()=>vm},goe=(e,t)=>(rs.identify(t)||Gt(t)&&(!t.type||t.type===tt.PLAIN)&&rs.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===rs.tag&&n.default);function W4(e,t,n){if(n=e&&Vl(n)?n.resolve(e.doc):n,uh(n))for(const r of n.items)Jx(e,t,r);else if(Array.isArray(n))for(const r of n)Jx(e,t,r);else Jx(e,t,n)}function Jx(e,t,n){const r=e&&Vl(n)?n.resolve(e.doc):n;if(!ch(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[a,o]of i)t instanceof Map?t.has(a)||t.set(a,o):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function Q4(e,t,{key:n,value:r}){if(bn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(goe(e,n))W4(e,t,r);else{const i=Ni(n,"",e);if(t instanceof Map)t.set(i,Ni(r,i,e));else if(t instanceof Set)t.add(i);else{const a=yoe(n,i,e),o=Ni(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function yoe(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(bn(e)&&n?.doc){const r=Y4(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)+'..."'),moe(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 PN(e,t,n){const r=Mf(e,void 0,n),i=Mf(t,void 0,n);return new pr(r,i)}class pr{constructor(t,n=null){Object.defineProperty(this,_i,{value:U4}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return bn(n)&&(n=n.clone(t)),bn(r)&&(r=r.clone(t)),new pr(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return Q4(n,r,this)}toString(t,n,r){return t?.doc?poe(this,t,n,r):JSON.stringify(this)}}function X4(e,t,n){return(t.inFlow??e.flow?boe:voe)(e,t,n)}function voe({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:u}){const{indent:d,options:{commentString:f}}=n,p=Object.assign({},n,{indent:a,type:null});let m=!1;const y=[];for(let w=0;w<t.length;++w){const S=t[w];let j=null;if(bn(S))!m&&S.spaceBefore&&y.push(""),zg(n,y,S.commentBefore,m),S.comment&&(j=S.comment);else if(xn(S)){const A=bn(S.key)?S.key:null;A&&(!m&&A.spaceBefore&&y.push(""),zg(n,y,A.commentBefore,m))}m=!1;let k=vu(S,p,()=>j=null,()=>m=!0);j&&(k+=dl(k,a,f(j))),m&&j&&(m=!1),y.push(r+k)}let v;if(y.length===0)v=i.start+i.end;else{v=y[0];for(let w=1;w<y.length;++w){const S=y[w];v+=S?`
159
+ ${d}${S}`:`
160
+ `}}return e?(v+=`
161
+ `+Ja(f(e),d),u&&u()):m&&o&&o(),v}function boe({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:a,flowCollectionPadding:o,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 w=0;w<e.length;++w){const S=e[w];let j=null;if(bn(S))S.spaceBefore&&m.push(""),zg(t,m,S.commentBefore,!1),S.comment&&(j=S.comment);else if(xn(S)){const A=bn(S.key)?S.key:null;A&&(A.spaceBefore&&m.push(""),zg(t,m,A.commentBefore,!1),A.comment&&(f=!0));const _=bn(S.value)?S.value:null;_?(_.comment&&(j=_.comment),_.commentBefore&&(f=!0)):S.value==null&&A?.comment&&(j=A.comment)}j&&(f=!0);let k=vu(S,d,()=>j=null);w<e.length-1&&(k+=","),j&&(k+=dl(k,r,u(j))),!f&&(m.length>p||k.includes(`
162
+ `))&&(f=!0),m.push(k),p=m.length}const{start:y,end:v}=n;if(m.length===0)return y+v;if(!f){const w=m.reduce((S,j)=>S+j.length+2,2);f=t.options.lineWidth>0&&w>t.options.lineWidth}if(f){let w=y;for(const S of m)w+=S?`
163
+ ${a}${i}${S}`:`
164
+ `;return`${w}
165
+ ${i}${v}`}else return`${y}${o}${m.join(" ")}${o}${v}`}function zg({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=Ja(t(r),e);n.push(a.trimStart())}}function fl(e,t){const n=Gt(t)?t.value:t;for(const r of e)if(xn(r)&&(r.key===t||r.key===n||Gt(r.key)&&r.key.value===n))return r}class xi extends V4{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(co,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:a}=r,o=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)&&o.items.push(PN(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"&&o.items.sort(t.sortMapEntries),o}add(t,n){let r;xn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new pr(t,t?.value):r=new pr(t.key,t.value);const i=fl(this.items,r.key),a=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Gt(i.value)&&G4(r.value)?i.value.value=r.value:i.value=r.value}else if(a){const o=this.items.findIndex(u=>a(r,u)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=fl(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=fl(this.items,t)?.value;return(!n&&Gt(i)?i.value:i)??void 0}has(t){return!!fl(this.items,t)}set(t,n){this.add(new pr(t,n),!0)}toJSON(t,n,r){const i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(const a of this.items)Q4(n,i,a);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!xn(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})),X4(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Lu={collection:"map",default:!0,nodeClass:xi,tag:"tag:yaml.org,2002:map",resolve(e,t){return ch(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>xi.from(e,t,n)};class zl extends V4{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Du,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=bm(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=bm(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Gt(i)?i.value:i}has(t){const n=bm(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=bm(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];Gt(i)&&G4(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(Ni(a,String(i++),n));return r}toString(t,n,r){return t?X4(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let u of n){if(typeof i=="function"){const d=n instanceof Set?u:String(o++);u=i.call(n,d,u)}a.items.push(Mf(u,void 0,r))}}return a}}function bm(e){let t=Gt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const $u={collection:"seq",default:!0,nodeClass:zl,tag:"tag:yaml.org,2002:seq",resolve(e,t){return uh(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>zl.from(e,t,n)},sv={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),TN(e,t,n,r)}},ov={identify:e=>e==null,createNode:()=>new tt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new tt(null),stringify:({source:e},t)=>typeof e=="string"&&ov.test.test(e)?e:t.options.nullStr},RN={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new tt(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&RN.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 Xi({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let a=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(a)){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let u=t-(a.length-o-1);for(;u-- >0;)a+="0"}return a}const J4={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:Xi},e$={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():Xi(e)}},t$={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 tt(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Xi},lv=e=>typeof e=="bigint"||Number.isInteger(e),MN=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function n$(e,t,n){const{value:r}=e;return lv(r)&&r>=0?n+r.toString(t):Xi(e)}const r$={identify:e=>lv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>MN(e,2,8,n),stringify:e=>n$(e,8,"0o")},i$={identify:lv,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>MN(e,0,10,n),stringify:Xi},a$={identify:e=>lv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>MN(e,2,16,n),stringify:e=>n$(e,16,"0x")},xoe=[Lu,$u,sv,ov,RN,r$,i$,a$,J4,e$,t$];function cT(e){return typeof e=="bigint"||Number.isInteger(e)}const xm=({value:e})=>JSON.stringify(e),woe=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:xm},{identify:e=>e==null,createNode:()=>new tt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:xm},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:xm},{identify:cT,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})=>cT(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:xm}],Soe={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},joe=[Lu,$u].concat(woe,Soe),DN={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return"";const o=n;let u;if(typeof btoa=="function"){let d="";for(let f=0;f<o.length;++f)d+=String.fromCharCode(o[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=tt.BLOCK_LITERAL),t!==tt.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,y=0;m<f;++m,y+=d)p[m]=u.substr(y,d);u=p.join(t===tt.BLOCK_LITERAL?`
166
+ `:" ")}return TN({comment:e,type:t,value:u},r,i,a)}};function s$(e,t){if(uh(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!xn(r)){if(ch(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new pr(new tt(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
167
+ ${i.key.commentBefore}`:r.commentBefore),r.comment){const a=i.value??i.key;a.comment=a.comment?`${r.comment}
168
+ ${a.comment}`:r.comment}r=i}e.items[n]=xn(r)?r:new pr(r)}}else t("Expected a sequence for this tag");return e}function o$(e,t,n){const{replacer:r}=n,i=new zl(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof r=="function"&&(o=r.call(t,String(a++),o));let u,d;if(Array.isArray(o))if(o.length===2)u=o[0],d=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const f=Object.keys(o);if(f.length===1)u=f[0],d=o[u];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else u=o;i.items.push(PN(u,d,n))}return i}const IN={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:s$,createNode:o$};class cu extends zl{constructor(){super(),this.add=xi.prototype.add.bind(this),this.delete=xi.prototype.delete.bind(this),this.get=xi.prototype.get.bind(this),this.has=xi.prototype.has.bind(this),this.set=xi.prototype.set.bind(this),this.tag=cu.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n?.onCreate&&n.onCreate(r);for(const i of this.items){let a,o;if(xn(i)?(a=Ni(i.key,"",n),o=Ni(i.value,a,n)):a=Ni(i,"",n),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,o)}return r}static from(t,n,r){const i=o$(t,n,r),a=new this;return a.items=i.items,a}}cu.tag="tag:yaml.org,2002:omap";const LN={collection:"seq",identify:e=>e instanceof Map,nodeClass:cu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=s$(e,t),r=[];for(const{key:i}of n.items)Gt(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new cu,n)},createNode:(e,t,n)=>cu.from(e,t,n)};function l$({value:e,source:t},n){return t&&(e?c$:u$).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const c$={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 tt(!0),stringify:l$},u$={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 tt(!1),stringify:l$},Noe={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:Xi},koe={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():Xi(e)}},Coe={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 tt(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:Xi},dh=e=>typeof e=="bigint"||Number.isInteger(e);function cv(e,t,n,{intAsBigInt:r}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return i==="-"?BigInt(-1)*o:o}const a=parseInt(e,n);return i==="-"?-1*a:a}function $N(e,t,n){const{value:r}=e;if(dh(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return Xi(e)}const _oe={identify:dh,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>cv(e,2,2,n),stringify:e=>$N(e,2,"0b")},Aoe={identify:dh,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>cv(e,1,8,n),stringify:e=>$N(e,8,"0")},Ooe={identify:dh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>cv(e,0,10,n),stringify:Xi},Eoe={identify:dh,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>cv(e,2,16,n),stringify:e=>$N(e,16,"0x")};class uu extends xi{constructor(t){super(t),this.tag=uu.tag}add(t){let n;xn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new pr(t.key,null):n=new pr(t,null),fl(this.items,n.key)||this.items.push(n)}get(t,n){const r=fl(this.items,t);return!n&&xn(r)?Gt(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=fl(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new pr(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),a.items.push(PN(o,null,r));return a}}uu.tag="tag:yaml.org,2002:set";const BN={collection:"map",identify:e=>e instanceof Set,nodeClass:uu,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>uu.from(e,t,n),resolve(e,t){if(ch(e)){if(e.hasAllNullValues(!0))return Object.assign(new uu,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function UN(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=o=>t?BigInt(o):Number(o),a=r.replace(/_/g,"").split(":").reduce((o,u)=>o*i(60)+i(u),i(0));return n==="-"?i(-1)*a:a}function d$(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return Xi(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const f$={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})=>UN(e,n),stringify:d$},h$={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=>UN(e,!1),stringify:d$},uv={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(uv.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,a,o,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,o||0,u||0,d);const p=t[8];if(p&&p!=="Z"){let m=UN(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$/,"")??""},uT=[Lu,$u,sv,ov,c$,u$,_oe,Aoe,Ooe,Eoe,Noe,koe,Coe,DN,rs,LN,IN,BN,f$,h$,uv],dT=new Map([["core",xoe],["failsafe",[Lu,$u,sv]],["json",joe],["yaml11",uT],["yaml-1.1",uT]]),fT={binary:DN,bool:RN,float:t$,floatExp:e$,floatNaN:J4,floatTime:h$,int:i$,intHex:a$,intOct:r$,intTime:f$,map:Lu,merge:rs,null:ov,omap:LN,pairs:IN,seq:$u,set:BN,timestamp:uv},zoe={"tag:yaml.org,2002:binary":DN,"tag:yaml.org,2002:merge":rs,"tag:yaml.org,2002:omap":LN,"tag:yaml.org,2002:pairs":IN,"tag:yaml.org,2002:set":BN,"tag:yaml.org,2002:timestamp":uv};function ew(e,t,n){const r=dT.get(t);if(r&&!e)return n&&!r.includes(rs)?r.concat(rs):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const a=Array.from(dT.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${a} or define customTags array`)}if(Array.isArray(e))for(const a of e)i=i.concat(a);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(rs)),i.reduce((a,o)=>{const u=typeof o=="string"?fT[o]:o;if(!u){const d=JSON.stringify(o),f=Object.keys(fT).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 Toe=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class FN{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:a,sortMapEntries:o,toStringDefaults:u}){this.compat=Array.isArray(t)?ew(t,"compat"):t?ew(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=i?zoe:{},this.tags=ew(n,this.name,r),this.toStringOptions=u??null,Object.defineProperty(this,co,{value:Lu}),Object.defineProperty(this,va,{value:sv}),Object.defineProperty(this,Du,{value:$u}),this.sortMapEntries=typeof o=="function"?o:o===!0?Toe:null}clone(){const t=Object.create(FN.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Poe(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=Y4(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=a(e.commentBefore);n.unshift(Ja(d,""))}let o=!1,u=null;if(e.contents){if(bn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=a(e.contents.commentBefore);n.push(Ja(p,""))}i.forceBlockIndent=!!e.comment,u=e.contents.comment}const d=u?void 0:()=>o=!0;let f=vu(e.contents,i,()=>u=null,d);u&&(f+=dl(f,"",a(u))),(f[0]==="|"||f[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${f}`:n.push(f)}else n.push(vu(e.contents,i));if(e.directives?.docEnd)if(e.comment){const d=a(e.comment);d.includes(`
169
+ `)?(n.push("..."),n.push(Ja(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&o&&(d=d.replace(/^\n+/,"")),d&&((!o||u)&&n[n.length-1]!==""&&n.push(""),n.push(Ja(a(d),"")))}return n.join(`
170
+ `)+`
171
+ `}class dv{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,_i,{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:o}=a;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new dr({version:o}),this.setSchema(o,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(dv.prototype,{[_i]:{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=bn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Lc(this.contents)&&this.contents.add(t)}addIn(t,n){Lc(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=H4(this);t.anchor=!n||r.has(n)?K4(n||"a",r):n}return new zN(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const j=A=>typeof A=="number"||A instanceof String||A instanceof Number,k=n.filter(j).map(String);k.length>0&&(n=n.concat(k)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:o,flow:u,keepUndefined:d,onTagObj:f,tag:p}=r??{},{onAnchor:m,setAnchors:y,sourceObjects:v}=soe(this,o||"a"),w={aliasDuplicateObjects:a??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:v},S=Mf(t,p,w);return u&&vn(S)&&(S.flow=!0),y(),S}createPair(t,n,r={}){const i=this.createNode(t,null,r),a=this.createNode(n,null,r);return new pr(i,a)}delete(t){return Lc(this.contents)?this.contents.delete(t):!1}deleteIn(t){return df(t)?this.contents==null?!1:(this.contents=null,!0):Lc(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return vn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return df(t)?!n&&Gt(this.contents)?this.contents.value:this.contents:vn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return vn(this.contents)?this.contents.has(t):!1}hasIn(t){return df(t)?this.contents!==void 0:vn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Eg(this.schema,[t],n):Lc(this.contents)&&this.contents.set(t,n)}setIn(t,n){df(t)?this.contents=n:this.contents==null?this.contents=Eg(this.schema,Array.from(t),n):Lc(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new dr({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new dr({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new FN(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:a,reviver:o}={}){const u={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},d=Ni(this.contents,n??"",u);if(typeof a=="function")for(const{count:f,res:p}of u.anchors.values())a(p,f);return typeof o=="function"?eu(o,{"":d},"",d):d}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Poe(this,t)}}function Lc(e){if(vn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class p$ extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class wm extends p${constructor(t,n,r){super("YAMLParseError",t,n,r)}}class Roe extends p${constructor(t,n,r){super("YAMLWarning",t,n,r)}}const hT=(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,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){const u=Math.min(a-39,o.length-79);o="…"+o.substring(u),a-=u-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,a))){let u=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);u.length>80&&(u=u.substring(0,79)+`…
172
+ `),o=u+o}if(/[^ ]/.test(o)){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+=`:
173
+
174
+ ${o}
175
+ ${f}
176
+ `}};function bu(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:u}){let d=!1,f=u,p=u,m="",y="",v=!1,w=!1,S=null,j=null,k=null,A=null,_=null,C=null,P=null;for(const T of e)switch(w&&(T.type!=="space"&&T.type!=="newline"&&T.type!=="comma"&&a(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),S&&(f&&T.type!=="comment"&&T.type!=="newline"&&a(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),T.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&T.source.includes(" ")&&(S=T),p=!0;break;case"comment":{p||a(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const M=T.source.substring(1)||" ";m?m+=y+M:m=M,y="",f=!1;break}case"newline":f?m?m+=T.source:(!C||n!=="seq-item-ind")&&(d=!0):y+=T.source,f=!0,v=!0,(j||k)&&(A=T),p=!0;break;case"anchor":j&&a(T,"MULTIPLE_ANCHORS","A node can have at most one anchor"),T.source.endsWith(":")&&a(T.offset+T.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),j=T,P??(P=T.offset),f=!1,p=!1,w=!0;break;case"tag":{k&&a(T,"MULTIPLE_TAGS","A node can have at most one tag"),k=T,P??(P=T.offset),f=!1,p=!1,w=!0;break}case n:(j||k)&&a(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`),C&&a(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${t??"collection"}`),C=T,f=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){_&&a(T,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),_=T,f=!1,p=!1;break}default:a(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),f=!1,p=!1}const E=e[e.length-1],O=E?E.offset+E.source.length:i;return w&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&a(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S&&(f&&S.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&a(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:C,spaceBefore:d,comment:m,hasNewline:v,anchor:j,tag:k,newlineAfterProp:A,end:O,start:P??O}}function Df(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
177
+ `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(Df(t.key)||Df(t.value))return!0}return!1;default:return!0}}function N1(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Df(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function m$(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(a,o)=>a===o||Gt(a)&&Gt(o)&&a.value===o.value;return t.some(a=>i(a.key,n))}const pT="All mapping items must start at the same column";function Moe({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??xi,u=new o(n.schema);n.atRoot&&(n.atRoot=!1);let d=r.offset,f=null;for(const p of r.items){const{start:m,key:y,sep:v,value:w}=p,S=bu(m,{indicator:"explicit-key-ind",next:y??v?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0}),j=!S.found;if(j){if(y&&(y.type==="block-seq"?i(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==r.indent&&i(d,"BAD_INDENT",pT)),!S.anchor&&!S.tag&&!v){f=S.end,S.comment&&(u.comment?u.comment+=`
178
+ `+S.comment:u.comment=S.comment);continue}(S.newlineAfterProp||Df(y))&&i(y??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else S.found?.indent!==r.indent&&i(d,"BAD_INDENT",pT);n.atKey=!0;const k=S.end,A=y?e(n,y,S,i):t(n,k,m,null,S,i);n.schema.compat&&N1(r.indent,y,i),n.atKey=!1,m$(n,u.items,A)&&i(k,"DUPLICATE_KEY","Map keys must be unique");const _=bu(v??[],{indicator:"map-value-ind",next:w,offset:A.range[2],onError:i,parentIndent:r.indent,startOnNewline:!y||y.type==="block-scalar"});if(d=_.end,_.found){j&&(w?.type==="block-map"&&!_.hasNewline&&i(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&S.start<_.found.offset-1024&&i(A.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const C=w?e(n,w,_,i):t(n,d,v,null,_,i);n.schema.compat&&N1(r.indent,w,i),d=C.range[2];const P=new pr(A,C);n.options.keepSourceTokens&&(P.srcToken=p),u.items.push(P)}else{j&&i(A.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(A.comment?A.comment+=`
179
+ `+_.comment:A.comment=_.comment);const C=new pr(A);n.options.keepSourceTokens&&(C.srcToken=p),u.items.push(C)}}return f&&f<d&&i(f,"IMPOSSIBLE","Map comment with trailing content"),u.range=[r.offset,d,f??d],u}function Doe({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??zl,u=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset,f=null;for(const{start:p,value:m}of r.items){const y=bu(p,{indicator:"seq-item-ind",next:m,offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||m)m?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(d,"MISSING_CHAR","Sequence item without - indicator");else{f=y.end,y.comment&&(u.comment=y.comment);continue}const v=m?e(n,m,y,i):t(n,y.end,p,null,y,i);n.schema.compat&&N1(r.indent,m,i),d=v.range[2],u.items.push(v)}return u.range=[r.offset,d,f??d],u}function fh(e,t,n,r){let i="";if(e){let a=!1,o="";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+=o+p:i=p,o="";break}case"newline":i&&(o+=d),a=!0;break;default:r(u,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=d.length}}return{comment:i,offset:t}}const tw="Block collections are not allowed within flow collections",nw=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Ioe({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=r.start.source==="{",u=o?"flow map":"flow sequence",d=a?.nodeClass??(o?xi:zl),f=new d(n.schema);f.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let m=r.offset+r.start.source.length;for(let j=0;j<r.items.length;++j){const k=r.items[j],{start:A,key:_,sep:C,value:P}=k,E=bu(A,{flow:u,indicator:"explicit-key-ind",next:_??C?.[0],offset:m,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!C&&!P){j===0&&E.comma?i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`):j<r.items.length-1&&i(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${u}`),E.comment&&(f.comment?f.comment+=`
180
+ `+E.comment:f.comment=E.comment),m=E.end;continue}!o&&n.options.strict&&Df(_)&&i(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(j===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 O="";e:for(const T of A)switch(T.type){case"comma":case"space":break;case"comment":O=T.source.substring(1);break e;default:break e}if(O){let T=f.items[f.items.length-1];xn(T)&&(T=T.value??T.key),T.comment?T.comment+=`
181
+ `+O:T.comment=O,E.comment=E.comment.substring(O.length+1)}}if(!o&&!C&&!E.found){const O=P?e(n,P,E,i):t(n,E.end,C,null,E,i);f.items.push(O),m=O.range[2],nw(P)&&i(O.range,"BLOCK_IN_FLOW",tw)}else{n.atKey=!0;const O=E.end,T=_?e(n,_,E,i):t(n,O,A,null,E,i);nw(_)&&i(T.range,"BLOCK_IN_FLOW",tw),n.atKey=!1;const M=bu(C??[],{flow:u,indicator:"map-value-ind",next:P,offset:T.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(M.found){if(!o&&!E.found&&n.options.strict){if(C)for(const L of C){if(L===M.found)break;if(L.type==="newline"){i(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<M.found.offset-1024&&i(M.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else P&&("source"in P&&P.source?.[0]===":"?i(P,"MISSING_CHAR",`Missing space after : in ${u}`):i(M.start,"MISSING_CHAR",`Missing , or : between ${u} items`));const q=P?e(n,P,M,i):M.found?t(n,M.end,C,null,M,i):null;q?nw(P)&&i(q.range,"BLOCK_IN_FLOW",tw):M.comment&&(T.comment?T.comment+=`
182
+ `+M.comment:T.comment=M.comment);const $=new pr(T,q);if(n.options.keepSourceTokens&&($.srcToken=k),o){const L=f;m$(n,L.items,T)&&i(O,"DUPLICATE_KEY","Map keys must be unique"),L.items.push($)}else{const L=new xi(n.schema);L.flow=!0,L.items.push($);const J=(q??T).range;L.range=[T.range[0],J[1],J[2]],f.items.push(L)}m=q?q.range[2]:M.end}}const y=o?"}":"]",[v,...w]=r.end;let S=m;if(v?.source===y)S=v.offset+v.source.length;else{const j=u[0].toUpperCase()+u.substring(1),k=p?`${j} must end with a ${y}`:`${j} in block collection must be sufficiently indented and end with a ${y}`;i(m,p?"MISSING_CHAR":"BAD_INDENT",k),v&&v.source.length!==1&&w.unshift(v)}if(w.length>0){const j=fh(w,S,n.options.strict,i);j.comment&&(f.comment?f.comment+=`
183
+ `+j.comment:f.comment=j.comment),f.range=[r.offset,S,j.offset]}else f.range=[r.offset,S,S];return f}function rw(e,t,n,r,i,a){const o=n.type==="block-map"?Moe(e,t,n,r,a):n.type==="block-seq"?Doe(e,t,n,r,a):Ioe(e,t,n,r,a),u=o.constructor;return i==="!"||i===u.tagName?(o.tag=u.tagName,o):(i&&(o.tag=i),o)}function Loe(e,t,n,r,i){const a=r.tag,o=a?t.directives.tagName(a.source,y=>i(a,"TAG_RESOLVE_FAILED",y)):null;if(n.type==="block-seq"){const{anchor:y,newlineAfterProp:v}=r,w=y&&a?y.offset>a.offset?y:a:y??a;w&&(!v||v.offset<w.offset)&&i(w,"MISSING_CHAR","Missing newline after block sequence props")}const u=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===xi.tagName&&u==="map"||o===zl.tagName&&u==="seq")return rw(e,t,n,i,o);let d=t.schema.tags.find(y=>y.tag===o&&y.collection===u);if(!d){const y=t.schema.knownTags[o];if(y?.collection===u)t.schema.tags.push(Object.assign({},y,{default:!1})),d=y;else return y?i(a,"BAD_COLLECTION_TYPE",`${y.tag} used for ${u} collection, but expects ${y.collection??"scalar"}`,!0):i(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),rw(e,t,n,i,o)}const f=rw(e,t,n,i,o,d),p=d.resolve?.(f,y=>i(a,"TAG_RESOLVE_FAILED",y),t.options)??f,m=bn(p)?p:new tt(p);return m.range=f.range,m.tag=o,d?.format&&(m.format=d.format),m}function $oe(e,t,n){const r=t.offset,i=Boe(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const a=i.mode===">"?tt.BLOCK_FOLDED:tt.BLOCK_LITERAL,o=t.source?Uoe(t.source):[];let u=o.length;for(let S=o.length-1;S>=0;--S){const j=o[S][1];if(j===""||j==="\r")u=S;else break}if(u===0){const S=i.chomp==="+"&&o.length>0?`
184
+ `.repeat(Math.max(1,o.length-1)):"";let j=r+i.length;return t.source&&(j+=t.source.length),{value:S,type:a,comment:i.comment,range:[r,j,j]}}let d=t.indent+i.indent,f=t.offset+i.length,p=0;for(let S=0;S<u;++S){const[j,k]=o[S];if(k===""||k==="\r")i.indent===0&&j.length>d&&(d=j.length);else{j.length<d&&n(f+j.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(d=j.length),p=S,d===0&&!e.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=j.length+k.length+1}for(let S=o.length-1;S>=u;--S)o[S][0].length>d&&(u=S+1);let m="",y="",v=!1;for(let S=0;S<p;++S)m+=o[S][0].slice(d)+`
185
+ `;for(let S=p;S<u;++S){let[j,k]=o[S];f+=j.length+k.length+1;const A=k[k.length-1]==="\r";if(A&&(k=k.slice(0,-1)),k&&j.length<d){const C=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(f-k.length-(A?2:1),"BAD_INDENT",C),j=""}a===tt.BLOCK_LITERAL?(m+=y+j.slice(d)+k,y=`
186
+ `):j.length>d||k[0]===" "?(y===" "?y=`
187
+ `:!v&&y===`
188
+ `&&(y=`
189
+
190
+ `),m+=y+j.slice(d)+k,y=`
191
+ `,v=!0):k===""?y===`
192
+ `?m+=`
193
+ `:y=`
194
+ `:(m+=y+k,y=" ",v=!1)}switch(i.chomp){case"-":break;case"+":for(let S=u;S<o.length;++S)m+=`
195
+ `+o[S][0].slice(d);m[m.length-1]!==`
196
+ `&&(m+=`
197
+ `);break;default:m+=`
198
+ `}const w=r+i.length+t.source.length;return{value:m,type:a,comment:i.comment,range:[r,w,w]}}function Boe({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],a=i[0];let o=0,u="",d=-1;for(let y=1;y<i.length;++y){const v=i[y];if(!u&&(v==="-"||v==="+"))u=v;else{const w=Number(v);!o&&w?o=w:d===-1&&(d=e+y)}}d!==-1&&r(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let f=!1,p="",m=i.length;for(let y=1;y<t.length;++y){const v=t[y];switch(v.type){case"space":f=!0;case"newline":m+=v.source.length;break;case"comment":n&&!f&&r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=v.source.length,p=v.source.substring(1);break;case"error":r(v,"UNEXPECTED_TOKEN",v.message),m+=v.source.length;break;default:{const w=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",w);const S=v.source;S&&typeof S=="string"&&(m+=S.length)}}}return{mode:a,indent:o,chomp:u,comment:p,length:m}}function Uoe(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),a=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)a.push([t[o],t[o+1]]);return a}function Foe(e,t,n){const{offset:r,type:i,source:a,end:o}=e;let u,d;const f=(y,v,w)=>n(r+y,v,w);switch(i){case"scalar":u=tt.PLAIN,d=qoe(a,f);break;case"single-quoted-scalar":u=tt.QUOTE_SINGLE,d=Hoe(a,f);break;case"double-quoted-scalar":u=tt.QUOTE_DOUBLE,d=Koe(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=fh(o,p,t,n);return{value:d,type:u,comment:m.comment,range:[r,p,m.offset]}}function qoe(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}`),g$(e)}function Hoe(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),g$(e.slice(1,-1)).replace(/''/g,"'")}function g$(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
199
+ `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
200
+ `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=" ",o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===""?a===`
201
+ `?i+=a:a=`
202
+ `:(i+=a+r[1],a=" "),o=n.lastIndex;const u=/[ \t]*(.*)/sy;return u.lastIndex=o,r=u.exec(e),i+a+(r?.[1]??"")}function Koe(e,t){let n="";for(let r=1;r<e.length-1;++r){const i=e[r];if(!(i==="\r"&&e[r+1]===`
203
+ `))if(i===`
204
+ `){const{fold:a,offset:o}=Goe(e,r);n+=a,r=o}else if(i==="\\"){let a=e[++r];const o=Voe[a];if(o)n+=o;else if(a===`
205
+ `)for(a=e[r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="\r"&&e[r+1]===`
206
+ `)for(a=e[++r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="x"||a==="u"||a==="U"){const u={x:2,u:4,U:8}[a];n+=Zoe(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 o=e[r+1];for(;o===" "||o===" ";)o=e[++r+1];o!==`
207
+ `&&!(o==="\r"&&e[r+2]===`
208
+ `)&&(n+=r>a?e.slice(a,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function Goe(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
209
+ `||r==="\r")&&!(r==="\r"&&e[t+2]!==`
210
+ `);)r===`
211
+ `&&(n+=`
212
+ `),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const Voe={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
213
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Zoe(e,t,n,r){const i=e.substr(t,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const u=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),u}return String.fromCodePoint(o)}function y$(e,t,n,r){const{value:i,type:a,comment:o,range:u}=t.type==="block-scalar"?$oe(e,t,r):Foe(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[va]:d?f=Yoe(e.schema,i,d,n,r):t.type==="scalar"?f=Woe(e,i,t,r):f=e.schema[va];let p;try{const m=f.resolve(i,y=>r(n??t,"TAG_RESOLVE_FAILED",y),e.options);p=Gt(m)?m:new tt(m)}catch(m){const y=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",y),p=new tt(i)}return p.range=u,p.source=i,a&&(p.type=a),d&&(p.tag=d),f.format&&(p.format=f.format),o&&(p.comment=o),p}function Yoe(e,t,n,r,i){if(n==="!")return e[va];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 o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[va])}function Woe({atKey:e,directives:t,schema:n},r,i,a){const o=n.tags.find(u=>(u.default===!0||e&&u.default==="key")&&u.test?.test(r))||n[va];if(n.compat){const u=n.compat.find(d=>d.default&&d.test?.test(r))??n[va];if(o.tag!==u.tag){const d=t.tagString(o.tag),f=t.tagString(u.tag),p=`Value may be parsed as either ${d} or ${f}`;a(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}function Qoe(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 Xoe={composeNode:v$,composeEmptyNode:qN};function v$(e,t,n,r){const i=e.atKey,{spaceBefore:a,comment:o,anchor:u,tag:d}=n;let f,p=!0;switch(t.type){case"alias":f=Joe(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=y$(e,t,d,r),u&&(f.anchor=u.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=Loe(Xoe,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=qN(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&&(!Gt(f)||typeof f.value!="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")&&r(d??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(f.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?f.comment=o:f.commentBefore=o),e.options.keepSourceTokens&&p&&(f.srcToken=t),f}function qN(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:u,end:d},f){const p={type:"scalar",offset:Qoe(t,n,r),indent:-1,source:""},m=y$(e,p,u,f);return o&&(m.anchor=o.source.substring(1),m.anchor===""&&f(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(m.spaceBefore=!0),a&&(m.comment=a,m.range[2]=d),m}function Joe({options:e},{offset:t,source:n,end:r},i){const a=new zN(n.substring(1));a.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,u=fh(r,o,e.strict,i);return a.range=[t,o,u.offset],u.comment&&(a.comment=u.comment),a}function ele(e,t,{offset:n,start:r,value:i,end:a},o){const u=Object.assign({_directives:t},e),d=new dv(void 0,u),f={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=bu(r,{indicator:"doc-start",next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(d.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=i?v$(f,i,p,o):qN(f,p.end,r,null,p,o);const m=d.contents.range[2],y=fh(a,m,!1,o);return y.comment&&(d.comment=y.comment),d.range=[n,m,y.offset],d}function Qd(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 mT(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){const a=e[i];switch(a[0]){case"#":t+=(t===""?"":r?`
214
+
215
+ `:`
216
+ `)+(a.substring(1)||" "),n=!0,r=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class tle{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,a)=>{const o=Qd(n);a?this.warnings.push(new Roe(o,r,i)):this.errors.push(new wm(o,r,i))},this.directives=new dr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=mT(this.prelude);if(r){const a=t.contents;if(n)t.comment=t.comment?`${t.comment}
217
+ ${r}`:r;else if(i||t.directives.docStart||!a)t.commentBefore=r;else if(vn(a)&&!a.flow&&a.items.length>0){let o=a.items[0];xn(o)&&(o=o.key);const u=o.commentBefore;o.commentBefore=u?`${r}
218
+ ${u}`:r}else{const o=a.commentBefore;a.commentBefore=o?`${r}
219
+ ${o}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:mT(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=Qd(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=ele(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 wm(Qd(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 wm(Qd(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=fh(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
220
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new wm(Qd(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 dv(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 b$="\uFEFF",x$="",w$="",k1="";function nle(e){switch(e){case b$:return"byte-order-mark";case x$:return"doc-mode";case w$:return"flow-error-end";case k1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
221
+ `:case`\r
222
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Ui(e){switch(e){case void 0:case" ":case`
223
+ `:case"\r":case" ":return!0;default:return!1}}const gT=new Set("0123456789ABCDEFabcdef"),rle=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Sm=new Set(",[]{}"),ile=new Set(` ,[]{}
224
+ \r `),iw=e=>!e||ile.has(e);class ale{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
225
+ `?!0:n==="\r"?this.buffer[t+1]===`
226
+ `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const i=this.buffer[r+t+1];if(i===`
227
+ `||!i&&!this.atEnd)return t+r+1}return n===`
228
+ `||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&Ui(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
229
+ `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===b$&&(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 x$,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==="...")&&Ui(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&&!Ui(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===":")&&Ui(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(iw),"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("..."))&&Ui(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield w$,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(iw),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||Ui(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let a=0;for(;this.buffer[n-1-a]==="\\";)a+=1;if(a%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let i=r.indexOf(`
230
+ `,this.pos);if(i!==-1){for(;i!==-1;){const a=this.continueScalar(i+1);if(a===-1)break;i=r.indexOf(`
231
+ `,a)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Ui(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let a=this.pos;r=this.buffer[a];++a)switch(r){case" ":n+=1;break;case`
232
+ `:t=a,n=0;break;case"\r":{const o=this.buffer[a+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
233
+ `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const a=this.continueScalar(t+1);if(a===-1)break;t=this.buffer.indexOf(`
234
+ `,a)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
235
+ `;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let a=t-1,o=this.buffer[a];o==="\r"&&(o=this.buffer[--a]);const u=a;for(;o===" ";)o=this.buffer[--a];if(o===`
236
+ `&&a>=this.pos&&a+1+n>u)t=a;else break}while(!0);return yield k1,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(Ui(a)||t&&Sm.has(a))break;n=r}else if(Ui(i)){let a=this.buffer[r+1];if(i==="\r"&&(a===`
237
+ `?(r+=1,i=`
238
+ `,a=this.buffer[r+1]):n=r),a==="#"||t&&Sm.has(a))break;if(i===`
239
+ `){const o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(t&&Sm.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield k1,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(iw))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(Ui(n)||t&&Sm.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(;!Ui(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(rle.has(n))n=this.buffer[++t];else if(n==="%"&&gT.has(this.buffer[t+1])&&gT.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
240
+ `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
241
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class sle{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 Zs(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function yT(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 S$(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 jm(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 $c(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 vT(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Zs(t.start,"explicit-key-ind")&&!Zs(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,S$(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 ole{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 ale,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=nle(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"&&vT(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&&yT(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":{yT(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=jm(this.peek(2)),r=$c(n);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
242
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
243
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(i&&n.sep&&!n.value){const o=[];for(let u=0;u<n.sep.length;++u){const d=n.sep[u];switch(d.type){case"newline":o.push(u);break;case"space":break;case"comment":d.indent>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Zs(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(S$(n.key)&&!Zs(n.sep,"newline")){const o=$c(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:o,key:u,sep:d}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Zs(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=$c(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Zs(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Zs(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Zs(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=jm(r),a=$c(i);vT(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const u={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
244
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
245
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=jm(t),r=$c(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=jm(t),r=$c(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 lle(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new sle||null,prettyErrors:t}}function cle(e,t={}){const{lineCounter:n,prettyErrors:r}=lle(t),i=new ole(n?.addNewLine),a=new tle(t),o=Array.from(a.compose(i.parse(e)));if(r&&n)for(const u of o)u.errors.forEach(hT(e,n)),u.warnings.forEach(hT(e,n));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function ule({onApplied:e}){const[t,n]=b.useState(""),[r,i]=b.useState(!1),[a,o]=b.useState([]),[u,d]=b.useState([]),f=async()=>{if(!t.trim())return;i(!0),o([]),d([]);const p=cle(t),m=[],y=[];for(let v=0;v<p.length;v++){const w=p[v];if(w.errors.length>0){m.push(`Document ${v+1}: ${w.errors[0]?.message}`);continue}const S=w.toJSON();if(!(!S||typeof S!="object"))try{const j=await i7(S);y.push(`Applied "${j.displayName||j.name}" (revision ${j.configRevision})`)}catch(j){m.push(`Document ${v+1}: ${j instanceof Error?j.message:String(j)}`)}}o(y),d(m),i(!1),y.length>0&&(ht({title:"YAML applied",detail:`Applied ${y.length} document${y.length===1?"":"s"} successfully.`,tone:m.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return c.jsxs("section",{className:"mt-8",children:[c.jsx("div",{className:"page-section-divider"}),c.jsx("div",{className:"section-head mt-6",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),c.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),c.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",c.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",c.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),c.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
246
+ kind: Project
247
+ metadata:
248
+ name: my-project
249
+ spec:
250
+ canonicalDomain: example.com
251
+ country: US
252
+ language: en
253
+ keywords: []`,value:t,onChange:p=>n(p.target.value)}),a.length>0&&c.jsx("ul",{className:"mt-2 space-y-1",children:a.map((p,m)=>c.jsx("li",{className:"text-emerald-400 text-sm",children:p},m))}),u.length>0&&c.jsx("ul",{className:"mt-2 space-y-1",children:u.map((p,m)=>c.jsx("li",{className:"text-rose-400 text-sm",children:p},m))}),c.jsx("div",{className:"mt-3",children:c.jsx(ge,{type:"button",disabled:!t.trim()||r,onClick:f,children:r?"Applying...":"Apply"})})]})}function dle(){const{dashboard:e,isLoading:t,refetch:n}=Kl();if(!e||t)return c.jsxs("div",{className:"page-skeleton",children:[c.jsxs("div",{className:"page-skeleton-header",children:[c.jsx("div",{className:"skeleton-text h-6 w-28"}),c.jsx("div",{className:"skeleton-text-sm w-40"})]}),c.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[c.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(O=>c.jsx("div",{className:"skeleton-text-sm w-16"},O))}),[1,2,3].map(O=>c.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[c.jsxs("div",{className:"flex-1 space-y-1",children:[c.jsx("div",{className:"skeleton-text w-28"}),c.jsx("div",{className:"skeleton-text-sm w-16"})]}),c.jsx("div",{className:"skeleton-text w-24"}),c.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),c.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),c.jsx("div",{className:"skeleton-text-sm w-8"})]},O))]})]});const r=e.projects,i=xo(),[a,o]=b.useState(!1),[u,d]=b.useState(""),[f,p]=b.useState(""),[m,y]=b.useState(""),[v,w]=b.useState("US"),[S,j]=b.useState("en"),[k,A]=b.useState(!1),[_,C]=b.useState(null),P=u.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),E=async()=>{if(!(!P||!m)){A(!0),C(null);try{const O=await $y(P,{displayName:f||u,canonicalDomain:m,country:v,language:S});ht({title:"Project created",detail:`${O.displayName||O.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${O.name}`,dedupeMode:"drop"}),n(),d(""),p(""),y(""),w("US"),j("en"),o(!1),i({to:"/projects/$projectId",params:{projectId:O.id}})}catch(O){C(O instanceof Error?O.message:"Failed to create project")}finally{A(!1)}}};return c.jsxs("div",{className:"page-container",children:[c.jsxs("div",{className:"page-header",children:[c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Projects"}),c.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),c.jsx("div",{className:"page-header-right",children:c.jsxs(ge,{type:"button",onClick:()=>o(O=>!O),children:[c.jsx(g2,{className:"size-4 mr-1.5"}),"Add project"]})})]}),a?c.jsxs(qe,{className:"surface-card mb-6",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),c.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),c.jsxs("div",{className:"compact-stack mt-4",children:[c.jsxs("div",{className:"setup-field-row",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),c.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:u,onChange:O=>d(O.target.value)}),P&&P!==u?c.jsxs("p",{className:"supporting-copy",children:["Slug: ",P]}):null]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),c.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:f,onChange:O=>p(O.target.value)})]})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),c.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:m,onChange:O=>y(O.target.value)})]}),c.jsxs("div",{className:"setup-field-row",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),c.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:v,onChange:O=>w(O.target.value.toUpperCase())})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),c.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:S,onChange:O=>j(O.target.value.toLowerCase())})]})]})]}),_?c.jsx("p",{className:"text-rose-400 text-sm mt-3",children:_}):null,c.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[c.jsx(ge,{type:"button",disabled:!P||!m||k,onClick:E,children:k?"Creating...":"Create project"}),c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>o(!1),children:"Cancel"})]})]}):null,r.length>0?c.jsx("div",{className:"data-table-wrapper",children:c.jsxs("table",{className:"data-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Name"}),c.jsx("th",{children:"Domain"}),c.jsx("th",{children:"Visibility"}),c.jsx("th",{children:"Last run"}),c.jsx("th",{className:"text-right",children:"Country"})]})}),c.jsx("tbody",{children:r.map(O=>{const T=O.recentRuns[0];return c.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:O.project.id}}),children:[c.jsxs("td",{children:[c.jsx(qt,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:M=>M.stopPropagation(),children:O.project.displayName||O.project.name}),c.jsx("p",{className:"text-[11px] text-zinc-500",children:O.project.name})]}),c.jsx("td",{className:"text-zinc-400",children:O.project.canonicalDomain}),c.jsx("td",{children:c.jsx(vt,{tone:O.visibilitySummary.tone,children:O.visibilitySummary.value})}),c.jsx("td",{className:"text-zinc-500 text-sm",children:T?c.jsx(Gy,{status:T.status}):c.jsx("span",{className:"text-zinc-600",children:"No runs"})}),c.jsx("td",{className:"text-right text-zinc-500",children:O.project.country})]},O.project.id)})})]})}):a?null:c.jsxs(qe,{className:"surface-card empty-card",children:[c.jsx("h3",{children:"No projects yet"}),c.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),c.jsxs(ge,{type:"button",onClick:()=>o(!0),children:[c.jsx(g2,{className:"size-4 mr-1.5"}),"Add project"]})]}),c.jsx(ule,{onApplied:()=>{n()}})]})}function C1({state:e}){return c.jsx(vt,{tone:pX(e),children:qy(e)})}function j$({run:e}){const{openRun:t}=Pu();return c.jsxs("article",{className:"run-row",children:[c.jsxs("div",{className:"run-row-main",children:[c.jsxs("div",{className:"run-row-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"run-row-title",children:e.summary}),c.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),c.jsx(Gy,{status:e.status})]}),c.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),c.jsxs("dl",{className:"run-row-meta",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Started"}),c.jsx("dd",{children:e.startedAt})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Duration"}),c.jsx("dd",{children:e.duration})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Trigger"}),c.jsx("dd",{children:e.triggerLabel})]})]}),c.jsx(ge,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function N$({value:e,label:t,delta:n,tone:r,description:i,tooltip:a,isNumeric:o=!0,progress:u,providerCoverage:d}){const m=2*Math.PI*48,y=Number.parseInt(e,10),v=typeof u=="number"&&Number.isFinite(u)?Math.min(Math.max(u,0),1):o&&!Number.isNaN(y)?Math.min(y/100,1):.5,w=m*(1-v);return c.jsxs("div",{className:"score-gauge",children:[c.jsxs("div",{className:"gauge-ring-wrapper",children:[c.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[c.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),c.jsx("circle",{className:`gauge-fill gauge-fill-${r}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:m,strokeDashoffset:w,transform:"rotate(-90 60 60)"})]}),c.jsx("div",{className:"gauge-center",children:c.jsx("span",{className:o?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),c.jsxs("p",{className:"gauge-label",children:[t,a&&c.jsx(Wn,{text:a})]}),c.jsx("p",{className:"gauge-delta",children:n}),d&&c.jsx("p",{className:"gauge-provider-coverage",children:d}),c.jsx("p",{className:"gauge-description",children:i})]})}function bT({history:e,maxDots:t=12}){const n=e.slice(-t);if(n.length===0)return c.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 c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:i}),c.jsx("div",{className:"flex items-center gap-[3px]",title:`${n.length} runs`,children:n.map((o,u)=>c.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[o.citationState]??"bg-zinc-700"} ${o.model&&u>0&&n[u-1]?.model&&n[u-1].model!==o.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[o.citationState,new Date(o.createdAt).toLocaleDateString(),o.model?`model ${o.model}`:null,o.model&&u>0&&n[u-1]?.model&&n[u-1].model!==o.model?"model changed":null].filter(Boolean).join(" — ")},u))}),c.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:a})]})}function fle(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 hle({evidence:e}){const{openEvidence:t}=Pu(),[n,r]=b.useState(new Set),i=b.useMemo(()=>{const o=new Map;for(const u of e){const d=o.get(u.keyword)??[];o.set(u.keyword,[...d,u])}return[...o.entries()].map(([u,d])=>({phrase:u,items:d}))},[e]),a=o=>{r(u=>{const d=new Set(u);return d.has(o)?d.delete(o):d.add(o),d})};return c.jsx("div",{className:"evidence-table-wrap",children:c.jsxs("table",{className:"evidence-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{style:{width:"2rem"}}),c.jsx("th",{children:"Key Phrase"}),c.jsx("th",{children:"Status"}),c.jsx("th",{children:"Citation History"}),c.jsx("th",{children:"Change"}),c.jsx("th",{})]})}),c.jsx("tbody",{children:i.map(({phrase:o,items:u})=>{const d=n.has(o),f=u.map(w=>w.citationState),p=f.includes("cited")?"cited":f.includes("emerging")?"emerging":f.includes("lost")?"lost":f.every(w=>w==="pending")?"pending":"not-cited",m=fle(u),y=u.filter(w=>w.citationState==="cited"||w.citationState==="emerging").length,v=(()=>{if(m.length===0)return"Awaiting first run";if(m.length===1)return"First observation";const w=m[m.length-1].citationState,S=m[m.length-2].citationState;if(S!=="cited"&&w==="cited")return"Newly cited";if(S==="cited"&&w!=="cited")return"Lost since last run";let j=0;for(let k=m.length-1;k>=0&&m[k].citationState===w;k--)j++;return w==="cited"?j<=1?"Cited in latest run":`Cited for ${j} runs`:j<=1?"Not cited in latest run":`Not cited across ${j} runs`})();return c.jsxs(b.Fragment,{children:[c.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>a(o),"aria-expanded":d,children:[c.jsx("td",{children:c.jsx(rh,{size:14,className:`transition-transform duration-150 text-zinc-500 ${d?"rotate-90":""}`})}),c.jsx("td",{className:"evidence-keyword-cell",children:c.jsxs("div",{children:[c.jsx("span",{className:"font-medium text-zinc-100",children:o}),c.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:u.map(w=>c.jsx(zf,{provider:w.provider},w.id))})]})}),c.jsx("td",{children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(C1,{state:p}),c.jsxs("span",{className:"text-[11px] text-zinc-500",children:[y,"/",u.length]})]})}),c.jsx("td",{children:c.jsx(bT,{history:m})}),c.jsx("td",{className:"evidence-change-cell",children:v}),c.jsx("td",{})]}),d&&u.map(w=>c.jsxs("tr",{className:"bg-zinc-900/30",children:[c.jsx("td",{}),c.jsx("td",{className:"evidence-keyword-cell pl-5",children:c.jsx(zf,{provider:w.provider})}),c.jsx("td",{children:c.jsx(C1,{state:w.citationState})}),c.jsx("td",{children:c.jsx(bT,{history:w.runHistory})}),c.jsx("td",{className:"evidence-change-cell",children:w.changeLabel}),c.jsx("td",{children:c.jsx(ge,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(w.id)},children:"View"})})]},w.id))]},o)})})]})})}function ple({competitors:e}){return e.length===0?c.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):c.jsx("div",{className:"competitor-table-wrap",children:c.jsxs("table",{className:"competitor-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Domain"}),c.jsx("th",{children:"Pressure"}),c.jsx("th",{children:"Citations"}),c.jsx("th",{children:"Key Phrases"})]})}),c.jsx("tbody",{children:e.map(t=>c.jsxs("tr",{children:[c.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),c.jsx("td",{children:c.jsx(vt,{tone:mX(t.pressureLabel),children:t.pressureLabel})}),c.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalKeywords>0?`${t.citationCount} / ${t.totalKeywords}`:"—"}),c.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedKeywords.length>0?t.citedKeywords.join(", "):"Not cited"})]},t.id))})]})})}function xT({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:a,coverageValue:o,note:u,updatedAt:d,active:f,onClick:p}){return c.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:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),c.jsx("h3",{children:t})]}),c.jsx(vt,{tone:r,children:n})]}),c.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:i}),c.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:a})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:o})]})]}),c.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:[c.jsx("span",{children:u}),c.jsx("span",{children:d?`Updated ${qi(d)}`:"No recent sync yet"})]})]})}function Nm({label:e,value:t,tone:n}){const r=n==="positive"?"text-emerald-400":n==="negative"?"text-rose-400":"text-zinc-200";return c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),c.jsx("p",{className:`mt-2 text-2xl font-semibold ${r}`,children:t})]})}var mle=["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 HN(e){if(typeof e!="string")return!1;var t=mle;return t.includes(e)}var gle=["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"],yle=new Set(gle);function k$(e){return typeof e!="string"?!1:yle.has(e)}function C$(e){return typeof e=="string"&&e.startsWith("data-")}function Zi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(k$(n)||C$(n))&&(t[n]=e[n]);return t}function fv(e){if(e==null)return null;if(b.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Zi(t)}return typeof e=="object"&&!Array.isArray(e)?Zi(e):null}function Pr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(k$(n)||C$(n)||HN(n))&&(t[n]=e[n]);return t}function vle(e){return e==null?null:b.isValidElement(e)?Pr(e.props):typeof e=="object"&&!Array.isArray(e)?Pr(e):null}var ble=["children","width","height","viewBox","className","style","title","desc"];function _1(){return _1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_1.apply(null,arguments)}function xle(e,t){if(e==null)return{};var n,r,i=wle(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 wle(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 KN=b.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:u,title:d,desc:f}=e,p=xle(e,ble),m=a||{width:r,height:i,x:0,y:0},y=Ct("recharts-surface",o);return b.createElement("svg",_1({},Pr(p),{className:y,width:r,height:i,style:u,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height),ref:t}),b.createElement("title",null,d),b.createElement("desc",null,f),n)}),Sle=["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 jle(e,t){if(e==null)return{};var n,r,i=Nle(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 Nle(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 Yi=b.forwardRef((e,t)=>{var{children:n,className:r}=e,i=jle(e,Sle),a=Ct("recharts-layer",r);return b.createElement("g",A1({className:a},Pr(i),{ref:t}),n)}),_$=b.createContext(null),kle=()=>b.useContext(_$);function Ht(e){return function(){return e}}const A$=Math.cos,Tg=Math.sin,Ji=Math.sqrt,Pg=Math.PI,hv=2*Pg,O1=Math.PI,E1=2*O1,il=1e-6,Cle=E1-il;function O$(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function _le(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return O$;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 Ale{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?O$:_le(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,u=this._y1,d=r-t,f=i-n,p=o-t,m=u-n,y=p*p+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(y>il)if(!(Math.abs(m*d-f*p)>il)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-o,w=i-u,S=d*d+f*f,j=v*v+w*w,k=Math.sqrt(S),A=Math.sqrt(y),_=a*Math.tan((O1-Math.acos((S+y-j)/(2*k*A)))/2),C=_/A,P=_/k;Math.abs(C-1)>il&&this._append`L${t+C*p},${n+C*m}`,this._append`A${a},${a},0,0,${+(m*v>p*w)},${this._x1=t+P*d},${this._y1=n+P*f}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let u=r*Math.cos(i),d=r*Math.sin(i),f=t+u,p=n+d,m=1^o,y=o?i-a:a-i;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>il||Math.abs(this._y1-p)>il)&&this._append`L${f},${p}`,r&&(y<0&&(y=y%E1+E1),y>Cle?this._append`A${r},${r},0,1,${m},${t-u},${n-d}A${r},${r},0,1,${m},${this._x1=f},${this._y1=p}`:y>il&&this._append`A${r},${r},0,${+(y>=O1)},${m},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function GN(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 Ale(t)}function VN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function E$(e){this._context=e}E$.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 pv(e){return new E$(e)}function z$(e){return e[0]}function T$(e){return e[1]}function P$(e,t){var n=Ht(!0),r=null,i=pv,a=null,o=GN(u);e=typeof e=="function"?e:e===void 0?z$:Ht(e),t=typeof t=="function"?t:t===void 0?T$:Ht(t);function u(d){var f,p=(d=VN(d)).length,m,y=!1,v;for(r==null&&(a=i(v=o())),f=0;f<=p;++f)!(f<p&&n(m=d[f],f,d))===y&&((y=!y)?a.lineStart():a.lineEnd()),y&&a.point(+e(m,f,d),+t(m,f,d));if(v)return a=null,v+""||null}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Ht(+d),u):e},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Ht(+d),u):t},u.defined=function(d){return arguments.length?(n=typeof d=="function"?d:Ht(!!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 km(e,t,n){var r=null,i=Ht(!0),a=null,o=pv,u=null,d=GN(f);e=typeof e=="function"?e:e===void 0?z$:Ht(+e),t=typeof t=="function"?t:Ht(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?T$:Ht(+n);function f(m){var y,v,w,S=(m=VN(m)).length,j,k=!1,A,_=new Array(S),C=new Array(S);for(a==null&&(u=o(A=d())),y=0;y<=S;++y){if(!(y<S&&i(j=m[y],y,m))===k)if(k=!k)v=y,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),w=y-1;w>=v;--w)u.point(_[w],C[w]);u.lineEnd(),u.areaEnd()}k&&(_[y]=+e(j,y,m),C[y]=+t(j,y,m),u.point(r?+r(j,y,m):_[y],n?+n(j,y,m):C[y]))}if(A)return u=null,A+""||null}function p(){return P$().defined(i).curve(o).context(a)}return f.x=function(m){return arguments.length?(e=typeof m=="function"?m:Ht(+m),r=null,f):e},f.x0=function(m){return arguments.length?(e=typeof m=="function"?m:Ht(+m),f):e},f.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:Ht(+m),f):r},f.y=function(m){return arguments.length?(t=typeof m=="function"?m:Ht(+m),n=null,f):t},f.y0=function(m){return arguments.length?(t=typeof m=="function"?m:Ht(+m),f):t},f.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:Ht(+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:Ht(!!m),f):i},f.curve=function(m){return arguments.length?(o=m,a!=null&&(u=o(a)),f):o},f.context=function(m){return arguments.length?(m==null?a=u=null:u=o(a=m),f):a},f}class R${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 Ole(e){return new R$(e,!0)}function Ele(e){return new R$(e,!1)}const ZN={draw(e,t){const n=Ji(t/Pg);e.moveTo(n,0),e.arc(0,0,n,0,hv)}},zle={draw(e,t){const n=Ji(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()}},M$=Ji(1/3),Tle=M$*2,Ple={draw(e,t){const n=Ji(t/Tle),r=n*M$;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Rle={draw(e,t){const n=Ji(t),r=-n/2;e.rect(r,r,n,n)}},Mle=.8908130915292852,D$=Tg(Pg/10)/Tg(7*Pg/10),Dle=Tg(hv/10)*D$,Ile=-A$(hv/10)*D$,Lle={draw(e,t){const n=Ji(t*Mle),r=Dle*n,i=Ile*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=hv*a/5,u=A$(o),d=Tg(o);e.lineTo(d*n,-u*n),e.lineTo(u*r-d*i,d*r+u*i)}e.closePath()}},aw=Ji(3),$le={draw(e,t){const n=-Ji(t/(aw*3));e.moveTo(0,n*2),e.lineTo(-aw*n,-n),e.lineTo(aw*n,-n),e.closePath()}},fi=-.5,hi=Ji(3)/2,z1=1/Ji(12),Ble=(z1/2+1)*3,Ule={draw(e,t){const n=Ji(t/Ble),r=n/2,i=n*z1,a=r,o=n*z1+n,u=-a,d=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(u,d),e.lineTo(fi*r-hi*i,hi*r+fi*i),e.lineTo(fi*a-hi*o,hi*a+fi*o),e.lineTo(fi*u-hi*d,hi*u+fi*d),e.lineTo(fi*r+hi*i,fi*i-hi*r),e.lineTo(fi*a+hi*o,fi*o-hi*a),e.lineTo(fi*u+hi*d,fi*d-hi*u),e.closePath()}};function Fle(e,t){let n=null,r=GN(i);e=typeof e=="function"?e:Ht(e||ZN),t=typeof t=="function"?t:Ht(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:Ht(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Ht(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Rg(){}function Mg(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 I$(e){this._context=e}I$.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:Mg(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:Mg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qle(e){return new I$(e)}function L$(e){this._context=e}L$.prototype={areaStart:Rg,areaEnd:Rg,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:Mg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Hle(e){return new L$(e)}function $$(e){this._context=e}$$.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:Mg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Kle(e){return new $$(e)}function B$(e){this._context=e}B$.prototype={areaStart:Rg,areaEnd:Rg,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 Gle(e){return new B$(e)}function wT(e){return e<0?-1:1}function ST(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),u=(a*i+o*r)/(r+i);return(wT(a)+wT(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function jT(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function sw(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,u=(a-r)/3;e._context.bezierCurveTo(r+u,i+u*t,a-u,o-u*n,a,o)}function Dg(e){this._context=e}Dg.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:sw(this,this._t0,jT(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,sw(this,jT(this,n=ST(this,e,t)),n);break;default:sw(this,this._t0,n=ST(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function U$(e){this._context=new F$(e)}(U$.prototype=Object.create(Dg.prototype)).point=function(e,t){Dg.prototype.point.call(this,t,e)};function F$(e){this._context=e}F$.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 Vle(e){return new Dg(e)}function Zle(e){return new U$(e)}function q$(e){this._context=e}q$.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=NT(e),i=NT(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function NT(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Yle(e){return new q$(e)}function mv(e,t){this._context=e,this._t=t}mv.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 Wle(e){return new mv(e,.5)}function Qle(e){return new mv(e,0)}function Xle(e){return new mv(e,1)}function Tl(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,u=a.length;n<o;++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 T1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Jle(e,t){return e[t]}function ece(e){const t=[];return t.key=e,t}function tce(){var e=Ht([]),t=T1,n=Tl,r=Jle;function i(a){var o=Array.from(e.apply(this,arguments),ece),u,d=o.length,f=-1,p;for(const m of a)for(u=0,++f;u<d;++u)(o[u][f]=[0,+r(m,o[u].key,f,a)]).data=m;for(u=0,p=VN(t(o));u<d;++u)o[p[u]].index=u;return n(o,p),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Ht(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Ht(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?T1:typeof a=="function"?a:Ht(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Tl,i):n},i}function nce(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}Tl(e,t)}}function rce(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,u=0;o<i;++o)u+=e[o][n][1]||0;r[n][1]+=r[n][0]=-u/2}Tl(e,t)}}function ice(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var u=0,d=0,f=0;u<o;++u){for(var p=e[t[u]],m=p[r][1]||0,y=p[r-1][1]||0,v=(m-y)/2,w=0;w<u;++w){var S=e[t[w]],j=S[r][1]||0,k=S[r-1][1]||0;v+=j-k}d+=m,f+=v*m}i[r-1][1]+=i[r-1][0]=n,d&&(n-=f/d)}i[r-1][1]+=i[r-1][0]=n,Tl(e,t)}}var ow={},lw={},kT;function ace(){return kT||(kT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(lw)),lw}var cw={},CT;function H$(){return CT||(CT=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})(cw)),cw}var uw={},_T;function YN(){return _T||(_T=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})(uw)),uw}var dw={},fw={},AT;function sce(){return AT||(AT=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})(fw)),fw}var OT;function WN(){return OT||(OT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=sce(),n=YN();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],o=i.length;if(o===0)return a;let u=0,d="",f="",p=!1;for(i.charCodeAt(0)===46&&(a.push(""),u++);u<o;){const m=i[u];f?m==="\\"&&u+1<o?(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})(dw)),dw}var ET;function QN(){return ET||(ET=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ace(),n=H$(),r=YN(),i=WN();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 o(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 o(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})(ow)),ow}var hw,zT;function oce(){return zT||(zT=1,hw=QN().get),hw}var lce=oce();const gv=ja(lce);var cce=4;function no(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:cce,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Zn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,o)=>{var u=n[o-1];return typeof u=="string"?i+u+a:u!==void 0?i+no(u)+a:i+a},"")}var wi=e=>e===0?0:e>0?1:-1,ba=e=>typeof e=="number"&&e!=+e,Pl=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Be=e=>(typeof e=="number"||e instanceof Number)&&!ba(e),Ai=e=>Be(e)||typeof e=="string",uce=0,If=e=>{var t=++uce;return"".concat(e||"").concat(t)},yo=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(!Be(t)&&typeof t!="string")return r;var a;if(Pl(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return ba(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},K$=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 ua(e,t,n){return Be(e)&&Be(t)?no(e+n*(t-e)):t}function G$(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):gv(r,t))===n)}var Xn=e=>e===null||typeof e>"u",hh=e=>Xn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Or(e){return e!=null}function Bu(){}var dce=["type","size","sizeType"];function P1(){return P1=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},P1.apply(null,arguments)}function TT(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 PT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TT(Object(n),!0).forEach(function(r){fce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fce(e,t,n){return(t=hce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hce(e){var t=pce(e,"string");return typeof t=="symbol"?t:t+""}function pce(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 mce(e,t){if(e==null)return{};var n,r,i=gce(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 gce(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 V$={symbolCircle:ZN,symbolCross:zle,symbolDiamond:Ple,symbolSquare:Rle,symbolStar:Lle,symbolTriangle:$le,symbolWye:Ule},yce=Math.PI/180,vce=e=>{var t="symbol".concat(hh(e));return V$[t]||ZN},bce=(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*yce;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}},xce=(e,t)=>{V$["symbol".concat(hh(e))]=t},Z$=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=mce(e,dce),a=PT(PT({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var u=()=>{var y=vce(o),v=Fle().type(y).size(bce(n,r,o)),w=v();if(w!==null)return w},{className:d,cx:f,cy:p}=a,m=Pr(a);return Be(f)&&Be(p)&&Be(n)?b.createElement("path",P1({},m,{className:Ct("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};Z$.registerSymbol=xce;var Y$=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,XN=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(b.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{HN(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},wce=(e,t,n)=>r=>(e(t,n,r),null),W$=(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];HN(i)&&typeof a=="function"&&(r||(r={}),r[i]=wce(a,t,n))}),r};function RT(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 Sce(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RT(Object(n),!0).forEach(function(r){jce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jce(e,t,n){return(t=Nce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nce(e){var t=kce(e,"string");return typeof t=="symbol"?t:t+""}function kce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gr(e,t){var n=Sce({},e),r=t,i=Object.keys(t),a=i.reduce((o,u)=>(o[u]===void 0&&r[u]!==void 0&&(o[u]=r[u]),o),n);return a}function Ig(){return Ig=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},Ig.apply(null,arguments)}function MT(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 Q$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MT(Object(n),!0).forEach(function(r){Cce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cce(e,t,n){return(t=_ce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _ce(e){var t=Ace(e,"string");return typeof t=="symbol"?t:t+""}function Ace(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 yi=32,Oce={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Ece(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function zce(e){var{data:t,iconType:n,inactiveColor:r}=e,i=yi/2,a=yi/6,o=yi/3,u=t.inactive?r:t.color,d=n??t.type;if(d==="none")return null;if(d==="plainline")return b.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:Ece(t.payload),x1:0,y1:i,x2:yi,y2:i,className:"recharts-legend-icon"});if(d==="line")return b.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(i,"h").concat(o,`
254
+ A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(i,`
255
+ H`).concat(yi,"M").concat(2*o,",").concat(i,`
256
+ A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(i),className:"recharts-legend-icon"});if(d==="rect")return b.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(yi/8,"h").concat(yi,"v").concat(yi*3/4,"h").concat(-yi,"z"),className:"recharts-legend-icon"});if(b.isValidElement(t.legendIcon)){var f=Q$({},t);return delete f.legendIcon,b.cloneElement(t.legendIcon,f)}return b.createElement(Z$,{fill:u,cx:i,cy:i,size:yi,sizeType:"diameter",type:d})}function Tce(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:u}=e,d={x:0,y:0,width:yi,height:yi},f={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((m,y)=>{var v=m.formatter||i,w=Ct({"recharts-legend-item":!0,["legend-item-".concat(y)]:!0,inactive:m.inactive});if(m.type==="none")return null;var S=typeof u=="object"?Q$({},u):{};S.color=m.inactive?a:S.color||m.color;var j=v?v(m.value,m,y):m.value;return b.createElement("li",Ig({className:w,style:f,key:"legend-item-".concat(y)},W$(e,m,y)),b.createElement(KN,{width:n,height:n,viewBox:d,style:p,"aria-label":"".concat(m.value," legend icon")},b.createElement(zce,{data:m,iconType:o,inactiveColor:a})),b.createElement("span",{className:"recharts-legend-item-text",style:S},j))})}var Pce=e=>{var t=gr(e,Oce),{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 b.createElement("ul",{className:"recharts-default-legend",style:a},b.createElement(Tce,Ig({},t,{payload:n})))},pw={},mw={},DT;function Rce(){return DT||(DT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a<n.length;a++){const o=n[a],u=r(o,a,n);i.has(u)||i.set(u,o)}return Array.from(i.values())}e.uniqBy=t})(mw)),mw}var gw={},IT;function Mce(){return IT||(IT=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})(gw)),gw}var yw={},LT;function X$(){return LT||(LT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(yw)),yw}var vw={},bw={},xw={},$T;function Dce(){return $T||($T=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(xw)),xw}var BT;function J$(){return BT||(BT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Dce();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(bw)),bw}var ww={},UT;function Ice(){return UT||(UT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(ww)),ww}var FT;function Lce(){return FT||(FT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=J$(),n=Ice();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(vw)),vw}var Sw={},jw={},qT;function $ce(){return qT||(qT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=QN();function n(r){return function(i){return t.get(i,r)}}e.property=n})(jw)),jw}var Nw={},kw={},Cw={},_w={},HT;function e3(){return HT||(HT=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})(_w)),_w}var Aw={},KT;function t3(){return KT||(KT=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})(Aw)),Aw}var Ow={},GT;function n3(){return GT||(GT=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})(Ow)),Ow}var VT;function Bce(){return VT||(VT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=e3(),n=t3(),r=n3();function i(p,m,y){return typeof y!="function"?i(p,m,()=>{}):a(p,m,function v(w,S,j,k,A,_){const C=y(w,S,j,k,A,_);return C!==void 0?!!C:a(w,S,v,_)},new Map)}function a(p,m,y,v){if(m===p)return!0;switch(typeof m){case"object":return o(p,m,y,v);case"function":return Object.keys(m).length>0?a(p,{...m},y,v):r.isEqualsSameValueZero(p,m);default:return t.isObject(p)?typeof m=="string"?m==="":!0:r.isEqualsSameValueZero(p,m)}}function o(p,m,y,v){if(m==null)return!0;if(Array.isArray(m))return d(p,m,y,v);if(m instanceof Map)return u(p,m,y,v);if(m instanceof Set)return f(p,m,y,v);const w=Object.keys(m);if(p==null||n.isPrimitive(p))return w.length===0;if(w.length===0)return!0;if(v?.has(m))return v.get(m)===p;v?.set(m,p);try{for(let S=0;S<w.length;S++){const j=w[S];if(!n.isPrimitive(p)&&!(j in p)||m[j]===void 0&&p[j]!==void 0||m[j]===null&&p[j]!==null||!y(p[j],m[j],j,p,m,v))return!1}return!0}finally{v?.delete(m)}}function u(p,m,y,v){if(m.size===0)return!0;if(!(p instanceof Map))return!1;for(const[w,S]of m.entries()){const j=p.get(w);if(y(j,S,w,p,m,v)===!1)return!1}return!0}function d(p,m,y,v){if(m.length===0)return!0;if(!Array.isArray(p))return!1;const w=new Set;for(let S=0;S<m.length;S++){const j=m[S];let k=!1;for(let A=0;A<p.length;A++){if(w.has(A))continue;const _=p[A];let C=!1;if(y(_,j,S,p,m,v)&&(C=!0),C){w.add(A),k=!0;break}}if(!k)return!1}return!0}function f(p,m,y,v){return m.size===0?!0:p instanceof Set?d([...p],[...m],y,v):!1}e.isMatchWith=i,e.isSetMatch=f})(Cw)),Cw}var ZT;function r3(){return ZT||(ZT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bce();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(kw)),kw}var Ew={},zw={},Tw={},YT;function Uce(){return YT||(YT=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})(Tw)),Tw}var Pw={},WT;function JN(){return WT||(WT=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})(Pw)),Pw}var Rw={},QT;function i3(){return QT||(QT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",o="[object Symbol]",u="[object Date]",d="[object Map]",f="[object Set]",p="[object Array]",m="[object Function]",y="[object ArrayBuffer]",v="[object Object]",w="[object Error]",S="[object DataView]",j="[object Uint8Array]",k="[object Uint8ClampedArray]",A="[object Uint16Array]",_="[object Uint32Array]",C="[object BigUint64Array]",P="[object Int8Array]",E="[object Int16Array]",O="[object Int32Array]",T="[object BigInt64Array]",M="[object Float32Array]",q="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=y,e.arrayTag=p,e.bigInt64ArrayTag=T,e.bigUint64ArrayTag=C,e.booleanTag=i,e.dataViewTag=S,e.dateTag=u,e.errorTag=w,e.float32ArrayTag=M,e.float64ArrayTag=q,e.functionTag=m,e.int16ArrayTag=E,e.int32ArrayTag=O,e.int8ArrayTag=P,e.mapTag=d,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=f,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=A,e.uint32ArrayTag=_,e.uint8ArrayTag=j,e.uint8ClampedArrayTag=k})(Rw)),Rw}var Mw={},XT;function Fce(){return XT||(XT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Mw)),Mw}var JT;function a3(){return JT||(JT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Uce(),n=JN(),r=i3(),i=t3(),a=Fce();function o(p,m){return u(p,void 0,p,new Map,m)}function u(p,m,y,v=new Map,w=void 0){const S=w?.(p,m,y,v);if(S!==void 0)return S;if(i.isPrimitive(p))return p;if(v.has(p))return v.get(p);if(Array.isArray(p)){const j=new Array(p.length);v.set(p,j);for(let k=0;k<p.length;k++)j[k]=u(p[k],k,y,v,w);return Object.hasOwn(p,"index")&&(j.index=p.index),Object.hasOwn(p,"input")&&(j.input=p.input),j}if(p instanceof Date)return new Date(p.getTime());if(p instanceof RegExp){const j=new RegExp(p.source,p.flags);return j.lastIndex=p.lastIndex,j}if(p instanceof Map){const j=new Map;v.set(p,j);for(const[k,A]of p)j.set(k,u(A,k,y,v,w));return j}if(p instanceof Set){const j=new Set;v.set(p,j);for(const k of p)j.add(u(k,void 0,y,v,w));return j}if(typeof Buffer<"u"&&Buffer.isBuffer(p))return p.subarray();if(a.isTypedArray(p)){const j=new(Object.getPrototypeOf(p)).constructor(p.length);v.set(p,j);for(let k=0;k<p.length;k++)j[k]=u(p[k],k,y,v,w);return j}if(p instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&p instanceof SharedArrayBuffer)return p.slice(0);if(p instanceof DataView){const j=new DataView(p.buffer.slice(0),p.byteOffset,p.byteLength);return v.set(p,j),d(j,p,y,v,w),j}if(typeof File<"u"&&p instanceof File){const j=new File([p],p.name,{type:p.type});return v.set(p,j),d(j,p,y,v,w),j}if(typeof Blob<"u"&&p instanceof Blob){const j=new Blob([p],{type:p.type});return v.set(p,j),d(j,p,y,v,w),j}if(p instanceof Error){const j=structuredClone(p);return v.set(p,j),j.message=p.message,j.name=p.name,j.stack=p.stack,j.cause=p.cause,j.constructor=p.constructor,d(j,p,y,v,w),j}if(p instanceof Boolean){const j=new Boolean(p.valueOf());return v.set(p,j),d(j,p,y,v,w),j}if(p instanceof Number){const j=new Number(p.valueOf());return v.set(p,j),d(j,p,y,v,w),j}if(p instanceof String){const j=new String(p.valueOf());return v.set(p,j),d(j,p,y,v,w),j}if(typeof p=="object"&&f(p)){const j=Object.create(Object.getPrototypeOf(p));return v.set(p,j),d(j,p,y,v,w),j}return p}function d(p,m,y=p,v,w){const S=[...Object.keys(m),...t.getSymbols(m)];for(let j=0;j<S.length;j++){const k=S[j],A=Object.getOwnPropertyDescriptor(p,k);(A==null||A.writable)&&(p[k]=u(m[k],k,y,v,w))}}function f(p){switch(n.getTag(p)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=u,e.copyProperties=d})(zw)),zw}var eP;function qce(){return eP||(eP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=a3();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(Ew)),Ew}var tP;function Hce(){return tP||(tP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=r3(),n=qce();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(Nw)),Nw}var Dw={},Iw={},Lw={},nP;function Kce(){return nP||(nP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=a3(),n=JN(),r=i3();function i(a,o){return t.cloneDeepWith(a,(u,d,f,p)=>{const m=o?.(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 y={};return p.set(a,y),t.copyProperties(y,a,f,p),y}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const y=new a.constructor(a?.valueOf());return t.copyProperties(y,a),y}case r.argumentsTag:{const y={};return t.copyProperties(y,a),y.length=a.length,y[Symbol.iterator]=a[Symbol.iterator],y}default:return}}})}e.cloneDeepWith=i})(Lw)),Lw}var rP;function Gce(){return rP||(rP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Kce();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(Iw)),Iw}var $w={},Bw={},iP;function s3(){return iP||(iP=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})(Bw)),Bw}var Uw={},aP;function Vce(){return aP||(aP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=JN();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(Uw)),Uw}var sP;function Zce(){return sP||(sP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=H$(),n=s3(),r=Vce(),i=WN();function a(o,u){let d;if(Array.isArray(u)?d=u:typeof u=="string"&&t.isDeepKey(u)&&o?.[u]==null?d=i.toPath(u):d=[u],d.length===0)return!1;let f=o;for(let p=0;p<d.length;p++){const m=d[p];if((f==null||!Object.hasOwn(f,m))&&!((Array.isArray(f)||r.isArguments(f))&&n.isIndex(m)&&m<f.length))return!1;f=f[m]}return!0}e.has=a})($w)),$w}var oP;function Yce(){return oP||(oP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=r3(),n=YN(),r=Gce(),i=QN(),a=Zce();function o(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=o})(Dw)),Dw}var lP;function Wce(){return lP||(lP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=X$(),n=$ce(),r=Hce(),i=Yce();function a(o){if(o==null)return t.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?i.matchesProperty(o[0],o[1]):r.matches(o);case"string":case"symbol":case"number":return n.property(o)}}e.iteratee=a})(Sw)),Sw}var cP;function Qce(){return cP||(cP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Rce(),n=Mce(),r=X$(),i=Lce(),a=Wce();function o(u,d=r.identity){return i.isArrayLikeObject(u)?t.uniqBy(Array.from(u),n.ary(a.iteratee(d),1)):[]}e.uniqBy=o})(pw)),pw}var Fw,uP;function Xce(){return uP||(uP=1,Fw=Qce().uniqBy),Fw}var Jce=Xce();const dP=ja(Jce);function o3(e,t,n){return t===!0?dP(e,n):typeof t=="function"?dP(e,t):e}var ek=b.createContext(null),eue=e=>e,un=()=>{var e=b.useContext(ek);return e?e.store.dispatch:eue},tg=()=>{},tue=()=>tg,nue=(e,t)=>e===t;function He(e){var t=b.useContext(ek),n=b.useMemo(()=>t?r=>{if(r!=null)return e(r)}:tg,[t,e]);return EI.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:tue,t?t.store.getState:tg,t?t.store.getState:tg,n,nue)}function rue(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function iue(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function aue(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 fP=e=>Array.isArray(e)?e:[e];function sue(e){const t=Array.isArray(e[0])?e[0]:e;return aue(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function oue(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var lue=class{constructor(e){this.value=e}deref(){return this.value}},cue=typeof WeakRef<"u"?WeakRef:lue,uue=0,hP=1;function Cm(){return{s:uue,v:void 0,o:null,p:null}}function l3(e,t={}){let n=Cm();const{resultEqualityCheck:r}=t;let i,a=0;function o(){let u=n;const{length:d}=arguments;for(let m=0,y=d;m<y;m++){const v=arguments[m];if(typeof v=="function"||typeof v=="object"&&v!==null){let w=u.o;w===null&&(u.o=w=new WeakMap);const S=w.get(v);S===void 0?(u=Cm(),w.set(v,u)):u=S}else{let w=u.p;w===null&&(u.p=w=new Map);const S=w.get(v);S===void 0?(u=Cm(),w.set(v,u)):u=S}}const f=u;let p;if(u.s===hP)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 cue(p):p}return f.s=hP,f.v=p,p}return o.clearCache=()=>{n=Cm(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function due(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,o=0,u,d={},f=i.pop();typeof f=="object"&&(d=f,f=i.pop()),rue(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p={...n,...d},{memoize:m,memoizeOptions:y=[],argsMemoize:v=l3,argsMemoizeOptions:w=[]}=p,S=fP(y),j=fP(w),k=sue(i),A=m(function(){return a++,f.apply(null,arguments)},...S),_=v(function(){o++;const P=oue(k,arguments);return u=A.apply(null,P),u},...j);return Object.assign(_,{resultFunc:f,memoizedResultFunc:A,dependencies:k,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var le=due(l3),fue=Object.assign((e,t=le)=>{iue(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((o,u,d)=>(o[n[d]]=u,o),{}))},{withTypes:()=>fue}),qw={},Hw={},Kw={},pP;function hue(){return pP||(pP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,a)=>{if(r!==i){const o=t(r),u=t(i);if(o===u&&o===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?u-o:o-u}return 0};e.compareValues=n})(Kw)),Kw}var Gw={},Vw={},mP;function c3(){return mP||(mP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(Vw)),Vw}var gP;function pue(){return gP||(gP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=c3(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,o){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(r.test(a)||!n.test(a))||o!=null&&Object.hasOwn(o,a)}e.isKey=i})(Gw)),Gw}var yP;function mue(){return yP||(yP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hue(),n=pue(),r=WN();function i(a,o,u,d){if(a==null)return[];u=d?void 0:u,Array.isArray(a)||(a=Object.values(a)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(u)||(u=u==null?[]:[u]),u=u.map(v=>String(v));const f=(v,w)=>{let S=v;for(let j=0;j<w.length&&S!=null;++j)S=S[w[j]];return S},p=(v,w)=>w==null||v==null?w:typeof v=="object"&&"key"in v?Object.hasOwn(w,v.key)?w[v.key]:f(w,v.path):typeof v=="function"?v(w):Array.isArray(v)?f(w,v):typeof w=="object"?w[v]:w,m=o.map(v=>(Array.isArray(v)&&v.length===1&&(v=v[0]),v==null||typeof v=="function"||Array.isArray(v)||n.isKey(v)?v:{key:v,path:r.toPath(v)}));return a.map(v=>({original:v,criteria:m.map(w=>p(w,v))})).slice().sort((v,w)=>{for(let S=0;S<m.length;S++){const j=t.compareValues(v.criteria[S],w.criteria[S],u[S]);if(j!==0)return j}return 0}).map(v=>v.original)}e.orderBy=i})(Hw)),Hw}var Zw={},vP;function gue(){return vP||(vP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),o=(u,d)=>{for(let f=0;f<u.length;f++){const p=u[f];Array.isArray(p)&&d<a?o(p,d+1):i.push(p)}};return o(n,0),i}e.flatten=t})(Zw)),Zw}var Yw={},bP;function u3(){return bP||(bP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=s3(),n=J$(),r=e3(),i=n3();function a(o,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],o):!1}e.isIterateeCall=a})(Yw)),Yw}var xP;function yue(){return xP||(xP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mue(),n=gue(),r=u3();function i(a,...o){const u=o.length;return u>1&&r.isIterateeCall(a,o[0],o[1])?o=[]:u>2&&r.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(a,n.flatten(o),["asc"])}e.sortBy=i})(qw)),qw}var Ww,wP;function vue(){return wP||(wP=1,Ww=yue().sortBy),Ww}var bue=vue();const yv=ja(bue);var d3=e=>e.legend.settings,xue=e=>e.legend.size,wue=e=>e.legend.payload,Sue=le([wue,d3],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?yv(r,n):r});function jue(){return He(Sue)}var _m=1;function f3(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=b.useState({height:0,left:0,top:0,width:0}),r=b.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),o={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(o.height-t.height)>_m||Math.abs(o.left-t.left)>_m||Math.abs(o.top-t.top)>_m||Math.abs(o.width-t.width)>_m)&&n({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Vn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Nue=typeof Symbol=="function"&&Symbol.observable||"@@observable",SP=Nue,Qw=()=>Math.random().toString(36).substring(7).split("").join("."),kue={INIT:`@@redux/INIT${Qw()}`,REPLACE:`@@redux/REPLACE${Qw()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Qw()}`},Lg=kue;function tk(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 h3(e,t,n){if(typeof e!="function")throw new Error(Vn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Vn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Vn(1));return n(h3)(e,t)}let r=e,i=t,a=new Map,o=a,u=0,d=!1;function f(){o===a&&(o=new Map,a.forEach((j,k)=>{o.set(k,j)}))}function p(){if(d)throw new Error(Vn(3));return i}function m(j){if(typeof j!="function")throw new Error(Vn(4));if(d)throw new Error(Vn(5));let k=!0;f();const A=u++;return o.set(A,j),function(){if(k){if(d)throw new Error(Vn(6));k=!1,f(),o.delete(A),a=null}}}function y(j){if(!tk(j))throw new Error(Vn(7));if(typeof j.type>"u")throw new Error(Vn(8));if(typeof j.type!="string")throw new Error(Vn(17));if(d)throw new Error(Vn(9));try{d=!0,i=r(i,j)}finally{d=!1}return(a=o).forEach(A=>{A()}),j}function v(j){if(typeof j!="function")throw new Error(Vn(10));r=j,y({type:Lg.REPLACE})}function w(){const j=m;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(Vn(11));function A(){const C=k;C.next&&C.next(p())}return A(),{unsubscribe:j(A)}},[SP](){return this}}}return y({type:Lg.INIT}),{dispatch:y,subscribe:m,getState:p,replaceReducer:v,[SP]:w}}function Cue(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Lg.INIT})>"u")throw new Error(Vn(12));if(typeof n(void 0,{type:Lg.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Vn(13))})}function p3(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const o=t[a];typeof e[o]=="function"&&(n[o]=e[o])}const r=Object.keys(n);let i;try{Cue(n)}catch(a){i=a}return function(o={},u){if(i)throw i;let d=!1;const f={};for(let p=0;p<r.length;p++){const m=r[p],y=n[m],v=o[m],w=y(v,u);if(typeof w>"u")throw u&&u.type,new Error(Vn(14));f[m]=w,d=d||w!==v}return d=d||r.length!==Object.keys(o).length,d?f:o}}function $g(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function _ue(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Vn(15))};const o={getState:i.getState,dispatch:(d,...f)=>a(d,...f)},u=e.map(d=>d(o));return a=$g(...u)(i.dispatch),{...i,dispatch:a}}}function m3(e){return tk(e)&&"type"in e&&typeof e.type=="string"}var g3=Symbol.for("immer-nothing"),jP=Symbol.for("immer-draftable"),mr=Symbol.for("immer-state");function Ki(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Yr=Object,xu=Yr.getPrototypeOf,Bg="constructor",vv="prototype",R1="configurable",Ug="enumerable",ng="writable",Lf="value",ss=e=>!!e&&!!e[mr];function Wi(e){return e?y3(e)||xv(e)||!!e[jP]||!!e[Bg]?.[jP]||wv(e)||Sv(e):!1}var Aue=Yr[vv][Bg].toString(),NP=new WeakMap;function y3(e){if(!e||!nk(e))return!1;const t=xu(e);if(t===null||t===Yr[vv])return!0;const n=Yr.hasOwnProperty.call(t,Bg)&&t[Bg];if(n===Object)return!0;if(!Wc(n))return!1;let r=NP.get(n);return r===void 0&&(r=Function.toString.call(n),NP.set(n,r)),r===Aue}function bv(e,t,n=!0){ph(e)===0?(n?Reflect.ownKeys(e):Yr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function ph(e){const t=e[mr];return t?t.type_:xv(e)?1:wv(e)?2:Sv(e)?3:0}var kP=(e,t,n=ph(e))=>n===2?e.has(t):Yr[vv].hasOwnProperty.call(e,t),M1=(e,t,n=ph(e))=>n===2?e.get(t):e[t],Fg=(e,t,n,r=ph(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Oue(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var xv=Array.isArray,wv=e=>e instanceof Map,Sv=e=>e instanceof Set,nk=e=>typeof e=="object",Wc=e=>typeof e=="function",Xw=e=>typeof e=="boolean";function Eue(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Wa=e=>e.copy_||e.base_,rk=e=>e.modified_?e.copy_:e.base_;function D1(e,t){if(wv(e))return new Map(e);if(Sv(e))return new Set(e);if(xv(e))return Array[vv].slice.call(e);const n=y3(e);if(t===!0||t==="class_only"&&!n){const r=Yr.getOwnPropertyDescriptors(e);delete r[mr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],u=r[o];u[ng]===!1&&(u[ng]=!0,u[R1]=!0),(u.get||u.set)&&(r[o]={[R1]:!0,[ng]:!0,[Ug]:u[Ug],[Lf]:e[o]})}return Yr.create(xu(e),r)}else{const r=xu(e);if(r!==null&&n)return{...e};const i=Yr.create(r);return Yr.assign(i,e)}}function ik(e,t=!1){return jv(e)||ss(e)||!Wi(e)||(ph(e)>1&&Yr.defineProperties(e,{set:Am,add:Am,clear:Am,delete:Am}),Yr.freeze(e),t&&bv(e,(n,r)=>{ik(r,!0)},!1)),e}function zue(){Ki(2)}var Am={[Lf]:zue};function jv(e){return e===null||!nk(e)?!0:Yr.isFrozen(e)}var qg="MapSet",I1="Patches",CP="ArrayMethods",v3={};function Rl(e){const t=v3[e];return t||Ki(0,e),t}var _P=e=>!!v3[e],$f,b3=()=>$f,Tue=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:_P(qg)?Rl(qg):void 0,arrayMethodsPlugin_:_P(CP)?Rl(CP):void 0});function AP(e,t){t&&(e.patchPlugin_=Rl(I1),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function L1(e){$1(e),e.drafts_.forEach(Pue),e.drafts_=null}function $1(e){e===$f&&($f=e.parent_)}var OP=e=>$f=Tue($f,e);function Pue(e){const t=e[mr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function EP(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[mr].modified_&&(L1(t),Ki(4)),Wi(e)&&(e=zP(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[mr].base_,e,t)}else e=zP(t,n);return Rue(t,e,!0),L1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==g3?e:void 0}function zP(e,t){if(jv(t))return t;const n=t[mr];if(!n)return Hg(t,e.handledSet_,e);if(!Nv(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);S3(n,e)}return n.copy_}function Rue(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ik(t,n)}function x3(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Nv=(e,t)=>e.scope_===t,Mue=[];function w3(e,t,n,r){const i=Wa(e),a=e.type_;if(r!==void 0&&M1(i,r,a)===t){Fg(i,r,n,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;bv(i,(d,f)=>{if(ss(f)){const p=u.get(f)||[];p.push(d),u.set(f,p)}})}const o=e.draftLocations_.get(t)??Mue;for(const u of o)Fg(i,u,n,a)}function Due(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!Nv(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const o=rk(a);w3(e,a.draft_??a,o,n),S3(a,i)})}function S3(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)}x3(e)}}function Iue(e,t,n){const{scope_:r}=e;if(ss(n)){const i=n[mr];Nv(i,r)&&i.callbacks_.push(function(){rg(e);const o=rk(i);w3(e,n,o,t)})}else Wi(n)&&e.callbacks_.push(function(){const a=Wa(e);e.type_===3?a.has(n)&&Hg(n,r.handledSet_,r):M1(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Hg(M1(e.copy_,t,e.type_),r.handledSet_,r)})}function Hg(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ss(e)||t.has(e)||!Wi(e)||jv(e)||(t.add(e),bv(e,(r,i)=>{if(ss(i)){const a=i[mr];if(Nv(a,n)){const o=rk(a);Fg(e,r,o,e.type_),x3(a)}}else Wi(i)&&Hg(i,t,n)})),e}function Lue(e,t){const n=xv(e),r={type_:n?1:0,scope_:t?t.scope_:b3(),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=Kg;n&&(i=[r],a=Bf);const{revoke:o,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=o,[u,r]}var Kg={get(e,t){if(t===mr)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=Wa(e);if(!kP(i,t,e.type_))return $ue(e,i,t);const a=i[t];if(e.finalized_||!Wi(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Eue(t))return a;if(a===Jw(e.base_,t)){rg(e);const o=e.type_===1?+t:t,u=U1(e.scope_,a,e,o);return e.copy_[o]=u}return a},has(e,t){return t in Wa(e)},ownKeys(e){return Reflect.ownKeys(Wa(e))},set(e,t,n){const r=j3(Wa(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Jw(Wa(e),t),a=i?.[mr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Oue(n,i)&&(n!==void 0||kP(e.base_,t,e.type_)))return!0;rg(e),B1(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),Iue(e,t,n)),!0},deleteProperty(e,t){return rg(e),Jw(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),B1(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Wa(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[ng]:!0,[R1]:e.type_!==1||t!=="length",[Ug]:r[Ug],[Lf]:n[t]}},defineProperty(){Ki(11)},getPrototypeOf(e){return xu(e.base_)},setPrototypeOf(){Ki(12)}},Bf={};for(let e in Kg){let t=Kg[e];Bf[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Bf.deleteProperty=function(e,t){return Bf.set.call(this,e,t,void 0)};Bf.set=function(e,t,n){return Kg.set.call(this,e[0],t,n,e[0])};function Jw(e,t){const n=e[mr];return(n?Wa(n):e)[t]}function $ue(e,t,n){const r=j3(t,n);return r?Lf in r?r[Lf]:r.get?.call(e.draft_):void 0}function j3(e,t){if(!(t in e))return;let n=xu(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=xu(n)}}function B1(e){e.modified_||(e.modified_=!0,e.parent_&&B1(e.parent_))}function rg(e){e.copy_||(e.assigned_=new Map,e.copy_=D1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Bue=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Wc(n)&&!Wc(r)){const o=r;r=n;const u=this;return function(f=o,...p){return u.produce(f,m=>r.call(this,m,...p))}}Wc(r)||Ki(6),i!==void 0&&!Wc(i)&&Ki(7);let a;if(Wi(n)){const o=OP(this),u=U1(o,n,void 0);let d=!0;try{a=r(u),d=!1}finally{d?L1(o):$1(o)}return AP(o,i),EP(a,o)}else if(!n||!nk(n)){if(a=r(n),a===void 0&&(a=n),a===g3&&(a=void 0),this.autoFreeze_&&ik(a,!0),i){const o=[],u=[];Rl(I1).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:u}),i(o,u)}return a}else Ki(1,n)},this.produceWithPatches=(n,r)=>{if(Wc(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]},Xw(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Xw(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Xw(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Wi(t)||Ki(8),ss(t)&&(t=Si(t));const n=OP(this),r=U1(n,t,void 0);return r[mr].isManual_=!0,$1(n),r}finishDraft(t,n){const r=t&&t[mr];(!r||!r.isManual_)&&Ki(9);const{scope_:i}=r;return AP(i,n),EP(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=Rl(I1).applyPatches_;return ss(t)?i(t,n):this.produce(t,a=>i(a,n))}};function U1(e,t,n,r){const[i,a]=wv(t)?Rl(qg).proxyMap_(t,n):Sv(t)?Rl(qg).proxySet_(t,n):Lue(t,n);return(n?.scope_??b3()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?Due(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 Si(e){return ss(e)||Ki(10,e),N3(e)}function N3(e){if(!Wi(e)||jv(e))return e;const t=e[mr];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 bv(n,(i,a)=>{Fg(n,i,N3(a))},r),t&&(t.finalized_=!1),n}var Uue=new Bue,k3=Uue.produce;function C3(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var Fue=C3(),que=C3,Hue=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?$g:$g.apply(null,arguments)};function Qr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Wr(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=>m3(r)&&r.type===e,n}var _3=class ff extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,ff.prototype)}static get[Symbol.species](){return ff}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new ff(...t[0].concat(this)):new ff(...t.concat(this))}};function TP(e){return Wi(e)?k3(e,()=>{}):e}function Om(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Kue(e){return typeof e=="boolean"}var Gue=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new _3;return n&&(Kue(n)?o.push(Fue):o.push(que(n.extraArgument))),o},A3="RTK_autoBatch",Yt=()=>e=>({payload:e,meta:{[A3]:!0}}),PP=e=>t=>{setTimeout(t,e)},O3=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,o=!1;const u=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:PP(10):e.type==="callback"?e.queueNotification:PP(e.timeout),f=()=>{o=!1,a&&(a=!1,u.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const m=()=>i&&p(),y=r.subscribe(m);return u.add(p),()=>{y(),u.delete(p)}},dispatch(p){try{return i=!p?.meta?.[A3],a=!i,a&&(o||(o=!0,d(f))),r.dispatch(p)}finally{i=!0}}})},Vue=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new _3(e);return r&&i.push(O3(typeof r=="object"?r:void 0)),i};function Zue(e){const t=Gue(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let u;if(typeof n=="function")u=n;else if(tk(n))u=p3(n);else throw new Error(Wr(1));let d;typeof r=="function"?d=r(t):d=t();let f=$g;i&&(f=Hue({trace:!1,...typeof i=="object"&&i}));const p=_ue(...d),m=Vue(p);let y=typeof o=="function"?o(m):m();const v=f(...y);return h3(u,a,v)}function E3(e){const t={},n=[];let r;const i={addCase(a,o){const u=typeof a=="string"?a:a.type;if(!u)throw new Error(Wr(28));if(u in t)throw new Error(Wr(29));return t[u]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return n.push({matcher:a,reducer:o}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function Yue(e){return typeof e=="function"}function Wue(e,t){let[n,r,i]=E3(t),a;if(Yue(e))a=()=>TP(e());else{const u=TP(e);a=()=>u}function o(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(ss(p)){const v=m(p,d);return v===void 0?p:v}else{if(Wi(p))return k3(p,y=>m(y,d));{const y=m(p,d);if(y===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return y}}return p},u)}return o.getInitialState=a,o}var Que="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Xue=(e=21)=>{let t="",n=e;for(;n--;)t+=Que[Math.random()*64|0];return t},Jue=Symbol.for("rtk-slice-createasyncthunk");function ede(e,t){return`${e}/${t}`}function tde({creators:e}={}){const t=e?.asyncThunk?.[Jue];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(Wr(11));const o=(typeof r.reducers=="function"?r.reducers(rde()):r.reducers)||{},u=Object.keys(o),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(_,C){const P=typeof _=="string"?_:_.type;if(!P)throw new Error(Wr(12));if(P in d.sliceCaseReducersByType)throw new Error(Wr(13));return d.sliceCaseReducersByType[P]=C,f},addMatcher(_,C){return d.sliceMatchers.push({matcher:_,reducer:C}),f},exposeAction(_,C){return d.actionCreators[_]=C,f},exposeCaseReducer(_,C){return d.sliceCaseReducersByName[_]=C,f}};u.forEach(_=>{const C=o[_],P={reducerName:_,type:ede(i,_),createNotation:typeof r.reducers=="function"};ade(C)?ode(P,C,f,t):ide(P,C,f)});function p(){const[_={},C=[],P=void 0]=typeof r.extraReducers=="function"?E3(r.extraReducers):[r.extraReducers],E={..._,...d.sliceCaseReducersByType};return Wue(r.initialState,O=>{for(let T in E)O.addCase(T,E[T]);for(let T of d.sliceMatchers)O.addMatcher(T.matcher,T.reducer);for(let T of C)O.addMatcher(T.matcher,T.reducer);P&&O.addDefaultCase(P)})}const m=_=>_,y=new Map,v=new WeakMap;let w;function S(_,C){return w||(w=p()),w(_,C)}function j(){return w||(w=p()),w.getInitialState()}function k(_,C=!1){function P(O){let T=O[_];return typeof T>"u"&&C&&(T=Om(v,P,j)),T}function E(O=m){const T=Om(y,C,()=>new WeakMap);return Om(T,O,()=>{const M={};for(const[q,$]of Object.entries(r.selectors??{}))M[q]=nde($,O,()=>Om(v,O,j),C);return M})}return{reducerPath:_,getSelectors:E,get selectors(){return E(P)},selectSlice:P}}const A={name:i,reducer:S,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:j,...k(a),injectInto(_,{reducerPath:C,...P}={}){const E=C??a;return _.inject({reducerPath:E,reducer:S},P),{...A,...k(E,!0)}}};return A}}function nde(e,t,n,r){function i(a,...o){let u=t(a);return typeof u>"u"&&r&&(u=n()),e(u,...o)}return i.unwrapped=e,i}var or=tde();function rde(){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 ide({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!sde(r))throw new Error(Wr(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Qr(e,o):Qr(e))}function ade(e){return e._reducerDefinitionType==="asyncThunk"}function sde(e){return e._reducerDefinitionType==="reducerWithPrepare"}function ode({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Wr(18));const{payloadCreator:a,fulfilled:o,pending:u,rejected:d,settled:f,options:p}=n,m=i(e,a,p);r.exposeAction(t,m),o&&r.addCase(m.fulfilled,o),u&&r.addCase(m.pending,u),d&&r.addCase(m.rejected,d),f&&r.addMatcher(m.settled,f),r.exposeCaseReducer(t,{fulfilled:o||Em,pending:u||Em,rejected:d||Em,settled:f||Em})}function Em(){}var lde="task",z3="listener",T3="completed",ak="cancelled",cde=`task-${ak}`,ude=`task-${T3}`,F1=`${z3}-${ak}`,dde=`${z3}-${T3}`,kv=class{constructor(e){this.code=e,this.message=`${lde} ${ak} (reason: ${e})`}name="TaskAbortError";message},sk=(e,t)=>{if(typeof e!="function")throw new TypeError(Wr(32))},Gg=()=>{},P3=(e,t=Gg)=>(e.catch(t),e),R3=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Sl=e=>{if(e.aborted)throw new kv(e.reason)};function M3(e,t){let n=Gg;return new Promise((r,i)=>{const a=()=>i(new kv(e.reason));if(e.aborted){a();return}n=R3(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Gg})}var fde=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof kv?"cancelled":"rejected",error:n}}finally{t?.()}},Vg=e=>t=>P3(M3(e,t).then(n=>(Sl(e),n))),D3=e=>{const t=Vg(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:du}=Object,RP={},Cv="listenerMiddleware",hde=(e,t)=>{const n=r=>R3(e,()=>r.abort(e.reason));return(r,i)=>{sk(r);const a=new AbortController;n(a);const o=fde(async()=>{Sl(e),Sl(a.signal);const u=await r({pause:Vg(a.signal),delay:D3(a.signal),signal:a.signal});return Sl(a.signal),u},()=>a.abort(ude));return i?.autoJoin&&t.push(o.catch(Gg)),{result:Vg(e)(o),cancel(){a.abort(cde)}}}},pde=(e,t)=>{const n=async(r,i)=>{Sl(t);let a=()=>{};const u=[new Promise((d,f)=>{let p=e({predicate:r,effect:(m,y)=>{y.unsubscribe(),d([m,y.getState(),y.getOriginalState()])}});a=()=>{p(),f()}})];i!=null&&u.push(new Promise(d=>setTimeout(d,i,null)));try{const d=await M3(t,Promise.race(u));return Sl(t),d}finally{a()}};return(r,i)=>P3(n(r,i))},I3=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Qr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Wr(21));return sk(a),{predicate:i,type:t,effect:a}},L3=du(e=>{const{type:t,predicate:n,effect:r}=I3(e);return{id:Xue(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Wr(22))}}},{withTypes:()=>L3}),MP=(e,t)=>{const{type:n,effect:r,predicate:i}=I3(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(F1)})},mde=(e,t)=>()=>{for(const n of t.keys())q1(n);e.clear()},DP=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},$3=du(Qr(`${Cv}/add`),{withTypes:()=>$3}),gde=Qr(`${Cv}/removeAll`),B3=du(Qr(`${Cv}/remove`),{withTypes:()=>B3}),yde=(...e)=>{console.error(`${Cv}/error`,...e)},mh=(e={})=>{const t=new Map,n=new Map,r=v=>{const w=n.get(v)??0;n.set(v,w+1)},i=v=>{const w=n.get(v)??1;w===1?n.delete(v):n.set(v,w-1)},{extra:a,onError:o=yde}=e;sk(o);const u=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),w=>{v.unsubscribe(),w?.cancelActive&&q1(v)}),d=v=>{const w=MP(t,v)??L3(v);return u(w)};du(d,{withTypes:()=>d});const f=v=>{const w=MP(t,v);return w&&(w.unsubscribe(),v.cancelActive&&q1(w)),!!w};du(f,{withTypes:()=>f});const p=async(v,w,S,j)=>{const k=new AbortController,A=pde(d,k.signal),_=[];try{v.pending.add(k),r(v),await Promise.resolve(v.effect(w,du({},S,{getOriginalState:j,condition:(C,P)=>A(C,P).then(Boolean),take:A,delay:D3(k.signal),pause:Vg(k.signal),extra:a,signal:k.signal,fork:hde(k.signal,_),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((C,P,E)=>{C!==k&&(C.abort(F1),E.delete(C))})},cancel:()=>{k.abort(F1),v.pending.delete(k)},throwIfCancelled:()=>{Sl(k.signal)}})))}catch(C){C instanceof kv||DP(o,C,{raisedBy:"effect"})}finally{await Promise.all(_),k.abort(dde),i(v),v.pending.delete(k)}},m=mde(t,n);return{middleware:v=>w=>S=>{if(!m3(S))return w(S);if($3.match(S))return d(S.payload);if(gde.match(S)){m();return}if(B3.match(S))return f(S.payload);let j=v.getState();const k=()=>{if(j===RP)throw new Error(Wr(23));return j};let A;try{if(A=w(S),t.size>0){const _=v.getState(),C=Array.from(t.values());for(const P of C){let E=!1;try{E=P.predicate(S,_,j)}catch(O){E=!1,DP(o,O,{raisedBy:"predicate"})}E&&p(P,S,v,k)}}}finally{j=RP}return A},startListening:d,stopListening:f,clearListeners:m}};function Wr(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 vde={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},U3=or({name:"chartLayout",initialState:vde,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:bde,setLayout:xde,setChartSize:wde,setScale:Sde}=U3.actions,jde=U3.reducer;function F3(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function rt(e){return Number.isFinite(e)}function xa(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function IP(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 nu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IP(Object(n),!0).forEach(function(r){Nde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nde(e,t,n){return(t=kde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kde(e){var t=Cde(e,"string");return typeof t=="symbol"?t:t+""}function Cde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $n(e,t,n){return Xn(e)||Xn(t)?n:Ai(t)?gv(e,t,n):typeof t=="function"?t(e):n}var _de=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:u}=t;if((u==="vertical"||u==="horizontal"&&o==="middle")&&a!=="center"&&Be(e[a]))return nu(nu({},e),{},{[a]:e[a]+(r||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&o!=="middle"&&Be(e[o]))return nu(nu({},e),{},{[o]:e[o]+(i||0)})}return e},Na=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",q3=(e,t,n,r)=>{if(r)return e.map(u=>u.coordinate);var i,a,o=e.map(u=>(u.coordinate===t&&(i=!0),u.coordinate===n&&(a=!0),u.coordinate));return i||o.push(t),a||o.push(n),o},H3=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:u,isCategorical:d,categoricalDomain:f,tickCount:p,ticks:m,niceTicks:y,axisType:v}=e;if(!o)return null;var w=u==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,S=i==="category"&&o.bandwidth?o.bandwidth()/w:0;if(S=v==="angleAxis"&&a&&a.length>=2?wi(a[0]-a[1])*2*S:S,m||y){var j=(m||y||[]).map((k,A)=>{var _=r?r.indexOf(k):k,C=o.map(_);return rt(C)?{coordinate:C+S,value:k,offset:S,index:A}:null}).filter(Or);return j}return d&&f?f.map((k,A)=>{var _=o.map(k);return rt(_)?{coordinate:_+S,value:k,index:A,offset:S}:null}).filter(Or):o.ticks&&p!=null?o.ticks(p).map((k,A)=>{var _=o.map(k);return rt(_)?{coordinate:_+S,value:k,index:A,offset:S}:null}).filter(Or):o.domain().map((k,A)=>{var _=o.map(k);return rt(_)?{coordinate:_+S,value:r?r[k]:k,index:A,offset:S}:null}).filter(Or)},Ade=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,o=0,u=0;u<n;++u){var d=e[u],f=d?.[i];if(f!=null){var p=f[1],m=f[0],y=ba(p)?m:p;y>=0?(f[0]=a,a+=y,f[1]=a):(f[0]=o,o+=y,f[1]=o)}}}},Ode=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,o=0;o<n;++o){var u=e[o],d=u?.[i];if(d!=null){var f=ba(d[1])?d[0]:d[1];f>=0?(d[0]=a,a+=f,d[1]=a):(d[0]=0,d[1]=0)}}}},Ede={sign:Ade,expand:nce,none:Tl,silhouette:rce,wiggle:ice,positive:Ode},zde=(e,t,n)=>{var r,i=(r=Ede[n])!==null&&r!==void 0?r:Tl,a=tce().keys(t).value((u,d)=>Number($n(u,d,0))).order(T1).offset(i),o=a(e);return o.forEach((u,d)=>{u.forEach((f,p)=>{var m=$n(e[p],t[d],0);Array.isArray(m)&&m.length===2&&Be(m[0])&&Be(m[1])&&(f[0]=m[0],f[1]=m[1])})}),o};function Tde(e){return e==null?void 0:String(e)}function LP(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Xn(i[t.dataKey])){var u=G$(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=$n(i,Xn(o)?t.dataKey:o),f=t.scale.map(d);return Be(f)?f:null}var Pde=e=>{var t=e.flat(2).filter(Be);return[Math.min(...t),Math.max(...t)]},Rde=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Mde=(e,t,n)=>{if(e!=null)return Rde(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,u=o.reduce((d,f)=>{var p=F3(f,t,n),m=Pde(p);return!rt(m[0])||!rt(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]))},$P=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,BP=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Zg=(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=yv(t,p=>p.coordinate),a=1/0,o=1,u=i.length;o<u;o++){var d=i[o],f=i[o-1];a=Math.min((d?.coordinate||0)-(f?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function UP(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return nu(nu({},t),{},{dataKey:n,payload:r,value:i,name:a})}function K3(e,t){if(e)return String(e);if(typeof t=="string")return t}var Dde=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Ide=(e,t)=>t==="centric"?e.angle:e.radius,ds=e=>e.layout.width,fs=e=>e.layout.height,Lde=e=>e.layout.scale,G3=e=>e.layout.margin,_v=le(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Av=le(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),$de="data-recharts-item-index",Bde="data-recharts-item-id",gh=60;function FP(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 zm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FP(Object(n),!0).forEach(function(r){Ude(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ude(e,t,n){return(t=Fde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fde(e){var t=qde(e,"string");return typeof t=="symbol"?t:t+""}function qde(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 Hde=e=>e.brush.height;function Kde(e){var t=Av(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:gh;return n+i}return n},0)}function Gde(e){var t=Av(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:gh;return n+i}return n},0)}function Vde(e){var t=_v(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function Zde(e){var t=_v(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Jn=le([ds,fs,G3,Hde,Kde,Gde,Vde,Zde,d3,xue],(e,t,n,r,i,a,o,u,d,f)=>{var p={left:(n.left||0)+i,right:(n.right||0)+a},m={top:(n.top||0)+o,bottom:(n.bottom||0)+u},y=zm(zm({},m),p),v=y.bottom;y.bottom+=r,y=_de(y,d,f);var w=e-y.left-y.right,S=t-y.top-y.bottom;return zm(zm({brushBottom:v},y),{},{width:Math.max(w,0),height:Math.max(S,0)})}),Yde=le(Jn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),V3=le(ds,fs,(e,t)=>({x:0,y:0,width:e,height:t})),Wde=b.createContext(null),yr=()=>b.useContext(Wde)!=null,Ov=e=>e.brush,Ev=le([Ov,Jn,G3],(e,t,n)=>({height:e.height,x:Be(e.x)?e.x:t.left,y:Be(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Be(e.width)?e.width:t.width})),eS={},tS={},nS={},qP;function Qde(){return qP||(qP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let o,u=null;const d=a!=null&&a.includes("leading"),f=a==null||a.includes("trailing"),p=()=>{u!==null&&(n.apply(o,u),o=void 0,u=null)},m=()=>{f&&p(),S()};let y=null;const v=()=>{y!=null&&clearTimeout(y),y=setTimeout(()=>{y=null,m()},r)},w=()=>{y!==null&&(clearTimeout(y),y=null)},S=()=>{w(),o=void 0,u=null},j=()=>{p()},k=function(...A){if(i?.aborted)return;o=this,u=A;const _=y==null;v(),d&&_&&p()};return k.schedule=v,k.cancel=S,k.flush=j,i?.addEventListener("abort",S,{once:!0}),k}e.debounce=t})(nS)),nS}var HP;function Xde(){return HP||(HP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Qde();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:o=!1,trailing:u=!0,maxWait:d}=a,f=Array(2);o&&(f[0]="leading"),u&&(f[1]="trailing");let p,m=null;const y=t.debounce(function(...S){p=r.apply(this,S),m=null},i,{edges:f}),v=function(...S){return d!=null&&(m===null&&(m=Date.now()),Date.now()-m>=d)?(p=r.apply(this,S),m=Date.now(),y.cancel(),y.schedule(),p):(y.apply(this,S),p)},w=()=>(y.flush(),p);return v.cancel=y.cancel,v.flush=w,v}e.debounce=n})(tS)),tS}var KP;function Jde(){return KP||(KP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Xde();function n(r,i=0,a={}){const{leading:o=!0,trailing:u=!0}=a;return t.debounce(r,i,{leading:o,maxWait:i,trailing:u})}e.throttle=n})(eS)),eS}var rS,GP;function efe(){return GP||(GP=1,rS=Jde().throttle),rS}var tfe=efe();const nfe=ja(tfe);var Yg=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var o=0;console.warn(n.replace(/%s/g,()=>i[o++]))}},ha={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},Z3=(e,t,n)=>{var{width:r=ha.width,height:i=ha.height,aspect:a,maxHeight:o}=n,u=Pl(r)?e:Number(r),d=Pl(i)?t:Number(i);return a&&a>0&&(u?d=u/a:d&&(u=d*a),o&&d!=null&&d>o&&(d=o)),{calculatedWidth:u,calculatedHeight:d}},rfe={width:0,height:0,overflow:"visible"},ife={width:0,overflowX:"visible"},afe={height:0,overflowY:"visible"},sfe={},ofe=e=>{var{width:t,height:n}=e,r=Pl(t),i=Pl(n);return r&&i?rfe:r?ife:i?afe:sfe};function lfe(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=ha.width,a=ha.height):i===void 0?i=r&&r>0?void 0:ha.width:a===void 0&&(a=r&&r>0?void 0:ha.height),{width:i,height:a}}function H1(){return H1=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},H1.apply(null,arguments)}function VP(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 ZP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VP(Object(n),!0).forEach(function(r){cfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cfe(e,t,n){return(t=ufe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ufe(e){var t=dfe(e,"string");return typeof t=="symbol"?t:t+""}function dfe(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 Y3=b.createContext(ha.initialDimension);function ffe(e){return xa(e.width)&&xa(e.height)}function W3(e){var{children:t,width:n,height:r}=e,i=b.useMemo(()=>({width:n,height:r}),[n,r]);return ffe(i)?b.createElement(Y3.Provider,{value:i},t):null}var ok=()=>b.useContext(Y3),hfe=b.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=ha.initialDimension,width:i,height:a,minWidth:o=ha.minWidth,minHeight:u,maxHeight:d,children:f,debounce:p=ha.debounce,id:m,className:y,onResize:v,style:w={}}=e,S=b.useRef(null),j=b.useRef();j.current=v,b.useImperativeHandle(t,()=>S.current);var[k,A]=b.useState({containerWidth:r.width,containerHeight:r.height}),_=b.useCallback((T,M)=>{A(q=>{var $=Math.round(T),L=Math.round(M);return q.containerWidth===$&&q.containerHeight===L?q:{containerWidth:$,containerHeight:L}})},[]);b.useEffect(()=>{if(S.current==null||typeof ResizeObserver>"u")return Bu;var T=L=>{var J,ae=L[0];if(ae!=null){var{width:Z,height:H}=ae.contentRect;_(Z,H),(J=j.current)===null||J===void 0||J.call(j,Z,H)}};p>0&&(T=nfe(T,p,{trailing:!0,leading:!1}));var M=new ResizeObserver(T),{width:q,height:$}=S.current.getBoundingClientRect();return _(q,$),M.observe(S.current),()=>{M.disconnect()}},[_,p]);var{containerWidth:C,containerHeight:P}=k;Yg(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:E,calculatedHeight:O}=Z3(C,P,{width:i,height:a,aspect:n,maxHeight:d});return Yg(E!=null&&E>0||O!=null&&O>0,`The width(%s) and height(%s) of chart should be greater than 0,
257
+ please check the style of container, or the props width(%s) and height(%s),
258
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
259
+ height and width.`,E,O,i,a,o,u,n),b.createElement("div",{id:m?"".concat(m):void 0,className:Ct("recharts-responsive-container",y),style:ZP(ZP({},w),{},{width:i,height:a,minWidth:o,minHeight:u,maxHeight:d}),ref:S},b.createElement("div",{style:ofe({width:i,height:a})},b.createElement(W3,{width:E,height:O},f)))}),Wg=b.forwardRef((e,t)=>{var n=ok();if(xa(n.width)&&xa(n.height))return e.children;var{width:r,height:i}=lfe({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=Z3(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Be(a)&&Be(o)?b.createElement(W3,{width:a,height:o},e.children):b.createElement(hfe,H1({},e,{width:r,height:i,ref:t}))});function lk(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 yh=()=>{var e,t=yr(),n=He(Yde),r=He(Ev),i=(e=He(Ov))===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}},pfe={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},Q3=()=>{var e;return(e=He(Jn))!==null&&e!==void 0?e:pfe},ck=()=>He(ds),uk=()=>He(fs),mfe=()=>He(e=>e.layout.margin),nn=e=>e.layout.layoutType,Uu=()=>He(nn),dk=()=>{var e=Uu();if(e==="horizontal"||e==="vertical")return e},X3=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},gfe=()=>{var e=Uu();return e!==void 0},vh=e=>{var t=un(),n=yr(),{width:r,height:i}=e,a=ok(),o=r,u=i;return a&&(o=a.width>0?a.width:r,u=a.height>0?a.height:i),b.useEffect(()=>{!n&&xa(o)&&xa(u)&&t(wde({width:o,height:u}))},[t,n,o,u]),null},J3=Symbol.for("immer-nothing"),YP=Symbol.for("immer-draftable"),Xr=Symbol.for("immer-state");function Gi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Uf=Object.getPrototypeOf;function wu(e){return!!e&&!!e[Xr]}function Ml(e){return e?eB(e)||Array.isArray(e)||!!e[YP]||!!e.constructor?.[YP]||bh(e)||Tv(e):!1}var yfe=Object.prototype.constructor.toString(),WP=new WeakMap;function eB(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=WP.get(n);return r===void 0&&(r=Function.toString.call(n),WP.set(n,r)),r===yfe}function Qg(e,t,n=!0){zv(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 zv(e){const t=e[Xr];return t?t.type_:Array.isArray(e)?1:bh(e)?2:Tv(e)?3:0}function K1(e,t){return zv(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function tB(e,t,n){const r=zv(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function vfe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function bh(e){return e instanceof Map}function Tv(e){return e instanceof Set}function al(e){return e.copy_||e.base_}function G1(e,t){if(bh(e))return new Map(e);if(Tv(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=eB(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Xr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],u=r[o];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(r[o]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[o]})}return Object.create(Uf(e),r)}else{const r=Uf(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function fk(e,t=!1){return Pv(e)||wu(e)||!Ml(e)||(zv(e)>1&&Object.defineProperties(e,{set:Tm,add:Tm,clear:Tm,delete:Tm}),Object.freeze(e),t&&Object.values(e).forEach(n=>fk(n,!0))),e}function bfe(){Gi(2)}var Tm={value:bfe};function Pv(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var xfe={};function Dl(e){const t=xfe[e];return t||Gi(0,e),t}var Ff;function nB(){return Ff}function wfe(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function QP(e,t){t&&(Dl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function V1(e){Z1(e),e.drafts_.forEach(Sfe),e.drafts_=null}function Z1(e){e===Ff&&(Ff=e.parent_)}function XP(e){return Ff=wfe(Ff,e)}function Sfe(e){const t=e[Xr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function JP(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Xr].modified_&&(V1(t),Gi(4)),Ml(e)&&(e=Xg(t,e),t.parent_||Jg(t,e)),t.patches_&&Dl("Patches").generateReplacementPatches_(n[Xr].base_,e,t.patches_,t.inversePatches_)):e=Xg(t,n,[]),V1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==J3?e:void 0}function Xg(e,t,n){if(Pv(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Xr];if(!i)return Qg(t,(a,o)=>eR(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Jg(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let o=a,u=!1;i.type_===3&&(o=new Set(a),a.clear(),u=!0),Qg(o,(d,f)=>eR(e,i,a,d,f,n,u),r),Jg(e,a,!1),n&&e.patches_&&Dl("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function eR(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const u=Pv(i);if(!(u&&!o)){if(wu(i)){const d=a&&t&&t.type_!==3&&!K1(t.assigned_,r)?a.concat(r):void 0,f=Xg(e,i,d);if(tB(n,r,f),wu(f))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(Ml(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&u)return;Xg(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(bh(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Jg(e,i)}}}function Jg(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&fk(t,n)}function jfe(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:nB(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=hk;n&&(i=[r],a=qf);const{revoke:o,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=o,u}var hk={get(e,t){if(t===Xr)return e;const n=al(e);if(!K1(n,t))return Nfe(e,n,t);const r=n[t];return e.finalized_||!Ml(r)?r:r===iS(e.base_,t)?(aS(e),e.copy_[t]=W1(r,e)):r},has(e,t){return t in al(e)},ownKeys(e){return Reflect.ownKeys(al(e))},set(e,t,n){const r=rB(al(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=iS(al(e),t),a=i?.[Xr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(vfe(n,i)&&(n!==void 0||K1(e.base_,t)))return!0;aS(e),Y1(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 iS(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,aS(e),Y1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=al(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Gi(11)},getPrototypeOf(e){return Uf(e.base_)},setPrototypeOf(){Gi(12)}},qf={};Qg(hk,(e,t)=>{qf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});qf.deleteProperty=function(e,t){return qf.set.call(this,e,t,void 0)};qf.set=function(e,t,n){return hk.set.call(this,e[0],t,n,e[0])};function iS(e,t){const n=e[Xr];return(n?al(n):e)[t]}function Nfe(e,t,n){const r=rB(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function rB(e,t){if(!(t in e))return;let n=Uf(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Uf(n)}}function Y1(e){e.modified_||(e.modified_=!0,e.parent_&&Y1(e.parent_))}function aS(e){e.copy_||(e.copy_=G1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var kfe=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const o=this;return function(d=a,...f){return o.produce(d,p=>n.call(this,p,...f))}}typeof n!="function"&&Gi(6),r!==void 0&&typeof r!="function"&&Gi(7);let i;if(Ml(t)){const a=XP(this),o=W1(t,void 0);let u=!0;try{i=n(o),u=!1}finally{u?V1(a):Z1(a)}return QP(a,r),JP(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===J3&&(i=void 0),this.autoFreeze_&&fk(i,!0),r){const a=[],o=[];Dl("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else Gi(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...u)=>this.produceWithPatches(o,d=>t(d,...u));let r,i;return[this.produce(t,n,(o,u)=>{r=o,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){Ml(e)||Gi(8),wu(e)&&(e=Cfe(e));const t=XP(this),n=W1(e,void 0);return n[Xr].isManual_=!0,Z1(t),n}finishDraft(e,t){const n=e&&e[Xr];(!n||!n.isManual_)&&Gi(9);const{scope_:r}=n;return QP(r,t),JP(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=Dl("Patches").applyPatches_;return wu(e)?r(e,t):this.produce(e,i=>r(i,t))}};function W1(e,t){const n=bh(e)?Dl("MapSet").proxyMap_(e,t):Tv(e)?Dl("MapSet").proxySet_(e,t):jfe(e,t);return(t?t.scope_:nB()).drafts_.push(n),n}function Cfe(e){return wu(e)||Gi(10,e),iB(e)}function iB(e){if(!Ml(e)||Pv(e))return e;const t=e[Xr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=G1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=G1(e,!0);return Qg(n,(i,a)=>{tB(n,i,iB(a))},r),t&&(t.finalized_=!1),n}var _fe=new kfe;_fe.produce;var Afe={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},aB=or({name:"legend",initialState:Afe,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:Yt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Si(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:Yt()},removeLegendPayload:{reducer(e,t){var n=Si(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:Yt()}}}),{setLegendSize:tR,setLegendSettings:Ofe,addLegendPayload:Efe,replaceLegendPayload:zfe,removeLegendPayload:Tfe}=aB.actions,Pfe=aB.reducer,sS={exports:{}},oS={};var nR;function Rfe(){if(nR)return oS;nR=1;var e=Ou();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,u=e.useDebugValue;return oS.useSyncExternalStoreWithSelector=function(d,f,p,m,y){var v=i(null);if(v.current===null){var w={hasValue:!1,value:null};v.current=w}else w=v.current;v=o(function(){function j(P){if(!k){if(k=!0,A=P,P=m(P),y!==void 0&&w.hasValue){var E=w.value;if(y(E,P))return _=E}return _=P}if(E=_,n(A,P))return E;var O=m(P);return y!==void 0&&y(E,O)?(A=P,E):(A=P,_=O)}var k=!1,A,_,C=p===void 0?null:p;return[function(){return j(f())},C===null?void 0:function(){return j(C())}]},[f,p,m,y]);var S=r(d,v[0],v[1]);return a(function(){w.hasValue=!0,w.value=S},[S]),u(S),S},oS}var rR;function Mfe(){return rR||(rR=1,sS.exports=Rfe()),sS.exports}Mfe();function Dfe(e){e()}function Ife(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Dfe(()=>{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 iR={notify(){},get:()=>[]};function Lfe(e,t){let n,r=iR,i=0,a=!1;function o(S){p();const j=r.subscribe(S);let k=!1;return()=>{k||(k=!0,j(),m())}}function u(){r.notify()}function d(){w.onStateChange&&w.onStateChange()}function f(){return a}function p(){i++,n||(n=e.subscribe(d),r=Ife())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=iR)}function y(){a||(a=!0,p())}function v(){a&&(a=!1,m())}const w={addNestedSub:o,notifyNestedSubs:u,handleChangeWrapper:d,isSubscribed:f,trySubscribe:y,tryUnsubscribe:v,getListeners:()=>r};return w}var $fe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Bfe=$fe(),Ufe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Ffe=Ufe(),qfe=()=>Bfe||Ffe?b.useLayoutEffect:b.useEffect,Hfe=qfe();function aR(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Kfe(e,t){if(aR(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])||!aR(e[n[i]],t[n[i]]))return!1;return!0}var Gfe=Symbol.for("react-redux-context"),Vfe=typeof globalThis<"u"?globalThis:{};function Zfe(){if(!b.createContext)return{};const e=Vfe[Gfe]??=new Map;let t=e.get(b.createContext);return t||(t=b.createContext(null),e.set(b.createContext,t)),t}var Yfe=Zfe();function Wfe(e){const{children:t,context:n,serverState:r,store:i}=e,a=b.useMemo(()=>{const d=Lfe(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),o=b.useMemo(()=>i.getState(),[i]);Hfe(()=>{const{subscription:d}=a;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),o!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[a,o]);const u=n||Yfe;return b.createElement(u.Provider,{value:a},t)}var Qfe=Wfe,Xfe=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Jfe(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function xh(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Xfe.has(r)){if(e[r]==null&&t[r]==null)continue;if(!Kfe(e[r],t[r]))return!1}else if(!Jfe(e[r],t[r]))return!1;return!0}var ehe=["contextPayload"];function Q1(){return Q1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q1.apply(null,arguments)}function sR(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 Su(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sR(Object(n),!0).forEach(function(r){the(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function the(e,t,n){return(t=nhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nhe(e){var t=rhe(e,"string");return typeof t=="symbol"?t:t+""}function rhe(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 ihe(e,t){if(e==null)return{};var n,r,i=ahe(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 ahe(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 she(e){return e.value}function ohe(e){var{contextPayload:t}=e,n=ihe(e,ehe),r=o3(t,e.payloadUniqBy,she),i=Su(Su({},n),{},{payload:r});return b.isValidElement(e.content)?b.cloneElement(e.content,i):typeof e.content=="function"?b.createElement(e.content,i):b.createElement(Pce,i)}function lhe(e,t,n,r,i,a){var{layout:o,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"&&o==="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}),Su(Su({},f),p)}function che(e){var t=un();return b.useEffect(()=>{t(Ofe(e))},[t,e]),null}function uhe(e){var t=un();return b.useEffect(()=>(t(tR(e)),()=>{t(tR({width:0,height:0}))}),[t,e]),null}function dhe(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var fhe={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function hhe(e){var t=gr(e,fhe),n=jue(),r=kle(),i=mfe(),{width:a,height:o,wrapperStyle:u,portal:d}=t,[f,p]=f3([n]),m=ck(),y=uk();if(m==null||y==null)return null;var v=m-(i?.left||0)-(i?.right||0),w=dhe(t.layout,o,a,v),S=d?u:Su(Su({position:"absolute",width:w?.width||a||"auto",height:w?.height||o||"auto"},lhe(u,t,i,m,y,f)),u),j=d??r;if(j==null||n==null)return null;var k=b.createElement("div",{className:"recharts-legend-wrapper",style:S,ref:p},b.createElement(che,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&b.createElement(uhe,{width:f.width,height:f.height}),b.createElement(ohe,Q1({},t,w,{margin:i,chartWidth:m,chartHeight:y,contextPayload:n})));return Ul.createPortal(k,j)}var X1=b.memo(hhe,xh);X1.displayName="Legend";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 oR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Xd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oR(Object(n),!0).forEach(function(r){phe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function phe(e,t,n){return(t=mhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mhe(e){var t=ghe(e,"string");return typeof t=="symbol"?t:t+""}function ghe(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 yhe(e){return Array.isArray(e)&&Ai(e[0])&&Ai(e[1])?e.join(" ~ "):e}var Bc={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 vhe(e,t){return t==null?e:yv(e,t)}var bhe=e=>{var{separator:t=Bc.separator,contentStyle:n,itemStyle:r,labelStyle:i=Bc.labelStyle,payload:a,formatter:o,itemSorter:u,wrapperClassName:d,labelClassName:f,label:p,labelFormatter:m,accessibilityLayer:y=Bc.accessibilityLayer}=e,v=()=>{if(a&&a.length){var P={padding:0,margin:0},E=vhe(a,u),O=E.map((T,M)=>{if(!T||T.type==="none")return null;var q=T.formatter||o||yhe,{value:$,name:L}=T,J=$,ae=L;if(q){var Z=q($,L,T,M,a);if(Array.isArray(Z))[J,ae]=Z;else if(Z!=null)J=Z;else return null}var H=Xd(Xd({},Bc.itemStyle),{},{color:T.color||Bc.itemStyle.color},r);return b.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(M),style:H},Ai(ae)?b.createElement("span",{className:"recharts-tooltip-item-name"},ae):null,Ai(ae)?b.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,b.createElement("span",{className:"recharts-tooltip-item-value"},J),b.createElement("span",{className:"recharts-tooltip-item-unit"},T.unit||""))});return b.createElement("ul",{className:"recharts-tooltip-item-list",style:P},O)}return null},w=Xd(Xd({},Bc.contentStyle),n),S=Xd({margin:0},i),j=!Xn(p),k=j?p:"",A=Ct("recharts-default-tooltip",d),_=Ct("recharts-tooltip-label",f);j&&m&&a!==void 0&&a!==null&&(k=m(p,a));var C=y?{role:"status","aria-live":"assertive"}:{};return b.createElement("div",J1({className:A,style:w},C),b.createElement("p",{className:_,style:S},b.isValidElement(k)?k:"".concat(k)),v())},Jd="recharts-tooltip-wrapper",xhe={visibility:"hidden"};function whe(e){var{coordinate:t,translateX:n,translateY:r}=e;return Ct(Jd,{["".concat(Jd,"-right")]:Be(n)&&t&&Be(t.x)&&n>=t.x,["".concat(Jd,"-left")]:Be(n)&&t&&Be(t.x)&&n<t.x,["".concat(Jd,"-bottom")]:Be(r)&&t&&Be(t.y)&&r>=t.y,["".concat(Jd,"-top")]:Be(r)&&t&&Be(t.y)&&r<t.y})}function lR(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:u,viewBox:d,viewBoxDimension:f}=e;if(a&&Be(a[r]))return a[r];var p=n[r]-u-(i>0?i:0),m=n[r]+i;if(t[r])return o[r]?p:m;var y=d[r];if(y==null)return 0;if(o[r]){var v=p,w=y;return v<w?Math.max(m,y):Math.max(p,y)}if(f==null)return 0;var S=m+u,j=y+f;return S>j?Math.max(p,y):Math.max(m,y)}function She(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 jhe(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:u,useTranslate3d:d,viewBox:f}=e,p,m,y;return u.height>0&&u.width>0&&n?(m=lR({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:u.width,viewBox:f,viewBoxDimension:f.width}),y=lR({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:u.height,viewBox:f,viewBoxDimension:f.height}),p=She({translateX:m,translateY:y,useTranslate3d:d})):p=xhe,{cssProperties:p,cssClasses:whe({translateX:m,translateY:y,coordinate:n})}}var Nhe=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),wh={isSsr:Nhe()};function sB(){var[e,t]=b.useState(()=>wh.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return b.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 cR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Uc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cR(Object(n),!0).forEach(function(r){khe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function khe(e,t,n){return(t=Che(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Che(e){var t=_he(e,"string");return typeof t=="symbol"?t:t+""}function _he(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ahe(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function Ohe(e){var t,n,r,i,a,o,u=sB(),[d,f]=b.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));b.useEffect(()=>{var w=S=>{if(S.key==="Escape"){var j,k,A,_;f({dismissed:!0,dismissedAtCoordinate:{x:(j=(k=e.coordinate)===null||k===void 0?void 0:k.x)!==null&&j!==void 0?j:0,y:(A=(_=e.coordinate)===null||_===void 0?void 0:_.y)!==null&&A!==void 0?A:0}})}};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),d.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==d.dismissedAtCoordinate.x||((a=(o=e.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==d.dismissedAtCoordinate.y)&&f(Uc(Uc({},d),{},{dismissed:!1}));var{cssClasses:p,cssProperties:m}=jhe({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),y=e.hasPortalFromProps?{}:Uc(Uc({transition:Ahe({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},m),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=Uc(Uc({},y),{},{visibility:!d.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return b.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:v,ref:e.innerRef},e.children)}var Ehe=b.memo(Ohe),oB=()=>{var e;return(e=He(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function ej(){return ej=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ej.apply(null,arguments)}function uR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uR(Object(n),!0).forEach(function(r){zhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zhe(e,t,n){return(t=The(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function The(e){var t=Phe(e,"string");return typeof t=="symbol"?t:t+""}function Phe(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 fR={curveBasisClosed:Hle,curveBasisOpen:Kle,curveBasis:qle,curveBumpX:Ole,curveBumpY:Ele,curveLinearClosed:Gle,curveLinear:pv,curveMonotoneX:Vle,curveMonotoneY:Zle,curveNatural:Yle,curveStep:Wle,curveStepAfter:Xle,curveStepBefore:Qle},ey=e=>rt(e.x)&&rt(e.y),hR=e=>e.base!=null&&ey(e.base)&&ey(e),ef=e=>e.x,tf=e=>e.y,Rhe=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(hh(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=fR["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return fR[n]||pv},pR={connectNulls:!1,type:"linear"},Mhe=e=>{var{type:t=pR.type,points:n=[],baseLine:r,layout:i,connectNulls:a=pR.connectNulls}=e,o=Rhe(t,i),u=a?n.filter(ey):n;if(Array.isArray(r)){var d,f=n.map((w,S)=>dR(dR({},w),{},{base:r[S]}));i==="vertical"?d=km().y(tf).x1(ef).x0(w=>w.base.x):d=km().x(ef).y1(tf).y0(w=>w.base.y);var p=d.defined(hR).curve(o),m=a?f.filter(hR):f;return p(m)}var y;i==="vertical"&&Be(r)?y=km().y(tf).x1(ef).x0(r):Be(r)?y=km().x(ef).y1(tf).y0(r):y=P$().x(ef).y(tf);var v=y.defined(ey).curve(o);return v(u)},ig=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Uu();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},u=n&&n.length?Mhe(o):r;return b.createElement("path",ej({},Zi(e),XN(e),{className:Ct("recharts-curve",t),d:u===null?void 0:u,ref:i}))},Dhe=["x","y","top","left","width","height","className"];function tj(){return tj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tj.apply(null,arguments)}function mR(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 Ihe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mR(Object(n),!0).forEach(function(r){Lhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lhe(e,t,n){return(t=$he(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $he(e){var t=Bhe(e,"string");return typeof t=="symbol"?t:t+""}function Bhe(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 Uhe(e,t){if(e==null)return{};var n,r,i=Fhe(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 Fhe(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 qhe=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),Hhe=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:u}=e,d=Uhe(e,Dhe),f=Ihe({x:t,y:n,top:r,left:i,width:a,height:o},d);return!Be(t)||!Be(n)||!Be(a)||!Be(o)||!Be(r)||!Be(i)?null:b.createElement("path",tj({},Pr(f),{className:Ct("recharts-cross",u),d:qhe(t,n,a,o,r,i)}))};function Khe(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 gR(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 yR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gR(Object(n),!0).forEach(function(r){Ghe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ghe(e,t,n){return(t=Vhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vhe(e){var t=Zhe(e,"string");return typeof t=="symbol"?t:t+""}function Zhe(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 Yhe=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),Whe=(e,t,n)=>e.map(r=>"".concat(Yhe(r)," ").concat(t,"ms ").concat(n)).join(","),Qhe=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Hf=(e,t)=>Object.keys(t).reduce((n,r)=>yR(yR({},n),{},{[r]:e(r,t[r])}),{});function vR(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 Rn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vR(Object(n),!0).forEach(function(r){Xhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xhe(e,t,n){return(t=Jhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jhe(e){var t=epe(e,"string");return typeof t=="symbol"?t:t+""}function epe(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 ty=(e,t,n)=>e+(t-e)*n,nj=e=>{var{from:t,to:n}=e;return t!==n},lB=(e,t,n)=>{var r=Hf((i,a)=>{if(nj(a)){var[o,u]=e(a.from,a.to,a.velocity);return Rn(Rn({},a),{},{from:o,velocity:u})}return a},t);return n<1?Hf((i,a)=>nj(a)&&r[i]!=null?Rn(Rn({},a),{},{velocity:ty(a.velocity,r[i].velocity,n),from:ty(a.from,r[i].from,n)}):a,t):lB(e,r,n-1)};function tpe(e,t,n,r,i,a){var o,u=r.reduce((y,v)=>Rn(Rn({},y),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),d=()=>Hf((y,v)=>v.from,u),f=()=>!Object.values(u).filter(nj).length,p=null,m=y=>{o||(o=y);var v=y-o,w=v/n.dt;u=lB(n,u,w),i(Rn(Rn(Rn({},e),t),d())),o=y,f()||(p=a.setTimeout(m))};return()=>(p=a.setTimeout(m),()=>{var y;(y=p)===null||y===void 0||y()})}function npe(e,t,n,r,i,a,o){var u=null,d=i.reduce((m,y)=>{var v=e[y],w=t[y];return v==null||w==null?m:Rn(Rn({},m),{},{[y]:[v,w]})},{}),f,p=m=>{f||(f=m);var y=(m-f)/r,v=Hf((S,j)=>ty(...j,n(y)),d);if(a(Rn(Rn(Rn({},e),t),v)),y<1)u=o.setTimeout(p);else{var w=Hf((S,j)=>ty(...j,n(1)),d);a(Rn(Rn(Rn({},e),t),w))}};return()=>(u=o.setTimeout(p),()=>{var m;(m=u)===null||m===void 0||m()})}const rpe=(e,t,n,r,i,a)=>{var o=Qhe(e,t);return n==null?()=>(i(Rn(Rn({},e),t)),()=>{}):n.isStepper===!0?tpe(e,t,n,o,i,a):npe(e,t,n,r,o,i,a)};var ny=1e-4,cB=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],uB=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),bR=(e,t)=>n=>{var r=cB(e,t);return uB(r,n)},ipe=(e,t)=>n=>{var r=cB(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return uB(i,n)},ape=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]]},spe=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=ape(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},ope=(e,t,n,r)=>{var i=bR(e,n),a=bR(t,r),o=ipe(e,n),u=f=>f>1?1:f<0?0:f,d=f=>{for(var p=f>1?1:f,m=p,y=0;y<8;++y){var v=i(m)-p,w=o(m);if(Math.abs(v-p)<ny||w<ny)return a(m);m=u(m-v/w)}return a(m)};return d.isStepper=!1,d},xR=function(){return ope(...spe(...arguments))},lpe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(o,u,d)=>{var f=-(o-u)*n,p=d*r,m=d+(f-p)*i/1e3,y=d*i/1e3+o;return Math.abs(y-u)<ny&&Math.abs(m)<ny?[u,0]:[y,m]};return a.isStepper=!0,a.dt=i,a},cpe=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return xR(e);case"spring":return lpe();default:if(e.split("(")[0]==="cubic-bezier")return xR(e)}return typeof e=="function"?e:null};function upe(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var u=o,[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 o=="string"&&(t=o,n(t)),typeof o=="object"&&(t=o,n(t)),typeof o=="function"&&o()}};return{stop:()=>{r=!0},start:o=>{r=!1,i&&(i(),i=null),a(o)},subscribe:o=>(n=o,()=>{n=()=>null}),getTimeoutController:()=>e}}class dpe{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=o=>{o-r>=n?t(o):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function fpe(){return upe(new dpe)}var hpe=b.createContext(fpe);function ppe(e,t){var n=b.useContext(hpe);return b.useMemo(()=>t??n(e),[e,t,n])}var mpe={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},wR={t:0},lS={t:1};function dB(e){var t=gr(e,mpe),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:u,onAnimationStart:d,children:f}=t,p=sB(),m=n==="auto"?!wh.isSsr&&!p:n,y=ppe(t.animationId,t.animationManager),[v,w]=b.useState(m?wR:lS),S=b.useRef(null);return b.useEffect(()=>{m||w(lS)},[m]),b.useEffect(()=>{if(!m||!r)return Bu;var j=rpe(wR,lS,cpe(a),i,w,y.getTimeoutController()),k=()=>{S.current=j()};return y.start([d,o,k,i,u]),()=>{y.stop(),S.current&&S.current(),u()}},[m,r,i,a,o,d,u,y]),f(v.t)}function fB(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=b.useRef(If(t)),r=b.useRef(e);return r.current!==e&&(n.current=If(t),r.current=e),n.current}var gpe=["radius"],ype=["radius"],SR,jR,NR,kR,CR,_R,AR,OR,ER,zR;function TR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function PR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TR(Object(n),!0).forEach(function(r){vpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vpe(e,t,n){return(t=bpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bpe(e){var t=xpe(e,"string");return typeof t=="symbol"?t:t+""}function xpe(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 ry(){return ry=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},ry.apply(null,arguments)}function RR(e,t){if(e==null)return{};var n,r,i=wpe(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 wpe(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 aa(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var MR=(e,t,n,r,i)=>{var a=no(n),o=no(r),u=Math.min(Math.abs(a)/2,Math.abs(o)/2),d=o>=0?1:-1,f=a>=0?1:-1,p=o>=0&&a>=0||o<0&&a<0?1:0,m;if(u>0&&Array.isArray(i)){for(var y=[0,0,0,0],v=0,w=4;v<w;v++){var S,j=(S=i[v])!==null&&S!==void 0?S:0;y[v]=j>u?u:j}m=Zn(SR||(SR=aa(["M",",",""])),e,t+d*y[0]),y[0]>0&&(m+=Zn(jR||(jR=aa(["A ",",",",0,0,",",",",",""])),y[0],y[0],p,e+f*y[0],t)),m+=Zn(NR||(NR=aa(["L ",",",""])),e+n-f*y[1],t),y[1]>0&&(m+=Zn(kR||(kR=aa(["A ",",",",0,0,",`,
260
+ `,",",""])),y[1],y[1],p,e+n,t+d*y[1])),m+=Zn(CR||(CR=aa(["L ",",",""])),e+n,t+r-d*y[2]),y[2]>0&&(m+=Zn(_R||(_R=aa(["A ",",",",0,0,",`,
261
+ `,",",""])),y[2],y[2],p,e+n-f*y[2],t+r)),m+=Zn(AR||(AR=aa(["L ",",",""])),e+f*y[3],t+r),y[3]>0&&(m+=Zn(OR||(OR=aa(["A ",",",",0,0,",`,
262
+ `,",",""])),y[3],y[3],p,e,t+r-d*y[3])),m+="Z"}else if(u>0&&i===+i&&i>0){var k=Math.min(u,i);m=Zn(ER||(ER=aa(["M ",",",`
263
+ A `,",",",0,0,",",",",",`
264
+ L `,",",`
265
+ A `,",",",0,0,",",",",",`
266
+ L `,",",`
267
+ A `,",",",0,0,",",",",",`
268
+ L `,",",`
269
+ A `,",",",0,0,",",",","," Z"])),e,t+d*k,k,k,p,e+f*k,t,e+n-f*k,t,k,k,p,e+n,t+d*k,e+n,t+r-d*k,k,k,p,e+n-f*k,t+r,e+f*k,t+r,k,k,p,e,t+r-d*k)}else m=Zn(zR||(zR=aa(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},DR={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Spe=e=>{var t=gr(e,DR),n=b.useRef(null),[r,i]=b.useState(-1);b.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var Q=n.current.getTotalLength();Q&&i(Q)}catch{}},[]);var{x:a,y:o,width:u,height:d,radius:f,className:p}=t,{animationEasing:m,animationDuration:y,animationBegin:v,isAnimationActive:w,isUpdateAnimationActive:S}=t,j=b.useRef(u),k=b.useRef(d),A=b.useRef(a),_=b.useRef(o),C=b.useMemo(()=>({x:a,y:o,width:u,height:d,radius:f}),[a,o,u,d,f]),P=fB(C,"rectangle-");if(a!==+a||o!==+o||u!==+u||d!==+d||u===0||d===0)return null;var E=Ct("recharts-rectangle",p);if(!S){var O=Pr(t),{radius:T}=O,M=RR(O,gpe);return b.createElement("path",ry({},M,{x:no(a),y:no(o),width:no(u),height:no(d),radius:typeof f=="number"?f:void 0,className:E,d:MR(a,o,u,d,f)}))}var q=j.current,$=k.current,L=A.current,J=_.current,ae="0px ".concat(r===-1?1:r,"px"),Z="".concat(r,"px ").concat(r,"px"),H=Whe(["strokeDasharray"],y,typeof m=="string"?m:DR.animationEasing);return b.createElement(dB,{animationId:P,key:P,canBegin:r>0,duration:y,easing:m,isActive:S,begin:v},Q=>{var he=ua(q,u,Q),we=ua($,d,Q),R=ua(L,a,Q),U=ua(J,o,Q);n.current&&(j.current=he,k.current=we,A.current=R,_.current=U);var F;w?Q>0?F={transition:H,strokeDasharray:Z}:F={strokeDasharray:ae}:F={strokeDasharray:Z};var D=Pr(t),{radius:Y}=D,se=RR(D,ype);return b.createElement("path",ry({},se,{radius:typeof f=="number"?f:void 0,className:E,d:MR(R,U,he,we,f),ref:n,style:PR(PR({},F),t.style)}))})};function IR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function LR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IR(Object(n),!0).forEach(function(r){jpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jpe(e,t,n){return(t=Npe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Npe(e){var t=kpe(e,"string");return typeof t=="symbol"?t:t+""}function kpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var iy=Math.PI/180,Cpe=e=>e*180/Math.PI,Qn=(e,t,n,r)=>({x:e+Math.cos(-iy*r)*n,y:t+Math.sin(-iy*r)*n}),_pe=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},Ape=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},Ope=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=Ape({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var u=(n-i)/o,d=Math.acos(u);return r>a&&(d=2*Math.PI-d),{radius:o,angle:Cpe(d),angleInRadian:d}},Epe=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}},zpe=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return e+o*360},Tpe=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=Ope({x:n,y:r},t),{innerRadius:o,outerRadius:u}=t;if(i<o||i>u||i===0)return null;var{startAngle:d,endAngle:f}=Epe(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?LR(LR({},t),{},{radius:i,angle:zpe(p,t)}):null};function hB(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=Qn(t,n,r,i),u=Qn(t,n,r,a);return{points:[o,u],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var $R,BR,UR,FR,qR,HR,KR;function rj(){return rj=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},rj.apply(null,arguments)}function hl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Ppe=(e,t)=>{var n=wi(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Pm=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:u,cornerIsExternal:d}=e,f=u*(o?1:-1)+r,p=Math.asin(u/f)/iy,m=d?i:i+a*p,y=Qn(t,n,f,m),v=Qn(t,n,r,m),w=d?i-a*p:i,S=Qn(t,n,f*Math.cos(p*iy),w);return{center:y,circleTangency:v,lineTangency:S,theta:p}},pB=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,u=Ppe(a,o),d=a+u,f=Qn(t,n,i,a),p=Qn(t,n,i,d),m=Zn($R||($R=hl(["M ",",",`
270
+ A `,",",`,0,
271
+ `,",",`,
272
+ `,",",`
273
+ `])),f.x,f.y,i,i,+(Math.abs(u)>180),+(a>d),p.x,p.y);if(r>0){var y=Qn(t,n,r,a),v=Qn(t,n,r,d);m+=Zn(BR||(BR=hl(["L ",",",`
274
+ A `,",",`,0,
275
+ `,",",`,
276
+ `,","," Z"])),v.x,v.y,r,r,+(Math.abs(u)>180),+(a<=d),y.x,y.y)}else m+=Zn(UR||(UR=hl(["L ",","," Z"])),t,n);return m},Rpe=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:u,startAngle:d,endAngle:f}=e,p=wi(f-d),{circleTangency:m,lineTangency:y,theta:v}=Pm({cx:t,cy:n,radius:i,angle:d,sign:p,cornerRadius:a,cornerIsExternal:u}),{circleTangency:w,lineTangency:S,theta:j}=Pm({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-j;if(k<0)return o?Zn(FR||(FR=hl(["M ",",",`
277
+ a`,",",",0,0,1,",`,0
278
+ a`,",",",0,0,1,",`,0
279
+ `])),y.x,y.y,a,a,a*2,a,a,-a*2):pB({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:f});var A=Zn(qR||(qR=hl(["M ",",",`
280
+ A`,",",",0,0,",",",",",`
281
+ A`,",",",0,",",",",",",",`
282
+ A`,",",",0,0,",",",",",`
283
+ `])),y.x,y.y,a,a,+(p<0),m.x,m.y,i,i,+(k>180),+(p<0),w.x,w.y,a,a,+(p<0),S.x,S.y);if(r>0){var{circleTangency:_,lineTangency:C,theta:P}=Pm({cx:t,cy:n,radius:r,angle:d,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),{circleTangency:E,lineTangency:O,theta:T}=Pm({cx:t,cy:n,radius:r,angle:f,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),M=u?Math.abs(d-f):Math.abs(d-f)-P-T;if(M<0&&a===0)return"".concat(A,"L").concat(t,",").concat(n,"Z");A+=Zn(HR||(HR=hl(["L",",",`
284
+ A`,",",",0,0,",",",",",`
285
+ A`,",",",0,",",",",",",",`
286
+ A`,",",",0,0,",",",",","Z"])),O.x,O.y,a,a,+(p<0),E.x,E.y,r,r,+(M>180),+(p>0),_.x,_.y,a,a,+(p<0),C.x,C.y)}else A+=Zn(KR||(KR=hl(["L",",","Z"])),t,n);return A},Mpe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Dpe=e=>{var t=gr(e,Mpe),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p,className:m}=t;if(a<i||f===p)return null;var y=Ct("recharts-sector",m),v=a-i,w=yo(o,v,0,!0),S;return w>0&&Math.abs(f-p)<360?S=Rpe({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(w,v/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p}):S=pB({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:p}),b.createElement("path",rj({},Pr(t),{className:y,d:S}))};function Ipe(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(Y$(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:u}=t,d=Qn(r,i,a,u),f=Qn(r,i,o,u);return[{x:d.x,y:d.y},{x:f.x,y:f.y}]}return hB(t)}}var cS={},uS={},dS={},GR;function Lpe(){return GR||(GR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=c3();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(dS)),dS}var VR;function $pe(){return VR||(VR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Lpe();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})(uS)),uS}var ZR;function Bpe(){return ZR||(ZR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=u3(),n=$pe();function r(i,a,o){o&&typeof o!="number"&&t.isIterateeCall(i,a,o)&&(a=o=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),o=o===void 0?i<a?1:-1:n.toFinite(o);const u=Math.max(Math.ceil((a-i)/(o||1)),0),d=new Array(u);for(let f=0;f<u;f++)d[f]=i,i+=o;return d}e.range=r})(cS)),cS}var fS,YR;function Upe(){return YR||(YR=1,fS=Bpe().range),fS}var Fpe=Upe();const mB=ja(Fpe);var ea=e=>e.chartData,pk=le([ea],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Rv=(e,t,n,r)=>r?pk(e):ea(e),qpe=(e,t,n)=>n?pk(e):ea(e),Hpe=le([Rv],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});le([pk],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var Kpe=le([ea],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function ma(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(rt(t)&&rt(n))return!0}return!1}function WR(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function gB(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(rt(n))i=n;else if(typeof n=="function")return;if(rt(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(ma(o))return o}}function Gpe(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(ma(r))return WR(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,u;if(i==="auto")t!=null&&(o=Math.min(...t));else if(Be(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t?.[0]))}catch{}else if(typeof i=="string"&&$P.test(i)){var d=$P.exec(i);if(d==null||d[1]==null||t==null)o=void 0;else{var f=+d[1];o=t[0]-f}}else o=t?.[0];if(a==="auto")t!=null&&(u=Math.max(...t));else if(Be(a))u=a;else if(typeof a=="function")try{t!=null&&(u=a(t?.[1]))}catch{}else if(typeof a=="string"&&BP.test(a)){var p=BP.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 y=[o,u];if(ma(y))return t==null?y:WR(y,t,n)}}}var Fu=1e9,Vpe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},gk,en=!0,Oi="[DecimalError] ",jl=Oi+"Invalid argument: ",mk=Oi+"Exponent out of range: ",qu=Math.floor,sl=Math.pow,Zpe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Vr,Ln=1e7,Wt=7,yB=9007199254740991,ay=qu(yB/Wt),De={};De.absoluteValue=De.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};De.comparedTo=De.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};De.decimalPlaces=De.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Wt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};De.dividedBy=De.div=function(e){return is(this,new this.constructor(e))};De.dividedToIntegerBy=De.idiv=function(e){var t=this,n=t.constructor;return $t(is(t,new n(e),0,1),n.precision)};De.equals=De.eq=function(e){return!this.cmp(e)};De.exponent=function(){return On(this)};De.greaterThan=De.gt=function(e){return this.cmp(e)>0};De.greaterThanOrEqualTo=De.gte=function(e){return this.cmp(e)>=0};De.isInteger=De.isint=function(){return this.e>this.d.length-2};De.isNegative=De.isneg=function(){return this.s<0};De.isPositive=De.ispos=function(){return this.s>0};De.isZero=function(){return this.s===0};De.lessThan=De.lt=function(e){return this.cmp(e)<0};De.lessThanOrEqualTo=De.lte=function(e){return this.cmp(e)<1};De.logarithm=De.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Vr))throw Error(Oi+"NaN");if(n.s<1)throw Error(Oi+(n.s?"NaN":"-Infinity"));return n.eq(Vr)?new r(0):(en=!1,t=is(Kf(n,a),Kf(e,a),a),en=!0,$t(t,i))};De.minus=De.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?xB(t,e):vB(t,(e.s=-e.s,e))};De.modulo=De.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Oi+"NaN");return n.s?(en=!1,t=is(n,e,0,1).times(e),en=!0,n.minus(t)):$t(new r(n),i)};De.naturalExponential=De.exp=function(){return bB(this)};De.naturalLogarithm=De.ln=function(){return Kf(this)};De.negated=De.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};De.plus=De.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?vB(t,e):xB(t,(e.s=-e.s,e))};De.precision=De.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(jl+e);if(t=On(i)+1,r=i.d.length-1,n=r*Wt+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};De.squareRoot=De.sqrt=function(){var e,t,n,r,i,a,o,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(Oi+"NaN")}for(e=On(u),en=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=pa(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=qu((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(i.toString()),n=d.precision,i=o=n+3;;)if(a=r,r=a.plus(is(u,a,o+2)).times(.5),pa(a.d).slice(0,o)===(t=pa(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if($t(a,n+1,0),a.times(a).eq(u)){r=a;break}}else if(t!="9999")break;o+=4}return en=!0,$t(r,n)};De.times=De.mul=function(e){var t,n,r,i,a,o,u,d,f,p=this,m=p.constructor,y=p.d,v=(e=new m(e)).d;if(!p.s||!e.s)return new m(0);for(e.s*=p.s,n=p.e+e.e,d=y.length,f=v.length,d<f&&(a=y,y=v,v=a,o=d,d=f,f=o),a=[],o=d+f,r=o;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=d+r;i>r;)u=a[i]+v[r]*y[i-r-1]+t,a[i--]=u%Ln|0,t=u/Ln|0;a[i]=(a[i]+t)%Ln|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,en?$t(e,m.precision):e};De.toDecimalPlaces=De.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(wa(e,0,Fu),t===void 0?t=r.rounding:wa(t,0,8),$t(n,e+On(n)+1,t))};De.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Il(r,!0):(wa(e,0,Fu),t===void 0?t=i.rounding:wa(t,0,8),r=$t(new i(r),e+1,t),n=Il(r,!0,e+1)),n};De.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?Il(i):(wa(e,0,Fu),t===void 0?t=a.rounding:wa(t,0,8),r=$t(new a(i),e+On(i)+1,t),n=Il(r.abs(),!1,e+On(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};De.toInteger=De.toint=function(){var e=this,t=e.constructor;return $t(new t(e),On(e)+1,t.rounding)};De.toNumber=function(){return+this};De.toPower=De.pow=function(e){var t,n,r,i,a,o,u=this,d=u.constructor,f=12,p=+(e=new d(e));if(!e.s)return new d(Vr);if(u=new d(u),!u.s){if(e.s<1)throw Error(Oi+"Infinity");return u}if(u.eq(Vr))return u;if(r=d.precision,e.eq(Vr))return $t(u,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=u.s,o){if((n=p<0?-p:p)<=yB){for(i=new d(Vr),t=Math.ceil(r/Wt+4),en=!1;n%2&&(i=i.times(u),XR(i.d,t)),n=qu(n/2),n!==0;)u=u.times(u),XR(u.d,t);return en=!0,e.s<0?new d(Vr).div(i):$t(i,r)}}else if(a<0)throw Error(Oi+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,en=!1,i=e.times(Kf(u,r+f)),en=!0,i=bB(i),i.s=a,i};De.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=On(i),r=Il(i,n<=a.toExpNeg||n>=a.toExpPos)):(wa(e,1,Fu),t===void 0?t=a.rounding:wa(t,0,8),i=$t(new a(i),e,t),n=On(i),r=Il(i,e<=n||n<=a.toExpNeg,e)),r};De.toSignificantDigits=De.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(wa(e,1,Fu),t===void 0?t=r.rounding:wa(t,0,8)),$t(new r(n),e,t)};De.toString=De.valueOf=De.val=De.toJSON=De[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=On(e),n=e.constructor;return Il(e,t<=n.toExpNeg||t>=n.toExpPos)};function vB(e,t){var n,r,i,a,o,u,d,f,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),en?$t(t,m):t;if(d=e.d,f=t.d,o=e.e,i=t.e,d=d.slice(),a=o-i,a){for(a<0?(r=d,a=-a,u=f.length):(r=f,i=o,u=d.length),o=Math.ceil(m/Wt),u=o>u?o+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)/Ln|0,d[a]%=Ln;for(n&&(d.unshift(n),++i),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=i,en?$t(t,m):t}function wa(e,t,n){if(e!==~~e||e<t||e>n)throw Error(jl+e)}function pa(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=Wt-r.length,n&&(a+=Ys(n)),a+=r;o=e[t],r=o+"",n=Wt-r.length,n&&(a+=Ys(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var is=(function(){function e(r,i){var a,o=0,u=r.length;for(r=r.slice();u--;)a=r[u]*i+o,r[u]=a%Ln|0,o=a/Ln|0;return o&&r.unshift(o),r}function t(r,i,a,o){var u,d;if(a!=o)d=a>o?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 o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*Ln+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var u,d,f,p,m,y,v,w,S,j,k,A,_,C,P,E,O,T,M=r.constructor,q=r.s==i.s?1:-1,$=r.d,L=i.d;if(!r.s)return new M(r);if(!i.s)throw Error(Oi+"Division by zero");for(d=r.e-i.e,O=L.length,P=$.length,v=new M(q),w=v.d=[],f=0;L[f]==($[f]||0);)++f;if(L[f]>($[f]||0)&&--d,a==null?A=a=M.precision:o?A=a+(On(r)-On(i))+1:A=a,A<0)return new M(0);if(A=A/Wt+2|0,f=0,O==1)for(p=0,L=L[0],A++;(f<P||p)&&A--;f++)_=p*Ln+($[f]||0),w[f]=_/L|0,p=_%L|0;else{for(p=Ln/(L[0]+1)|0,p>1&&(L=e(L,p),$=e($,p),O=L.length,P=$.length),C=O,S=$.slice(0,O),j=S.length;j<O;)S[j++]=0;T=L.slice(),T.unshift(0),E=L[0],L[1]>=Ln/2&&++E;do p=0,u=t(L,S,O,j),u<0?(k=S[0],O!=j&&(k=k*Ln+(S[1]||0)),p=k/E|0,p>1?(p>=Ln&&(p=Ln-1),m=e(L,p),y=m.length,j=S.length,u=t(m,S,y,j),u==1&&(p--,n(m,O<y?T:L,y))):(p==0&&(u=p=1),m=L.slice()),y=m.length,y<j&&m.unshift(0),n(S,m,j),u==-1&&(j=S.length,u=t(L,S,O,j),u<1&&(p++,n(S,O<j?T:L,j))),j=S.length):u===0&&(p++,S=[0]),w[f++]=p,u&&S[0]?S[j++]=$[C]||0:(S=[$[C]],j=1);while((C++<P||S[0]!==void 0)&&A--)}return w[0]||w.shift(),v.e=d,$t(v,o?a+On(v)+1:a)}})();function bB(e,t){var n,r,i,a,o,u,d=0,f=0,p=e.constructor,m=p.precision;if(On(e)>16)throw Error(mk+On(e));if(!e.s)return new p(Vr);for(en=!1,u=m,o=new p(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(sl(2,f))/Math.LN10*2+5|0,u+=r,n=i=a=new p(Vr),p.precision=u;;){if(i=$t(i.times(e),u),n=n.times(++d),o=a.plus(is(i,n,u)),pa(o.d).slice(0,u)===pa(a.d).slice(0,u)){for(;f--;)a=$t(a.times(a),u);return p.precision=m,t==null?(en=!0,$t(a,m)):a}a=o}}function On(e){for(var t=e.e*Wt,n=e.d[0];n>=10;n/=10)t++;return t}function hS(e,t,n){if(t>e.LN10.sd())throw en=!0,n&&(e.precision=n),Error(Oi+"LN10 precision limit exceeded");return $t(new e(e.LN10),t)}function Ys(e){for(var t="";e--;)t+="0";return t}function Kf(e,t){var n,r,i,a,o,u,d,f,p,m=1,y=10,v=e,w=v.d,S=v.constructor,j=S.precision;if(v.s<1)throw Error(Oi+(v.s?"NaN":"-Infinity"));if(v.eq(Vr))return new S(0);if(t==null?(en=!1,f=j):f=t,v.eq(10))return t==null&&(en=!0),hS(S,f);if(f+=y,S.precision=f,n=pa(w),r=n.charAt(0),a=On(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=pa(v.d),r=n.charAt(0),m++;a=On(v),r>1?(v=new S("0."+n),a++):v=new S(r+"."+n.slice(1))}else return d=hS(S,f+2,j).times(a+""),v=Kf(new S(r+"."+n.slice(1)),f-y).plus(d),S.precision=j,t==null?(en=!0,$t(v,j)):v;for(u=o=v=is(v.minus(Vr),v.plus(Vr),f),p=$t(v.times(v),f),i=3;;){if(o=$t(o.times(p),f),d=u.plus(is(o,new S(i),f)),pa(d.d).slice(0,f)===pa(u.d).slice(0,f))return u=u.times(2),a!==0&&(u=u.plus(hS(S,f+2,j).times(a+""))),u=is(u,new S(m),f),S.precision=j,t==null?(en=!0,$t(u,j)):u;u=d,i+=2}}function QR(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=qu(n/Wt),e.d=[],r=(n+1)%Wt,n<0&&(r+=Wt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Wt;r<i;)e.d.push(+t.slice(r,r+=Wt));t=t.slice(r),r=Wt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),en&&(e.e>ay||e.e<-ay))throw Error(mk+n)}else e.s=0,e.e=0,e.d=[0];return e}function $t(e,t,n){var r,i,a,o,u,d,f,p,m=e.d;for(o=1,a=m[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=Wt,i=t,f=m[p=0];else{if(p=Math.ceil((r+1)/Wt),a=m.length,p>=a)return e;for(f=a=m[p],o=1;a>=10;a/=10)o++;r%=Wt,i=r-Wt+o}if(n!==void 0&&(a=sl(10,o-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/sl(10,o-i):0:m[p-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return d?(a=On(e),m.length=1,t=t-a-1,m[0]=sl(10,(Wt-t%Wt)%Wt),e.e=qu(-t/Wt)||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=sl(10,Wt-r),m[p]=i>0?(f/sl(10,o-i)%sl(10,i)|0)*a:0),d)for(;;)if(p==0){(m[0]+=a)==Ln&&(m[0]=1,++e.e);break}else{if(m[p]+=a,m[p]!=Ln)break;m[p--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(en&&(e.e>ay||e.e<-ay))throw Error(mk+On(e));return e}function xB(e,t){var n,r,i,a,o,u,d,f,p,m,y=e.constructor,v=y.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new y(e),en?$t(t,v):t;if(d=e.d,m=t.d,r=t.e,f=e.e,d=d.slice(),o=f-r,o){for(p=o<0,p?(n=d,o=-o,u=m.length):(n=m,r=f,u=d.length),i=Math.max(Math.ceil(v/Wt),u)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;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}o=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>o;){if(d[--i]<m[i]){for(a=i;a&&d[--a]===0;)d[a]=Ln-1;--d[a],d[i]+=Ln}d[i]-=m[i]}for(;d[--u]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,en?$t(t,v):t):new y(0)}function Il(e,t,n){var r,i=On(e),a=pa(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+Ys(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Ys(-i-1)+a,n&&(r=n-o)>0&&(a+=Ys(r))):i>=o?(a+=Ys(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Ys(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=Ys(r))),e.s<0?"-"+a:a}function XR(e,t){if(e.length>t)return e.length=t,!0}function wB(e){var t,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(jl+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return QR(o,a.toString())}else if(typeof a!="string")throw Error(jl+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,Zpe.test(a))QR(o,a);else throw Error(jl+a)}if(i.prototype=De,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=wB,i.config=i.set=Ype,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 Ype(e){if(!e||typeof e!="object")throw Error(Oi+"Object expected");var t,n,r,i=["precision",1,Fu,"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(qu(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(jl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(jl+n+": "+r);return this}var gk=wB(Vpe);Vr=new gk(1);const yt=gk;function SB(e){var t;return e===0?t=1:t=Math.floor(new yt(e).abs().log(10).toNumber())+1,t}function jB(e,t,n){for(var r=new yt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var NB=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},yk=(e,t,n)=>{if(e.lte(0))return new yt(0);var r=SB(e.toNumber()),i=new yt(10).pow(r),a=e.div(i),o=r!==1?.05:.1,u=new yt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),d=u.mul(i);return t?new yt(d.toNumber()):new yt(Math.ceil(d.toNumber()))},kB=(e,t,n)=>{var r;if(e.lte(0))return new yt(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new yt(a).abs().log(10).toNumber()),u=new yt(10).pow(o),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 yt(10).pow(p))}var m=(r=i[f])!==null&&r!==void 0?r:1,y=new yt(m).mul(u);return t?y:new yt(Math.ceil(y.toNumber()))},Wpe=(e,t,n)=>{var r=new yt(1),i=new yt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new yt(10).pow(SB(e)-1),i=new yt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new yt(Math.floor(e)))}else e===0?i=new yt(Math.floor((t-1)/2)):n||(i=new yt(Math.floor(e)));for(var o=Math.floor((t-1)/2),u=[],d=0;d<t;d++)u.push(i.add(new yt(d-o).mul(r)).toNumber());return u},CB=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:yk;if(!Number.isFinite((n-t)/(r-1)))return{step:new yt(0),tickMin:new yt(0),tickMax:new yt(0)};var u=o(new yt(n).sub(t).div(r-1),i,a),d;t<=0&&n>=0?d=new yt(0):(d=new yt(t).add(n).div(2),d=d.sub(new yt(d).mod(u)));var f=Math.ceil(d.sub(t).div(u).toNumber()),p=Math.ceil(new yt(n).sub(d).div(u).toNumber()),m=f+p+1;return m>r?CB(t,n,r,i,a+1,o):(m<r&&(p=n>0?p+(r-m):p,f=n>0?f:f+(r-m)),{step:u,tickMin:d.sub(new yt(f).mul(u)),tickMax:d.add(new yt(p).mul(u))})},JR=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",u=Math.max(i,2),[d,f]=NB([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 Wpe(d,i,a);var m=o==="snap125"?kB:yk,{step:y,tickMin:v,tickMax:w}=CB(d,f,u,a,0,m),S=jB(v,w.add(new yt(.1).mul(y)),y);return n>r?S.reverse():S},eM=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[u,d]=NB([r,i]);if(u===-1/0||d===1/0)return[r,i];if(u===d)return[u];var f=o==="snap125"?kB:yk,p=Math.max(n,2),m=f(new yt(d).sub(u).div(p-1),a,0),y=[...jB(new yt(u),new yt(d),m),d];return a===!1&&(y=y.map(v=>Math.round(v))),r>i?y.reverse():y},Qpe=e=>e.rootProps.barCategoryGap,Mv=e=>e.rootProps.stackOffset,_B=e=>e.rootProps.reverseStackOrder,vk=e=>e.options.chartName,bk=e=>e.rootProps.syncId,AB=e=>e.rootProps.syncMethod,xk=e=>e.options.eventEmitter,Xpe=e=>e.rootProps.baseValue,ar={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Xo={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},sa={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Dv=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Iv(e,t,n){if(n!=="auto")return n;if(e!=null)return Na(e,t)?"category":"number"}function tM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function sy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tM(Object(n),!0).forEach(function(r){Jpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jpe(e,t,n){return(t=eme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eme(e){var t=tme(e,"string");return typeof t=="symbol"?t:t+""}function tme(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:Xo.allowDataOverflow,allowDecimals:Xo.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Xo.angleAxisId,includeHidden:!1,name:void 0,reversed:Xo.reversed,scale:Xo.scale,tick:Xo.tick,tickCount:void 0,ticks:void 0,type:Xo.type,unit:void 0,niceTicks:"auto"},rM={allowDataOverflow:sa.allowDataOverflow,allowDecimals:sa.allowDecimals,allowDuplicatedCategory:sa.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:sa.radiusAxisId,includeHidden:sa.includeHidden,name:void 0,reversed:sa.reversed,scale:sa.scale,tick:sa.tick,tickCount:sa.tickCount,ticks:void 0,type:sa.type,unit:void 0,niceTicks:"auto"},nme=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},wk=le([nme,X3],(e,t)=>{var n;if(e!=null)return e;var r=(n=Iv(t,"angleAxis",nM.type))!==null&&n!==void 0?n:"category";return sy(sy({},nM),{},{type:r})}),rme=(e,t)=>e.polarAxis.radiusAxis[t],Sk=le([rme,X3],(e,t)=>{var n;if(e!=null)return e;var r=(n=Iv(t,"radiusAxis",rM.type))!==null&&n!==void 0?n:"category";return sy(sy({},rM),{},{type:r})}),Lv=e=>e.polarOptions,jk=le([ds,fs,Jn],_pe),OB=le([Lv,jk],(e,t)=>{if(e!=null)return yo(e.innerRadius,t,0)}),EB=le([Lv,jk],(e,t)=>{if(e!=null)return yo(e.outerRadius,t,t*.8)}),ime=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},zB=le([Lv],ime);le([wk,zB],Dv);var TB=le([jk,OB,EB],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});le([Sk,TB],Dv);var PB=le([nn,Lv,OB,EB,ds,fs],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:u,startAngle:d,endAngle:f}=t;return{cx:yo(o,i,i/2),cy:yo(u,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:f,clockWise:!1}}}),Bn=(e,t)=>t,$v=(e,t,n)=>n;function Nk(e){return e?.id}function RB(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=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=Nk(u);f.forEach((m,y)=>{var v=a==null||i?y:String($n(m,a,null)),w=$n(m,u.dataKey,0),S;o.has(v)?S=o.get(v):S={},Object.assign(S,{[p]:w}),o.set(v,S)})}}),Array.from(o.values())}function kk(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Bv=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Uv(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function ame(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 Un=e=>{var t=nn(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Hu=e=>e.tooltip.settings.axisId;function Ck(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(a){function o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var o=i[0],u=i[1];return o<=u?a>=o&&a<=u:a>=u&&a<=o},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,o)=>{var u=e(a);if(u!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var d=e.bandwidth();switch(o.position){case"middle":u+=d/2;break;case"end":u+=d;break}}return u}}}}}var sme=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!ma(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];rt(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 ome(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function _k(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===ome?e:lme,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 o(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:o,right:a}}function lme(){return 0}function MB(e){return e===null?NaN:+e}function*cme(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const ume=_k(uo),Sh=ume.right;_k(MB).center;class iM extends Map{constructor(t,n=hme){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(dme(this,t),n)}delete(t){return super.delete(fme(this,t))}}function aM({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function dme({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function fme({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function hme(e){return e!==null&&typeof e=="object"?e.valueOf():e}function pme(e=uo){if(e===uo)return DB;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 DB(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const mme=Math.sqrt(50),gme=Math.sqrt(10),yme=Math.sqrt(2);function oy(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=mme?10:a>=gme?5:a>=yme?2:1;let u,d,f;return i<0?(f=Math.pow(10,-i)/o,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)*o,u=Math.round(e/f),d=Math.round(t/f),u*f<e&&++u,d*f>t&&--d),d<u&&.5<=n&&n<2?oy(e,t,n*2):[u,d,f]}function ij(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,o]=r?oy(t,e,n):oy(e,t,n);if(!(a>=i))return[];const u=a-i+1,d=new Array(u);if(r)if(o<0)for(let f=0;f<u;++f)d[f]=(a-f)/-o;else for(let f=0;f<u;++f)d[f]=(a-f)*o;else if(o<0)for(let f=0;f<u;++f)d[f]=(i+f)/-o;else for(let f=0;f<u;++f)d[f]=(i+f)*o;return d}function aj(e,t,n){return t=+t,e=+e,n=+n,oy(e,t,n)[2]}function sj(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?aj(t,e,n):aj(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function sM(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 IB(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?DB:pme(i);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,p=Math.log(d),m=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*m*(d-m)/d)*(f-d/2<0?-1:1),v=Math.max(n,Math.floor(t-f*m/d+y)),w=Math.min(r,Math.floor(t+(d-f)*m/d+y));IB(e,t,v,w,i)}const a=e[t];let o=n,u=r;for(nf(e,n,t),i(e[r],a)>0&&nf(e,n,r);o<u;){for(nf(e,o,u),++o,--u;i(e[o],a)<0;)++o;for(;i(e[u],a)>0;)--u}i(e[n],a)===0?nf(e,n,u):(++u,nf(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function nf(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function vme(e,t,n){if(e=Float64Array.from(cme(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return oM(e);if(t>=1)return sM(e);var r,i=(r-1)*t,a=Math.floor(i),o=sM(IB(e,a).subarray(0,a+1)),u=oM(e.subarray(a+1));return o+(u-o)*(i-a)}}function bme(e,t,n=MB){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),u=+n(e[a+1],a+1,e);return o+(u-o)*(i-a)}}function xme(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 Pi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function hs(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 oj=Symbol("implicit");function Ak(){var e=new iM,t=[],n=[],r=oj;function i(a){let o=e.get(a);if(o===void 0){if(r!==oj)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new iM;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Ak(t,n).unknown(r)},Pi.apply(i,arguments),i}function Ok(){var e=Ak().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,u=!1,d=0,f=0,p=.5;delete e.unknown;function m(){var y=t().length,v=i<r,w=v?i:r,S=v?r:i;a=(S-w)/Math.max(1,y-d+f*2),u&&(a=Math.floor(a)),w+=(S-w-a*(y-d))*p,o=a*(1-d),u&&(w=Math.round(w),o=Math.round(o));var j=xme(y).map(function(k){return w+a*k});return n(v?j.reverse():j)}return e.domain=function(y){return arguments.length?(t(y),m()):t()},e.range=function(y){return arguments.length?([r,i]=y,r=+r,i=+i,m()):[r,i]},e.rangeRound=function(y){return[r,i]=y,r=+r,i=+i,u=!0,m()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(y){return arguments.length?(u=!!y,m()):u},e.padding=function(y){return arguments.length?(d=Math.min(1,f=+y),m()):d},e.paddingInner=function(y){return arguments.length?(d=Math.min(1,y),m()):d},e.paddingOuter=function(y){return arguments.length?(f=+y,m()):f},e.align=function(y){return arguments.length?(p=Math.max(0,Math.min(1,y)),m()):p},e.copy=function(){return Ok(t(),[r,i]).round(u).paddingInner(d).paddingOuter(f).align(p)},Pi.apply(m(),arguments)}function LB(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return LB(t())},e}function wme(){return LB(Ok.apply(null,arguments).paddingInner(1))}function Ek(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function $B(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function jh(){}var Gf=.7,ly=1/Gf,fu="\\s*([+-]?\\d+)\\s*",Vf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ga="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Sme=/^#([0-9a-f]{3,8})$/,jme=new RegExp(`^rgb\\(${fu},${fu},${fu}\\)$`),Nme=new RegExp(`^rgb\\(${ga},${ga},${ga}\\)$`),kme=new RegExp(`^rgba\\(${fu},${fu},${fu},${Vf}\\)$`),Cme=new RegExp(`^rgba\\(${ga},${ga},${ga},${Vf}\\)$`),_me=new RegExp(`^hsl\\(${Vf},${ga},${ga}\\)$`),Ame=new RegExp(`^hsla\\(${Vf},${ga},${ga},${Vf}\\)$`),lM={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};Ek(jh,Zf,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:cM,formatHex:cM,formatHex8:Ome,formatHsl:Eme,formatRgb:uM,toString:uM});function cM(){return this.rgb().formatHex()}function Ome(){return this.rgb().formatHex8()}function Eme(){return BB(this).formatHsl()}function uM(){return this.rgb().formatRgb()}function Zf(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Sme.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?dM(t):n===3?new Er(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Rm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Rm(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=jme.exec(e))?new Er(t[1],t[2],t[3],1):(t=Nme.exec(e))?new Er(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=kme.exec(e))?Rm(t[1],t[2],t[3],t[4]):(t=Cme.exec(e))?Rm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=_me.exec(e))?pM(t[1],t[2]/100,t[3]/100,1):(t=Ame.exec(e))?pM(t[1],t[2]/100,t[3]/100,t[4]):lM.hasOwnProperty(e)?dM(lM[e]):e==="transparent"?new Er(NaN,NaN,NaN,0):null}function dM(e){return new Er(e>>16&255,e>>8&255,e&255,1)}function Rm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Er(e,t,n,r)}function zme(e){return e instanceof jh||(e=Zf(e)),e?(e=e.rgb(),new Er(e.r,e.g,e.b,e.opacity)):new Er}function lj(e,t,n,r){return arguments.length===1?zme(e):new Er(e,t,n,r??1)}function Er(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Ek(Er,lj,$B(jh,{brighter(e){return e=e==null?ly:Math.pow(ly,e),new Er(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Gf:Math.pow(Gf,e),new Er(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Er(Nl(this.r),Nl(this.g),Nl(this.b),cy(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:fM,formatHex:fM,formatHex8:Tme,formatRgb:hM,toString:hM}));function fM(){return`#${pl(this.r)}${pl(this.g)}${pl(this.b)}`}function Tme(){return`#${pl(this.r)}${pl(this.g)}${pl(this.b)}${pl((isNaN(this.opacity)?1:this.opacity)*255)}`}function hM(){const e=cy(this.opacity);return`${e===1?"rgb(":"rgba("}${Nl(this.r)}, ${Nl(this.g)}, ${Nl(this.b)}${e===1?")":`, ${e})`}`}function cy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Nl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function pl(e){return e=Nl(e),(e<16?"0":"")+e.toString(16)}function pM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Vi(e,t,n,r)}function BB(e){if(e instanceof Vi)return new Vi(e.h,e.s,e.l,e.opacity);if(e instanceof jh||(e=Zf(e)),!e)return new Vi;if(e instanceof Vi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,u=a-i,d=(a+i)/2;return u?(t===a?o=(n-r)/u+(n<r)*6:n===a?o=(r-t)/u+2:o=(t-n)/u+4,u/=d<.5?a+i:2-a-i,o*=60):u=d>0&&d<1?0:o,new Vi(o,u,d,e.opacity)}function Pme(e,t,n,r){return arguments.length===1?BB(e):new Vi(e,t,n,r??1)}function Vi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ek(Vi,Pme,$B(jh,{brighter(e){return e=e==null?ly:Math.pow(ly,e),new Vi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Gf:Math.pow(Gf,e),new Vi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Er(pS(e>=240?e-240:e+120,i,r),pS(e,i,r),pS(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Vi(mM(this.h),Mm(this.s),Mm(this.l),cy(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=cy(this.opacity);return`${e===1?"hsl(":"hsla("}${mM(this.h)}, ${Mm(this.s)*100}%, ${Mm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function mM(e){return e=(e||0)%360,e<0?e+360:e}function Mm(e){return Math.max(0,Math.min(1,e||0))}function pS(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 zk=e=>()=>e;function Rme(e,t){return function(n){return e+n*t}}function Mme(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 Dme(e){return(e=+e)==1?UB:function(t,n){return n-t?Mme(t,n,e):zk(isNaN(t)?n:t)}}function UB(e,t){var n=t-e;return n?Rme(e,n):zk(isNaN(e)?t:e)}const gM=(function e(t){var n=Dme(t);function r(i,a){var o=n((i=lj(i)).r,(a=lj(a)).r),u=n(i.g,a.g),d=n(i.b,a.b),f=UB(i.opacity,a.opacity);return function(p){return i.r=o(p),i.g=u(p),i.b=d(p),i.opacity=f(p),i+""}}return r.gamma=e,r})(1);function Ime(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 Lme(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function $me(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=Ku(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(u){for(o=0;o<r;++o)a[o]=i[o](u);return a}}function Bme(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function uy(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Ume(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]=Ku(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var cj=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mS=new RegExp(cj.source,"g");function Fme(e){return function(){return e}}function qme(e){return function(t){return e(t)+""}}function Hme(e,t){var n=cj.lastIndex=mS.lastIndex=0,r,i,a,o=-1,u=[],d=[];for(e=e+"",t=t+"";(r=cj.exec(e))&&(i=mS.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),u[o]?u[o]+=a:u[++o]=a),(r=r[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,d.push({i:o,x:uy(r,i)})),n=mS.lastIndex;return n<t.length&&(a=t.slice(n),u[o]?u[o]+=a:u[++o]=a),u.length<2?d[0]?qme(d[0].x):Fme(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 Ku(e,t){var n=typeof t,r;return t==null||n==="boolean"?zk(t):(n==="number"?uy:n==="string"?(r=Zf(t))?(t=r,gM):Hme:t instanceof Zf?gM:t instanceof Date?Bme:Lme(t)?Ime:Array.isArray(t)?$me:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Ume:uy)(e,t)}function Tk(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Kme(e,t){t===void 0&&(t=e,e=Ku);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var u=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[u](o-u)}}function Gme(e){return function(){return e}}function dy(e){return+e}var yM=[0,1];function fr(e){return e}function uj(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Gme(isNaN(t)?NaN:.5)}function Vme(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Zme(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=uj(i,r),a=n(o,a)):(r=uj(r,i),a=n(a,o)),function(u){return a(r(u))}}function Yme(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=uj(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(u){var d=Sh(e,u,1,r)-1;return a[d](i[d](u))}}function Nh(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Fv(){var e=yM,t=yM,n=Ku,r,i,a,o=fr,u,d,f;function p(){var y=Math.min(e.length,t.length);return o!==fr&&(o=Vme(e[0],e[y-1])),u=y>2?Yme:Zme,d=f=null,m}function m(y){return y==null||isNaN(y=+y)?a:(d||(d=u(e.map(r),t,n)))(r(o(y)))}return m.invert=function(y){return o(i((f||(f=u(t,e.map(r),uy)))(y)))},m.domain=function(y){return arguments.length?(e=Array.from(y,dy),p()):e.slice()},m.range=function(y){return arguments.length?(t=Array.from(y),p()):t.slice()},m.rangeRound=function(y){return t=Array.from(y),n=Tk,p()},m.clamp=function(y){return arguments.length?(o=y?!0:fr,p()):o!==fr},m.interpolate=function(y){return arguments.length?(n=y,p()):n},m.unknown=function(y){return arguments.length?(a=y,m):a},function(y,v){return r=y,i=v,p()}}function Pk(){return Fv()(fr,fr)}function Wme(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function fy(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 ju(e){return e=fy(Math.abs(e)),e?e[1]:NaN}function Qme(e,t){return function(n,r){for(var i=n.length,a=[],o=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[o=(o+1)%e.length];return a.reverse().join(t)}}function Xme(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Jme=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Yf(e){if(!(t=Jme.exec(e)))throw new Error("invalid format: "+e);var t;return new Rk({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]})}Yf.prototype=Rk.prototype;function Rk(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+""}Rk.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 ege(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 hy;function tge(e,t){var n=fy(e,t);if(!n)return hy=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(hy=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+fy(e,Math.max(0,t+a-1))[0]}function vM(e,t){var n=fy(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const bM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Wme,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)=>vM(e*100,t),r:vM,s:tge,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function xM(e){return e}var wM=Array.prototype.map,SM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nge(e){var t=e.grouping===void 0||e.thousands===void 0?xM:Qme(wM.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?xM:Xme(wM.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(m,y){m=Yf(m);var v=m.fill,w=m.align,S=m.sign,j=m.symbol,k=m.zero,A=m.width,_=m.comma,C=m.precision,P=m.trim,E=m.type;E==="n"?(_=!0,E="g"):bM[E]||(C===void 0&&(C=12),P=!0,E="g"),(k||v==="0"&&w==="=")&&(k=!0,v="0",w="=");var O=(y&&y.prefix!==void 0?y.prefix:"")+(j==="$"?n:j==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():""),T=(j==="$"?r:/[%p]/.test(E)?o:"")+(y&&y.suffix!==void 0?y.suffix:""),M=bM[E],q=/[defgprs%]/.test(E);C=C===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function $(L){var J=O,ae=T,Z,H,Q;if(E==="c")ae=M(L)+ae,L="";else{L=+L;var he=L<0||1/L<0;if(L=isNaN(L)?d:M(Math.abs(L),C),P&&(L=ege(L)),he&&+L==0&&S!=="+"&&(he=!1),J=(he?S==="("?S:u:S==="-"||S==="("?"":S)+J,ae=(E==="s"&&!isNaN(L)&&hy!==void 0?SM[8+hy/3]:"")+ae+(he&&S==="("?")":""),q){for(Z=-1,H=L.length;++Z<H;)if(Q=L.charCodeAt(Z),48>Q||Q>57){ae=(Q===46?i+L.slice(Z+1):L.slice(Z))+ae,L=L.slice(0,Z);break}}}_&&!k&&(L=t(L,1/0));var we=J.length+L.length+ae.length,R=we<A?new Array(A-we+1).join(v):"";switch(_&&k&&(L=t(R+L,R.length?A-ae.length:1/0),R=""),w){case"<":L=J+L+ae+R;break;case"=":L=J+R+L+ae;break;case"^":L=R.slice(0,we=R.length>>1)+J+L+ae+R.slice(we);break;default:L=R+J+L+ae;break}return a(L)}return $.toString=function(){return m+""},$}function p(m,y){var v=Math.max(-8,Math.min(8,Math.floor(ju(y)/3)))*3,w=Math.pow(10,-v),S=f((m=Yf(m),m.type="f",m),{suffix:SM[8+v/3]});return function(j){return S(w*j)}}return{format:f,formatPrefix:p}}var Dm,Mk,FB;rge({thousands:",",grouping:[3],currency:["$",""]});function rge(e){return Dm=nge(e),Mk=Dm.format,FB=Dm.formatPrefix,Dm}function ige(e){return Math.max(0,-ju(Math.abs(e)))}function age(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ju(t)/3)))*3-ju(Math.abs(e)))}function sge(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ju(t)-ju(e))+1}function qB(e,t,n,r){var i=sj(e,t,n),a;switch(r=Yf(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=age(i,o))&&(r.precision=a),FB(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=sge(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=ige(i))&&(r.precision=a-(r.type==="%")*2);break}}return Mk(r)}function ko(e){var t=e.domain;return e.ticks=function(n){var r=t();return ij(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return qB(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],u=r[a],d,f,p=10;for(u<o&&(f=o,o=u,u=f,f=i,i=a,a=f);p-- >0;){if(f=aj(o,u,n),f===d)return r[i]=o,r[a]=u,t(r);if(f>0)o=Math.floor(o/f)*f,u=Math.ceil(u/f)*f;else if(f<0)o=Math.ceil(o*f)/f,u=Math.floor(u*f)/f;else break;d=f}return e},e}function HB(){var e=Pk();return e.copy=function(){return Nh(e,HB())},Pi.apply(e,arguments),ko(e)}function KB(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,dy),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return KB(e).unknown(t)},e=arguments.length?Array.from(e,dy):[0,1],ko(n)}function GB(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function jM(e){return Math.log(e)}function NM(e){return Math.exp(e)}function oge(e){return-Math.log(-e)}function lge(e){return-Math.exp(-e)}function cge(e){return isFinite(e)?+("1e"+e):e<0?0:e}function uge(e){return e===10?cge:e===Math.E?Math.exp:t=>Math.pow(e,t)}function dge(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 kM(e){return(t,n)=>-e(-t,n)}function Dk(e){const t=e(jM,NM),n=t.domain;let r=10,i,a;function o(){return i=dge(r),a=uge(r),n()[0]<0?(i=kM(i),a=kM(a),e(oge,lge)):e(jM,NM),t}return t.base=function(u){return arguments.length?(r=+u,o()):r},t.domain=function(u){return arguments.length?(n(u),o()):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 y=i(f),v=i(p),w,S;const j=u==null?10:+u;let k=[];if(!(r%1)&&v-y<j){if(y=Math.floor(y),v=Math.ceil(v),f>0){for(;y<=v;++y)for(w=1;w<r;++w)if(S=y<0?w/a(-y):w*a(y),!(S<f)){if(S>p)break;k.push(S)}}else for(;y<=v;++y)for(w=r-1;w>=1;--w)if(S=y>0?w/a(-y):w*a(y),!(S<f)){if(S>p)break;k.push(S)}k.length*2<j&&(k=ij(f,p,j))}else k=ij(y,v,Math.min(v-y,j)).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=Yf(d)).precision==null&&(d.trim=!0),d=Mk(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(GB(n(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function VB(){const e=Dk(Fv()).domain([1,10]);return e.copy=()=>Nh(e,VB()).base(e.base()),Pi.apply(e,arguments),e}function CM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function _M(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Ik(e){var t=1,n=e(CM(t),_M(t));return n.constant=function(r){return arguments.length?e(CM(t=+r),_M(t)):t},ko(n)}function ZB(){var e=Ik(Fv());return e.copy=function(){return Nh(e,ZB()).constant(e.constant())},Pi.apply(e,arguments)}function AM(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function fge(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function hge(e){return e<0?-e*e:e*e}function Lk(e){var t=e(fr,fr),n=1;function r(){return n===1?e(fr,fr):n===.5?e(fge,hge):e(AM(n),AM(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},ko(t)}function $k(){var e=Lk(Fv());return e.copy=function(){return Nh(e,$k()).exponent(e.exponent())},Pi.apply(e,arguments),e}function pge(){return $k.apply(null,arguments).exponent(.5)}function OM(e){return Math.sign(e)*e*e}function mge(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function YB(){var e=Pk(),t=[0,1],n=!1,r;function i(a){var o=mge(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(OM(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,dy)).map(OM)),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 YB(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Pi.apply(i,arguments),ko(i)}function WB(){var e=[],t=[],n=[],r;function i(){var o=0,u=Math.max(1,t.length);for(n=new Array(u-1);++o<u;)n[o-1]=bme(e,o/u);return a}function a(o){return o==null||isNaN(o=+o)?r:t[Sh(n,o)]}return a.invertExtent=function(o){var u=t.indexOf(o);return u<0?[NaN,NaN]:[u>0?n[u-1]:e[0],u<n.length?n[u]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let u of o)u!=null&&!isNaN(u=+u)&&e.push(u);return e.sort(uo),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return WB().domain(e).range(t).unknown(r)},Pi.apply(a,arguments)}function QB(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(d){return d!=null&&d<=d?i[Sh(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 o}return o.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,u()):[e,t]},o.range=function(d){return arguments.length?(n=(i=Array.from(d)).length-1,u()):i.slice()},o.invertExtent=function(d){var f=i.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},o.unknown=function(d){return arguments.length&&(a=d),o},o.thresholds=function(){return r.slice()},o.copy=function(){return QB().domain([e,t]).range(i).unknown(a)},Pi.apply(ko(o),arguments)}function XB(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Sh(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return XB().domain(e).range(t).unknown(n)},Pi.apply(i,arguments)}const gS=new Date,yS=new Date;function Mn(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),u=i.ceil(a);return a-o<u-a?o:u},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,u)=>{const d=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a<o)||!(u>0))return d;let f;do d.push(f=new Date(+a)),t(a,u),e(a);while(f<a&&a<o);return d},i.filter=a=>Mn(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!a(o););else for(;--u>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(gS.setTime(+a),yS.setTime(+o),e(gS),e(yS),Math.floor(n(gS,yS))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const py=Mn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);py.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Mn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):py);py.range;const es=1e3,ji=es*60,ts=ji*60,os=ts*24,Bk=os*7,EM=os*30,vS=os*365,ml=Mn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*es)},(e,t)=>(t-e)/es,e=>e.getUTCSeconds());ml.range;const Uk=Mn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*es)},(e,t)=>{e.setTime(+e+t*ji)},(e,t)=>(t-e)/ji,e=>e.getMinutes());Uk.range;const Fk=Mn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ji)},(e,t)=>(t-e)/ji,e=>e.getUTCMinutes());Fk.range;const qk=Mn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*es-e.getMinutes()*ji)},(e,t)=>{e.setTime(+e+t*ts)},(e,t)=>(t-e)/ts,e=>e.getHours());qk.range;const Hk=Mn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ts)},(e,t)=>(t-e)/ts,e=>e.getUTCHours());Hk.range;const kh=Mn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ji)/os,e=>e.getDate()-1);kh.range;const qv=Mn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/os,e=>e.getUTCDate()-1);qv.range;const JB=Mn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/os,e=>Math.floor(e/os));JB.range;function Zl(e){return Mn(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())*ji)/Bk)}const Hv=Zl(0),my=Zl(1),gge=Zl(2),yge=Zl(3),Nu=Zl(4),vge=Zl(5),bge=Zl(6);Hv.range;my.range;gge.range;yge.range;Nu.range;vge.range;bge.range;function Yl(e){return Mn(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)/Bk)}const Kv=Yl(0),gy=Yl(1),xge=Yl(2),wge=Yl(3),ku=Yl(4),Sge=Yl(5),jge=Yl(6);Kv.range;gy.range;xge.range;wge.range;ku.range;Sge.range;jge.range;const Kk=Mn(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());Kk.range;const Gk=Mn(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());Gk.range;const ls=Mn(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());ls.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Mn(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)});ls.range;const cs=Mn(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());cs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Mn(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)});cs.range;function e6(e,t,n,r,i,a){const o=[[ml,1,es],[ml,5,5*es],[ml,15,15*es],[ml,30,30*es],[a,1,ji],[a,5,5*ji],[a,15,15*ji],[a,30,30*ji],[i,1,ts],[i,3,3*ts],[i,6,6*ts],[i,12,12*ts],[r,1,os],[r,2,2*os],[n,1,Bk],[t,1,EM],[t,3,3*EM],[e,1,vS]];function u(f,p,m){const y=p<f;y&&([f,p]=[p,f]);const v=m&&typeof m.range=="function"?m:d(f,p,m),w=v?v.range(f,+p+1):[];return y?w.reverse():w}function d(f,p,m){const y=Math.abs(p-f)/m,v=_k(([,,j])=>j).right(o,y);if(v===o.length)return e.every(sj(f/vS,p/vS,m));if(v===0)return py.every(Math.max(sj(f,p,m),1));const[w,S]=o[y/o[v-1][2]<o[v][2]/y?v-1:v];return w.every(S)}return[u,d]}const[Nge,kge]=e6(cs,Gk,Kv,JB,Hk,Fk),[Cge,_ge]=e6(ls,Kk,Hv,kh,qk,Uk);function bS(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 xS(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 rf(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Age(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,u=e.months,d=e.shortMonths,f=af(i),p=sf(i),m=af(a),y=sf(a),v=af(o),w=sf(o),S=af(u),j=sf(u),k=af(d),A=sf(d),_={a:Q,A:he,b:we,B:R,c:null,d:DM,e:DM,f:Qge,g:oye,G:cye,H:Zge,I:Yge,j:Wge,L:t6,m:Xge,M:Jge,p:U,q:F,Q:$M,s:BM,S:eye,u:tye,U:nye,V:rye,w:iye,W:aye,x:null,X:null,y:sye,Y:lye,Z:uye,"%":LM},C={a:D,A:Y,b:se,B:ie,c:null,d:IM,e:IM,f:pye,g:Nye,G:Cye,H:dye,I:fye,j:hye,L:r6,m:mye,M:gye,p:fe,q:je,Q:$M,s:BM,S:yye,u:vye,U:bye,V:xye,w:wye,W:Sye,x:null,X:null,y:jye,Y:kye,Z:_ye,"%":LM},P={a:q,A:$,b:L,B:J,c:ae,d:RM,e:RM,f:Hge,g:PM,G:TM,H:MM,I:MM,j:Bge,L:qge,m:$ge,M:Uge,p:M,q:Lge,Q:Gge,s:Vge,S:Fge,u:Pge,U:Rge,V:Mge,w:Tge,W:Dge,x:Z,X:H,y:PM,Y:TM,Z:Ige,"%":Kge};_.x=E(n,_),_.X=E(r,_),_.c=E(t,_),C.x=E(n,C),C.X=E(r,C),C.c=E(t,C);function E(ee,ue){return function(Ae){var W=[],Ke=-1,Re=0,it=ee.length,at,At,Bt;for(Ae instanceof Date||(Ae=new Date(+Ae));++Ke<it;)ee.charCodeAt(Ke)===37&&(W.push(ee.slice(Re,Ke)),(At=zM[at=ee.charAt(++Ke)])!=null?at=ee.charAt(++Ke):At=at==="e"?" ":"0",(Bt=ue[at])&&(at=Bt(Ae,At)),W.push(at),Re=Ke+1);return W.push(ee.slice(Re,Ke)),W.join("")}}function O(ee,ue){return function(Ae){var W=rf(1900,void 0,1),Ke=T(W,ee,Ae+="",0),Re,it;if(Ke!=Ae.length)return null;if("Q"in W)return new Date(W.Q);if("s"in W)return new Date(W.s*1e3+("L"in W?W.L:0));if(ue&&!("Z"in W)&&(W.Z=0),"p"in W&&(W.H=W.H%12+W.p*12),W.m===void 0&&(W.m="q"in W?W.q:0),"V"in W){if(W.V<1||W.V>53)return null;"w"in W||(W.w=1),"Z"in W?(Re=xS(rf(W.y,0,1)),it=Re.getUTCDay(),Re=it>4||it===0?gy.ceil(Re):gy(Re),Re=qv.offset(Re,(W.V-1)*7),W.y=Re.getUTCFullYear(),W.m=Re.getUTCMonth(),W.d=Re.getUTCDate()+(W.w+6)%7):(Re=bS(rf(W.y,0,1)),it=Re.getDay(),Re=it>4||it===0?my.ceil(Re):my(Re),Re=kh.offset(Re,(W.V-1)*7),W.y=Re.getFullYear(),W.m=Re.getMonth(),W.d=Re.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),it="Z"in W?xS(rf(W.y,0,1)).getUTCDay():bS(rf(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(it+5)%7:W.w+W.U*7-(it+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,xS(W)):bS(W)}}function T(ee,ue,Ae,W){for(var Ke=0,Re=ue.length,it=Ae.length,at,At;Ke<Re;){if(W>=it)return-1;if(at=ue.charCodeAt(Ke++),at===37){if(at=ue.charAt(Ke++),At=P[at in zM?ue.charAt(Ke++):at],!At||(W=At(ee,Ae,W))<0)return-1}else if(at!=Ae.charCodeAt(W++))return-1}return W}function M(ee,ue,Ae){var W=f.exec(ue.slice(Ae));return W?(ee.p=p.get(W[0].toLowerCase()),Ae+W[0].length):-1}function q(ee,ue,Ae){var W=v.exec(ue.slice(Ae));return W?(ee.w=w.get(W[0].toLowerCase()),Ae+W[0].length):-1}function $(ee,ue,Ae){var W=m.exec(ue.slice(Ae));return W?(ee.w=y.get(W[0].toLowerCase()),Ae+W[0].length):-1}function L(ee,ue,Ae){var W=k.exec(ue.slice(Ae));return W?(ee.m=A.get(W[0].toLowerCase()),Ae+W[0].length):-1}function J(ee,ue,Ae){var W=S.exec(ue.slice(Ae));return W?(ee.m=j.get(W[0].toLowerCase()),Ae+W[0].length):-1}function ae(ee,ue,Ae){return T(ee,t,ue,Ae)}function Z(ee,ue,Ae){return T(ee,n,ue,Ae)}function H(ee,ue,Ae){return T(ee,r,ue,Ae)}function Q(ee){return o[ee.getDay()]}function he(ee){return a[ee.getDay()]}function we(ee){return d[ee.getMonth()]}function R(ee){return u[ee.getMonth()]}function U(ee){return i[+(ee.getHours()>=12)]}function F(ee){return 1+~~(ee.getMonth()/3)}function D(ee){return o[ee.getUTCDay()]}function Y(ee){return a[ee.getUTCDay()]}function se(ee){return d[ee.getUTCMonth()]}function ie(ee){return u[ee.getUTCMonth()]}function fe(ee){return i[+(ee.getUTCHours()>=12)]}function je(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var ue=E(ee+="",_);return ue.toString=function(){return ee},ue},parse:function(ee){var ue=O(ee+="",!1);return ue.toString=function(){return ee},ue},utcFormat:function(ee){var ue=E(ee+="",C);return ue.toString=function(){return ee},ue},utcParse:function(ee){var ue=O(ee+="",!0);return ue.toString=function(){return ee},ue}}}var zM={"-":"",_:" ",0:"0"},Fn=/^\s*\d+/,Oge=/^%/,Ege=/[\\^$*+?|[\]().{}]/g;function jt(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 zge(e){return e.replace(Ege,"\\$&")}function af(e){return new RegExp("^(?:"+e.map(zge).join("|")+")","i")}function sf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Tge(e,t,n){var r=Fn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Pge(e,t,n){var r=Fn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Rge(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Mge(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Dge(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function TM(e,t,n){var r=Fn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function PM(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Ige(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 Lge(e,t,n){var r=Fn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function $ge(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function RM(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Bge(e,t,n){var r=Fn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function MM(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Uge(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Fge(e,t,n){var r=Fn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function qge(e,t,n){var r=Fn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Hge(e,t,n){var r=Fn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Kge(e,t,n){var r=Oge.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Gge(e,t,n){var r=Fn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Vge(e,t,n){var r=Fn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function DM(e,t){return jt(e.getDate(),t,2)}function Zge(e,t){return jt(e.getHours(),t,2)}function Yge(e,t){return jt(e.getHours()%12||12,t,2)}function Wge(e,t){return jt(1+kh.count(ls(e),e),t,3)}function t6(e,t){return jt(e.getMilliseconds(),t,3)}function Qge(e,t){return t6(e,t)+"000"}function Xge(e,t){return jt(e.getMonth()+1,t,2)}function Jge(e,t){return jt(e.getMinutes(),t,2)}function eye(e,t){return jt(e.getSeconds(),t,2)}function tye(e){var t=e.getDay();return t===0?7:t}function nye(e,t){return jt(Hv.count(ls(e)-1,e),t,2)}function n6(e){var t=e.getDay();return t>=4||t===0?Nu(e):Nu.ceil(e)}function rye(e,t){return e=n6(e),jt(Nu.count(ls(e),e)+(ls(e).getDay()===4),t,2)}function iye(e){return e.getDay()}function aye(e,t){return jt(my.count(ls(e)-1,e),t,2)}function sye(e,t){return jt(e.getFullYear()%100,t,2)}function oye(e,t){return e=n6(e),jt(e.getFullYear()%100,t,2)}function lye(e,t){return jt(e.getFullYear()%1e4,t,4)}function cye(e,t){var n=e.getDay();return e=n>=4||n===0?Nu(e):Nu.ceil(e),jt(e.getFullYear()%1e4,t,4)}function uye(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+jt(t/60|0,"0",2)+jt(t%60,"0",2)}function IM(e,t){return jt(e.getUTCDate(),t,2)}function dye(e,t){return jt(e.getUTCHours(),t,2)}function fye(e,t){return jt(e.getUTCHours()%12||12,t,2)}function hye(e,t){return jt(1+qv.count(cs(e),e),t,3)}function r6(e,t){return jt(e.getUTCMilliseconds(),t,3)}function pye(e,t){return r6(e,t)+"000"}function mye(e,t){return jt(e.getUTCMonth()+1,t,2)}function gye(e,t){return jt(e.getUTCMinutes(),t,2)}function yye(e,t){return jt(e.getUTCSeconds(),t,2)}function vye(e){var t=e.getUTCDay();return t===0?7:t}function bye(e,t){return jt(Kv.count(cs(e)-1,e),t,2)}function i6(e){var t=e.getUTCDay();return t>=4||t===0?ku(e):ku.ceil(e)}function xye(e,t){return e=i6(e),jt(ku.count(cs(e),e)+(cs(e).getUTCDay()===4),t,2)}function wye(e){return e.getUTCDay()}function Sye(e,t){return jt(gy.count(cs(e)-1,e),t,2)}function jye(e,t){return jt(e.getUTCFullYear()%100,t,2)}function Nye(e,t){return e=i6(e),jt(e.getUTCFullYear()%100,t,2)}function kye(e,t){return jt(e.getUTCFullYear()%1e4,t,4)}function Cye(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ku(e):ku.ceil(e),jt(e.getUTCFullYear()%1e4,t,4)}function _ye(){return"+0000"}function LM(){return"%"}function $M(e){return+e}function BM(e){return Math.floor(+e/1e3)}var Fc,a6,s6;Aye({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 Aye(e){return Fc=Age(e),a6=Fc.format,Fc.parse,s6=Fc.utcFormat,Fc.utcParse,Fc}function Oye(e){return new Date(e)}function Eye(e){return e instanceof Date?+e:+new Date(+e)}function Vk(e,t,n,r,i,a,o,u,d,f){var p=Pk(),m=p.invert,y=p.domain,v=f(".%L"),w=f(":%S"),S=f("%I:%M"),j=f("%I %p"),k=f("%a %d"),A=f("%b %d"),_=f("%B"),C=f("%Y");function P(E){return(d(E)<E?v:u(E)<E?w:o(E)<E?S:a(E)<E?j:r(E)<E?i(E)<E?k:A:n(E)<E?_:C)(E)}return p.invert=function(E){return new Date(m(E))},p.domain=function(E){return arguments.length?y(Array.from(E,Eye)):y().map(Oye)},p.ticks=function(E){var O=y();return e(O[0],O[O.length-1],E??10)},p.tickFormat=function(E,O){return O==null?P:f(O)},p.nice=function(E){var O=y();return(!E||typeof E.range!="function")&&(E=t(O[0],O[O.length-1],E??10)),E?y(GB(O,E)):p},p.copy=function(){return Nh(p,Vk(e,t,n,r,i,a,o,u,d,f))},p}function zye(){return Pi.apply(Vk(Cge,_ge,ls,Kk,Hv,kh,qk,Uk,ml,a6).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Tye(){return Pi.apply(Vk(Nge,kge,cs,Gk,Kv,qv,Hk,Fk,ml,s6).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Gv(){var e=0,t=1,n,r,i,a,o=fr,u=!1,d;function f(m){return m==null||isNaN(m=+m)?d:o(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?(o=m,f):o};function p(m){return function(y){var v,w;return arguments.length?([v,w]=y,o=m(v,w),f):[o(0),o(1)]}}return f.range=p(Ku),f.rangeRound=p(Tk),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 Co(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function o6(){var e=ko(Gv()(fr));return e.copy=function(){return Co(e,o6())},hs.apply(e,arguments)}function l6(){var e=Dk(Gv()).domain([1,10]);return e.copy=function(){return Co(e,l6()).base(e.base())},hs.apply(e,arguments)}function c6(){var e=Ik(Gv());return e.copy=function(){return Co(e,c6()).constant(e.constant())},hs.apply(e,arguments)}function Zk(){var e=Lk(Gv());return e.copy=function(){return Co(e,Zk()).exponent(e.exponent())},hs.apply(e,arguments)}function Pye(){return Zk.apply(null,arguments).exponent(.5)}function u6(){var e=[],t=fr;function n(r){if(r!=null&&!isNaN(r=+r))return t((Sh(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)=>vme(e,a/r))},n.copy=function(){return u6(t).domain(e)},hs.apply(n,arguments)}function Vv(){var e=0,t=.5,n=1,r=1,i,a,o,u,d,f=fr,p,m=!1,y;function v(S){return isNaN(S=+S)?y:(S=.5+((S=+p(S))-a)*(r*S<r*a?u:d),f(m?Math.max(0,Math.min(1,S)):S))}v.domain=function(S){return arguments.length?([e,t,n]=S,i=p(e=+e),a=p(t=+t),o=p(n=+n),u=i===a?0:.5/(a-i),d=a===o?0:.5/(o-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(S){return arguments.length?(m=!!S,v):m},v.interpolator=function(S){return arguments.length?(f=S,v):f};function w(S){return function(j){var k,A,_;return arguments.length?([k,A,_]=j,f=Kme(S,[k,A,_]),v):[f(0),f(.5),f(1)]}}return v.range=w(Ku),v.rangeRound=w(Tk),v.unknown=function(S){return arguments.length?(y=S,v):y},function(S){return p=S,i=S(e),a=S(t),o=S(n),u=i===a?0:.5/(a-i),d=a===o?0:.5/(o-a),r=a<i?-1:1,v}}function d6(){var e=ko(Vv()(fr));return e.copy=function(){return Co(e,d6())},hs.apply(e,arguments)}function f6(){var e=Dk(Vv()).domain([.1,1,10]);return e.copy=function(){return Co(e,f6()).base(e.base())},hs.apply(e,arguments)}function h6(){var e=Ik(Vv());return e.copy=function(){return Co(e,h6()).constant(e.constant())},hs.apply(e,arguments)}function Yk(){var e=Lk(Vv());return e.copy=function(){return Co(e,Yk()).exponent(e.exponent())},hs.apply(e,arguments)}function Rye(){return Yk.apply(null,arguments).exponent(.5)}const p6=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Ok,scaleDiverging:d6,scaleDivergingLog:f6,scaleDivergingPow:Yk,scaleDivergingSqrt:Rye,scaleDivergingSymlog:h6,scaleIdentity:KB,scaleImplicit:oj,scaleLinear:HB,scaleLog:VB,scaleOrdinal:Ak,scalePoint:wme,scalePow:$k,scaleQuantile:WB,scaleQuantize:QB,scaleRadial:YB,scaleSequential:o6,scaleSequentialLog:l6,scaleSequentialPow:Zk,scaleSequentialQuantile:u6,scaleSequentialSqrt:Pye,scaleSequentialSymlog:c6,scaleSqrt:pge,scaleSymlog:ZB,scaleThreshold:XB,scaleTime:zye,scaleUtc:Tye,tickFormat:qB},Symbol.toStringTag,{value:"Module"}));function Mye(e){var t=p6;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(hh(e));if(n in t&&typeof t[n]=="function")return t[n]()}function UM(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=Mye(e);if(r!=null)return r.domain(t).range(n),r}}function Wk(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?UM(e.scale,n,r):UM(t,n,r)}function Dye(e){return"scale".concat(hh(e))}function Iye(e){return Dye(e)in p6}var m6=(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 Iye(r)?r:"point"}};function Lye(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 g6(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var o;return(o=e(a))!==null&&o!==void 0?o:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var o,u,d=Lye(r,a);if(d<=0)return n[0];if(d>=n.length)return n[n.length-1];var f=(o=r[d-1])!==null&&o!==void 0?o:0,p=(u=r[d])!==null&&u!==void 0?u:0;return Math.abs(a-f)<=Math.abs(a-p)?n[d-1]:n[d]}}}function $ye(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):g6(e,void 0)}function FM(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 yy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FM(Object(n),!0).forEach(function(r){Bye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bye(e,t,n){return(t=Uye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uye(e){var t=Fye(e,"string");return typeof t=="symbol"?t:t+""}function Fye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var dj=[0,"auto"],Tn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},y6=(e,t)=>e.cartesianAxis.xAxis[t],ka=(e,t)=>{var n=y6(e,t);return n??Tn},Pn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:dj,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:gh},v6=(e,t)=>e.cartesianAxis.yAxis[t],Ca=(e,t)=>{var n=v6(e,t);return n??Pn},qye={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:""},Qk=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??qye},vr=(e,t,n)=>{switch(t){case"xAxis":return ka(e,n);case"yAxis":return Ca(e,n);case"zAxis":return Qk(e,n);case"angleAxis":return wk(e,n);case"radiusAxis":return Sk(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Hye=(e,t,n)=>{switch(t){case"xAxis":return ka(e,n);case"yAxis":return Ca(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Ch=(e,t,n)=>{switch(t){case"xAxis":return ka(e,n);case"yAxis":return Ca(e,n);case"angleAxis":return wk(e,n);case"radiusAxis":return Sk(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},b6=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function x6(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 w6=e=>e.graphicalItems.cartesianItems,Kye=le([Bn,$v],x6),S6=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),Gu=le([w6,vr,Kye],S6,{memoizeOptions:{resultEqualityCheck:Uv}}),j6=le([Gu],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(kk)),N6=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Gye=le([Gu],N6),k6=e=>e.map(t=>t.data).filter(Boolean).flat(1),Vye=le([Gu],e=>e.some(t=>!t.data)),C6=le([Gu],k6,{memoizeOptions:{resultEqualityCheck:Uv}}),_6=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},Xk=le([C6,Rv],_6),Zye=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:$n(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:$n(i,r)}))):e.map(r=>({value:r})),A6=(e,t,n,r,i,a)=>{var{chartData:o=[],dataStartIndex:u,dataEndIndex:d}=r,f=Zye(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=o.slice(u,d+1),m=p.map(y=>({value:$n(y,t.dataKey)})).filter(y=>y.value!=null);return[...m,...f]}return f},_h=le([Xk,vr,Gu,Rv,Vye,C6],A6);function hu(e){if(Ai(e)||e instanceof Date){var t=Number(e);if(rt(t))return t}}function qM(e){if(Array.isArray(e)){var t=[hu(e[0]),hu(e[1])];return ma(t)?t:void 0}var n=hu(e);if(n!=null)return[n,n]}function Sa(e){return e.map(hu).filter(Or)}function Yye(e,t){var n=hu(e),r=hu(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Wye=le([_h],e=>e?.map(t=>t.value).sort(Yye));function O6(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Qye(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!ba(t))r=t;else if(Array.isArray(t)){var i=Sa(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Sa(n.flatMap(a=>{var o=$n(e,a.dataKey),u,d;if(Array.isArray(o)?[u,d]=o:u=d=o,!(!rt(u)||!rt(d)))return[r-u,r+d]}))}var Dn=e=>{var t=Un(e),n=Hu(e);return Ch(e,t,n)},Cu=le([Dn],e=>e?.dataKey),Xye=le([j6,Rv,Dn],RB),E6=(e,t,n,r)=>{var i={},a=t.reduce((o,u)=>{if(u.stackId==null)return o;var d=o[u.stackId];return d==null&&(d=[]),d.push(u),o[u.stackId]=d,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var[u,d]=o,f=r?[...d].reverse():d,p=f.map(Nk);return[u,{stackedData:zde(e,p,n),graphicalItems:f}]}))},z6=le([Xye,j6,Mv,_B],E6),T6=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=Mde(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},Jye=le([vr],e=>e.allowDataOverflow),Jk=e=>{var t;if(e==null||!("domain"in e))return dj;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Sa(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:dj},P6=le([vr],Jk),R6=le([P6,Jye],gB),eve=le([z6,ea,Bn,R6],T6,{memoizeOptions:{resultEqualityCheck:Bv}}),eC=e=>e.errorBars,tve=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>O6(n,r)),vy=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),o=Math.min(...a),u=Math.max(...a);return[o,u]}},M6=function(t,n,r,i,a){var o=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]:o,y=(p=i[f.id])===null||p===void 0?void 0:p.filter(v=>O6(a,v));m.forEach(v=>{var w,S=$n(v,(w=n.dataKey)!==null&&w!==void 0?w:f.dataKey),j=Qye(v,S,y);if(j.length>=2){var k=Math.min(...j),A=Math.max(...j);(u==null||k<u)&&(u=k),(d==null||A>d)&&(d=A)}var _=qM(S);_!=null&&(u=u==null?_[0]:Math.min(u,_[0]),d=d==null?_[1]:Math.max(d,_[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(f=>{var p=qM($n(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]))}),rt(u)&&rt(d))return[u,d]},nve=le([Xk,vr,Gye,eC,Bn,Hpe],M6,{memoizeOptions:{resultEqualityCheck:Bv}});function rve(e){var{value:t}=e;if(Ai(t)||t instanceof Date)return t}var ive=(e,t,n)=>{var r=e.map(rve).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&K$(r))?mB(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},D6=e=>e.referenceElements.dots,Vu=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),ave=le([D6,Bn,$v],Vu),I6=e=>e.referenceElements.areas,sve=le([I6,Bn,$v],Vu),L6=e=>e.referenceElements.lines,ove=le([L6,Bn,$v],Vu),$6=(e,t)=>{if(e!=null){var n=Sa(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},lve=le(ave,Bn,$6),B6=(e,t)=>{if(e!=null){var n=Sa(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)]}},cve=le([sve,Bn],B6);function uve(e){var t;if(e.x!=null)return Sa([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Sa(n)}function dve(e){var t;if(e.y!=null)return Sa([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Sa(n)}var U6=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?uve(r):dve(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},fve=le([ove,Bn],U6),hve=le(lve,fve,cve,(e,t,n)=>vy(e,n,t)),F6=(e,t,n,r,i,a,o,u)=>{if(n!=null)return n;var d=o==="vertical"&&u==="xAxis"||o==="horizontal"&&u==="yAxis",f=d?vy(r,a,i):vy(a,i);return Gpe(t,f,e.allowDataOverflow)},pve=le([vr,P6,R6,eve,nve,hve,nn,Bn],F6,{memoizeOptions:{resultEqualityCheck:Bv}}),mve=[0,1],q6=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:u,type:d}=e,f=Na(t,a);if(f&&u==null){var p;return mB(0,(p=n?.length)!==null&&p!==void 0?p:0)}return d==="category"?ive(r,e,f):i==="expand"&&!f?mve:o}},tC=le([vr,nn,Xk,_h,Mv,Bn,pve],q6),Zu=le([vr,b6,vk],m6),H6=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=Jk(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&ma(e)){if(a)return JR(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return eM(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&ma(e))return JR(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&ma(e))return eM(e,t.tickCount,t.allowDecimals,"adaptive")}}},nC=le([tC,Ch,Zu],H6),K6=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&ma(t)&&Array.isArray(n)&&n.length>0){var i,a,o=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(o,u),Math.max(d,f)]}return t},gve=le([vr,tC,nC,Bn],K6),yve=le(_h,vr,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Sa(e.map(m=>m.value))).sort((m,y)=>m-y),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var 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/o}}),G6=le(yve,nn,Qpe,Jn,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!rt(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=yo(n,e*a),u=e*a/2;return u-o-(u-o)/a*o}return 0}),vve=(e,t,n)=>{var r=ka(e,t);return r==null||typeof r.padding!="string"?0:G6(e,"xAxis",t,n,r.padding)},bve=(e,t,n)=>{var r=Ca(e,t);return r==null||typeof r.padding!="string"?0:G6(e,"yAxis",t,n,r.padding)},xve=le(ka,vve,(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}}),wve=le(Ca,bve,(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}}),Sve=le([Jn,xve,Ev,Ov,(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]}),jve=le([Jn,nn,wve,Ev,Ov,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Ah=(e,t,n,r)=>{var i;switch(t){case"xAxis":return Sve(e,n,r);case"yAxis":return jve(e,n,r);case"zAxis":return(i=Qk(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return zB(e);case"radiusAxis":return TB(e,n);default:return}},V6=le([vr,Ah],Dv),Nve=le([Zu,gve],sme),rC=le([vr,Zu,Nve,V6],Wk),Z6=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=Na(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(u=>u.value)}},iC=le([nn,_h,Ch,Bn],Z6),_u=le([rC],Ck);le([rC],$ye);le([rC,Wye],g6);le([Gu,eC,Bn],tve);function Y6(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Zv=(e,t)=>t,Yv=(e,t,n)=>n,kve=le(_v,Zv,Yv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(Y6)),Cve=le(Av,Zv,Yv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(Y6)),W6=(e,t)=>({width:e.width,height:t.height}),_ve=(e,t)=>{var n=typeof t.width=="number"?t.width:gh;return{width:n,height:e.height}},Ave=le(Jn,ka,W6),Ove=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},Eve=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},zve=le(fs,Jn,kve,Zv,Yv,(e,t,n,r,i)=>{var a={},o;return n.forEach(u=>{var d=W6(t,u);o==null&&(o=Ove(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[u.id]=o-Number(f)*d.height,o+=(f?-1:1)*d.height}),a}),Tve=le(ds,Jn,Cve,Zv,Yv,(e,t,n,r,i)=>{var a={},o;return n.forEach(u=>{var d=_ve(t,u);o==null&&(o=Eve(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[u.id]=o-Number(f)*d.width,o+=(f?-1:1)*d.width}),a}),Pve=(e,t)=>{var n=ka(e,t);if(n!=null)return zve(e,n.orientation,n.mirror)},Rve=le([Jn,ka,Pve,(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}}}),Mve=(e,t)=>{var n=Ca(e,t);if(n!=null)return Tve(e,n.orientation,n.mirror)},Dve=le([Jn,Ca,Mve,(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}}}),Ive=le(Jn,Ca,(e,t)=>{var n=typeof t.width=="number"?t.width:gh;return{width:n,height:e.height}}),Q6=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,u=Na(e,r),d=t.map(p=>p.value),f=d.filter(p=>p!=null);if(o&&u&&a==="category"&&i&&K$(f))return d}},aC=le([nn,_h,vr,Bn],Q6),HM=le([nn,Hye,Zu,_u,aC,iC,Ah,nC,Bn],(e,t,n,r,i,a,o,u,d)=>{if(t!=null){var f=Na(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:o,realScaleType:n,scale:r}}}),Lve=(e,t,n,r,i,a,o,u,d)=>{if(!(t==null||r==null)){var f=Na(e,d),{type:p,ticks:m,tickCount:y}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,w=p==="category"&&r.bandwidth?r.bandwidth()/v:0;w=d==="angleAxis"&&a!=null&&a.length>=2?wi(a[0]-a[1])*2*w:w;var S=m||i;return S?S.map((j,k)=>{var A=o?o.indexOf(j):j,_=r.map(A);return rt(_)?{index:k,coordinate:_+w,value:j,offset:w}:null}).filter(Or):f&&u?u.map((j,k)=>{var A=r.map(j);return rt(A)?{coordinate:A+w,value:j,index:k,offset:w}:null}).filter(Or):r.ticks?r.ticks(y).map((j,k)=>{var A=r.map(j);return rt(A)?{coordinate:A+w,value:j,index:k,offset:w}:null}).filter(Or):r.domain().map((j,k)=>{var A=r.map(j);return rt(A)?{coordinate:A+w,value:o?o[j]:j,index:k,offset:w}:null}).filter(Or)}},X6=le([nn,Ch,Zu,_u,nC,Ah,aC,iC,Bn],Lve),$ve=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var u=Na(e,o),{tickCount:d}=t,f=0;return f=o==="angleAxis"&&r?.length>=2?wi(r[0]-r[1])*2*f:f,u&&a?a.map((p,m)=>{var y=n.map(p);return rt(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(Or):n.ticks?n.ticks(d).map((p,m)=>{var y=n.map(p);return rt(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(Or):n.domain().map((p,m)=>{var y=n.map(p);return rt(y)?{coordinate:y+f,value:i?i[p]:p,index:m,offset:f}:null}).filter(Or)}},J6=le([nn,Ch,_u,Ah,aC,iC,Bn],$ve),eU=le(vr,_u,(e,t)=>{if(!(e==null||t==null))return yy(yy({},e),{},{scale:t})}),Bve=le([vr,Zu,tC,V6],Wk),Uve=le([Bve],Ck);le((e,t,n)=>Qk(e,n),Uve,(e,t)=>{if(!(e==null||t==null))return yy(yy({},e),{},{scale:t})});var Fve=le([nn,_v,Av],(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}}),qve=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};le([qve],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var o=Math.abs(a.coordinate-t);o<r&&(r=o,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var tU=e=>e.options.defaultTooltipEventType,nU=e=>e.options.validateTooltipEventTypes;function rU(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function Oh(e,t){var n=tU(e),r=nU(e);return rU(t,n,r)}function Hve(e){return He(t=>Oh(t,e))}var iU=(e,t)=>{var n,r=Number(t);if(!(ba(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},Kve=e=>e.tooltip.settings,Qs={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},Gve={itemInteraction:{click:Qs,hover:Qs},axisInteraction:{click:Qs,hover:Qs},keyboardInteraction:Qs,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}},aU=or({name:"tooltip",initialState:Gve,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Yt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Si(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:Yt()},removeTooltipEntrySettings:{reducer(e,t){var n=Si(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Yt()},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:Vve,replaceTooltipEntrySettings:Zve,removeTooltipEntrySettings:Yve,setTooltipSettingsState:Wve,setActiveMouseOverItemIndex:Qve,mouseLeaveItem:Ike,mouseLeaveChart:sU,setActiveClickItemIndex:Lke,setMouseOverAxisIndex:oU,setMouseClickAxisIndex:Xve,setSyncInteraction:hf,setKeyboardInteraction:by}=aU.actions,Jve=aU.reducer;function KM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Im(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KM(Object(n),!0).forEach(function(r){e0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function e0e(e,t,n){return(t=t0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t0e(e){var t=n0e(e,"string");return typeof t=="symbol"?t:t+""}function n0e(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 r0e(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function i0e(e){return e.index!=null}var lU=(e,t,n,r)=>{if(t==null)return Qs;var i=r0e(e,t,n);if(i==null)return Qs;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(i0e(i)){if(a)return Im(Im({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Im(Im({},Qs),{},{coordinate:i.coordinate})};function a0e(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 s0e(e,t){var n=a0e(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),o=Math.max(r,i);return n>=a&&n<=o}function o0e(e,t,n){if(n==null||t==null)return!0;var r=$n(e,t);return r==null||!ma(n)?!0:s0e(r,n)}var Sf=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!rt(a))return i;var o=0,u=1/0;t.length>0&&(u=t.length-1);var d=Math.max(o,Math.min(a,u)),f=t[d];return f==null||o0e(f,n,r)?String(d):null},cU=(e,t,n,r,i,a,o)=>{if(a!=null){var u=o[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}}},uU=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(o=>{var u;return((u=o.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},dU=e=>e.options.tooltipPayloadSearcher,Yu=e=>e.tooltip;function GM(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 VM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GM(Object(n),!0).forEach(function(r){l0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function l0e(e,t,n){return(t=c0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c0e(e){var t=u0e(e,"string");return typeof t=="symbol"?t:t+""}function u0e(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 d0e(e){if(typeof e=="string"||typeof e=="number")return e}function f0e(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function h0e(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function ZM(e){if(typeof e=="string")return e}function p0e(e){if(!(e==null||typeof e!="object")){var t="name"in e?d0e(e.name):void 0,n="unit"in e?f0e(e.unit):void 0,r="dataKey"in e?h0e(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?ZM(e.color):void 0,o="fill"in e?ZM(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function m0e(e,t){return e??t}var fU=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:u,computedData:d,dataStartIndex:f,dataEndIndex:p}=n,m=[];return e.reduce((y,v)=>{var w,{dataDefinedOnItem:S,settings:j}=v,k=m0e(S,u),A=Array.isArray(k)?F3(k,f,p):k,_=(w=j?.dataKey)!==null&&w!==void 0?w:r,C=j?.nameKey,P;if(r&&Array.isArray(A)&&!Array.isArray(A[0])&&o==="axis"?P=G$(A,r,i):P=a(A,t,d,C),Array.isArray(P))P.forEach(O=>{var T,M,q=p0e(O),$=q?.name,L=q?.dataKey,J=q?.payload,ae=VM(VM({},j),{},{name:$,unit:q?.unit,color:(T=q?.color)!==null&&T!==void 0?T:j?.color,fill:(M=q?.fill)!==null&&M!==void 0?M:j?.fill});y.push(UP({tooltipEntrySettings:ae,dataKey:L,payload:J,value:$n(J,L),name:$==null?void 0:String($)}))});else{var E;y.push(UP({tooltipEntrySettings:j,dataKey:_,payload:P,value:$n(P,_),name:(E=$n(P,C))!==null&&E!==void 0?E:j?.name}))}return y},m)}},sC=le([Dn,b6,vk],m6),g0e=le([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),y0e=le([Un,Hu],x6),Wl=le([g0e,Dn,y0e],S6,{memoizeOptions:{resultEqualityCheck:Uv}}),v0e=le([Wl],e=>e.filter(kk)),hU=le([Wl],k6,{memoizeOptions:{resultEqualityCheck:Uv}}),b0e=le([Wl],e=>e.some(t=>!t.data)),Ll=le([hU,ea],_6),x0e=le([v0e,ea,Dn],RB),oC=le([Ll,Dn,Wl,ea,b0e,hU],A6),pU=le([Dn],Jk),w0e=le([Dn],e=>e.allowDataOverflow),mU=le([pU,w0e],gB),S0e=le([Wl],e=>e.filter(kk)),j0e=le([x0e,S0e,Mv,_B],E6),N0e=le([j0e,ea,Un,mU],T6),k0e=le([Wl],N6),C0e=le([Ll,Dn,k0e,eC,Un,Kpe],M6,{memoizeOptions:{resultEqualityCheck:Bv}}),_0e=le([D6,Un,Hu],Vu),A0e=le([_0e,Un],$6),O0e=le([I6,Un,Hu],Vu),E0e=le([O0e,Un],B6),z0e=le([L6,Un,Hu],Vu),T0e=le([z0e,Un],U6),P0e=le([A0e,T0e,E0e],vy),R0e=le([Dn,pU,mU,N0e,C0e,P0e,nn,Un],F6),Au=le([Dn,nn,Ll,oC,Mv,Un,R0e],q6),M0e=le([Au,Dn,sC],H6),D0e=le([Dn,Au,M0e,Un],K6),gU=e=>{var t=Un(e),n=Hu(e),r=!1;return Ah(e,t,n,r)},yU=le([Dn,gU],Dv),I0e=le([Dn,sC,D0e,yU],Wk),vU=le([I0e],Ck),L0e=le([nn,oC,Dn,Un],Q6),$0e=le([nn,oC,Dn,Un],Z6),B0e=(e,t,n,r,i,a,o,u)=>{if(t){var{type:d}=t,f=Na(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?wi(i[0]-i[1])*2*m:m,f&&o?o.map((y,v)=>{var w=r.map(y);return rt(w)?{coordinate:w+m,value:y,index:v,offset:m}:null}).filter(Or):r.domain().map((y,v)=>{var w=r.map(y);return rt(w)?{coordinate:w+m,value:a?a[y]:y,index:v,offset:m}:null}).filter(Or)}}},ps=le([nn,Dn,sC,vU,gU,L0e,$0e,Un],B0e),lC=le([tU,nU,Kve],(e,t,n)=>rU(n.shared,e,t)),bU=e=>e.tooltip.settings.trigger,cC=e=>e.tooltip.settings.defaultIndex,Eh=le([Yu,lC,bU,cC],lU),Wf=le([Eh,Ll,Cu,Au],Sf),xU=le([ps,Wf],iU),U0e=le([Eh],e=>{if(e)return e.dataKey}),F0e=le([Eh],e=>{if(e)return e.graphicalItemId}),wU=le([Yu,lC,bU,cC],uU),q0e=le([ds,fs,nn,Jn,ps,cC,wU],cU),H0e=le([Eh,q0e],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),K0e=le([Eh],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),G0e=le([wU,Wf,ea,Cu,xU,dU,lC],fU),V0e=le([G0e],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function YM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function WM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YM(Object(n),!0).forEach(function(r){Z0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Z0e(e,t,n){return(t=Y0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y0e(e){var t=W0e(e,"string");return typeof t=="symbol"?t:t+""}function W0e(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 Q0e=()=>He(Dn),X0e=()=>{var e=Q0e(),t=He(ps),n=He(vU);return Zg(!e||!n?void 0:WM(WM({},e),{},{scale:n}),t)};function QM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QM(Object(n),!0).forEach(function(r){J0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function J0e(e,t,n){return(t=ebe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ebe(e){var t=tbe(e,"string");return typeof t=="symbol"?t:t+""}function tbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nbe=(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}},rbe=(e,t,n,r)=>{var i=t.find(f=>f&&f.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:o}=r;return qc(qc(qc({},r),Qn(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var u=i.coordinate,{angle:d}=r;return qc(qc(qc({},r),Qn(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 ibe(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 SU=(e,t,n,r,i)=>{var a,o=(a=t?.length)!==null&&a!==void 0?a:0;if(o<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var u=0;u<o;u++){var d,f,p,m,y,v=u>0?(d=n[u-1])===null||d===void 0?void 0:d.coordinate:(f=n[o-1])===null||f===void 0?void 0:f.coordinate,w=(p=n[u])===null||p===void 0?void 0:p.coordinate,S=u>=o-1?(m=n[0])===null||m===void 0?void 0:m.coordinate:(y=n[u+1])===null||y===void 0?void 0:y.coordinate,j=void 0;if(!(v==null||w==null||S==null))if(wi(w-v)!==wi(S-w)){var k=[];if(wi(S-w)===wi(i[1]-i[0])){j=S;var A=w+i[1]-i[0];k[0]=Math.min(A,(A+v)/2),k[1]=Math.max(A,(A+v)/2)}else{j=v;var _=S+i[1]-i[0];k[0]=Math.min(w,(_+w)/2),k[1]=Math.max(w,(_+w)/2)}var C=[Math.min(w,(j+w)/2),Math.max(w,(j+w)/2)];if(e>C[0]&&e<=C[1]||e>=k[0]&&e<=k[1]){var P;return(P=n[u])===null||P===void 0?void 0:P.index}}else{var E=Math.min(v,S),O=Math.max(v,S);if(e>(E+w)/2&&e<=(O+w)/2){var T;return(T=n[u])===null||T===void 0?void 0:T.index}}}else if(t)for(var M=0;M<o;M++){var q=t[M];if(q!=null){var $=t[M+1],L=t[M-1];if(M===0&&$!=null&&e<=(q.coordinate+$.coordinate)/2||M===o-1&&L!=null&&e>(q.coordinate+L.coordinate)/2||M>0&&M<o-1&&L!=null&&$!=null&&e>(q.coordinate+L.coordinate)/2&&e<=(q.coordinate+$.coordinate)/2)return q.index}}return-1},jU=()=>He(vk),uC=(e,t)=>t,NU=(e,t,n)=>n,dC=(e,t,n,r)=>r,abe=le(ps,e=>yv(e,t=>t.coordinate)),fC=le([Yu,uC,NU,dC],lU),hC=le([fC,Ll,Cu,Au],Sf),sbe=(e,t,n)=>{if(t!=null){var r=Yu(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},kU=le([Yu,uC,NU,dC],uU),xy=le([ds,fs,nn,Jn,ps,dC,kU],cU),obe=le([fC,xy],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),CU=le([ps,hC],iU),lbe=le([kU,hC,ea,Cu,CU,dU,uC],fU),cbe=le([fC,hC],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),ube=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&ibe(e,o)){var u=Dde(e,t),d=SU(u,a,i,n,r),f=nbe(t,i,d,e);return{activeIndex:String(d),activeCoordinate:f}}},dbe=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var u=Tpe(e,n);if(u){var d=Ide(u,t),f=SU(d,o,a,r,i),p=rbe(t,a,f,u);return{activeIndex:String(f),activeCoordinate:p}}}},fbe=(e,t,n,r,i,a,o,u)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?ube(e,t,r,i,a,o,u):dbe(e,t,n,r,i,a,o)},hbe=le(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),pbe=le(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(ar)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:ame}});function XM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function JM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XM(Object(n),!0).forEach(function(r){mbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mbe(e,t,n){return(t=gbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gbe(e){var t=ybe(e,"string");return typeof t=="symbol"?t:t+""}function ybe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vbe={},bbe={zIndexMap:Object.values(ar).reduce((e,t)=>JM(JM({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),vbe)},xbe=new Set(Object.values(ar));function wbe(e){return xbe.has(e)}var _U=or({name:"zIndex",initialState:bbe,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:Yt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!wbe(n)&&delete e.zIndexMap[n])},prepare:Yt()},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:Yt()},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:Yt()}}}),{registerZIndexPortal:Sbe,unregisterZIndexPortal:wS,registerZIndexPortalElement:jbe,unregisterZIndexPortalElement:Nbe}=_U.actions,kbe=_U.reducer;function _a(e){var{zIndex:t,children:n}=e,r=gfe(),i=r&&t!==void 0&&t!==0,a=yr(),o=b.useRef(void 0),u=b.useRef(new Set),d=un(),f=He(m=>hbe(m,t,a));if(b.useLayoutEffect(()=>{if(!i){var m=u.current;m.forEach(v=>{d(wS({zIndex:v}))}),m.clear(),o.current=void 0;return}if(u.current.has(t)||(d(Sbe({zIndex:t})),u.current.add(t)),f){o.current=f;var y=u.current;y.forEach(v=>{v!==t&&(d(wS({zIndex:v})),y.delete(v))})}},[d,t,i,f]),b.useLayoutEffect(()=>{var m=u.current;return()=>{m.forEach(y=>{d(wS({zIndex:y}))}),m.clear()}},[d]),!i)return n;var p=f??o.current;return p?Ul.createPortal(n,p):null}function fj(){return fj=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},fj.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 Lm(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){Cbe(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 Cbe(e,t,n){return(t=_be(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _be(e){var t=Abe(e,"string");return typeof t=="symbol"?t:t+""}function Abe(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 Obe(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return b.isValidElement(t)?b.cloneElement(t,r):b.createElement(n,r)}function Ebe(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:o,layout:u,cursor:d,tooltipEventType:f,chartName:p}=e,m=n,y=r,v=i;if(!d||!m||p!=="ScatterChart"&&f!=="axis")return null;var w,S,j;if(p==="ScatterChart")w=m,S=Hhe,j=ar.cursorLine;else if(p==="BarChart")w=Khe(u,m,a,o),S=Spe,j=ar.cursorRectangle;else if(u==="radial"&&Y$(m)){var{cx:k,cy:A,radius:_,startAngle:C,endAngle:P}=hB(m);w={cx:k,cy:A,startAngle:C,endAngle:P,innerRadius:_,outerRadius:_},S=Dpe,j=ar.cursorLine}else w={points:Ipe(u,m,a)},S=ig,j=ar.cursorLine;var E=typeof d=="object"&&"className"in d?d.className:void 0,O=Lm(Lm(Lm(Lm({stroke:"#ccc",pointerEvents:"none"},a),w),fv(d)),{},{payload:y,payloadIndex:v,className:Ct("recharts-tooltip-cursor",E)});return b.createElement(_a,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:j},b.createElement(Obe,{cursor:d,cursorComp:S,cursorProps:O}))}function zbe(e){var t=X0e(),n=Q3(),r=Uu(),i=jU();return t==null||n==null||r==null||i==null?null:b.createElement(Ebe,fj({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var AU=b.createContext(null),Tbe=()=>b.useContext(AU),SS={exports:{}},tD;function Pbe(){return tD||(tD=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(d,f,p){this.fn=d,this.context=f,this.once=p||!1}function a(d,f,p,m,y){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new i(p,m||d,y),w=n?n+f:f;return d._events[w]?d._events[w].fn?d._events[w]=[d._events[w],v]:d._events[w].push(v):(d._events[w]=v,d._eventsCount++),d}function o(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 y=0,v=m.length,w=new Array(v);y<v;y++)w[y]=m[y].fn;return w},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,y,v,w){var S=n?n+f:f;if(!this._events[S])return!1;var j=this._events[S],k=arguments.length,A,_;if(j.fn){switch(j.once&&this.removeListener(f,j.fn,void 0,!0),k){case 1:return j.fn.call(j.context),!0;case 2:return j.fn.call(j.context,p),!0;case 3:return j.fn.call(j.context,p,m),!0;case 4:return j.fn.call(j.context,p,m,y),!0;case 5:return j.fn.call(j.context,p,m,y,v),!0;case 6:return j.fn.call(j.context,p,m,y,v,w),!0}for(_=1,A=new Array(k-1);_<k;_++)A[_-1]=arguments[_];j.fn.apply(j.context,A)}else{var C=j.length,P;for(_=0;_<C;_++)switch(j[_].once&&this.removeListener(f,j[_].fn,void 0,!0),k){case 1:j[_].fn.call(j[_].context);break;case 2:j[_].fn.call(j[_].context,p);break;case 3:j[_].fn.call(j[_].context,p,m);break;case 4:j[_].fn.call(j[_].context,p,m,y);break;default:if(!A)for(P=1,A=new Array(k-1);P<k;P++)A[P-1]=arguments[P];j[_].fn.apply(j[_].context,A)}}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,y){var v=n?n+f:f;if(!this._events[v])return this;if(!p)return o(this,v),this;var w=this._events[v];if(w.fn)w.fn===p&&(!y||w.once)&&(!m||w.context===m)&&o(this,v);else{for(var S=0,j=[],k=w.length;S<k;S++)(w[S].fn!==p||y&&!w[S].once||m&&w[S].context!==m)&&j.push(w[S]);j.length?this._events[v]=j.length===1?j[0]:j:o(this,v)}return this},u.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&o(this,p)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(SS)),SS.exports}var Rbe=Pbe();const Mbe=ja(Rbe);var Qf=new Mbe,hj="recharts.syncEvent.tooltip",nD="recharts.syncEvent.brush",Dbe=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!ba(n))return e[n]}},Ibe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},OU=or({name:"options",initialState:Ibe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Lbe=OU.reducer,{createEventEmitter:$be}=OU.actions;function Bbe(e){return e.tooltip.syncInteraction}var Ube={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},EU=or({name:"chartData",initialState:Ube,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:rD,setDataStartEndIndexes:Fbe,setComputedData:$ke}=EU.actions,qbe=EU.reducer,Hbe=["x","y"];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 Hc(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){Kbe(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 Kbe(e,t,n){return(t=Gbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gbe(e){var t=Vbe(e,"string");return typeof t=="symbol"?t:t+""}function Vbe(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 Zbe(e,t){if(e==null)return{};var n,r,i=Ybe(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 Ybe(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 Wbe(){var e=He(bk),t=He(xk),n=un(),r=He(AB),i=He(ps),a=Uu(),o=yh(),u=He(d=>d.rootProps.className);b.useEffect(()=>{if(e==null)return Bu;var d=(f,p,m)=>{if(t!==m&&e===f){if(p.payload.active===!1){n(hf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var y;if(o&&p!==null&&p!==void 0&&(y=p.payload)!==null&&y!==void 0&&y.coordinate&&p.payload.sourceViewBox){var v=p.payload.coordinate,{x:w,y:S}=v,j=Zbe(v,Hbe),{x:k,y:A,width:_,height:C}=p.payload.sourceViewBox,P=Hc(Hc({},j),{},{x:o.x+(_?(w-k)/_:0)*o.width,y:o.y+(C?(S-A)/C:0)*o.height});n(Hc(Hc({},p),{},{payload:Hc(Hc({},p.payload),{},{coordinate:P})}))}else n(p);return}if(i!=null){var E;if(typeof r=="function"){var O={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},T=r(i,O);E=i[T]}else r==="value"&&(E=i.find(H=>String(H.value)===p.payload.label));var{coordinate:M}=p.payload;if(M==null||o==null){n(hf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(E==null){n(hf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:q,y:$}=M,L=Math.min(q,o.x+o.width),J=Math.min($,o.y+o.height),ae={x:a==="horizontal"?E.coordinate:L,y:a==="horizontal"?J:E.coordinate},Z=hf({active:p.payload.active,coordinate:ae,dataKey:p.payload.dataKey,index:String(E.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(Z)}}};return Qf.on(hj,d),()=>{Qf.off(hj,d)}},[u,n,t,e,r,i,a,o])}function Qbe(){var e=He(bk),t=He(xk),n=un();b.useEffect(()=>{if(e==null)return Bu;var r=(i,a,o)=>{t!==o&&e===i&&n(Fbe(a))};return Qf.on(nD,r),()=>{Qf.off(nD,r)}},[n,t,e])}function Xbe(){var e=un();b.useEffect(()=>{e($be())},[e]),Wbe(),Qbe()}function Jbe(e,t,n,r,i,a){var o=He(w=>sbe(w,e,t)),u=He(F0e),d=He(xk),f=He(bk),p=He(AB),m=He(Bbe),y=m?.sourceViewBox!=null,v=yh();b.useEffect(()=>{if(!y&&f!=null&&d!=null){var w=hf({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:u});Qf.emit(hj,f,w,d)}},[y,n,o,u,i,r,d,f,p,a,v])}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 sD(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){exe(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 exe(e,t,n){return(t=txe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function txe(e){var t=nxe(e,"string");return typeof t=="symbol"?t:t+""}function nxe(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 rxe(e){return e.dataKey}function ixe(e,t){return b.isValidElement(e)?b.cloneElement(e,t):typeof e=="function"?b.createElement(e,t):b.createElement(bhe,t)}var oD=[],axe={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 wy(e){var t,n,r=gr(e,axe),{active:i,allowEscapeViewBox:a,animationDuration:o,animationEasing:u,content:d,filterNull:f,isAnimationActive:p,offset:m,payloadUniqBy:y,position:v,reverseDirection:w,useTranslate3d:S,wrapperStyle:j,cursor:k,shared:A,trigger:_,defaultIndex:C,portal:P,axisId:E}=r,O=un(),T=typeof C=="number"?String(C):C;b.useEffect(()=>{O(Wve({shared:A,trigger:_,axisId:E,active:i,defaultIndex:T}))},[O,A,_,E,i,T]);var M=yh(),q=oB(),$=Hve(A),{activeIndex:L,isActive:J}=(t=He(je=>cbe(je,$,_,T)))!==null&&t!==void 0?t:{},ae=He(je=>lbe(je,$,_,T)),Z=He(je=>CU(je,$,_,T)),H=He(je=>obe(je,$,_,T)),Q=ae,he=Tbe(),we=(n=i??J)!==null&&n!==void 0?n:!1,[R,U]=f3([Q,we]),F=$==="axis"?Z:void 0;Jbe($,_,H,F,L,we);var D=P??he;if(D==null||M==null||$==null)return null;var Y=Q??oD;we||(Y=oD),f&&Y.length&&(Y=o3(Y.filter(je=>je.value!=null&&(je.hide!==!0||r.includeHidden)),y,rxe));var se=Y.length>0,ie=sD(sD({},r),{},{payload:Y,label:F,active:we,activeIndex:L,coordinate:H,accessibilityLayer:q}),fe=b.createElement(Ehe,{allowEscapeViewBox:a,animationDuration:o,animationEasing:u,isAnimationActive:p,active:we,coordinate:H,hasPayload:se,offset:m,position:v,reverseDirection:w,useTranslate3d:S,viewBox:M,wrapperStyle:j,lastBoundingBox:R,innerRef:U,hasPortalFromProps:!!P},ixe(d,ie));return b.createElement(b.Fragment,null,Ul.createPortal(fe,D),we&&b.createElement(zbe,{cursor:k,tooltipEventType:$,coordinate:H,payload:Y,index:L}))}function sxe(e,t,n){return(t=oxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oxe(e){var t=lxe(e,"string");return typeof t=="symbol"?t:t+""}function lxe(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 cxe{constructor(t){sxe(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 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 uxe(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){dxe(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 dxe(e,t,n){return(t=fxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fxe(e){var t=hxe(e,"string");return typeof t=="symbol"?t:t+""}function hxe(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 pxe={cacheSize:2e3,enableCache:!0},zU=uxe({},pxe),cD=new cxe(zU.cacheSize),mxe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},uD="recharts_measurement_span";function gxe(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",o=t.letterSpacing||"",u=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(o,"|").concat(u)}var dD=(e,t)=>{try{var n=document.getElementById(uD);n||(n=document.createElement("span"),n.setAttribute("id",uD),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,mxe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},jf=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||wh.isSsr)return{width:0,height:0};if(!zU.enableCache)return dD(t,n);var r=gxe(t,n),i=cD.get(r);if(i)return i;var a=dD(t,n);return cD.set(r,a),a},TU;function yxe(e,t,n){return(t=vxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vxe(e){var t=bxe(e,"string");return typeof t=="symbol"?t:t+""}function bxe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fD=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,hD=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,xxe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,wxe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Sxe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},jxe=["cm","mm","pt","pc","in","Q","px"];function Nxe(e){return jxe.includes(e)}var ru="NaN";function kxe(e,t){return e*Sxe[t]}class Yn{static parse(t){var n,[,r,i]=(n=wxe.exec(t))!==null&&n!==void 0?n:[];return r==null?Yn.NaN:new Yn(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,ba(t)&&(this.unit=""),n!==""&&!xxe.test(n)&&(this.num=NaN,this.unit=""),Nxe(n)&&(this.num=kxe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Yn(NaN,""):new Yn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Yn(NaN,""):new Yn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Yn(NaN,""):new Yn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Yn(NaN,""):new Yn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return ba(this.num)}}TU=Yn;yxe(Yn,"NaN",new TU(NaN,""));function PU(e){if(e==null||e.includes(ru))return ru;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=fD.exec(t))!==null&&n!==void 0?n:[],o=Yn.parse(r??""),u=Yn.parse(a??""),d=i==="*"?o.multiply(u):o.divide(u);if(d.isNaN())return ru;t=t.replace(fD,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,p,m,y]=(f=hD.exec(t))!==null&&f!==void 0?f:[],v=Yn.parse(p??""),w=Yn.parse(y??""),S=m==="+"?v.add(w):v.subtract(w);if(S.isNaN())return ru;t=t.replace(hD,S.toString())}return t}var pD=/\(([^()]*)\)/;function Cxe(e){for(var t=e,n;(n=pD.exec(t))!=null;){var[,r]=n;t=t.replace(pD,PU(r))}return t}function _xe(e){var t=e.replace(/\s+/g,"");return t=Cxe(t),t=PU(t),t}function Axe(e){try{return _xe(e)}catch{return ru}}function jS(e){var t=Axe(e.slice(5,-1));return t===ru?"":t}var Oxe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Exe=["dx","dy","angle","className","breakAll"];function pj(){return pj=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},pj.apply(null,arguments)}function mD(e,t){if(e==null)return{};var n,r,i=zxe(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 zxe(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 RU=/[ \f\n\r\t\v\u2028\u2029]+/,MU=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Xn(t)||(n?i=t.toString().split(""):i=t.toString().split(RU));var a=i.map(u=>({word:u,width:jf(u,r).width})),o=n?0:jf(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function DU(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function Txe(e){return Xn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var IU=(e,t,n,r)=>e.reduce((i,a)=>{var{word:o,width:u}=a,d=i[i.length-1];if(d&&u!=null&&(t==null||r||d.width+u+n<Number(t)))d.words.push(o),d.width+=u+n;else{var f={words:[o],width:u};i.push(f)}return i},[]),LU=e=>e.reduce((t,n)=>t.width>n.width?t:n),Pxe="…",gD=(e,t,n,r,i,a,o,u)=>{var d=e.slice(0,t),f=MU({breakAll:n,style:r,children:d+Pxe});if(!f)return[!1,[]];var p=IU(f.wordsWithComputedWidth,a,o,u),m=p.length>i||LU(p).width>Number(a);return[m,p]},Rxe=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:u,breakAll:d}=e,f=Be(a),p=String(o),m=IU(t,r,n,i);if(!f||i)return m;var y=m.length>a||LU(m).width>Number(r);if(!y)return m;for(var v=0,w=p.length-1,S=0,j;v<=w&&S<=p.length-1;){var k=Math.floor((v+w)/2),A=k-1,[_,C]=gD(p,A,d,u,a,r,n,i),[P]=gD(p,k,d,u,a,r,n,i);if(!_&&!P&&(v=k+1),_&&P&&(w=k-1),!_&&P){j=C;break}S++}return j||m},yD=e=>{var t=Xn(e)?[]:e.toString().split(RU);return[{words:t,width:void 0}]},Mxe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!wh.isSsr){var u,d,f=MU({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:p,spaceWidth:m}=f;u=p,d=m}else return yD(r);return Rxe({breakAll:a,children:r,maxLines:o,style:i},u,d,t,!!n)}return yD(r)},$U="#808080",Dxe={angle:0,breakAll:!1,capHeight:"0.71em",fill:$U,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},pC=b.forwardRef((e,t)=>{var n=gr(e,Dxe),{x:r,y:i,lineHeight:a,capHeight:o,fill:u,scaleToFit:d,textAnchor:f,verticalAnchor:p}=n,m=mD(n,Oxe),y=b.useMemo(()=>Mxe({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:d,style:m.style,width:m.width}),[m.breakAll,m.children,m.maxLines,d,m.style,m.width]),{dx:v,dy:w,angle:S,className:j,breakAll:k}=m,A=mD(m,Exe);if(!Ai(r)||!Ai(i)||y.length===0)return null;var _=Number(r)+(Be(v)?v:0),C=Number(i)+(Be(w)?w:0);if(!rt(_)||!rt(C))return null;var P;switch(p){case"start":P=jS("calc(".concat(o,")"));break;case"middle":P=jS("calc(".concat((y.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:P=jS("calc(".concat(y.length-1," * -").concat(a,")"));break}var E=[],O=y[0];if(d&&O!=null){var T=O.width,{width:M}=m;E.push("scale(".concat(Be(M)&&Be(T)?M/T:1,")"))}return S&&E.push("rotate(".concat(S,", ").concat(_,", ").concat(C,")")),E.length&&(A.transform=E.join(" ")),b.createElement("text",pj({},Pr(A),{ref:t,x:_,y:C,className:Ct("recharts-text",j),textAnchor:f,fill:u.includes("url")?$U:u}),y.map((q,$)=>{var L=q.words.join(k?"":" ");return b.createElement("tspan",{x:_,dy:$===0?P:a,key:"".concat(L,"-").concat($)},L)}))});pC.displayName="Text";function vD(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 oa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vD(Object(n),!0).forEach(function(r){Ixe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ixe(e,t,n){return(t=Lxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lxe(e){var t=$xe(e,"string");return typeof t=="symbol"?t:t+""}function $xe(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 Bxe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:u,upperWidth:d,lowerWidth:f}=lk(t),p=a,m=a+(d-f)/2,y=(p+m)/2,v=(d+f)/2,w=p+d/2,S=u>=0?1:-1,j=S*r,k=S>0?"end":"start",A=S>0?"start":"end",_=d>=0?1:-1,C=_*r,P=_>0?"end":"start",E=_>0?"start":"end",O=i;if(n==="top"){var T={x:p+d/2,y:o-j,horizontalAnchor:"middle",verticalAnchor:k};return O&&(T.height=Math.max(o-O.y,0),T.width=d),T}if(n==="bottom"){var M={x:m+f/2,y:o+u+j,horizontalAnchor:"middle",verticalAnchor:A};return O&&(M.height=Math.max(O.y+O.height-(o+u),0),M.width=f),M}if(n==="left"){var q={x:y-C,y:o+u/2,horizontalAnchor:P,verticalAnchor:"middle"};return O&&(q.width=Math.max(q.x-O.x,0),q.height=u),q}if(n==="right"){var $={x:y+v+C,y:o+u/2,horizontalAnchor:E,verticalAnchor:"middle"};return O&&($.width=Math.max(O.x+O.width-$.x,0),$.height=u),$}var L=O?{width:v,height:u}:{};return n==="insideLeft"?oa({x:y+C,y:o+u/2,horizontalAnchor:E,verticalAnchor:"middle"},L):n==="insideRight"?oa({x:y+v-C,y:o+u/2,horizontalAnchor:P,verticalAnchor:"middle"},L):n==="insideTop"?oa({x:p+d/2,y:o+j,horizontalAnchor:"middle",verticalAnchor:A},L):n==="insideBottom"?oa({x:m+f/2,y:o+u-j,horizontalAnchor:"middle",verticalAnchor:k},L):n==="insideTopLeft"?oa({x:p+C,y:o+j,horizontalAnchor:E,verticalAnchor:A},L):n==="insideTopRight"?oa({x:p+d-C,y:o+j,horizontalAnchor:P,verticalAnchor:A},L):n==="insideBottomLeft"?oa({x:m+C,y:o+u-j,horizontalAnchor:E,verticalAnchor:k},L):n==="insideBottomRight"?oa({x:m+f-C,y:o+u-j,horizontalAnchor:P,verticalAnchor:k},L):n&&typeof n=="object"&&(Be(n.x)||Pl(n.x))&&(Be(n.y)||Pl(n.y))?oa({x:a+yo(n.x,v),y:o+yo(n.y,u),horizontalAnchor:"end",verticalAnchor:"end"},L):oa({x:w,y:o+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},L)},Uxe=["labelRef"],Fxe=["content"];function bD(e,t){if(e==null)return{};var n,r,i=qxe(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 qxe(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 xD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xD(Object(n),!0).forEach(function(r){Hxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hxe(e,t,n){return(t=Kxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kxe(e){var t=Gxe(e,"string");return typeof t=="symbol"?t:t+""}function Gxe(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 Xa(){return Xa=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},Xa.apply(null,arguments)}var BU=b.createContext(null),UU=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:u}=e,d=b.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return b.createElement(BU.Provider,{value:d},u)},FU=()=>{var e=b.useContext(BU),t=yh();return e||(t?lk(t):void 0)},Vxe=b.createContext(null),Zxe=()=>{var e=b.useContext(Vxe),t=He(PB);return e||t},Yxe=e=>{var{value:t,formatter:n}=e,r=Xn(e.children)?t:e.children;return typeof n=="function"?n(r):r},mC=e=>e!=null&&typeof e=="function",Wxe=(e,t)=>{var n=wi(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Qxe=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:u,cy:d,innerRadius:f,outerRadius:p,startAngle:m,endAngle:y,clockWise:v}=i,w=(f+p)/2,S=Wxe(m,y),j=S>=0?1:-1,k,A;switch(t){case"insideStart":k=m+j*a,A=v;break;case"insideEnd":k=y-j*a,A=!v;break;case"end":k=y+j*a,A=v;break;default:throw new Error("Unsupported position ".concat(t))}A=S<=0?A:!A;var _=Qn(u,d,w,k),C=Qn(u,d,w,k+(A?1:-1)*359),P="M".concat(_.x,",").concat(_.y,`
287
+ A`).concat(w,",").concat(w,",0,1,").concat(A?0:1,`,
288
+ `).concat(C.x,",").concat(C.y),E=Xn(e.id)?If("recharts-radial-line-"):e.id;return b.createElement("text",Xa({},r,{dominantBaseline:"central",className:Ct("recharts-radial-bar-label",o)}),b.createElement("defs",null,b.createElement("path",{id:E,d:P})),b.createElement("textPath",{xlinkHref:"#".concat(E)},n))},Xxe=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:u,endAngle:d}=e,f=(u+d)/2;if(n==="outside"){var{x:p,y:m}=Qn(r,i,o+t,f);return{x:p,y:m,textAnchor:p>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var y=(a+o)/2,{x:v,y:w}=Qn(r,i,y,f);return{x:v,y:w,textAnchor:"middle",verticalAnchor:"middle"}},ag=e=>e!=null&&"cx"in e&&Be(e.cx),Jxe={angle:0,offset:5,zIndex:ar.label,position:"middle",textBreakAll:!1};function ewe(e){if(!ag(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 Ws(e){var t=gr(e,Jxe),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:u,className:d="",textBreakAll:f,labelRef:p}=t,m=Zxe(),y=FU(),v=i==="center"?y:m??y,w,S,j;n==null?w=v:ag(n)?w=n:w=lk(n);var k=ewe(w);if(!w||Xn(a)&&Xn(o)&&!b.isValidElement(u)&&typeof u!="function")return null;var A=pf(pf({},t),{},{viewBox:w});if(b.isValidElement(u)){var{labelRef:_}=A,C=bD(A,Uxe);return b.cloneElement(u,C)}if(typeof u=="function"){var{content:P}=A,E=bD(A,Fxe);if(S=b.createElement(u,E),b.isValidElement(S))return S}else S=Yxe(t);var O=Pr(t);if(ag(w)){if(i==="insideStart"||i==="insideEnd"||i==="end")return Qxe(t,i,S,O,w);j=Xxe(w,t.offset,t.position)}else{if(!k)return null;var T=Bxe({viewBox:k,position:i,offset:t.offset,parentViewBox:ag(r)?void 0:r});j=pf(pf({x:T.x,y:T.y,textAnchor:T.horizontalAnchor,verticalAnchor:T.verticalAnchor},T.width!==void 0?{width:T.width}:{}),T.height!==void 0?{height:T.height}:{})}return b.createElement(_a,{zIndex:t.zIndex},b.createElement(pC,Xa({ref:p,className:Ct("recharts-label",d)},O,j,{textAnchor:DU(O.textAnchor)?O.textAnchor:j.textAnchor,breakAll:f}),S))}Ws.displayName="Label";var twe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?b.createElement(Ws,Xa({key:"label-implicit"},r)):Ai(e)?b.createElement(Ws,Xa({key:"label-implicit",value:e},r)):b.isValidElement(e)?e.type===Ws?b.cloneElement(e,pf({key:"label-implicit"},r)):b.createElement(Ws,Xa({key:"label-implicit",content:e},r)):mC(e)?b.createElement(Ws,Xa({key:"label-implicit",content:e},r)):e&&typeof e=="object"?b.createElement(Ws,Xa({},e,{key:"label-implicit"},r)):null};function qU(e){var{label:t,labelRef:n}=e,r=FU();return twe(t,r,n)||null}var nwe=["valueAccessor"],rwe=["dataKey","clockWise","id","textBreakAll","zIndex"];function Sy(){return Sy=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},Sy.apply(null,arguments)}function wD(e,t){if(e==null)return{};var n,r,i=iwe(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 iwe(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 awe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(Txe(t))return t},HU=b.createContext(void 0),swe=HU.Provider,KU=b.createContext(void 0);KU.Provider;function owe(){return b.useContext(HU)}function lwe(){return b.useContext(KU)}function sg(e){var{valueAccessor:t=awe}=e,n=wD(e,nwe),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:u}=n,d=wD(n,rwe),f=owe(),p=lwe(),m=f||p;return!m||!m.length?null:b.createElement(_a,{zIndex:u??ar.label},b.createElement(Yi,{className:"recharts-label-list"},m.map((y,v)=>{var w,S=Xn(r)?t(y,v):$n(y.payload,r),j=Xn(a)?{}:{id:"".concat(a,"-").concat(v)};return b.createElement(Ws,Sy({key:"label-".concat(v)},Pr(y),d,j,{fill:(w=n.fill)!==null&&w!==void 0?w:y.fill,parentViewBox:y.parentViewBox,value:S,textBreakAll:o,viewBox:y.viewBox,index:v,zIndex:0}))})))}sg.displayName="LabelList";function cwe(e){var{label:t}=e;return t?t===!0?b.createElement(sg,{key:"labelList-implicit"}):b.isValidElement(t)||mC(t)?b.createElement(sg,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(sg,Sy({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function mj(){return mj=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},mj.apply(null,arguments)}var GU=e=>{var{cx:t,cy:n,r,className:i}=e,a=Ct("recharts-dot",i);return Be(t)&&Be(n)&&Be(r)?b.createElement("circle",mj({},Zi(e),XN(e),{className:a,cx:t,cy:n,r})):null},uwe={radiusAxis:{},angleAxis:{}},VU=or({name:"polarAxis",initialState:uwe,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:Bke,removeRadiusAxis:Uke,addAngleAxis:Fke,removeAngleAxis:qke}=VU.actions,dwe=VU.reducer;function fwe(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var ZU=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function hwe(e){var{tooltipEntrySettings:t}=e,n=un(),r=yr(),i=b.useRef(null);return b.useLayoutEffect(()=>{r||(i.current===null?n(Vve(t)):i.current!==t&&n(Zve({prev:i.current,next:t})),i.current=t)},[t,n,r]),b.useLayoutEffect(()=>()=>{i.current&&(n(Yve(i.current)),i.current=null)},[n]),null}function pwe(e){var{legendPayload:t}=e,n=un(),r=yr(),i=b.useRef(null);return b.useLayoutEffect(()=>{r||(i.current===null?n(Efe(t)):i.current!==t&&n(zfe({prev:i.current,next:t})),i.current=t)},[n,r,t]),b.useLayoutEffect(()=>()=>{i.current&&(n(Tfe(i.current)),i.current=null)},[n]),null}var NS,mwe=()=>{var[e]=b.useState(()=>If("uid-"));return e},gwe=(NS=Ty.useId)!==null&&NS!==void 0?NS:mwe;function ywe(e,t){var n=gwe();return t||(e?"".concat(e,"-").concat(n):n)}var vwe=b.createContext(void 0),bwe=e=>{var{id:t,type:n,children:r}=e,i=ywe("recharts-".concat(n),t);return b.createElement(vwe.Provider,{value:i},r(i))},xwe={cartesianItems:[],polarItems:[]},YU=or({name:"graphicalItems",initialState:xwe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Yt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Si(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:Yt()},removeCartesianGraphicalItem:{reducer(e,t){var n=Si(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Yt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Yt()},removePolarGraphicalItem:{reducer(e,t){var n=Si(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Yt()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Si(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:Yt()}}}),{addCartesianGraphicalItem:wwe,replaceCartesianGraphicalItem:Swe,removeCartesianGraphicalItem:jwe,addPolarGraphicalItem:Hke,removePolarGraphicalItem:Kke,replacePolarGraphicalItem:Gke}=YU.actions,Nwe=YU.reducer,kwe=e=>{var t=un(),n=b.useRef(null);return b.useLayoutEffect(()=>{n.current===null?t(wwe(e)):n.current!==e&&t(Swe({prev:n.current,next:e})),n.current=e},[t,e]),b.useLayoutEffect(()=>()=>{n.current&&(t(jwe(n.current)),n.current=null)},[t]),null},Cwe=b.memo(kwe),_we=["points"];function SD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SD(Object(n),!0).forEach(function(r){Awe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Awe(e,t,n){return(t=Owe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Owe(e){var t=Ewe(e,"string");return typeof t=="symbol"?t:t+""}function Ewe(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 jy(){return jy=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},jy.apply(null,arguments)}function zwe(e,t){if(e==null)return{};var n,r,i=Twe(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 Twe(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 Pwe(e){var{option:t,dotProps:n,className:r}=e;if(b.isValidElement(t))return b.cloneElement(t,n);if(typeof t=="function")return t(n);var i=Ct(r,typeof t!="boolean"?t.className:""),a=n??{},{points:o}=a,u=zwe(a,_we);return b.createElement(GU,jy({},u,{className:i}))}function Rwe(e,t){return e==null?!1:t?!0:e.length===1}function Mwe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:u,clipPathId:d,zIndex:f=ar.scatter}=e;if(!Rwe(t,n))return null;var p=ZU(n),m=vle(n),y=t.map((w,S)=>{var j,k,A=kS(kS(kS({r:3},o),m),{},{index:S,cx:(j=w.x)!==null&&j!==void 0?j:void 0,cy:(k=w.y)!==null&&k!==void 0?k:void 0,dataKey:a,value:w.value,payload:w.payload,points:t});return b.createElement(Pwe,{key:"dot-".concat(S),option:n,dotProps:A,className:i})}),v={};return u&&d!=null&&(v.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(d,")")),b.createElement(_a,{zIndex:f},b.createElement(Yi,jy({className:r},v),y))}function jD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ND(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jD(Object(n),!0).forEach(function(r){Dwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dwe(e,t,n){return(t=Iwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iwe(e){var t=Lwe(e,"string");return typeof t=="symbol"?t:t+""}function Lwe(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 WU=0,$we={xAxis:{},yAxis:{},zAxis:{}},QU=or({name:"cartesianAxis",initialState:$we,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Yt()},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:Yt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Yt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Yt()},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:Yt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Yt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Yt()},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:Yt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Yt()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,o=i.widthHistory||[];if(o.length===3&&o[0]===o[2]&&r===o[1]&&r!==i.width&&Math.abs(r-((a=o[0])!==null&&a!==void 0?a:0))<=1)return;var u=[...o,r].slice(-3);e.yAxis[n]=ND(ND({},i),{},{width:r,widthHistory:u})}}}}),{addXAxis:Bwe,replaceXAxis:Uwe,removeXAxis:Fwe,addYAxis:qwe,replaceYAxis:Hwe,removeYAxis:Kwe,addZAxis:Vke,replaceZAxis:Zke,removeZAxis:Yke,updateYAxisWidth:Gwe}=QU.actions,Vwe=QU.reducer,Zwe=le([Jn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Ywe=le([Zwe,ds,fs],(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)}}),gC=()=>He(Ywe),Wwe=()=>He(V0e);function kD(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 CS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kD(Object(n),!0).forEach(function(r){Qwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qwe(e,t,n){return(t=Xwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xwe(e){var t=Jwe(e,"string");return typeof t=="symbol"?t:t+""}function Jwe(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 eSe=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var 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=CS(CS(CS({},u),fv(i)),XN(i)),f;return b.isValidElement(i)?f=b.cloneElement(i,d):typeof i=="function"?f=i(d):f=b.createElement(GU,d),b.createElement(Yi,{className:"recharts-active-dot",clipPath:o},f)};function CD(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=ar.activeDot}=e,u=He(Wf),d=Wwe();if(t==null||d==null)return null;var f=t.find(p=>d.includes(p.payload));return Xn(f)?null:b.createElement(_a,{zIndex:o},b.createElement(eSe,{point:f,childIndex:Number(u),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var tSe=e=>{var{chartData:t}=e,n=un(),r=yr();return b.useEffect(()=>r?()=>{}:(n(rD(t)),()=>{n(rD(void 0))}),[t,n,r]),null},_D={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},XU=or({name:"brush",initialState:_D,reducers:{setBrushSettings(e,t){return t.payload==null?_D:t.payload}}}),{setBrushSettings:Wke}=XU.actions,nSe=XU.reducer,rSe=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return{x:Math.min(n,i),y:Math.min(r,a),width:Math.abs(i-n),height:Math.abs(a-r)}},iSe=e=>{var{x1:t,y1:n,x2:r,y2:i}=e;return rSe({x:t,y:n},{x:r,y:i})};function aSe(e){return(e%180+180)%180}var sSe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=aSe(i),o=a*Math.PI/180,u=Math.atan(r/n),d=o>u&&o<Math.PI-u?r/Math.sin(o):n/Math.cos(o);return Math.abs(d)},oSe={dots:[],areas:[],lines:[]},JU=or({name:"referenceElements",initialState:oSe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Si(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=Si(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=Si(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:Qke,removeDot:Xke,addArea:Jke,removeArea:eCe,addLine:lSe,removeLine:cSe}=JU.actions,uSe=JU.reducer,e8=b.createContext(void 0),dSe=e=>{var{children:t}=e,[n]=b.useState("".concat(If("recharts"),"-clip")),r=gC();if(r==null)return null;var{x:i,y:a,width:o,height:u}=r;return b.createElement(e8.Provider,{value:n},b.createElement("defs",null,b.createElement("clipPath",{id:n},b.createElement("rect",{x:i,y:a,height:u,width:o}))),t)},fSe=()=>b.useContext(e8);class hSe{constructor(t){var{x:n,y:r}=t;this.xAxisScale=n,this.yAxisScale=r}map(t,n){var r,i,{position:a}=n;return{x:(r=this.xAxisScale.map(t.x,{position:a}))!==null&&r!==void 0?r:0,y:(i=this.yAxisScale.map(t.y,{position:a}))!==null&&i!==void 0?i:0}}mapWithFallback(t,n){var r,i,{position:a,fallback:o}=n,u,d;return o==="rangeMin"?u=this.yAxisScale.rangeMin():o==="rangeMax"?u=this.yAxisScale.rangeMax():u=0,o==="rangeMin"?d=this.xAxisScale.rangeMin():o==="rangeMax"?d=this.xAxisScale.rangeMax():d=0,{x:(r=this.xAxisScale.map(t.x,{position:a}))!==null&&r!==void 0?r:d,y:(i=this.yAxisScale.map(t.y,{position:a}))!==null&&i!==void 0?i:u}}isInRange(t){var{x:n,y:r}=t,i=n==null||this.xAxisScale.isInRange(n),a=r==null||this.yAxisScale.isInRange(r);return i&&a}}function AD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function OD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AD(Object(n),!0).forEach(function(r){pSe(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 pSe(e,t,n){return(t=mSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mSe(e){var t=gSe(e,"string");return typeof t=="symbol"?t:t+""}function gSe(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 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)}var ySe=(e,t)=>{var n;if(b.isValidElement(e))n=b.cloneElement(e,t);else if(typeof e=="function")n=e(t);else{if(!rt(t.x1)||!rt(t.y1)||!rt(t.x2)||!rt(t.y2))return null;n=b.createElement("line",Ny({},t,{className:"recharts-reference-line-line"}))}return n},vSe=(e,t,n,r,i,a)=>{var{x:o,width:u}=a,d=i.map(e,{position:n});if(!rt(d)||t==="discard"&&!i.isInRange(d))return null;var f=[{x:o+u,y:d},{x:o,y:d}];return r==="left"?f.reverse():f},bSe=(e,t,n,r,i,a)=>{var{y:o,height:u}=a,d=i.map(e,{position:n});if(!rt(d)||t==="discard"&&!i.isInRange(d))return null;var f=[{x:d,y:o+u},{x:d,y:o}];return r==="top"?f.reverse():f},xSe=(e,t,n,r)=>{var i=[r.mapWithFallback(e[0],{position:n,fallback:"rangeMin"}),r.mapWithFallback(e[1],{position:n,fallback:"rangeMax"})];return t==="discard"&&i.some(a=>!r.isInRange(a))?null:i},wSe=(e,t,n,r,i,a,o)=>{var{x:u,y:d,segment:f,ifOverflow:p}=o,m=Ai(u),y=Ai(d);return y?vSe(d,p,r,a,t,n):m?bSe(u,p,r,i,e,n):f!=null&&f.length===2?xSe(f,p,r,new hSe({x:e,y:t})):null};function SSe(e){var t=un();return b.useEffect(()=>(t(lSe(e)),()=>{t(cSe(e))})),null}function jSe(e){var{xAxisId:t,yAxisId:n,shape:r,className:i,ifOverflow:a}=e,o=yr(),u=fSe(),d=He(O=>ka(O,t)),f=He(O=>Ca(O,n)),p=He(O=>_u(O,"xAxis",t,o)),m=He(O=>_u(O,"yAxis",n,o)),y=yh();if(!u||!y||d==null||f==null||p==null||m==null)return null;var v=wSe(p,m,y,e.position,d.orientation,f.orientation,e);if(!v)return null;var w=v[0],S=v[1];if(w==null||S==null)return null;var{x:j,y:k}=w,{x:A,y:_}=S,C=a==="hidden"?"url(#".concat(u,")"):void 0,P=OD(OD({clipPath:C},Pr(e)),{},{x1:j,y1:k,x2:A,y2:_}),E=iSe({x1:j,y1:k,x2:A,y2:_});return b.createElement(_a,{zIndex:e.zIndex},b.createElement(Yi,{className:Ct("recharts-reference-line",i)},ySe(r,P),b.createElement(UU,Ny({},E,{lowerWidth:E.width,upperWidth:E.width}),b.createElement(qU,{label:e.label}),e.children)))}var NSe={ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",label:!1,stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle",zIndex:ar.line};function t8(e){var t=gr(e,NSe);return b.createElement(b.Fragment,null,b.createElement(SSe,{yAxisId:t.yAxisId,xAxisId:t.xAxisId,ifOverflow:t.ifOverflow,x:t.x,y:t.y,segment:t.segment}),b.createElement(jSe,t))}t8.displayName="ReferenceLine";function n8(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 kSe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return sSe(r,n)}function CSe(e,t,n){var r=n==="width",{x:i,y:a,width:o,height:u}=e;return t===1?{start:r?i:a,end:r?i+o:a+u}:{start:r?i+o:a+u,end:r?i:a}}function Xf(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 _Se(e,t){return n8(e,t+1)}function ASe(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:u}=t,d=0,f=1,p=o,m=function(){var w=r?.[d];if(w===void 0)return{v:n8(r,f)};var S=d,j,k=()=>(j===void 0&&(j=n(w,S)),j),A=w.coordinate,_=d===0||Xf(e,A,k,p,u);_||(d=0,p=o,f+=1),_&&(p=A+e*(k()/2+i),d+=f)},y;f<=a.length;)if(y=m(),y)return y.v;return[]}function OSe(e,t,n,r,i){var a=(r||[]).slice(),o=a.length;if(o===0)return[];for(var{start:u,end:d}=t,f=1;f<=o;f++){for(var p=(o-1)%f,m=u,y=!0,v=function(){var C=r[S];if(C==null)return 0;var P=S,E,O=()=>(E===void 0&&(E=n(C,P)),E),T=C.coordinate,M=S===p||Xf(e,T,O,m,d);if(!M)return y=!1,1;M&&(m=T+e*(O()/2+i))},w,S=p;S<o&&(w=v(),!(w!==0&&w===1));S+=f);if(y){for(var j=[],k=p;k<o;k+=f){var A=r[k];A!=null&&j.push(A)}return j}}return[]}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 tr(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){ESe(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 ESe(e,t,n){return(t=zSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zSe(e){var t=TSe(e,"string");return typeof t=="symbol"?t:t+""}function TSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PSe(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:u}=t,{end:d}=t,f=function(y){var v=a[y];if(v==null)return 1;var w=v,S,j=()=>(S===void 0&&(S=n(v,y)),S);if(y===o-1){var k=e*(w.coordinate+e*j()/2-d);a[y]=w=tr(tr({},w),{},{tickCoord:k>0?w.coordinate-k*e:w.coordinate})}else a[y]=w=tr(tr({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var A=Xf(e,w.tickCoord,j,u,d);A&&(d=w.tickCoord-e*(j()/2+i),a[y]=tr(tr({},w),{},{isShow:!0}))}},p=o-1;p>=0;p--)f(p);return a}function RSe(e,t,n,r,i,a){var o=(r||[]).slice(),u=o.length,{start:d,end:f}=t;if(a){var p=r[u-1];if(p!=null){var m=n(p,u-1),y=e*(p.coordinate+e*m/2-f);if(o[u-1]=p=tr(tr({},p),{},{tickCoord:y>0?p.coordinate-y*e:p.coordinate}),p.tickCoord!=null){var v=Xf(e,p.tickCoord,()=>m,d,f);v&&(f=p.tickCoord-e*(m/2+i),o[u-1]=tr(tr({},p),{},{isShow:!0}))}}}for(var w=a?u-1:u,S=function(A){var _=o[A];if(_==null)return 1;var C=_,P,E=()=>(P===void 0&&(P=n(_,A)),P);if(A===0){var O=e*(C.coordinate-e*E()/2-d);o[A]=C=tr(tr({},C),{},{tickCoord:O<0?C.coordinate-O*e:C.coordinate})}else o[A]=C=tr(tr({},C),{},{tickCoord:C.coordinate});if(C.tickCoord!=null){var T=Xf(e,C.tickCoord,E,d,f);T&&(d=C.tickCoord+e*(E()/2+i),o[A]=tr(tr({},C),{},{isShow:!0}))}},j=0;j<w;j++)S(j);return o}function yC(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:u,interval:d,tickFormatter:f,unit:p,angle:m}=e;if(!i||!i.length||!r)return[];if(Be(d)||wh.isSsr){var y;return(y=_Se(i,Be(d)?d:0))!==null&&y!==void 0?y:[]}var v=[],w=u==="top"||u==="bottom"?"width":"height",S=p&&w==="width"?jf(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=(P,E)=>{var O=typeof f=="function"?f(P.value,E):P.value;return w==="width"?kSe(jf(O,{fontSize:t,letterSpacing:n}),S,m):jf(O,{fontSize:t,letterSpacing:n})[w]},k=i[0],A=i[1],_=i.length>=2&&k!=null&&A!=null?wi(A.coordinate-k.coordinate):1,C=CSe(a,_,w);return d==="equidistantPreserveStart"?ASe(_,C,j,i,o):d==="equidistantPreserveEnd"?OSe(_,C,j,i,o):(d==="preserveStart"||d==="preserveStartEnd"?v=RSe(_,C,j,i,o,d==="preserveStartEnd"):v=PSe(_,C,j,i,o),v.filter(P=>P.isShow))}var MSe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(p=>{if(p){var m=p.getBoundingClientRect();m.width>o&&(o=m.width)}});var u=n?n.getBoundingClientRect().width:0,d=i+a,f=o+d+u+(n?r:0);return Math.round(f)}return 0},DSe={xAxis:{},yAxis:{}},r8=or({name:"renderedTicks",initialState:DSe,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:ISe,removeRenderedTicks:LSe}=r8.actions,$Se=r8.reducer,BSe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function USe(e,t){if(e==null)return{};var n,r,i=FSe(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 FSe(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 $l(){return $l=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},$l.apply(null,arguments)}function zD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hn(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){qSe(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 qSe(e,t,n){return(t=HSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HSe(e){var t=KSe(e,"string");return typeof t=="symbol"?t:t+""}function KSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var as={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:ar.axis};function GSe(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:u,otherSvgProps:d}=e;if(!u)return null;var f=hn(hn(hn({},d),Zi(u)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!o||a==="bottom"&&o);f=hn(hn({},f),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var m=+(a==="left"&&!o||a==="right"&&o);f=hn(hn({},f),{},{x1:t+m*r,y1:n,x2:t+m*r,y2:n+i})}return b.createElement("line",$l({},f,{className:Ct("recharts-cartesian-axis-line",gv(u,"className"))}))}function VSe(e,t,n,r,i,a,o,u,d){var f,p,m,y,v,w,S=u?-1:1,j=e.tickSize||o,k=Be(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=p=e.coordinate,y=n+ +!u*i,m=y-S*j,w=m-S*d,v=k;break;case"left":m=y=e.coordinate,p=t+ +!u*r,f=p-S*j,v=f-S*d,w=k;break;case"right":m=y=e.coordinate,p=t+ +u*r,f=p+S*j,v=f+S*d,w=k;break;default:f=p=e.coordinate,y=n+ +u*i,m=y+S*j,w=m+S*d,v=k;break}return{line:{x1:f,y1:m,x2:p,y2:y},tick:{x:v,y:w}}}function ZSe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function YSe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function WSe(e){var{option:t,tickProps:n,value:r}=e,i,a=Ct(n.className,"recharts-cartesian-axis-tick-value");if(b.isValidElement(t))i=b.cloneElement(t,hn(hn({},n),{},{className:a}));else if(typeof t=="function")i=t(hn(hn({},n),{},{className:a}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=Ct(o,fwe(t))),i=b.createElement(pC,$l({},n,{className:o}),r)}return i}function QSe(e){var{ticks:t,axisType:n,axisId:r}=e,i=un();return b.useEffect(()=>{if(r==null||n==null)return Bu;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(ISe({ticks:a,axisId:r,axisType:n})),()=>{i(LSe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var XSe=b.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:u,padding:d,tickTextProps:f,orientation:p,mirror:m,x:y,y:v,width:w,height:S,tickSize:j,tickMargin:k,fontSize:A,letterSpacing:_,getTicksConfig:C,events:P,axisType:E,axisId:O}=e,T=yC(hn(hn({},C),{},{ticks:n}),A,_),M=Zi(C),q=fv(r),$=DU(M.textAnchor)?M.textAnchor:ZSe(p,m),L=YSe(p,m),J={};typeof i=="object"&&(J=i);var ae=hn(hn({},M),{},{fill:"none"},J),Z=T.map(he=>hn({entry:he},VSe(he,y,v,w,S,p,j,m,k))),H=Z.map(he=>{var{entry:we,line:R}=he;return b.createElement(Yi,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(we.value,"-").concat(we.coordinate,"-").concat(we.tickCoord)},i&&b.createElement("line",$l({},ae,R,{className:Ct("recharts-cartesian-axis-tick-line",gv(i,"className"))})))}),Q=Z.map((he,we)=>{var R,U,{entry:F,tick:D}=he,Y=hn(hn(hn(hn({verticalAnchor:L},M),{},{textAnchor:$,stroke:"none",fill:a},D),{},{index:we,payload:F,visibleTicksCount:T.length,tickFormatter:o,padding:d},f),{},{angle:(R=(U=f?.angle)!==null&&U!==void 0?U:M.angle)!==null&&R!==void 0?R:0}),se=hn(hn({},Y),q);return b.createElement(Yi,$l({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(F.value,"-").concat(F.coordinate,"-").concat(F.tickCoord)},W$(P,F,we)),r&&b.createElement(WSe,{option:r,tickProps:se,value:"".concat(typeof o=="function"?o(F.value,we):F.value).concat(u||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(E,"-ticks")},b.createElement(QSe,{ticks:T,axisId:O,axisType:E}),Q.length>0&&b.createElement(_a,{zIndex:ar.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(E,"-tick-labels"),ref:t},Q)),H.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(E,"-tick-lines")},H))}),JSe=b.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:u,axisType:d,axisId:f}=e,p=USe(e,BSe),[m,y]=b.useState(""),[v,w]=b.useState(""),S=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return MSe({ticks:S.current,label:(k=e.labelRef)===null||k===void 0?void 0:k.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=b.useCallback(k=>{if(k){var A=k.getElementsByClassName("recharts-cartesian-axis-tick-value");S.current=A;var _=A[0];if(_){var C=window.getComputedStyle(_),P=C.fontSize,E=C.letterSpacing;(P!==m||E!==v)&&(y(P),w(E))}}},[m,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:b.createElement(_a,{zIndex:e.zIndex},b.createElement(Yi,{className:Ct("recharts-cartesian-axis",a)},b.createElement(GSe,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Zi(e)}),b.createElement(XSe,{ref:j,axisType:d,events:p,fontSize:m,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:u,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:f}),b.createElement(UU,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(qU,{label:e.label,labelRef:e.labelRef}),e.children)))}),vC=b.forwardRef((e,t)=>{var n=gr(e,as);return b.createElement(JSe,$l({},n,{ref:t}))});vC.displayName="CartesianAxis";var e1e=["x1","y1","x2","y2","key"],t1e=["offset"],n1e=["xAxisId","yAxisId"],r1e=["xAxisId","yAxisId"];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 ir(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){i1e(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 i1e(e,t,n){return(t=a1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a1e(e){var t=s1e(e,"string");return typeof t=="symbol"?t:t+""}function s1e(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 gl(){return gl=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},gl.apply(null,arguments)}function ky(e,t){if(e==null)return{};var n,r,i=o1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function o1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var l1e=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:u}=e;return b.createElement("rect",{x:r,y:i,ry:u,width:a,height:o,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function i8(e){var{option:t,lineItemProps:n}=e,r;if(b.isValidElement(t))r=b.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:o,x2:u,y2:d,key:f}=n,p=ky(n,e1e),m=(i=Zi(p))!==null&&i!==void 0?i:{},{offset:y}=m,v=ky(m,t1e);r=b.createElement("line",gl({},v,{x1:a,y1:o,x2:u,y2:d,fill:"none",key:f}))}return r}function c1e(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,u=ky(e,n1e),d=i.map((f,p)=>{var m=ir(ir({},u),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(p),index:p});return b.createElement(i8,{key:"line-".concat(p),option:r,lineItemProps:m})});return b.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function u1e(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,u=ky(e,r1e),d=i.map((f,p)=>{var m=ir(ir({},u),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(p),index:p});return b.createElement(i8,{option:r,lineItemProps:m,key:"line-".concat(p)})});return b.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function d1e(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,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,y)=>m-y);i!==f[0]&&f.unshift(0);var p=f.map((m,y)=>{var v=f[y+1],w=v==null,S=w?i+o-m:v-m;if(S<=0)return null;var j=y%t.length;return b.createElement("rect",{key:"react-".concat(y),y:m,x:r,height:S,width:a,stroke:"none",fill:t[j],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function f1e(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:u,verticalPoints:d}=e;if(!t||!n||!n.length)return null;var f=d.map(m=>Math.round(m+i-i)).sort((m,y)=>m-y);i!==f[0]&&f.unshift(0);var p=f.map((m,y)=>{var v=f[y+1],w=v==null,S=w?i+o-m:v-m;if(S<=0)return null;var j=y%n.length;return b.createElement("rect",{key:"react-".concat(y),x:m,y:a,width:S,height:u,stroke:"none",fill:n[j],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return b.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var h1e=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return q3(yC(ir(ir(ir({},as),n),{},{ticks:H3(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},p1e=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return q3(yC(ir(ir(ir({},as),n),{},{ticks:H3(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},m1e={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:ar.grid};function a8(e){var t=ck(),n=uk(),r=Q3(),i=ir(ir({},gr(e,m1e)),{},{x:Be(e.x)?e.x:r.left,y:Be(e.y)?e.y:r.top,width:Be(e.width)?e.width:r.width,height:Be(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:u,y:d,width:f,height:p,syncWithTicks:m,horizontalValues:y,verticalValues:v}=i,w=yr(),S=He(M=>HM(M,"xAxis",a,w)),j=He(M=>HM(M,"yAxis",o,w));if(!xa(f)||!xa(p)||!Be(u)||!Be(d))return null;var k=i.verticalCoordinatesGenerator||h1e,A=i.horizontalCoordinatesGenerator||p1e,{horizontalPoints:_,verticalPoints:C}=i;if((!_||!_.length)&&typeof A=="function"){var P=y&&y.length,E=A({yAxis:j?ir(ir({},j),{},{ticks:P?y:j.ticks}):void 0,width:t??f,height:n??p,offset:r},P?!0:m);Yg(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof E,"]")),Array.isArray(E)&&(_=E)}if((!C||!C.length)&&typeof k=="function"){var O=v&&v.length,T=k({xAxis:S?ir(ir({},S),{},{ticks:O?v:S.ticks}):void 0,width:t??f,height:n??p,offset:r},O?!0:m);Yg(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof T,"]")),Array.isArray(T)&&(C=T)}return b.createElement(_a,{zIndex:i.zIndex},b.createElement("g",{className:"recharts-cartesian-grid"},b.createElement(l1e,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),b.createElement(d1e,gl({},i,{horizontalPoints:_})),b.createElement(f1e,gl({},i,{verticalPoints:C})),b.createElement(c1e,gl({},i,{offset:r,horizontalPoints:_,xAxis:S,yAxis:j})),b.createElement(u1e,gl({},i,{offset:r,verticalPoints:C,xAxis:S,yAxis:j}))))}a8.displayName="CartesianGrid";var g1e={},s8=or({name:"errorBars",initialState:g1e,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:tCe,replaceErrorBar:nCe,removeErrorBar:rCe}=s8.actions,y1e=s8.reducer;function o8(e,t){var n,r,i=He(f=>ka(f,e)),a=He(f=>Ca(f,t)),o=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:Tn.allowDataOverflow,u=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Pn.allowDataOverflow,d=o||u;return{needClip:d,needClipX:o,needClipY:u}}function v1e(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=gC(),{needClipX:a,needClipY:o,needClip:u}=o8(t,n);if(!u||!i)return null;var{x:d,y:f,width:p,height:m}=i;return b.createElement("clipPath",{id:"clipPath-".concat(r)},b.createElement("rect",{x:a?d:d-p/2,y:o?f:f-m/2,width:a?p:p*2,height:o?m:m*2}))}function b1e(e){var t=fv(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),u=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(u)||u<0)&&(u=r),{r:o,strokeWidth:u}}return{r:n,strokeWidth:r}}function bC(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:WU}function xC(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:WU}var l8=(e,t,n)=>eU(e,"xAxis",bC(e,t),n),c8=(e,t,n)=>J6(e,"xAxis",bC(e,t),n),u8=(e,t,n)=>eU(e,"yAxis",xC(e,t),n),d8=(e,t,n)=>J6(e,"yAxis",xC(e,t),n),x1e=le([nn,l8,u8,c8,d8],(e,t,n,r,i)=>Na(e,"xAxis")?Zg(t,r,!1):Zg(n,i,!1)),w1e=(e,t)=>t,f8=le([w6,w1e],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),h8=e=>{var t=nn(e),n=Na(t,"xAxis");return n?"yAxis":"xAxis"},S1e=(e,t)=>{var n=h8(e);return n==="yAxis"?xC(e,t):bC(e,t)},j1e=(e,t,n)=>z6(e,h8(e),S1e(e,t),n),N1e=le([f8,j1e],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=Nk(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,o=a?.find(u=>u.key===i);if(o!=null)return o.map(u=>[u[0],u[1]])}}}),k1e=le([nn,l8,u8,c8,d8,N1e,qpe,x1e,f8,Xpe],(e,t,n,r,i,a,o,u,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:y}=o;if(!(d==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||u==null)){var{data:v}=d,w;if(v&&v.length>0?w=v:w=p?.slice(m,y+1),w!=null)return K1e({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:m,areaSettings:d,stackedData:a,displayedData:w,chartBaseValue:f,bandSize:u})}}),C1e=["id"],_1e=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function kl(){return kl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kl.apply(null,arguments)}function p8(e,t){if(e==null)return{};var n,r,i=A1e(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 A1e(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 PD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function iu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PD(Object(n),!0).forEach(function(r){O1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function O1e(e,t,n){return(t=E1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E1e(e){var t=z1e(e,"string");return typeof t=="symbol"?t:t+""}function z1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cy(e,t){return e&&e!=="none"?e:t}var T1e=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:Cy(r,i),value:K3(n,t),payload:e}]},P1e=b.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:u,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:Bu,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:K3(o,t),hide:u,type:f,color:Cy(r,a),unit:d,graphicalItemId:p}};return b.createElement(hwe,{tooltipEntrySettings:m})});function R1e(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,u=Zi(r);return b.createElement(Mwe,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:u,needClip:i,clipPathId:t})}function M1e(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var o,u,d={x:(o=a.x)!==null&&o!==void 0?o:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return iu(iu({},d),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return b.createElement(swe,{value:t?i:void 0},n)}function RD(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:o,type:u,stroke:d,connectNulls:f,isRange:p}=a,{id:m}=a,y=p8(a,C1e),v=Zi(y),w=Pr(y);return b.createElement(b.Fragment,null,t?.length>1&&b.createElement(Yi,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},b.createElement(ig,kl({},w,{id:m,points:t,connectNulls:f,type:u,baseLine:n,layout:o,stroke:"none",className:"recharts-area-area"})),d!=="none"&&b.createElement(ig,kl({},v,{className:"recharts-area-curve",layout:o,type:u,connectNulls:f,fill:"none",points:t})),d!=="none"&&p&&Array.isArray(n)&&b.createElement(ig,kl({},v,{className:"recharts-area-curve",layout:o,type:u,connectNulls:f,fill:"none",points:n}))),b.createElement(R1e,{points:t,props:y,clipPathId:i}))}function D1e(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=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(!rt(u)||!rt(d))return null;var f=r*Math.abs(u-d),p=Math.max(...a.map(m=>m.x||0));return Be(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.x||0),p)),Be(p)?b.createElement("rect",{x:0,y:u<d?u:u-f,width:p+(o?parseInt("".concat(o),10):1),height:Math.floor(f)}):null}function I1e(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=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(!rt(u)||!rt(d))return null;var f=r*Math.abs(u-d),p=Math.max(...a.map(m=>m.y||0));return Be(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.y||0),p)),Be(p)?b.createElement("rect",{x:u<d?u:u-f,y:0,width:f,height:Math.floor(p+(o?parseInt("".concat(o),10):1))}):null}function L1e(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?b.createElement(D1e,{alpha:t,points:r,baseLine:i,strokeWidth:a}):b.createElement(I1e,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function $1e(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:o,baseLine:u,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,onAnimationStart:y,onAnimationEnd:v}=r,w=b.useMemo(()=>({points:o,baseLine:u}),[o,u]),S=fB(w,"recharts-area-"),j=dk(),[k,A]=b.useState(!1),_=!k,C=b.useCallback(()=>{typeof v=="function"&&v(),A(!1)},[v]),P=b.useCallback(()=>{typeof y=="function"&&y(),A(!0)},[y]);if(j==null)return null;var E=i.current,O=a.current;return b.createElement(M1e,{showLabels:_,points:o},r.children,b.createElement(dB,{animationId:S,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:C,onAnimationStart:P,key:S},T=>{if(E){var M=E.length/o.length,q=T===1?o:o.map((L,J)=>{var ae=Math.floor(J*M);if(E[ae]){var Z=E[ae];return iu(iu({},L),{},{x:ua(Z.x,L.x,T),y:ua(Z.y,L.y,T)})}return L}),$;return Be(u)?$=ua(O,u,T):Xn(u)||ba(u)?$=ua(O,0,T):$=u.map((L,J)=>{var ae=Math.floor(J*M);if(Array.isArray(O)&&O[ae]){var Z=O[ae];return iu(iu({},L),{},{x:ua(Z.x,L.x,T),y:ua(Z.y,L.y,T)})}return L}),T>0&&(i.current=q,a.current=$),b.createElement(RD,{points:q,baseLine:$,needClip:t,clipPathId:n,props:r})}return T>0&&(i.current=o,a.current=u),b.createElement(Yi,null,d&&b.createElement("defs",null,b.createElement("clipPath",{id:"animationClipPath-".concat(n)},b.createElement(L1e,{alpha:T,points:o,baseLine:u,layout:j,strokeWidth:r.strokeWidth}))),b.createElement(Yi,{clipPath:"url(#animationClipPath-".concat(n,")")},b.createElement(RD,{points:o,baseLine:u,needClip:t,clipPathId:n,props:r})))}),b.createElement(cwe,{label:r.label}))}function B1e(e){var{needClip:t,clipPathId:n,props:r}=e,i=b.useRef(null),a=b.useRef();return b.createElement($1e,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class U1e extends b.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:o,needClip:u,xAxisId:d,yAxisId:f,width:p,height:m,id:y,baseLine:v,zIndex:w}=this.props;if(t)return null;var S=Ct("recharts-area",i),j=y,{r:k,strokeWidth:A}=b1e(n),_=ZU(n),C=k*2+A,P=u?"url(#clipPath-".concat(_?"":"dots-").concat(j,")"):void 0;return b.createElement(_a,{zIndex:w},b.createElement(Yi,{className:S},u&&b.createElement("defs",null,b.createElement(v1e,{clipPathId:j,xAxisId:d,yAxisId:f}),!_&&b.createElement("clipPath",{id:"clipPath-dots-".concat(j)},b.createElement("rect",{x:o-C/2,y:a-C/2,width:p+C,height:m+C}))),b.createElement(B1e,{needClip:u,clipPathId:j,props:this.props})),b.createElement(CD,{points:r,mainColor:Cy(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:P}),this.props.isRange&&Array.isArray(v)&&b.createElement(CD,{points:v,mainColor:Cy(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:P}))}}var F1e={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:ar.area};function q1e(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:o,dot:u,fill:d,fillOpacity:f,hide:p,isAnimationActive:m,legendType:y,stroke:v,xAxisId:w,yAxisId:S}=e,j=p8(e,_1e),k=Uu(),A=jU(),{needClip:_}=o8(w,S),C=yr(),{points:P,isRange:E,baseLine:O}=(t=He(J=>k1e(J,e.id,C)))!==null&&t!==void 0?t:{},T=gC();if(k!=="horizontal"&&k!=="vertical"||T==null||A!=="AreaChart"&&A!=="ComposedChart")return null;var{height:M,width:q,x:$,y:L}=T;return!P||!P.length?null:b.createElement(U1e,kl({},j,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:O,connectNulls:o,dot:u,fill:d,fillOpacity:f,height:M,hide:p,layout:k,isAnimationActive:m,isRange:E,legendType:y,needClip:_,points:P,stroke:v,width:q,left:$,top:L,xAxisId:w,yAxisId:S}))}var H1e=(e,t,n,r,i)=>{var a=n??t;if(Be(a))return a;var o=e==="horizontal"?i:r,u=o.scale.domain();if(o.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 K1e(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:o,xAxis:u,yAxis:d,displayedData:f,dataStartIndex:p,xAxisTicks:m,yAxisTicks:y,bandSize:v}=e,w=i&&i.length,S=H1e(a,o,n,u,d),j=a==="horizontal",k=!1,A=f.map((C,P)=>{var E,O,T,M;if(w)M=i[p+P];else{var q=$n(C,r);Array.isArray(q)?(M=q,k=!0):M=[S,q]}var $=(E=(O=M)===null||O===void 0?void 0:O[1])!==null&&E!==void 0?E:null,L=$==null||w&&!t&&$n(C,r)==null;if(j){var J;return{x:LP({axis:u,ticks:m,bandSize:v,entry:C,index:P}),y:L?null:(J=d.scale.map($))!==null&&J!==void 0?J:null,value:M,payload:C}}return{x:L?null:(T=u.scale.map($))!==null&&T!==void 0?T:null,y:LP({axis:d,ticks:y,bandSize:v,entry:C,index:P}),value:M,payload:C}}),_;return w||k?_=A.map(C=>{var P,E=Array.isArray(C.value)?C.value[0]:null;if(j){var O;return{x:C.x,y:E!=null&&C.y!=null&&(O=d.scale.map(E))!==null&&O!==void 0?O:null,payload:C.payload}}return{x:E!=null&&(P=u.scale.map(E))!==null&&P!==void 0?P:null,y:C.y,payload:C.payload}}):_=j?d.scale.map(S):u.scale.map(S),{points:A,baseLine:_??0,isRange:k}}function G1e(e){var t=gr(e,F1e),n=yr();return b.createElement(bwe,{id:t.id,type:"area"},r=>b.createElement(b.Fragment,null,b.createElement(pwe,{legendPayload:T1e(t)}),b.createElement(P1e,{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}),b.createElement(Cwe,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:Tde(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),b.createElement(q1e,kl({},t,{id:r}))))}var yl=b.memo(G1e,xh);yl.displayName="Area";var V1e=["domain","range"],Z1e=["domain","range"];function MD(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 DD(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 m8(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=MD(e,V1e),{domain:a,range:o}=t,u=MD(t,Z1e);return!DD(n,a)||!DD(r,o)?!1:xh(i,u)}var W1e=["type"],Q1e=["dangerouslySetInnerHTML","ticks","scale"],X1e=["id","scale"];function gj(){return gj=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},gj.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 LD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ID(Object(n),!0).forEach(function(r){J1e(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 J1e(e,t,n){return(t=eje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eje(e){var t=tje(e,"string");return typeof t=="symbol"?t:t+""}function tje(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 yj(e,t){if(e==null)return{};var n,r,i=nje(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 nje(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 rje(e){var t=un(),n=b.useRef(null),r=dk(),{type:i}=e,a=yj(e,W1e),o=Iv(r,"xAxis",i),u=b.useMemo(()=>{if(o!=null)return LD(LD({},a),{},{type:o})},[a,o]);return b.useLayoutEffect(()=>{u!=null&&(n.current===null?t(Bwe(u)):n.current!==u&&t(Uwe({prev:n.current,next:u})),n.current=u)},[u,t]),b.useLayoutEffect(()=>()=>{n.current&&(t(Fwe(n.current)),n.current=null)},[t]),null}var ije=e=>{var{xAxisId:t,className:n}=e,r=He(V3),i=yr(),a="xAxis",o=He(k=>X6(k,a,t,i)),u=He(k=>Ave(k,t)),d=He(k=>Rve(k,t)),f=He(k=>y6(k,t));if(u==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:p,ticks:m,scale:y}=e,v=yj(e,Q1e),{id:w,scale:S}=f,j=yj(f,X1e);return b.createElement(vC,gj({},v,j,{x:d.x,y:d.y,width:u.width,height:u.height,className:Ct("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:o,axisType:a,axisId:t}))},aje={allowDataOverflow:Tn.allowDataOverflow,allowDecimals:Tn.allowDecimals,allowDuplicatedCategory:Tn.allowDuplicatedCategory,angle:Tn.angle,axisLine:as.axisLine,height:Tn.height,hide:!1,includeHidden:Tn.includeHidden,interval:Tn.interval,label:!1,minTickGap:Tn.minTickGap,mirror:Tn.mirror,orientation:Tn.orientation,padding:Tn.padding,reversed:Tn.reversed,scale:Tn.scale,tick:Tn.tick,tickCount:Tn.tickCount,tickLine:as.tickLine,tickSize:as.tickSize,type:Tn.type,niceTicks:Tn.niceTicks,xAxisId:0},sje=e=>{var t=gr(e,aje);return b.createElement(b.Fragment,null,b.createElement(rje,{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}),b.createElement(ije,t))},Jf=b.memo(sje,m8);Jf.displayName="XAxis";var oje=["type"],lje=["dangerouslySetInnerHTML","ticks","scale"],cje=["id","scale"];function vj(){return vj=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},vj.apply(null,arguments)}function $D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function BD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$D(Object(n),!0).forEach(function(r){uje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$D(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uje(e,t,n){return(t=dje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dje(e){var t=fje(e,"string");return typeof t=="symbol"?t:t+""}function fje(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 bj(e,t){if(e==null)return{};var n,r,i=hje(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function hje(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function pje(e){var t=un(),n=b.useRef(null),r=dk(),{type:i}=e,a=bj(e,oje),o=Iv(r,"yAxis",i),u=b.useMemo(()=>{if(o!=null)return BD(BD({},a),{},{type:o})},[o,a]);return b.useLayoutEffect(()=>{u!=null&&(n.current===null?t(qwe(u)):n.current!==u&&t(Hwe({prev:n.current,next:u})),n.current=u)},[u,t]),b.useLayoutEffect(()=>()=>{n.current&&(t(Kwe(n.current)),n.current=null)},[t]),null}function mje(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=b.useRef(null),o=b.useRef(null),u=He(V3),d=yr(),f=un(),p="yAxis",m=He(E=>Ive(E,t)),y=He(E=>Dve(E,t)),v=He(E=>X6(E,p,t,d)),w=He(E=>v6(E,t));if(b.useLayoutEffect(()=>{if(!(r!=="auto"||!m||mC(i)||b.isValidElement(i)||w==null)){var E=a.current;if(E){var O=E.getCalculatedWidth();Math.round(m.width)!==Math.round(O)&&f(Gwe({id:t,width:O}))}}},[v,m,f,i,t,r,w]),m==null||y==null||w==null)return null;var{dangerouslySetInnerHTML:S,ticks:j,scale:k}=e,A=bj(e,lje),{id:_,scale:C}=w,P=bj(w,cje);return b.createElement(vC,vj({},A,P,{ref:a,labelRef:o,x:y.x,y:y.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:m.width,height:m.height,className:Ct("recharts-".concat(p," ").concat(p),n),viewBox:u,ticks:v,axisType:p,axisId:t}))}var gje={allowDataOverflow:Pn.allowDataOverflow,allowDecimals:Pn.allowDecimals,allowDuplicatedCategory:Pn.allowDuplicatedCategory,angle:Pn.angle,axisLine:as.axisLine,hide:!1,includeHidden:Pn.includeHidden,interval:Pn.interval,label:!1,minTickGap:Pn.minTickGap,mirror:Pn.mirror,orientation:Pn.orientation,padding:Pn.padding,reversed:Pn.reversed,scale:Pn.scale,tick:Pn.tick,tickCount:Pn.tickCount,tickLine:as.tickLine,tickSize:as.tickSize,type:Pn.type,niceTicks:Pn.niceTicks,width:Pn.width,yAxisId:0},yje=e=>{var t=gr(e,gje);return b.createElement(b.Fragment,null,b.createElement(pje,{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}),b.createElement(mje,t))},eh=b.memo(yje,m8);eh.displayName="YAxis";var vje=(e,t)=>t,wC=le([vje,nn,PB,Un,yU,ps,abe,Jn],fbe);function bje(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function SC(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(bje(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(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=>o(u.clientX,u.clientY)):o(e.clientX,e.clientY)}var g8=Qr("mouseClick"),y8=mh();y8.startListening({actionCreator:g8,effect:(e,t)=>{var n=e.payload,r=wC(t.getState(),SC(n));r?.activeIndex!=null&&t.dispatch(Xve({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var xj=Qr("mouseMove"),v8=mh(),Kc=null,Jo=null,_S=null;v8.startListening({actionCreator:xj,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a?.includes("mousemove");Kc!==null&&(cancelAnimationFrame(Kc),Kc=null),Jo!==null&&(typeof i!="number"||!o)&&(clearTimeout(Jo),Jo=null),_S=SC(n);var u=()=>{var d=t.getState(),f=Oh(d,d.tooltip.settings.shared);if(!_S){Kc=null,Jo=null;return}if(f==="axis"){var p=wC(d,_S);p?.activeIndex!=null?t.dispatch(oU({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(sU())}Kc=null,Jo=null};if(!o){u();return}i==="raf"?Kc=requestAnimationFrame(u):typeof i=="number"&&Jo===null&&(Jo=setTimeout(u,i))}});function xje(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 UD={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},b8=or({name:"rootProps",initialState:UD,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:UD.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}}}),wje=b8.reducer,{updateOptions:Sje}=b8.actions,jje=null,Nje={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)},x8=or({name:"polarOptions",initialState:jje,reducers:Nje}),{updatePolarOptions:iCe}=x8.actions,kje=x8.reducer,w8=Qr("keyDown"),S8=Qr("focus"),j8=Qr("blur"),Wv=mh(),Gc=null,el=null,$m=null;Wv.startListening({actionCreator:w8,effect:(e,t)=>{$m=e.payload,Gc!==null&&(cancelAnimationFrame(Gc),Gc=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 o=()=>{try{var u=t.getState(),d=u.rootProps.accessibilityLayer!==!1;if(!d)return;var{keyboardInteraction:f}=u.tooltip,p=$m;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var m=Sf(f,Ll(u),Cu(u),Au(u)),y=m==null?-1:Number(m),v=!Number.isFinite(y)||y<0,w=ps(u),S=Ll(u),j=Oh(u,u.tooltip.settings.shared);if(p==="Enter"){if(v)return;var k=xy(u,j,"hover",String(f.index));t.dispatch(by({active:!f.active,activeIndex:f.index,activeCoordinate:k}));return}var A=Fve(u),_=A==="left-to-right"?1:-1,C=p==="ArrowRight"?1:-1,P;if(v){var E=Cu(u),O=Au(u),T=C*_,M=ae=>({active:!1,index:String(ae),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(P=-1,T>0){for(var q=0;q<S.length;q++)if(Sf(M(q),S,E,O)!=null){P=q;break}}else for(var $=S.length-1;$>=0;$--)if(Sf(M($),S,E,O)!=null){P=$;break}if(P<0)return}else{P=y+C*_;var L=w?.length||S.length;if(L===0||P>=L||P<0)return}var J=xy(u,j,"hover",String(P));t.dispatch(by({active:!0,activeIndex:P.toString(),activeCoordinate:J}))}finally{Gc=null,el=null}};if(!a){o();return}r==="raf"?Gc=requestAnimationFrame(o):typeof r=="number"&&el===null&&(o(),$m=null,el=setTimeout(()=>{$m?o():(el=null,Gc=null)},r))}});Wv.startListening({actionCreator:S8,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var a="0",o=Oh(n,n.tooltip.settings.shared),u=xy(n,o,"hover",String(a));t.dispatch(by({active:!0,activeIndex:a,activeCoordinate:u}))}}}});Wv.startListening({actionCreator:j8,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(by({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function N8(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 gi=Qr("externalEvent"),k8=mh(),Bm=new Map,of=new Map,AS=new Map;k8.startListening({actionCreator:gi,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=N8(r);AS.set(i,{handler:n,reactEvent:a});var o=Bm.get(i);o!==void 0&&(cancelAnimationFrame(o),Bm.delete(i));var u=t.getState(),{throttleDelay:d,throttledEvents:f}=u.eventSettings,p=f,m=p==="all"||p?.includes(i),y=of.get(i);y!==void 0&&(typeof d!="number"||!m)&&(clearTimeout(y),of.delete(i));var v=()=>{var j=AS.get(i);try{if(!j)return;var{handler:k,reactEvent:A}=j,_=t.getState(),C={activeCoordinate:H0e(_),activeDataKey:U0e(_),activeIndex:Wf(_),activeLabel:xU(_),activeTooltipIndex:Wf(_),isTooltipActive:K0e(_)};k&&k(C,A)}finally{Bm.delete(i),of.delete(i),AS.delete(i)}};if(!m){v();return}if(d==="raf"){var w=requestAnimationFrame(v);Bm.set(i,w)}else if(typeof d=="number"){if(!of.has(i)){v();var S=setTimeout(v,d);of.set(i,S)}}else v()}}});var Cje=le([Yu],e=>e.tooltipItemPayloads),_je=le([Cje,(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)}}}),C8=Qr("touchMove"),_8=mh(),tl=null,Hs=null,FD=null,lf=null;_8.startListening({actionCreator:C8,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){lf=N8(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");tl!==null&&(cancelAnimationFrame(tl),tl=null),Hs!==null&&(typeof i!="number"||!o)&&(clearTimeout(Hs),Hs=null),FD=Array.from(n.touches).map(d=>SC({clientX:d.clientX,clientY:d.clientY,currentTarget:n.currentTarget}));var u=()=>{if(lf!=null){var d=t.getState(),f=Oh(d,d.tooltip.settings.shared);if(f==="axis"){var p,m=(p=FD)===null||p===void 0?void 0:p[0];if(m==null){tl=null,Hs=null;return}var y=wC(d,m);y?.activeIndex!=null&&t.dispatch(oU({activeIndex:y.activeIndex,activeDataKey:void 0,activeCoordinate:y.activeCoordinate}))}else if(f==="item"){var v,w=lf.touches[0];if(document.elementFromPoint==null||w==null)return;var S=document.elementFromPoint(w.clientX,w.clientY);if(!S||!S.getAttribute)return;var j=S.getAttribute($de),k=(v=S.getAttribute(Bde))!==null&&v!==void 0?v:void 0,A=Wl(d).find(P=>P.id===k);if(j==null||A==null||k==null)return;var{dataKey:_}=A,C=_je(d,j,k);t.dispatch(Qve({activeDataKey:_,activeIndex:j,activeCoordinate:C,activeGraphicalItemId:k}))}tl=null,Hs=null}};if(!o){u();return}i==="raf"?tl=requestAnimationFrame(u):typeof i=="number"&&Hs===null&&(u(),lf=null,Hs=setTimeout(()=>{lf?u():(Hs=null,tl=null)},i))}}});var A8={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},O8=or({name:"eventSettings",initialState:A8,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:Aje}=O8.actions,Oje=O8.reducer,Eje=p3({brush:nSe,cartesianAxis:Vwe,chartData:qbe,errorBars:y1e,eventSettings:Oje,graphicalItems:Nwe,layout:jde,legend:Pfe,options:Lbe,polarAxis:dwe,polarOptions:kje,referenceElements:uSe,renderedTicks:$Se,rootProps:wje,tooltip:Jve,zIndex:kbe}),zje=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Zue({reducer:Eje,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([y8.middleware,v8.middleware,Wv.middleware,k8.middleware,_8.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(O3({type:"raf"}))},devTools:{serialize:{replacer:xje},name:"recharts-".concat(n)}})};function Tje(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=yr(),a=b.useRef(null);if(i)return n;a.current==null&&(a.current=zje(t,r));var o=ek;return b.createElement(Qfe,{context:o,store:a.current},n)}function Pje(e){var{layout:t,margin:n}=e,r=un(),i=yr();return b.useEffect(()=>{i||(r(xde(t)),r(bde(n)))},[r,i,t,n]),null}var Rje=b.memo(Pje,xh);function Mje(e){var t=un();return b.useEffect(()=>{t(Sje(e))},[t,e]),null}var Dje=e=>{var t=un();return b.useEffect(()=>{t(Aje(e))},[t,e]),null},Ije=b.memo(Dje,xh);function qD(e){var{zIndex:t,isPanorama:n}=e,r=b.useRef(null),i=un();return b.useLayoutEffect(()=>(r.current&&i(jbe({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Nbe({zIndex:t,isPanorama:n}))}),[i,t,n]),b.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function HD(e){var{children:t,isPanorama:n}=e,r=He(pbe);if(!r||r.length===0)return t;var i=r.filter(o=>o<0),a=r.filter(o=>o>0);return b.createElement(b.Fragment,null,i.map(o=>b.createElement(qD,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>b.createElement(qD,{key:o,zIndex:o,isPanorama:n})))}var Lje=["children"];function $je(e,t){if(e==null)return{};var n,r,i=Bje(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 Bje(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 _y(){return _y=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},_y.apply(null,arguments)}var Uje={width:"100%",height:"100%",display:"block"},Fje=b.forwardRef((e,t)=>{var n=ck(),r=uk(),i=oB();if(!xa(n)||!xa(r))return null;var{children:a,otherAttributes:o,title:u,desc:d}=e,f,p;return o!=null&&(typeof o.tabIndex=="number"?f=o.tabIndex:f=i?0:void 0,typeof o.role=="string"?p=o.role:p=i?"application":void 0),b.createElement(KN,_y({},o,{title:u,desc:d,role:p,tabIndex:f,width:n,height:r,style:Uje,ref:t}),a)}),qje=e=>{var{children:t}=e,n=He(Ev);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return b.createElement(KN,{width:r,height:i,x:o,y:a},t)},KD=b.forwardRef((e,t)=>{var{children:n}=e,r=$je(e,Lje),i=yr();return i?b.createElement(qje,null,b.createElement(HD,{isPanorama:!0},n)):b.createElement(Fje,_y({ref:t},r),b.createElement(HD,{isPanorama:!1},n))});function Hje(){var e=un(),[t,n]=b.useState(null),r=He(Lde);return b.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;rt(a)&&a!==r&&e(Sde(a))}},[t,e,r]),n}function GD(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 Kje(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GD(Object(n),!0).forEach(function(r){Gje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gje(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=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 fo(){return fo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fo.apply(null,arguments)}var Yje=()=>(Xbe(),null);function Ay(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var Wje=b.forwardRef((e,t)=>{var n,r,i=b.useRef(null),[a,o]=b.useState({containerWidth:Ay((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Ay((r=e.style)===null||r===void 0?void 0:r.height)}),u=b.useCallback((f,p)=>{o(m=>{var y=Math.round(f),v=Math.round(p);return m.containerWidth===y&&m.containerHeight===v?m:{containerWidth:y,containerHeight:v}})},[]),d=b.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 y=w=>{var S=w[0];if(S!=null){var{width:j,height:k}=S.contentRect;u(j,k)}},v=new ResizeObserver(y);v.observe(f),i.current=v}},[t,u]);return b.useEffect(()=>()=>{var f=i.current;f?.disconnect()},[u]),b.createElement(b.Fragment,null,b.createElement(vh,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",fo({ref:d},e)))}),Qje=b.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=b.useState({containerWidth:Ay(n),containerHeight:Ay(r)}),o=b.useCallback((d,f)=>{a(p=>{var m=Math.round(d),y=Math.round(f);return p.containerWidth===m&&p.containerHeight===y?p:{containerWidth:m,containerHeight:y}})},[]),u=b.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:f,height:p}=d.getBoundingClientRect();o(f,p)}},[t,o]);return b.createElement(b.Fragment,null,b.createElement(vh,{width:i.containerWidth,height:i.containerHeight}),b.createElement("div",fo({ref:u},e)))}),Xje=b.forwardRef((e,t)=>{var{width:n,height:r}=e;return b.createElement(b.Fragment,null,b.createElement(vh,{width:n,height:r}),b.createElement("div",fo({ref:t},e)))}),Jje=b.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?b.createElement(Qje,fo({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?b.createElement(Xje,fo({},e,{width:n,height:r,ref:t})):b.createElement(b.Fragment,null,b.createElement(vh,{width:n,height:r}),b.createElement("div",fo({ref:t},e)))});function eNe(e){return e?Wje:Jje}var tNe=b.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:u,onMouseDown:d,onMouseEnter:f,onMouseLeave:p,onMouseMove:m,onMouseUp:y,onTouchEnd:v,onTouchMove:w,onTouchStart:S,style:j,width:k,responsive:A,dispatchTouchEvents:_=!0}=e,C=b.useRef(null),P=un(),[E,O]=b.useState(null),[T,M]=b.useState(null),q=Hje(),$=ok(),L=$?.width>0?$.width:k,J=$?.height>0?$.height:i,ae=b.useCallback(ue=>{q(ue),typeof t=="function"&&t(ue),O(ue),M(ue),ue!=null&&(C.current=ue)},[q,t,O,M]),Z=b.useCallback(ue=>{P(g8(ue)),P(gi({handler:a,reactEvent:ue}))},[P,a]),H=b.useCallback(ue=>{P(xj(ue)),P(gi({handler:f,reactEvent:ue}))},[P,f]),Q=b.useCallback(ue=>{P(sU()),P(gi({handler:p,reactEvent:ue}))},[P,p]),he=b.useCallback(ue=>{P(xj(ue)),P(gi({handler:m,reactEvent:ue}))},[P,m]),we=b.useCallback(()=>{P(S8())},[P]),R=b.useCallback(()=>{P(j8())},[P]),U=b.useCallback(ue=>{P(w8(ue.key))},[P]),F=b.useCallback(ue=>{P(gi({handler:o,reactEvent:ue}))},[P,o]),D=b.useCallback(ue=>{P(gi({handler:u,reactEvent:ue}))},[P,u]),Y=b.useCallback(ue=>{P(gi({handler:d,reactEvent:ue}))},[P,d]),se=b.useCallback(ue=>{P(gi({handler:y,reactEvent:ue}))},[P,y]),ie=b.useCallback(ue=>{P(gi({handler:S,reactEvent:ue}))},[P,S]),fe=b.useCallback(ue=>{_&&P(C8(ue)),P(gi({handler:w,reactEvent:ue}))},[P,_,w]),je=b.useCallback(ue=>{P(gi({handler:v,reactEvent:ue}))},[P,v]),ee=eNe(A);return b.createElement(AU.Provider,{value:E},b.createElement(_$.Provider,{value:T},b.createElement(ee,{width:L??j?.width,height:J??j?.height,className:Ct("recharts-wrapper",r),style:Kje({position:"relative",cursor:"default",width:L,height:J},j),onClick:Z,onContextMenu:F,onDoubleClick:D,onFocus:we,onBlur:R,onKeyDown:U,onMouseDown:Y,onMouseEnter:H,onMouseLeave:Q,onMouseMove:he,onMouseUp:se,onTouchEnd:je,onTouchMove:fe,onTouchStart:ie,ref:ae},b.createElement(Yje,null),n)))}),nNe=["width","height","responsive","children","className","style","compact","title","desc"];function rNe(e,t){if(e==null)return{};var n,r,i=iNe(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 iNe(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 aNe=b.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:u,compact:d,title:f,desc:p}=e,m=rNe(e,nNe),y=Zi(m);return d?b.createElement(b.Fragment,null,b.createElement(vh,{width:n,height:r}),b.createElement(KD,{otherAttributes:y,title:f,desc:p},a)):b.createElement(tNe,{className:o,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},b.createElement(KD,{otherAttributes:y,title:f,desc:p,ref:t},b.createElement(dSe,null,a)))});function wj(){return wj=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},wj.apply(null,arguments)}function VD(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 sNe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VD(Object(n),!0).forEach(function(r){oNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oNe(e,t,n){return(t=lNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lNe(e){var t=cNe(e,"string");return typeof t=="symbol"?t:t+""}function cNe(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 uNe={top:5,right:5,bottom:5,left:5},dNe=sNe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:uNe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},A8),fNe=b.forwardRef(function(t,n){var r,i=gr(t.categoricalChartProps,dNe),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,categoricalChartProps:f}=t,p={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,eventEmitter:void 0};return b.createElement(Tje,{preloadedState:{options:p},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},b.createElement(tSe,{chartData:f.data}),b.createElement(Rje,{layout:i.layout,margin:i.margin}),b.createElement(Ije,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),b.createElement(Mje,{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}),b.createElement(aNe,wj({},i,{ref:n})))}),hNe=["axis"],Oy=b.forwardRef((e,t)=>b.createElement(fNe,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:hNe,tooltipPayloadSearcher:Dbe,categoricalChartProps:e,ref:t}));const pu={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},ro={fill:"#71717a",fontSize:11},pNe="#27272a",th="#27272a",io=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function E8(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function Ey(e){return E8(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function zy(e){const t=E8(e);return`${t.getMonth()+1}/${t.getDate()}`}const mNe=["7d","30d","90d","all"],gNe=["gap","cited","uncited"],z8={forum:"bg-amber-500",social:"bg-blue-500",news:"bg-zinc-400",reference:"bg-purple-500",blog:"bg-emerald-500",ecommerce:"bg-orange-500",video:"bg-red-500",academic:"bg-cyan-500",other:"bg-zinc-600"},yNe={[eo.answer]:"Answer",[eo.citation]:"Sources"};function vNe({projectName:e}){const[t,n]=b.useState("30d"),[r,i]=b.useState(eo.answer),[a,o]=b.useState(null),[u,d]=b.useState(null),[f,p]=b.useState(null),[m,y]=b.useState(null),[v,w]=b.useState(!0);if(b.useEffect(()=>{let T=!1;return w(!0),Promise.all([C7(e,t),_7(e,t),A7(e,t)]).then(([M,q,$])=>{T||(o(M),d(q),p($),w(!1))}).catch(()=>{T||w(!1)}),()=>{T=!0}},[e,t]),b.useEffect(()=>{y(null)},[r]),v&&!a)return c.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"});const S=r===eo.answer,j=a?S?a.overall.answerRate:a.overall.citationRate:0,k=a?S?a.overall.answerMentionedCount:a.overall.cited:0,A=a?.overall.total??0,_=a?S?a.answerTrend:a.trend:"stable",C=_==="improving"?"positive":_==="declining"?"negative":"neutral",P=u?S?u.mentionedKeywords:u.cited:[],E=u?S?u.mentionGap:u.gap:[],O=u?S?u.notMentioned:u.uncited:[];return c.jsxs(c.Fragment,{children:[c.jsxs("section",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:S?"Visibility Metrics":"Citation Metrics"}),c.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:[S?"Answer Visibility Trends":"Source Citation Trends",c.jsx(Wn,{text:S?"Percentage of queries where your brand is mentioned in the AI-generated answer text. A higher rate means AI engines are actively surfacing your brand when answering user questions.":"Percentage of queries where your domain appears in the AI provider's source/reference links. This measures whether your pages are used as grounding sources, not whether your brand is named in the answer."})]})]}),c.jsx("div",{className:"sidebar-tabs ml-2",children:[eo.answer,eo.citation].map(T=>c.jsx("button",{type:"button",className:`sidebar-tab ${r===T?"sidebar-tab--active":""}`,onClick:()=>i(T),children:yNe[T]},T))})]}),c.jsx("div",{className:"flex gap-1",children:mNe.map(T=>c.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===T?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>n(T),children:T==="all"?"All":T},T))})]}),a&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-6",children:[c.jsx(N$,{value:`${Math.round(j*100)}`,label:S?"Answer Rate":"Citation Rate",delta:`${k} / ${A}`,tone:C,description:`Trend: ${_}`,isNumeric:!0}),c.jsxs("div",{className:"flex-1 space-y-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-xs text-zinc-500",children:"Trend"}),c.jsx(vt,{tone:C,children:_})]}),Object.keys(a.byProvider).length>0&&c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[c.jsx("th",{className:"text-left py-1 font-medium",children:"Provider"}),c.jsx("th",{className:"text-right py-1 font-medium",children:"Rate"}),c.jsx("th",{className:"text-right py-1 font-medium",children:S?"Mentioned / Total":"Cited / Total"})]})}),c.jsx("tbody",{children:Object.entries(a.byProvider).map(([T,M])=>{const q=S?M.answerRate:M.citationRate,$=S?M.answerMentionedCount:M.cited;return c.jsxs("tr",{className:"border-t border-zinc-800/40",children:[c.jsx("td",{className:"py-1.5 text-zinc-300",children:T}),c.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(q*100).toFixed(1),"%"]}),c.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[$," / ",M.total]})]},T)})})]})]})]}),a.buckets.length>=1&&c.jsx(bNe,{buckets:a.buckets,keywordChanges:a.keywordChanges??[],metricMode:r})]})]}),c.jsx("div",{className:"page-section-divider"}),c.jsxs("section",{children:[c.jsx("div",{className:"flex items-center justify-between mb-4",children:c.jsxs("div",{children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Opportunity Analysis"}),c.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Brand Gap Analysis ",c.jsx(Wn,{text:S?"Classification based on the most recent completed run. Mentioned: your brand was named in the AI answer text. Gap: a competitor was cited but your brand was not mentioned. Not Mentioned: your brand was not mentioned and no competitors were cited.":"Classification based on the most recent completed run. Cited: your domain appeared in the AI provider's source links. Gap: a competitor was cited but you were not. Not Cited: neither your domain nor competitors appeared in sources. Consistency shows how often each key phrase was cited across all runs in the selected window."})]})]})}),u&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex gap-1 mb-4",children:gNe.map(T=>{const M=T==="cited"?P.length:T==="gap"?E.length:O.length,q=m===T,$=T==="gap"?"Gap":T==="cited"?S?"Mentioned":"Cited":S?"Not Mentioned":"Not Cited";return c.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${q?T==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":T==="cited"?"bg-emerald-900/40 border-emerald-700/60 text-emerald-300":"bg-zinc-800/40 border-zinc-700 text-zinc-300":"border-zinc-800 text-zinc-400 hover:border-zinc-700"}`,onClick:()=>y(q?null:T),children:[$," (",M,")"]},T)})}),c.jsx(xNe,{citedRows:P,gapRows:E,uncitedRows:O,filter:m,metricMode:r})]})]}),c.jsx("div",{className:"page-section-divider"}),c.jsxs("section",{children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Source Intelligence"}),c.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Source Origin Breakdown ",c.jsx(Wn,{text:"Aggregated across all runs in the selected window. Shows what types of websites AI engines cite as grounding sources. More runs = more statistically meaningful breakdown."})]})]}),f&&f.overall.length>0&&c.jsxs("div",{className:"space-y-4",children:[c.jsx(wNe,{categories:f.overall}),c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[c.jsx("th",{className:"text-left py-1 font-medium",children:"Category"}),c.jsx("th",{className:"text-right py-1 font-medium",children:"Count"}),c.jsx("th",{className:"text-right py-1 font-medium",children:"%"}),c.jsx("th",{className:"text-left py-1 pl-4 font-medium",children:"Top Sources"})]})}),c.jsx("tbody",{children:f.overall.map(T=>c.jsxs("tr",{className:"border-t border-zinc-800/40",children:[c.jsxs("td",{className:"py-1.5 text-zinc-300 flex items-center gap-2",children:[c.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${z8[T.category]??"bg-zinc-600"}`}),T.label]}),c.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:T.count}),c.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(T.percentage*100).toFixed(1),"%"]}),c.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:T.topDomains.slice(0,3).map(M=>M.domain).join(", ")})]},T.category))})]})]}),f&&f.overall.length===0&&c.jsx("p",{className:"text-sm text-zinc-500 py-4",children:"No source data available. Run a visibility sweep first."})]})]})}function bNe({buckets:e,keywordChanges:t,metricMode:n}){const r=n===eo.answer,i=r?"answerRate":"citationRate",a=r?"Answer Rate":"Citation Rate",o=e.map(d=>({date:d.startDate,answerRate:Math.round(d.answerRate*1e3)/10,citationRate:Math.round(d.citationRate*1e3)/10,keywordCount:d.keywordCount??0})),u=b.useMemo(()=>{if(!t||t.length===0||e.length<2)return[];const d=new Date(e[0].startDate).getTime(),f=new Date(e[e.length-1].startDate).getTime();return t.filter(p=>{const m=new Date(p.date).getTime();return m>=d&&m<=f}).map(p=>{const m=new Date(p.date).getTime();let y=e[0].startDate,v=Math.abs(m-new Date(y).getTime());for(const w of e){const S=Math.abs(m-new Date(w.startDate).getTime());S<v&&(y=w.startDate,v=S)}return{...p,date:y}})},[e,t]);return c.jsxs("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:[c.jsx("p",{className:"text-[10px] text-zinc-500 mb-1 flex items-center gap-1",children:"kp = key phrases tracked in this window"}),c.jsx("div",{className:"h-40",role:"img","aria-label":`${a} trend chart`,children:c.jsx(Wg,{width:"100%",height:"100%",children:c.jsxs(Oy,{data:o,margin:{top:8,right:8,bottom:0,left:0},children:[c.jsx(a8,{strokeDasharray:"3 3",stroke:pNe,vertical:!1}),c.jsx(Jf,{dataKey:"date",tick:ro,tickLine:!1,axisLine:{stroke:th},tickFormatter:zy}),c.jsx(eh,{tick:ro,tickLine:!1,axisLine:!1,domain:[0,100],tickFormatter:d=>`${d}%`,width:40}),c.jsx(wy,{...pu,labelFormatter:Ey,formatter:(d,f)=>{const p=typeof d=="number"?d:Number(d??0);return String(f)===i?[`${p.toFixed(1)}%`,a]:[String(p),String(f)]}}),u.map(d=>c.jsx(t8,{x:d.date,stroke:"#52525b",strokeDasharray:"4 2",label:{value:d.label,position:"top",fill:"#71717a",fontSize:9}},d.date)),c.jsx(yl,{type:"monotone",dataKey:i,stroke:io[0],fill:io[0],fillOpacity:.15,strokeWidth:2,dot:{fill:io[0],r:3,strokeWidth:0},activeDot:{fill:io[0],r:5,strokeWidth:0,opacity:.8}})]})})})]})}function xNe({citedRows:e,gapRows:t,uncitedRows:n,filter:r,metricMode:i}){const a=i===eo.answer,o=b.useMemo(()=>{const u=[...t.map(d=>({...d,_sort:0})),...e.map(d=>({...d,_sort:1})),...n.map(d=>({...d,_sort:2}))];return r?u.filter(d=>d.category===r):u.sort((d,f)=>d._sort-f._sort)},[e,t,n,r]);return o.length===0?c.jsxs("p",{className:"text-sm text-zinc-500 py-4",children:["No key phrases found",r?` with status "${r}"`:"","."]}):c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[c.jsx("th",{className:"text-left py-1 font-medium",children:"Keyword"}),c.jsx("th",{className:"text-left py-1 font-medium",children:"Status"}),c.jsx("th",{className:"text-left py-1 font-medium",children:a?"Providers Mentioning":"Providers Citing"}),c.jsx("th",{className:"text-left py-1 font-medium",children:"Competitors Citing"}),c.jsx("th",{className:"text-right py-1 font-medium",children:"Consistency"})]})}),c.jsx("tbody",{children:o.map(u=>{const d=u.category==="cited"?"positive":u.category==="gap"?"caution":"neutral",f=u.category==="gap"?"Gap":u.category==="cited"?a?"Mentioned":"Cited":a?"Not Mentioned":"Not Cited",p=a?u.consistency.mentionedRuns:u.consistency.citedRuns;return c.jsxs("tr",{className:`border-t border-zinc-800/40 ${u.category==="gap"?"border-l-2 border-l-amber-600/60":""}`,children:[c.jsx("td",{className:"py-1.5 text-zinc-200",children:u.keyword}),c.jsx("td",{className:"py-1.5",children:c.jsx(vt,{tone:d,children:f})}),c.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:u.providers.length>0?u.providers.join(", "):"—"}),c.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:u.competitorsCiting.length>0?u.competitorsCiting.join(", "):"—"}),c.jsx("td",{className:"py-1.5 text-right text-zinc-400 text-xs",children:u.consistency.totalRuns>0?`${p}/${u.consistency.totalRuns} runs`:"—"})]},u.keywordId)})})]})}function wNe({categories:e}){const t=e.reduce((n,r)=>n+r.count,0);return t===0?null:c.jsx("div",{className:"flex rounded-full overflow-hidden h-3 bg-zinc-800","aria-label":"Source category distribution",children:e.map(n=>{const r=n.count/t*100;return r<.5?null:c.jsx("div",{className:`${z8[n.category]??"bg-zinc-600"} transition-all`,style:{width:`${r}%`},title:`${n.label}: ${(n.percentage*100).toFixed(1)}%`},n.category)})})}const SNe=["7d","30d","90d","all"],Ks=io;function cf(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function jNe(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 NNe({projectName:e}){const[t,n]=b.useState(null),[r,i]=b.useState(null),[a,o]=b.useState(!0),[u,d]=b.useState(!1),[f,p]=b.useState(!1),[m,y]=b.useState(null),[v,w]=b.useState(null),[S,j]=b.useState("sessions"),[k,A]=b.useState("desc"),[_,C]=b.useState("sessions"),[P,E]=b.useState("desc"),[O,T]=b.useState("sessions"),[M,q]=b.useState("desc"),[$,L]=b.useState([]),[J,ae]=b.useState([]),[Z,H]=b.useState([]),[Q,he]=b.useState("30d");function we(be){o(!0),l2(e).then(Me=>{if(!be.current)return n(Me),Me.connected?Promise.all([c2(e,void 0,Q),u2(e,Q).catch(()=>[]),f2(e,Q).catch(()=>[]),d2(e,Q).catch(()=>[])]):null}).then(Me=>{be.current||(Array.isArray(Me)?(i(Me[0]),L(Me[1]),ae(Me[2]),H(Me[3])):(i(null),L([]),ae([]),H([])),o(!1))}).catch(Me=>{be.current||(y(Me instanceof Error?Me.message:"Failed to load GA4 data"),o(!1))})}b.useEffect(()=>{const be={current:!1};return we(be),()=>{be.current=!0}},[e,Q]);async function R(){d(!0),y(null),w(null);try{const be=await HI(e);w(`Synced ${be.rowCount.toLocaleString()} page rows, ${be.aiReferralCount.toLocaleString()} AI and ${be.socialReferralCount.toLocaleString()} social referral rows (${be.days} days)`);const[Me,Pe,ze,ne]=await Promise.all([c2(e,void 0,Q),u2(e,Q).catch(()=>[]),f2(e,Q).catch(()=>[]),d2(e,Q).catch(()=>[])]);i(Me),L(Pe),ae(ze),H(ne);const xe=await l2(e);n(xe)}catch(be){y(be instanceof Error?be.message:"Sync failed")}finally{d(!1)}}async function U(){p(!0),y(null),w(null);try{await E7(e),n({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),i(null),w("GA4 disconnected")}catch(be){y(be instanceof Error?be.message:"Disconnect failed")}finally{p(!1)}}function F(be){S===be?A(Me=>Me==="desc"?"asc":"desc"):(j(be),A("desc"))}function D(be){_===be?E(Me=>Me==="desc"?"asc":"desc"):(C(be),E("desc"))}function Y(be){O===be?q(Me=>Me==="desc"?"asc":"desc"):(T(be),q("desc"))}const se=b.useMemo(()=>r?.topPages?[...r.topPages].sort((be,Me)=>{const Pe=be[S],ze=Me[S];return typeof Pe=="string"&&typeof ze=="string"?k==="asc"?Pe.localeCompare(ze):ze.localeCompare(Pe):k==="asc"?Pe-ze:ze-Pe}):[],[r?.topPages,S,k]),ie=b.useMemo(()=>r?.aiReferrals?[...r.aiReferrals].sort((be,Me)=>{const Pe=be[_],ze=Me[_];return typeof Pe=="string"&&typeof ze=="string"?P==="asc"?Pe.localeCompare(ze):ze.localeCompare(Pe):P==="asc"?Pe-ze:ze-Pe}):[],[r?.aiReferrals,_,P]),fe=b.useMemo(()=>r?.socialReferrals?[...r.socialReferrals].sort((be,Me)=>{const Pe=be[O],ze=Me[O];return typeof Pe=="string"&&typeof ze=="string"?M==="asc"?Pe.localeCompare(ze):ze.localeCompare(Pe):M==="asc"?Pe-ze:ze-Pe}):[],[r?.socialReferrals,O,M]),{socialChartData:je,socialChartSources:ee}=b.useMemo(()=>{const be=[...new Set(Z.map(ze=>ze.source))],Me=new Map;for(const ze of Z){let ne=Me.get(ze.date);ne||(ne={_socialTotal:0},Me.set(ze.date,ne)),ne[ze.source]=(ne[ze.source]??0)+ze.sessions,ne._socialTotal=(ne._socialTotal??0)+ze.sessions}return{socialChartData:[...Me.entries()].sort(([ze],[ne])=>ze.localeCompare(ne)).map(([ze,ne])=>({date:ze,...ne})),socialChartSources:be}},[Z]),{chartData:ue,chartSources:Ae,dateRange:W}=b.useMemo(()=>{const be=[...new Set($.map(Ee=>Ee.source))],Me=new Map;for(const Ee of J)Me.set(Ee.date,{_totalSessions:Ee.sessions,_organicSessions:Ee.organicSessions});const Pe=new Map;for(const Ee of $){const Ge=`${Ee.date}::${Ee.source}`,et=Pe.get(Ge)??0;Pe.set(Ge,Math.max(et,Ee.sessions))}for(const[Ee,Ge]of Pe){const[et,rn]=Ee.split("::");let Sn=Me.get(et);Sn||(Sn={_totalSessions:0,_organicSessions:0},Me.set(et,Sn)),Sn[rn]=(Sn[rn]??0)+Ge}const ze=[...Me.entries()].sort(([Ee],[Ge])=>Ee.localeCompare(Ge)).map(([Ee,Ge])=>({date:Ee,...Ge})),ne=ze.map(Ee=>Ee.date),xe=ne.length>0?{start:ne[0],end:ne[ne.length-1]}:null;return{chartData:ze,chartSources:be,dateRange:xe}},[$,J]);if(a&&!t)return c.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!t?.connected)return c.jsx(kNe,{projectName:e,onConnected:()=>we({current:!1})});const Ke=r?.organicSharePct??0,Re=r?.aiSessionsDeduped??0,it=r?.aiSharePct??0,at=r?new Set(r.aiReferrals.map(be=>be.source.toLowerCase())).size:0,At=ie[0]??null,Bt=r?.socialSessions??0,wn=r?.socialSharePct??0,ve=r?new Set(r.socialReferrals.map(be=>be.source.toLowerCase())).size:0,Ye=fe[0]??null;return c.jsxs(c.Fragment,{children:[m&&c.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:m}),v&&c.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-emerald-900/20 border border-emerald-800/60 text-sm text-emerald-300",children:v}),c.jsxs("div",{className:"flex items-center justify-between mb-6",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),c.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",c.jsx("span",{className:"text-zinc-300",children:t.propertyId}),t.clientEmail&&c.jsxs(c.Fragment,{children:[" · ",c.jsx("span",{className:"text-zinc-500",children:t.clientEmail})]})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(ge,{variant:"outline",size:"sm",disabled:u,onClick:R,children:[c.jsx(y2,{className:`w-3.5 h-3.5 mr-1.5 ${u?"animate-spin":""}`}),u?"Syncing…":"Sync"]}),c.jsxs(ge,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:f,onClick:U,children:[c.jsx(BG,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),c.jsxs("section",{children:[c.jsxs("div",{className:"mb-4 flex items-start justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),c.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",c.jsx(Wn,{text:`Aggregated traffic metrics from Google Analytics 4. Sessions and users are summed across the selected period.${r?.periodStart&&r?.periodEnd?` Data available: ${new Date(r.periodStart+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})} – ${new Date(r.periodEnd+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}.`:""} Organic sessions are Google organic search sessions specifically.`})]})]}),c.jsx("div",{className:"flex gap-1",children:SNe.map(be=>c.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${Q===be?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>he(be),children:be==="all"?"All":be},be))})]}),r?c.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[c.jsx(OS,{value:cf(r.totalSessions),label:"Total Sessions",subtitle:r.totalSessions.toLocaleString(),tone:"neutral"}),c.jsx(OS,{value:cf(r.totalOrganicSessions),label:"Organic Sessions",subtitle:`${Ke}% of total`,tone:"positive"}),c.jsx(OS,{value:cf(r.totalUsers),label:"Total Users",subtitle:r.totalUsers.toLocaleString(),tone:"neutral"})]}):c.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[c.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),c.jsxs(ge,{variant:"outline",size:"sm",disabled:u,onClick:R,children:[c.jsx(y2,{className:`w-3.5 h-3.5 mr-1.5 ${u?"animate-spin":""}`}),"Sync from GA4"]})]})]}),r&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"page-section-divider"}),c.jsxs("section",{children:[c.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"AI Attribution"}),c.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["AI Referral Sources",c.jsx(Wn,{text:"Tracks sessions from known AI referrers and matching AI-tagged UTMs detected in GA4 sessionSource, firstUserSource, and sessionManualSource. Generic search sources are excluded to avoid false positives."})]})]}),W&&c.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(W.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(W.end+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),ue.length>0&&c.jsxs(qe,{className:"surface-card p-5 mb-4",children:[c.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),c.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:Ae.length>0?"AI vs. total sessions":"All sessions (baseline)"}),Ae.length===0&&c.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),Ae.length===0&&c.jsx("p",{className:"text-xs text-zinc-500",children:"No AI referrals detected yet"})]}),c.jsx("div",{className:"h-64",children:c.jsx(Wg,{width:"100%",height:"100%",children:c.jsxs(Oy,{data:ue,margin:{top:4,right:4,bottom:0,left:0},children:[c.jsx(Jf,{dataKey:"date",tick:ro,tickLine:!1,axisLine:{stroke:th},tickFormatter:zy}),c.jsx(eh,{tick:ro,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),c.jsx(wy,{...pu,labelFormatter:Ey,formatter:(be,Me)=>{const Pe=typeof be=="number"?be.toLocaleString():String(be??0),ze=String(Me??"");return ze==="_totalSessions"?[Pe,"Total Sessions"]:ze==="_organicSessions"?[Pe,"Organic Sessions"]:[Pe,ze]}}),c.jsx(X1,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:be=>be==="_totalSessions"?"Total Sessions":be==="_organicSessions"?"Organic Sessions":be}),c.jsx(yl,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Ae.map((be,Me)=>c.jsx(yl,{type:"monotone",dataKey:be,stackId:"ai",stroke:Ks[Me%Ks.length],fill:Ks[Me%Ks.length],fillOpacity:.4,strokeWidth:1.5},be))]})})})]}),c.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[c.jsxs(qe,{className:"surface-card p-5",children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),c.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Attributable AI visits"})]}),r.aiReferrals.length>0?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[c.jsx(mi,{label:"AI Sessions",value:cf(Re),hint:`${Re.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions attributed to AI referral sources detected via GA4 sessionSource, firstUserSource, and sessionManualSource dimensions."}),c.jsx(mi,{label:"Share of Traffic",value:`${it}%`,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from AI answer engines. A higher share indicates stronger AI-driven discovery."}),c.jsx(mi,{label:"Tracked Sources",value:String(at),hint:`${r.aiReferrals.length} source rows`,tone:"neutral",tooltip:"Number of distinct AI referral sources detected. Each unique source/medium combination (e.g. chatgpt.com/referral) counts as one source row."})]}),At&&c.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: ",c.jsx("span",{className:"font-medium",children:At.source})," via ",At.medium,", accounting for ",At.sessions.toLocaleString()," sessions."]})]}):c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[c.jsx(mi,{label:"AI Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to AI referral sources detected via GA4 sessionSource, firstUserSource, and sessionManualSource dimensions."}),c.jsx(mi,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from AI answer engines."}),c.jsx(mi,{label:"Tracked Sources",value:"0",hint:"known AI sources",tone:"neutral",tooltip:"Number of distinct AI referral sources detected after matching known AI engine referrers and AI-tagged UTM sources."})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3 text-sm text-zinc-400",children:[c.jsx("p",{className:"mb-1.5 text-zinc-300",children:"Monitoring for AI referral traffic from:"}),c.jsx("p",{className:"text-xs text-zinc-500",children:"Known AI answer engines and matching UTM-tagged variants. Sessions will appear here once GA4 detects visits from tracked AI sources."})]})]})]}),c.jsxs(qe,{className:"surface-card p-5",children:[c.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Breakdown"}),c.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Source / medium"})]}),c.jsx("p",{className:"text-xs text-zinc-500",children:r.aiReferrals.length>0?`${r.aiReferrals.length} rows`:"No source rows"})]}),r.aiReferrals.length>0?c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[c.jsx(pi,{label:"Source",sortKey:"source",current:_,dir:P,onSort:D,align:"left"}),c.jsx(pi,{label:"Medium",sortKey:"medium",current:_,dir:P,onSort:D,align:"left"}),c.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),c.jsx(pi,{label:"Sessions",sortKey:"sessions",current:_,dir:P,onSort:D,align:"right"}),c.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),c.jsx(pi,{label:"Users",sortKey:"users",current:_,dir:P,onSort:D,align:"right"})]})}),c.jsx("tbody",{children:ie.map(be=>c.jsx(ONe,{referral:be,totalSessions:Re},`${be.source}:${be.medium}:${be.sourceDimension}`))})]})}):c.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[c.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI referrer sessions detected yet"}),c.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"When visitors arrive from ChatGPT, Claude, Gemini, or other AI platforms, their sessions will be broken down here by source and medium."})]})]})]})]})]}),r&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"page-section-divider"}),c.jsxs("section",{children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Social Attribution"}),c.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Social Media Traffic",c.jsx(Wn,{text:"Tracks sessions classified as social traffic by GA4's default channel grouping (Organic Social and Paid Social). Google maintains the source-to-channel mapping."})]})]}),je.length>0&&c.jsxs(qe,{className:"surface-card p-5 mb-4",children:[c.jsx("div",{className:"mb-4 flex items-end justify-between",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),c.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social sessions over time"})]})}),c.jsx("div",{className:"h-64",children:c.jsx(Wg,{width:"100%",height:"100%",children:c.jsxs(Oy,{data:je,margin:{top:4,right:4,bottom:0,left:0},children:[c.jsx(Jf,{dataKey:"date",tick:ro,tickLine:!1,axisLine:{stroke:th},tickFormatter:zy}),c.jsx(eh,{tick:ro,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),c.jsx(wy,{...pu,labelFormatter:Ey,formatter:(be,Me)=>{const Pe=typeof be=="number"?be.toLocaleString():String(be??0),ze=String(Me??"");return ze==="_socialTotal"?[Pe,"Total Social"]:[Pe,ze]}}),c.jsx(X1,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:be=>be==="_socialTotal"?"Total Social":be}),c.jsx(yl,{type:"monotone",dataKey:"_socialTotal",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),ee.map((be,Me)=>c.jsx(yl,{type:"monotone",dataKey:be,stackId:"social",stroke:Ks[Me%Ks.length],fill:Ks[Me%Ks.length],fillOpacity:.4,strokeWidth:1.5},be))]})})})]}),c.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[c.jsxs(qe,{className:"surface-card p-5",children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),c.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social media visits"})]}),r.socialReferrals.length>0?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[c.jsx(mi,{label:"Social Sessions",value:cf(Bt),hint:`${Bt.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions classified as Organic Social or Paid Social by GA4's default channel grouping."}),c.jsx(mi,{label:"Share of Traffic",value:`${wn}%`,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from social media platforms."}),c.jsx(mi,{label:"Platforms",value:String(ve),hint:`${r.socialReferrals.length} source rows`,tone:"neutral",tooltip:"Number of distinct social media platforms detected. Each unique source/medium combination counts as one source row."})]}),Ye&&c.jsxs("div",{className:"mt-4 rounded-lg border border-sky-800/40 bg-sky-500/6 px-4 py-3 text-sm text-sky-100",children:["Top social source: ",c.jsx("span",{className:"font-medium",children:Ye.source})," via ",Ye.medium,", accounting for ",Ye.sessions.toLocaleString()," sessions."]})]}):c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[c.jsx(mi,{label:"Social Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to social media platforms."}),c.jsx(mi,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions from social media."}),c.jsx(mi,{label:"Platforms",value:"0",hint:"known platforms",tone:"neutral",tooltip:"Number of distinct social media platforms detected."})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3 text-sm text-zinc-400",children:[c.jsx("p",{className:"mb-1.5 text-zinc-300",children:"Monitoring social media traffic via GA4 channel grouping"}),c.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."})]})]})]}),c.jsxs(qe,{className:"surface-card p-5",children:[c.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Breakdown"}),c.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Source / medium"})]}),c.jsx("p",{className:"text-xs text-zinc-500",children:r.socialReferrals.length>0?`${r.socialReferrals.length} rows`:"No source rows"})]}),r.socialReferrals.length>0?c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[c.jsx(pi,{label:"Source",sortKey:"source",current:O,dir:M,onSort:Y,align:"left"}),c.jsx(pi,{label:"Medium",sortKey:"medium",current:O,dir:M,onSort:Y,align:"left"}),c.jsx("th",{className:"py-1 font-medium text-left",children:"Channel"}),c.jsx(pi,{label:"Sessions",sortKey:"sessions",current:O,dir:M,onSort:Y,align:"right"}),c.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),c.jsx(pi,{label:"Users",sortKey:"users",current:O,dir:M,onSort:Y,align:"right"})]})}),c.jsx("tbody",{children:fe.map(be=>c.jsx(ENe,{referral:be,totalSessions:Bt},`${be.source}:${be.medium}:${be.channelGroup}`))})]})}):c.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[c.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No social media sessions detected yet"}),c.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"When visitors arrive from Facebook, X/Twitter, LinkedIn, or other social platforms, their sessions will be broken down here by source and medium."})]})]})]})]})]}),r&&r.topPages.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"page-section-divider"}),c.jsxs("section",{children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),c.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",c.jsx(Wn,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[c.jsx(pi,{label:"Landing Page",sortKey:"landingPage",current:S,dir:k,onSort:F,align:"left"}),c.jsx(pi,{label:"Sessions",sortKey:"sessions",current:S,dir:k,onSort:F,align:"right"}),c.jsx(pi,{label:"Organic",sortKey:"organicSessions",current:S,dir:k,onSort:F,align:"right"}),c.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),c.jsx(pi,{label:"Users",sortKey:"users",current:S,dir:k,onSort:F,align:"right"})]})}),c.jsx("tbody",{children:se.map(be=>c.jsx(CNe,{page:be},be.landingPage))})]})})]})]}),c.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[c.jsx("span",{children:r?.lastSyncedAt?`Last synced ${jNe(r.lastSyncedAt)}`:"Never synced"}),c.jsx("span",{children:r?`${r.topPages.length} pages · ${r.aiReferrals.length} AI rows · ${r.socialReferrals.length} social rows`:""})]})]})}function kNe({projectName:e,onConnected:t}){const[n,r]=b.useState(""),[i,a]=b.useState(null),[o,u]=b.useState(null),[d,f]=b.useState(!1),[p,m]=b.useState(null),y=b.useRef(null),v=b.useCallback(S=>{const j=S.target.files?.[0];if(!j)return;m(null),a(j.name);const k=new FileReader;k.onload=()=>{const A=k.result;try{const _=JSON.parse(A);if(!_.client_email||!_.private_key){m("JSON file is missing required fields: client_email and private_key. Make sure you downloaded a service account key (not an OAuth client)."),u(null);return}u(A)}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(j)},[]);async function w(){if(m(null),!n.trim()){m("Property ID is required.");return}if(!o){m("Please upload a service account key file.");return}f(!0);try{await O7(e,{propertyId:n.trim(),keyJson:o});try{await HI(e)}catch{}t()}catch(S){m(S instanceof Error?S.message:"Failed to connect GA4")}finally{f(!1)}}return c.jsxs(qe,{className:"surface-card p-6",children:[c.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-1",children:"Connect Google Analytics 4"}),c.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&&c.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}),c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{htmlFor:"ga4-property-id",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"GA4 Property ID"}),c.jsx("input",{id:"ga4-property-id",type:"text",placeholder:"e.g. 123456789",value:n,onChange:S=>r(S.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"}),c.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)."})]}),c.jsxs("div",{className:"mb-5",children:[c.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Service Account Key File"}),c.jsx("input",{ref:y,type:"file",accept:".json,application/json",onChange:v,className:"hidden"}),c.jsxs("button",{type:"button",onClick:()=>y.current?.click(),className:"flex items-center gap-2 w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 border-dashed px-4 py-3 text-sm text-zinc-400 hover:border-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:[c.jsx(FG,{className:"w-4 h-4 shrink-0"}),i?c.jsx("span",{className:"text-zinc-200 truncate",children:i}):c.jsx("span",{children:"Upload .json key file"})]}),c.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 ",c.jsx("span",{className:"text-zinc-400",children:"Viewer"})," access on the GA4 property."]})]}),c.jsx(ge,{variant:"default",size:"sm",disabled:d||!n.trim()||!o,onClick:w,children:d?"Connecting & syncing…":"Connect GA4"})]})}function pi({label:e,sortKey:t,current:n,dir:r,onSort:i,align:a}){const o=n===t;return c.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${a==="right"?"text-right":"text-left"}`,onClick:()=>i(t),children:[e,o&&c.jsx("span",{className:"ml-0.5",children:r==="asc"?"↑":"↓"})]})}const T8={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function OS({value:e,label:t,subtitle:n,tone:r}){return c.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),c.jsx("p",{className:`text-2xl font-bold tabular-nums ${T8[r]}`,children:e}),c.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function mi({value:e,label:t,hint:n,tone:r,tooltip:i}){return c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-4 py-3 flex flex-col",children:[c.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1 flex items-center gap-1",children:[t,i&&c.jsx(Wn,{text:i})]}),c.jsx("p",{className:`text-xl font-semibold tabular-nums ${T8[r]}`,children:e}),c.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function CNe({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return c.jsxs("tr",{className:"border-t border-zinc-800/40",children:[c.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),c.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),c.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),c.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),c.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}const _Ne={session:"Session",first_user:"First Visit",manual_utm:"UTM"},ANe={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 ONe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=_Ne[e.sourceDimension]??e.sourceDimension,i=ANe[e.sourceDimension]??"";return c.jsxs("tr",{className:"border-t border-zinc-800/40",children:[c.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),c.jsx("td",{className:"py-1.5 text-zinc-500 max-w-[180px] truncate",title:e.medium,children:e.medium}),c.jsx("td",{className:"py-1.5",children:c.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})}),c.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),c.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),c.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function ENe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=e.channelGroup==="Paid Social"?"Paid":"Organic";return c.jsxs("tr",{className:"border-t border-zinc-800/40",children:[c.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),c.jsx("td",{className:"py-1.5 text-zinc-500 max-w-[180px] truncate",title:e.medium,children:e.medium}),c.jsx("td",{className:"py-1.5",children:c.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})}),c.jsx("td",{className:"py-1.5 text-right text-sky-400 tabular-nums",children:e.sessions.toLocaleString()}),c.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),c.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function zh(e){e.invalidateQueries({queryKey:Ar.runs.all}),e.invalidateQueries({queryKey:Ar.projects.all})}function zNe(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function TNe(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 Qv(e,t){VL({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),ht({title:zNe(e.kind),detail:TNe(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function PNe(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){ht({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)VL({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=kX({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});ht({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 Xv(e,t){if(e instanceof Ci&&e.code==="RUN_IN_PROGRESS"){ht({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}ht({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function P8(){const e=vo();return nh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>BK(t,n),onSuccess:(t,n)=>{zh(e),Qv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{Xv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function RNe(){const e=vo();return nh({meta:{skipGlobalErrorToast:!0},mutationFn:t=>a7(t),onSuccess:t=>{zh(e),PNe(t)},onError:t=>{ht({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function MNe(){const e=vo();return nh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>BI(t,n),onSuccess:(t,n)=>{zh(e),Qv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{Xv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function DNe(){const e=vo();return nh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>v7(t),onSuccess:(t,n)=>{zh(e),Qv(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{Xv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function INe(){const e=vo();return nh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>g7(t,n),onSuccess:(t,n)=>{zh(e),Qv(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{Xv(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}const LNe=["7d","30d","90d","all"];function $Ne({projectName:e}){const[t,n]=b.useState(!1),[r,i]=b.useState([]),[a,o]=b.useState([]),[u,d]=b.useState([]),[f,p]=b.useState([]),[m,y]=b.useState([]),[v,w]=b.useState(null),[S,j]=b.useState(""),[k,A]=b.useState(""),[_,C]=b.useState("30"),[P,E]=b.useState(!1),[O,T]=b.useState("30d"),[M,q]=b.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[$,L]=b.useState(""),[J,ae]=b.useState(!0),[Z,H]=b.useState(!1),[Q,he]=b.useState(!1),[we,R]=b.useState(!1),[U,F]=b.useState(!1),[D,Y]=b.useState(!1),[se,ie]=b.useState(!1),[fe,je]=b.useState(null),[ee,ue]=b.useState(!1),[Ae,W]=b.useState(!1),[Ke,Re]=b.useState(null),[it,at]=b.useState(""),[At,Bt]=b.useState(!1),[wn,ve]=b.useState(!1),[Ye,be]=b.useState("indexed"),[Me,Pe]=b.useState(null),ze=b.useMemo(()=>{if(!Me)return u;const{key:G,dir:Ne}=Me;return[...u].sort((bt,ut)=>{const Ot=G===to.CTR?Number.isFinite(bt.ctr)?bt.ctr:0:bt[G],Ir=G===to.CTR?Number.isFinite(ut.ctr)?ut.ctr:0:ut[G];return Ne==="asc"?Ot-Ir:Ir-Ot})},[u,Me]),[ne,xe]=b.useState([]),[Ee,Ge]=b.useState(null),[et,rn]=b.useState(!1),[Sn,Xe]=b.useState(null),[Qt,Ut]=b.useState(null),Ue=r.find(G=>G.connectionType==="gsc"),Jr=u.length>0||f.length>0||m.length>0,Se=MNe(),lr=DNe(),ms=INe();async function _o(G){if(!G){o([]),j("");return}he(!0);try{const{sites:Ne}=await l7(e);o(Ne),j(G.propertyId??Ne[0]?.siteUrl??"")}catch(Ne){o([]),Xe(Ne instanceof Error?Ne.message:"Failed to load Search Console properties")}finally{he(!1)}}async function Aa(){F(!0);try{const G=await d7(e,{startDate:M.startDate||void 0,endDate:M.endDate||void 0,query:M.query||void 0,page:M.page||void 0,limit:parseInt(M.limit,10)||20,window:O});d(G)}catch(G){d([]),Xe(G instanceof Error?G.message:"Failed to load GSC performance data")}finally{F(!1)}}async function ei(){Y(!0);try{const[G,Ne]=await Promise.all([h7(e,{url:$.trim()||void 0,limit:20}),p7(e)]);p(G),y(Ne)}catch(G){p([]),y([]),Xe(G instanceof Error?G.message:"Failed to load GSC inspection history")}finally{Y(!1)}}async function Ao(){ue(!0);try{const[G,Ne]=await Promise.all([Hj(e),m7(e).catch(()=>[])]);je(G),xe(Ne)}catch(G){je(null),xe([]),Xe(G instanceof Error?G.message:"Failed to load coverage data")}finally{ue(!1)}}async function gs(G){rn(!0),Xe(null);try{const Ne=await s2(e,{urls:G}),{succeeded:bt,failed:ut,total:Ot}=Ne.summary;ht({title:"Indexing requested",detail:ut===0?`${bt} URL${bt!==1?"s":""} submitted for indexing.`:`${bt}/${Ot} submitted successfully, ${ut} failed.`,tone:ut===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(Ne){Xe(Ne instanceof Error?Ne.message:"Failed to request indexing")}finally{rn(!1)}}async function Jv(){rn(!0),Xe(null);try{const G=await s2(e,{urls:[],allUnindexed:!0}),{succeeded:Ne,failed:bt,total:ut}=G.summary;ht({title:"Indexing requested",detail:bt===0?`${Ne} unindexed URL${Ne!==1?"s":""} submitted for indexing.`:`${Ne}/${ut} submitted successfully, ${bt} failed.`,tone:bt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(G){Xe(G instanceof Error?G.message:"Failed to request indexing")}finally{rn(!1)}}async function Oo(){if(it.trim()){Bt(!0),Xe(null);try{await u7(e,"gsc",it.trim()),i(G=>G.map(Ne=>Ne.connectionType==="gsc"?{...Ne,sitemapUrl:it.trim()}:Ne)),ht({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),at("")}catch(G){Xe(G instanceof Error?G.message:"Failed to save sitemap URL")}finally{Bt(!1)}}}async function Ql(){Xe(null);try{const G=await lr.mutateAsync({projectName:e,projectLabel:e});Re(G.sitemaps),i(Ne=>Ne.map(bt=>bt.connectionType==="gsc"?{...bt,sitemapUrl:G.primarySitemapUrl}:bt))}catch{}}async function Eo(){W(!0),Xe(null);try{const G=await y7(e);Re(G.sitemaps),G.sitemaps.length===0&&Ut("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(G){Xe(G instanceof Error?G.message:"Failed to list sitemaps")}finally{W(!1)}}async function Ph(){ae(!0),Xe(null);try{const[G,Ne]=await Promise.all([qj().catch(()=>null),$I(e).catch(()=>[])]);n(!!G?.google?.configured),i(Ne);const bt=Ne.find(ut=>ut.connectionType==="gsc");await Promise.all([_o(bt),Aa(),ei(),Ao()])}finally{ae(!1)}}b.useEffect(()=>{Ph()},[e]),b.useEffect(()=>{Aa()},[O]);async function Rh(){if(!t){Xe("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}H(!0),Xe(null),Ut(null);try{const{authUrl:G}=await s7(e,"gsc");if(!G.startsWith("https://accounts.google.com/")){Xe("Unexpected OAuth redirect URL. Please try again.");return}const Ne=window.open(G,"_blank","width=600,height=700");if(!Ne){window.location.assign(G);return}Ut("Finish the Google consent flow in the popup, then close it to refresh this project.");const bt=window.setInterval(()=>{Ne.closed&&(window.clearInterval(bt),Ut(null),Ph())},1e3)}catch(G){Xe(G instanceof Error?G.message:"Failed to start OAuth flow")}finally{H(!1)}}async function Mh(){Xe(null),Ut(null);try{await o7(e,"gsc"),i(G=>G.filter(Ne=>Ne.connectionType!=="gsc")),o([]),j("")}catch(G){Xe(G instanceof Error?G.message:"Failed to disconnect")}}async function Dh(){if(S){R(!0),Xe(null);try{await c7(e,"gsc",S),i(G=>G.map(Ne=>Ne.connectionType==="gsc"?{...Ne,propertyId:S}:Ne)),ht({title:"GSC property updated",detail:`${e} is now linked to ${S}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(G){Xe(G instanceof Error?G.message:"Failed to save GSC property")}finally{R(!1)}}}async function Qu(){Xe(null),Ut(null);try{await Se.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(_,10)||void 0,full:P||void 0}})}catch{}}async function Xl(){if(k.trim()){ie(!0),Xe(null),Ut(null);try{const G=await f7(e,k.trim());w(G),A(""),await ei()}catch(G){Xe(G instanceof Error?G.message:"Failed to inspect URL")}finally{ie(!1)}}}return c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),c.jsx("h2",{children:"Google Search Console"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"flex gap-1",children:LNe.map(G=>c.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${O===G?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>T(G),children:G==="all"?"All":G},G))}),Ue&&c.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:U,onClick:()=>{Aa()},children:U?"Refreshing…":"Refresh data"})]})]}),Sn&&c.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:[Sn,c.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>Xe(null),children:"×"})]}),Qt&&c.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:[Qt,c.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>Ut(null),children:"×"})]}),J?c.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):c.jsxs("div",{className:"space-y-3",children:[c.jsxs(qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),c.jsx("h3",{children:"Domain authorization"})]}),c.jsx(vt,{tone:Ue?"positive":t?"caution":"negative",children:Ue?"Connected":t?"Ready to connect":"App credentials missing"})]}),Ue?c.jsxs("div",{className:"mt-3 space-y-3",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),c.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),c.jsx("span",{className:"text-xs text-zinc-500",children:Ue.domain}),c.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:Mh,children:"Disconnect"})]}),c.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",c.jsx("code",{children:Ue.domain}),"."]})]}),c.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Ue.propertyId??"No property selected yet"})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:qi(Ue.updatedAt)})]})]})]}):c.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[c.jsx("p",{className:"text-sm text-zinc-300",children:t?"Generate a Google OAuth link for this project and have the client sign in with a Google account that already has access to the correct Search Console property.":"Set Google OAuth client credentials first. Once configured, you can generate a consent link for this project domain."}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t?c.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:Z,onClick:Rh,children:Z?"Opening…":"Connect Google Search Console"}):c.jsx(ge,{type:"button",variant:"outline",size:"sm",asChild:!0,children:c.jsx(qt,{to:"/settings",children:"Open Settings"})}),!t&&c.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),Ue&&!Ue.sitemapUrl&&c.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("span",{className:"mt-0.5 text-amber-400",children:c.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:c.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"})})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),c.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."}),c.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[c.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[c.jsx(ge,{type:"button",size:"sm",disabled:lr.isPending||!Ue.propertyId,onClick:Ql,children:lr.isPending?"Discovering…":"Auto-discover from GSC"}),c.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),c.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[c.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:it,onChange:G=>at(G.target.value),onKeyDown:G=>G.key==="Enter"&&void Oo()}),c.jsx(ge,{type:"button",size:"sm",variant:"outline",disabled:At||!it.trim(),onClick:Oo,children:At?"Saving…":"Save sitemap URL"})]})]})]})]})}),(Ue||Jr)&&c.jsxs(c.Fragment,{children:[c.jsxs(qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),c.jsx("h3",{children:"Index coverage"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[fe&&fe.notIndexed.length>0&&c.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:et,onClick:()=>{Jv()},children:et?"Requesting…":`Request indexing (${fe.notIndexed.length})`}),c.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:ee,onClick:()=>{Ao()},children:ee?"Loading…":"Refresh coverage"})]})]}),fe&&fe.summary.total>0?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const G=fe.summary.indexed+fe.summary.notIndexed,Ne=G>0?fe.summary.indexed/G:0,bt=G>0?fe.summary.notIndexed/G:0,ut=54,Ot=2*Math.PI*ut,Ir=Ot*(1-Ne),Ri=Ot*bt,ys=Ot*Ne;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"relative h-48 w-48",children:[c.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[c.jsx("circle",{cx:"64",cy:"64",r:ut,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),c.jsx("circle",{cx:"64",cy:"64",r:ut,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:Ot,strokeDashoffset:Ir,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),fe.summary.notIndexed>0&&c.jsx("circle",{cx:"64",cy:"64",r:ut,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Ri} ${Ot-Ri}`,strokeDashoffset:-ys,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),c.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[c.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(Ne*100).toFixed(0),"%"]}),c.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),c.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:fe.summary.indexed.toLocaleString()}),c.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),c.jsx("div",{className:"h-8 w-px bg-zinc-800"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:fe.summary.notIndexed.toLocaleString()}),c.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(fe.reasonGroups??[]).length>0&&c.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(fe.reasonGroups??[]).length," ",(fe.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),fe.summary.deindexed>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"h-8 w-px bg-zinc-800"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:fe.summary.deindexed.toLocaleString()}),c.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),c.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(G=>{const Ne=G==="indexed"?fe.indexed.length:G==="notIndexed"?fe.notIndexed.length:fe.deindexed.length,bt=G==="indexed"?"Indexed":G==="notIndexed"?"Not Indexed":"Deindexed";return c.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${Ye===G?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{be(G),Ge(null)},children:[bt," (",Ne,")"]},G)})}),c.jsxs("div",{className:"mt-3 overflow-x-auto",children:[Ye==="indexed"&&fe.indexed.length>0&&c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Verdict"}),c.jsx("th",{className:"text-left",children:"Last Crawl"}),c.jsx("th",{className:"text-left",children:"Mobile"})]})}),c.jsx("tbody",{children:fe.indexed.map(G=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),c.jsx("td",{className:"text-zinc-400",children:G.verdict??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:G.crawlTime?G.crawlTime.split("T")[0]:"—"}),c.jsx("td",{className:"text-zinc-400",children:G.isMobileFriendly===!0?"Yes":G.isMobileFriendly===!1?"No":"—"})]},G.id))})]}),Ye==="notIndexed"&&!Ee&&(fe.reasonGroups??[]).length>0&&c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"Reason"}),c.jsx("th",{className:"text-right",children:"Pages"})]})}),c.jsx("tbody",{children:(fe.reasonGroups??[]).map(G=>c.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Ge(G.reason),children:[c.jsx("td",{className:"text-zinc-200",children:G.reason}),c.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:G.count})]},G.reason))})]}),Ye==="notIndexed"&&!Ee&&(fe.reasonGroups??[]).length===0&&fe.notIndexed.length>0&&c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Indexing State"}),c.jsx("th",{className:"text-left",children:"Coverage"})]})}),c.jsx("tbody",{children:fe.notIndexed.map(G=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),c.jsx("td",{className:"text-zinc-400",children:G.indexingState??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:G.coverageState??"Unknown"})]},G.id))})]}),Ye==="notIndexed"&&Ee&&(()=>{const G=(fe.reasonGroups??[]).find(Ne=>Ne.reason===Ee);return G?c.jsxs("div",{children:[c.jsx("div",{className:"flex items-center gap-2 mb-3",children:c.jsxs("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Ge(null),children:["←"," Back to reasons"]})}),c.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium text-zinc-200",children:G.reason}),c.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[G.count," affected page",G.count!==1?"s":""]})]}),c.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:et,onClick:()=>{gs(G.urls.map(Ne=>Ne.url))},children:et?"Requesting…":`Request indexing (${G.count})`})]}),c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Last Crawl"}),c.jsx("th",{className:"w-8"})]})}),c.jsx("tbody",{children:G.urls.map(Ne=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Ne.url}),c.jsx("td",{className:"text-zinc-400",children:Ne.crawlTime?Ne.crawlTime.split("T")[0]:"—"}),c.jsx("td",{children:c.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:et,onClick:()=>{gs([Ne.url])},title:"Request indexing",children:"Index"})})]},Ne.id))})]})]}):null})(),Ye==="deindexed"&&fe.deindexed.length>0&&c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Previous"}),c.jsx("th",{className:"text-left",children:"Current"}),c.jsx("th",{className:"text-left",children:"Detected"})]})}),c.jsx("tbody",{children:fe.deindexed.map((G,Ne)=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),c.jsx("td",{className:"text-zinc-400",children:G.previousState}),c.jsx("td",{className:"text-zinc-400",children:G.currentState}),c.jsx("td",{className:"text-zinc-400",children:G.transitionDate.split("T")[0]})]},`${G.url}-${Ne}`))})]}),(Ye==="indexed"&&fe.indexed.length===0||Ye==="notIndexed"&&!Ee&&fe.notIndexed.length===0||Ye==="deindexed"&&fe.deindexed.length===0)&&c.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):c.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:ee?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),c.jsxs(qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),c.jsx("h3",{children:"Search performance"})]}),c.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:U,onClick:()=>{Aa()},children:U?"Loading…":"Apply filters"})]}),u.length>0&&(()=>{const G=new Map;for(const st of u){const xt=G.get(st.date);xt?(xt.clicks+=st.clicks,xt.impressions+=st.impressions):G.set(st.date,{clicks:st.clicks,impressions:st.impressions})}const Ne=[...G.entries()].sort(([st],[xt])=>st.localeCompare(xt));if(Ne.length===0)return null;const bt=Math.max(...Ne.map(([,st])=>st.impressions),1),ut=Ne.reduce((st,[,xt])=>st+xt.clicks,0),Ot=Ne.reduce((st,[,xt])=>st+xt.impressions,0),Ir=Ot>0?(ut/Ot*100).toFixed(1):"0.0",Ri=700,ys=220,br={top:12,bottom:36,left:48,right:12},Ih=Ri-br.left-br.right,ti=ys-br.top-br.bottom,Oa=Ih/Ne.length,Mi=Math.max(Math.min(Oa*.35,24),4),Ea=Math.max(Mi*.15,1),zo=st=>{if(st<=0)return 1;const xt=Math.pow(10,Math.floor(Math.log10(st))),Lr=st/xt,Ii=Lr<=1.5?1.5:Lr<=3?3:Lr<=5?5:10;return Math.ceil(Ii*xt)},Di=4,an=Math.ceil(zo(bt)/Di)*Di,Lh=Array.from({length:Di+1},(st,xt)=>an/Di*xt),$h=st=>st>=1e3?`${(st/1e3).toFixed(st>=1e4?0:1)}k`:String(st);return c.jsxs("div",{className:"mt-3",children:[c.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),c.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",c.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:ut.toLocaleString()})]})]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),c.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",c.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Ot.toLocaleString()})]})]}),c.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",c.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Ir,"%"]})]})]}),c.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Ri} / ${ys}`},children:c.jsxs("svg",{viewBox:`0 0 ${Ri} ${ys}`,className:"h-full w-full",children:[Lh.map((st,xt)=>{const Lr=br.top+ti-st/an*ti;return c.jsxs("g",{children:[c.jsx("line",{x1:br.left,y1:Lr,x2:Ri-br.right,y2:Lr,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),c.jsx("text",{x:br.left-6,y:Lr+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:$h(st)})]},`t-${xt}`)}),Ne.map(([st,xt],Lr)=>{const Ii=br.left+Oa*Lr+Oa/2,To=xt.impressions/an*ti,Bh=xt.clicks/an*ti;return c.jsxs("g",{children:[c.jsx("title",{children:`${st}
289
+ Clicks: ${xt.clicks}
290
+ Impressions: ${xt.impressions}
291
+ CTR: ${xt.impressions>0?(xt.clicks/xt.impressions*100).toFixed(1):0}%`}),c.jsx("rect",{x:Ii-Mi-Ea/2,y:br.top+ti-To,width:Mi,height:Math.max(To,1),rx:2,fill:"#3b82f6",opacity:.85}),c.jsx("rect",{x:Ii+Ea/2,y:br.top+ti-Bh,width:Mi,height:Math.max(Bh,1),rx:2,fill:"#10b981",opacity:.85})]},st)}),(()=>{const st=Math.min(Ne.length,7);return Array.from({length:st},(xt,Lr)=>{const Ii=Ne.length===1?0:Math.round(Lr/(st-1)*(Ne.length-1)),To=br.left+Oa*Ii+Oa/2;return c.jsx("text",{x:To,y:ys-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:Ne[Ii][0].slice(5)},`xl-${Ii}`)})})()]})})]})})(),c.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[c.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:M.startDate,onChange:G=>q(Ne=>({...Ne,startDate:G.target.value}))}),c.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:M.endDate,onChange:G=>q(Ne=>({...Ne,endDate:G.target.value}))}),c.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:M.query,onChange:G=>q(Ne=>({...Ne,query:G.target.value}))}),c.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:M.page,onChange:G=>q(Ne=>({...Ne,page:G.target.value}))}),c.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:M.limit,onChange:G=>q(Ne=>({...Ne,limit:G.target.value}))})]}),u.length>0?c.jsx("div",{className:"mt-3 overflow-x-auto",children:c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"Date"}),c.jsx("th",{className:"text-left",children:"Query"}),c.jsx("th",{className:"text-left",children:"Page"}),Object.values(to).map(G=>c.jsx("th",{className:"text-right","aria-sort":Me?.key===G?Me.dir==="asc"?"ascending":"descending":"none",children:c.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:()=>Pe(Ne=>Ne?.key===G?Ne.dir==="desc"?{key:G,dir:"asc"}:null:{key:G,dir:"desc"}),children:[uX[G],Me?.key===G?Me.dir==="desc"?" ↓":" ↑":""]})},G))]})}),c.jsx("tbody",{children:ze.map((G,Ne)=>c.jsxs("tr",{children:[c.jsx("td",{className:"text-zinc-400",children:G.date}),c.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:G.query}),c.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:G.page}),c.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:G.clicks.toLocaleString()}),c.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:G.impressions.toLocaleString()}),c.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(G.ctr)?G.ctr*100:0).toFixed(1),"%"]}),c.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:G.position.toFixed(1)})]},`${G.date}:${G.query}:${G.page}:${Ne}`))})]})}):c.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),c.jsxs(qe,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),c.jsx("h3",{children:"Inspect a URL"})]})}),c.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[c.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://example.com/page",value:k,onChange:G=>A(G.target.value),onKeyDown:G=>G.key==="Enter"&&void Xl()}),c.jsx(ge,{type:"button",size:"sm",disabled:se||!Ue?.propertyId||!k.trim(),onClick:Xl,children:se?"Inspecting…":"Inspect URL"})]}),v&&c.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:v.indexingState??"Unknown"})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:v.verdict??"Unknown"})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:q2(v.isMobileFriendly)})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:qi(v.crawlTime)})]})]})]}),c.jsxs(qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),c.jsx("h3",{children:"Inspection log"})]}),c.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:D,onClick:()=>{ei()},children:D?"Loading…":"Refresh history"})]}),c.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[c.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:$,onChange:G=>L(G.target.value)}),c.jsx(ge,{type:"button",size:"sm",variant:"outline",disabled:D,onClick:()=>{ei()},children:"Apply filter"})]}),f.length>0?c.jsx("div",{className:"mt-3 overflow-x-auto",children:c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Indexing"}),c.jsx("th",{className:"text-left",children:"Verdict"}),c.jsx("th",{className:"text-left",children:"Coverage"}),c.jsx("th",{className:"text-left",children:"Mobile"}),c.jsx("th",{className:"text-left",children:"Inspected"})]})}),c.jsx("tbody",{children:f.map(G=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),c.jsx("td",{className:"text-zinc-300",children:G.indexingState??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:G.verdict??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:G.coverageState??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:q2(G.isMobileFriendly)}),c.jsx("td",{className:"text-zinc-400",children:qi(G.inspectedAt)})]},G.id))})]})}):c.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),c.jsxs(qe,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),c.jsx("h3",{children:"Recent indexing losses"})]})}),m.length>0?c.jsx("div",{className:"mt-3 overflow-x-auto",children:c.jsxs("table",{className:"data-table w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left",children:"URL"}),c.jsx("th",{className:"text-left",children:"Previous"}),c.jsx("th",{className:"text-left",children:"Current"}),c.jsx("th",{className:"text-left",children:"Changed at"})]})}),c.jsx("tbody",{children:m.map(G=>c.jsxs("tr",{children:[c.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),c.jsx("td",{className:"text-zinc-400",children:G.previousState??"Unknown"}),c.jsx("td",{className:"text-zinc-300",children:G.currentState??"Unknown"}),c.jsx("td",{className:"text-zinc-400",children:qi(G.transitionDate)})]},`${G.url}:${G.transitionDate}`))})]})}):c.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),Ue&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:c.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>ve(G=>!G),children:[c.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 ${wn?"rotate-90":""}`,"aria-hidden":"true",children:c.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"})}),c.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),wn&&c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[c.jsxs(qe,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),c.jsx("h3",{children:"Pick the Search Console property"})]})}),c.jsxs("div",{className:"mt-3 space-y-2",children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),c.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:Q||a.length===0,onChange:G=>j(G.target.value),children:a.length===0?c.jsx("option",{value:"",children:Q?"Loading properties…":"No properties available"}):a.map(G=>c.jsxs("option",{value:G.siteUrl,children:[G.siteUrl," · ",G.permissionLevel]},G.siteUrl))}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(ge,{type:"button",size:"sm",variant:"outline",disabled:Q,onClick:()=>{_o(Ue)},children:Q?"Refreshing…":"Refresh properties"}),c.jsx(ge,{type:"button",size:"sm",disabled:!S||we,onClick:Dh,children:we?"Saving…":"Save property"})]}),c.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),c.jsxs(qe,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),c.jsx("h3",{children:"Import GSC performance data"})]})}),c.jsxs("div",{className:"mt-3 space-y-3",children:[c.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),c.jsx("input",{id:`gsc-sync-days-${e}`,type:"number",min:"1",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",value:_,onChange:G=>C(G.target.value)})]}),c.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:[c.jsx("input",{type:"checkbox",checked:P,onChange:G=>E(G.target.checked)}),"Replace existing imported rows for the requested range"]})]}),c.jsx(ge,{type:"button",size:"sm",disabled:Se.isPending||!Ue.propertyId,onClick:Qu,children:Se.isPending?"Queueing…":"Queue sync"}),!Ue.propertyId&&c.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),c.jsxs(qe,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),c.jsx("h3",{children:"Sitemap configuration"})]})}),c.jsxs("div",{className:"mt-3 space-y-3",children:[Ue.sitemapUrl&&c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:Ue.sitemapUrl})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(ge,{type:"button",size:"sm",variant:"outline",disabled:Ae||!Ue.propertyId,onClick:()=>{Eo()},children:Ae?"Loading…":"Browse sitemaps from GSC"}),c.jsx(ge,{type:"button",size:"sm",variant:"outline",disabled:lr.isPending||!Ue.propertyId,onClick:Ql,children:lr.isPending?"Discovering…":"Auto-discover and queue inspection"})]}),c.jsx("p",{className:"text-xs text-zinc-500",children:"Browse lists available sitemaps without queueing a run. Auto-discover saves the primary sitemap and queues an inspection."}),Ke&&Ke.length>0&&c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[c.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",Ke.length,")"]}),Ke.map(G=>{const Ne=G.contents?.[0];return c.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-zinc-200 break-all",children:G.path}),G.lastSubmitted&&c.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",G.lastSubmitted.split("T")[0]]})]}),c.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[Ne&&c.jsxs("div",{className:"text-right",children:[c.jsxs("p",{className:"text-zinc-300",children:[Ne.indexed," / ",Ne.submitted]}),c.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),c.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>at(G.path),children:"Use"})]})]},G.path)})]}),c.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[c.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:Ue.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:it,onChange:G=>at(G.target.value),onKeyDown:G=>G.key==="Enter"&&it.trim()&&void Oo()}),c.jsx(ge,{type:"button",size:"sm",disabled:At||!it.trim(),onClick:Oo,children:At?"Saving…":Ue.sitemapUrl?"Update":"Save"})]}),c.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[c.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}`}),c.jsx(ge,{type:"button",size:"sm",variant:"outline",disabled:ms.isPending||!Ue.propertyId,onClick:async()=>{const Ne=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||Ue.sitemapUrl||void 0;Xe(null),Ut(null);try{await ms.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:Ne}})}catch{}},children:ms.isPending?"Queueing…":"Inspect sitemap"})]}),!Ue.propertyId&&c.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function ES({children:e,label:t="More info",placement:n="top",className:r}){const i=b.useId(),[a,o]=b.useState(!1);return c.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[c.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:()=>o(!0),onMouseLeave:()=>o(!1),onFocus:()=>o(!0),onBlur:()=>o(!1),children:c.jsx(WI,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&c.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 nl=50;function Vc(e){return typeof window>"u"?e:`${window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??""}${e}`}function Um(e){return e.toLocaleString()}function BNe(e){const t=Number(e);return Number.isFinite(t)?`${(t*100).toFixed(1)}%`:"—"}function UNe(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 FNe(e){const t=e.filter(n=>n.kind===sn["backlink-extract"]&&!rN(n.status));return t.length===0?null:t.reduce((n,r)=>n.createdAt>r.createdAt?n:r)}function qNe(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 HNe({projectName:e}){const[t,n]=b.useState(null),[r,i]=b.useState(null),[a,o]=b.useState([]),[u,d]=b.useState(null),[f,p]=b.useState(null),[m,y]=b.useState(null),[v,w]=b.useState(Date.now()),[S,j]=b.useState(0),[k,A]=b.useState(!0),[_,C]=b.useState(!1),[P,E]=b.useState(null),O=b.useRef(null),T=b.useCallback(async()=>{A(!0),E(null);try{const[Z,H,Q,he,we]=await Promise.all([KI().catch(()=>null),$7(e).catch(()=>null),B7(e,{limit:nl,offset:S}).catch(U=>{if(U instanceof Ci&&U.code==="NOT_FOUND")return null;throw U}),U7(e).catch(()=>[]),MK(e).catch(()=>[])]);d(Z),n(H),i(Q),o(he);const R=FNe(we);p(R),O.current=R?.id??null}catch(Z){E(Z instanceof Error?Z.message:"Failed to load backlinks")}finally{A(!1)}},[e,S]);b.useEffect(()=>{T()},[T]),b.useEffect(()=>{if(!f)return;const Z=f.id;let H=!1;const Q=async()=>{try{const we=await Al(Z);if(H)return;rN(we.status)?(p(null),y(we),await T()):p(R=>R?.id===we.id?{...R,...we}:R)}catch{}},he=window.setInterval(()=>{Q()},3e3);return()=>{H=!0,window.clearInterval(he)}},[f,T]),b.useEffect(()=>{if(!f)return;const Z=window.setInterval(()=>w(Date.now()),1e3);return()=>window.clearInterval(Z)},[f]),b.useEffect(()=>{if(!m||m.status==="failed")return;const Z=window.setTimeout(()=>y(null),1e4);return()=>window.clearTimeout(Z)},[m]);async function M(){C(!0),E(null);try{const Z=await F7(e);p(Z),O.current=Z.id}catch(Z){Z instanceof Ci&&Z.code==="MISSING_DEPENDENCY"?E("DuckDB is not installed. Visit the Backlinks admin page to install it."):E(Z instanceof Error?Z.message:"Failed to trigger extract")}finally{C(!1)}}const q=b.useMemo(()=>a.slice().sort((Z,H)=>Z.queriedAt.localeCompare(H.queriedAt)).map(Z=>({date:Z.queriedAt,linkingDomains:Z.totalLinkingDomains})),[a]),$=r&&r.total>nl,L=Math.floor(S/nl)+1,J=r?Math.max(1,Math.ceil(r.total/nl)):1;return c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Backlinks"}),c.jsx("h2",{children:"Referring domains"}),c.jsxs("p",{className:"text-sm text-zinc-500 mt-1 max-w-2xl",children:["Domains linking to "," ",c.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."]})]})}),P&&c.jsx(qe,{className:"surface-card p-4 mb-4 border-rose-800/60",children:c.jsx("p",{className:"text-sm text-rose-300",children:P})}),f&&c.jsx(qe,{className:"surface-card p-4 mb-4 border-sky-800/60",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(XI,{className:"h-5 w-5 text-sky-400 animate-spin shrink-0 mt-0.5","aria-hidden":!0}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("p",{className:"text-sm font-medium text-zinc-100",children:"Extract running"}),c.jsx(vt,{tone:"neutral",children:f.status}),c.jsxs("span",{className:"text-xs text-zinc-500 tabular-nums",children:[qNe(f.startedAt,f.createdAt)," elapsed · refreshing every 3s"]}),c.jsxs("span",{className:"sr-only",children:["now=",v]})]}),c.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Re-querying the cached Common Crawl release for"," ",c.jsx("span",{className:"text-zinc-300",children:e}),". No re-download — the ~16 GB dump already lives at"," ",c.jsx("code",{className:"text-zinc-400",children:"~/.canonry/cache/commoncrawl/"}),". Typically takes ~5 minutes."]})]})]})}),m&&!f&&c.jsx(qe,{className:`surface-card p-4 mb-4 ${m.status==="failed"?"border-rose-800/60":"border-emerald-800/60"}`,children:c.jsxs("div",{className:"flex items-start gap-3",children:[m.status==="failed"?c.jsx("span",{className:"h-5 w-5 shrink-0 mt-0.5 text-rose-400 text-lg leading-none","aria-hidden":!0,children:"!"}):c.jsx(YI,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),c.jsxs("div",{className:"flex-1",children:[c.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?c.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:m.error}):m.status!=="failed"?c.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Backlinks refreshed from the cached release."}):null]})]})}),ae()]});function ae(){if(k)return c.jsx(qe,{className:"surface-card p-6",children:c.jsx("p",{className:"text-sm text-zinc-500",children:"Loading backlinks…"})});const Z=t!==null&&t.totalLinkingDomains>0,H=m?.status==="failed",Q=t!==null&&t.totalLinkingDomains===0&&!H,he=u?.status==="ready",we=u?.status==="failed",R=u&&(u.status==="downloading"||u.status==="querying"||u.status==="queued");return Z?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"gauge-row",children:[c.jsxs("div",{className:"metric-card",children:[c.jsx("p",{className:"metric-card-eyebrow",children:"Referring domains"}),c.jsx("p",{className:"metric-card-big-value",children:c.jsx("span",{className:"text-zinc-50",children:Um(t.totalLinkingDomains)})}),c.jsxs("p",{className:"metric-card-sub",children:["unique domains linking to ",t.targetDomain]})]}),c.jsxs("div",{className:"metric-card",children:[c.jsx("p",{className:"metric-card-eyebrow",children:"Total linking hosts"}),c.jsx("p",{className:"metric-card-big-value",children:c.jsx("span",{className:"text-zinc-50",children:Um(t.totalHosts)})}),c.jsx("p",{className:"metric-card-sub",children:"aggregate host count across referring domains"})]}),c.jsxs("div",{className:"metric-card",children:[c.jsx("p",{className:"metric-card-eyebrow",children:"Top-10 concentration"}),c.jsx("p",{className:"metric-card-big-value",children:c.jsx("span",{className:"text-zinc-50",children:BNe(t.top10HostsShare)})}),c.jsx("p",{className:"metric-card-sub",children:"share of hosts from the 10 largest linking domains"})]})]}),c.jsxs("p",{className:"text-xs text-zinc-600 mt-2",children:["Release ",c.jsx("code",{className:"text-zinc-400",children:t.release})," · queried ",UNe(t.queriedAt)]}),q.length>=2&&c.jsxs(qe,{className:"surface-card p-4 mt-4",children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Referring domains over releases"}),c.jsx("div",{className:"h-40 mt-2",children:c.jsx(Wg,{width:"100%",height:"100%",children:c.jsxs(Oy,{data:q,margin:{top:8,right:12,bottom:0,left:12},children:[c.jsx("defs",{children:c.jsxs("linearGradient",{id:"bl-gradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"0%",stopColor:io[0],stopOpacity:.4}),c.jsx("stop",{offset:"100%",stopColor:io[0],stopOpacity:0})]})}),c.jsx(Jf,{dataKey:"date",tick:ro,stroke:th,tickFormatter:zy}),c.jsx(eh,{tick:ro,stroke:th,allowDecimals:!1}),c.jsx(wy,{contentStyle:pu.contentStyle,labelStyle:pu.labelStyle,itemStyle:pu.itemStyle,labelFormatter:Ey}),c.jsx(yl,{type:"monotone",dataKey:"linkingDomains",name:"Referring domains",stroke:io[0],fill:"url(#bl-gradient)",strokeWidth:2})]})})})]}),c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Top referring domains"}),$&&c.jsxs("p",{className:"text-xs text-zinc-600",children:["Page ",L," of ",J," · ",Um(r.total)," total"]})]}),c.jsx(qe,{className:"surface-card overflow-hidden",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[c.jsx("th",{className:"px-4 py-2 font-medium",children:"Domain"}),c.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Linking hosts"})]})}),c.jsxs("tbody",{children:[(r?.rows??[]).map(U=>c.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[c.jsx("td",{className:"px-4 py-2 text-zinc-200",children:U.linkingDomain}),c.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:Um(U.numHosts)})]},U.linkingDomain)),r?.rows.length===0&&c.jsx("tr",{children:c.jsx("td",{className:"px-4 py-4 text-sm text-zinc-500",colSpan:2,children:"No referring domains in this release."})})]})]})}),$&&c.jsxs("div",{className:"flex items-center justify-end gap-2 mt-2",children:[c.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:S===0,onClick:()=>j(U=>Math.max(0,U-nl)),children:"Previous"}),c.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:S+nl>=(r?.total??0),onClick:()=>j(U=>U+nl),children:"Next"})]})]}),c.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[c.jsxs(ge,{type:"button",variant:"outline",size:"sm",disabled:_||f!==null,onClick:M,children:[c.jsx(Vj,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":_?"Queuing…":"Re-run extract"]}),c.jsxs(ES,{label:"What does Re-run extract do?",children:[c.jsxs("span",{className:"block",children:["Re-queries the ",c.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",c.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," for ",c.jsx("span",{className:"text-zinc-200",children:e}),". Replaces existing backlink rows for this project under the current release."]}),c.jsxs("span",{className:"mt-2 block text-zinc-400",children:[c.jsx("span",{className:"text-zinc-200",children:"No re-download"})," of the ~16 GB dump. Typically ",c.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]}),c.jsx(ge,{asChild:!0,type:"button",variant:"outline",size:"sm",children:c.jsx("a",{href:Vc("/backlinks"),children:"Open admin"})})]})]}):c.jsx(qe,{className:"surface-card p-6",children:c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-zinc-900 text-zinc-400",children:c.jsx(QI,{className:"h-5 w-5","aria-hidden":!0})}),c.jsxs("div",{className:"flex-1",children:[!u&&c.jsxs(c.Fragment,{children:[c.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No release sync yet"}),c.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."}),c.jsx("div",{className:"mt-4",children:c.jsx(ge,{asChild:!0,type:"button",size:"sm",children:c.jsx("a",{href:Vc("/backlinks"),children:"Set up backlinks"})})})]}),R&&c.jsxs(c.Fragment,{children:[c.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Sync in progress"}),c.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."]}),c.jsx("div",{className:"mt-4",children:c.jsx(ge,{asChild:!0,type:"button",variant:"outline",size:"sm",children:c.jsx("a",{href:Vc("/backlinks"),children:"View sync status"})})})]}),we&&c.jsxs(c.Fragment,{children:[c.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last sync failed"}),c.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:u.error??"The workspace release sync failed. Retry from the Backlinks admin page."}),c.jsx("div",{className:"mt-4",children:c.jsx(ge,{asChild:!0,type:"button",size:"sm",children:c.jsx("a",{href:Vc("/backlinks"),children:"Go to Backlinks admin"})})})]}),he&&!R&&!Q&&!H&&c.jsxs(c.Fragment,{children:[c.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No backlinks yet for this project"}),c.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["Release ",c.jsx("code",{className:"text-zinc-300",children:u.release})," is ready but no backlinks have been extracted for"," ",c.jsx("code",{className:"text-zinc-300",children:e}),". Run an extract to populate data using the cached release."]}),c.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[c.jsxs(ge,{type:"button",size:"sm",disabled:_||f!==null,onClick:M,children:[c.jsx(yg,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":_?"Queuing…":"Run extract"]}),c.jsxs(ES,{label:"What does Run extract do?",children:[c.jsxs("span",{className:"block",children:["Runs a DuckDB query against the ",c.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",c.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," to find referring domains for ",c.jsx("span",{className:"text-zinc-200",children:e}),"."]}),c.jsxs("span",{className:"mt-2 block text-zinc-400",children:["No re-download. Typically takes ",c.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]})]})]}),H&&c.jsxs(c.Fragment,{children:[c.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last extract failed"}),c.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["See the error above for details. If the cache files for release"," ",c.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."]}),c.jsx("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:c.jsx(ge,{asChild:!0,type:"button",size:"sm",children:c.jsx("a",{href:Vc("/backlinks"),children:"Go to Backlinks admin"})})})]}),Q&&c.jsxs(c.Fragment,{children:[c.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No referring domains found"}),c.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["The last extract against release ",c.jsx("code",{className:"text-zinc-300",children:t.release})," found"," ",c.jsx("span",{className:"text-zinc-300",children:"0 referring domains"})," for"," ",c.jsx("code",{className:"text-zinc-300",children:t.targetDomain}),". This can happen when:"]}),c.jsxs("ul",{className:"mt-2 space-y-1 text-xs text-zinc-500 list-disc list-inside",children:[c.jsx("li",{children:"the domain is newer than the release’s crawl window"}),c.jsx("li",{children:"the Common Crawl snapshot didn’t capture pages that link to it"}),c.jsx("li",{children:"the extract ran against a cache that was missing or incomplete"})]}),c.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."}),c.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[c.jsx(ge,{asChild:!0,type:"button",size:"sm",children:c.jsx("a",{href:Vc("/backlinks"),children:"Go to Backlinks admin"})}),c.jsxs(ge,{type:"button",variant:"outline",size:"sm",disabled:_||f!==null,onClick:M,children:[c.jsx(yg,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":_?"Queuing…":"Re-run extract"]}),c.jsxs(ES,{label:"What does Re-run extract do?",children:[c.jsxs("span",{className:"block",children:["Re-queries the cached release for ",c.jsx("span",{className:"text-zinc-200",children:t.targetDomain}),". Only useful if the cache files were incomplete last time."]}),c.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 KNe({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=b.useState(!1),[a,o]=b.useState(!1),[u,d]=b.useState(null),[f,p]=b.useState(e.displayName),[m,y]=b.useState(e.canonicalDomain),[v,w]=b.useState(e.country),[S,j]=b.useState(e.language),[k,A]=b.useState(e.ownedDomains??[]),[_,C]=b.useState(""),[P,E]=b.useState(null),[O,T]=b.useState(!1),[M,q]=b.useState(!1),[$,L]=b.useState(""),[J,ae]=b.useState(""),[Z,H]=b.useState(""),[Q,he]=b.useState(""),[we,R]=b.useState("");b.useEffect(()=>{r||(p(e.displayName),y(e.canonicalDomain),w(e.country),j(e.language),A(e.ownedDomains??[]))},[e,r]);function U(){i(!1),d(null),p(e.displayName),y(e.canonicalDomain),w(e.country),j(e.language),A(e.ownedDomains??[]),C("")}function F(){const W=_.trim();W&&(k.includes(W)||A([...k,W]),C(""))}function D(W){A(k.filter(Ke=>Ke!==W))}async function Y(){if(!(!f.trim()||!m.trim()||!v.trim()||!S.trim())){o(!0),d(null);try{await t(e.name,{displayName:f.trim(),canonicalDomain:m.trim(),ownedDomains:k,country:v.trim(),language:S.trim()}),i(!1),ht({title:"Project settings saved",detail:`${f.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(W){d(W instanceof Error?W.message:"Failed to save")}finally{o(!1)}}}async function se(){const W=$.trim(),Ke=J.trim(),Re=Z.trim(),it=Q.trim();if(!(!W||!Ke||!Re||!it)){T(!0),E(null);try{const at={label:W,city:Ke,region:Re,country:it};we.trim()&&(at.timezone=we.trim()),await UK(e.name,at),n(),L(""),ae(""),H(""),he(""),R(""),q(!1),ht({title:"Location added",detail:`${W} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${W}`,dedupeMode:"drop"})}catch(at){E(at instanceof Error?at.message:"Failed to add location")}finally{T(!1)}}}async function ie(W){T(!0),E(null);try{await FK(e.name,W),n(),ht({title:"Location removed",detail:`${W} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${W}`,dedupeMode:"drop"})}catch(Ke){E(Ke instanceof Error?Ke.message:"Failed to remove location")}finally{T(!1)}}async function fe(W){T(!0),E(null);try{await qK(e.name,W),n(),ht({title:"Default location updated",detail:`${W} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Ke){E(Ke instanceof Error?Ke.message:"Failed to set default location")}finally{T(!1)}}const je=f!==e.displayName||m!==e.canonicalDomain||v!==e.country||S!==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",ue="block text-xs font-medium text-zinc-400 mb-1",Ae=$.trim()&&J.trim()&&Z.trim()&&Q.trim();return c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),c.jsx("h2",{children:"Project settings"})]}),!r&&c.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!0),children:"Edit settings"})]}),u&&c.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,c.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>d(null),children:"×"})]}),r?c.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:ue,children:"Display name"}),c.jsx("input",{className:ee,type:"text",value:f,onChange:W=>p(W.target.value),placeholder:"My Project"})]}),c.jsxs("div",{children:[c.jsx("label",{className:ue,children:"Canonical domain"}),c.jsx("input",{className:ee,type:"text",value:m,onChange:W=>y(W.target.value),placeholder:"example.com"})]}),c.jsxs("div",{children:[c.jsx("label",{className:ue,children:"Country"}),c.jsx("input",{className:ee,type:"text",value:v,onChange:W=>w(W.target.value),placeholder:"US",maxLength:2})]}),c.jsxs("div",{children:[c.jsx("label",{className:ue,children:"Language"}),c.jsx("input",{className:ee,type:"text",value:S,onChange:W=>j(W.target.value),placeholder:"en"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:ue,children:"Owned domains"}),c.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(W=>c.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:[W,c.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>D(W),"aria-label":`Remove ${W}`,children:"×"})]},W))}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{className:`${ee} flex-1`,type:"text",placeholder:"docs.example.com",value:_,onChange:W=>C(W.target.value),onKeyDown:W=>W.key==="Enter"&&(W.preventDefault(),F())}),c.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:!_.trim(),onClick:F,children:"Add"})]})]}),c.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[c.jsx(ge,{type:"button",disabled:a||!je||!f.trim()||!m.trim(),onClick:Y,children:a?"Saving...":"Save changes"}),c.jsx(ge,{type:"button",variant:"outline",disabled:a,onClick:U,children:"Cancel"})]})]}):c.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:c.jsx("table",{className:"w-full text-sm",children:c.jsxs("tbody",{children:[c.jsxs("tr",{className:"border-b border-zinc-800/40",children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),c.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),c.jsxs("tr",{className:"border-b border-zinc-800/40",children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),c.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),c.jsxs("tr",{className:"border-b border-zinc-800/40",children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),c.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?c.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(W=>c.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:W},W))}):c.jsx("span",{className:"text-zinc-500",children:"—"})})]}),c.jsxs("tr",{className:"border-b border-zinc-800/40",children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),c.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),c.jsxs("tr",{className:"border-b border-zinc-800/40",children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),c.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),c.jsxs("tr",{children:[c.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),c.jsxs("td",{className:"px-4 py-2.5",children:[P&&c.jsxs("div",{className:"mb-2 rounded border border-rose-800/40 bg-rose-950/20 px-2 py-1 text-xs text-rose-300",children:[P,c.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>E(null),children:"×"})]}),(e.locations??[]).length>0?c.jsxs("table",{className:"w-full text-xs mb-2",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-zinc-600",children:[c.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),c.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),c.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),c.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),c.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),c.jsx("th",{className:"pb-1"})]})}),c.jsx("tbody",{children:e.locations.map(W=>c.jsxs("tr",{className:"border-t border-zinc-800/30",children:[c.jsx("td",{className:"py-1.5 pr-3",children:c.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${W.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:[W.label,W.label===e.defaultLocation?" ★":""]})}),c.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:W.city}),c.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:W.region}),c.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:W.country}),c.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:W.timezone??"—"}),c.jsx("td",{className:"py-1.5",children:c.jsxs("div",{className:"flex items-center gap-1.5",children:[W.label!==e.defaultLocation&&c.jsx("button",{type:"button",disabled:O,onClick:()=>fe(W.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${W.label} as default location`,children:"Set default"}),c.jsx("button",{type:"button",disabled:O,onClick:()=>ie(W.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${W.label}`,children:"Remove"})]})})]},W.label))})]}):c.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),M?c.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[c.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),c.jsx("input",{className:ee,type:"text",value:$,onChange:W=>L(W.target.value),placeholder:"nyc"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),c.jsx("input",{className:ee,type:"text",value:J,onChange:W=>ae(W.target.value),placeholder:"New York"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),c.jsx("input",{className:ee,type:"text",value:Z,onChange:W=>H(W.target.value),placeholder:"NY"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),c.jsx("input",{className:ee,type:"text",value:Q,onChange:W=>he(W.target.value),placeholder:"US",maxLength:2})]}),c.jsxs("div",{className:"col-span-2",children:[c.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),c.jsx("input",{className:ee,type:"text",value:we,onChange:W=>R(W.target.value),placeholder:"America/New_York"})]})]}),c.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[c.jsx(ge,{type:"button",size:"sm",disabled:O||!Ae,onClick:se,children:O?"Adding...":"Add location"}),c.jsx(ge,{type:"button",size:"sm",variant:"outline",disabled:O,onClick:()=>{q(!1),E(null)},children:"Cancel"})]})]}):c.jsx(ge,{type:"button",size:"sm",variant:"outline",onClick:()=>q(!0),children:"+ Add location"})]})]})]})})})]})}const GNe=[{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"}],ZD=["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 VNe({projectName:e}){const[t,n]=b.useState("loading"),[r,i]=b.useState(!1),[a,o]=b.useState("daily"),[u,d]=b.useState(6),[f,p]=b.useState(""),[m,y]=b.useState("UTC"),[v,w]=b.useState(!1),[S,j]=b.useState(""),[k,A]=b.useState(!1),[_,C]=b.useState(!1),[P,E]=b.useState(null);b.useEffect(()=>{QK(e).then(n).catch(()=>n(null))},[e]);const O=()=>{if(t&&t!=="loading"){const $=hX(t.preset??null,t.cronExpr);o($.freq),d($.hour),p($.customCron);const L=ZD.includes(t.timezone);y(L?t.timezone:"Other"),w(!L),j(L?"":t.timezone)}else o("daily"),d(6),p(""),y("UTC"),w(!1),j("");E(null),i(!0)},T=async()=>{A(!0),E(null);try{const L={timezone:v?S.trim()||"UTC":m};a==="custom"?L.cron=f.trim():L.preset=fX(a,u);const J=await i2(e,L);n(J),i(!1),ht({title:"Schedule saved",detail:_x(J.preset??null,J.cronExpr,J.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch($){E($ instanceof Error?$.message:"Failed to save schedule")}finally{A(!1)}},M=async()=>{if(!(!t||t==="loading")){A(!0),E(null);try{const $={timezone:t.timezone,enabled:!t.enabled};t.preset?$.preset=t.preset:$.cron=t.cronExpr;const L=await i2(e,$);n(L),ht({title:L.enabled?"Schedule resumed":"Schedule paused",detail:_x(L.preset??null,L.cronExpr,L.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch($){E($ instanceof Error?$.message:"Failed to update schedule")}finally{A(!1)}}},q=async()=>{C(!0),E(null);try{await XK(e),n(null),i(!1),ht({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch($){E($ instanceof Error?$.message:"Failed to remove schedule")}finally{C(!1)}};return c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),c.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!r&&c.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:O,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&c.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&c.jsx(qe,{className:"surface-card compact-card",children:c.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!r&&t!==null&&c.jsxs(qe,{className:"surface-card compact-card",children:[c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("p",{className:"text-sm font-medium text-zinc-200",children:_x(t.preset??null,t.cronExpr,t.timezone)}),c.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",c.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&c.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&c.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsx(vt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),c.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:M,children:t.enabled?"Pause":"Resume"}),c.jsx(ge,{type:"button",variant:"ghost",size:"sm",disabled:_,onClick:q,children:_?"Removing...":"Remove"})]})]}),P&&c.jsx("p",{className:"text-rose-400 text-sm mt-2",children:P})]}),r&&c.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),c.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:$=>o($.target.value),children:GNe.map($=>c.jsx("option",{value:$.value,children:$.label},$.value))})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),c.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:$=>d(parseInt($.target.value)),children:Array.from({length:24},($,L)=>c.jsx("option",{value:L,children:e1(L)},L))})]})]}),a==="custom"&&c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),c.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:$=>p($.target.value)})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),c.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:$=>{$.target.value==="Other"?(w(!0),y("Other")):(w(!1),y($.target.value))},children:[ZD.map($=>c.jsx("option",{value:$,children:$},$)),c.jsxs("option",{value:"Other",children:["Other (enter manually)","…"]})]}),v&&c.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:S,onChange:$=>j($.target.value)})]}),P&&c.jsx("p",{className:"text-rose-400 text-sm",children:P}),c.jsxs("div",{className:"flex gap-2 justify-end",children:[c.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),E(null)},children:"Cancel"}),c.jsx(ge,{type:"button",size:"sm",disabled:k||a==="custom"&&!f.trim(),onClick:T,children:k?"Saving...":"Save schedule"})]})]})]})}const ZNe=[{value:"citation.lost",label:"Citation lost"},{value:"citation.gained",label:"Citation gained"},{value:"run.completed",label:"Run completed"},{value:"run.failed",label:"Run failed"}];function YNe({projectName:e}){const[t,n]=b.useState("loading"),[r,i]=b.useState(!1),[a,o]=b.useState(""),[u,d]=b.useState(["citation.lost","citation.gained"]),[f,p]=b.useState(!1),[m,y]=b.useState(null),[v,w]=b.useState({});b.useEffect(()=>{JK(e).then(n).catch(()=>n([]))},[e]);const S=_=>{d(C=>C.includes(_)?C.filter(P=>P!==_):[...C,_])},j=async()=>{if(!(!a.trim()||u.length===0)){p(!0),y(null);try{const _=await e7(e,{channel:"webhook",url:a.trim(),events:u});n(C=>C==="loading"?[_]:[...C,_]),o(""),d(["citation.lost","citation.gained"]),i(!1),ht({title:"Webhook added",detail:`Notifications will be sent to ${_.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(_){y(_ instanceof Error?_.message:"Failed to add webhook")}finally{p(!1)}}},k=async _=>{try{await t7(e,_),n(C=>C==="loading"?C:C.filter(P=>P.id!==_)),ht({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${_}`,dedupeMode:"drop"})}catch(C){y(C instanceof Error?C.message:"Failed to remove webhook")}},A=async _=>{w(C=>({...C,[_]:{state:"testing"}}));try{const C=await n7(e,_);w(P=>({...P,[_]:{state:C.ok?"ok":"fail",status:C.status}})),C.ok&&ht({title:"Test notification sent",detail:`Webhook returned status ${C.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${_}`,dedupeMode:"replace"})}catch{w(C=>({...C,[_]:{state:"fail"}}))}};return c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),c.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&c.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),y(null)},children:r?"Cancel":"+ Add webhook"})]}),r&&c.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),c.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://hooks.example.com/canonry",value:a,onChange:_=>o(_.target.value)})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),c.jsx("div",{className:"flex flex-wrap gap-3",children:ZNe.map(_=>c.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[c.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:u.includes(_.value),onChange:()=>S(_.value)}),c.jsx("span",{className:"text-sm text-zinc-300",children:_.label})]},_.value))})]}),m&&c.jsx("p",{className:"text-rose-400 text-sm",children:m}),c.jsxs("div",{className:"flex gap-2 justify-end",children:[c.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),y(null)},children:"Cancel"}),c.jsx(ge,{type:"button",size:"sm",disabled:f||!a.trim()||u.length===0,onClick:j,children:f?"Adding...":"Add webhook"})]})]}),t==="loading"&&c.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&c.jsx(qe,{className:"surface-card compact-card",children:c.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&&c.jsxs("div",{className:"evidence-table-wrap",children:[c.jsxs("table",{className:"evidence-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Endpoint"}),c.jsx("th",{children:"Events"}),c.jsx("th",{children:"Status"}),c.jsx("th",{})]})}),c.jsx("tbody",{children:t.map(_=>c.jsxs("tr",{children:[c.jsx("td",{className:"evidence-keyword-cell",children:c.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:_.urlHost,children:_.urlDisplay??_.url})}),c.jsx("td",{children:c.jsx("div",{className:"flex flex-wrap gap-1",children:_.events.map(C=>c.jsx("span",{className:"inline-flex items-center rounded-full border border-zinc-700 bg-zinc-800/60 px-2 py-0.5 text-[10px] font-medium text-zinc-400 uppercase tracking-wide",children:C.replace("."," ")},C))})}),c.jsx("td",{children:c.jsx(vt,{tone:_.enabled?"positive":"neutral",children:_.enabled?"Active":"Paused"})}),c.jsx("td",{children:c.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[v[_.id]&&(()=>{const C=v[_.id],P=C.state==="testing"?"Sending…":C.state==="ok"?`Delivered${C.status?` (${C.status})`:""}`:`Failed${C.status?` (${C.status})`:""}`;return c.jsx(vt,{tone:C.state==="ok"?"positive":C.state==="fail"?"negative":"neutral",children:P})})(),c.jsx(ge,{variant:"ghost",size:"sm",type:"button",disabled:v[_.id]?.state==="testing",onClick:()=>A(_.id),children:"Test"}),c.jsx(ge,{variant:"ghost",size:"sm",type:"button",onClick:()=>k(_.id),children:"Remove"})]})})]},_.id))})]}),m&&c.jsx("p",{className:"text-rose-400 text-sm mt-2",children:m})]})]})}function WNe({projectName:e,refreshNonce:t}){const[n,r]=b.useState(null),[i,a]=b.useState([]),[o,u]=b.useState(null),[d,f]=b.useState([]),[p,m]=b.useState([]),[y,v]=b.useState(null),[w,S]=b.useState(""),[j,k]=b.useState(""),[A,_]=b.useState(""),[C,P]=b.useState(!0),[E,O]=b.useState(!1),[T,M]=b.useState(null),[q,$]=b.useState("coverage");b.useEffect(()=>{L()},[e,t]);async function L(){P(!0),M(null);try{const R=await UI(e);if(r(R),R.connected){const[U,F,D,Y]=await Promise.all([Kj(e).catch(()=>null),FI(e).catch(()=>[]),N7(e).catch(()=>[]),R.siteUrl?Promise.resolve([]):S7(e).then(se=>se.sites).catch(()=>[])]);u(U),f(F),m(D),a(Y)}else u(null),f([]),m([]),a([])}catch(R){M(R instanceof Error?R.message:"Failed to load Bing data")}finally{P(!1)}}async function J(){if(j.trim()){M(null);try{const R=await x7(e,j.trim());k(""),R.availableSites.length>0&&a(R.availableSites),await L()}catch(R){M(R instanceof Error?R.message:"Failed to connect")}}}async function ae(){try{await w7(e),r(null),a([]),u(null),f([]),m([]),v(null),_(""),M(null)}catch(R){M(R instanceof Error?R.message:"Failed to disconnect")}}async function Z(){if(A)try{await j7(e,A),await L()}catch(R){M(R instanceof Error?R.message:"Failed to set site")}}async function H(){if(w.trim())try{const R=await qI(e,w.trim());v(R),f(U=>[R,...U])}catch(R){M(R instanceof Error?R.message:"Inspection failed")}}async function Q(R){O(!0),M(null);try{const U=await o2(e,{urls:[R]}),{succeeded:F,failed:D,total:Y}=U.summary;ht({title:"Bing submission requested",detail:D===0?`${F} URL submitted to Bing.`:`${F}/${Y} submitted successfully, ${D} failed.`,tone:D===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${R}`,dedupeMode:"replace"})}catch(U){const F=U instanceof Error?U.message:"Submission failed";M(F),ht({title:"Bing submission failed",detail:F,tone:"negative",dedupeKey:`bing:indexing:${e}:${R}`,dedupeMode:"replace"})}finally{O(!1)}}async function he(){O(!0),M(null),ht({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const R=await o2(e,{allUnindexed:!0}),{succeeded:U,failed:F,total:D}=R.summary;ht({title:"Bing submissions requested",detail:F===0?`${U}/${D} URL${D!==1?"s":""} submitted to Bing.`:`${U}/${D} submitted successfully, ${F} failed.`,tone:F===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(R){const U=R instanceof Error?R.message:"Batch submission failed";M(U),ht({title:"Bing submissions failed",detail:U,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{O(!1)}}if(C)return c.jsx(qe,{className:"surface-card",children:c.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!n?.connected)return c.jsxs(qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),c.jsx("h3",{children:"Domain authorization"})]}),c.jsx(vt,{tone:"caution",children:"Not connected"})]}),c.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),c.jsxs("div",{className:"mt-3",children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),c.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[c.jsx("input",{id:"bing-api-key",type:"password",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:j,onChange:R=>k(R.target.value),onKeyDown:R=>R.key==="Enter"&&J()}),c.jsx(ge,{size:"sm",disabled:!j.trim(),onClick:J,children:"Connect"})]}),c.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",c.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]})]}),T&&c.jsx("p",{className:"mt-3 text-xs text-rose-400",children:T})]});if(!n.siteUrl)return c.jsxs(qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),c.jsx("h3",{children:"Domain authorization"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(vt,{tone:"positive",children:"Connected"}),c.jsx(ge,{size:"sm",variant:"ghost",onClick:ae,children:"Disconnect"})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),c.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),c.jsx("span",{className:"text-xs text-zinc-500",children:n.domain})]}),c.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."})]}),c.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.domain})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.updatedAt?qi(n.updatedAt):"—"})]})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),i.length>0?c.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[c.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:A,onChange:R=>_(R.target.value),children:[c.jsx("option",{value:"",children:"Select a site..."}),i.map(R=>c.jsxs("option",{value:R.url,children:[R.url,R.verified?" (verified)":""]},R.url))]}),c.jsx(ge,{size:"sm",disabled:!A,onClick:Z,children:"Set Site"})]}):c.jsx("p",{className:"mt-3 text-xs text-zinc-500",children:"No verified Bing sites are available yet. Verify the domain in Bing Webmaster Tools, then use the page-level refresh to reload everything."})]})]}),T&&c.jsx("p",{className:"mt-3 text-xs text-rose-400",children:T})]});const we=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return c.jsxs("div",{className:"space-y-3",children:[c.jsxs(qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),c.jsx("h3",{children:"Domain authorization"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(vt,{tone:"positive",children:"Connected"}),c.jsx(ge,{size:"sm",variant:"ghost",onClick:ae,children:"Disconnect"})]})]}),T&&c.jsx("p",{className:"mb-3 text-xs text-rose-400",children:T}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),c.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),c.jsx("span",{className:"text-xs text-zinc-500",children:n.domain})]}),c.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",c.jsx("code",{children:n.siteUrl}),"."]})]}),c.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.siteUrl})]}),c.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),c.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.updatedAt?qi(n.updatedAt):"—"})]})]})]})]}),c.jsxs(qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),c.jsx("h3",{children:"Index monitoring"})]}),c.jsx("p",{className:"text-xs text-zinc-500",children:o?.lastInspectedAt?`Last inspected ${qi(o.lastInspectedAt)}`:"No inspection history yet"})]}),c.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:we.map(R=>c.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${q===R.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>$(R.key),children:R.label},R.key))}),q==="coverage"&&o&&c.jsxs("div",{className:"mt-4 space-y-4",children:[c.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[c.jsx(Nm,{label:"Indexed",value:o.summary.indexed,tone:"positive"}),c.jsx(Nm,{label:"Not in index",value:o.summary.notIndexed+(o.summary.unknown??0),tone:"negative"}),c.jsx(Nm,{label:"Status unknown",value:o.summary.unknown??0,tone:"neutral"}),c.jsx(Nm,{label:"Coverage",value:`${o.summary.percentage}%`,tone:"neutral"})]}),o.notIndexed.length>0&&c.jsxs("div",{children:[c.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[c.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",o.notIndexed.length,")"]}),c.jsx(ge,{size:"sm",variant:"ghost",disabled:E,onClick:he,children:E?"Submitting…":"Submit all to Bing"})]}),c.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:c.jsxs("table",{className:"w-full text-xs",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-zinc-800",children:[c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),c.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),c.jsx("tbody",{children:o.notIndexed.map(R=>c.jsxs("tr",{className:"border-b border-zinc-800/50",children:[c.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:R.url}),c.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:R.httpCode??"—"}),c.jsx("td",{className:"py-1.5 px-3 text-right",children:c.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:E,onClick:()=>Q(R.url),children:"Submit"})})]},R.id))})]})})]}),(o.unknown??[]).length>0&&c.jsxs("div",{children:[c.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[c.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(o.unknown??[]).length,")"]}),c.jsx(ge,{size:"sm",variant:"ghost",disabled:E,onClick:he,children:E?"Submitting…":"Submit all to Bing"})]}),c.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:c.jsxs("table",{className:"w-full text-xs",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-zinc-800",children:[c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),c.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),c.jsx("tbody",{children:(o.unknown??[]).map(R=>c.jsxs("tr",{className:"border-b border-zinc-800/50",children:[c.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:R.url}),c.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:R.lastCrawledDate?qi(R.lastCrawledDate):"—"}),c.jsx("td",{className:"py-1.5 px-3 text-right",children:c.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:E,onClick:()=>Q(R.url),children:"Submit"})})]},R.id))})]})})]}),o.indexed.length>0&&c.jsxs("div",{children:[c.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",o.indexed.length,")"]}),c.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:c.jsxs("table",{className:"w-full text-xs",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-zinc-800",children:[c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),c.jsx("tbody",{children:o.indexed.map(R=>c.jsxs("tr",{className:"border-b border-zinc-800/50",children:[c.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:R.url}),c.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:R.lastCrawledDate?qi(R.lastCrawledDate):"—"})]},R.id))})]})})]})]}),q==="coverage"&&!o&&c.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),q==="inspections"&&c.jsxs("div",{className:"mt-4 space-y-3",children:[c.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[c.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:w,onChange:R=>S(R.target.value),onKeyDown:R=>R.key==="Enter"&&H()}),c.jsx(ge,{size:"sm",disabled:!w.trim(),onClick:H,children:"Inspect"})]}),y&&c.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[c.jsx("div",{className:"font-medium text-zinc-200",children:y.url}),c.jsxs("div",{className:"text-zinc-400",children:["In Index: ",c.jsx("span",{className:y.inIndex?"text-emerald-400":"text-rose-400",children:y.inIndex?"Yes":"No"})," · ","HTTP: ",y.httpCode??"—"," · ","Crawled: ",y.lastCrawledDate??"—"]})]}),d.length>0&&c.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:c.jsxs("table",{className:"w-full text-xs",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-zinc-800",children:[c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),c.jsx("tbody",{children:d.map(R=>c.jsxs("tr",{className:"border-b border-zinc-800/50",children:[c.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:R.url}),c.jsx("td",{className:"py-1.5 px-3",children:c.jsx(vt,{tone:R.inIndex?"positive":"negative",children:R.inIndex?"Yes":"No"})}),c.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:R.httpCode??"—"}),c.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:qi(R.inspectedAt)})]},R.id))})]})})]}),q==="performance"&&c.jsx("div",{className:"mt-4",children:p.length===0?c.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):c.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:c.jsxs("table",{className:"w-full text-xs",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-zinc-800",children:[c.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),c.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:sm[to.Clicks]}),c.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:sm[to.Impressions]}),c.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:sm[to.CTR]}),c.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:sm[to.Position]})]})}),c.jsx("tbody",{children:p.map((R,U)=>c.jsxs("tr",{className:"border-b border-zinc-800/50",children:[c.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:R.query}),c.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:R.clicks}),c.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:R.impressions}),c.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(R.ctr)?R.ctr*100:0).toFixed(1),"%"]}),c.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:R.averagePosition.toFixed(1)})]},U))})]})})})]})]})}function QNe({projectName:e}){const[t,n]=b.useState("google"),[r,i]=b.useState(!0),[a,o]=b.useState("idle"),[u,d]=b.useState(null),f=b.useRef(null),[p,m]=b.useState(!1),[y,v]=b.useState(null),[w,S]=b.useState(null),[j,k]=b.useState(!1),[A,_]=b.useState(null),[C,P]=b.useState(null),[E,O]=b.useState(0);async function T(U=!1){U||i(!0),d(null);try{const[F,D,Y]=await Promise.all([qj().catch(()=>null),$I(e).catch(()=>[]),UI(e).catch(()=>null)]),se=D.find(je=>je.connectionType==="gsc")??null;m(!!F?.google?.configured),k(!!F?.bing?.configured),v(se),_(Y);const[ie,fe]=await Promise.all([se?Hj(e).catch(()=>null):Promise.resolve(null),Y?.connected?Kj(e).catch(()=>null):Promise.resolve(null)]);S(ie),P(fe)}catch(F){d(F instanceof Error?F.message:"Failed to load search console overview")}finally{i(!1)}}async function M(){if(a!=="idle")return;f.current?.abort();const U=new AbortController;f.current=U;const F=U.signal;o("syncing"),d(null);const D=[];try{async function Y(){if(!y)return;const je=await BI(e);if(!je?.id)return;const ee=2e3,Ae=Date.now()+12e4;for(;Date.now()<Ae;){if(F.aborted||(await new Promise(Ke=>setTimeout(Ke,ee)),F.aborted))return;const W=await Al(je.id).catch(()=>null);if(!W)break;if(["completed","failed","cancelled"].includes(W.status)){W.status!=="completed"&&D.push(`Google sync ${W.status}`);break}}}const se=10;async function ie(){if(!A?.connected)return;const je=await FI(e).catch(()=>[]),ee=[...new Set(je.map(ue=>ue.url))];if(ee.length!==0)for(let ue=0;ue<ee.length;ue+=se){if(F.aborted)return;const Ae=ee.slice(ue,ue+se),Ke=(await Promise.allSettled(Ae.map(Re=>qI(e,Re)))).filter(Re=>Re.status==="rejected").length;Ke>0&&D.push(`${Ke} Bing inspection(s) failed`)}}const fe=await Promise.allSettled([Y(),ie()]);for(const je of fe)je.status==="rejected"&&D.push(je.reason instanceof Error?je.reason.message:"Sync failed");if(F.aborted)return;o("reloading"),await T(!0),O(je=>je+1),D.length>0&&d(`Partial refresh: ${D.join("; ")}`)}catch(Y){F.aborted||d(Y instanceof Error?Y.message:"Refresh failed")}finally{F.aborted||o("idle")}}b.useEffect(()=>(T(),()=>{f.current?.abort()}),[e]);const q=y?"positive":p?"caution":"negative",$=y?"Connected":p?"Ready to connect":"Needs setup",L=w?`${w.summary.percentage}% indexed`:y?"Awaiting coverage":"No coverage data",J=w?`${w.summary.notIndexed} not indexed${w.summary.deindexed>0?` · ${w.summary.deindexed} deindexed`:""}`:y?"Run sitemap inspection to populate coverage":p?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",ae=w?.lastInspectedAt??y?.updatedAt??null,Z=A?.connected?"positive":j?"caution":"negative",H=A?.connected?"Connected":j?"Ready to connect":"Needs setup",Q=C?`${C.summary.percentage}% indexed`:A?.connected?"Awaiting coverage":"No coverage data",he=C?C.summary.notIndexed+(C.summary.unknown??0):0,we=C?`${he} not in index`:A?.connected?"Inspect URLs to populate coverage":j?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",R=C?.lastInspectedAt??A?.updatedAt??null;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs(qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),c.jsx("h2",{children:"Search Engine Intelligence"}),c.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."})]}),c.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:r||a!=="idle",onClick:()=>{M()},children:r?"Loading…":a==="syncing"?"Refreshing Google & Bing…":a==="reloading"?"Reloading workspaces…":"Refresh all"})]}),u&&c.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:u}),c.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[c.jsx(xT,{eyebrow:"Google",title:"Google Search Console",status:r?"Loading…":$,tone:r?"neutral":q,targetLabel:"Selected property",targetValue:y?.propertyId??"No property selected",coverageValue:r?"Loading…":L,note:r?"Loading overview…":J,updatedAt:ae,active:t==="google",onClick:()=>n("google")}),c.jsx(xT,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:r?"Loading…":H,tone:r?"neutral":Z,targetLabel:"Selected site",targetValue:A?.siteUrl??"No site selected",coverageValue:r?"Loading…":Q,note:r?"Loading overview…":we,updatedAt:R,active:t==="bing",onClick:()=>n("bing")})]})]}),c.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([U,F])=>c.jsx("button",{type:"button",role:"tab","aria-selected":t===U,className:`project-subnav-link ${t===U?"project-subnav-link-active":""}`,onClick:()=>n(U),children:F},U))}),t==="google"&&c.jsx($Ne,{projectName:e}),t==="bing"&&c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),c.jsx("h2",{children:"Bing Webmaster Tools"})]})}),c.jsx(WNe,{projectName:e,refreshNonce:E})]})]})}function XNe({insights:e}){const{openEvidence:t}=Pu(),[n,r]=b.useState(null);return c.jsx("div",{className:"insight-list",children:e.map(i=>{const a=n===i.id,o=i.affectedPhrases.length>0;return c.jsxs("div",{children:[c.jsxs("div",{className:`insight-row insight-row-${i.tone} ${o?"cursor-pointer":""}`,onClick:o?()=>r(a?null:i.id):void 0,children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o&&c.jsx(rh,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${a?"rotate-90":""}`}),c.jsx(vt,{tone:i.tone,children:i.actionLabel}),c.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:i.title}),c.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:i.detail})]}),o&&c.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[i.affectedPhrases.length," phrase",i.affectedPhrases.length>1?"s":""]})]}),a&&c.jsx("div",{className:"divide-y divide-zinc-800/20",children:i.affectedPhrases.map((u,d)=>c.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(C1,{state:u.citationState}),c.jsx("span",{className:"text-sm text-zinc-200 truncate",children:u.keyword}),c.jsx("div",{className:"hidden sm:flex gap-1",children:u.provider&&c.jsx(zf,{provider:u.provider})})]}),u.evidenceId&&c.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 Th({tab:e}){const{projectId:t}=Iy({from:"/projects/$projectId"}),n=xo(),{dashboard:r,isLoading:i,refetch:a}=Kl();if(!r||i)return c.jsxs("div",{className:"page-skeleton",children:[c.jsxs("div",{className:"page-skeleton-header",children:[c.jsx("div",{className:"skeleton-text h-6 w-48"}),c.jsx("div",{className:"skeleton-text-sm w-32"})]}),c.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(ve=>c.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[c.jsx("div",{className:"skeleton-circle size-20"}),c.jsx("div",{className:"skeleton-text w-16 mt-3"})]},ve))}),c.jsxs("div",{className:"page-skeleton-card",children:[c.jsx("div",{className:"skeleton-text w-28"}),c.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(ve=>c.jsx("div",{className:"skeleton-text-sm w-full"},ve))})]})]});const o=xte(r,t),[u,d]=b.useState(!1),[f,p]=b.useState(!1),[m,y]=b.useState(!1),[v,w]=b.useState(""),[S,j]=b.useState(!1),[k,A]=b.useState(!1),[_,C]=b.useState(""),[P,E]=b.useState(!1),[O,T]=b.useState(!1),[M,q]=b.useState(""),[$,L]=b.useState(!1),[J,ae]=b.useState(void 0),[Z,H]=b.useState(!1),[Q,he]=b.useState(null),[we,R]=b.useState(!1),U=o?.visibilityEvidence??[],F=o?.project.name??"",D=o?.project.displayName||o?.project.name||F,Y=P8(),se=b.useMemo(()=>new Set(U.map(ve=>ve.location??"")),[U]),ie=se.has(""),fe=b.useMemo(()=>[...se].filter(Boolean),[se]);b.useEffect(()=>{if(J===void 0||J===""||!F){he(null),R(!1);return}R(!0),II(F,J).then(ve=>{he(ve),R(!1)}).catch(()=>{he(null),R(!1)})},[J,F]);const je=b.useMemo(()=>{if(!Q)return null;const ve=new Map;for(const Ye of Q){for(const[be,Me]of Object.entries(Ye.providerRuns??{}))ve.set(`${Ye.keyword}::${be}`,Me.map(Pe=>({runId:Pe.runId,citationState:Pe.citationState,createdAt:Pe.createdAt,answerMentioned:Pe.answerMentioned,visibilityState:Pe.visibilityState,visibilityTransition:Pe.visibilityTransition})));(!Ye.providerRuns||Object.keys(Ye.providerRuns).length===0)&&ve.set(`${Ye.keyword}::`,Ye.runs.map(be=>({runId:be.runId,citationState:be.citationState,createdAt:be.createdAt,answerMentioned:be.answerMentioned,visibilityState:be.visibilityState,visibilityTransition:be.visibilityTransition})))}return ve},[Q]),ee=b.useMemo(()=>{const ve=J!==void 0?U.filter(Ye=>J===""?!Ye.location:Ye.location===J):U;return je?ve.map(Ye=>{const be=je.get(`${Ye.keyword}::${Ye.provider}`)??je.get(`${Ye.keyword}::`);return be?{...Ye,runHistory:be}:Ye}):ve},[U,J,je]);if(!o)return c.jsx("div",{className:"page-container",children:c.jsxs(qe,{className:"surface-card empty-card",children:[c.jsx("h1",{children:"Project not found"}),c.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),c.jsx(ge,{asChild:!0,children:c.jsx(qt,{to:"/",children:"Return to overview"})})]})});async function ue(){try{await Y.mutateAsync({projectName:F,projectLabel:D,sourceAction:"project-run"}),a()}catch{}}async function Ae(){p(!0);try{await HK(F),ht({title:"Project deleted",detail:`${D} was removed.`,tone:"positive",dedupeKey:`project:delete:${F}`,dedupeMode:"drop"}),n({to:"/"}),a()}catch(ve){console.error("Failed to delete project:",ve)}finally{p(!1)}}async function W(){try{const ve=await KK(F),Ye=typeof ve=="string"?ve:JSON.stringify(ve,null,2),be=new Blob([Ye],{type:"text/yaml"}),Me=URL.createObjectURL(be),Pe=document.createElement("a");Pe.href=Me,Pe.download=`${F}.yaml`,Pe.click()}catch(ve){ht({title:"Export failed",detail:ve instanceof Error?ve.message:"Could not export project YAML.",tone:"negative"})}}async function Ke(){const ve=v.split(`
292
+ `).map(Ye=>Ye.trim()).filter(Boolean);if(ve.length!==0){j(!0);try{await LK(F,ve),a(),w(""),y(!1)}finally{j(!1)}}}async function Re(){const ve=_.trim();if(ve){E(!0);try{const be=(await DI(F)).map(Pe=>Pe.domain),Me=[...new Set([...be,ve])];await LI(F,Me),a(),C(""),A(!1)}finally{E(!1)}}}async function it(){const ve=M.trim();if(ve){L(!0);try{const Ye=o?.project.ownedDomains??[];await r2(F,[...Ye,ve]),a(),q(""),T(!1)}finally{L(!1)}}}async function at(ve){L(!0);try{const Ye=o?.project.ownedDomains??[];await r2(F,Ye.filter(be=>be!==ve)),a()}finally{L(!1)}}async function At(ve,Ye){await $K(ve,Ye),a()}const Bt=ve=>!Number.isNaN(Number.parseInt(ve,10)),wn=[{key:"overview",label:"Overview",href:`/projects/${o.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${o.project.id}/search-console`},{key:"traffic",label:"Traffic",href:`/projects/${o.project.id}/traffic`},{key:"analytics",label:"Visibility",href:`/projects/${o.project.id}/analytics`},{key:"inbound",label:"Inbound",href:`/projects/${o.project.id}/inbound`}];return c.jsxs("div",{className:"page-container",children:[u?c.jsxs(qe,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[c.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),c.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",c.jsx("strong",{className:"text-zinc-200",children:o.project.displayName||o.project.name})," and all its key phrases, competitors, runs, and snapshots. This cannot be undone."]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(ge,{type:"button",variant:"destructive",disabled:f,onClick:Ae,children:f?"Deleting...":"Yes, delete project"}),c.jsx(ge,{type:"button",variant:"outline",disabled:f,onClick:()=>d(!1),children:"Cancel"})]})]}):null,c.jsxs("div",{className:"page-header",children:[c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:o.project.displayName||o.project.name}),c.jsxs("p",{className:"page-subtitle",children:[o.project.canonicalDomain,(o.project.ownedDomains??[]).length===0&&!O&&c.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>T(!0),children:"+ add domain"})," "," · ",o.contextLabel]}),c.jsxs("div",{className:"tag-row",children:[c.jsx("span",{className:"tag",children:o.project.country}),c.jsx("span",{className:"tag",children:o.project.language.toUpperCase()}),o.project.tags.map(ve=>c.jsx("span",{className:"tag",children:ve},ve))]}),((o.project.ownedDomains??[]).length>0||O)&&c.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[c.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(o.project.ownedDomains??[]).map(ve=>c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[ve,c.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:$,onClick:()=>at(ve),"aria-label":`Remove ${ve}`,children:"×"})]},ve)),O?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.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:M,onChange:ve=>q(ve.target.value),onKeyDown:ve=>ve.key==="Enter"&&it(),autoFocus:!0}),c.jsx(ge,{type:"button",size:"sm",disabled:!M.trim()||$,onClick:it,children:$?"...":"Add"}),c.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{T(!1),q("")},children:"Cancel"})]}):c.jsx("button",{type:"button",className:"rounded-full border border-dashed border-zinc-700 px-2 py-0.5 text-[10px] uppercase tracking-wide text-zinc-500 hover:text-zinc-300 hover:border-zinc-500 transition-colors",onClick:()=>T(!0),children:"+ domain"})]})]}),c.jsxs("div",{className:"page-header-right",children:[c.jsx("p",{className:"text-sm text-zinc-500",children:o.dateRangeLabel}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(ge,{type:"button",variant:"outline",size:"icon",onClick:W,"aria-label":"Export project as YAML",children:c.jsx(Vj,{className:"h-4 w-4 text-zinc-400"})}),c.jsx(ge,{type:"button",variant:"outline",size:"icon",onClick:()=>d(!0),"aria-label":"Delete project",children:c.jsx(eL,{className:"h-4 w-4 text-zinc-400"})}),c.jsx(ge,{type:"button",disabled:Y.isPending,onClick:ue,children:Y.isPending?"Starting...":"Run now"})]})]})]}),c.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:wn.map(ve=>c.jsx(qt,{to:ve.href,className:`project-subnav-link ${ve.key===e?"project-subnav-link-active":""}`,"aria-current":ve.key===e?"page":void 0,children:ve.label},ve.key))}),e==="overview"?c.jsxs(c.Fragment,{children:[c.jsxs("section",{className:"gauge-row",children:[c.jsx(N$,{value:o.visibilitySummary.value,label:o.visibilitySummary.label,delta:o.visibilitySummary.delta,tone:o.visibilitySummary.tone,description:o.visibilitySummary.description,tooltip:o.visibilitySummary.tooltip,isNumeric:Bt(o.visibilitySummary.value),progress:o.visibilitySummary.progress,providerCoverage:o.visibilitySummary.providerCoverage}),c.jsxs("div",{className:"metric-card",children:[c.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Key Phrases",c.jsx(Wn,{text:"Tracked key phrases where competitors are cited in the latest completed visibility run but your domain is not."})]}),c.jsxs("p",{className:"metric-card-big-value",children:[c.jsx("span",{className:"text-zinc-50",children:o.gapKeyPhrases.value}),c.jsxs("span",{className:"text-zinc-600",children:[" / ",o.keywordCounts.total]})]}),c.jsx("div",{className:"metric-card-bar",children:c.jsx("div",{className:`metric-card-bar-fill progress-fill-${o.gapKeyPhrases.tone}`,style:{width:o.gapKeyPhrases.progress!==void 0?`${o.gapKeyPhrases.progress*100}%`:"0%"}})}),c.jsx("p",{className:"metric-card-detail",children:o.gapKeyPhrases.delta}),c.jsx("p",{className:"metric-card-sub",children:o.gapKeyPhrases.description})]}),c.jsxs("div",{className:"metric-card",children:[c.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",c.jsx(Wn,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),c.jsxs("p",{className:"metric-card-big-value",children:[c.jsx("span",{className:"text-zinc-50",children:o.indexCoverage.value}),c.jsx("span",{className:"text-zinc-600",children:"%"})]}),c.jsx("div",{className:"metric-card-bar",children:c.jsx("div",{className:`metric-card-bar-fill progress-fill-${o.indexCoverage.tone}`,style:{width:`${Number.parseInt(o.indexCoverage.value,10)||0}%`}})}),c.jsx("p",{className:"metric-card-detail",children:o.indexCoverage.delta}),c.jsx("p",{className:"metric-card-sub",children:o.indexCoverage.description})]}),c.jsxs("div",{className:"metric-card",children:[c.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",c.jsx(Wn,{text:"Keyword-level citation changes compared to the previous completed run."})]}),o.movementSummary.hasPreviousRun?c.jsxs("div",{className:"metric-card-movement",children:[c.jsxs("span",{className:o.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",o.movementSummary.gained," gained"]}),c.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),c.jsxs("span",{className:o.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",o.movementSummary.lost," lost"]})]}):c.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),c.jsx("p",{className:"metric-card-sub mt-auto",children:o.movementSummary.gained===0&&o.movementSummary.lost===0&&o.movementSummary.hasPreviousRun?"No changes since last run":o.movementSummary.gained>o.movementSummary.lost?"Visibility improving":o.movementSummary.lost>o.movementSummary.gained?"Visibility declining":""})]})]}),o.providerScores.length>1&&c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),c.jsxs("h2",{children:["Visibility by model ",c.jsx(Wn,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked key phrases. Switching models can significantly affect citation rates."})]})]})}),c.jsx("div",{className:"evidence-table-wrap",children:c.jsxs("table",{className:"evidence-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Model"}),c.jsx("th",{children:"Score"}),c.jsx("th",{children:"Cited key phrases"})]})}),c.jsx("tbody",{children:o.providerScores.map(ve=>c.jsxs("tr",{children:[c.jsx("td",{children:c.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[c.jsx(zf,{provider:ve.provider}),ve.model&&c.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:ve.model})]})}),c.jsx("td",{children:c.jsxs("span",{className:`font-semibold ${ve.score>=70?"text-emerald-400":ve.score>=40?"text-amber-400":"text-rose-400"}`,children:[ve.score,"%"]})}),c.jsxs("td",{className:"text-zinc-500",children:[ve.cited," of ",ve.total]})]},`${ve.provider}::${ve.model??"unknown"}`))})]})})]}),c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),c.jsx("h2",{children:"Citation signals"})]})}),c.jsx(XNe,{insights:o.insights})]}),c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),c.jsx("h2",{children:"Key phrase citation tracking"})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("p",{className:"supporting-copy",children:[new Set(o.visibilityEvidence.map(ve=>ve.keyword)).size," key phrases tracked"]}),c.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!m),children:m?"Cancel":"+ Add key phrases"})]})]}),m&&c.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[c.jsx("textarea",{className:"w-full resize-none rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",rows:3,placeholder:"Enter key phrases, one per line",value:v,onChange:ve=>w(ve.target.value)}),c.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[c.jsxs("p",{className:"text-xs text-zinc-500",children:[v.split(`
293
+ `).filter(ve=>ve.trim()).length," key phrases"]}),c.jsx(ge,{type:"button",size:"sm",disabled:!v.trim()||S,onClick:Ke,children:S?"Adding...":"Add key phrases"})]})]}),o.project.locations&&o.project.locations.length>0&&c.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[c.jsx("button",{className:`filter-chip ${J===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":J===void 0,onClick:()=>{ae(void 0)},children:"All locations"}),o.project.locations.map(ve=>se.has(ve.label)&&c.jsx("button",{className:`filter-chip ${J===ve.label?"filter-chip-active":""}`,type:"button","aria-pressed":J===ve.label,onClick:()=>{ae(ve.label),H(!1)},children:ve.label},ve.label)),ie&&c.jsx("button",{className:`filter-chip ${J===""?"filter-chip-active":""}`,type:"button","aria-pressed":J==="",onClick:()=>{ae(""),H(!1)},children:"No location"}),fe.length>1&&J===void 0&&c.jsx("button",{className:`filter-chip filter-chip-compare ${Z?"filter-chip-active":""}`,type:"button","aria-pressed":Z,onClick:()=>H(ve=>!ve),title:"Side-by-side location comparison",children:"Compare"})]}),c.jsx(hle,{evidence:ee})]}),c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),c.jsx("h2",{children:"Competitive landscape"})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("p",{className:"supporting-copy",children:[o.competitors.length," tracked"]}),c.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>A(!k),children:k?"Cancel":"+ Add competitor"})]})]}),k&&c.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[c.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"competitor.com",value:_,onChange:ve=>C(ve.target.value),onKeyDown:ve=>ve.key==="Enter"&&Re()}),c.jsx(ge,{type:"button",size:"sm",disabled:!_.trim()||P,onClick:Re,children:P?"Adding...":"Add"})]}),c.jsx(ple,{competitors:o.competitors})]}),c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),c.jsx("h2",{children:"Recent execution history"})]})}),c.jsx("div",{className:"run-list",children:o.recentRuns.map(ve=>c.jsx(j$,{run:ve},ve.id))})]}),c.jsx(KNe,{project:{...o.project,displayName:o.project.displayName??o.project.name,defaultLocation:o.project.defaultLocation??null},onUpdateProject:At,onRefresh:()=>{a()}}),c.jsx(VNe,{projectName:o.project.name}),c.jsx(YNe,{projectName:o.project.name})]}):e==="analytics"?c.jsx(vNe,{projectName:o.project.name}):e==="traffic"?c.jsx(NNe,{projectName:o.project.name}):e==="inbound"?c.jsx(HNe,{projectName:o.project.name}):c.jsx(QNe,{projectName:o.project.name})]})}function JNe(){const{dashboard:e,isLoading:t}=Kl(),n=RNe();if(!e||t)return c.jsxs("div",{className:"page-skeleton",children:[c.jsxs("div",{className:"page-skeleton-header",children:[c.jsx("div",{className:"skeleton-text h-6 w-20"}),c.jsx("div",{className:"skeleton-text-sm w-72"})]}),c.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(d=>c.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[c.jsxs("div",{className:"flex-1 space-y-1.5",children:[c.jsx("div",{className:"skeleton-text w-40"}),c.jsx("div",{className:"skeleton-text-sm w-56"})]}),c.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},d))})]});const r=e.runs,[i,a]=b.useState("all"),o=i==="all"?r:r.filter(d=>d.status===i),u=async()=>{try{await n.mutateAsync(void 0)}catch{}};return c.jsxs("div",{className:"page-container",children:[c.jsxs("div",{className:"page-header",children:[c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Runs"}),c.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),c.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{u()},children:n.isPending?"Queueing…":"Run all projects"})]}),c.jsxs("section",{children:[c.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(d=>c.jsx("button",{className:`filter-chip ${i===d?"filter-chip-active":""}`,type:"button","aria-pressed":i===d,onClick:()=>a(d),children:d==="all"?"All runs":qy(d)},d))}),c.jsx("div",{className:"run-list",children:o.length>0?o.map(d=>c.jsx(j$,{run:d},d.id)):c.jsxs(qe,{className:"surface-card empty-card",children:[c.jsx("h2",{children:"No runs match this filter"}),c.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function eke({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[a,o]=b.useState(""),[u,d]=b.useState(""),[f,p]=b.useState(""),[m,y]=b.useState(""),[v,w]=b.useState(""),[S,j]=b.useState(""),[k,A]=b.useState(!1),[_,C]=b.useState(null),[P,E]=b.useState(!1),O=i?u.trim().length>0:a.trim().length>0;async function T(){if(O){A(!0),C(null),E(!1);try{const q=Z=>{const H=parseInt(Z.trim(),10);return Number.isFinite(H)&&H>0?H:void 0},$={},L=q(m);L!==void 0&&($.maxConcurrency=L);const J=q(v);J!==void 0&&($.maxRequestsPerMinute=J);const ae=q(S);ae!==void 0&&($.maxRequestsPerDay=ae),await YK(e.toLowerCase(),{...a.trim()?{apiKey:a.trim()}:{},...u.trim()?{baseUrl:u.trim()}:{},...f.trim()?{model:f.trim()}:{},...Object.keys($).length>0?{quota:$}:{}}),o(""),d(""),p(""),y(""),w(""),j(""),E(!0),ht({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(q){C(q instanceof Error?q.message:"Failed to update provider")}finally{A(!1)}}}const M=n??"Use default model";return c.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[i&&c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),c.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:q=>d(q.target.value)}),c.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",i?" (optional)":""]}),t&&c.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 ","↗"]})]}),c.jsx("input",{id:`api-key-${e}`,type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:i?"Optional — most local servers don't need one":`Enter ${e} API key`,value:a,onChange:q=>o(q.target.value)})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),c.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:M,value:f,onChange:q=>p(q.target.value)})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),c.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[c.jsxs("div",{children:[c.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Concurrent",value:m,onChange:q=>y(q.target.value)}),c.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),c.jsxs("div",{children:[c.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/min",value:v,onChange:q=>w(q.target.value)}),c.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),c.jsxs("div",{children:[c.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:S,onChange:q=>j(q.target.value)}),c.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),_&&c.jsx("p",{className:"text-xs text-rose-400",children:_}),P&&c.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),c.jsx(ge,{type:"button",size:"sm",disabled:!O||k,onClick:T,children:k?"Saving...":"Save"})]})}function tke({onSaved:e}){const[t,n]=b.useState(""),[r,i]=b.useState(""),[a,o]=b.useState(!1),[u,d]=b.useState(null),[f,p]=b.useState(!1),m=t.trim().length>0&&r.trim().length>0;async function y(){if(m){o(!0),d(null),p(!1);try{await WK({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),p(!0),ht({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),e()}catch(v){d(v instanceof Error?v.message:"Failed to update Google OAuth credentials")}finally{o(!1)}}}return c.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),c.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 ","↗"]})]}),c.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)})]}),c.jsxs("div",{children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),c.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)})]}),c.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",c.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),u&&c.jsx("p",{className:"text-xs text-rose-400",children:u}),f&&c.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),c.jsx(ge,{type:"button",size:"sm",disabled:!m||a,onClick:y,children:a?"Saving...":"Save Google OAuth app"})]})}function nke(){const[e,t]=b.useState(null),[n,r]=b.useState(null),[i,a]=b.useState(!1),[o,u]=b.useState("localhost"),[d,f]=b.useState("9222"),[p,m]=b.useState(!1);return b.useEffect(()=>{a2().then(t).catch(y=>{const v=y instanceof Error?y.message:String(y);v.includes("501")||r(v)})},[]),c.jsxs(qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),c.jsx("h2",{children:"ChatGPT (CDP)"})]}),c.jsx(vt,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),c.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&c.jsxs("div",{children:[c.jsx("dt",{children:"Endpoint"}),c.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&c.jsxs("div",{children:[c.jsx("dt",{children:"Browser"}),c.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&c.jsxs("div",{children:[c.jsx("dt",{children:"Tabs"}),c.jsx("dd",{children:e.targets.map(y=>c.jsxs("span",{className:"mr-2",children:[y.name,": ",y.alive?"● alive":"○ idle"]},y.name))})]})]}),c.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"}),c.jsx("div",{className:"mt-2",children:c.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!i),children:i?"Cancel":e?.connected?"Update endpoint":"Configure"})}),i&&c.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async y=>{y.preventDefault(),m(!0);try{await b7(o,parseInt(d,10)||9222);const v=await a2().catch(()=>null);v&&t(v),a(!1),ht({title:"CDP endpoint saved",detail:`${o}:${parseInt(d,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}catch(v){r(v instanceof Error?v.message:String(v))}finally{m(!1)}},children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"localhost",value:o,onChange:y=>u(y.target.value),"aria-label":"CDP host"}),c.jsx("input",{className:"w-24 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"9222",value:d,onChange:y=>f(y.target.value),"aria-label":"CDP port"})]}),c.jsx("div",{children:c.jsx(ge,{type:"submit",size:"sm",disabled:p,children:p?"Saving…":"Save endpoint"})})]})]})}const rke={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function ike(){const e=sh(),{dashboard:t}=Kl(),n=t?.settings??e?.dashboard?.settings,a=Qy(!e,e?.health).data??e?.health??rke,[o,u]=b.useState(null),[d,f]=b.useState(!1),[p,m]=b.useState(!1),[y,v]=b.useState(""),[w,S]=b.useState(!1),[j,k]=b.useState(null),[A,_]=b.useState(!1);return n?c.jsxs("div",{className:"page-container",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Settings"}),c.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),c.jsxs("section",{className:"settings-grid",children:[n.providerStatuses.map(C=>c.jsxs(qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),c.jsx("h2",{children:C.displayName??C.name})]}),c.jsx(vt,{tone:C.state==="ready"?"positive":"caution",children:C.state==="ready"?"Ready":"Needs config"})]}),c.jsxs("dl",{className:"definition-list mt-3",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Model"}),c.jsx("dd",{className:"font-mono text-xs",children:C.model})]}),C.quota&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Concurrency"}),c.jsx("dd",{children:C.quota.maxConcurrency})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Rate limit"}),c.jsxs("dd",{children:[C.quota.maxRequestsPerMinute,"/min · ",C.quota.maxRequestsPerDay,"/day"]})]})]})]}),c.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:C.detail}),c.jsx("div",{className:"mt-2",children:c.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>u(o===C.name?null:C.name),children:o===C.name?"Cancel":C.state==="ready"?C.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),o===C.name&&c.jsx(eke,{providerName:C.name,keyUrl:C.keyUrl,modelHint:C.modelHint,onSaved:()=>{u(null)}})]},C.name)),c.jsxs(qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),c.jsx("h2",{children:"Search Console OAuth"})]}),c.jsx(vt,{tone:n.google.state==="ready"?"positive":"caution",children:n.google.state==="ready"?"Ready":"Needs config"})]}),c.jsxs("dl",{className:"definition-list mt-3",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Auth model"}),c.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Storage"}),c.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),c.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.google.detail}),c.jsx("div",{className:"mt-2",children:c.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>f(!d),children:d?"Cancel":n.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),d&&c.jsx(tke,{onSaved:()=>{f(!1)}})]}),c.jsxs(qe,{className:"surface-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),c.jsx("h2",{children:"Webmaster Tools"})]}),c.jsx(vt,{tone:n.bing.state==="ready"?"positive":"caution",children:n.bing.state==="ready"?"Ready":"Needs config"})]}),c.jsxs("dl",{className:"definition-list mt-3",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Auth model"}),c.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Storage"}),c.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),c.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.bing.detail}),c.jsx("div",{className:"mt-2",children:c.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":n.bing.state==="ready"?"Update API key":"Configure Bing"})}),p&&c.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),c.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"})]}),c.jsx("input",{id:"bing-api-key",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:y,onChange:C=>v(C.target.value)})]}),c.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",c.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),j&&c.jsx("p",{className:"text-xs text-rose-400",children:j}),A&&c.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),c.jsx(ge,{type:"button",size:"sm",disabled:!y.trim()||w,onClick:async()=>{if(y.trim()){S(!0),k(null),_(!1);try{await k7(y.trim()),v(""),_(!0),m(!1),ht({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(C){k(C instanceof Error?C.message:"Failed to update Bing API key")}finally{S(!1)}}},children:w?"Saving...":"Save Bing API key"})]})]}),c.jsx(nke,{}),c.jsxs(qe,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),c.jsx("h2",{children:"API and worker"})]})}),c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{className:"health-row",children:[c.jsxs("div",{children:[c.jsx("p",{className:"run-row-title",children:"API"}),c.jsx("p",{className:"supporting-copy",children:a.apiStatus.detail})]}),c.jsx(vt,{tone:Ng(a.apiStatus),title:go(a.apiStatus),children:a.apiStatus.state==="ok"?"Healthy":"Attention"})]}),c.jsxs("div",{className:"health-row",children:[c.jsxs("div",{children:[c.jsx("p",{className:"run-row-title",children:"Worker"}),c.jsx("p",{className:"supporting-copy",children:a.workerStatus.detail})]}),c.jsx(vt,{tone:Ng(a.workerStatus),title:go(a.workerStatus),children:a.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),c.jsx("section",{className:"page-section",children:c.jsxs(qe,{className:"surface-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),c.jsx("h2",{children:"Operational guidance"})]})}),c.jsx("ul",{className:"detail-list",children:n.selfHostNotes.map(C=>c.jsx("li",{children:C},C))}),c.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const ake=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Key phrases",description:"Add key phrases to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function ske({current:e,labels:t}){return c.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((n,r)=>{const i=r<e,a=r===e;return c.jsxs("div",{className:`setup-step ${i?"setup-step-done":""} ${a?"setup-step-active":""}`,role:"listitem","aria-current":a?"step":void 0,children:[c.jsx("span",{className:"setup-step-number",children:i?"✓":r+1}),c.jsx("span",{className:"setup-step-label",children:n.label})]},n.label)})})}function oke(){const e=sh(),{dashboard:t,isLoading:n,refetch:r}=Kl(),i=t??e?.dashboard;if(!i||n)return c.jsxs("div",{className:"page-skeleton",children:[c.jsxs("div",{className:"page-skeleton-header",children:[c.jsx("div",{className:"skeleton-text h-6 w-24"}),c.jsx("div",{className:"skeleton-text-sm w-80"})]}),c.jsxs("div",{className:"page-skeleton-card",children:[c.jsx("div",{className:"skeleton-text w-32"}),c.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(Se=>c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-1 flex-1",children:[c.jsx("div",{className:"skeleton-text w-24"}),c.jsx("div",{className:"skeleton-text-sm w-48"})]}),c.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},Se))})]})]});const a=i.settings,d=Qy(!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=bX(i.setup,d,a),p=xo(),[m,y]=b.useState(0),[v,w]=b.useState(""),[S,j]=b.useState(""),[k,A]=b.useState(""),[_,C]=b.useState("US"),[P,E]=b.useState("en"),[O,T]=b.useState(!1),[M,q]=b.useState(null),[$,L]=b.useState(null),[J,ae]=b.useState(null),[Z,H]=b.useState(!1),[Q,he]=b.useState(""),[we,R]=b.useState(!1),[U,F]=b.useState(null),[D,Y]=b.useState(!1),se=a.providerStatuses.filter(Se=>Se.state==="ready"),[ie,fe]=b.useState(se[0]?.name??""),[je,ee]=b.useState(5),[ue,Ae]=b.useState(!1),[W,Ke]=b.useState(null),[Re,it]=b.useState(""),[at,At]=b.useState(!1),[Bt,wn]=b.useState(null),[ve,Ye]=b.useState(!1),[be,Me]=b.useState(!1),[Pe,ze]=b.useState(!1),ne=P8(),xe=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Ee=Q.split(`
294
+ `).map(Se=>Se.trim()).filter(Boolean),Ge=Re.split(`
295
+ `).map(Se=>Se.trim()).filter(Boolean),et=f.healthChecks.some(Se=>Se.id==="api"&&Se.state==="ready"),rn=async()=>{if(!(!xe||!k)){H(!0),ae(null);try{const Se=await $y(xe,{displayName:S||v,canonicalDomain:k,country:_,language:P,autoExtractBacklinks:O});q(xe),L(Se.id),ht({title:"Project created",detail:`${Se.displayName||Se.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${Se.name}`,dedupeMode:"drop"}),r(),y(2)}catch(Se){ae(Se instanceof Error?Se.message:"Failed to create project")}finally{H(!1)}}},Sn=async()=>{if(!M)return;const Se=Ee;if(Se.length!==0){Y(!0),F(null);try{await IK(M,Se),R(!0),r(),y(3)}catch(lr){F(lr instanceof Error?lr.message:"Failed to save key phrases")}finally{Y(!1)}}},Xe=async()=>{if(!(!M||!ie)){Ae(!0),Ke(null);try{const Se=await r7(M,ie,je);if(Se.keywords.length>0){const lr=Q?Q.trimEnd()+`
296
+ `+Se.keywords.join(`
297
+ `):Se.keywords.join(`
298
+ `);he(lr)}}catch(Se){Ke(Se instanceof Error?Se.message:"Failed to generate key phrases")}finally{Ae(!1)}}},Qt=async()=>{if(!M)return;const Se=Ge;if(Se.length!==0){Ye(!0),wn(null);try{await LI(M,Se),At(!0),r(),y(4)}catch(lr){wn(lr instanceof Error?lr.message:"Failed to save competitors")}finally{Ye(!1)}}},Ut=async()=>{if(M){ze(!0);try{await ne.mutateAsync({projectName:M,projectLabel:S||v||M,sourceAction:"setup-launch"}),Me(!0),r()}catch{}finally{ze(!1)}}},Ue=()=>y(Se=>Math.max(0,Se-1)),Jr=(()=>{switch(m){case 0:return c.jsxs(qe,{className:"surface-card step-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),c.jsx("h2",{children:"System ready"})]})}),c.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),c.jsx("div",{className:"compact-stack",children:f.healthChecks.map(Se=>c.jsxs("div",{className:"health-check-row",children:[c.jsxs("div",{children:[c.jsx("p",{className:"run-row-title",children:Se.label}),c.jsx("p",{className:"supporting-copy",children:Se.detail}),Se.id==="provider"&&Se.state!=="ready"&&c.jsx(qt,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),c.jsx(vt,{tone:Se.state==="ready"?"positive":"caution",title:Se.id==="api"?go(d.apiStatus):Se.id==="worker"?go(d.workerStatus):Se.detail,children:Se.state==="ready"?"Ready":"Attention"})]},Se.id))}),c.jsxs("div",{className:"setup-nav",children:[c.jsx("span",{}),c.jsx(ge,{type:"button",disabled:!et,onClick:()=>y(1),children:"Continue"})]})]});case 1:return c.jsxs(qe,{className:"surface-card step-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),c.jsx("h2",{children:"Create project"})]}),M?c.jsx(vt,{tone:"positive",children:"Created"}):null]}),M?c.jsxs("div",{className:"compact-stack",children:[c.jsxs("p",{className:"text-zinc-300",children:["Project ",c.jsx("span",{className:"text-zinc-100 font-medium",children:M})," created successfully."]}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(ge,{type:"button",variant:"outline",onClick:Ue,children:"Back"}),c.jsx(ge,{type:"button",onClick:()=>y(2),children:"Continue"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),c.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:v,onChange:Se=>w(Se.target.value)}),xe&&xe!==v?c.jsxs("p",{className:"supporting-copy",children:["Slug: ",xe]}):null]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),c.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:S,onChange:Se=>j(Se.target.value)})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),c.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:k,onChange:Se=>A(Se.target.value)})]}),c.jsxs("div",{className:"setup-field-row",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),c.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:_,onChange:Se=>C(Se.target.value.toUpperCase())})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),c.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:P,onChange:Se=>E(Se.target.value.toLowerCase())})]})]}),c.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:[c.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-zinc-700 bg-zinc-950",checked:O,onChange:Se=>T(Se.target.checked)}),c.jsxs("span",{className:"flex-1",children:[c.jsx("span",{className:"block text-sm text-zinc-100",children:"Auto-extract backlinks"}),c.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."," ",c.jsx(qt,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),J?c.jsx("p",{className:"text-rose-400 text-sm",children:J}):null,c.jsxs("div",{className:"setup-nav",children:[c.jsx(ge,{type:"button",variant:"outline",onClick:Ue,children:"Back"}),c.jsx(ge,{type:"button",disabled:!xe||!k||Z,onClick:rn,children:Z?"Creating...":"Create project"})]})]})]});case 2:return c.jsxs(qe,{className:"surface-card step-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),c.jsx("h2",{children:"Add key phrases"})]}),we?c.jsxs(vt,{tone:"positive",children:[Ee.length," saved"]}):c.jsxs(vt,{tone:"neutral",children:[Ee.length," key phrase",Ee.length!==1?"s":""]})]}),c.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),we?c.jsxs("div",{className:"compact-stack",children:[c.jsx("ul",{className:"detail-list",children:Ee.map(Se=>c.jsx("li",{children:Se},Se))}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(ge,{type:"button",variant:"outline",onClick:Ue,children:"Back"}),c.jsx(ge,{type:"button",onClick:()=>y(3),children:"Continue"})]})]}):c.jsxs("div",{className:"compact-stack",children:[se.length>0?c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[c.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",c.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),c.jsxs("div",{className:"flex items-end gap-2",children:[c.jsxs("div",{className:"setup-field flex-1",children:[c.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),c.jsx("select",{id:"gen-provider",className:"setup-input",value:ie,onChange:Se=>fe(Se.target.value),children:se.map(Se=>c.jsxs("option",{value:Se.name,children:[Se.displayName??Se.name,Se.model?` (${Se.model})`:""]},Se.name))})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),c.jsx("select",{id:"gen-count",className:"setup-input",value:je,onChange:Se=>ee(Number(Se.target.value)),children:[3,5,10,15,20].map(Se=>c.jsx("option",{value:Se,children:Se},Se))})]}),c.jsx(ge,{type:"button",variant:"outline",disabled:ue||!ie,onClick:Xe,children:ue?"Analyzing site...":"Generate"})]}),W?c.jsx("p",{className:"text-rose-400 text-sm",children:W}):null]}):null,c.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[c.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",c.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"keywords",children:"Key phrases (one per line)"}),c.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
299
+ best invisalign downtown brooklyn
300
+ pediatric dentist brooklyn heights`,value:Q,onChange:Se=>he(Se.target.value)})]}),U?c.jsx("p",{className:"text-rose-400 text-sm",children:U}):null,c.jsxs("div",{className:"setup-nav",children:[c.jsx(ge,{type:"button",variant:"outline",onClick:Ue,children:"Back"}),c.jsx(ge,{type:"button",disabled:Ee.length===0||D,onClick:Sn,children:D?"Saving...":`Save ${Ee.length} key phrase${Ee.length!==1?"s":""}`})]})]})]});case 3:return c.jsxs(qe,{className:"surface-card step-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),c.jsx("h2",{children:"Add competitors"})]}),at?c.jsx(vt,{tone:"positive",children:"Saved"}):null]}),c.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),at?c.jsxs("div",{className:"compact-stack",children:[c.jsx("ul",{className:"detail-list",children:Ge.map(Se=>c.jsx("li",{children:Se},Se))}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(ge,{type:"button",variant:"outline",onClick:Ue,children:"Back"}),c.jsx(ge,{type:"button",onClick:()=>y(4),children:"Continue"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),c.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
301
+ competitor2.com`,value:Re,onChange:Se=>it(Se.target.value)})]}),Bt?c.jsx("p",{className:"text-rose-400 text-sm",children:Bt}):null,c.jsxs("div",{className:"setup-nav",children:[c.jsx(ge,{type:"button",variant:"outline",onClick:Ue,children:"Back"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(ge,{type:"button",variant:"outline",onClick:()=>y(4),children:"Skip"}),c.jsx(ge,{type:"button",disabled:Ge.length===0||ve,onClick:Qt,children:ve?"Saving...":`Save ${Ge.length} competitor${Ge.length!==1?"s":""}`})]})]})]})]});case 4:return c.jsxs(qe,{className:"surface-card step-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),c.jsx("h2",{children:"Launch first run"})]}),be?c.jsx(vt,{tone:"positive",children:"Queued"}):null]}),be?c.jsxs("div",{className:"compact-stack",children:[c.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),c.jsxs("div",{className:"setup-nav",children:[c.jsx("span",{}),c.jsx(ge,{type:"button",onClick:()=>p({to:$?`/projects/${$}`:"/"}),children:"Open project"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",c.jsx("span",{className:"text-zinc-100 font-medium",children:M}),"."]}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(ge,{type:"button",variant:"outline",onClick:Ue,children:"Back"}),c.jsx(ge,{type:"button",disabled:Pe,onClick:Ut,children:Pe?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return c.jsxs("div",{className:"page-container",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Setup"}),c.jsx("p",{className:"page-subtitle",children:"Create a project, add key phrases, add competitors, and launch the first run."})]})}),c.jsx(ske,{current:m,labels:ake}),c.jsx("section",{className:"setup-wizard",children:Jr})]})}function Zc({children:e,label:t="More info",placement:n="top",className:r}){const i=b.useId(),[a,o]=b.useState(!1);return c.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[c.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:()=>o(!0),onMouseLeave:()=>o(!1),onFocus:()=>o(!0),onBlur:()=>o(!1),children:c.jsx(WI,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&c.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})]})}function lke(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 Fm(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 zS(e){switch(e){case"ready":return"positive";case"failed":return"negative";case"downloading":case"querying":case"queued":return"caution"}}function cke(){const[e,t]=b.useState(null),[n,r]=b.useState(null),[i,a]=b.useState([]),[o,u]=b.useState([]),[d,f]=b.useState(!0),[p,m]=b.useState(!1),[y,v]=b.useState(!1),[w,S]=b.useState(""),[j,k]=b.useState(null),[A,_]=b.useState(null),C=b.useCallback(async()=>{f(!0),k(null);try{const[M,q,$,L]=await Promise.all([P7(),KI().catch(()=>null),M7().catch(()=>[]),I7().catch(()=>[])]);t(M),r(q),a($),u(L)}catch(M){k(M instanceof Error?M.message:"Failed to load backlinks status")}finally{f(!1)}},[]);b.useEffect(()=>{C()},[C]);async function P(){m(!0),k(null),_(null);try{const M=await R7();_(M.alreadyPresent?`DuckDB already installed (${M.version}).`:`Installed DuckDB ${M.version}.`),await C()}catch(M){k(M instanceof Error?M.message:"Failed to install DuckDB")}finally{m(!1)}}async function E(){const M=w.trim();if(!M){k("Enter a release id (e.g., cc-main-2026-jan-feb-mar).");return}v(!0),k(null),_(null);try{await D7(M),_(`Queued sync for ${M}. Download + query runs in the background.`),S(""),await C()}catch(q){q instanceof Ci&&q.code==="MISSING_DEPENDENCY"?k("DuckDB is not installed. Install it first."):k(q instanceof Error?q.message:"Failed to trigger sync")}finally{v(!1)}}async function O(M){k(null),_(null);try{await L7(M),_(`Pruned cached release ${M}.`),await C()}catch(q){k(q instanceof Error?q.message:"Failed to prune release")}}const T=n?.status==="ready"&&o.every(M=>M.release!==n.release);return c.jsxs("div",{className:"page-container",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Backlinks"}),c.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."})]})}),c.jsx(qe,{className:"surface-card p-4 mb-6 border-amber-800/60",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(vg,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),c.jsxs("div",{className:"text-sm text-zinc-300 leading-relaxed",children:[c.jsx("p",{className:"font-medium text-amber-200",children:"Heads up — a release sync is a large download."}),c.jsxs("ul",{className:"mt-1.5 space-y-1 text-zinc-400",children:[c.jsxs("li",{children:[c.jsx("span",{className:"text-zinc-200",children:"~16 GB"})," of gzipped vertex + edge files per release, stored at"," ",c.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),"."]}),c.jsxs("li",{children:[c.jsx("span",{className:"text-zinc-200",children:"10–20 min on a fast connection"})," for the download, then ~5 min for the DuckDB query."]}),c.jsx("li",{children:"One sync covers every project in this workspace. Releases are immutable, so the download only happens once per release."})]})]})]})}),c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"About"}),c.jsx("h2",{children:"How it works"})]})}),c.jsxs(qe,{className:"surface-card p-5",children:[c.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"," ",c.jsx("span",{className:"text-zinc-200",children:"release"})," at a time and extracts backlinks for every project in this workspace in a single pass."]}),c.jsxs("ol",{className:"space-y-3 text-sm text-zinc-400 max-w-3xl",children:[c.jsxs("li",{className:"flex gap-3",children:[c.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"}),c.jsxs("span",{children:[c.jsx("span",{className:"text-zinc-200 font-medium",children:"Download (one-time, ~16 GB)"})," — vertex + edge files cached to"," ",c.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),". Runs once per release; subsequent operations reuse the cache."]})]}),c.jsxs("li",{className:"flex gap-3",children:[c.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"}),c.jsxs("span",{children:[c.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 ",c.jsx("span",{className:"text-zinc-200",children:"read"})," these dumps; it doesn’t store any canonry state."]})]}),c.jsxs("li",{className:"flex gap-3",children:[c.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"}),c.jsxs("span",{children:[c.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."]})]})]})]})]}),j&&c.jsx(qe,{className:"surface-card p-4 mb-4 border-rose-800/60",children:c.jsx("p",{className:"text-sm text-rose-300",children:j})}),A&&c.jsx(qe,{className:"surface-card p-4 mb-4 border-emerald-800/60",children:c.jsx("p",{className:"text-sm text-emerald-300",children:A})}),c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dependency"}),c.jsxs("h2",{className:"flex items-center gap-2",children:["DuckDB install status",c.jsxs(Zc,{label:"Why DuckDB?",children:[c.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."}),c.jsxs("span",{className:"mt-2 block text-zinc-400",children:["It does ",c.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."]}),c.jsxs("span",{className:"mt-2 block text-zinc-500",children:["Installed on demand (not bundled) into ",c.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?c.jsx(vt,{tone:"positive",children:"Installed"}):c.jsx(vt,{tone:"caution",children:"Not installed"})]}),c.jsx(qe,{className:"surface-card p-5",children:d?c.jsx("p",{className:"text-sm text-zinc-500",children:"Checking…"}):e?.duckdbInstalled?c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(YI,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),c.jsxs("div",{children:[c.jsxs("p",{className:"text-sm text-zinc-200",children:["Version ",e.duckdbVersion??"unknown"," installed at"," ",c.jsx("code",{className:"text-zinc-300",children:e.pluginDir})]}),c.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Required spec: ",e.duckdbSpec]})]})]}):c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(lG,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),c.jsxs("div",{className:"flex-1",children:[c.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."}),c.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&&c.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Will be installed into ",c.jsx("code",{className:"text-zinc-300",children:e.pluginDir})," (~40 MB)."]}),c.jsx("div",{className:"mt-3",children:c.jsxs(ge,{type:"button",size:"sm",disabled:p,onClick:P,children:[c.jsx(Vj,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),p?"Installing…":"Install DuckDB"]})})]})]})})]}),c.jsxs("section",{className:"page-section-divider",children:[c.jsxs("div",{className:"section-head section-head-inline",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Latest sync"}),c.jsxs("h2",{className:"flex items-center gap-2",children:["Release sync",c.jsx(Zc,{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&&c.jsx(vt,{tone:zS(n.status),children:n.status})]}),c.jsxs(qe,{className:"surface-card p-5",children:[c.jsxs("p",{className:"text-xs text-zinc-500 max-w-3xl mb-4",children:["A release is one Common Crawl dump (e.g. ",c.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?c.jsxs("div",{className:"space-y-2 text-sm",children:[c.jsxs("p",{className:"text-zinc-200",children:["Release ",c.jsx("code",{className:"text-zinc-300",children:n.release})]}),n.phaseDetail&&c.jsx("p",{className:"text-zinc-500",children:n.phaseDetail}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-xs text-zinc-500 pt-2",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Projects"}),c.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.projectsProcessed??"—"})]}),c.jsxs("div",{children:[c.jsxs("p",{className:"text-zinc-600 uppercase tracking-wide flex items-center gap-1",children:["Rows",c.jsx(Zc,{label:"What are rows?",children:"Total number of (project, referring domain) pairs persisted in SQLite from this sync, across every project in the workspace."})]}),c.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.domainsDiscovered??"—"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Started"}),c.jsx("p",{className:"text-zinc-300 mt-0.5",children:Fm(n.downloadStartedAt??n.createdAt)})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Finished"}),c.jsx("p",{className:"text-zinc-300 mt-0.5",children:Fm(n.queryFinishedAt)})]})]}),n.error&&c.jsx("p",{className:"text-sm text-rose-400 pt-2",children:n.error})]}):c.jsx("p",{className:"text-sm text-zinc-500",children:"No release sync has run in this workspace yet."}),T&&c.jsx("div",{className:"mt-4 rounded border border-amber-800/60 bg-amber-950/20 p-3",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(vg,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),c.jsxs("div",{className:"text-xs text-zinc-300 leading-relaxed",children:[c.jsx("p",{className:"font-medium text-amber-200",children:"Cached files for this release are missing."}),c.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"," ",c.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."]})]})]})}),c.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[c.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:w,onChange:M=>S(M.target.value),disabled:y}),c.jsxs(ge,{type:"button",size:"sm",disabled:y||!e?.duckdbInstalled,onClick:E,children:[c.jsx(yg,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),y?"Queuing…":"Run sync"]}),c.jsxs(Zc,{label:"What does Run sync do?",children:[c.jsxs("span",{className:"block",children:["Downloads the named Common Crawl release (~16 GB) to"," ",c.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."]}),c.jsxs("span",{className:"mt-2 block text-zinc-400",children:["First time for a release: ",c.jsx("span",{className:"text-zinc-200",children:"~10–20 min download + ~5 min query"}),". Re-running the same release later: ",c.jsx("span",{className:"text-zinc-200",children:"skips download, just re-queries"})," (~5 min)."]})]})]}),!e?.duckdbInstalled&&c.jsx("p",{className:"text-xs text-zinc-600 mt-2",children:"Install DuckDB first to enable sync."})]})]}),c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Cached releases"}),c.jsxs("h2",{className:"flex items-center gap-2",children:["Local disk cache",c.jsxs(Zc,{label:"What is this?",children:[c.jsxs("span",{className:"block",children:["Raw Common Crawl dumps stored at"," ",c.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/<release>/"}),". Each release takes ~16 GB."]}),c.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 ",c.jsx("span",{className:"text-zinc-200",children:"does not delete your backlink data"})," — that lives in SQLite."]})]})]})]})}),c.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."}),c.jsx(qe,{className:"surface-card overflow-hidden",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[c.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),c.jsx("th",{className:"px-4 py-2 font-medium",children:"Sync status"}),c.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Size"}),c.jsx("th",{className:"px-4 py-2 font-medium",children:"Last used"}),c.jsx("th",{className:"px-4 py-2 font-medium sr-only",children:"Actions"})]})}),c.jsxs("tbody",{children:[o.map(M=>c.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[c.jsx("td",{className:"px-4 py-2 text-zinc-200",children:c.jsx("code",{children:M.release})}),c.jsx("td",{className:"px-4 py-2",children:M.syncStatus?c.jsx(vt,{tone:zS(M.syncStatus),children:M.syncStatus}):c.jsx("span",{className:"text-zinc-600",children:"—"})}),c.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:lke(M.bytes)}),c.jsx("td",{className:"px-4 py-2 text-zinc-400",children:Fm(M.lastUsedAt)}),c.jsx("td",{className:"px-4 py-2 text-right",children:c.jsxs("div",{className:"inline-flex items-center gap-1",children:[c.jsxs(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>O(M.release),children:[c.jsx(eL,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),"Prune"]}),c.jsx(Zc,{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)."})]})})]},M.release)),o.length===0&&c.jsx("tr",{children:c.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&&c.jsxs("section",{className:"page-section-divider",children:[c.jsx("div",{className:"section-head section-head-inline",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),c.jsx("h2",{children:"Past release syncs"})]})}),c.jsx(qe,{className:"surface-card overflow-hidden",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[c.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),c.jsx("th",{className:"px-4 py-2 font-medium",children:"Status"}),c.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Projects"}),c.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Rows"}),c.jsx("th",{className:"px-4 py-2 font-medium",children:"Finished"})]})}),c.jsx("tbody",{children:i.map(M=>c.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[c.jsx("td",{className:"px-4 py-2 text-zinc-200",children:c.jsx("code",{children:M.release})}),c.jsx("td",{className:"px-4 py-2",children:c.jsx(vt,{tone:zS(M.status),children:M.status})}),c.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:M.projectsProcessed??"—"}),c.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:M.domainsDiscovered??"—"}),c.jsx("td",{className:"px-4 py-2 text-zinc-400",children:Fm(M.queryFinishedAt??M.updatedAt)})]},M.id))})]})})]})]})}function uke(){return c.jsx("div",{className:"page-container",children:c.jsx("section",{className:"page-section",children:c.jsxs(qe,{className:"surface-card empty-card",children:[c.jsx("h1",{children:"Route not found"}),c.jsx("p",{children:"The current path does not map to a dashboard view."}),c.jsx(ge,{asChild:!0,children:c.jsx(qt,{to:"/",children:"Return to overview"})})]})})})}function dke(){return c.jsx(Wse,{children:c.jsx(Yse,{})})}const ki=mK()({component:dke,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),fke=Rr({getParentRoute:()=>ki,path:"/",component:Jse,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ar.projects.all);if(t&&t.length===0)throw Tj({to:"/setup"})}}),hke=Rr({getParentRoute:()=>ki,path:"/projects",component:dle}),Wu=Rr({getParentRoute:()=>ki,path:"/projects/$projectId",component:()=>c.jsx(Uj,{})}),pke=Rr({getParentRoute:()=>Wu,path:"/",component:()=>c.jsx(Th,{tab:"overview"})}),mke=Rr({getParentRoute:()=>Wu,path:"/search-console",component:()=>c.jsx(Th,{tab:"search-console"})}),gke=Rr({getParentRoute:()=>Wu,path:"/analytics",component:()=>c.jsx(Th,{tab:"analytics"})}),yke=Rr({getParentRoute:()=>Wu,path:"/traffic",component:()=>c.jsx(Th,{tab:"traffic"})}),vke=Rr({getParentRoute:()=>Wu,path:"/inbound",component:()=>c.jsx(Th,{tab:"inbound"})}),bke=Rr({getParentRoute:()=>ki,path:"/runs",component:JNe}),xke=Rr({getParentRoute:()=>ki,path:"/settings",component:ike,beforeLoad:({context:e})=>{}}),wke=Rr({getParentRoute:()=>ki,path:"/setup",component:oke,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ar.projects.all);if(t&&t.length>0)throw Tj({to:"/"})}}),Ske=Rr({getParentRoute:()=>ki,path:"/backlinks",component:cke}),jke=Rr({getParentRoute:()=>ki,path:"*",component:uke}),Nke=ki.addChildren([fke,hke,Wu.addChildren([pke,mke,gke,yke,vke]),bke,xke,wke,Ske,jke]);function kke(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const YD=kke(),Cke=YD==="/"?"":YD.replace(/\/$/,"");function _ke(e,t){return kK({routeTree:Nke,basepath:Cke||"/",context:{queryClient:e},...t?.initialEntries})}const R8=Y7(),Ake=_ke(R8),M8=document.getElementById("root");if(!M8)throw new Error("Expected #root element for web app bootstrap.");function Oke(){const[e,t]=b.useState(n2()?"ready":"checking"),[n,r]=b.useState(""),[i,a]=b.useState(""),[o,u]=b.useState(null),[d,f]=b.useState(!1);b.useEffect(()=>{if(n2())return;let y=!1;return GK().then(v=>{y||(v.authenticated?t("ready"):t(v.setupRequired?"setup":"login"))}).catch(v=>{y||(u(v instanceof Error?v.message:"Failed to reach the Canonry API"),t("login"))}),()=>{y=!0}},[]);const p=async y=>{if(y.preventDefault(),!n.trim()||n.trim().length<8){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 VK(n.trim())).authenticated){u("Setup failed");return}r(""),a(""),t("ready")}catch(v){u(v instanceof Ci||v instanceof Error?v.message:"Setup failed")}finally{f(!1)}},m=async y=>{if(y.preventDefault(),!!n.trim()){f(!0),u(null);try{if(!(await ZK(n.trim())).authenticated){u("Incorrect password");return}r(""),t("ready")}catch(v){u(v instanceof Ci||v instanceof Error?v.message:"Authentication failed")}finally{f(!1)}}};return e==="ready"?c.jsx(j9,{client:R8,children:c.jsx(AK,{router:Ake})}):c.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:c.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:c.jsx(qe,{className:"surface-card w-full",children:e==="checking"?c.jsx(Qm,{className:"py-8",children:c.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?c.jsxs(c.Fragment,{children:[c.jsxs(y1,{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),c.jsx(v1,{children:"Create a dashboard password"}),c.jsx(b1,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),c.jsx(Qm,{children:c.jsxs("form",{className:"space-y-4",onSubmit:p,children:[c.jsxs("label",{className:"block space-y-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),c.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:n,onChange:y=>r(y.target.value),placeholder:"At least 8 characters"})]}),c.jsxs("label",{className:"block space-y-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),c.jsx("input",{className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:y=>a(y.target.value),placeholder:"Re-enter password"})]}),o?c.jsx("p",{className:"text-sm text-rose-400",children:o}):null,c.jsx(ge,{type:"submit",disabled:d||!n.trim()||!i.trim(),children:d?"Setting up…":"Create password & open dashboard"})]})})]}):c.jsxs(c.Fragment,{children:[c.jsxs(y1,{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),c.jsx(v1,{children:"Sign in to Canonry"}),c.jsx(b1,{children:"Enter your dashboard password to continue."})]}),c.jsx(Qm,{children:c.jsxs("form",{className:"space-y-4",onSubmit:m,children:[c.jsxs("label",{className:"block space-y-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),c.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:n,onChange:y=>r(y.target.value),placeholder:"Dashboard password"})]}),o?c.jsx("p",{className:"text-sm text-rose-400",children:o}):null,c.jsx(ge,{type:"submit",disabled:d||!n.trim(),children:d?"Signing in…":"Open dashboard"})]})})]})})})})}Xq.createRoot(M8).render(c.jsx(b.StrictMode,{children:c.jsx(Oke,{})}));